Is there any way to get mesh vertices which included in every convex ?
LegionFu opened this issue · 7 comments
So what you want to know is which vertices from the original mesh contributed to each output convex hull? There is currently no code to do this, but it would certainly be possible to add it. The question is, what would be the possible use for this?
I'm trying to make a tool, which can automatic genertate these convex hulls and transfer the normals from convex hulls to the mesh.
I need to generate more accurate convex hulls and using it. ; )
http://www.scriptspot.com/3ds-max/scripts/noors-normal-thief
For the reference~
Ok, well here is how I would do this. For each vertex in the source mesh I would figure out which convex hull is the closest to that point. You can use the aabb code to get that answer. This would probably take me about 30 minutes to implement if it is really needed.
Yes, I need it ! Thank you so much for your support~
Ok, I have implemented this on the following branch: nearest-hull-api
You must rebuild from source though. I do not have a way to rebuild binaries for this package.
I am also strongly considering doing a big refactor the code to simplify it immensely, but that is a separate larger project.
If you don't build this from source, I don't know how to help you. I have no way to build the binaries.
The new API call is called: findNearestConvexHull and you pass into it a point and a reference to the distance. The point could be from the original source mesh or not. You decide.
This method will compute the distance between that 3d point and all of the convex hulls in the solution. It will return which convex hull the point was closest to and how far apart they are.
Here is a screenshot showing it working. Each vertex in the original source mesh is color-coded to correspond to the convex hull it is nearest to.
Nice, I'll try it.
It worked! Thanks~