mirror of
https://github.com/gumyr/build123d.git
synced 2025-12-06 02:30:55 -08:00
Replaced text Halign/Valign with Align
This commit is contained in:
parent
2f38545f76
commit
d36b120206
14 changed files with 65 additions and 115 deletions
|
|
@ -21,7 +21,6 @@ Enums
|
|||
.. autoclass:: Align
|
||||
.. autoclass:: FontStyle
|
||||
.. autoclass:: GeomType
|
||||
.. autoclass:: Halign
|
||||
.. autoclass:: Keep
|
||||
.. autoclass:: Kind
|
||||
.. autoclass:: Mode
|
||||
|
|
@ -29,7 +28,6 @@ Enums
|
|||
.. autoclass:: SortBy
|
||||
.. autoclass:: Transition
|
||||
.. autoclass:: Until
|
||||
.. autoclass:: Valign
|
||||
|
||||
**********
|
||||
Workplanes
|
||||
|
|
|
|||
|
|
@ -200,8 +200,6 @@ Cheat Sheet
|
|||
+----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :class:`~build_enums.GeomType` | BEZIER, BSPLINE, CIRCLE, CONE, CYLINDER, ELLIPSE, EXTRUSION, HYPERBOLA, LINE, OFFSET, OTHER, PARABOLA, PLANE, REVOLUTION, SPHERE, TORUS |
|
||||
+----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :class:`~build_enums.Halign` | CENTER, LEFT, RIGHT |
|
||||
+----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :class:`~build_enums.Keep` | TOP, BOTTOM, BOTH |
|
||||
+----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :class:`~build_enums.Kind` | ARC, INTERSECTION, TANGENT |
|
||||
|
|
@ -216,5 +214,3 @@ Cheat Sheet
|
|||
+----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :class:`~build_enums.Until` | NEXT, LAST |
|
||||
+----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :class:`~build_enums.Valign` | CENTER, TOP, BOTTOM |
|
||||
+----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------+
|
||||
|
|
|
|||
|
|
@ -796,10 +796,10 @@ with BuildPart() as ex34:
|
|||
Box(length, width, thickness)
|
||||
topf = ex34.faces().sort_by(Axis.Z)[-1]
|
||||
with BuildSketch(topf) as ex34_sk:
|
||||
Text("Hello", fontsize=fontsz, halign=Halign.CENTER, valign=Valign.BOTTOM)
|
||||
Text("Hello", fontsize=fontsz, align=(Align.CENTER, Align.MIN))
|
||||
Extrude(amount=fontht)
|
||||
with BuildSketch(topf) as ex34_sk2:
|
||||
Text("World", fontsize=fontsz, halign=Halign.CENTER, valign=Valign.TOP)
|
||||
Text("World", fontsize=fontsz, align=(Align.CENTER, Align.MAX))
|
||||
Extrude(amount=-fontht, mode=Mode.SUBTRACT)
|
||||
# [Ex. 34]
|
||||
|
||||
|
|
|
|||
|
|
@ -27,17 +27,22 @@ license:
|
|||
from build123d import *
|
||||
|
||||
with BuildSketch() as logo_text:
|
||||
Text("123d", fontsize=10, valign=Valign.BOTTOM)
|
||||
Text("123d", fontsize=10, align=(Align.MIN, Align.MIN))
|
||||
font_height = logo_text.vertices().sort_by(Axis.Y)[-1].Y
|
||||
|
||||
with BuildSketch() as build_text:
|
||||
Text("build", fontsize=5, halign=Halign.CENTER)
|
||||
Text("build", fontsize=5, align=(Align.CENTER, Align.CENTER))
|
||||
build_bb = BoundingBox(build_text.sketch, mode=Mode.PRIVATE)
|
||||
build_vertices = build_bb.vertices().sort_by(Axis.X)
|
||||
build_width = build_vertices[-1].X - build_vertices[0].X
|
||||
|
||||
with BuildSketch() as cust_text:
|
||||
Text("customizable", fontsize=2.9, halign=Halign.CENTER, font_style=FontStyle.BOLD)
|
||||
Text(
|
||||
"customizable",
|
||||
fontsize=2.9,
|
||||
align=(Align.CENTER, Align.CENTER),
|
||||
font_style=FontStyle.BOLD,
|
||||
)
|
||||
cust_bb = BoundingBox(cust_text.sketch, mode=Mode.PRIVATE)
|
||||
cust_vertices = cust_text.vertices().sort_by(Axis.X)
|
||||
cust_width = cust_vertices[-1].X - cust_vertices[0].X
|
||||
|
|
@ -48,12 +53,12 @@ with BuildLine() as one:
|
|||
|
||||
with BuildSketch() as two:
|
||||
with Locations((font_height * 0.35, 0)):
|
||||
Text("2", fontsize=10, valign=Valign.BOTTOM)
|
||||
Text("2", fontsize=10, align=(Align.MIN, Align.MIN))
|
||||
|
||||
with BuildPart() as three_d:
|
||||
with Locations((font_height * 1.1, 0)):
|
||||
with BuildSketch():
|
||||
Text("3d", fontsize=10, valign=Valign.BOTTOM)
|
||||
Text("3d", fontsize=10, align=(Align.MIN, Align.MIN))
|
||||
Extrude(amount=font_height * 0.3)
|
||||
logo_width = three_d.vertices().sort_by(Axis.X)[-1].X
|
||||
|
||||
|
|
|
|||
|
|
@ -27,11 +27,11 @@ license:
|
|||
from build123d import *
|
||||
|
||||
with BuildSketch() as logo_text:
|
||||
Text("123d", fontsize=10, valign=Valign.BOTTOM)
|
||||
Text("123d", fontsize=10, align=(Align.MIN, Align.MIN))
|
||||
font_height = logo_text.vertices().sort_by(Axis.Y)[-1].Y
|
||||
|
||||
with BuildSketch() as build_text:
|
||||
Text("build", fontsize=5, halign=Halign.CENTER)
|
||||
Text("build", fontsize=5, align=(Align.CENTER, Align.CENTER))
|
||||
build_bb = BoundingBox(build_text.sketch, mode=Mode.PRIVATE)
|
||||
build_vertices = build_bb.vertices().sort_by(Axis.X)
|
||||
build_width = build_vertices[-1].X - build_vertices[0].X
|
||||
|
|
@ -42,12 +42,12 @@ with BuildLine() as one:
|
|||
|
||||
with BuildSketch() as two:
|
||||
with Locations((font_height * 0.35, 0)):
|
||||
Text("2", fontsize=10, valign=Valign.BOTTOM)
|
||||
Text("2", fontsize=10, align=(Align.MIN, Align.MIN))
|
||||
|
||||
with BuildPart() as three_d:
|
||||
with Locations((font_height * 1.1, 0)):
|
||||
with BuildSketch():
|
||||
Text("3d", fontsize=10, valign=Valign.BOTTOM)
|
||||
Text("3d", fontsize=10, align=(Align.MIN, Align.MIN))
|
||||
Extrude(amount=font_height * 0.3)
|
||||
logo_width = three_d.vertices().sort_by(Axis.X)[-1].X
|
||||
|
||||
|
|
|
|||
|
|
@ -48,7 +48,6 @@ with BuildSketch() as clock_face:
|
|||
str(hour),
|
||||
fontsize=clock_radius * 0.175,
|
||||
font_style=FontStyle.BOLD,
|
||||
halign=Halign.CENTER,
|
||||
mode=Mode.SUBTRACT,
|
||||
)
|
||||
|
||||
|
|
|
|||
|
|
@ -30,13 +30,13 @@ from build123d import *
|
|||
# Extrude pending face by amount
|
||||
with BuildPart() as simple:
|
||||
with BuildSketch():
|
||||
Text("O", fontsize=10, halign=Halign.CENTER, valign=Valign.CENTER)
|
||||
Text("O", fontsize=10)
|
||||
Extrude(amount=5)
|
||||
|
||||
# Extrude pending face in both directions by amount
|
||||
with BuildPart() as both:
|
||||
with BuildSketch():
|
||||
Text("O", fontsize=10, halign=Halign.CENTER, valign=Valign.CENTER)
|
||||
Text("O", fontsize=10)
|
||||
Extrude(amount=5, both=True)
|
||||
|
||||
# Extrude multiple pending faces on multiple faces
|
||||
|
|
@ -45,7 +45,7 @@ with BuildPart() as multiple:
|
|||
with Workplanes(*multiple.faces()):
|
||||
with GridLocations(5, 5, 2, 2):
|
||||
with BuildSketch():
|
||||
Text("Ω", fontsize=3, halign=Halign.CENTER, valign=Valign.CENTER)
|
||||
Text("Ω", fontsize=3)
|
||||
Extrude(amount=1)
|
||||
|
||||
# Non-planar surface
|
||||
|
|
|
|||
|
|
@ -20,8 +20,6 @@ __all__ = [
|
|||
"Mode",
|
||||
"Transition",
|
||||
"FontStyle",
|
||||
"Halign",
|
||||
"Valign",
|
||||
"Until",
|
||||
"SortBy",
|
||||
"GeomType",
|
||||
|
|
|
|||
|
|
@ -41,8 +41,6 @@ from build123d.build_enums import (
|
|||
Mode,
|
||||
Transition,
|
||||
FontStyle,
|
||||
Halign,
|
||||
Valign,
|
||||
Until,
|
||||
SortBy,
|
||||
GeomType,
|
||||
|
|
|
|||
|
|
@ -107,28 +107,6 @@ class FontStyle(Enum):
|
|||
return f"<{self.__class__.__name__}.{self.name}>"
|
||||
|
||||
|
||||
class Halign(Enum):
|
||||
"""Text Horizontal Alignment"""
|
||||
|
||||
CENTER = auto()
|
||||
LEFT = auto()
|
||||
RIGHT = auto()
|
||||
|
||||
def __repr__(self):
|
||||
return f"<{self.__class__.__name__}.{self.name}>"
|
||||
|
||||
|
||||
class Valign(Enum):
|
||||
"""Text Vertical Alignment"""
|
||||
|
||||
CENTER = auto()
|
||||
TOP = auto()
|
||||
BOTTOM = auto()
|
||||
|
||||
def __repr__(self):
|
||||
return f"<{self.__class__.__name__}.{self.name}>"
|
||||
|
||||
|
||||
class Until(Enum):
|
||||
"""Extrude limit"""
|
||||
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ import inspect
|
|||
from math import pi, sin, cos, tan, radians
|
||||
from typing import Union
|
||||
from build123d.hull import find_hull
|
||||
from build123d.build_enums import Align, CenterOf, FontStyle, Halign, Mode, Valign
|
||||
from build123d.build_enums import Align, CenterOf, FontStyle, Mode
|
||||
from build123d.direct_api import (
|
||||
Edge,
|
||||
Wire,
|
||||
|
|
@ -722,7 +722,7 @@ class SlotOverall(BaseSketchObject):
|
|||
super().__init__(face, rotation, None, mode)
|
||||
|
||||
|
||||
class Text(Compound):
|
||||
class Text(BaseSketchObject):
|
||||
"""Sketch Object: Text
|
||||
|
||||
Add text(s) to the sketch.
|
||||
|
|
@ -733,8 +733,8 @@ class Text(Compound):
|
|||
font (str, optional): font name. Defaults to "Arial".
|
||||
font_path (str, optional): system path to font library. Defaults to None.
|
||||
font_style (Font_Style, optional): style. Defaults to Font_Style.REGULAR.
|
||||
halign (Halign, optional): horizontal alignment. Defaults to Halign.LEFT.
|
||||
valign (Valign, optional): vertical alignment. Defaults to Valign.CENTER.
|
||||
align (tuple[Align, Align], optional): align min, center, or max of object.
|
||||
Defaults to (Align.CENTER, Align.CENTER).
|
||||
path (Union[Edge, Wire], optional): path for text to follow. Defaults to None.
|
||||
position_on_path (float, optional): the relative location on path to position the
|
||||
text, values must be between 0.0 and 1.0. Defaults to 0.0.
|
||||
|
|
@ -751,8 +751,7 @@ class Text(Compound):
|
|||
font: str = "Arial",
|
||||
font_path: str = None,
|
||||
font_style: FontStyle = FontStyle.REGULAR,
|
||||
halign: Halign = Halign.LEFT,
|
||||
valign: Valign = Valign.CENTER,
|
||||
align: tuple[Align, Align] = (Align.CENTER, Align.CENTER),
|
||||
path: Union[Edge, Wire] = None,
|
||||
position_on_path: float = 0.0,
|
||||
rotation: float = 0,
|
||||
|
|
@ -767,8 +766,7 @@ class Text(Compound):
|
|||
self.font = font
|
||||
self.font_path = font_path
|
||||
self.font_style = font_style
|
||||
self.halign = halign
|
||||
self.valign = valign
|
||||
self.align = align
|
||||
self.text_path = path
|
||||
self.position_on_path = position_on_path
|
||||
self.rotation = rotation
|
||||
|
|
@ -780,19 +778,11 @@ class Text(Compound):
|
|||
font=font,
|
||||
font_path=font_path,
|
||||
font_style=font_style,
|
||||
halign=halign,
|
||||
valign=valign,
|
||||
align=align,
|
||||
position_on_path=position_on_path,
|
||||
text_path=path,
|
||||
).rotate(Axis.Z, rotation)
|
||||
new_compounds = [
|
||||
text_string.moved(location)
|
||||
for location in LocationList._get_context().local_locations
|
||||
]
|
||||
new_faces = [face for compound in new_compounds for face in compound]
|
||||
for face in new_faces:
|
||||
context._add_to_context(face, mode=mode)
|
||||
super().__init__(Compound.make_compound(new_faces).wrapped)
|
||||
)
|
||||
super().__init__(text_string, rotation, None, mode)
|
||||
|
||||
|
||||
class Trapezoid(BaseSketchObject):
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@ from typing_extensions import Literal
|
|||
from vtkmodules.vtkCommonDataModel import vtkPolyData
|
||||
from vtkmodules.vtkFiltersCore import vtkPolyDataNormals, vtkTriangleFilter
|
||||
|
||||
from build123d.build_enums import Until
|
||||
from build123d.build_enums import Align, Until
|
||||
|
||||
import OCP.GeomAbs as ga # Geometry type enum
|
||||
import OCP.IFSelect
|
||||
|
|
@ -262,12 +262,10 @@ from build123d.build_enums import (
|
|||
FontStyle,
|
||||
FrameMethod,
|
||||
GeomType,
|
||||
Halign,
|
||||
Kind,
|
||||
PositionMode,
|
||||
SortBy,
|
||||
Transition,
|
||||
Valign,
|
||||
)
|
||||
|
||||
# Create a build123d logger to distinguish these logs from application logs.
|
||||
|
|
@ -3489,7 +3487,7 @@ class Shape(NodeMixin):
|
|||
font: str = "Arial",
|
||||
font_path: str = None,
|
||||
kind: FontStyle = FontStyle.REGULAR,
|
||||
valign: Valign = Valign.CENTER,
|
||||
valign: Align = Align.CENTER,
|
||||
start: float = 0,
|
||||
) -> Compound:
|
||||
"""Projected 3D text following the given path on Shape
|
||||
|
|
@ -3512,7 +3510,7 @@ class Shape(NodeMixin):
|
|||
font: Font name. Defaults to "Arial".
|
||||
font_path: Path to font file. Defaults to None.
|
||||
kind: Font type. Defaults to FontStyle.REGULAR.
|
||||
valign: Vertical Alignment. Defaults to Valign.CENTER.
|
||||
valign: Vertical Alignment. Defaults to Align.CENTER.
|
||||
start: Relative location on path to start the text. Defaults to 0.
|
||||
|
||||
Returns:
|
||||
|
|
@ -3525,7 +3523,7 @@ class Shape(NodeMixin):
|
|||
|
||||
# Create text faces
|
||||
text_faces = Compound.make_2d_text(
|
||||
txt, fontsize, font, font_path, kind, Halign.LEFT, valign, start
|
||||
txt, fontsize, font, font_path, kind, (Align.MIN, valign), start
|
||||
).faces()
|
||||
|
||||
logger.debug("projecting text sting '%s' as %d face(s)", txt, len(text_faces))
|
||||
|
|
@ -4515,8 +4513,7 @@ class Compound(Shape, Mixin3D):
|
|||
font: str = "Arial",
|
||||
font_path: str = None,
|
||||
kind: FontStyle = FontStyle.REGULAR,
|
||||
halign: Halign = Halign.CENTER,
|
||||
valign: Valign = Valign.CENTER,
|
||||
align: tuple[Align, Align] = (Align.CENTER, Align.CENTER),
|
||||
position: Plane = Plane.XY,
|
||||
) -> Compound:
|
||||
"""3D text
|
||||
|
|
@ -4530,15 +4527,15 @@ class Compound(Shape, Mixin3D):
|
|||
font (str, optional): font type. Defaults to "Arial".
|
||||
font_path (str, optional): system path to fonts. Defaults to None.
|
||||
kind (FontStyle, optional): font style. Defaults to FontStyle.REGULAR.
|
||||
halign (Halign, optional): horizontal alignment. Defaults to Halign.CENTER.
|
||||
valign (Valign, optional): vertical alignment. Defaults to Valign.CENTER.
|
||||
align (tuple[Align, Align], optional): align min, center, or max of object.
|
||||
Defaults to (Align.CENTER, Align.CENTER).
|
||||
position (Plane, optional): plane to position text. Defaults to Plane.XY.
|
||||
|
||||
Returns:
|
||||
Compound: 3d text
|
||||
"""
|
||||
text_flat = Compound.make_2d_text(
|
||||
text, size, font, font_path, kind, halign, valign, None
|
||||
text, size, font, font_path, kind, align, None
|
||||
)
|
||||
|
||||
vec_normal = text_flat.faces()[0].normal_at() * height
|
||||
|
|
@ -4556,8 +4553,7 @@ class Compound(Shape, Mixin3D):
|
|||
font: str = "Arial",
|
||||
font_path: Optional[str] = None,
|
||||
font_style: FontStyle = FontStyle.REGULAR,
|
||||
halign: Halign = Halign.LEFT,
|
||||
valign: Valign = Valign.CENTER,
|
||||
align: tuple[Align, Align] = (Align.CENTER, Align.CENTER),
|
||||
position_on_path: float = 0.0,
|
||||
text_path: Union[Edge, Wire] = None,
|
||||
) -> "Compound":
|
||||
|
|
@ -4574,8 +4570,8 @@ class Compound(Shape, Mixin3D):
|
|||
font: font name
|
||||
font_path: path to font file
|
||||
font_style: text style. Defaults to FontStyle.REGULAR.
|
||||
halign: horizontal alignment. Defaults to Halign.LEFT.
|
||||
valign: vertical alignment. Defaults to Valign.CENTER.
|
||||
align (tuple[Align, Align], optional): align min, center, or max of object.
|
||||
Defaults to (Align.CENTER, Align.CENTER).
|
||||
position_on_path: the relative location on path to position the text,
|
||||
between 0.0 and 1.0. Defaults to 0.0.
|
||||
text_path: a path for the text to follows. Defaults to None - linear text.
|
||||
|
|
@ -4643,21 +4639,17 @@ class Compound(Shape, Mixin3D):
|
|||
)
|
||||
text_flat = Compound(builder.Perform(font_i, NCollection_Utf8String(txt)))
|
||||
|
||||
bounding_box = text_flat.bounding_box()
|
||||
|
||||
center_alignment = Vector()
|
||||
|
||||
if halign == Halign.CENTER:
|
||||
center_alignment.X = -bounding_box.xlen / 2
|
||||
elif halign == Halign.RIGHT:
|
||||
center_alignment.X = -bounding_box.xlen
|
||||
|
||||
if valign == Valign.CENTER:
|
||||
center_alignment.Y = -bounding_box.ylen / 2
|
||||
elif valign == Valign.TOP:
|
||||
center_alignment.Y = -bounding_box.ylen
|
||||
|
||||
text_flat = text_flat.translate(center_alignment)
|
||||
# Align the text from the bounding box
|
||||
bbox = text_flat.bounding_box()
|
||||
align_offset = []
|
||||
for i in range(2):
|
||||
if align[i] == Align.MIN:
|
||||
align_offset.append(-bbox.mins[i])
|
||||
elif align[i] == Align.CENTER:
|
||||
align_offset.append(-(bbox.mins[i] + bbox.maxs[i]) / 2)
|
||||
elif align[i] == Align.MAX:
|
||||
align_offset.append(-bbox.maxs[i])
|
||||
text_flat = text_flat.translate(Vector(*align_offset))
|
||||
|
||||
if text_path is not None:
|
||||
path_length = text_path.length
|
||||
|
|
@ -7302,14 +7294,14 @@ class SVG:
|
|||
arrow = arrow_arc.fuse(arrow_arc.copy().mirror(Plane.XZ))
|
||||
x_label = (
|
||||
Compound.make_2d_text(
|
||||
"X", fontsize=axes_scale / 4, halign=Halign.LEFT, valign=Valign.CENTER
|
||||
"X", fontsize=axes_scale / 4, align=(Align.MIN, Align.CENTER)
|
||||
)
|
||||
.move(Location(x_axis @ 1))
|
||||
.edges()
|
||||
)
|
||||
y_label = (
|
||||
Compound.make_2d_text(
|
||||
"Y", fontsize=axes_scale / 4, halign=Halign.LEFT, valign=Valign.CENTER
|
||||
"Y", fontsize=axes_scale / 4, align=(Align.MIN, Align.CENTER)
|
||||
)
|
||||
.rotate(Axis.Z, 90)
|
||||
.move(Location(y_axis @ 1))
|
||||
|
|
@ -7317,10 +7309,7 @@ class SVG:
|
|||
)
|
||||
z_label = (
|
||||
Compound.make_2d_text(
|
||||
"Z",
|
||||
fontsize=axes_scale / 4,
|
||||
halign=Halign.CENTER,
|
||||
valign=Valign.BOTTOM,
|
||||
"Z", fontsize=axes_scale / 4, align=(Align.CENTER, Align.MIN)
|
||||
)
|
||||
.rotate(Axis.Y, 90)
|
||||
.rotate(Axis.X, 90)
|
||||
|
|
@ -8052,15 +8041,15 @@ class BallJoint(Joint):
|
|||
circle_x,
|
||||
circle_y,
|
||||
circle_z,
|
||||
Compound.make_2d_text("X", radius / 5, halign=Halign.CENTER).locate(
|
||||
circle_x.location_at(0.125) * Rotation(90, 0, 0)
|
||||
),
|
||||
Compound.make_2d_text("Y", radius / 5, halign=Halign.CENTER).locate(
|
||||
circle_y.location_at(0.625) * Rotation(90, 0, 0)
|
||||
),
|
||||
Compound.make_2d_text("Z", radius / 5, halign=Halign.CENTER).locate(
|
||||
circle_z.location_at(0.125) * Rotation(90, 0, 0)
|
||||
),
|
||||
Compound.make_2d_text(
|
||||
"X", radius / 5, align=(Align.CENTER, Align.CENTER)
|
||||
).locate(circle_x.location_at(0.125) * Rotation(90, 0, 0)),
|
||||
Compound.make_2d_text(
|
||||
"Y", radius / 5, align=(Align.CENTER, Align.CENTER)
|
||||
).locate(circle_y.location_at(0.625) * Rotation(90, 0, 0)),
|
||||
Compound.make_2d_text(
|
||||
"Z", radius / 5, align=(Align.CENTER, Align.CENTER)
|
||||
).locate(circle_z.location_at(0.125) * Rotation(90, 0, 0)),
|
||||
]
|
||||
).move(self.parent.location * self.relative_location)
|
||||
|
||||
|
|
|
|||
|
|
@ -230,8 +230,7 @@ class BuildSketchObjects(unittest.TestCase):
|
|||
self.assertEqual(t.font, "Arial")
|
||||
self.assertIsNone(t.font_path)
|
||||
self.assertEqual(t.font_style, FontStyle.REGULAR)
|
||||
self.assertEqual(t.halign, Halign.LEFT)
|
||||
self.assertEqual(t.valign, Valign.CENTER)
|
||||
self.assertEqual(t.align, (Align.CENTER, Align.CENTER))
|
||||
self.assertIsNone(t.text_path)
|
||||
self.assertEqual(t.position_on_path, 0)
|
||||
self.assertEqual(t.rotation, 0)
|
||||
|
|
|
|||
|
|
@ -427,7 +427,7 @@ class TestCompound(unittest.TestCase):
|
|||
text = Compound.make_2d_text("test", 10, text_path=arc)
|
||||
self.assertEqual(len(text.faces()), 4)
|
||||
text = Compound.make_2d_text(
|
||||
"test", 10, halign=Halign.RIGHT, valign=Valign.TOP, text_path=arc
|
||||
"test", 10, align=(Align.MAX,Align.MAX), text_path=arc
|
||||
)
|
||||
self.assertEqual(len(text.faces()), 4)
|
||||
|
||||
|
|
@ -1274,7 +1274,7 @@ class ProjectionTests(unittest.TestCase):
|
|||
sphere = Solid.make_sphere(50)
|
||||
projection_direction = Vector(0, -1, 0)
|
||||
planar_text_faces = (
|
||||
Compound.make_2d_text("Flat", 30, halign=Halign.CENTER)
|
||||
Compound.make_2d_text("Flat", 30, align=(Align.CENTER, Align.CENTER))
|
||||
.rotate(Axis.X, 90)
|
||||
.faces()
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue