.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "examples/TPMS/infill_graded_distance.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_infill_graded_distance.py: Infill graded by the distance to the surface ============================================ Fill the Stanford bunny with a gyroid whose offset is given by :class:`microgen.NormedDistance`: thin near the skin, thick in the core. The infill is clipped to show the inside. .. GENERATED FROM PYTHON SOURCE LINES 9-33 .. code-block:: Python import pyvista as pv from pyvista import examples from microgen import Infill, NormedDistance from microgen.shape.surface_functions import gyroid mesh = examples.download_bunny() offset = NormedDistance( obj=mesh, boundary_offset=0, furthest_offset=3.0, boundary_weight=1.0, ) infill = Infill( obj=mesh, surface_function=gyroid, cell_size=0.015, offset=offset, resolution=5, ) .. GENERATED FROM PYTHON SOURCE LINES 34-39 .. code-block:: Python pl = pv.Plotter() pl.add_mesh(infill.sheet.clip("z", origin=mesh.center_of_mass()), color="#ef7d2d") pl.add_axes() pl.view_xy() pl.show() .. tab-set:: .. tab-item:: Static Scene .. image-sg:: /examples/TPMS/images/sphx_glr_infill_graded_distance_001.png :alt: infill graded distance :srcset: /examples/TPMS/images/sphx_glr_infill_graded_distance_001.png :class: sphx-glr-single-img .. tab-item:: Interactive Scene .. offlineviewer:: /home/runner/work/microgen/microgen/docs/examples/TPMS/images/sphx_glr_infill_graded_distance_001.vtksz .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 3.543 seconds) .. _sphx_glr_download_examples_TPMS_infill_graded_distance.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: infill_graded_distance.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: infill_graded_distance.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: infill_graded_distance.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_