Nightly releases are generated automatically from the latest source code and are intended for experimental purposes only.
These builds may contain incomplete or untested features, bugs, or security vulnerabilities, and as such, are not for production use.
Users should be aware that nightly releases may cause unexpected behavior, data loss, or system instability.
Use of these releases is at the user's own risk, and it is advised to have adequate backups before testing.
The software is provided as is with no guarantees or support.
Perform different kinds of measurements between 3D objects
Create and manage measurements as first-class entities in the webvis context
Possible measurement inputs include nodes, shapes, faces, edges, and points, as well as planes and lines.
All available input types are defined in the MeasurementTargetClass enum.
Quick Start
To measure the distance between a point and a plane, we need to represent them as MeasurementTargets
as follows:
The API contains two sets of functions. The first is used to perform a measurement and return the result
without creating a new measurement entity in the webvis context. These include:
The second set of functions is used to create and manage measurements as first-class entities in the webvis
context. Here, createMeasurement is used to perform different kinds
of measurements and create a new measurement entity holding the result. The available measurement types for this
scenario are defined in the MeasurementType enum. Besides this function, this set also includes:
If we want to perform the same measurement as in the quick start example, but also create a corresponding
measurement entity in the webvis context, we can use the
createMeasurement function:
// Define targets as in the quick start example...constcontext = webvis.getContext();constmeasurementId = context.createMeasurement(webvis.MeasurementType.MULTIPLE, // Analogous to measureBetween [pointTarget, planeTarget]);// We can access the result of the measurement by requesting// its propertiesconstmeasurementProperties = awaitcontext.requestMeasurementData(measurementId);constresult = measurementProperties.result;
Working With Model Geometry
In webvis, a part of a model's geometry can be referenced via a TopologyHandle. Given such a handle,
we can create a corresponding MeasurementTarget to use in measurements:
consttopologyHandle = getTopologyHandle(); // Replace with your topology handleconstedgeMeasurementTarget = {class:webvis.MeasurementTargetClass.TOPOLOGY,value:topologyHandle};
Performs a measurement and creates a corresponding measurement entity in the webvis context.
The different kinds of measurements that this function can perform are defined in the
MeasurementType enum. Depending on the measurement type, different targets are required.
Measures the distance and, if applicable, the angle between two measurement targets. The result also includes
the corresponding closest points on the targets.
If the targets intersect, the result will contain a representation of the intersection. Note that the
intersection is not available for measurements involving target classes
TOPOLOGY or NODE, except for
the cases plane-face and face-face.
Attention: This function is experimental and may be changed or removed
in future versions.
Returns points from a search space that have the specified
distance to a set of measurement targets. The search space is
defined by a measurement target. Currently only supports
a search space that is defined by a curve and
edges as distance targets.
Measures the tangent of an edge at a given point. The edge is specified by a measurement target that
points to a corresponding TopologyHandle. If the point does not lie on the edge, the closest
point on the edge is used.
Measures the thickness of a shape at a given point. The shape is specified by a measurement target that
points to a corresponding TopologyHandle. If the point does not lie on the shape, the closest
point on the shape is used. The thickness is measured along the line defined by the normal of the shape
at the given point.
MeasurementAPI
Overview
The MeasurementAPI provides functionality to:
Possible measurement inputs include nodes, shapes, faces, edges, and points, as well as planes and lines. All available input types are defined in the MeasurementTargetClass enum.
Quick Start
To measure the distance between a point and a plane, we need to represent them as MeasurementTargets as follows:
For other target types, see MeasurementTargetClass. With these targets, we can now measure the distance using the measureBetween function:
Measurement Functions
The API contains two sets of functions. The first is used to perform a measurement and return the result without creating a new measurement entity in the webvis context. These include:
The second set of functions is used to create and manage measurements as first-class entities in the webvis context. Here, createMeasurement is used to perform different kinds of measurements and create a new measurement entity holding the result. The available measurement types for this scenario are defined in the MeasurementType enum. Besides this function, this set also includes:
Creating a Measurement Entity
If we want to perform the same measurement as in the quick start example, but also create a corresponding measurement entity in the webvis context, we can use the createMeasurement function:
Working With Model Geometry
In webvis, a part of a model's geometry can be referenced via a TopologyHandle. Given such a handle, we can create a corresponding MeasurementTarget to use in measurements: