MCPcopy Index your code
hub / github.com/CadQuery/cadquery / testSplitKeepingBottom

Method testSplitKeepingBottom

tests/test_cadquery.py:2360–2374  ·  view source on GitHub ↗

Tests splitting a solid improperly

(self)

Source from the content-addressed store, hash-verified

2358 self.assertEqual(8, result.solids().item(1).faces().size())
2359
2360 def testSplitKeepingBottom(self):
2361 """
2362 Tests splitting a solid improperly
2363 """
2364 # Drill a hole in the side
2365 c = CQ(makeUnitCube()).faces(">Z").workplane().circle(0.25).cutThruAll()
2366 self.assertEqual(7, c.faces().size())
2367
2368 # Now cut it in half sideways
2369 result = c.faces(">Y").workplane(-0.5).split(keepTop=False, keepBottom=True)
2370
2371 # stack will have both halves, original will be unchanged
2372 # one solid is on the stack
2373 self.assertEqual(1, result.solids().size())
2374 self.assertEqual(8, result.solids().item(0).faces().size())
2375
2376 def testSplitError(self):
2377 # Test split produces the correct error when called with no solid to split.

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