bellockk / alphashape

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

optimizealpha does not converge for alphas >= 4 #18

Open Dapid opened 4 years ago

Dapid commented 4 years ago

Description

optimizealpha fails when the optimal alpha is a bit big. In my particular case, upper and lower values are:

lower = 4.5 
upper = np.nextafter(lower, 9)
print((upper - lower) > numpy.finfo(float).eps * 2 )         
True                                                                                                                           

The middle point is identical to lower, so the model never converges below the threshold.

Solutions:

I see two ways of solving the problem:

The first case is better suited to the current code, but getting alpha to within machine precision may not always be necessary.

jazzathoth commented 1 year ago

I am having similar trouble with latitude longitude data.