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

Method testChainedMirror

tests/test_cadquery.py:2174–2197  ·  view source on GitHub ↗

Tests whether or not calling mirrorX().mirrorY() works correctly

(self)

Source from the content-addressed store, hash-verified

2172 self.assertEqual(18, r.edges().size())
2173
2174 def testChainedMirror(self):
2175 """
2176 Tests whether or not calling mirrorX().mirrorY() works correctly
2177 """
2178 r = 20
2179 s = 7
2180 t = 1.5
2181
2182 points = [
2183 (0, t / 2),
2184 (r / 2 - 1.5 * t, r / 2 - t),
2185 (s / 2, r / 2 - t),
2186 (s / 2, r / 2),
2187 (r / 2, r / 2),
2188 (r / 2, s / 2),
2189 (r / 2 - t, s / 2),
2190 (r / 2 - t, r / 2 - 1.5 * t),
2191 (t / 2, 0),
2192 ]
2193
2194 r = Workplane("XY").polyline(points).mirrorX().mirrorY().extrude(1).faces(">Z")
2195
2196 self.assertEqual(1, r.wires().size())
2197 self.assertEqual(32, r.edges().size())
2198
2199 # TODO: Re-work testIbeam test below now that chaining works
2200 # TODO: Add toLocalCoords and toWorldCoords tests

Callers

nothing calls this directly

Calls 9

WorkplaneClass · 0.85
extrudeMethod · 0.80
mirrorYMethod · 0.80
mirrorXMethod · 0.80
polylineMethod · 0.80
facesMethod · 0.45
sizeMethod · 0.45
wiresMethod · 0.45
edgesMethod · 0.45

Tested by

no test coverage detected