Back to Three Js

LineSegments2

docs/pages/LineSegments2.html

latest1.4 KB
Original Source

Import

LineSegments2 is an addon, and must be imported explicitly, see Installation#Addons.

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

Constructor

new LineSegments2( geometry : LineSegmentsGeometry, material : LineMaterial )

Constructs a new wide line.

| geometry |

The line geometry.

| | material |

The line material.

|

Properties

.isLineSegments2 : boolean (readonly)

This flag can be used for type testing.

Default is true.

Methods

.computeLineDistances() : LineSegments2

Computes an array of distance values which are necessary for rendering dashed lines. For each vertex in the geometry, the method calculates the cumulative length from the current point to the very beginning of the line.

Returns: A reference to this instance.

.raycast( raycaster : Raycaster, intersects : Array.<Object> )

Computes intersection points between a casted ray and this instance.

| raycaster |

The raycaster.

| | intersects |

The target array that holds the intersection points.

|

Overrides: Mesh#raycast

Source

examples/jsm/lines/LineSegments2.js