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

Method testWorkplaneCenter

tests/test_selectors.py:24–36  ·  view source on GitHub ↗

Test Moving workplane center

(self)

Source from the content-addressed store, hash-verified

22
23class TestCQSelectors(BaseTest):
24 def testWorkplaneCenter(self):
25 "Test Moving workplane center"
26 s = Workplane(Plane.XY())
27
28 # current point and world point should be equal
29 self.assertTupleAlmostEquals((0.0, 0.0, 0.0), s.plane.origin.toTuple(), 3)
30
31 # move origin and confirm center moves
32 s = s.center(-2.0, -2.0)
33
34 # current point should be 0,0, but
35
36 self.assertTupleAlmostEquals((-2.0, -2.0, 0.0), s.plane.origin.toTuple(), 3)
37
38 def testVertices(self):
39 t = makeUnitSquareWire() # square box

Callers

nothing calls this directly

Calls 5

centerMethod · 0.95
WorkplaneClass · 0.85
XYMethod · 0.80
toTupleMethod · 0.45

Tested by

no test coverage detected