Skip to content

Creating a Geologic Model Using Gempy

bsomps edited this page Feb 28, 2025 · 34 revisions

GemPy Modeller

This operator uses the GemPy v3 module to compute geological surfaces from orientation and formation data. The workflow integrates with Blender's georeferenced 3D environment, allowing users to create geologically and spatially accurate models.

Gempy_example.mp4
Gempy_example2.mp4
gempy_example4.mp4

Overview

The GemPy Modeller feature enables users to:

  • Set model extents using a cube object in the Blender scene.
  • Define formations and orientations based on objects in specified collections.
  • Organize formations into stratigraphic or fault series with customizable relations.
  • Generate surfaces (and lith blocks) for each stratigraphic or fault series using the GemPy engine.

Key Features

  1. Georeferenced Extents: Define model boundaries using a cube object to set xmin, xmax, ymin, ymax, zmin, and zmax.
  2. Formation and Orientation Data: Extract custom properties (e.g., azimuth, dip) from objects to create input CSV files for GemPy.
  3. Series Management: Organize formations into stratigraphic or fault series, with user-defined order and relations (e.g., Erode, Onlap, Basement).
  4. Surface Generation: Compute and visualize geologic surfaces directly in Blender.
  5. Lith Block Generation Check box of optional creation of lith blocks

Input Data

  • Use the drill hole importer or point data importer to add your data into the Blender scene.
  • Input data can be either curve object collections (drill hole interval data) or mesh objects collections (point data).
  • If point or interval data is brought in with fields (ie columns in your CSV)Azimuth, Dip, and Polarity then your custom properties in Blender will reflect these values, if not, then Azimuth, Dip, and Polarity fields will auto-populate with azimuth=0, dip=0, and polarity=1. The name field can be generated using the manager operator. For example, if you stylize your objects based on the a categorical property called rock type then this rock type name will become the name in the outliner.

Step-by-Step Guide

1. Define Model Extents

  • Create a cube object in the scene and position it to enclose the area of interest. TIP -- Set the cube object to appear as wireframe so you can see what it encompasses.
  • Select the cube in the "GemPy Modeller" panel as the Extents Object.
  • The cube's bounding box will define the model extents (xmin, xmax, ymin, ymax, zmin, zmax).

2. Name the Model and Set the Refinement level (octree levels)

  • Name the model (can use spaces)
  • Define a level of refinement (recommendation = 6). Higher refinement levels increase computational costs.

3. Select Structral Data Format.

  • Under Data Uses choose either dip direction (i.e. azimuth) or right-hand rule (i.e. strike)
  • important to choose this before step #4

4. Select Data Collections

  • In the "GemPy Modeller" panel, choose collections containing formation objects and orientation objects (These can be the same collection):
    • Formations Collection: Mesh or curve objects representing the positions of the base of geological formations. (for example if Sandstone contacts Siltstone along its lower contact, and Limestone along its upper contact, the xyz location for Sandstone is where it contacts Siltstone) Note that the code generate a CSV compatible with GemPy based on the selected collection. This means each object will become a row in the CSV file and derive the name from the name presented in the outliner, the x, y, and z location from the true xyz location in blender.
    • Orientations Collection: Objects with custom properties (azimuth, dip, polarity) representing structural orientations. Note that the code generate a CSV compatible with GemPy based on the selected collection. This means each object will become a row in the CSV file and derive the name from the name presented in the outliner, the x, y, and z location from the true xyz location in blender., and the azimuth, dip and polarity from the custom properties.
  • Check your console to view where the generated CSV file was saved. Your CSV file(s) should have these exact names;

for formations:

formation x y z

For Orientations (or formations and orientations as one):

formation x y z azimuth dip polarity

NOTE you'll notice in your outliner that if you have 10 objects named 'Sandstone' that they will appear Sandstone.001, Sandstone.002, Sandstone.003 ect.. this is OK, when the code generates the CSV for GemPy, it removes all concatenated numbers so they will appear as just 'Sandstone'

5. Organize Series

  • Add Stratigraphic Series or Fault Series:
    • Stratigraphic series can be set to Erode, Onlap, or Basement.
    • Fault series are automatically categorized as Fault.
  • Specify the order of each series to represent geologic time (0 = youngest).
  • Use the check boxes in the panel to assign formations to each series.

6. Compute the Model

  • Click the Compute Model button to generate geological surfaces.
  • GemPy will calculate surfaces based on the input extents, formations, orientations, and series relations.

7. Visualize the Model

  • The computed surfaces are added as mesh objects to a new collection in Blender.
  • If selected, the lith blocks are added as mesh objects to the scene and collection.
  • Each surface/lith block mesh is assigned a unique material with colors derived from the GemPy series.

Notes and Limitations

  • Refinement Levels: Adjust refinement (default = 6) for smoother or coarser surfaces.
  • Fault Relations: Fault relations are dynamically created based on series order.
  • Console Feedback: Check the Blender Console (Window → Toggle System Console) to view the stack relations and other details during model computation.

Tips for Efficient Modelling

  • Ensure all objects in the selected collections have the necessary custom properties (azimuth, dip, polarity) filled out correctly.
  • Ensure clear and consistent naming to simplify organization. Always check your formations and orientations collections to ensure naming looks correct and no other objects ended up in the collection before computation If manually selecting points to use for modelling, move them all to a collection and use Batch Rename as you see fit (Edit -> Batch Rename).
  • When adjusting azimuth, dip or polarity fields within Blender's UI, you can copy any items custom properties to all that you have selected (right click -> copy to selected)
  • Work with small-to-moderate-sized datasets for optimal performance. large one will have long processing times.
  • Take advantage of Blender's extensive editing options once the surfaces are generated (smoothing, re-color, move vertices, boolean clips ect..)

For more details about GemPy, visit the GemPy documentation.

Clone this wiki locally