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

Method regularPolygon

cadquery/sketch.py:333–350  ·  view source on GitHub ↗

Construct a regular polygonal face.

(
        self: T,
        r: Real,
        n: int,
        angle: Real = 0,
        mode: Modes = "a",
        tag: Optional[str] = None,
    )

Source from the content-addressed store, hash-verified

331 return self.face(wire, angle, mode, tag)
332
333 def regularPolygon(
334 self: T,
335 r: Real,
336 n: int,
337 angle: Real = 0,
338 mode: Modes = "a",
339 tag: Optional[str] = None,
340 ) -> T:
341 """
342 Construct a regular polygonal face.
343 """
344
345 pts = [
346 Vector(r * sin(i * 2 * pi / n), r * cos(i * 2 * pi / n))
347 for i in range(n + 1)
348 ]
349
350 return self.polygon(pts, angle, mode, tag)
351
352 def polygon(
353 self: T,

Callers 1

test_face_interfaceFunction · 0.80

Calls 2

polygonMethod · 0.95
VectorClass · 0.85

Tested by 1

test_face_interfaceFunction · 0.64