Defaults to DynamicPolygonPoint. However, a custom class can be specified which derives from DynamicPolygonPoint.
Polygon constructor, counter-clockwise polygon winding order.
Name of polyline
BimCoreApi instance
Factory method which is used to create the instances of generic class type Point.
If true then it updates the 2D positions for each tracked 3D coordinate at the end of each frame.
Optionalparent: TransformNodeIf Babylon TransformNode is provided the dynamic polygon will attach as a child and follow its parent.
OptionaldragPointPositioningFunction: DragPointPositioningFunctionFunction to calculate the drag points position in the polygon.
Protected Readonly_BimCoreApi instance
Protected_OptionaldragFunction to calculate the drag points position in the polygon.
ReadonlynameName of polyline
ReadonlyonTriggered when DynamicPolygon.apply is called or when camera moves around. By listening to this event it is possible to know when the area label X,Y position is updated (This always exists on a DynamicPolygon). 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.).
ReadonlyonTriggered when DynamicPolygon.apply is called or when camera moves around. By listening to this event, it is possible to know when new polygon points are added, updated and removed. It is also possible to see how far away the points are from the camera. And to see what position they have in 2D space (for example, to add a HTML element to the DOM).
Polygon bottom area. Only updated when DynamicPolygon.apply or DynamicPolygon.build is called. Calculated with polygonArea function with a height of zero.
The polygon bottom area.
Interior point. Only updated when DynamicPolygon.apply or DynamicPolygon.build is called.
The interior point.
Whether or not the mesh is disposed or not.
boolean.
true if polygon has no points. Otherwise false.
true if the dynamic polygon is enabled otherwise false.
Sets isEnabled on the dynamicpolygon and sets isEnabled on the polygon mesh if it has any points.
state to set
Sets the parent of the DynamicPolygon without keeping the position in world space.
new parent for the DynamicPolygon.
Plane spanned by points. Only updated when DynamicPolygon.build or DynamicPolygon.assignNewPolygonPoints is called.
The Plane.
Polygon surface area. Only updated when DynamicPolygon.apply or DynamicPolygon.build is called.
The polygon surface area.
Polygon volume. Only updated when there exists a height and DynamicPolygon.apply or DynamicPolygon.build is called.
The polygon volume.
Applies changes to polygon which occurred when calling methods on DynamicPolygonPoint.move, DynamicPolygonPoint.virtual and DynamicPolygonPoint.delete. It will also trigger DynamicPolygon.onPointTrackableScreen events.
Assigns points to define the polygon, this method can be used instead of build which adds virtual points
Attempt to build a DynamicPolygon using the points parameter.
returns a DynamicPolygonPointValidationResult.
Clears the polygon of all current points
Disposes the DynamicPolygon. It is no longer useable after this call.
Optionalpredicate: (p: DynamicPolygonPoint) => booleanInternalIf transformPointsToLocal is true, transforms all provided points according to this DynamicPolygon's parent. In either case, validate points and return the validation result
The points to transform
Whether to transform the points to the DynamicPolygon's parent local space before validating them
The validation result NOTE: Internal API. Subject to change. Use of these APIs in production applications is not supported.
Get the world matrix of this DynamicPolygon
the world matrix for this DynamicPolygon.
StaticvalidateValidates the specified points.
returns a DynamicPolygonPointValidationResult.
Represents a dynamic polygon. 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 area.