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

Method testFindSolid

tests/test_cadquery.py:4164–4180  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

4162 self.assertTupleAlmostEquals(origin, (45.0, -10.0, 30.0), decimal_places)
4163
4164 def testFindSolid(self):
4165
4166 r = Workplane("XY").pushPoints([(-2, 0), (2, 0)]).box(1, 1, 1, combine=False)
4167
4168 # there should be two solids on the stack
4169 self.assertEqual(len(r.objects), 2)
4170 self.assertTrue(isinstance(r.val(), Solid))
4171
4172 # find solid should return a compound of two solids
4173 s = r.findSolid()
4174 self.assertEqual(len(s.Solids()), 2)
4175 self.assertTrue(isinstance(s, Compound))
4176
4177 # if no solids are found, should raise ValueError
4178 w = Workplane().hLine(1).close()
4179 with raises(ValueError):
4180 w.findSolid()
4181
4182 def testSlot2D(self):
4183

Callers

nothing calls this directly

Calls 8

WorkplaneClass · 0.85
boxMethod · 0.80
pushPointsMethod · 0.80
findSolidMethod · 0.80
SolidsMethod · 0.80
hLineMethod · 0.80
valMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected