Tests a model that uses more than one workplane
(self)
| 1667 | self.assertEqual(10, r.faces().size()) |
| 1668 | |
| 1669 | def testTwoWorkplanes(self): |
| 1670 | """ |
| 1671 | Tests a model that uses more than one workplane |
| 1672 | """ |
| 1673 | # base block |
| 1674 | s = Workplane(Plane.XY()) |
| 1675 | |
| 1676 | # TODO: this syntax is nice, but the iteration might not be worth |
| 1677 | # the complexity. |
| 1678 | # the simpler and slightly longer version would be: |
| 1679 | # r = s.rect(2.0,2.0).rect(1.3,1.3,forConstruction=True).vertices() |
| 1680 | # for c in r.all(): |
| 1681 | # c.circle(0.125).extrude(0.5,True) |
| 1682 | r = ( |
| 1683 | s.rect(2.0, 2.0) |
| 1684 | .rect(1.3, 1.3, forConstruction=True) |
| 1685 | .vertices() |
| 1686 | .circle(0.125) |
| 1687 | .extrude(0.5) |
| 1688 | ) |
| 1689 | |
| 1690 | # side hole, blind deep 1.9 |
| 1691 | t = r.faces(">Y").workplane().circle(0.125).cutBlind(-1.9) |
| 1692 | self.saveModel(t) |
| 1693 | self.assertEqual(12, t.faces().size()) |
| 1694 | |
| 1695 | def testCut(self): |
| 1696 | """ |