.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "examples/TPMS/tpms_surfaces.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_surfaces.py: Available TPMS ============== The surface functions available in :mod:`microgen.shape.surface_functions`: Neovius, gyroid, Schwarz D, Schwarz P, honeycomb, Schoen IWP, Schoen FRD, Fischer-Koch S and PMY. .. GENERATED FROM PYTHON SOURCE LINES 9-49 .. code-block:: Python import numpy as np import pyvista as pv from microgen import Tpms from microgen.shape import surface_functions surfaces = [ surface_functions.neovius, surface_functions.gyroid, surface_functions.schwarz_d, surface_functions.schwarz_p, surface_functions.honeycomb, surface_functions.schoen_iwp, surface_functions.schoen_frd, surface_functions.fischer_koch_s, surface_functions.pmy, ] meshes = [] n_col = 3 n_row = np.ceil(len(surfaces) / n_col) for i, surface in enumerate(surfaces): i_x = i % n_col i_y = i // n_col elem = Tpms( surface_function=surface, offset=0.3, resolution=50, ) mesh = elem.sheet mesh.translate( [1.2 * (i_x - 0.5 * (n_col - 1)), -1.2 * (i_y - 0.5 * (n_row - 1)), 0], inplace=True, ) meshes.append(mesh) surfaces_block = pv.MultiBlock(meshes) surfaces_block.save("tpms_surfaces.vtm") .. GENERATED FROM PYTHON SOURCE LINES 50-51 .. code-block:: Python surfaces_block.plot(smooth_shading=True, cpos="xy", color="#ef7d2d") .. image-sg:: /examples/TPMS/images/sphx_glr_tpms_surfaces_001.png :alt: tpms surfaces :srcset: /examples/TPMS/images/sphx_glr_tpms_surfaces_001.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 4.108 seconds) .. _sphx_glr_download_examples_TPMS_tpms_surfaces.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: tpms_surfaces.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: tpms_surfaces.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: tpms_surfaces.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_