LineStrip

The linestrip() function creates a connected series of line segments from a list of points. It is useful for paths, graphs, and outlines.

lineStrip([
        [-100, 0],
        [-50, 50],
        [50, 50],
        [100, -100]
    ])
    .linewidth(6)
    .color({
        from: "deepskyblue",
        to: "tomato"
    })
    .dashed(20, 20);

Returns the LineStrip object:


LineStrip

Example usage:
lineStrip.color("dodgerblue").linewidth(2);
field
mesh: Line2
The Line2 mesh representing the line strip.
Example
lineStrip.mesh.scale.set(1, 1, 1);
method
pos(position: Vec3): LineStrip
Set the position of the object.
param position
A vector-like object representing the position.
Example
lineStrip.pos([0, 0, 1]);
method
color(color: LineStripColor): LineStrip
Set the color of the line strip.
param color
A color, an array of colors or an object defining from/to colors.
Example
lineStrip.color({ from: "steelblue", to: "gold" });
method
material(material: LineMaterial): LineStrip
Sets the material of the line strip.
param material
A LineMaterial instance.
Example
lineStrip.material(new LineMaterial());
method
linewidth(width: number): LineStrip
Sets the line width of the line strip.
param width
The new line width.
Example
lineStrip.linewidth(3);
method
dashed(dashSize?: number, gapSize?: number): LineStrip
Sets the line to be dashed. If no parameters are provided, default values are used.
param dashSize
Size of the dashes.
param gapSize
Size of the gaps between dashes.
Example
lineStrip.dashed(2, 1);