SDK3DVerse_MeasureDisplay_Ext

Create and display measures.

This extension require the following extension installed:

  • SDK3DVerse_ThreeJS_Ext
  • SDK3DVerse_ViewportDomOverlay_Ext

Methods

(async) createMeasure(color, positions) → {SDK3DVerse_Entity}

Create a measure from 3D points.

The measure type depends on the point count. 2 points will make a linear measurement. 3 points will make a angular measurement.

Parameters:
Name Type Description
color Color

HTML color string

positions Array.<Array.<Number>>

An array of 3D point in global space.

Returns:

The measure entity created

Type
SDK3DVerse_Entity

(async) createMeasureFromMouseEvent(mouseEvent, pointCount, color) → {SDK3DVerse_Entity}

Create a measure by mouse clicks with a visual effect between each of them.

This function is designed to create a measure from multiple mouse click events. The first event (which will trigger this function) needs to be passed to this function, but the following events are registered and handled by this function automatically.

The measure type depends on the point count. 2 points will make a linear measurement. 3 points will make a angular measurement.

Parameters:
Name Type Description
mouseEvent MouseEvent

The initial mouse event which triggered this function.

pointCount Number

Number of point to register before creating a measure.

color Color

HTML color string

Returns:

The measure entity created

Type
SDK3DVerse_Entity

distance(firstEntity, secondEntity) → {Number}

See:
  • setUnit

Calculates the euclidian distance multiplied by the current factor (setted by the function setUnit) between two entity global positions.

Parameters:
Name Type Description
firstEntity SDK3DVerse_Entity
secondEntity SDK3DVerse_Entity
Returns:

Euclidean distance.

Type
Number

getMeasuresFromEntity(entity) → {Array.<object>}

Get computed measures from a measure entity.

Parameters:
Name Type Description
entity SDK3DVerse_Entity

The measure entity

Returns:

An array of measures

Type
Array.<object>

setUnit(factor, unit)

Set measure unit and factor.

Parameters:
Name Type Description
factor Number

Scaling factor applied to the measures.

unit String

Unit of measurement displayed as a suffix.