.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "examples/TPMS/tpms_sphere.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_tpms_sphere.py: Spherical gyroid ================ Intersection of a gyroid sheet with a sphere, computed with a boolean operation on the surface meshes. .. GENERATED FROM PYTHON SOURCE LINES 8-27 .. code-block:: Python import pyvista as pv from microgen import Tpms, surface_functions geometry = Tpms( surface_function=surface_functions.gyroid, offset=0.3, repeat_cell=3, resolution=30, ) shape = geometry.generate_surface_mesh(type_part="sheet") shape = shape.flip_faces() sphere = pv.Sphere(radius=1.45) result = shape.boolean_intersection(sphere) result.save("tpms_sphere.vtk") .. GENERATED FROM PYTHON SOURCE LINES 28-29 .. code-block:: Python result.plot(smooth_shading=True, color="#ef7d2d") .. image-sg:: /examples/TPMS/images/sphx_glr_tpms_sphere_001.png :alt: tpms sphere :srcset: /examples/TPMS/images/sphx_glr_tpms_sphere_001.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 40.368 seconds) .. _sphx_glr_download_examples_TPMS_tpms_sphere.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: tpms_sphere.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: tpms_sphere.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: tpms_sphere.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_