PolyLine <Point>
Index
Constructors
Properties
Accessors
Methods
Constructors
publicconstructor
Polyline constructor.
Type parameters
- Point: TrackCoordinate3D
Parameters
name: string
Name of polyline
_api: BimCoreApi
BimCoreApi instance
optionaloptions: { maxPointCount?: number }
Options for line creation
Returns PolyLine<Point>
Properties
publicname
Name of polyline
publicreadonlyonPointTrackableScreen
Triggered when apply is called or when camera moves around. By listening to this event it is possible to know when new points are added, updated and removed. It is also possible to see how far away the points are from the camera. What position they have in 2D space (perhaps one wants to add a HTML element to the DOM there.).
publicpoints
Points that make up the polyline. Use usual array operations to add, remove insert points etc. When changes have been made call applyToMesh in order to visualize the changes as a LinesMesh.
Accessors
publiccolor
Color of the line.
Returns Color3
The color
Color of the line
Parameters
c: Color3
The color the line shall have.
Returns void
Methods
publicapply
Apply changes made to the points array. This will mirror the changes in the visual representation of the polygon line. It will also trigger onPointTrackableScreen events.
Returns void
publicclear
Sets point array to zero and disables visibility for the lines mesh. Also removes coordinate trackers for labels if present.
Returns void
publicdispose
Sets point array to zero and disables visibility for the lines mesh. Also removes coordinate trackers for labels if present. And disposes the linemesh.
Returns void
publicdistance
Gets the distance of the polyline.
Parameters
optionalo: { end: Point }
Returns number
distance.
publicforEachLine
Makes it possible to iterate each line that points represents
Parameters
predicate: (start: Point, end: Point) => boolean
Called for each line with start and end vector. If predicate returns
false
then iteration is stopped.
Returns void
Represents a dynamic polyline. It is possible to add, insert and remove points to it and have those changes reflect its 3D visualization. Useful for tools that need to calculate distances between start and end points etc.