viewer3d.measure
Invoked when a measurement changes.
Example
Usage
const onMeasurementChange = function (event) {
const { measure, measures } = event;
console.log("viewer3d.measure", "measure:", measure, "measures", measures);
};
viewer3d.addEventListener("viewer3d.measure", onMeasurementChange);Parameters
onMeasurementChange
Function called when a measurement changes.
Type |
|---|
(event: Object, measure: Object, measures: Array[Object]) => Void |
event
Measure
Name | Type | Description |
|---|---|---|
uuid | String | Id of the measure |
mode | String | Mode of the measurement |
values | Map[Object] | Values of the measurement |
mode
Valid values are:
- dimension
- laser
- point
values
Map of measurement components.
- Point measurements have a single component point.
- Laser measurements have three components a, b, and c corresponding to the x, y and z axis.
- Dimension measurements have four components depth, distance, height, and width.
Name | Type | Description |
|---|---|---|
color | String | Color of this component |
points | Array[Object] | List of measurement points |
point
Name | Type | Description |
|---|---|---|
distance | Number | Distance from this point to the previous point |
point | Vector3 | The measurement point |