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

Method testSimpleShell

tests/test_cadquery.py:2394–2417  ·  view source on GitHub ↗

Create s simple box

(self)

Source from the content-addressed store, hash-verified

2392 self.saveModel(s)
2393
2394 def testSimpleShell(self):
2395 """
2396 Create s simple box
2397 """
2398 s1 = Workplane("XY").box(2, 2, 2).faces("+Z").shell(0.05)
2399 self.saveModel(s1)
2400 self.assertEqual(23, s1.faces().size())
2401
2402 s2 = (
2403 Workplane()
2404 .ellipse(4, 2)
2405 .extrude(4)
2406 .faces(">Z")
2407 .shell(+2, kind="intersection")
2408 )
2409 self.assertEqual(5, s2.faces().size())
2410
2411 s3 = Workplane().ellipse(4, 2).extrude(4).faces(">Z").shell(+2, kind="arc")
2412 self.assertEqual(6, s3.faces().size())
2413
2414 # test error on no solid found
2415 s4 = Workplane().hLine(1).vLine(1).close()
2416 with raises(ValueError):
2417 s4.shell(1)
2418
2419 def testClosedShell(self):
2420 """

Callers

nothing calls this directly

Calls 11

saveModelMethod · 0.95
WorkplaneClass · 0.85
boxMethod · 0.80
extrudeMethod · 0.80
vLineMethod · 0.80
hLineMethod · 0.80
shellMethod · 0.45
facesMethod · 0.45
sizeMethod · 0.45
ellipseMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected