OCCNurbsCurve
¤
OCCNurbsCurve(native_curve: Geom_BSplineCurve, name: str | None = None)
Class representing a NURBS curve based on the BSplineCurve of the OCC geometry kernel.
Parameters:
-
name(str | None, default:None) –The name of the curve.
Attributes:
-
continuity(int) –The degree of continuity of the curve.
-
degree(int) –The degree of the curve.
-
is_rational(bool) –Flag indicating that the curve is rational.
-
knots(list[float]) –The knots of the curve, without multiplicities.
-
knotsequence(list[float]) –The full vector of knots of the curve.
-
multiplicities(list[int]) –The multiplicities of the knots of the curve.
-
order(int) –The order of the curve (= degree + 1).
-
points(list[Point]) –The control points of the curve.
-
weights(list[float]) –The weights of the control points of the curve.
Examples:
Curve from points...
>>> from compas.geometry import Point
>>> from compas_occ.geometry import OCCNurbsCurve
>>> points = [Point(0, 0, 0), Point(3, 6, 0), Point(6, -3, 3), Point(10, 0, 0)]
>>> curve = OCCNurbsCurve.from_points(points)
Curve from parameters...
>>> from compas.geometry import Point
>>> from compas_occ.geometry import OCCNurbsCurve
>>> points = [Point(0, 0, 0), Point(3, 6, 0), Point(6, -3, 3), Point(10, 0, 0)]
>>> curve = OCCNurbsCurve.from_parameters(points=points, weights=[1.0, 1.0, 1.0, 1.0], knots=[0.0, 1.0], multiplicities=[4, 4], degree=3)
Functions¤
copy
¤
copy() -> OCCNurbsCurve
from_arc
classmethod
¤
from_arc(arc: Arc, degree: int, pointcount: int | None = None) -> OCCNurbsCurve
from_circle
classmethod
¤
from_circle(circle: Circle) -> OCCNurbsCurve
from_ellipse
classmethod
¤
from_ellipse(ellipse: Ellipse) -> OCCNurbsCurve
Construct a NURBS curve from an ellipse.
Parameters:
-
ellipse(Ellipse) –The ellipse geometry.
Returns:
from_interpolation
classmethod
¤
from_interpolation(points: list[Point], precision: float = 0.001) -> OCCNurbsCurve
from_line
classmethod
¤
from_line(line: Line) -> OCCNurbsCurve
from_native
classmethod
¤
from_native(native_curve: Geom_BSplineCurve) -> OCCNurbsCurve
Construct a NURBS curve from an existing OCC BSplineCurve.
Parameters:
-
native_curve(Geom_BSplineCurve) –
Returns:
from_parameters
classmethod
¤
from_parameters(
points: list[Point],
weights: list[float],
knots: list[float],
multiplicities: list[int],
degree: int,
is_periodic: bool = False,
) -> OCCNurbsCurve
Construct a NURBS curve from explicit curve parameters.
Parameters:
-
points(list[Point]) –The control points.
-
weights(list[float]) –The weights of the control points.
-
knots(list[float]) –The knots of the curve, without multiplicities.
-
multiplicities(list[int]) –The multiplicities of the knots.
-
degree(int) –The degree of the curve.
-
is_periodic(bool, default:False) –Flag indicating that the curve is periodic.
Returns:
from_points
classmethod
¤
from_points(points: list[Point], degree: int = 3) -> OCCNurbsCurve
join
¤
join(curve: OCCNurbsCurve, precision: float = 0.0001) -> None
Modifies this curve by joining it with another curve.
Parameters:
-
curve(OCCNurbsCurve) –The curve to join.
-
precision(float, default:0.0001) –Tolerance for continuity and multiplicity.
Returns:
-
None–
joined
¤
joined(curve: OCCNurbsCurve, precision: float = 0.0001) -> OCCNurbsCurve | None
Returns a new curve that is the result of joining this curve with another.
Parameters:
-
curve(OCCNurbsCurve) –The curve to join.
-
precision(float, default:0.0001) –Tolerance for continuity and multiplicity.
Returns:
-
OCCNurbsCurve | None–
segment
¤
segmented
¤
segmented(u: float, v: float, precision: float = 0.001) -> OCCNurbsCurve