.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "examples/TPMS/spherical.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_examples_TPMS_spherical.py: Spherical gyroid shell ====================== A gyroid surface mapped onto a spherical coordinate frame with :class:`microgen.SphericalTpms`. .. GENERATED FROM PYTHON SOURCE LINES 8-28 .. code-block:: Python import pyvista as pv from microgen import SphericalTpms from microgen.shape.surface_functions import gyroid def swapped_gyroid(x, y, z): return gyroid(x=z, y=y, z=x) geometry = SphericalTpms( surface_function=swapped_gyroid, offset=0.5, repeat_cell=(1, 10, 20), radius=3, resolution=50, ) surface = geometry.surface .. GENERATED FROM PYTHON SOURCE LINES 29-35 .. code-block:: Python plotter = pv.Plotter() plotter.add_mesh(surface, smooth_shading=True, color="#ef7d2d") plotter.view_xy() plotter.enable_parallel_projection() plotter.show_axes() plotter.show() .. image-sg:: /examples/TPMS/images/sphx_glr_spherical_001.png :alt: spherical :srcset: /examples/TPMS/images/sphx_glr_spherical_001.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 16.427 seconds) .. _sphx_glr_download_examples_TPMS_spherical.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: spherical.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: spherical.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: spherical.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_