New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Find intersection for parallel, flat Meshes #1098
Comments
hi ..so your meshes are almost overlapping? https://vedo.embl.es/autodocs/content/vedo/vedo/pointcloud.html#Points.cut_with_scalar mesh1.distance_to(mesh2, signed=True)
mesh1.cut_with_scalar(0, "Distance") also have you tried |
Sorry from what you have sent it is not clear to me at all what the "tunnel" is or where it is in the image. |
Ok now it is more clear.. |
You can play around with a test case to find the strategy that best fits your problem, consider this as a starting point: from vedo import *
ln = [[sin(x), cos(x), x / 2] for x in np.arange(6,9, 0.1)]
N = len(ln)
radii = [0.3*(cos(6.0*ir/N))**2+0.1 for ir in range(N)]
tube = Tube(ln, r=radii, res=48).triangulate()
n = (0.3,-1,0)
slices = []
for i in range(-3, 6):
sli = tube.slice(origin=[0,i/10,0], normal=n)
sli.c("b9").bc("k5").lighting("off").pickable(True)
# sli = tube.intersect_with_plane(origin=[0,i/10,0], normal=n)
sli.reorient(n, [0,0,1])
slices.append(sli)
show([tube, slices], N=2, sharecam=0, axes=1) |
Hello,
I'm trying to find the intersection of two flat Meshes that lie on top of each other.
I was trying to do this with boolean at first, but I found here that it doesn't work if all normals point in the same directions.
So I tried intersection = mesh1.clone().cut_with_mesh(mesh2), which kind of does work but the result is not smooth. :( (see pictures below)
I played around with triangulate() and subdivide() in the hope that more triangles would make the outcome smoother but actually it made it worse and I got a result with even more cracks.
Any ideas how to get a better result? I was thinking about maybe changing the normals very little so they are not perfectly straight anymore to retry the boolean approach, but I'm unsure to do this.
The meshes to cut are green and blue. The white cut is the result.
I would appreciate any help! :)
The text was updated successfully, but these errors were encountered: