I have a series of points that are to be sorted into adjacent squares so that a mesh is created.
is there maby anything comparable to the Delaunay triangulation?
Picture from input points in blue and goal in red
import numpy as np
import matplotlib.pyplot as plt
points_2D = np.array([[2,2],[3,2],[5,2],[7,2],[8,2],[10,2],[2,4],[3,5],[5,4],[7,3],[8,4],[10,5],[2,7],[4,7],[5,7],[6,7],[8,6],[9,7],])
def find_rectangle(points):
pass
# return somthing like np.array([rectangle_number][
# [x,y],
# [x,y],
# [x,y],
# [x,y],
# ])
#points_2D = find_rectangle(points_2D)
plt.scatter(points_2D[:,0], points_2D[:,1])
plt.show()