403Webshell
Server IP : 93.86.61.54  /  Your IP : 216.73.216.156
Web Server : Apache/2.4.62 (Ubuntu)
System : Linux rasin.ddns.net 6.8.0-124-generic #124~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Tue May 26 21:05:19 UTC x86_64
User : www-data ( 33)
PHP Version : 8.4.22
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /usr/lib/python3/dist-packages/mpl_toolkits/mplot3d/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/lib/python3/dist-packages/mpl_toolkits/mplot3d/__pycache__/art3d.cpython-310.pyc
o

�:�a&{�@s�dZddlZddlZddlmZmZmZmZ	m
Z
mZm
ZddlmZmZmZmZddlmZddlmZddlmZd	d
�Zdd�Zd
d�ZGdd�dej�Zd?dd�ZGdd�de
j �Z!d?dd�Z"d?dd�Z#d?dd�Z$d?dd�Z%d?dd�Z&Gd d!�d!e�Z'd?d"d#�Z(Gd$d%�d%e�Z)Gd&d'�d'e)�Z*d(d)�Z+d?d*d+�Z,d?d,d-�Z-Gd.d/�d/e�Z.Gd0d1�d1e�Z/d@d3d4�Z0Gd5d6�d6e�Z1d?d7d8�Z2d9d:�Z3d;d<�Z4d=d>�Z5dS)Azx
Module containing 3D artist code and functions to convert 2D
artists into 3D versions which can be added to an Axes3D.
�N)�_api�artist�cbook�colors�lines�text�path)�LineCollection�PolyCollection�PatchCollection�PathCollection)�	Normalize)�Patch�)�proj3dcC� |dd}|dkr|d}|S)z?Return the given angle normalized to -180 < *a* <= 180 degrees.ih����arr�</usr/lib/python3/dist-packages/mpl_toolkits/mplot3d/art3d.py�_norm_angle�rcCr)z=Return the given angle normalized to -90 < *a* <= 90 degrees.r�Zrrrrr�_norm_text_angle rrcCsp|dkr	t�d�S|dkrt�d�S|dkrt�d�S|dur$t�d�St�|�r4t|�d	kr4t�|�Std
��)a�
    Return a direction vector.

    Parameters
    ----------
    zdir : {'x', 'y', 'z', None, 3-tuple}
        The direction. Possible values are:

        - 'x': equivalent to (1, 0, 0)
        - 'y': equivalent to (0, 1, 0)
        - 'z': equivalent to (0, 0, 1)
        - *None*: equivalent to (0, 0, 0)
        - an iterable (x, y, z) is converted to a NumPy array, if not already

    Returns
    -------
    x, y, z : array-like
        The direction vector.
    �x)rrr�y)rrr�z)rrrN)rrr�z2'x', 'y', 'z', None or vector of length 3 expected)�np�array�iterable�len�
ValueError��zdirrrr�get_dir_vector(s




r&cs\eZdZdZddd�Zdd�Zd�fd
d�	Zdd
�Zddd�Ze	j
dd��Zdd�Z�Z
S)�Text3Da�
    Text object with 3D position and direction.

    Parameters
    ----------
    x, y, z
        The position of the text.
    text : str
        The text string to display.
    zdir : {'x', 'y', 'z', None, 3-tuple}
        The direction of the text. See `.get_dir_vector` for a description of
        the values.

    Other Parameters
    ----------------
    **kwargs
         All other parameters are passed on to `~matplotlib.text.Text`.
   r�rcKs*tjj||||fi|��|�||�dS�N)�mtext�Text�__init__�set_3d_properties)�selfrrrrr%�kwargsrrrr,^szText3D.__init__cCs|j|j|jfS)z*Return the (x, y, z) position of the text.)�_x�_y�_z�r.rrr�get_position_3dbszText3D.get_position_3dNcs<t��|dd��|�|d�|durt|�|_dSdS)a?
        Set the (*x*, *y*, *z*) position of the text.

        Parameters
        ----------
        xyz : (float, float, float)
            The position in 3D space.
        zdir : {'x', 'y', 'z', None, 3-tuple}
            The direction of the text. If unspecified, the zdir will not be
            changed.
        N�)�super�set_position�set_zr&�_dir_vec)r.�xyzr%��	__class__rr�set_position_3dfs
�zText3D.set_position_3dcC�||_d|_dS)zl
        Set the *z* position of the text.

        Parameters
        ----------
        z : float
        TN)r2�stale)r.rrrrr8ws
zText3D.set_zcCs||_t|�|_d|_dS�NT)r2r&r9r?)r.rr%rrrr-�s

zText3D.set_3d_propertiescCs�t�|j|j|jf�}t�|||jg|jj	�}|dd|dd}|dd|dd}t
�t
�||��}t
j||dd|ddt|�d��tj�||�Wd�n1s^wYd|_dS)Nrr)r0r1�	_rotationF)rr r0r1r2r�proj_trans_pointsr9�axes�M�math�degrees�atan2r�_setattr_cmrr*r+�drawr?)r.�renderer�
position3d�proj�dx�dy�anglerrrrI�s���
zText3D.drawcCsdSr)r�r.rJrrr�
get_tightbbox�szText3D.get_tightbbox)rrrr(rr)�rr)�__name__�
__module__�__qualname__�__doc__r,r4r=r8r-r�allow_rasterizationrIrQ�
__classcell__rrr;rr'Js


r'rcC�t|_|�||�dS)z"Convert a Text to a Text3D object.N)r'r<r-)�objrr%rrr�
text_2d_to_3d�sr[csLeZdZdZ�fdd�Zddd�Zdd	�Zd
d�Zej	�fdd
��Z
�ZS)�Line3Dz
    3D line object.
    cs,t�jggg|�Ri|��|||f|_dS)zU
        Keyword arguments are passed onto :func:`~matplotlib.lines.Line2D`.
        N)r6r,�_verts3d)r.�xs�ys�zs�argsr/r;rrr,�szLine3D.__init__rrcCs:|��}|��}t�|t|��}t||||�|_d|_dSr@)�	get_xdata�	get_ydatar�broadcast_tor"�juggle_axesr]r?)r.r`r%r^r_rrrr-�s

zLine3D.set_3d_propertiescGs(t|�dkr|d|_n||_d|_dS)ag
        Set the x, y and z data

        Parameters
        ----------
        x : array-like
            The x-data to be plotted.
        y : array-like
            The y-data to be plotted.
        z : array-like
            The z-data to be plotted.

        Notes
        -----
        Accepts x, y, z arguments or a single array-like (x, y, z)
        rrTN)r"r]r?)r.rarrr�set_data_3d�s
zLine3D.set_data_3dcC�|jS)z�
        Get the current data

        Returns
        -------
        verts3d : length-3 tuple or array-like
            The current data as a tuple or array-like.
        )r]r3rrr�get_data_3d�s	zLine3D.get_data_3dcsH|j\}}}t�||||jj�\}}}|�||�t��|�d|_dS)NF)	r]r�proj_transformrCrD�set_datar6rIr?)r.rJ�xs3d�ys3d�zs3dr^r_r`r;rrrI�s

zLine3D.drawrR)rSrTrUrVr,r-rfrhrrWrIrXrrr;rr\�s
r\cCrY)zConvert a 2D line to 3D.N)r\r<r-)�liner`r%rrr�
line_2d_to_3d�srocsHt�|t|��}|jddd�}dd�t||�D�}�fdd�|D�}|S)zConvert a path to a 3D segment.F��simplify�curvescSs"g|]
\\\}}}}|||f�qSrr��.0rr�coderrrr�
<listcomp>��"z'_path_to_3d_segment.<locals>.<listcomp>c� g|]\}}}t|||���qSr�re�rtrrrr$rrrv�� )rrdr"�
iter_segments�zip)rr`r%�pathsegs�seg�seg3drr$r�_path_to_3d_segment�s
r�csPt�|�st�|t|��}nt|�t|�krtd���fdd�t||�D�}|S)z6Convert paths from a collection object to 3D segments.z-Number of z-coordinates does not match paths.c�g|]
\}}t||���qSr)r��rtr�pathzr$rrrv���z)_paths_to_3d_segments.<locals>.<listcomp>)rr!rdr"r#r})�pathsr`r%�segsrr$r�_paths_to_3d_segments�s

�r�csjt�|t|��}|jddd�}dd�t||�D�}|r+t|�\}}�fdd�|D�}ng}g}|t|�fS)z/Convert a path to a 3D segment with path codes.FrpcSs&g|]\\\}}}}|||f|f�qSrrrsrrrrvs&z2_path_to_3d_segment_with_codes.<locals>.<listcomp>crxrryrzr$rrrvr{)rrdr"r|r}�list)rr`r%r~�	seg_codesr�codesr�rr$r�_path_to_3d_segment_with_codes�sr�csTt�|t|��}�fdd�t||�D�}|rt|�\}}ngg}}t|�t|�fS)zP
    Convert paths from a collection object to 3D segments with path codes.
    cr�r)r�r�r$rrrvr�z4_paths_to_3d_segments_with_codes.<locals>.<listcomp>)rrdr"r}r�)r�r`r%�segments_codes�segmentsr�rr$r� _paths_to_3d_segments_with_codess
�
r�csbeZdZdZdd�Z�fdd�Ze�dd�dd	d
��Ze	j
ejddd
d�d�fdd�	��Z�ZS)�Line3DCollectionz#
    A collection of 3D lines.
    cCr>�z&Set the position to use for z-sorting.TN��
_sort_zposr?�r.�valrrr�
set_sort_zpos �
zLine3DCollection.set_sort_zposcs||_t��g�dS)z"
        Set 3D segments.
        N)�_segments3dr6�set_segments)r.r�r;rrr�%szLine3DCollection.set_segments�3.4rJNcsT�fdd��jD�}dd�|D�}t��|�d}|D]\}}}t|t|��}q|S)zB
        Project the points according to renderer matrix.
        csg|]
}t�|�jj��qSr)rrBrCrD)rt�pointsr3rrrv1s�z5Line3DCollection.do_3d_projection.<locals>.<listcomp>cSs g|]\}}}t�||g��qSr)r�column_stack)rtr^r_r`rrrrv3r{ge��A)r�r	r��min)r.rJ�xyslist�segments_2d�minzr^r_r`rr3r�do_3d_projection,s
�z!Line3DCollection.do_3d_projection�project)�alternativeFcs|r|��t��|�dSr))r�r6rI)r.rJr�r;rrrI<szLine3DCollection.drawr))F)
rSrTrUrVr�r�r�delete_parameterr�rrWrIrXrrr;rr�s
�r�cCs$t|��||�}t|_|�|�dS)z6Convert a LineCollection to a Line3DCollection object.N)r��	get_pathsr�r<r�)�colr`r%�
segments3drrr�line_collection_2d_to_3dEsr�csPeZdZdZddd��fdd�
Zddd	�Zd
d�Ze�dd
�ddd��Z	�Z
S)�Patch3Dz
    3D patch object.
    rr�r`r%cs"t�j|i|��|�||�dSr))r6r,r-)r.r`r%rar/r;rrr,QszPatch3D.__init__rcs.t�|t|��}�fdd�t||�D�|_dS)Ncs"g|]
\\}}}t|||���qSrryrzr$rrrvWs
�z-Patch3D.set_3d_properties.<locals>.<listcomp>)rrdr"r}�
_segment3d)r.�vertsr`r%rr$rr-Us
�zPatch3D.set_3d_propertiescCrgr))�_path2dr3rrr�get_pathZ�zPatch3D.get_pathr�rJNc
CsN|j}t|�\}}}t�||||jj�\}}}}	t�t�	||g��|_
t|�Sr))r�r}r�proj_transform_cliprCrD�mpath�Pathrr�r�r��
r.rJ�sr^r_r`�vxs�vys�vzs�visrrrr�]s
�zPatch3D.do_3d_projectionrRr))rSrTrUrVr,r-r�rr�r�rXrrr;rr�Ls

r�c@s@eZdZdZddd�dd�Zddd	�Ze�d
d�dd
d��ZdS)�PathPatch3Dz
    3D PathPatch object.
    rrr�cKs$tj|fi|��|�|||�dSr))rr,r-)r.rr`r%r/rrrr,lszPathPatch3D.__init__rcCs tj||j||d�|j|_dS)Nr�)r�r-�verticesr��_code3d)r.rr`r%rrrr-qszPathPatch3D.set_3d_propertiesr�rJNc
CsR|j}t|�\}}}t�||||jj�\}}}}	t�t�	||g�|j
�|_t|�Sr))
r�r}rr�rCrDr�r�rr�r�r�r�r�rrrr�us
�zPathPatch3D.do_3d_projectionrRr))	rSrTrUrVr,r-rr�r�rrrrr�gs

r�cCs4|��}|��}|�|�}t|�r|dSt�g�S)z2Return a list of vertices for the path of a patch.r)�get_patch_transformr��to_polygonsr"rr )�patch�transr�polygonsrrr�_get_patch_vertss
r�cCs t|�}t|_|�|||�dS)z$Convert a Patch to a Patch3D object.N)r�r�r<r-)r�rr%r�rrr�patch_2d_to_3d�sr�cCs2|��}|��}|�|�}t|_|�|||�dS)z,Convert a PathPatch to a PathPatch3D object.N)r�r��transform_pathr�r<r-)�	pathpatchrr%rr�r�rrr�pathpatch_2d_to_3d�s

r�cs�eZdZdZdddd��fdd�
Zdd	�Zd
d�Zdd
�Zdd�Ze	�
dd�d�fdd�	�Zdd�Z�fdd�Z
�fdd�Z�ZS)�Patch3DCollectionz%
    A collection of 3D patches.
    rrT�r`r%�
depthshadecs(||_t�j|i|��|�||�dS)a�
        Create a collection of flat 3D patches with its normal vector
        pointed in *zdir* direction, and located at *zs* on the *zdir*
        axis. 'zs' can be a scalar or an array-like of the same length as
        the number of patches in the collection.

        Constructor arguments are the same as for
        :class:`~matplotlib.collections.PatchCollection`. In addition,
        keywords *zs=0* and *zdir='z'* are available.

        Also, the keyword argument *depthshade* is available to
        indicate whether or not to shade the patches in order to
        give the appearance of depth (default is *True*).
        This is typically desired in scatter plots.
        N)�_depthshader6r,r-�r.r`r%r�rar/r;rrr,�szPatch3DCollection.__init__cCrgr)�r�r3rrr�get_depthshade�r�z Patch3DCollection.get_depthshadecCr>�z�
        Set whether depth shading is performed on collection members.

        Parameters
        ----------
        depthshade : bool
            Whether to shade the patches in order to give the appearance of
            depth.
        TN�r�r?�r.r�rrr�set_depthshade��

z Patch3DCollection.set_depthshadecCr>r�r�r�rrrr��r�zPatch3DCollection.set_sort_zposcCs`|��|��}t|�dkr|j\}}ng}g}t||t�|�|�|_td�|_	d|_
d|_dS�Nr���T)�update_scalarmappable�get_offsetsr"�Trer�
atleast_1d�
_offsets3d�slice�_z_markers_idx�_vzsr?�r.r`r%�offsetsr^r_rrrr-�s

z#Patch3DCollection.set_3d_propertiesr�rJNc	s\|j\}}}t�||||jj�\}}}}||_t��t�	||g��|j
dkr+t|�StjS�Nr)
r�rr�rCrDr�r6�set_offsetsrr��sizer��nan)	r.rJr^r_r`r�r�r�r�r;rrr��s
�
z"Patch3DCollection.do_3d_projectioncC�D|jdur|jrt||j�n|}t|�dkr||j}t�||j�S�Nr�r�r��_zalphar"r��mcolors�
to_rgba_array�_alpha�r.�color_arrayrrr�"_maybe_depth_shade_and_sort_colors����
z4Patch3DCollection._maybe_depth_shade_and_sort_colorsc�|�t����Sr)�r�r6�
get_facecolorr3r;rrr���zPatch3DCollection.get_facecolorc�&t�|jd�r|��S|�t����S�N�face�r�
_str_equal�_edgecolorsr�r�r6�
get_edgecolorr3r;rrr���zPatch3DCollection.get_edgecolorr))rSrTrUrVr,r�r�r�r-rr�r�r�r�r�rXrrr;rr��s


r�cs�eZdZdZdddd��fdd�
Z�fdd	�Zd
d�Zdd
�Zd"�fdd�	Z�fdd�Z	dd�Z
dd�Ze�
dd�d#dd��Zdd�Z�fdd�Z�fd d!�Z�ZS)$�Path3DCollectionz#
    A collection of 3D paths.
    rrTr�cs.||_d|_t�j|i|��|�||�dS)a�
        Create a collection of flat 3D paths with its normal vector
        pointed in *zdir* direction, and located at *zs* on the *zdir*
        axis. 'zs' can be a scalar or an array-like of the same length as
        the number of paths in the collection.

        Constructor arguments are the same as for
        :class:`~matplotlib.collections.PathCollection`. In addition,
        keywords *zs=0* and *zdir='z'* are available.

        Also, the keyword argument *depthshade* is available to
        indicate whether or not to shade the patches in order to
        give the appearance of depth (default is *True*).
        This is typically desired in scatter plots.
        FN)r��_in_drawr6r,r-r�r;rrr,�szPath3DCollection.__init__cs@tj|dd��t��|�Wd�dS1swYdS)NT)r�)rrHr6rIrPr;rrrIs"�zPath3DCollection.drawcCr>r�r�r�rrrr�r�zPath3DCollection.set_sort_zposcCs||��|��}t|�dkr|j\}}ng}g}t||t�|�|�|_|j|_	|j
|_|j\}}}td�|_
d|_d|_dSr�)r�r�r"r�rerr�r��_sizes�_sizes3d�_linewidths�
_linewidths3dr�r�r�r?r�rrrr-s

z"Path3DCollection.set_3d_properties�R@cs"t��||�|js||_dSdSr))r6�	set_sizesr�r�)r.�sizes�dpir;rrr;s
�zPath3DCollection.set_sizescs t��|�|js||_dSdSr))r6�
set_linewidthr��_linewidth3d)r.�lwr;rrr@s
�zPath3DCollection.set_linewidthcCrgr)r�r3rrrr�Er�zPath3DCollection.get_depthshadecCr>r�r�r�rrrr�Hr�zPath3DCollection.set_depthshader�rJNc
Cs�|j\}}}t�||||jj�\}}}}t�|�ddd�}	|_||_t	|j
�dkr1|j
|	|_t	|j�dkr>|j|	|_
||	}||	}||	}t�|t�||f��|jr]t�|�StjS)Nr�r)r�rr�rCrDr�argsortr�r�r"r�r�r�r�rr�r�r�r�r�)
r.rJr^r_r`r�r�r�r��
z_markers_idxrrrr�Us
�z!Path3DCollection.do_3d_projectioncCr�r�r�r�rrrr�tr�z3Path3DCollection._maybe_depth_shade_and_sort_colorscr�r)r�r3r;rrr�~r�zPath3DCollection.get_facecolorcr�r�r�r3r;rrr��r�zPath3DCollection.get_edgecolor)r�r))rSrTrUrVr,rIr�r-rrr�r�rr�r�r�r�r�rXrrr;rr��s 


r�TcCs>t|t�r	t|_nt|t�rt|_||_d|_|�||�dS)a
    Convert a :class:`~matplotlib.collections.PatchCollection` into a
    :class:`Patch3DCollection` object
    (or a :class:`~matplotlib.collections.PathCollection` into a
    :class:`Path3DCollection` object).

    Parameters
    ----------
    za
        The location or locations to place the patches in the collection along
        the *zdir* axis. Default: 0.
    zdir
        The axis in which to place the patches. Default: "z".
    depthshade
        Whether to shade the patches to give a sense of depth. Default: *True*.

    FN)	�
isinstancerr�r<rr�r�r�r-)r�r`r%r�rrr�patch_collection_2d_to_3d�s

r	cs�eZdZdZdd��fdd�
Zejejejd�Z	dd�Z
d	d
�Zd#�fdd
�	Zdd�Z
dd�Zdd�Ze�dd�d$dd��Z�fdd�Z�fdd�Zdd�Zdd �Zd!d"�Z�ZS)%�Poly3DCollectiona�
    A collection of 3D polygons.

    .. note::
        **Filling of 3D polygons**

        There is no simple definition of the enclosed surface of a 3D polygon
        unless the polygon is planar.

        In practice, Matplotlib fills the 2D projection of the polygon. This
        gives a correct filling appearance only for planar polygons. For all
        other polygons, you'll find orientations in which the edges of the
        polygon intersect in the projection. This will lead to an incorrect
        visualization of the 3D area.

        If you need filled areas, it is recommended to create them via
        `~mpl_toolkits.mplot3d.axes3d.Axes3D.plot_trisurf`, which creates a
        triangulation and thus generates consistent surfaces.
    �average)�zsortcsht�j|g|�Ri|��t|tj�r|jdkrtd��n
tdd�|D��r*td��|�|�d|_	dS)aS
        Parameters
        ----------
        verts : list of (N, 3) array-like
            Each element describes a polygon as a sequence of ``N_i`` points
            ``(x, y, z)``.
        zsort : {'average', 'min', 'max'}, default: 'average'
            The calculation method for the z-order.
            See `~.Poly3DCollection.set_zsort` for details.
        *args, **kwargs
            All other parameters are forwarded to `.PolyCollection`.

        Notes
        -----
        Note that this class does a bit of magic with the _facecolors
        and _edgecolors properties.
        rz)verts must be a list of (N, 3) array-likecss"�|]}tt�|��dkVqdS)r5N)r"r�shape)rt�vertrrr�	<genexpr>�s� z,Poly3DCollection.__init__.<locals>.<genexpr>N)
r6r,rr�ndarray�ndimr#�any�	set_zsort�_codes3d)r.r�rrar/r;rrr,�s
�

zPoly3DCollection.__init__)rr��maxcCs|j||_d|_d|_dS)a
        Set the calculation method for the z-order.

        Parameters
        ----------
        zsort : {'average', 'min', 'max'}
            The function applied on the z-coordinates of the vertices in the
            viewer's coordinate system, to determine the z-order.
        NT)�_zsort_functions�
_zsortfuncr�r?)r.rrrrr�s

zPoly3DCollection.set_zsortcCs�t|�rt�|�j\}}}nggg}}}t�t|��}t�||||g�|_dgt�dd�|D���}gtt	|dd�|dd���|_
dS)zOptimize points for projection.rcSsg|]}t|��qSr)r")rt�segmentrrrrv�sz/Poly3DCollection.get_vector.<locals>.<listcomp>Nr�r)r"r�	row_stackr��onesr �_vec�cumsum�mapr��
_segslices)r.r�r^r_r`r�indicesrrr�
get_vector�s&zPoly3DCollection.get_vectorTcs"|�|�t��gd�||_dS)zSet 3D vertices.FN)r r6�	set_verts�_closed)r.r��closedr;rrr!�s

zPoly3DCollection.set_vertscCs|j|dd�||_dS)z Set 3D vertices with path codes.F)r#N)r!r)r.r�r�rrr�set_verts_and_codes�s
z$Poly3DCollection.set_verts_and_codescCsF|��d|_|�d�t�|�|_t�|�|_t�|�|_	d|_
dS)NrT)r�r�rr
r��_facecolor3dr��_edgecolor3d�	get_alpha�_alpha3dr?r3rrrr-s

z"Poly3DCollection.set_3d_propertiescCr>r�r�r�rrrr�r�zPoly3DCollection.set_sort_zposr�rJNcs��jdur����jr�j�_�jr�j�_t�	�j
�jj�\������fdd��j
D�}�j}�j}t|�t|�krF|jt|�dd�}t|�t|�kr`t|�dkrW|}n	|jt|�dd�}|r�t�fdd�tt|||��D�dd	�d
d�}t|�\}}�_�_}ng}t�d��_t�d��_g}�jdur��fd
d�|D�}	t��||	�nt��|�j�t�j�t|�kr��j�_�jdur�t�dgdg�jgdgg�}
t�	|
�jj�}|ddS�jdkr�t���Stj S)z<
        Perform the 3D projection for this object.
        Ncs"g|]
}�|�|�|f�qSrr)rt�sl)�txs�tys�tzsrrrv(rwz5Poly3DCollection.do_3d_projection.<locals>.<listcomp>r)�axisc3s>�|]\}\\}}}}}��|�t�||g�|||fVqdSr))rrr�)rt�idxr^r_r`�fc�ecr3rrr8s�&�z4Poly3DCollection.do_3d_projection.<locals>.<genexpr>cSs|dSr�r)rrrr�<lambda>;sz3Poly3DCollection.do_3d_projection.<locals>.<lambda>T)�key�reverse�r�csg|]}�j|�qSr)r)rtr.r3rrrvFsrr5)!�_Ar��_face_is_mapped�_facecolorsr%�_edge_is_mappedr�r&r�_proj_transform_vecrrCrDrr"�repeat�sorted�	enumerater}�
_facecolors2d�
_edgecolors2dr�emptyrr
r$r!r"r�r r�r�r�)r.rJ�xyzlist�cface�cedge�
z_segments_2d�_r��idxsr��zvec�ztransr)r.r*r+r,rr�sT

���



z!Poly3DCollection.do_3d_projectionc�t��|�t�|�|_dSr))r6�
set_facecolorr
r�r%�r.rr;rrrJ[�zPoly3DCollection.set_facecolorcrIr))r6�
set_edgecolorr
r�r&rKr;rrrM`rLzPoly3DCollection.set_edgecolorc
Csxtj�||�zt�|j|j�|_Wnttt	fyYnwzt�|j
|j�|_Wnttt	fy6Ynwd|_dSr@)
r�Artist�	set_alphar�r�r%r��AttributeError�	TypeError�
IndexErrorr&r�r?)r.�alpharrrrOes 
��
��
zPoly3DCollection.set_alphacCrgr))r>r3rrrr�tr�zPoly3DCollection.get_facecolorcCrgr))r?r3rrrr�wr�zPoly3DCollection.get_edgecolor)Tr))rSrTrUrVr,rrr�rrrr r!r$r-r�rr�r�rJrMrOr�r�rXrrr;rr
�s(�
Er
cCs2t|��||�\}}t|_|�||�|��dS)z6Convert a PolyCollection to a Poly3DCollection object.N)r�r�r
r<r$r-)r�r`r%�segments_3dr�rrr�poly_collection_2d_to_3d{s
�rUcCsH|dkr	|||fS|dkr|||fS|ddkrt||||�S|||fS)z�
    Reorder coordinates so that 2D xs, ys can be plotted in the plane
    orthogonal to zdir. zdir is normally x, y or z. However, if zdir
    starts with a '-' it is interpreted as a compensation for rotate_axes.
    rrr�-)�rotate_axes�r^r_r`r%rrrre�s


recCsR|dkr	|||fS|dkr|||fS|dkr|||fS|dkr$|||fS|||fS)z�
    Reorder coordinates so that the axes are rotated with zdir along
    the original z axis. Prepending the axis with a '-' does the
    inverse transform, so zdir can be x, -x, y, -y, z or -z
    rz-xrz-yrrXrrrrW�s




rWcCs�t|�dkst|�dkrt�d�Stt|�t|��}d||�d}t�t�|�t|�df�}t�	|dd�dd�f|dd�df|g�S)z7Modify the alphas of the color list according to depth.rr4rgffffff�?r5Nr)
r"r�zerosr
r�rrdr�r�r�)rr`�norm�sats�rgbarrrr��s
.r�rR)rrT)6rVrE�numpyr�
matplotlibrrrrr�rrr*rr��matplotlib.collectionsr	r
rr�matplotlib.colorsr
�matplotlib.patchesrr(rrrr&r+r'r[�Line2Dr\ror�r�r�r�r�r�r�r�r�r�r�r�r�r	r
rUrerWr�rrrr�<module>sH$"
P
>





*


`

W	

Youez - 2016 - github.com/yon3zu
LinuXploit