Convex Hull fails to create for co-linear points
See original GitHub issueHi, first off, many thanks for the great work in this library! We’ve been using it in an open-source library called RefineryToolkits and have found an issue that we wanted to discuss.
It seems that ConvexHull
fails to be created when the input points are co-linear
. Specifically, this line of code does not throw, but returns a null when points are co-linear.
var convexHull = MIConvexHull.ConvexHull.Create(vertices);
Example
Below is a list of points with the coordinates that highlighted the failure during a recent hackathon :
X 260 Y 600
X 285 Y 600
X 310 Y 600
X 335 Y 600
To solve this in short-term, we are adding a co-linearity check in our library and handle that case separately, but was wondering if it’s something that you’d like to address in the MIConvexHull
library itself so everyone has access to the fix ?
Let us know 👍
Issue Analytics
- State:
- Created 4 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
Convex hull of all co-linear points?
If all your points lie on a line, then there are only two vertices: The two extreme endpoints along the line. Thus traditionally...
Read more >What Is Convex Hull and Why It Fails in Point Cloud Library?
The main reason for the failure of Convex Hull calculation in PCL is the presence of degenerate cases in the point cloud. A...
Read more >Finding non-collinear vertices of a convex hull
I generate large collections of (rational, 2d) points and need to find which of these points are the vertices of the convex hull....
Read more >Convex hull construction
Convex Hull construction. In this article we will discuss the problem of constructing a convex hull from a set of points.
Read more >A gentle introduction to the convex hull problem
The convex hull of a set of points is defined as the smallest convex polygon, that encloses all of the points in the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
yes, the nuget is updated (https://www.nuget.org/packages/MIConvexHull/) and the details of the commit are here: https://github.com/DesignEngrLab/MIConvexHull/commit/915cdb730594f388b475a0a39fff2fa4d9dd5400
Well, I found an easy place to fix this. There was already a function called “FindIntermediatePointsForLongSkinny” which I was able to make a small modification to so that it would return the two extrema along the line instead of crashing. For the general case, this adds no extra time. thanks for catching this!