Vtk Boolean Operations On Poly Data Producing Empty Sets
I have an STL of a gyroid & I want to crop it with a sphere (previous question) Now I have the data represented in the correct manner but whenever I do a Boolean operation on m
Solution 1:
I posted a possible solution here. A variation using the boolean filter gives reasonable results:
from vedo import *
import numpy as np
x, y, z = np.mgrid[:30,:30,:30] * 0.4
U = sin(x)*cos(y) + sin(y)*cos(z) + sin(z)*cos(x)
# Create a Volume, take the isosurface at 0 and smooth it
g = Volume(U).isosurface(0).smoothLaplacian()
# Intersect with a sphere
s = Sphere(pos=(15,15,15), r=14, quads=True).triangulate()
gxs = g.boolean('intersect',s).clean().computeNormals()
gxs.color('silver').lighting('metallic')
show([[g,s],gxs], N=2, bg='wheat', bg2='lightblue', axes=5)
Post a Comment for "Vtk Boolean Operations On Poly Data Producing Empty Sets"