| 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 | |