OwlCyberSecurity - MANAGER
Edit File: triangulation.cpython-38.pyc
U ��]� � @ s d dl ZG dd� de�ZdS )� Nc @ sf e Zd ZdZddd�Zdd� Zedd� �Zd d � Zdd� Z e d d� �Zdd� Zedd� �Z dd� ZdS )� Triangulationa� 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. Parameters ---------- x, y : array-like of shape (npoints) Coordinates of grid points. triangles : integer array_like of shape (ntri, 3), optional For each triangle, the indices of the three points that make up the triangle, ordered in an anticlockwise manner. If not specified, the Delaunay triangulation is calculated. mask : boolean array-like of shape (ntri), optional Which triangles are masked out. Attributes ---------- edges : int array of shape (nedges, 2) See `~.Triangulation.edges` neighbors : int array of shape (ntri, 3) See `~.Triangulation.neighbors` mask : bool array of shape (ntri, 3) Masked out triangles. is_delaunay : bool Whether the Triangulation is a calculated Delaunay triangulation (where `triangles` was not specified) or not. Notes ----- For a Triangulation to be valid it must not have duplicate points, triangles formed from colinear points, or overlapping triangles. Nc C sD ddl m} tj|tjd�| _tj|tjd�| _| jj| jjksL| jjdkrTt d��d | _ d | _d | _d| _ |d kr�|�||�\| _| _d| _ njtj|tjdd �| _| jjd ks�| jjd dkr�t d��| j�� t| j�kr�t d ��| j�� dk r�t d��|d k �r4tj|td�| _ | j j| jjd fk�r4t d��d | _d | _d S )Nr )�_qhull��dtype� z'x and y must be equal-length 1-D arraysFT�C)r �order� � ztriangles must be a (?,3) arrayz&triangles max element is out of boundsz&triangles min element is out of bounds�3mask array must have same length as triangles array)� matplotlibr �np�asarrayZfloat64�x�y�shape�ndim� ValueError�mask�_edges� _neighbors�is_delaunayZdelaunay� trianglesZarray�int32�max�len�min�bool�_cpp_triangulation� _trifinder)�selfr r r r r � r! �>/usr/lib/python3/dist-packages/matplotlib/tri/triangulation.py�__init__&