[page:BufferGeometry] → [page:InstancedBufferGeometry] →

[name]

A series of vertex pairs, forming line segments.

This is used in [page:LineSegments2] to describe the shape.

Import

[name] is an add-on, and therefore must be imported explicitly. See [link:#manual/introduction/Installation Installation / Addons].

import { LineSegmentsGeometry } from 'three/addons/lines/LineSegmentsGeometry.js';

Example

[example:webgl_lines_fat_raycasting WebGL / lines / fat / raycasting ]

Constructor

[name]()

Creates a new geometry. Call [page:LineSegmentsGeometry.setPositions setPositions] to add segments.

Properties

See the base [page:InstancedBufferGeometry] class for common properties.

[property:Boolean isLineSegmentsGeometry]

Read-only flag to check if a given object is of type [name].

Methods

See the base [page:Mesh] class for common methods.

[method:this fromEdgesGeometry]( [param:EdgesGeometry geometry] )

Copy the vertex positions of an edge geometry into this geometry.

[method:this fromLineSegments]( [param:LineSegments lineSegments] )

Copy the vertex positions of a [page:LineSegments] object into this geometry. Assumes the source geometry is not using indices.

[method:this fromMesh]( [param:Mesh mesh] )

Copy the vertex positions of a mesh object into this geometry.

[method:this fromWireframeGeometry]( [param:WireframeGeometry geometry] )

Copy the vertex positions of a wireframe geometry into this geometry.

[method:this setColors]( [param:Array array] )

Replace the per-vertex colors. Every sixtuple describes a segment: `[r1, g1, b1, r2, g2, b2]`. The array can be an `Array` or `Float32Array`.

[method:this setPositions]( [param:Array array] )

Replace the vertex positions with a new set. The array can be an `Array` or `Float32Array`. The length must be a multiple of six.

See also [page:LineSegmentsGeometry.positions positions].

[method:undefined toJSON]()

Unimplemented.

Source

[link:https://github.com/mrdoob/three.js/blob/master/examples/jsm/lines/LineSegmentsGeometry.js examples/jsm/lines/LineSegmentsGeometry.js]