Skip to content

Convex Hull fails to create for co-linear points #32

@radumg

Description

@radumg

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

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 👍

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions