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

Method testTwoWorkplanes

tests/test_cadquery.py:1669–1693  ·  view source on GitHub ↗

Tests a model that uses more than one workplane

(self)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 11

rectMethod · 0.95
saveModelMethod · 0.95
WorkplaneClass · 0.85
XYMethod · 0.80
extrudeMethod · 0.80
cutBlindMethod · 0.80
workplaneMethod · 0.80
circleMethod · 0.45
verticesMethod · 0.45
facesMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected