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

Method makePolygon

cadquery/occ_impl/shapes.py:3039–3060  ·  view source on GitHub ↗

Construct a polygonal wire from points.

(
        cls,
        listOfVertices: Iterable[VectorLike],
        forConstruction: bool = False,
        close: bool = False,
    )

Source from the content-addressed store, hash-verified

3037
3038 @classmethod
3039 def makePolygon(
3040 cls,
3041 listOfVertices: Iterable[VectorLike],
3042 forConstruction: bool = False,
3043 close: bool = False,
3044 ) -> Wire:
3045 """
3046 Construct a polygonal wire from points.
3047 """
3048
3049 wire_builder = BRepBuilderAPI_MakePolygon()
3050
3051 for v in listOfVertices:
3052 wire_builder.Add(Vector(v).toPnt())
3053
3054 if close:
3055 wire_builder.Close()
3056
3057 w = cls(wire_builder.Wire())
3058 w.forConstruction = forConstruction
3059
3060 return w
3061
3062 @classmethod
3063 def makeHelix(

Callers 10

polygonMethod · 0.80
rectMethod · 0.80
polygonMethod · 0.80
interpPlateMethod · 0.80
makeUnitSquareWireFunction · 0.80
testEdgeWrapperRadiusMethod · 0.80
testWireFilletMethod · 0.80
test_wire_makepolygonFunction · 0.80
_makePolygonMethod · 0.80
test_constraint_getPlnFunction · 0.80

Calls 2

VectorClass · 0.85
toPntMethod · 0.80

Tested by 5

testEdgeWrapperRadiusMethod · 0.64
testWireFilletMethod · 0.64
test_wire_makepolygonFunction · 0.64
_makePolygonMethod · 0.64
test_constraint_getPlnFunction · 0.64