Skip to content

OCCCurve2d ¤

OCCCurve2d(native_curve, name=None)

Class representing a general 2D curve, usually generated through an embedding in a surface.

Parameters:

  • native_curve (Geom2dCurve) –

    An existing OCC 2D curve handle wrapper.

  • name (str, default: None ) –

    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.

Methods:¤

copy ¤

copy() -> OCCCurve2d

Make an independent copy of the current curve.

curvature_at ¤

curvature_at(t: float) -> Vector

Compute the curvature vector at a curve parameter.

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.

Raises:

  • ValueError

    If the parameter is not in the curve domain.

from_native classmethod ¤

from_native(native_curve) -> OCCCurve2d

Construct a 2D curve from an existing OCC Geom2d curve handle.

from_occ classmethod ¤

from_occ(native_curve) -> OCCCurve2d

Construct a 2D curve from an existing OCC Geom2d curve handle.

.. deprecated:: 1.3 Use from_native instead.

point_at ¤

point_at(t: float) -> Point

Compute the point at a curve parameter.

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.

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.

to_step ¤

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

Write the curve geometry to a STP file.