Skip to content

OCCCurve2d ¤

OCCCurve2d(native_curve: Geom2d_Curve, name=None)

Class representing a general 2D curve object ussually generated through an embedding in a surface.

Parameters:

  • name

    The name of the curve.

Attributes:

  • dimension (int) –

    The dimension of the curve is always 2.

  • domain (tuple[float, float]) –

    The domain of the parameter space of the curve.

  • end (Point) –

    The end point of the curve.

  • is_closed (bool) –

    Flag indicating that the curve is closed.

  • is_periodic (bool) –

    Flag indicating that the curve is periodic.

  • start (Point) –

    The start point of the curve.

Functions¤

copy ¤

copy() -> OCCCurve2d

Make an independent copy of the current curve.

Returns:

curvature_at ¤

curvature_at(t: float) -> Vector

Compute the curvature vector at a curve parameter.

Parameters:

  • t (float) –

    The curve parameter.

Returns:

Raises:

  • ValueError

    If the parameter is not in the curve domain.

frame_at ¤

frame_at(t: float) -> Frame

Compute the local frame at a curve parameter.

Parameters:

  • t (float) –

    The curve parameter.

Returns:

Raises:

  • ValueError

    If the parameter is not in the curve domain.

from_native classmethod ¤

from_native(native_curve: Geom2d_Curve) -> OCCCurve2d

Construct a NURBS curve from an existing OCC BSplineCurve.

Parameters:

  • native_curve (Geom2d_Curve) –

    An OCC Geom2d_Curve object.

Returns:

from_occ classmethod ¤

from_occ(native_curve: Geom2d_Curve) -> OCCCurve2d

Construct a NURBS curve from an existing OCC BSplineCurve.

Parameters:

  • native_curve (Geom2d_Curve) –

    An OCC Geom2d_Curve object.

Returns:

Warnings

.. deprecated:: 1.3 Use from_native instead.

point_at ¤

point_at(t: float) -> Point

Compute the point at a curve parameter.

Parameters:

  • t (float) –

    The curve parameter.

Returns:

Raises:

  • ValueError

    If the parameter is not in the curve domain.

tangent_at ¤

tangent_at(t: float) -> Vector

Compute the tangent vector at a curve parameter.

Parameters:

  • t (float) –

    The curve parameter.

Returns:

Raises:

  • ValueError

    If the parameter is not in the curve domain.

to_polyline ¤

to_polyline(n: int = 100) -> Polyline

Convert the curve to a polyline.

Parameters:

  • n (int, default: 100 ) –

    The number of polyline points.

Returns:

to_step ¤

to_step(filepath: str, schema: str = 'AP203') -> None

Write the curve geometry to a STP file.

Parameters:

  • filepath (str) –

    The path to the file.

  • schema (str, default: 'AP203' ) –

    The STEP schema to use.

Returns:

  • None