Top

pytess.tesselator module

Where the actual behind-the scenes work takes place. This is the original voronoi diagram calculator/Delauney triangulator by Bill Simons and Carson Farmer.

Functions

def computeDelaunayTriangulation(

points)

Takes a list of point objects (which must have x and y fields). Returns a list of 3-tuples: the indices of the points that form a Delaunay triangle.

def computeVoronoiDiagram(

points)

Takes a list of point objects (which must have x and y fields). Returns a 3-tuple of:

(1) a list of 2-tuples, which are the x,y coordinates of the Voronoi diagram vertices (2) a list of 3-tuples (a,b,c) which are the equations of the lines in the Voronoi diagram: ax + by = c (3) a list of 3-tuples, (l, v1, v2) representing edges of the Voronoi diagram. l is the index of the line, v1 and v2 are the indices of the vetices at the end of the edge. If v1 or v2 is -1, the line extends to infinity.

def isEqual(

a, b, relativeError=1e-09)

def voronoi(

siteList, context)

Classes

class Context

Ancestors (in MRO)

Methods

def __init__(

self)

def circle(

self, x, y, rad)

def clip_line(

self, edge)

def line(

self, x0, y0, x1, y1)

def outBisector(

self, edge)

def outEdge(

self, edge)

def outSite(

self, s)

def outTriple(

self, s1, s2, s3)

def outVertex(

self, s)

class Edge

Ancestors (in MRO)

  • Edge
  • __builtin__.object

Static methods

def bisect(

s1, s2)

Methods

def __init__(

self)

def dump(

self)

def setEndpoint(

self, lrFlag, site)

class EdgeList

Ancestors (in MRO)

Methods

def __init__(

self, xmin, xmax, nsites)

def delete(

self, he)

def gethash(

self, b)

def insert(

self, left, he)

def leftbnd(

self, pt)

class Halfedge

Ancestors (in MRO)

Methods

def __init__(

self, edge=None, pm=0)

def dump(

self)

def intersect(

self, other)

def isPointRightOf(

self, pt)

def leftreg(

self, default)

def rightreg(

self, default)

class PriorityQueue

Ancestors (in MRO)

Methods

def __init__(

self, ymin, ymax, nsites)

def delete(

self, he)

def getBucket(

self, he)

def getMinPt(

self)

def insert(

self, he, site, offset)

def isEmpty(

self)

def popMinHalfedge(

self)

class Site

Ancestors (in MRO)

  • Site
  • __builtin__.object

Methods

def __init__(

self, x=0.0, y=0.0, sitenum=0)

def distance(

self, other)

def dump(

self)

class SiteList

Ancestors (in MRO)

Methods

def __init__(

self, pointList)

def iterator(

self)

def setSiteNumber(

self, site)