BufferGeometry
Object3D
Raycaster
Camera
CubeCamera
PerspectiveCamera
OrthographicCamera
StereoCamera
Clock
Curve
CurvePath
Path
Shape
ShapePath
ArrowHelper
AxesHelper
BoxHelper
Box3Helper
CameraHelper
DirectionalLightHelper
GridHelper
PolarGridHelper
HemisphereLightHelper
PlaneHelper
PointLightHelper
SkeletonHelper
SpotLightHelper
Light
PointLight
RectAreaLight
SpotLight
DirectionalLight
HemisphereLight
LightShadow
PointLightShadow
AnimationLoader
AudioLoader
BufferGeometryLoader
CompressedTextureLoader
CubeTextureLoader
DataTextureLoader
FileLoader
ImageBitmapLoader
ImageLoader
Loader
LoaderUtils
MaterialLoader
ObjectLoader
TextureLoader
LoadingManager
Material
Box2
Box3
Color
Cylindrical
Euler
Frustum
Interpolant
Line3
MathUtils
Matrix3
Matrix4
Plane
Quaternion
AnimationAction
AnimationClip
AnimationMixer
AnimationObjectGroup
AnimationUtils
keyframeTrack
PropertyBinding
PropertyMixer
BooleanKeyframeTrack
QuaternionKeyframeTrack
StringKeyframeTrack
Audio
AudioAnalyser
AudioContext
AudioListener
PositionalAudio

Curve.getSpacedPoints()

The Curve.getSpacedPoints() method returns an array of points that are spaced evenly along the curve. The number of points returned is determined by the divisions parameter, which specifies the distance between each point.

Syntax

getSpacedPoints(divisions)

Parameters

  • divisions — A number that specifies the number of points to be returned.

Return Value

An array of points that are spaced evenly along the curve.

Example Usage

const curve = new THREE.CatmullRomCurve3( [
  new THREE.Vector3( -10, 0, 10 ),
  new THREE.Vector3( -5, 5, 5 ),
  new THREE.Vector3( 0, 0, 0 ),
  new THREE.Vector3( 5, -5, 5 ),
  new THREE.Vector3( 10, 0, 10 )
] );

const points = curve.getSpacedPoints( 50 );

In this example, a CatmullRomCurve3 is created with five control points. The getSpacedPoints() method is called with a divisions value of 50, so an array of 50 evenly spaced points along the curve is returned.

Recommendations

  • Use a higher value for divisions to obtain a smoother curve.
  • Use a lower value for divisions to obtain a coarser curve or to optimize performance.

See Also