[page:Object3D] → [page:Mesh] → [page:LineSegments2] →

[name]

A polyline drawn between vertices.

This adds functionality beyond [page:Line], like arbitrary line width and changing width to be in world units. It extends [page:LineSegments2], simplifying constructing segments from a chain of points.

Import

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

import { Line2 } from 'three/addons/lines/Line2.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]( [param:LineGeometry geometry], [param:LineMaterial material] )

[page:LineGeometry geometry] — (optional) Pair(s) of vertices representing each line segment.
[page:Material material] — (optional) Material for the line. Default is a [page:LineMaterial] with random color.

Properties

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

[property:Boolean isLine2]

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

Methods

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

Source

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