Open fabiosalvati opened 1 year ago
I tryied the simple example proposed in the documentation (read also 1.1.2 from the Alphashape documentation)
The code I tried:
` import alphashape import matplotlib.pyplot as plt from descartes import PolygonPatch
points = [(0., 0.), (0., 1.), (1., 1.), (1., 0.), (0.5, 0.5)] alpha = 0.2 alpha_shape = alphashape.alphashape(points, alpha) fig, ax = plt.subplots() ax.scatter(zip(points)) ax.add_patch(PolygonPatch(alpha_shape, alpha=.2)) plt.show() `
I obtained the following: IndexError: too many indices for array: array is 0-dimensional, but 2 were indexed
IndexError: too many indices for array: array is 0-dimensional, but 2 were indexed
I also get this error from this snippet.
You can check out this link, the methods inside are effective for me.
It may be some error in descartes. But I think you can do not use it.
x, y = alpha_shape.exterior.xy ax.plot(x, y, color='red')
I use these code to plot.
Description
I tryied the simple example proposed in the documentation (read also 1.1.2 from the Alphashape documentation)
What I Did
The code I tried:
` import alphashape import matplotlib.pyplot as plt from descartes import PolygonPatch
points = [(0., 0.), (0., 1.), (1., 1.), (1., 0.), (0.5, 0.5)] alpha = 0.2 alpha_shape = alphashape.alphashape(points, alpha) fig, ax = plt.subplots() ax.scatter(zip(points)) ax.add_patch(PolygonPatch(alpha_shape, alpha=.2)) plt.show() `
I obtained the following:
IndexError: too many indices for array: array is 0-dimensional, but 2 were indexed
Additional notes: