(self)
| 4180 | w.findSolid() |
| 4181 | |
| 4182 | def testSlot2D(self): |
| 4183 | |
| 4184 | decimal_places = 9 |
| 4185 | |
| 4186 | # Ensure it produces a solid with the correct volume |
| 4187 | result = Workplane("XY").slot2D(4, 1, 0).extrude(1) |
| 4188 | self.assertAlmostEqual(result.val().Volume(), 3.785398163, decimal_places) |
| 4189 | |
| 4190 | # Test for proper expected behaviour when cutting |
| 4191 | box = Workplane("XY").box(5, 5, 1) |
| 4192 | result = box.faces(">Z").workplane().slot2D(4, 1, 0).cutThruAll() |
| 4193 | self.assertAlmostEqual(result.val().Volume(), 21.214601837, decimal_places) |
| 4194 | result = box.faces(">Z").workplane().slot2D(4, 1, 0).cutBlind(-0.5) |
| 4195 | self.assertAlmostEqual(result.val().Volume(), 23.107300918, decimal_places) |
| 4196 | |
| 4197 | # Test to see if slot is rotated correctly |
| 4198 | result = Workplane("XY").slot2D(4, 1, 45).extrude(1) |
| 4199 | point = result.faces(">Z").edges(">X").first().val().endPoint().toTuple() |
| 4200 | self.assertTupleAlmostEquals( |
| 4201 | point, (0.707106781, 1.414213562, 1.0), decimal_places |
| 4202 | ) |
| 4203 | |
| 4204 | def test_assembleEdges(self): |
| 4205 |
nothing calls this directly
no test coverage detected