Skip to content
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

Decimate a mesh #41

Closed
yw5aj opened this issue Jan 26, 2017 · 8 comments
Closed

Decimate a mesh #41

yw5aj opened this issue Jan 26, 2017 · 8 comments

Comments

@yw5aj
Copy link
Contributor

yw5aj commented Jan 26, 2017

Hi Mike,

(I assume this would be a simple question :)

Would there be any simple way to decimate a mesh? Say, simplify the geometry from 10,000 faces to 1,000 faces?

Thanks!

Shawn

@mikedh
Copy link
Owner

mikedh commented Jan 27, 2017

Hey Shawn- at the moment Trimesh doesn't implement any simplification algorithms- I've been meaning to implement quadratic edge collapse decimation for a while, but never had time. If you want to implement it PR's would be accepted gladly :). In the meantime you're probably best off calling meshlabserver with subprocess.check_call or something.

@yw5aj
Copy link
Contributor Author

yw5aj commented Jan 27, 2017

Hi Mike,

Thanks for your response! And the quadratic edge collapse decimation looks really interesting. I'll read more into it - I'm not sure whether the complexity is within my coding capabilities :P

And thank you also for your suggestion to use meshlabserver! I noticed that blender also has a decimate modifier, so I can try to see whether that's callable via command line.

Shawn

@Marviel
Copy link
Contributor

Marviel commented Mar 23, 2017

This code sample looks like it does the meshlabserver trick: https://gist.github.com/awesomebytes/a3bc8729d0c1d0a9499172b9a77d2622

@mikedh
Copy link
Owner

mikedh commented May 2, 2018

It would be neat to make a nice cython wrapper then set up cibuildwheel on: https://github.com/sp4cerat/Fast-Quadric-Mesh-Simplification

@xuefeng7
Copy link

thanks for the information, one question is: is there anyway to keep track of which faces are merged into one face? like if you have a labeled mesh, after decimating, how could you know the label for each new face?
Thanks!

@mikedh
Copy link
Owner

mikedh commented Dec 21, 2018

@xuefeng7: I think that would be pretty easy in a native numpy implementation but might be tough with a wrapper.

I referenced and consolidated this into the enhancements list and would be as always mega- happy if someone wants to PR this 😄 . Thanks for the report!

@jonnymaserati
Copy link
Contributor

I'm doing this via open3d pretty simply, I can pass on that code if it helps?

@mikedh
Copy link
Owner

mikedh commented Oct 1, 2020

Oh yeah actually the open3d implementation of this is pretty good, and they appear to be distributing through wheels now. I added a thin wrapper to open3d in 8b9daf2 that seems to work well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants