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

Method testOccBottle

tests/test_cadquery.py:2081–2108  ·  view source on GitHub ↗

Make the OCC bottle example.

(self)

Source from the content-addressed store, hash-verified

2079 r.largestDimension()
2080
2081 def testOccBottle(self):
2082 """
2083 Make the OCC bottle example.
2084 """
2085
2086 L = 20.0
2087 w = 6.0
2088 t = 3.0
2089
2090 s = Workplane(Plane.XY())
2091 # draw half the profile of the bottle
2092 p = (
2093 s.center(-L / 2.0, 0)
2094 .vLine(w / 2.0)
2095 .threePointArc((L / 2.0, w / 2.0 + t), (L, w / 2.0))
2096 .vLine(-w / 2.0)
2097 .mirrorX()
2098 .extrude(30.0, True)
2099 )
2100
2101 # make the neck
2102 p.faces(">Z").workplane().circle(3.0).extrude(
2103 2.0, True
2104 ) # .edges().fillet(0.05)
2105
2106 # make a shell
2107 p.faces(">Z").shell(0.3)
2108 self.saveModel(p)
2109
2110 def testSplineShape(self):
2111 """

Callers

nothing calls this directly

Calls 12

centerMethod · 0.95
saveModelMethod · 0.95
WorkplaneClass · 0.85
XYMethod · 0.80
extrudeMethod · 0.80
mirrorXMethod · 0.80
vLineMethod · 0.80
threePointArcMethod · 0.80
workplaneMethod · 0.80
circleMethod · 0.45
facesMethod · 0.45
shellMethod · 0.45

Tested by

no test coverage detected