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

Method makeBezier

cadquery/occ_impl/shapes.py:2863–2880  ·  view source on GitHub ↗

Create a cubic Bézier Curve from the points. :param points: a list of Vectors that represent the points. The edge will pass through the first and the last point, and the inner points are Bézier control points. :return: An edge

(cls, points: list[Vector])

Source from the content-addressed store, hash-verified

2861
2862 @classmethod
2863 def makeBezier(cls, points: list[Vector]) -> Edge:
2864 """
2865 Create a cubic Bézier Curve from the points.
2866
2867 :param points: a list of Vectors that represent the points.
2868 The edge will pass through the first and the last point,
2869 and the inner points are Bézier control points.
2870 :return: An edge
2871 """
2872
2873 # Convert to a TColgp_Array1OfPnt
2874 arr = TColgp_Array1OfPnt(1, len(points))
2875 for i, v in enumerate(points):
2876 arr.SetValue(i + 1, Vector(v).toPnt())
2877
2878 bez = Geom_BezierCurve(arr)
2879
2880 return cls(BRepBuilderAPI_MakeEdge(bez).Edge())
2881
2882
2883class Wire(Shape, Mixin1D):

Callers 3

bezierMethod · 0.80
bezierMethod · 0.80

Calls 2

VectorClass · 0.85
toPntMethod · 0.80

Tested by 1