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

[name]

A chain of vertices, forming a polyline.

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

Import

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

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

Examples

[example:webgl_lines_fat WebGL / lines / fat ]
[example:webgl_lines_fat_raycasting WebGL / lines / fat / raycasting ]
[example:webgpu_lines_fat WebGPU / lines / fat / raycasting ]

Constructor

[name]()

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

Properties

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

[property:Boolean isLineGeometry]

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

Methods

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

[method:this fromLine]( [param:Line line] )

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

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

Replace the per-vertex colors. Every triple describes a line vertex: `[r1, g1, b1]`. 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 three.

Source

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