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

Method testYZPlaneOrigins

tests/test_workplanes.py:19–30  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

17
18class TestWorkplanes(BaseTest):
19 def testYZPlaneOrigins(self):
20 # xy plane-- with origin at x=0.25
21 base = Vector(0.25, 0, 0)
22 p = Plane(base, Vector(0, 1, 0), Vector(1, 0, 0))
23
24 # origin is always (0,0,0) in local coordinates
25 self.assertTupleAlmostEquals((0, 0, 0), p.toLocalCoords(p.origin).toTuple(), 2)
26
27 # (0,0,0) is always the original base in global coordinates
28 self.assertTupleAlmostEquals(
29 base.toTuple(), p.toWorldCoords((0, 0)).toTuple(), 2
30 )
31
32 def testXYPlaneOrigins(self):
33 base = Vector(0, 0, 0.25)

Callers

nothing calls this directly

Calls 6

toTupleMethod · 0.95
toLocalCoordsMethod · 0.95
toWorldCoordsMethod · 0.95
VectorClass · 0.85
PlaneClass · 0.85

Tested by

no test coverage detected