Capítulo 359 de 859

Chapter 359: NURBSCurve

Core Idea

This class represents a NURBS curve.

Implementation is based on (x, y [, z=0 [, w=1]]) control points with w=weight.

Key Concepts

  • controlPoints : Array.<Vector4>: An array of control points.
  • degree : number: The NURBS degree.
  • endKnot : number: Index of the end knot into the knots array.
  • knots : Array.<number>: The knots as a flat array of numbers.
  • startKnot : number: Index of the start knot into the knots array.

Code Examples

import { NURBSCurve } from 'three/addons/curves/NURBSCurve.js';
  • What it demonstrates: Typical usage of NURBSCurve.

Reference Tables

Constructor

Signature
`new NURBSCurve( degree : number, knots : Array.<number>, controlPoints : Array.<(Vector2

Properties

PropertyDescription
.controlPoints : Array.<Vector4>An array of control points.
.degree : numberThe NURBS degree.
.endKnot : numberIndex of the end knot into the knots array.
.knots : Array.<number>The knots as a flat array of numbers.
.startKnot : numberIndex of the start knot into the knots array.

Methods

MethodDescription
.getPoint( t : number, optionalTarget : Vector3 ) : Vector3This method returns a vector in 3D space for the given interpolation factor.
.getTangent( t : number, optionalTarget : Vector3 ) : Vector3Returns a unit vector tangent for the given interpolation factor.

Key Takeaways

  1. NURBSCurve extends: Curve
  2. Most relevant properties: controlPoints, degree, endKnot, knots.
  3. Key methods: getPoint, getTangent.

Connects To