OwlCyberSecurity - MANAGER
Edit File: path.cpython-38.pyc
U ��]ʍ � @ s~ d Z ddlmZ ddlmZ ddlZddlmZm Z m Z ddl mZmZ G dd � d e �Zd d� Ze jdd d�g fdd��ZdS )a� A module for dealing with the polylines used throughout Matplotlib. The primary class for polyline handling in Matplotlib is `Path`. Almost all vector drawing makes use of `Path`\s somewhere in the drawing pipeline. Whilst a `Path` instance itself cannot be drawn, some `.Artist` subclasses, such as `.PathPatch` and `.PathCollection`, can be used for convenient `Path` visualisation. � )� lru_cache)�WeakValueDictionaryN� )�_path�cbook�rcParams)�_to_unmasked_float_array�simple_linear_interpolationc @ sh e Zd ZdZejZed�Zed�Zed�Z ed�Z ed�Zed�Zedede de dedediZ dbd d�Zedcdd ��Zdd� Zedd� �Zejdd� �Zedd� �Zejdd� �Zedd� �Zejdd� �Zejddd�edd� ��Zedd� �Zejd d� �Zed!d"� �Zd#d$� ZeZddd%d&�ZeZed'd(� �Z ed)d*� �Z!d+d,� Z"d-d.� Z#ded1d2�Z$dfd3d4�Z%d5d6� Z&dgd8d9�Z'dhd:d;�Z(did<d=�Z)djd>d?�Z*dkd@dA�Z+dldBdC�Z,dDdE� Z-dmdFdG�Z.dZ/edHdI� �Z0e1� Z2edJdK� �Z3e1� Z4edndMdN��Z5edOdP� �Z6dZ7edQdR� �Z8edodTdU��Z9dZ:edVdW� �Z;edpdXdY��Z<edqdZd[��Z=e>e?d\�drd^d_���Z@dsd`da�ZAdS )t�Patha :class:`Path` represents a series of possibly disconnected, possibly closed, line and curve segments. The underlying storage is made up of two parallel numpy arrays: - *vertices*: an Nx2 float array of vertices - *codes*: an N-length uint8 array of vertex types These two arrays always have the same length in the first dimension. For example, to represent a cubic curve, you must provide three vertices as well as three codes ``CURVE3``. The code types are: - ``STOP`` : 1 vertex (ignored) A marker for the end of the entire path (currently not required and ignored) - ``MOVETO`` : 1 vertex Pick up the pen and move to the given vertex. - ``LINETO`` : 1 vertex Draw a line from the current position to the given vertex. - ``CURVE3`` : 1 control point, 1 endpoint Draw a quadratic Bezier curve from the current position, with the given control point, to the given end point. - ``CURVE4`` : 2 control points, 1 endpoint Draw a cubic Bezier curve from the current position, with the given control points, to the given end point. - ``CLOSEPOLY`` : 1 vertex (ignored) Draw a line segment to the start point of the current polyline. Users of Path objects should not access the vertices and codes arrays directly. Instead, they should use :meth:`iter_segments` or :meth:`cleaned` to get the vertex/code pairs. This is important, since many :class:`Path` objects, as an optimization, do not store a *codes* at all, but have a default one provided for them by :meth:`iter_segments`. Some behavior of Path objects can be controlled by rcParams. See the rcParams whose keys contain 'path.'. .. note:: The vertices and codes arrays should be treated as immutable -- there are a number of optimizations and assumptions made up front in the constructor that will not change when the data changes. r r � � � �O NFc C s t |�}|jdks |jd dkr(td��|dk r�t�|| j�}|jdksXt|�t|�kr`td��t|�r�|d | jkr�td� | j���nB|r�t|�r�tj t|�| jd�}| j|d<