MCPcopy
hub / github.com/CadQuery/cadquery / testTextAlignment

Method testTextAlignment

tests/test_cadquery.py:3937–3957  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

3935 )
3936
3937 def testTextAlignment(self):
3938 left_bottom = Workplane().text(
3939 "I", 10, 0, halign="left", valign="bottom", fontPath=testFont,
3940 )
3941 lb_bb = left_bottom.val().BoundingBox()
3942 self.assertGreaterEqual(lb_bb.xmin, 0)
3943 self.assertGreaterEqual(lb_bb.ymin, 0)
3944
3945 centers = Workplane().text(
3946 "I", 10, 0, halign="center", valign="center", fontPath=testFont,
3947 )
3948 c_bb = centers.val().BoundingBox()
3949 self.assertAlmostEqual(c_bb.center.x, 0, places=0)
3950 self.assertAlmostEqual(c_bb.center.y, 0, places=0)
3951
3952 right_top = Workplane().text(
3953 "I", 10, 0, halign="right", valign="top", fontPath=testFont,
3954 )
3955 rt_bb = right_top.val().BoundingBox()
3956 self.assertLessEqual(rt_bb.xmax, 0)
3957 self.assertLessEqual(rt_bb.ymax, 0)
3958
3959 def testParametricCurve(self):
3960

Callers

nothing calls this directly

Calls 4

WorkplaneClass · 0.85
textMethod · 0.80
BoundingBoxMethod · 0.45
valMethod · 0.45

Tested by

no test coverage detected