Chapter 18 | Using Point Clouds for Terrain


Introduction

In Virtual CRASH 3 the user can import .dxf files into the simulation environment. Point clouds are a great way to document scene evidence and can provide a surface geometry data which can be used in vehicle simulations. In this write-up we demonstrate how one can easily convert a point cloud data file into .dxf format for use in Virtual CRASH. 

You may find a video of the resulting animation online below: 

Obtain Aerial Photograph and Import

First, we obtained an aerial photograph of our accident scene using Google Earth (see next two figures below) [1], [2].

Import Point Cloud into Surface Building Utility 

In this case, a 3D laser scanner was used to scan a residential neighborhood road. The data was stored to .pts format. The free application CloudCompare v2.6.2 was used to visualize and pre-process to remove unneeded points [3]. Below we review the steps needed to convert a point cloud file to a surface mesh which can then be imported into Virtual CRASH 3. Note, in our example, the point cloud file was stored in distance units of meters, and Virtual CRASH 3 assumes .dxf geometries are also in meters, so no further conversions were required; however, if conversion is necessary, points can be easily rescaled within the CloudCompare application.

Open Datafile in Cloud Compare

CloudCompare is a very powerful point cloud application which can be used for visualization and manipulation of point clouds. Open your file in CloudCompare.

Change Views and Trim Points

Using the orthographic view icons on the left side, change your view of your point cloud to orthographic top down view.

Use the Segment tool (File > Segment) to draw a polygon around the points you wish to remove from your cloud, then press the “Segment Out” button (see next two figures below).

Note, each time you wish to trim additional points, you must first press the “unpause” button.

When you’re finished trimming points, press the green check mark.

Inspect the other orthographic views to ensure unneeded points from objects such as trees are also removed (see next three figures below).

Resampling (Edit > Subsample) your points to reduce the point cloud density can help speed up the surface creation process and make it less computationally intensive. In CloudCompare, the user can specify the average spacing between points by (see next two figures below).

Carefully ensure that any artifacts or extraneous points floating above the road surface are removed using this same procedure (see next two figures below).

Once you are satisfied with your trimmed point cloud, save to a .ply file. 

Create Surface Normals

Open your .ply file in free application MeshLab [4].

Once your .ply file is opened in MeshLab, you will need to first have MeshLab find the surface normal vectors. Do this by selecting “Filters > Point Set > Compute normals for point set” (see next two figures below).

You can visualize the result of the process by selecting “Render > Show Normal/Curvature.”

If the surface normal vectors are pointing in the opposite direction from the direction they should be pointing in, you will likely need to flip the normal for the final surface mesh created in the next step.

Create Surface

Finally, create your surface mesh by selecting “Filters > Point Set > Surface Reconstruction Poisson.”

Note as you increase the Octree Depth setting, the level of detail in the surface mesh increase, as does the computational time to converge to a solution fit to your points.

You should see a mesh sitting on top of your points.

Depending on how the solver converged onto your points, you will likely have to trim away excess polygons outside of the volume of your points using the polygon delete tool.

You may also need to trim away bubble features which can occur near the edges of holes in your point cloud coverage. Finally, save the surface mesh to .dxf format [5].

Import Surface Mesh into Virtual CRASH

Import your .dxf surface mesh into Virtual CRASH 3 (see next two figures below).

Using the rotation and translate tools, align your surface mesh in the appropriate configuration over your aerial photograph. Enable the “receive projection” option so that your mesh projects the color maps of the aerial photo and other graphical elements which sit beneath it.

Set Mesh Object to Terrain and Simulate

With your mesh object selected in Virtual CRASH, select “Create > Physics > Make Unyielding / Terrain from Selection.” This will allow vehicles to interact with the mesh as a terrain object. Once the terrain has been placed within the scene, a simulation can be created using this new terrain in just minutes (see next two figures below) [6].


Notes:

[1] The process of importing Google Earth (or scale diagrams) is described in Chapter 9 | Scaling Images and can also be seen at: https://youtu.be/z5utwWWcMCE

[2] You can find the aerial photo used in this tutorial online at: http://www.vcrashusa.com/s/GoogleEarth_PointCloud.png

[3] CloudCompare can be obtained for free online at: http://cloudcompare.org/

[4] MeshLab can be obtain for free online at: http://meshlab.sourceforge.net/

[5] You can find the .dxf file in this tutorial online at: http://www.vcrashusa.com/s/PointCloud_DXF.dxf

[6] The process of creating bicycle and motorcycle simulations is described in Chapter 14 | Staging Bicycle & Motorcycle Impacts.




© 2020 Virtual CRASH, LLC. All Rights Reserved