3D Area Tool, developers perspective

New 3D Area Tool in our viewer

Since version 2.5 we offered a 2D area tool that calculates the area projected to the ground surface. And an area tool that computes the area projected to a plane that derives from the first three points.

The second one is now deprecated in favour of our new 3D area tool introduced with version 2.6. The new area tool allows you to calculate any surface area as long as it doesn't overlap. The tool achieves this by connecting all the selected vertexes to triangles. Thus the triangulation generates a triangle mesh which allows calculating the area quickly.

To generate the triangles, we use the Delaunay algorithm. If the Delaunay algorithm operates in 3D, it produces pyramides instead of triangles. Therefore we reduce the points into the two dimensions. That's the reason why this tool only works as long as none of the selected points overlap. Thus to be technically correct, this tool should be called the 2.5D area tool. But because our goal is to create tools that are easy to use for every level of experience, we decided to name it the 3D area tool.

Another caveat of the Delaunay algorithm is that it only creates convex shapes.

The Delaunay algorithm always cerates convex shapes.

In the early stage of the development, we realized that such a shape is very often impractical. Therefore, we decided to come up with a solution to create a hull that defines the mesh's shape. Now the 3D area tool has two steps. The first step lets you specify the shape. In the second step, you can select the vertexes of the mesh. In the background, the tool checks which triangles are inside the hull and disables all the other ones. To check if a triangle lies inside or outside, we use raytracing from the centre of the triangle.

All these calculations happen in a fraction of a second. And they repeat every time a point is added or edited. The result is an accurate area measurement which allows measuring all sorts of trains from every angle.


Full Stack Development
Matthias Keim, dott.