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

Method _makePolygon

tests/test_cadquery.py:210–222  ·  view source on GitHub ↗
(loc)

Source from the content-addressed store, hash-verified

208
209 def rPoly(self, nSides, diameter):
210 def _makePolygon(loc):
211 # pnt is a vector in local coordinates
212 angle = 2.0 * math.pi / nSides
213 pnts = []
214 for i in range(nSides + 1):
215 pnts.append(
216 Vector(
217 (diameter / 2.0 * math.cos(angle * i)),
218 (diameter / 2.0 * math.sin(angle * i)),
219 0,
220 )
221 )
222 return Wire.makePolygon(pnts).located(loc)
223
224 return self.eachpoint(_makePolygon, True)
225

Callers

nothing calls this directly

Calls 4

VectorClass · 0.85
appendMethod · 0.80
makePolygonMethod · 0.80
locatedMethod · 0.45

Tested by

no test coverage detected