Base class for parametric 3D curves.

Curves are sampled over t in the range [0..1] and provide helpers for point, tangent, arc-length, and uniform-distance sampling.

Hierarchy (View Summary)

Constructors

Properties

__arcLengthDivisions?: number
_t: number = 0
cacheArcLengths?: number[]
needsUpdate?: boolean

Accessors

Methods

  • Returns cumulative sampled arc lengths for the curve.

    The returned array starts at 0 and ends at the total sampled length. Results are cached until invalidated.

    Parameters

    • Optionaldivisions: number

      Number of sampling divisions used to approximate arc length

    Returns number[]

    Cumulative arc lengths

  • Returns a point using normalized arc-length parameterization.

    Unlike getPoint, u maps to distance along the curve rather than directly to the curve parameter.

    Parameters

    • u: number

      Normalized distance along the curve in the range [0..1]

    Returns Vec3

    Point on the curve

  • Samples points at evenly spaced parameter intervals.

    Parameters

    • divisions: number = 5

      Number of intervals to divide [0..1] into

    Returns Vec3[]

    Sampled points, including both endpoints

  • Returns the normalized tangent at parameter t.

    Uses a small finite difference around t.

    Parameters

    • Optionalt: number

      Curve parameter in the range [0..1]. Defaults to the current t.

    Returns Vec3

    Normalized tangent vector

  • Maps normalized arc-length parameter u to curve parameter t.

    This is useful when you want points spaced by distance along the curve instead of by raw parameter value.

    Parameters

    • u: number

      Normalized distance along the curve in the range [0..1]

    • Optionaldistance: number

      Absolute distance along the curve. When provided, overrides u.

    Returns number

    Curve parameter in the range [0..1]