Here is my new code :
Oups,made a mistake with the code ... I don't know how to edit :(
Can you explain me my mistake ?
Thanks a lot,
Scientifix
Here is the correct one :
Oups,made a mistake with the code ... I don't know how to edit :(
Can you explain me my mistake ?
Thanks a lot,
Scientifix
Here is the correct one :
from scipy.spatial import ConvexHull import matplotlib.pyplot as plt import numpy as np points = np.random.rand(30, 2) Plot = True def min_convex(points): oignon_layers = [] while len(points) > 4: layer = ConvexHull(points) oignon_layers.append(layer) points = points = np.delete(points, layer.vertices, axis=0) if Plot == True: plt.plot(points[:,0], points[:,1], 'o') for layer in oignon_layers: for simplex in layer.simplices: plt.plot(points[simplex, 0], points[simplex, 1], 'k-') plt.show()with the error:
Error:plt.plot(points[simplex, 0], points[simplex, 1],'k-')
IndexError: index 24 is out of bounds for axis 0 with size 4