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])
| 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 | |
| 2883 | class Wire(Shape, Mixin1D): |