brepjs API Reference
    Preparing search index...

    Class Curve2D

    Handle-wrapped 2D parametric curve backed by an OCCT Geom2d_Curve.

    Provides evaluation, splitting, projection, tangent queries, and distance computations on a single parametric curve.

    Index

    Constructors

    Properties

    _boundingBox: BoundingBox2d | null

    Accessors

    • get firstParameter(): number

      Return the parameter value at the start of the curve.

      Returns number

    • get innerCurve(): any

      Access the underlying OCCT Geom2d_Curve (unwrapped from its handle).

      Returns any

    • get lastParameter(): number

      Return the parameter value at the end of the curve.

      Returns number

    • get repr(): string

      Return a human-readable representation, e.g. LINE (0,0) - (1,1).

      Returns string

    Methods

    • Create a Geom2dAdaptor_Curve for algorithmic queries (caller must delete).

      Returns any

    • Project a point onto the curve and return its parameter value.

      Parameters

      • point: Point2D
      • precision: number = 1e-9

      Returns Result<number>

      Ok(parameter) when the point is on the curve, or an error result otherwise.

    • Serialize this curve to a string that can be restored with deserializeCurve2D.

      Returns string

    • Split this curve at the given points or parameter values.

      Parameters

      • points: number[] | Point2D[]
      • precision: number = 1e-9

      Returns Curve2D[]

      An array of sub-curves whose union covers the original curve.

    • Compute the tangent vector at a parameter position or at the projection of a point.

      Parameters

      • index: number | Point2D

        A normalized parameter (0..1) or a Point2D to project onto the curve.

      Returns Point2D