mymesh.implicit.diamond#

mymesh.implicit.diamond(x, y, z)[source]#

Implicit function approximation of the diamond (Schwarz D) triply periodic minimal surface (TPMS). This function uses sympy functions (sp.cos, sp.sin) to enable symbolic differentiation.

For efficient vectorized evaluation, use: x, y, z = sp.symbols(‘x y z’, real=True) vector_func = sp.lambdify((x, y, z), func(x,y,z), ‘numpy’)

Parameters:
  • x (scalar or np.ndarray) – x coordinate(s)

  • y (scalar or np.ndarray) – y coordinate(s)

  • z (scalar or np.ndarray) – z coordinate(s)

Returns:

f – implicit function evaluated with sympy

Return type:

sympy expression

Examples

surface = implicit.SurfaceMesh(implicit.diamond, [0,1,0,1,0,1], 0.05)
surface.plot(bgcolor='w')
../../_images/mymesh-implicit-diamond-1.png