alphashape.contains misses edge points
DDeFilippis opened this issue · 1 comments
DDeFilippis commented
- Alpha Shape Toolbox version: 1.2.1
- Python version:3.9.x
- Operating System:OSx
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
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