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

Method testSplitKeepingBoth

tests/test_cadquery.py:2342–2358  ·  view source on GitHub ↗

Tests splitting a solid

(self)

Source from the content-addressed store, hash-verified

2340 self.assertEqual(8, result.faces().size())
2341
2342 def testSplitKeepingBoth(self):
2343 """
2344 Tests splitting a solid
2345 """
2346
2347 # drill a hole in the side
2348 c = CQ(makeUnitCube()).faces(">Z").workplane().circle(0.25).cutThruAll()
2349 self.assertEqual(7, c.faces().size())
2350
2351 # now cut it in half sideways
2352 result = c.faces(">Y").workplane(-0.5).split(keepTop=True, keepBottom=True)
2353
2354 # stack will have both halves, original will be unchanged
2355 # two solids are on the stack, eac
2356 self.assertEqual(2, result.solids().size())
2357 self.assertEqual(8, result.solids().item(0).faces().size())
2358 self.assertEqual(8, result.solids().item(1).faces().size())
2359
2360 def testSplitKeepingBottom(self):
2361 """

Callers

nothing calls this directly

Calls 9

makeUnitCubeFunction · 0.90
cutThruAllMethod · 0.80
workplaneMethod · 0.80
itemMethod · 0.80
circleMethod · 0.45
facesMethod · 0.45
sizeMethod · 0.45
splitMethod · 0.45
solidsMethod · 0.45

Tested by

no test coverage detected