diff --git a/src/build123d/objects_sketch.py b/src/build123d/objects_sketch.py index f603147..1b1a6cc 100644 --- a/src/build123d/objects_sketch.py +++ b/src/build123d/objects_sketch.py @@ -544,16 +544,16 @@ class Text(BaseSketchObject): "Arial Black". Alternatively, a specific font file can be specified with font_path. Note: Windows 10+ users must "Install for all users" for fonts to be found by name. - - Not all fonts have every FontStyle available, however ITALIC and BOLDITALIC will - still italicize the font if the respective font file is not available. - text_align specifies alignment of text inside the bounding box, while align the + Not all fonts have every FontStyle available, however ITALIC and BOLDITALIC will + still italicize the font if the respective font file is not available. + + text_align specifies alignment of text inside the bounding box, while align the aligns the bounding box itself. - Optionally, the Text can be positioned on a non-linear edge or wire with a path and + Optionally, the Text can be positioned on a non-linear edge or wire with a path and position_on_path. - + Args: txt (str): text to render font_size (float): size of the font in model units @@ -564,10 +564,10 @@ class Text(BaseSketchObject): text_align (tuple[TextAlign, TextAlign], optional): horizontal text align LEFT, CENTER, or RIGHT. Vertical text align BOTTOM, CENTER, TOP, or TOPFIRSTLINE. Defaults to (TextAlign.CENTER, TextAlign.CENTER) - align (Align | tuple[Align, Align], optional): align MIN, CENTER, or MAX of + align (Align | tuple[Align, Align], optional): align MIN, CENTER, or MAX of object. Defaults to None path (Edge | Wire, optional): path for text to follow. Defaults to None - position_on_path (float, optional): the relative location on path to position + 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 rotation (float, optional): angle to rotate object. Defaults to 0 mode (Mode, optional): combination mode. Defaults to Mode.ADD @@ -782,9 +782,12 @@ class Triangle(BaseSketchObject): self.vertex_A = topo_explore_common_vertex( self.edge_b, self.edge_c ) #: vertex 'A' + self.vertex_A.topo_parent = self self.vertex_B = topo_explore_common_vertex( self.edge_a, self.edge_c ) #: vertex 'B' + self.vertex_B.topo_parent = self self.vertex_C = topo_explore_common_vertex( self.edge_a, self.edge_b ) #: vertex 'C' + self.vertex_C.topo_parent = self diff --git a/tests/test_build_sketch.py b/tests/test_build_sketch.py index d57fbf7..52a6194 100644 --- a/tests/test_build_sketch.py +++ b/tests/test_build_sketch.py @@ -419,6 +419,9 @@ class TestBuildSketchObjects(unittest.TestCase): self.assertTupleAlmostEquals(tri.vertex_A, (3, 4, 0), 5) self.assertTupleAlmostEquals(tri.vertex_B, (0, 0, 0), 5) self.assertTupleAlmostEquals(tri.vertex_C, (3, 0, 0), 5) + self.assertEqual(tri.vertex_A.topo_parent, tri) + self.assertEqual(tri.vertex_B.topo_parent, tri) + self.assertEqual(tri.vertex_C.topo_parent, tri) tri = Triangle(c=5, C=90, a=3) self.assertAlmostEqual(tri.area, (3 * 4) / 2, 5)