File: LineGeometry.md | Updated: 11/15/2025
A chain of vertices, forming a polyline.
This is used in Line2 to describe the shape.
const points = [
new THREE.Vector3( - 10, 0, 0 ),
new THREE.Vector3( 0, 5, 0 ),
new THREE.Vector3( 10, 0, 0 ),
];
const geometry = new LineGeometry();
geometry.setFromPoints( points );
LineGeometry is an addon, and must be imported explicitly, see Installation#Addons.
import { LineLineGeometry2 } from 'three/addons/lines/LineGeometry.js';
Constructs a new line geometry.
This flag can be used for type testing.
Default is true.
Setups this line segments geometry from the given line.
line | The line that should be used as a data source for this geometry.
---|---
Returns: A reference to this geometry.
Sets the given line colors for this geometry.
array | The position data to set.
---|---
Overrides: LineSegmentsGeometry#setColors
Returns: A reference to this geometry.
Setups this line segments geometry from the given sequence of points.
points | An array of points in 2D or 3D space.
---|---
Returns: A reference to this geometry.
Sets the given line positions for this geometry.
array | The position data to set.
---|---
Overrides: LineSegmentsGeometry#setPositions
Returns: A reference to this geometry.