Defines a polygonal shape consisting of polylines.
new PolylineSet():
PolylineSet
new PolylineSet(
points
,polylinePointsCounts
,colors
?,colorIndices
?):PolylineSet
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
<ArrayBufferLike
>
Array of points in {x,y,z} format [x,y,z,x,y,z,...].
Number of points per polyline.
Uint16Array
<ArrayBufferLike
> | Uint32Array
<ArrayBufferLike
>
Float32Array
<ArrayBufferLike
>
Array of colors in RGB ([R,G,B,R,G,B,...]) format.
Color indices array.
Uint16Array
<ArrayBufferLike
> | Uint32Array
<ArrayBufferLike
>
PolyShape.constructor
new PolylineSet(
points
,polylinePointsCounts
,colors
?,colorIndices
?):PolylineSet
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.
BaseXYZ
[]
Array of points in [{x,y,z},{x,y,z},...] format.
number
[]
Number of points per polyline.
BaseRGB
[]
Array of colors in [{r,g,b},{r,g,b},...] format.
number
[]
Color indices array.
PolyShape.constructor
new PolylineSet(
polylines
,colors
?,colorIndices
?):PolylineSet
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.
Polyline
[]
Array of polylines.
BaseRGB
[]
Array of colors in [{r,g,b},{r,g,b},...] format.
number
[]
Color indices array.
PolyShape.constructor
get colors():
Float32Array
<ArrayBufferLike
>
Returns array with colors in RGB ([r,g,b,r,g,b,...]) format for each vertex (i.e. taking into account colors indices), if specified. Otherwise, returns empty array.
Float32Array
<ArrayBufferLike
>
get id():
bigint
Returns object id.
bigint
get name():
null
|string
Returns name of the Shape. null
if the element has no name (by default).
null
| string
set name(
name
):void
Sets name of the Shape.
Name of the Shape.
null
| string
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
<ArrayBufferLike
>
Returns unique vertices in {x,y,z} format [x,y,z,x,y,z,...]..
Float32Array
<ArrayBufferLike
>
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.
BaseRGB
[]
Array of colors in [{r,g,b},{r,g,b},...] 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.
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
<ArrayBufferLike
>
Array of points in {x,y,z} format [x,y,z,x,y,z,...].
Number of points per polyline.
Uint16Array
<ArrayBufferLike
> | Uint32Array
<ArrayBufferLike
>
Float32Array
<ArrayBufferLike
>
Array of colors in RGB ([R,G,B,R,G,B,...]) format.
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.
BaseXYZ
[]
Array of points in [{x,y,z},{x,y,z},...] format.
number
[]
Number of points per polyline.
BaseRGB
[]
Array of colors in [{r,g,b},{r,g,b},...] 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.
Polyline
[]
Array of polylines.
BaseRGB
[]
Array of colors in [{r,g,b},{r,g,b},...] 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
):Polyline
Returns the polyline. index
must be in the range [0, numberOfPolylines()-1]
. Otherwise the result is undefined.
number
Point index.