gempy-project / gempy

GemPy is an open-source, Python-based 3-D structural geological modeling software, which allows the implicit (i.e. automatic) creation of complex geological models from interface and orientation data. It also offers support for stochastic modeling to address parameter and model uncertainties.
https://gempy.org
European Union Public License 1.2
986 stars 235 forks source link

3d voxel representation #935

Closed Sebadita closed 2 months ago

Sebadita commented 2 months ago

Hi everyone!

Is it possible to visualize the 3d voxel of the geo_model, just like a block model?

thank u in advance!

javoha commented 2 months ago

Hi, do you have some context what you want to achieve exactly. This is not implemented in gempy but it should be rather straightforward to do in pyvista. Something like this works:

arr = geo_model.solutions.raw_arrays.lith_block.reshape(geo_model.grid.regular_grid.resolution)

vol = pv.ImageData()
vol.dimensions = arr.shape
vol["array"] = arr.ravel(order="F")

vol.plot()

Is that what you need?

javoha commented 2 months ago

I will mark this as answered, feel free to reopen if you have further questions.