Top

pytess.main module

Where all the end-user functionality is defined.

Functions

def triangulate(

points)

Connects an input list of xy tuples with lines forming a set of smallest possible Delauney triangles between them.

Arguments:

  • points: A list of xy or xyz point tuples to triangulate.

Returns:

  • A list of triangle polygons. If the input coordinate points contained a third z value then the output triangles will also have these z values.

def voronoi(

points, buffer_percent=100)

Surrounds each point in an input list of xy tuples with a unique Voronoi polygon.

Arguments:

  • points: A list of xy or xyz point tuples to triangulate.
  • buffer_percent (optional): Controls how much bigger than the original bbox of the input points to set the bbox of fake points, used to account for lacking values around the edges (default is 100 percent).

Returns:

  • Returns a list of 2-tuples, with the first item in each tuple being the original input point (or None for each corner of the bounding box buffer), and the second item being the point's corressponding Voronoi polygon.