DesignEngrLab / MIConvexHull

A .Net fast convex hull library for 2, 3, and higher dimensions.
http://designengrlab.github.io/MIConvexHull/
MIT License
341 stars 60 forks source link

How does sending a list of unique vertices vs sending a list of vertices change hull calculation #43

Closed debashis66 closed 1 year ago

debashis66 commented 4 years ago

Hello I was comparing the output from two cases

  1. sending the list of mesh vertices (extracted from each mesh facet, so that N facets give 3N vertices) to createHull method
  2. extract the uniqueVertices list from the mesh vertices so that each vertex only appears once as below var uniquePoints = points.GroupBy(point => new { point.x, point.y, point.z }).Select(g => g.First()).ToList(); and use the uniqueVertices as input to createHull method

I see that the hull created in cases I and II are different with slightly different number of points. Is this expected from the quickHull algortihm ?

massonib commented 1 year ago

Without digging into too deep, I believe that the algorithm will return the points on the convex hull. It does not look for duplicates internally, so if you put more points on the convex hull, it will return more points.