After filtering the point clouds in PCPro, you will move to Cloud Compare for further refining of the point clouds and construction of the volume. As a reminder, at this point you should have a working folder on the desktop that contains three exports from PCPro: the top point cloud, the bottom point cloud, and a summary of the PCPro settings.
Adding Point Clouds and Clipping #
- Select the [context number]_top and [context number]_base files from the folder you saved them in, and drag them into Cloud Compare.
- Select the two point clouds in the DB Tree panel and Select Edit > Clone. This will create duplicates of the point clouds that you can work with while preserving the originals. You can then delete the original point clouds from the DB Tree panel; if you decide to keep them, unselect them and make sure you are always working with the clones.
- The next step is to remove extraneous points from the point clouds. This may involve trial and error depending on the complexity of the context in question, so you are encouraged to experiment with this step to get a sense for what methods work for you. Below are some general guidelines.
Clipping Manually #
Follow these instructions to manually clip the point clouds and to remove extraneous points:
- First, select the point cloud you want to edit in the DB Tree and click “Segment” (the icon for which looks like a pair of scissors). The following toolbar will appear on the screen:
- You will select points by drawing a polygon around them. Left click to place the vertices and right click to finalize the polygon. Depending on how you drew the polygon, select either “Segment In” or “Segment Out.” If you wish to start over, click the red X.
- When you are happy with the polygon you have drawn, click the green check. The former point cloud will be divided into two, [name].segmented and [name].remaining.
- If you have used the “Segment In” too, the [name]_segmented layer will contain everything inside your polygon.
- If you have used the “Segment Out” tool, the [name]_segmented layer will contain everything outside your polygon.
- Determine which layer contains the points you wish to keep (usually [name]_segmented); the other layer can be deleted to keep the DB Tree panel more manageable.
- You cannot draw multiple polygons in a single segmenting action, so you may have to repeat this process multiple times to produce a properly trimmed point cloud. Note: when creating the mesh, the program will utilize ALL points, so any extraneous points left will be included in the mesh, even if they are not “inside” the volume.
HINT: Computing Normals for one point cloud and leaving the other as is can make it easier to see where the point clouds overlap/intersect. Also, if you are working on a very complex context, filtering the point clouds in PCPro to have a higher percentage of points remaining can make it much easier to see the surfaces you are trying to isolate, though this will increase the processing time in PCPro.
Clipping with the Spatial Context Polygon #
If the top and base point clouds retain many points the extend beyond the target context, it can be helpful to clip by the spatial context polygon, a two-dimensional illustration drawn by the excavation area supervisor or assistant. You do need to be careful with this technique; clipping by the spatial context polygon can sometimes remove important points accidentally. Follow these instructions to create and use the spatial context polygon:
- First, ask a supervisor to give you access to the spatial context polygon layer for the excavation area you are working on; how you access this layer will differ depending on whether the area is under active excavation.
- Open an empty QGIS project (or one that you have created for this task) and add the spatial context polygons layer. Open the attribute table and select the entry for the target context.
- Right click on the layer in the Layers pane, select Export > Save Selected Feature As.
- Set the format to ESRI shapefile.
- Next to File Name, click the three dots to name the file and save it to the working folder on your desktop. The filename should be [context number].shp.
- Next, you need to transform the polygon in a couple of ways. Bring the shapefile back into QGIS and do the following in any order:
- To ensure that the coordinates of the polygon match those of the point cloud, the polygon coordinates need to be translated. In the Processing Toolbox, find “Translate” under Vector Geometry. Set the offset for the x value to -580,000, and the offset for the y value to -4,274,000. You can either create a temporary layer, or save this layer to the working folder.
- To ensure that important parts of the point clouds are not clipped out with the spatial context polygon, it is a good idea to add a buffer around the polygon. A 5 cm buffer is a good standard, but you may want to increase or decrease that buffer for a given context. In the Processing Toolbox, find “Buffer” under Vector Geometry. Set the Distance to your preferred buffer, ensuring that the units are centimeters rather than meters (the default). You can either create a temporary layer, or save this layer to the working folder.
- Once you have transformed the spatial context polygon as necessary, save the final version in the working folder with the file name [context number]_translated.shp.
- You can then bring the translated shapefile into CloudCompare with the point clouds. Select the preset top view to see the polygon; then Segment the point clouds as described above, using the spatial context polygon as the segmenting polygon.
Computing Normals #
- Once the point clouds are trimmed sufficiently, go to Edit > Normals > Compute. In the dialog box under “Surface approximation” select “Triangulation” and hit Ok.
- The different options for surface approximation might be appropriate for different circumstances. We will almost always use “Triangulation,” which is best for sharp edges but not does deal well with noise. “Planar” does well with noise, but is not good at sharp edges, and “Quadratic” is best for smooth, curved surfaces.
- After computing normals, go again to Edit > Normals > Invert. This impacts how light (digitally) interacts with the normal and is preferable for mesh construction.
- At this point, it is recommended that you save the clipped top and base point clouds to the working folder. Select each point cloud in turn and go to File > Save. Name the point cloud appropriately (e.g., “33_base”) and save as a .ply file in ASCII format.
Creating the Mesh #
HINT: The Poisson Surface Reconstruction tool works best on closed volumes. If there is a hole in the point clouds, the tool will create a “bubble” in the mesh that represents the tool interpolating across the hole. Ideally, if the mesh has a bubble, you should return to a previous step to close the hole. If this is not possible, it is possible to edit the mesh itself.
- The next step is to merge the two point clouds into a single point cloud. Before you do so, clone the clipped point clouds; merging cannot be undone, so you should not merge the original point clouds in case you wish to edit them again. Then, select the cloned point clouds in the DB Tree and either go to Edit > merge or click the Merge icon on the bar at the top of the screen.
- Once you have a merged point cloud, select it and go to Plugins > Poisson Surface Reconstruction. In the dialog box, make sure you click the box for “output density as SF.” This will produce a mesh from the merged point cloud.
- Select the mesh in the DB Tree panel, and the Properties for the mesh will become visible. Important properties include:
- Color: can be set to either RGB (which uses the RGB data from the point clouds to approximate the colors of the surface; this is what the final volume should look like) or Scalar Field (which uses a gradient to show the confidence of interpolation different parts of the mesh).
- SF Display Patterns: This histogram again uses a gradient to show the confidence of the interpolation of different parts of the mesh. By adjusting the histogram, it is possible to remove the parts of the mesh with the least confidence and therefore to remove bubbles. Note, however, that removing bubbles with the histogram can sometimes leave holes in the mesh (which is hollow rather than solid).
- If there are bubbles in the mesh that cannot be removed in any other way and if it does not create holes, you can adjust the SF histogram to remove the bubbles and create a new mesh. Once you are happy with the way the histogram has been adjusted, go to Edit > Scalar Fields > Filter by Value. This will pull up a dialog box with the values in the current histogram. When you click Ok, a new trimmed mesh will be added to the DB Tree.
- Once you have produced a mesh that you are happy with, select the mesh in the DB Tree and go to File > Save. Name the file [context number]_mesh and save it in ASCII format as a .ply file to the working folder.
- You are now ready to move the files to the main server for final checks.
- Copy the mesh and the top and base point clouds and paste them into the E: drive. These should go into a subfolder called “Check” inside gygaia\3Dspatial\processed\[EA]\context_volumes\[mesh/top/bottom].
- Open the Master Volume Tracking Google Sheet and mark the volume as “Ready to Check,” adding any other notes you feel are necessary.
- Keep the working folder and all its files on your desktop for now, in case reprocessing or edits are necessary.