-
Notifications
You must be signed in to change notification settings - Fork 27
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
Unexpected cleaning result #45
Comments
Got it partially working: First, split the mesh into the three individual bodies. They're not connected at all. import pymeshfix
import pyvista as pv
# we're going to subdivide, for whatever reason this helps meshfix
mesh = pv.read("bridge08.stl")
sub_div = mesh.subdivide(1)
bodies = pv.MultiBlock([body.extract_surface() for body in sub_div.split_bodies()])
bodies.plot(multi_colors=True) Next, let's join the first and last body (the teeth I'm assuming?) # join the bodies within pyvista
joined = bodies[0].boolean_union(bodies[2])
bodies[1] = bodies[1].compute_normals(flip_normals=True)
final = joined.compute_normals(auto_orient_normals=True).clean()
# clean
tin = pymeshfix.PyTMesh()
tin.load_array(final.points, final.faces.reshape(-1, 4)[:, 1:])
tin.clean()
mfix = pymeshfix.MeshFix(*tin.return_arrays())
mfix.plot() The hard part is now the dental bridge. I'm not able to get pyvista to merge it using any bodies[1].plot_normals(mag=0.1) I hope at least helps you out a bit! |
Thank you, this is helping me a lot! I now have a better understanding of why it doesn't work well. |
Hey,
I try to repair the following mesh (a dental bridge):
Within the mesh are some holes and also intersecting triangles. I use the function tin.small_boundaries() and if i detect intersecting triangles also tin.clean(max_iters=10, inner_loops=3). Unfortunately, the dental bridge is split, leaving only one tooth in the end:
Do you maybe have some ideas how i can fix this issue? You can find the used source code and the *.stl file below:
ScriptAndModel.zip
The text was updated successfully, but these errors were encountered: