Ńň tJc @ s d d k Z y e Wn( e j o d d k Z e i Z n Xd d k Z d d k l Z d d k l Z l Z d d g Z d e f d YZ d e f d YZ d S( i˙˙˙˙N( t delaunay( t LinearInterpolatort NNInterpolatort Triangulationt DuplicatePointWarningc B s e Z d Z RS( sB Duplicate points were passed in to the triangulation routine. ( t __name__t __module__t __doc__( ( ( sE /usr/lib64/python2.6/site-packages/matplotlib/delaunay/triangulate.pyR s c B s e Z d Z d Z d Z d Z e i d Z e i d Z d d Z d e i d Z d e i d Z d Z RS( sw A Delaunay triangulation of points in a plane. Triangulation(x, y) x, y -- the coordinates of the points as 1-D arrays of floats Let us make the following definitions: npoints = number of points input nedges = number of edges in the triangulation ntriangles = number of triangles in the triangulation point_id = an integer identifying a particular point (specifically, an index into x and y), range(0, npoints) edge_id = an integer identifying a particular edge, range(0, nedges) triangle_id = an integer identifying a particular triangle range(0, ntriangles) Attributes: (all should be treated as read-only to maintain consistency) x, y -- the coordinates of the points as 1-D arrays of floats. circumcenters -- (ntriangles, 2) array of floats giving the (x,y) coordinates of the circumcenters of each triangle (indexed by a triangle_id). edge_db -- (nedges, 2) array of point_id's giving the points forming each edge in no particular order; indexed by an edge_id. triangle_nodes -- (ntriangles, 3) array of point_id's giving the points forming each triangle in counter-clockwise order; indexed by a triangle_id. triangle_neighbors -- (ntriangles, 3) array of triangle_id's giving the neighboring triangle; indexed by a triangle_id. The value can also be -1 meaning that that edge is on the convex hull of the points and there is no neighbor on that edge. The values are ordered such that triangle_neighbors[tri, i] corresponds with the edge *opposite* triangle_nodes[tri, i]. As such, these neighbors are also in counter-clockwise order. hull -- list of point_id's giving the nodes which form the convex hull of the point set. This list is sorted in counter-clockwise order. c C s5 t i | d t i | _ t i | d t i | _ | i i | i i j p t | i i d j o t d n | i i | _ | i } | i | i i j oC t i d t | | _ | i | i | _ | i | i | _ n d | _ t | i | i \ | _ | _ | _ | _ | i | _ d S( Nt dtypei s# x,y must be equal-length 1-D arrayssB Input data contains duplicate x,y points; some values are ignored.( t npt asarrayt float64t xt yt shapet lent ValueErrort old_shapet _collapse_duplicate_pointst warningst warnR t j_uniquet NoneR t circumcenterst edge_dbt triangle_nodest triangle_neighborst _compute_convex_hullt hull( t selfR R R ( ( sE /usr/lib64/python2.6/site-packages/matplotlib/delaunay/triangulate.pyt __init__A s 2 -c C sk t i d | i | i f } t i t t i | i | d j t i | i | d j Bg } | | S( s Generate index array that picks out unique x,y points. This appears to be required by the underlying delaunay triangulation code. t keysi ( R t lexsortR R t hstackt Truet diff( R t j_sortedt mask_unique( ( sE /usr/lib64/python2.6/site-packages/matplotlib/delaunay/triangulate.pyR \ s <c C s | i d j } h } | i t t | i | d d d f d d d f | i | d d d f d d d f | i t t | i | d d d f d d d f | i | d d d f d d d f | i t t | i | d d d f d d d f | i | d d d f d d d f t | i } x&