.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "tutorials/ch1_fundamentals/ch1_7_3d_visualization.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code .. rst-class:: sphx-glr-example-title .. _sphx_glr_tutorials_ch1_fundamentals_ch1_7_3d_visualization.py: 1.7: 3-D Visualization ====================== .. GENERATED FROM PYTHON SOURCE LINES 8-9 Importing GemPy .. GENERATED FROM PYTHON SOURCE LINES 9-15 .. code-block:: Python import gempy as gp import gempy_viewer as gpv from gempy import generate_example_model from gempy.core.data.enumerators import ExampleModel # sphinx_gallery_thumbnail_number = 2 .. GENERATED FROM PYTHON SOURCE LINES 16-19 Loading an example geomodel ~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. GENERATED FROM PYTHON SOURCE LINES 21-27 .. code-block:: Python geo_model = generate_example_model(ExampleModel.GRABEN) gp.compute_model(geo_model) .. rst-class:: sphx-glr-script-out .. code-block:: none Surface points hash: 8c72af50fc56389b620c6458a6af23915b121b5e655b3ce179a790636dc529a5 Orientations hash: 87cf30b08b5be03b38c5e6d288fa7bb8855263704efb62c7c3cd77673eaae96d Setting Backend To: AvailableBackends.PYTORCH /home/leguark/gempy/gempy/core/data/geo_model.py:115: UserWarning: Both octree levels and resolution are set. The default grid for the `raw_array_solution`and plots will be the dense regular grid. To use octrees instead, set resolution to None in the regular grid. warnings.warn("Both octree levels and resolution are set. The default grid for the `raw_array_solution`" Setting Backend To: AvailableBackends.PYTORCH /home/leguark/gempy/gempy/core/data/geo_model.py:115: UserWarning: Both octree levels and resolution are set. The default grid for the `raw_array_solution`and plots will be the dense regular grid. To use octrees instead, set resolution to None in the regular grid. warnings.warn("Both octree levels and resolution are set. The default grid for the `raw_array_solution`" .. raw:: html
Solutions: 6 Octree Levels, 8 DualContouringMeshes


.. GENERATED FROM PYTHON SOURCE LINES 28-31 Basic plotting API ------------------ .. GENERATED FROM PYTHON SOURCE LINES 34-37 Data plot ~~~~~~~~~ .. GENERATED FROM PYTHON SOURCE LINES 39-47 .. code-block:: Python gpv.plot_3d( model=geo_model, show_surfaces=False, show_data=True, show_lith=False, image=False ) .. image-sg:: /tutorials/ch1_fundamentals/images/sphx_glr_ch1_7_3d_visualization_001.png :alt: ch1 7 3d visualization :srcset: /tutorials/ch1_fundamentals/images/sphx_glr_ch1_7_3d_visualization_001.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-script-out .. code-block:: none .. GENERATED FROM PYTHON SOURCE LINES 48-51 Geomodel plot ~~~~~~~~~~~~~ .. GENERATED FROM PYTHON SOURCE LINES 53-55 .. code-block:: Python gpv.plot_3d(geo_model, image=False) .. image-sg:: /tutorials/ch1_fundamentals/images/sphx_glr_ch1_7_3d_visualization_002.png :alt: ch1 7 3d visualization :srcset: /tutorials/ch1_fundamentals/images/sphx_glr_ch1_7_3d_visualization_002.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-script-out .. code-block:: none .. GENERATED FROM PYTHON SOURCE LINES 56-64 LiquidEarth Integration ~~~~~~~~~~~~~~~~~~~~~~~ Beyond the classical plotting capabilities introduced in GemPy v3, users can now also upload models to LiquidEarth. `LiquidEarth `_ is a collaborative platform designed for 3D visualization, developed by many of the main `gempy` maintainers, with a strong focus on collaboration and sharing. This makes it an excellent tool for sharing your models with others and viewing them across different platforms. To upload a model to LiquidEarth, you must have an account and a user token. Once your model is uploaded, you can easily share the link with anyone. .. GENERATED FROM PYTHON SOURCE LINES 66-76 .. code-block:: Python link = gpv.plot_to_liquid_earth( geo_model=geo_model, space_name="ch1_7_3d_visualization", file_name="gempy_model", user_token=None, # If None, it will try to grab it from the environment grab_link=True, ) print(f"Generated Link: {link}") .. rst-class:: sphx-glr-script-out .. code-block:: none Generated Link: https://liquidearth.app.link/1caa2e99-80fd-4f79-ba3f-a5a26de6013e .. GENERATED FROM PYTHON SOURCE LINES 77-78 Now we can use `this link `_ to visualize the model in Liquid Earth. .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 32.195 seconds) .. _sphx_glr_download_tutorials_ch1_fundamentals_ch1_7_3d_visualization.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: ch1_7_3d_visualization.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: ch1_7_3d_visualization.py ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_