Defines a polygonal shape consisting of polylines.
new Polyline2dSet():
Polyline2dSet
Polyline2dSet
new Polyline2dSet(
points,polylinePointsCounts,colors?,colorIndices?):Polyline2dSet
Number of polylines attributes (colors) should be the same as polylines. Otherwise, the appropriate attributes indices array should be specified. If specified, attribute indices array should have the same length as polylines array.
WARNING: Inconsistency in data will result to creation of empty polyline set.
Float32Array
Array of points in {x,y} format [x,y,x,y,...].
Number of points per polyline.
Uint16Array<ArrayBufferLike> | Uint32Array<ArrayBufferLike>
Float32Array<ArrayBufferLike>
Array of colors in RGB ([r,g,b,r,g,b,...]) or RGBA ([r,g,b,a,r,g,b,a,...]) formats.
Color indices array.
Uint16Array<ArrayBufferLike> | Uint32Array<ArrayBufferLike>
Polyline2dSet
MeshShape.constructor
new Polyline2dSet(
points,polylinePointsCounts,colors?,colorIndices?):Polyline2dSet
Number of polylines attributes (colors) should be the same as polylines. Otherwise, the appropriate attributes indices array should be specified. If specified, attribute indices array should have the same length as polylines array.
WARNING: Inconsistency in data will result to creation of empty polyline set.
BaseXY[]
Array of points in [{x,y},{x,y},...] 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.
Polyline2dSet
MeshShape.constructor
new Polyline2dSet(
polylines,colors?,colorIndices?):Polyline2dSet
Number of polylines attributes (colors) should be the same as polylines. Otherwise, the appropriate attributes indices array should be specified. If specified, attribute indices array should have the same length as polylines array.
WARNING: Inconsistency in data will result to creation of empty polyline set.
Array of polylines.
Array of colors in RGB and / or RGBA [{r,g,b},{r,g,b,a},...] format.
number[]
Color indices array.
Polyline2dSet
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 object id.
bigint
get name():
string|null
Returns name of the Shape. null if the element has no name (by default).
string | null
set name(
name):void
Sets name of the Shape.
Name of the Shape.
string | null
void
get numberOfColors():
number
Returns number of unique colors.
number
get numberOfPolylines():
number
Returns a number of polylines in polyline set.
number
get vertices():
Float32Array
Returns unique vertices in {x,y} format [x,y,x,y,...]..
Float32Array
addPolyline(
polyline,colors?,colorIndices?):boolean
Adds polyline and it's attributes to this polylines set. Returns true if polyline successfully added. this polylines set should have the same specified attributes as specified for new added polyline. Otherwise, polyline won't be added.
Polyline.
Array of 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 polylines set to this polylines set. Returns true if polylines successfully added. this polylines set and added polylineSet should have the same specified attributes. Otherwise, polylines won't be added.
Polyline2dSet
Added polyline set.
boolean
addPolylines(
points,polylinePointsCounts,colors?,colorIndices?):boolean
Adds polylines and attributes to this polylines set. Returns true if polylines successfully added. this polylines set should have the same specified attributes as specified for new added polylines. Otherwise, polylines won't be added.
Float32Array
Array of points in {x,y} format [x,y,x,y,...].
Number of points per polyline.
Uint16Array<ArrayBufferLike> | Uint32Array<ArrayBufferLike>
Float32Array<ArrayBufferLike>
Array of colors in RGB ([r,g,b,r,g,b,...]) or RGBA ([r,g,b,a,r,g,b,a,...]) formats.
Color indices array.
Uint16Array<ArrayBufferLike> | Uint32Array<ArrayBufferLike>
boolean
addPolylines(
points,polylinePointsCounts,colors?,colorIndices?):boolean
Adds polylines and attributes to this polylines set. Returns true if polylines successfully added. this polylines set should have the same specified attributes as specified for new added polylines. Otherwise, polylines won't be added.
BaseXY[]
Array of points in [{x,y},{x,y},...] 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.
boolean
addPolylines(
polylines,colors?,colorIndices?):boolean
Adds polylines and attributes to this polylines set. Returns true if polylines successfully added. this polylines set should have the same specified attributes as specified for new added polylines. Otherwise, polylines won't be added.
Array of polylines.
Array of colors in RGB and / or RGBA [{r,g,b},{r,g,b,a},...] format.
number[]
Color indices array.
boolean
color(
index):Color
Returns color. index must be in the range [0, numberOfColors()-1]. Otherwise the result is undefined.
number
Color index.
hasColors():
boolean
Returns true if the triangle 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 in polyline points range. 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 in polyline points range. If the point index was not found -1 will be returned.
number
Polyline index.
number
Point index in polyline.
number
polyline(
index):Polyline2d
Returns the polyline. index must be in the range [0, numberOfPolylines()-1]. Otherwise the result is undefined.
number
Point index.