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

AttributeError: 'float' object has no attribute 'shape' when using gp.plot_3d #823

Closed lucianomarquetto closed 10 months ago

lucianomarquetto commented 1 year ago

Hi all! I just updated Gempy to 2.3, and want to thank you all for this marvelous work!

Nonetheless, I am having an issue when trying to plot the model in 3D, as described below.

Describe the bug

When I run gp.plot_3d(geo_model, ve=200, plotter_type='background', show_topography=False, show_data=False)

I get the following error: image

And this flat view: image image

To Reproduce Provide detailed steps to reproduce the behavior:

  1. I ran the model as usual, adding surface and orientation points;
  2. The error appears after computing the model, when trying to view it in 3D. When I run the model with different z limits (-1200 m below sea level; -500 m; -250m) it does not present any issues! But tried z minimum of -200 m and -150m and the issue starts appearing. I have points below -250m, down to -1000m.

Expected behavior Expected a 3D view of the computed model.

Screenshots Not sure if this is also related, but running the model with gp.compute_model(geo_model) I get the following: image

I can view the model in 2D as usual: image

Desktop (please complete the following information):

AlexanderJuestel commented 1 year ago

Dear @lucianomarquetto, I could reproduce your error with one of my sample models so I can track down whats wrong! Thanks for posting that!

AlexanderJuestel commented 1 year ago

Looking at the geo_model.surfaces.df, you can see that two of my surfaces do not have vertices and edges. That is why it cannot be plotted. Why it is not computed is the next question...maybe @Japhiolite has an idea

image

Leguark commented 10 months ago

Yes, @AlexanderJuestel was spot on. If a surface is not present on the result the plot_3d function is not robust enough to work. I will keep it in mind moving forward to gempy v3.

I will close the issue for now but feel free to reopen it if you need more information