Measurements
What is it?
The Measurement
tool allows you to measure 3D space using three different measurement types:
The
Distance
option allows you to measure the distance between two arbitrary points in 3D space. If the measurement line spans a long distance, it represents a geodesic distance, that is, the shortest path between two points on the Earth's surface.The
Orthogonal
option allows you to measure the distance between two points in 3D space, together with its orthogonal segments - the vertical and the horizontal line, and the angle between the measurement line and the horizontal segment.The
Area
option allows you to measure the surface and the perimeter of the area shape.
You can additionally choose the measurement mode that determines how the 2D cursor positions will be interpreted in 3D space. The possible options are:
Closest Surface
- The closest 3D point that is painted under the cursor position.Plane-projected
- The orthogonal projection of the 3D point obtained with the previous method on the measurement plane.Plane-cast
- The 3D point on the measurement plane under the cursor position.
The last two modes require you to create a plane in 3D space on which the measurement shape will eventually be placed. This constraining plane is defined by three arbitrary points that you place before performing a measurement.
StartApp locally stores your measurements in the browser. If you start your next StartApp session in the same browser, it shows you the measurements it stored previously.
How to measure from the UI
To start measuring in HxDR StartApp:
- Slide open the Measurements drawer by clicking the Measurements ruler icon in the left navigation bar.
HxDR StartApp opens the Measurements drawer on the left. It also shows a selection bar with the measurement types at the bottom of the map. - Select your measurement mode and type, and create your measurement on the map. See Measure distances, Measure orthogonal distances and angles, and Measure areas and perimeters for more information.
- To save the measurement results, enter a name for the measurement in the Save Measurement box, and click Save.
If you don't want to save the measurement, click Cancel.
The Measurements drawer lists your saved measurements. They remain visible on the map.
To re-center the map on a specific measurement, click the Re-center icon with the saved measurement.
To make a measurement invisible, click the Eye icon.
Measure distances
To measure a distance on the map:
- Select a measurement mode. Click the ... in the top right corner of the measurement bar, and select the mode from the Mode drop-down menu.
- Select the Distance type in the measurement bar on the map. Skip the next step if you selected the Closest surface measurement mode, and go to step 4.
- The white + cursor on the map indicates that you can start defining your measurement plane. Click 3 times to set the plane position and rotation.
- Click to mark the first polyline point of your measurement on the map.
- Keep clicking to add more polyline points.
HxDR StartApp shows you the measured distances for each polyline segment. - To finish your measurement, double-click to indicate the final polyline point.
- Save or discard the measurement results.
Measure orthogonal distances and angles
To create your orthogonal measurement:
- Select a measurement mode. Click the ... in the top right corner of the measurement bar, and select the mode from the Mode drop-down menu.
- Select the Orthogonal type in the measurement bar on the map. Skip the next step if you selected the Closest surface measurement mode, and go to step 4.
- The white + cursor on the map indicates that you can start defining your measurement plane. Click 3 times to set the plane position and rotation.
- Click to mark the first point of your measurement. This is the first vertex of an orthogonal triangle.
- Move the mouse to create the perpendicular triangle sides.
- Click to mark the completion of your measurement triangle.
HxDR StartApp shows you the measured distances for each triangle side, and the angle of the first triangle vertex. - Save or discard the measurement results.
Measure areas and perimeters
Measuring an area in 3D space accurately can be tricky. It's recommended to get some practice in first with the measurement of flat surfaces and convex flat shapes.
To measure an area or perimeter:
- Select a measurement mode. Click the ... in the top right corner of the measurement bar, and select the mode from the Mode drop-down menu.
- Select the Area type in the measurement bar on the map. Skip the next step if you selected the Closest surface measurement mode, and go to step 4.
- The white + cursor on the map indicates that you can start defining your measurement plane. Click 3 times to set the plane position and rotation.
- Click to mark the first polygon point of your measurement on the map.
- Keep clicking to add more polygon points, and create more segments.
HxDR StartApp displays the length of each polygon segment you add, and displays the calculated area for the polygon shape you are drawing.INFOStartApp builds up the area 3D polygon as a set of triangles fanning out from a center point. Each time you add a segment to the 3D polygon, StartApp defines a triangle between the center point, the previous polygon point, and the polygon point you are adding.
- To finish your measurement, double-click to indicate the final polygon point.
- Save or discard the measurement results.
How to measure from code
Use the MeasurementSupport
that is created in App.tsx
.
Measurements exist on 2 levels:
- The generic
Measurement
represents everything that LuciadRIA needs to display a measurement like corner points, and total distance. - The
MeasurementWrapper
object, which contains oneMeasurement
and additional metadata like an id and name. These are the objects that are persisted in the browser's local storage by HxDR StartApp.
//Start the interaction where a user can create a measurement on the map.
//The type defines what the measurement type is like distance or area for example.
//The projection defines how the user's gestures are interpreted to create the measurement points, like ray-casted to a
//plane defined at the start of the interaction for example.
support.startMeasurement(type, projection)
//You can also add measurements programatically, which is useful if you want to load persisted measurements.
const ref = getReference("CRS:84");
measurementSupport.addMeasurementWrapper({
id: "0",
name: "My Measurement",
expanded: true,
fitPosition: {
eye: {x: 4572469, y: 277521, z: 4772592}, //eye points are implicitely defined in EPSG:4978 (3D world coordinates)
pitch: -85,
yaw: 45,
roll: 0,
},
measurement: createMeasurement(
MeasurementType.DISTANCE,
[
createPoint(ref, [2.5, 45.3, 5]),
createPoint(ref, [4.5, 47.5, 5]),
]
)
})