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
965 stars 232 forks source link

How to get vertices and faces of a geo_model in gempy (version '2023.2.0b1')? #854

Closed zxo102 closed 9 months ago

zxo102 commented 9 months ago

In the 69_Export_GemPy_model_into_blender example at the site https://gemgis.readthedocs.io/en/latest/getting_started/tutorial/69_Export_GemPy_model_into_blender.html, vertices and faces can be get as follows in the old version of gempy (2.3.1?) like :

`vertices, faces = gp.get_surfaces(geo_model)

Enter values to shift model

x0, y0, z0 = 0, 0, -700

Save the model for blender

for i in range(len(vertices)): np.save('vertices/' + 'vert%02d.npy' %i, vertices[i]-[x0, y0, z0]) np.save('faces/' + 'faces%02d.npy' %i, faces[i]) print(len(vertices[i]))`

Unfornately , the code

vertices, faces = gp.get_surfaces(geo_model)

does not work in the new version of gempy ('2023.2.0b1'). Anybody knows how to get vertices and faces of geo_model in the new version of gempy ('2023.2.0b1')?

Thanks a lot for your help.

javoha commented 9 months ago

Hi, if I am correct the following should get you what you need:

geo_model.solutions.raw_arrays.edges geo_model.solutions.raw_arrays.vertices

Please let us know if it solves the issue. Cheers!

AlexanderJuestel commented 9 months ago

Yep, I can confirm that these attributes return the vertices and edges

zxo102 commented 9 months ago

javoha:

The script

geo_model.solutions.raw_arrays.edges, geo_model.solutions.raw_arrays.vertices

returns the vertices and edges.

Following the example at https://gemgis.readthedocs.io/en/latest/getting_started/tutorial/69_Export_GemPy_model_into_blender.html, A gempy model can be exported to Blender correctly.

Thanks for your help.