1

I have an array of points in python making a square lattice. I want to triangulate it like this: enter image description here

so that the braces alternate in a checkerboard pattern from square to square. My attempts have been based on deforming it before triangulation. For example, shearing the lattice before triangulating via

xy_skew = np.dstack((xypts[:,0]+ 0.1*xypts[:,1], xypts[:,1]))[0]
tri = scipy.spatial.Delaunay(xy_skew)
TRI = tri.vertices

can give me all 'rightward' diagonals or all 'leftward' diagonals, but I haven't found a deformation that can lead to the desired triangulation.

How can I do this efficiently (for lattices of ~million points)?

If relevant, the indices of my points increase in Y first, then increase in X.

Thanks!

manlio
  • 18,345
  • 14
  • 76
  • 126
NPMitchell
  • 193
  • 1
  • 10

0 Answers0