2 - Terrain Generator and Image Segmentation
1.0 Introduction
This tutorial will show you how to use the new Terrain Generator to import digital elevation models from satellite data, and how to use the Image Segmentation feature to automatically assign material regions by texture.
Topics covered in this tutorial:
- Import Terrain
- Topographic Lines
- Image Segmentation
- Select Faces by Filter
Finished Product:
The finished product of this tutorial can be found in the Tutorial 02 Terrain Generator and Image Segmentation data file. All tutorial files installed with RocFall3 can be accessed by selecting File > Recent Folders > Tutorials Folder from the RocFall3 main menu.
2.0 Geometry
2.1 Import Terrain
The Terrain Generator tool allows users to create the geometry of their slope by importing the terrain using satellite imagery. The location of your terrain can be specified in several ways. Users can search an address using a civic address or they can directly enter the coordinates (latitude/longitude) for the center of the desired location. For this tutorial, we will be entering coordinates. From a new project:
- Select Geometry > Import/Export > Import Terrain
- Set the Layer as Satellite.
- Set the Region Dimensions (km) to Custom
and enter:
- Width = 1.5 km
- Height = 1 km
- Enter the Center Coordinate as 38.86295534611765, -120.071928601074 and click Set.
Note: You can copy and paste these coordinates into the Center Coordinate text box. - Check Assign Map Image as Texture, and then click Post-Processing .
2.2 Simplify and Repair Geometry
- Select Simplify Triangulation.
- Under Simplification Level select Custom > By Triangle Count and enter 25000.
Note: In the dialog you can see the Before Simplification Triangle count is over 215000, this can lead to larger compute time. - Click OK.
Note: Going back into the simplification tool will show the current new triangulation is 25000. This can be done by selecting Geometry > Surface Triangulation tools > Simplify Triangulation. - You should be redirected back into the Import Terrain dialog, select Find and Repair Defects.
- Click Repair to repair the detected defects then click Close.
Note: The Simplification and Repair Process does not remove the image texture on the terrain. Other geometric processes that can change the overall geometry of the surface can remove the texture. - Select Done to close the Import Terrain dialog.
You will notice that it is difficult to make out the image of the terrain. Select the Terrain by clicking on it in the Visibility Tree. In the Properties pane change the Transparency to 0%. Deselect the slope by either clicking in the view outside the slope or using the Clear Selection toolbar option.
2.3 Set Slope Surface
When you're done editing the slope:
- In the Visibility Tree, select the Terrain we just simplified and repaired.
- Select Geometry > Set Slope Surface menu option.
2.4 Show Topographic Lines
- Select Annotate > Topographic Lines
in the menu.
- In the Visibility Tree, ensure the Topographic Annotation is selected to view the options in the Properties Pane below.
- Go to the Properties Pane, change the Spacing to 100 and check Show Colors.
The topographic lines turn the model into a topographical map. It can serve as a visual aid to place slope-dependent elements (such as seeders and barriers).
3.0 Slope Materials and Seeder
3.1 Define Materials
We're going to define 3 materials for this model.
- Select Materials > Define Materials
in the menu.
- Define the following 3 materials:
Name | Normal Restitution | Distribution | St. dev. / Rel.Min / Rel.Max | Tangential Restitution | Distribution | St. dev. / Rel.Min / Rel.Max | Friction Angle (o) |
Hard | 0.7 | Normal | 0.04 / 0.12 / 0.12 | 0.85 | Normal | 0.04 / 0.12 / 0.12 | 20 |
Soft | 0.5 | Normal | 0.04 / 0.12 / 0.12 | 0.8 | Normal | 0.04 / 0.12 / 0.12 | 20 |
Water | 0.0 | None | - | 0.0 | None | - | 90 |
Change the color of the water material to Light Blue.
3.2 Add New Material Regions
3.2.1 Automatically Assign Materials by Texture (Image Segmentation)
The new image segmentation feature in RocFall3 uses the imported surface textures to automatically assign the material regions. We will use this feature to set up the areas of hard and soft surfaces.
- Select Materials > Automatically Assign Materials by Surface Texture
- The Number of Segmentations option allows you to change the color definition of the image, we will keep it a value of 2.
- Each material can be defined on the map using the colors in the Segmentations Section, select the colors and assigned materials shown in the Image below.
- Close the dialog by clicking Ok.
The Image below showcases the material assignment. You can see that the lakes have been identified as soft. In order to define the 2 water bodies, we will need to custom override the material regions of interest. This will be done by drawing water regions.
3.2.2 Drawing Water regions
- Select the Material Regions tab (located next to the Visibility Tree).
- Click Draw New Regions.
- Select The Water Property and click OK.
- We're now in the Draw Polyline mode for defining the polygonal region with the Water material assignment. There are 2 lakes in the East side of the terrain. Roughly draw the outline of the southern most lake. Right-click and select Done when finished defining the polygon.
- Repeat the same steps for defining the northern most lake.
If you want to use the exact values for this model, navigate to and open the provided .txt files in the Tutorials folder or you can download the files linked below. Select the import option in the Edit Polyline dialog and import the Tutorial 02 Water Region 1.txt and Tutorial 02 Water Region 2.txt files for regions 1 and 2.
Click on the Tree tab in the Visibility pane to exit out of the Edit Material Regions mode.
3.3 Add Line Seeder
- Change to the Seeders Flow Tab.
- Select Seeders > Define Seeder Properties in the menu.
- Set the Number of Rocks to 300.
- Leave all other values at their default and click OK to close the dialog.
- Select Seeders > Add Line Seeder
in the menu.
- Select Height Above Surface and put in a height of 3 m.
- Click Add Points on Viewport and draw the seeder line by tracing along the mountain ridge.
- Click Done once you’re done drawing the line.
- Click OK to close the dialog.
If you want to use the exact values for this model, navigate to and open the provided Tutorial 02 Line Seeder.txt file in the Tutorials folder. Alternatively, you can save the .txt file by right-clicking the link and selecting Save Link As. To import values for a line seeder, first draw a polyline by selecting Geometry > Draw Polyline, and then import the provided txt file in the Edit table option. Select the Polyline and then convert it into a line seeder by selecting Seeder > Add Line Seeder from Polyline.
4.0 Compute
Click on the Compute icon in the toolbar (or select Analysis >
Compute in the menu).
5.0 Results
This model is a great example to showcase the difference between 2D and 3D models. It's obvious to see how the paths turn and congregate at local valleys. For creating sections at desired locations and exporting them to RocFall2, see this tutorial: RocFall2 Section Creator.