Cylindrical gyroid

A gyroid mapped onto a cylindrical coordinate frame with microgen.CylindricalTpms.

import pyvista as pv

from microgen import CylindricalTpms
from microgen.shape.surface_functions import gyroid


def swapped_gyroid(x, y, z):
    return gyroid(x=z, y=y, z=x)


geometry = CylindricalTpms(
    surface_function=swapped_gyroid,
    offset=0.5,
    cell_size=(1, 1, 1),
    repeat_cell=(1, 0, 1),
    radius=1,
    resolution=20,
)
sheet = geometry.sheet
/opt/hostedtoolcache/Python/3.12.16/x64/lib/python3.12/site-packages/autograd/numpy/numpy_vjps.py:187: RuntimeWarning: divide by zero encountered in power
  defvjp(anp.sqrt, lambda ans, x: lambda g: g * 0.5 * x**-0.5)
/opt/hostedtoolcache/Python/3.12.16/x64/lib/python3.12/site-packages/autograd/numpy/numpy_vjps.py:141: RuntimeWarning: invalid value encountered in multiply
  lambda ans, x, y: unbroadcast_f(x, lambda g: g * y * x ** anp.where(y, y - 1, 1.0)),
/opt/hostedtoolcache/Python/3.12.16/x64/lib/python3.12/site-packages/autograd/numpy/numpy_vjps.py:147: RuntimeWarning: invalid value encountered in divide
  lambda ans, x, y: unbroadcast_f(y, lambda g: g * -x / (x**2 + y**2)),
/opt/hostedtoolcache/Python/3.12.16/x64/lib/python3.12/site-packages/autograd/numpy/numpy_vjps.py:146: RuntimeWarning: invalid value encountered in divide
  lambda ans, x, y: unbroadcast_f(x, lambda g: g * y / (x**2 + y**2)),
plotter = pv.Plotter()
plotter.add_mesh(sheet, smooth_shading=True, color="#ef7d2d")
plotter.view_xy()
plotter.enable_parallel_projection()
plotter.show_axes()
plotter.show()
cylindrical

Total running time of the script: (0 minutes 0.447 seconds)

Gallery generated by Sphinx-Gallery