Create a triangle and mirror into a unit box
(self)
| 235 | ) |
| 236 | |
| 237 | def test_mirror_face(self): |
| 238 | """Create a triangle and mirror into a unit box""" |
| 239 | r = Workplane("XY").line(0, 1).line(1, -1).close().extrude(1) |
| 240 | |
| 241 | bbBox = r.findSolid().BoundingBox() |
| 242 | self.assertTupleAlmostEquals( |
| 243 | (bbBox.xlen, bbBox.ylen, bbBox.zlen), (1.0, 1.0, 1.0), 4 |
| 244 | ) |
| 245 | self.assertAlmostEqual(r.findSolid().Volume(), 0.5, 5) |
| 246 | |
| 247 | r = r.mirror(r.faces().objects[1], union=True) |
| 248 | bbBox = r.findSolid().BoundingBox() |
| 249 | self.assertTupleAlmostEquals( |
| 250 | (bbBox.xlen, bbBox.ylen, bbBox.zlen), (1.0, 1.0, 1.0), 4 |
| 251 | ) |
| 252 | self.assertAlmostEqual(r.findSolid().Volume(), 1.0, 5) |
| 253 | |
| 254 | def test_bezier_curve(self): |
| 255 | # Quadratic bezier |
nothing calls this directly
no test coverage detected