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

Method test_mirror

tests/test_workplanes.py:156–162  ·  view source on GitHub ↗

Create a unit box and mirror it so that it doubles in size

(self)

Source from the content-addressed store, hash-verified

154 self.assertTupleAlmostEquals(p.yDir.toTuple(), yAxis_.toTuple(), 4)
155
156 def test_mirror(self):
157 """Create a unit box and mirror it so that it doubles in size"""
158 b2 = Workplane().box(1, 1, 1)
159 b2 = b2.mirror("XY", (0, 0, 0.5), union=True)
160 bbBox = b2.findSolid().BoundingBox()
161 assert [bbBox.xlen, bbBox.ylen, bbBox.zlen] == [1.0, 1.0, 2]
162 self.assertAlmostEqual(b2.findSolid().Volume(), 2, 5)
163
164 def test_all_planes(self):
165 b2 = Workplane().box(1, 1, 1)

Callers

nothing calls this directly

Calls 6

WorkplaneClass · 0.85
boxMethod · 0.80
findSolidMethod · 0.80
VolumeMethod · 0.80
mirrorMethod · 0.45
BoundingBoxMethod · 0.45

Tested by

no test coverage detected