Defines a polygonal shape consisting of polylines.
new PolylineSet():
PolylineSet
Creates an empty polyline set.
PolylineSet
new PolylineSet(
points,polylinePointsCounts,colors?,colorIndices?):PolylineSet
Creates a polyline set from point coordinates and point counts per polyline.
If colorIndices is omitted, colors must define one color per point in the input polylines. If colorIndices is specified, it must contain one entry per point.
If the provided data is inconsistent, an empty polyline set is created.
Float32Array
Array of points in {x,y,z} format [x,y,z,x,y,z,...].
Uint16Array<ArrayBufferLike> | Uint32Array<ArrayBufferLike>
Number of points per polyline.
Float32Array<ArrayBufferLike>
Array of colors in RGB ([r,g,b,r,g,b,...]) or RGBA ([r,g,b,a,r,g,b,a,...]) format.
Uint16Array<ArrayBufferLike> | Uint32Array<ArrayBufferLike>
Color indices array.
PolylineSet
MeshShape.constructor
new PolylineSet(
points,polylinePointsCounts,colors?,colorIndices?):PolylineSet
Creates a polyline set from points and point counts per polyline.
If colorIndices is omitted, colors must define one color per point in the input polylines. If colorIndices is specified, it must contain one entry per point.
If the provided data is inconsistent, an empty polyline set is created.
BaseXYZ[]
Array of points in [{x,y,z},{x,y,z},...] format.
number[]
Number of points per polyline.
Array of colors in RGB and / or RGBA [{r,g,b},{r,g,b,a},...] format.
number[]
Color indices array.
PolylineSet
MeshShape.constructor
new PolylineSet(
polylines,colors?,colorIndices?):PolylineSet
Creates a polyline set from polylines.
If colorIndices is omitted, colors must define one color per point across all polylines. If colorIndices is specified, it must contain one entry per point.
If the provided data is inconsistent, an empty polyline set is created.
Polyline[]
Array of polylines.
Array of colors in RGB and / or RGBA [{r,g,b},{r,g,b,a},...] format.
number[]
Color indices array.
PolylineSet
MeshShape.constructor
get colors():
Float32Array
Returns array with colors in RGBA ([r,g,b,a,r,g,b,a,...]) format for each vertex (i.e. taking into account colors indices), if specified. Otherwise, returns empty array.
Float32Array
get id():
bigint
Returns the unique identifier of the object.
bigint
get name():
string|null
Name of the mesh shape.
The default value is null.
string | null
set name(
name):void
Sets the name of the mesh shape.
string | null
Mesh shape name.
void
get numberOfColors():
number
Number of unique colors.
number
get numberOfPolylines():
number
Number of polylines in the polyline set.
number
get vertices():
Float32Array
Polyline vertices in {x,y,z} format [x,y,z,x,y,z,...].
Float32Array
addPolyline(
polyline,colors?,colorIndices?):boolean
Adds a polyline and its attributes to this polyline set.
Returns true if the polyline was added successfully. This polyline set must already define the same kinds of attributes as the polyline being added. Otherwise, the polyline is not added.
Polyline.
Array of point colors in RGB and / or RGBA [{r,g,b},{r,g,b,a},...] format.
number[]
Color indices array.
boolean
addPolylines(
polylineSet):boolean
Adds polylines and attributes from another polyline set to this polyline set.
Returns true if the polylines were added successfully. This polyline set and polylineSet must define the same kinds of attributes. Otherwise, polylines are not added.
PolylineSet
Polyline set to add.
boolean
addPolylines(
points,polylinePointsCounts,colors?,colorIndices?):boolean
Adds polylines and attributes to this polyline set.
Returns true if the polylines were added successfully. This polyline set must already define the same kinds of attributes as the polylines being added. Otherwise, polylines are not added.
Float32Array
Array of points in {x,y,z} format [x,y,z,x,y,z,...].
Uint16Array<ArrayBufferLike> | Uint32Array<ArrayBufferLike>
Number of points per polyline.
Float32Array<ArrayBufferLike>
Array of point colors in RGB ([r,g,b,r,g,b,...]) or RGBA ([r,g,b,a,r,g,b,a,...]) format.
Uint16Array<ArrayBufferLike> | Uint32Array<ArrayBufferLike>
Color indices array.
boolean
addPolylines(
points,polylinePointsCounts,colors?,colorIndices?):boolean
Adds polylines and attributes to this polyline set.
Returns true if the polylines were added successfully. This polyline set must already define the same kinds of attributes as the polylines being added. Otherwise, polylines are not added.
BaseXYZ[]
Array of points in [{x,y,z},{x,y,z},...] format.
number[]
Number of points per polyline.
Array of point colors in RGB and / or RGBA [{r,g,b},{r,g,b,a},...] format.
number[]
Color indices array.
boolean
addPolylines(
polylines,colors?,colorIndices?):boolean
Adds polylines and attributes to this polyline set.
Returns true if the polylines were added successfully. This polyline set must already define the same kinds of attributes as the polylines being added. Otherwise, polylines are not added.
Polyline[]
Array of polylines.
Array of point colors in RGB and / or RGBA [{r,g,b},{r,g,b,a},...] format.
number[]
Color indices array.
boolean
color(
index):Color
Returns a color.
index must be in the range [0, numberOfColors() - 1]. Otherwise the result is undefined.
number
Color index.
hasColors():
boolean
Returns whether the polyline set has explicitly defined colors.
boolean
pointColor(
polylineIndex,pointIndex):Color
Returns a color at point.
polylineIndex must be in the range [0, numberOfPolylines() - 1]. pointIndex must be a valid point index in the polyline. Otherwise the result is undefined.
number
Polyline index.
number
Point index in polyline.
pointColorIndex(
polylineIndex,pointIndex):number
Returns a color index for point.
polylineIndex must be in the range [0, numberOfPolylines() - 1]. pointIndex must be a valid point index in the polyline. If no color index is found, -1 is returned.
number
Polyline index.
number
Point index in polyline.
number
polyline(
index):Polyline
Returns a polyline.
index must be in the range [0, numberOfPolylines() - 1]. Otherwise the result is undefined.
number
Polyline index.