eradiate.scenes.surface.triangulate_grid

eradiate.scenes.surface.triangulate_grid#

eradiate.scenes.surface.triangulate_grid(x, y, z=None, flip=False, divide='nesw')[source]#

Create a 2D triangulation for a regular (x, y) grid.

Parameters:
  • x (ndarray) – List of x grid values.

  • y (ndarray) – List of y grid values.

  • z (ndarray, optional) – If passed, a 3rd coordinate for vertices in gridded format (y-major).

  • flip (bool) – If True, flip triangle orientation (clockwise by default).

  • divide ({"nesw", "nwse"}, default: "nesw") – Cell division method.

Returns:

  • vertices (ndarray) – Vertex list (y-major) as a (n, 2) array.

  • faces (ndarray) – Face definitions as a (n, 3) array.