Closed Bekwnn closed 7 years ago
These are good questions, and they are at the root of an issue that my co-developer and I have wrestled with for a long time. I would call the convex hull that excludes all internal vertices as the minimal convex hull, while one that includes all internal vertices the maximal convex hull. What is produced by MIConvexHull is not guaranteed to be either. Sorry for the bad news. The reason for doing this is speed and robustness. If you need either, you would need to post-process the results of this algorithm. At some point, we should provide this as a built in facility. What would happen, is that after this result is created, one would go back and consider how the vertices should be added or removed. One thing to realize is that in either case - minimal or maximal - it is not necessarily the case that there is a single tessellation that is the answer. Another thing to realize is that the (new) single tolerance that is accepted in the ConvexHull routine is the distance that a new vertex is above an existing plane to be considered for initiating new faces. Higher values produce convex hulls with fewer vertices and faces (toward or beyond the minimal) while a lower number produces something with more vertices and faces (like the maximal). Due to round-off error a value of exact zero - a new vertex exactly in the plane - is not recommended. This is true even for double precision. The default 1e-10 seems to works well without sacrificing accuracy.
Thank you. I had one further question: looking at the calls to ConvexHull.Create<>(), I can't tell whether there's a method in this library which would return some sort of 2-dimensional array of indices, similar to triangle indexing although not necessarily triangular (but preferably ordered).
I'm hoping to keep a mapping from my input to the resulting output without having to do a full comparison of my input against the resulting output.
There is not a facility to do that. Again, I agree it would be handy and it could also be done best as a post-processing step. A few LINQ calls could generate such a 2d array, but it would not be quick as it would require many calls to "IndexOf", but perhaps that is okay for you.
I was wondering if a contributor could tell me:
Thank you for your time and for this project.