Skip to content

OCCNurbsCurve ¤

OCCNurbsCurve(native_curve, 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:

>>> from compas.geometry import Point
>>> from compas_occt.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)

Methods:¤

copy ¤

copy() -> OCCNurbsCurve

Make an independent copy of the current curve.

from_arc classmethod ¤

from_arc(arc: Arc, degree: int, pointcount: int | None = None) -> OCCNurbsCurve

Construct a NURBS curve from an arc.

from_circle classmethod ¤

from_circle(circle: Circle) -> OCCNurbsCurve

Construct a NURBS curve from a circle.

from_ellipse classmethod ¤

from_ellipse(ellipse: Ellipse) -> OCCNurbsCurve

Construct a NURBS curve from an ellipse.

from_interpolation classmethod ¤

from_interpolation(points: list[Point], precision: float = 0.001) -> OCCNurbsCurve

Construct a NURBS curve by interpolating a set of points.

from_line classmethod ¤

from_line(line: Line) -> OCCNurbsCurve

Construct a NURBS curve from a line.

from_native classmethod ¤

from_native(native_curve) -> OCCNurbsCurve

Construct a NURBS curve from an existing OCC BSplineCurve handle.

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.

from_points classmethod ¤

from_points(points: list[Point], degree: int = 3) -> OCCNurbsCurve

Construct a NURBS curve from control points.

join ¤

join(curve: OCCNurbsCurve, precision: float = 0.0001) -> None

Modify this curve by joining it with another curve.

joined ¤

joined(curve: OCCNurbsCurve, precision: float = 0.0001) -> OCCNurbsCurve | None

Return a new curve that is the result of joining this curve with another.

segment ¤

segment(u: float, v: float, precision: float = 0.001) -> None

Modify this curve by segmenting it between the parameters u and v.

segmented ¤

segmented(u: float, v: float, precision: float = 0.001) -> OCCNurbsCurve

Return a copy of this curve segmented between the parameters u and v.