vedo
vedo copied to clipboard
boolean minus fails for large meshes
Hey,
I've encountered some issues with the boolean cutout. It seems to work great untill the amount of faces becomse large. Then, the output sometimes contains inverted faces and faces from both the original mesh and the mesh from which should be substracted. I've also noticed that the original mesh (m1
in the code example below) has inverted faces after the operation. I believe the original mesh shouldn't be modified which makes me believe that there is a memory issue somewhere
These are the 2 meshes I substract from one another
This is the results
I've uploaded the files here: https://drive.google.com/drive/folders/16EZM9tz37O0C3X_8oPcLKfvkfx-DoaNb?usp=sharing (the _simp files have less faces and for those it works). Here's the code I used to test:
import vedo
m1 = vedo.load("m1.stl")
m2 = vedo.load("m2.stl")
m1.show().close()
m2.show().close()
m3 = m1.boolean("minus", m2)
m1.show().close()
m2.show().close()
m3.show().close()
Hi, unfortunately the booloean filter is one of the few which has always been problematic, you may want to investigate if there pymeshlab
can do better on this.
In your case the teeth are separated so at least you can check one by one...:
from vedo import *
m1 = Mesh("m1.stl").c("red8")
m2 = Mesh("m2.stl").c("k9")
teeth = m2.split()
teeth = [t.clean().compute_normals() for t in teeth]
show(m1, teeth, axes=7).close()
m3 = m1.boolean("+", teeth[0]).compute_normals()
show(m3, axes=7)
sorry I cannot offer a real solution...
Hey, Thank you for the info. I'll try that out