Skip to content Skip to sidebar Skip to footer

Is There A Way To Fill One Side Of The Gyroid Surface By Using Mayavi?

I'm using Mayavi to plot an iso-surface of a gyroid. My problem is that I need a more solid structure by filling one side of the two generated areas. In the following pictures, you

Solution 1:

Using vedo:

from vedo import *
import numpy as np

a = 15
pi = np.pi
x, y, z = np.mgrid[:30, :30, :30]/a
U =   sin(2*pi* x) * cos(2*pi* y) + sin(2*pi* y) * cos(2*pi* z) \
    + sin(2*pi* z) * cos(2*pi* x)
iso = Volume(U).isosurface(0)
plane = Grid(sx=29,sy=29, pos=(14.5,14.5,0), resx=200, resy=200)
cpln = plane.cutWithMesh(iso).wireframe(0).c('tomato').lw(0)
show(iso, cpln, axes=1)

enter image description here

(note that the red-tomato "cap" is effectively a different mesh)

PS: you can also use CubicGrid(n=(29,29,29), spacing=(1,1,1), alpha=1) (instead of 6 planes). E.g.:

iso = Volume(U).isosurface(0).smoothLaplacian().c('silver').lw(1)
cube = CubicGrid(n=(29,29,29), spacing=(1,1,1))
cube.cutWithMesh(iso).c('silver').alpha(1)
show(iso, cube)

enter image description here

Post a Comment for "Is There A Way To Fill One Side Of The Gyroid Surface By Using Mayavi?"