Submit
Path:
~
/
/
proc
/
thread-self
/
root
/
opt
/
alt
/
python27
/
lib64
/
python2.7
/
site-packages
/
matplotlib
/
tri
/
File Content:
triangulation.pyo
� ]�3Lc @ sD d d l j Z d d l j Z d d l Z d e f d � � YZ d S( i����Nt Triangulationc B se e Z d Z d d d � Z e d � � Z d � Z d � Z e d � � Z e d � � Z d � Z RS( s� An unstructured triangular grid consisting of npoints points and ntri triangles. The triangles can either be specified by the user or automatically generated using a Delaunay triangulation. Read-only attributes: *x*: array of shape (npoints). x-coordinates of grid points. *y*: array of shape (npoints). y-coordinates of grid points. *triangles*: integer array of shape (ntri,3). For each triangle, the indices of the three points that make up the triangle, ordered in an anticlockwise manner. *mask*: optional boolean array of shape (ntri). Which triangles are masked out. *edges*: integer array of shape (?,2). All edges of non-masked triangles. Each edge is the start point index and end point index. Each edge (start,end and end,start) appears only once. *neighbors*: integer array of shape (ntri,3). For each triangle, the indices of the three triangles that share the same edges, or -1 if there is no such neighboring triangle. neighbors[i,j] is the triangle that is the neighbor to the edge from point index triangles[i,j] to point index triangles[i,(j+1)%3]. c C sY t j | d t j �| _ t j | d t j �| _ | j j | j j k sf t | j j � d k ru t d � � n d | _ d | _ d | _ | d k r8t j | j | j � } t j | j d t j �| _ | d k r�t j | j d t j �| _ t j | j d t j �} t j | d d d �| _ q�n� t j | d t j �| _ | j j d k s{| j j d d k r�t d � � n | j j � t | j � k r�t d � � n | j j � d k r�t d � � n | d k rLt j | d t j �| _ t | j j � d k s:| j j d | j j d k rLt d � � qLn d | _ d S( s� Create a Triangulation object. The first two arguments must be: *x*, *y*: arrays of shape (npoints). Point coordinates. Optional arguments (args or keyword args): *triangles*: integer array of shape (ntri,3). For each triangle, the indices of the three points that make up the triangle. If the points are ordered in a clockwise manner, they are converted to anticlockwise. If not specified, matplotlib.delaunay is used to create a Delaunay triangulation of the points. *mask*: optional boolean array of shape (ntri). Which triangles are masked out. t dtypei s'