bellockk / alphashape

Toolbox for constructing alpha shapes.
MIT License
258 stars 28 forks source link

alphashape.contains misses edge points #20

Open DDeFilippis opened 3 years ago

DDeFilippis commented 3 years ago

Description

When creating an alphashpe with a set of points running alphashape.alphashape.contains() on all of the points the edge and corner points come up as false. the points are floating point numbers and this could be a rounding issue of some sort.

What I Did

Create random floating point coordinates and generate an alphashape using optimizealpha. Then run the alphashap.alphashape.contains() method on all of the points. All of the border points come back false. 

Use the script from https://stackoverflow.com/questions/61757304/how-to-determine-if-a-point-lies-inside-a-concave-hull-alpha-shape but also run the original points through the if statement and see what color they end up being.

What I Expected

Border points used to create an alphashape should be true if passed into the contain method for that alphashape object.

Acceptance Criteria

Border points used to create an alphashape will be true if passed into the contain method for that alphashape object.

hschoeller commented 1 year ago

Whether edge points are actually contained by the hull is a matter of definition (is the hull an open or a closed set). If you want points inside + edge points, simply retrieve the edge points with alphashape.alphashape.bounds