A curve representing a Catmull-Rom spline.

//Create a closed wavey loop
const curve = new AcGeCatmullRomCurve3d( [
new AcGePoint3d( -10, 0, 10 ),
new AcGePoint3d( -5, 5, 5 ),
new AcGePoint3d( 0, 0, 0 ),
new AcGePoint3d( 5, -5, 5 ),
new AcGePoint3d( 10, 0, 10 )
], true ); // true for closed curve

const points = curve.getPoints( 50 );

// Convert to NURBS curve
const nurbsCurve = curve.toNurbsCurve();

Hierarchy

  • AcGeCurve3d
    • AcGeCatmullRomCurve3d

Constructors

  • Constructs a new Catmull-Rom curve.

    Parameters

    • Optionalpoints: AcGeVector3dLike[]

      An array of 3D points defining the curve.

    • Optionalclosed: boolean

      Whether the curve is closed or not.

    • OptionalcurveType: CatmullRomCurveType

      The curve type.

    • Optionaltension: number

      Tension of the curve.

    Returns AcGeCatmullRomCurve3d

Properties

_boundingBoxNeedsUpdate: boolean
isCatmullRomCurve3d: true

This flag can be used for type testing.

type: "CatmullRomCurve3d"

The curve type identifier

Accessors

  • get boundingBoxNeedUpdate(): boolean
  • When this is set, it calculates the bounding box of this shape and resets this property to false. Default is false.

    Returns boolean

  • get box(): AcGeBox3d
  • The bounding box of this shape. Because it is a time-consuming operation to calculate the bounding box of one shape, the bounding box value is cached. It will be calculated again lazily once there are any changes to properties of this shape.

    Returns AcGeBox3d

  • get closed(): boolean
  • Whether the curve is closed or not.

    Returns boolean

  • get endPoint(): AcGePoint3d
  • End point of this curve.

    Returns AcGePoint3d

  • get length(): number
  • Length of this curve (approximated).

    Returns number

  • get points(): AcGePoint3d[]
  • An array of 3D points defining the curve.

    Returns AcGePoint3d[]

  • get startPoint(): AcGePoint3d
  • Start point of this curve.

    Returns AcGePoint3d

  • get tension(): number
  • Tension of the curve.

    Returns number

Methods

  • Calculate the bounding box of this curve.

    Returns AcGeBox3d

    The bounding box

  • Returns a point on the curve.

    Parameters

    • t: number

      A interpolation factor representing a position on the curve. Must be in the range [0,1].

    • OptionaloptionalTarget: AcGePoint3d

      The optional target vector the result is written to.

    Returns AcGePoint3d

    The position on the curve.

  • Get an array of points along the curve

    Parameters

    • divisions: number

      Number of divisions to create

    Returns AcGePoint3d[]

    Array of points along the curve

  • Set whether the curve is closed

    Parameters

    • closed: boolean

      Whether the curve should be closed

    Returns void

  • Set the curve type

    Parameters

    Returns void

  • Set the points defining the curve

    Parameters

    Returns void

  • Set the tension of the curve

    Parameters

    • tension: number

      The tension value

    Returns void

  • Transforms the curve by applying the input matrix.

    Parameters

    Returns this

    Return this curve

  • Return new shape translated by given vector. Translation vector may be also defined by a pair of numbers.

    Parameters

    Returns AcGeShape3d