Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Convex Hull fails to create for co-linear points

See original GitHub issue

Hi, 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);


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:open
  • Created 4 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

micampbellcommented, Jul 30, 2019
micampbellcommented, Jul 30, 2019

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!

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Post

No results found

github_iconTop Related Hashnode Post

No results found