Ë
    íÍ:j�ò  ã                   ó4  — d Z ddlZddlZddlmZ ddlmZmZm	Z	m
ZmZmZmZmZ ddlmZmZmZmZmZ ddlmZ ddlmZ d	„ Zd
„ Zd„ Zd„ Zd„ Z  G d„ dejB                  «      Z"d5d„Z# G d„ dejH                  «      Z%d5d„Z&d6d„Z'd6d„Z(d6d„Z)d6d„Z* G d„ de«      Z+d5d„Z, G d„ de«      Z-d5d„Z. G d„ de«      Z/ G d „ d!e/«      Z0d"„ Z1d5d#„Z2d6d$„Z3 G d%„ d&e«      Z4d'„ Z5 G d(„ d)e«      Z6	 	 	 	 d7dd*œd+„Z7 G d,„ d-e«      Z8d5d.„Z9d/„ Z:d0„ Z;	 	 d8d1„Z<d9d2„Z=d3„ Z>d:d4„Z?y);zx
Module containing 3D artist code and functions to convert 2D
artists into 3D versions which can be added to an Axes3D.
é    N)Úcontextmanager)Ú_apiÚartistÚcbookÚcolorsÚlinesÚtextÚpathÚrcParams)Ú
CollectionÚLineCollectionÚPolyCollectionÚPatchCollectionÚPathCollection)ÚPatché   )Úproj3dc                 ó*   — | dz   dz  } | dkD  r| dz
  } | S )z?Return the given angle normalized to -180 < *a* <= 180 degrees.ih  é´   © ©Úas    úo/home/mcse/projects/srt_converter/srt-converter-venv/lib/python3.12/site-packages/mpl_toolkits/mplot3d/art3d.pyÚ_norm_angler      s$   € à	
ˆS‰�C‰€AØˆ3‚wØ�‰GˆØ€Hó    c                 ó*   — | dz   dz  } | dkD  r| dz
  } | S )z=Return the given angle normalized to -90 < *a* <= 90 degrees.r   éZ   r   r   s    r   Ú_norm_text_angler   !   s$   € à	
ˆS‰�C‰€AØˆ2‚vØ�‰GˆØ€Hr   c                 ó¸  — t        j                  | d«      rt        j                  d«      S t        j                  | d«      rt        j                  d«      S t        j                  | d«      rt        j                  d«      S | €t        j                  d«      S t        j                  | «      r#t        | «      dk(  rt        j                  | «      S t        d	«      ‚)
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 an array

    Returns
    -------
    x, y, z : array
        The direction vector.
    Úx)r   r   r   Úy)r   r   r   Úz)r   r   r   )r   r   r   é   z2'x', 'y', 'z', None or vector of length 3 expected)r   Ú
_str_equalÚnpÚarrayÚiterableÚlenÚ
ValueError)Úzdirs    r   Úget_dir_vectorr+   )   s¥   € ô( ×Ñ˜˜cÔ"Ü�x‰x˜	Ó"Ð"Ü	×	Ñ	˜$ Ô	$Ü�x‰x˜	Ó"Ð"Ü	×	Ñ	˜$ Ô	$Ü�x‰x˜	Ó"Ð"Ø	ˆÜ�x‰x˜	Ó"Ð"Ü	�‰�TÔ	œs 4›y¨Aš~Ü�x‰x˜‹~ÐäÐMÓNÐNr   c           	      ód  — t         j                  j                  | |j                  j                  k  | |j                  j
                  kD  ||j                  j                  k  ||j                  j                  kD  ||j                  j                  k  ||j                  j
                  kD  f«      }|S )a]  
    Return the mask of the points outside the axes view limits.

    Parameters
    ----------
    xs, ys, zs : array-like
        The points to mask. These should be in data coordinates.
    axes : Axes3D
        The axes to use for the view limits.

    Returns
    -------
    mask : np.array
        The mask of the points as a bool array.
    )	r%   Ú
logical_orÚreduceÚ
xy_viewLimÚxminÚxmaxÚyminÚymaxÚ
zz_viewLim)ÚxsÚysÚzsÚaxesÚmasks        r   Ú_viewlim_maskr:   K   s�   € ô  �=‰=×Ñ  d§o¡o×&:Ñ&:Ñ!:Ø!# d§o¡o×&:Ñ&:Ñ!:Ø!# d§o¡o×&:Ñ&:Ñ!:Ø!# d§o¡o×&:Ñ&:Ñ!:Ø!# d§o¡o×&:Ñ&:Ñ!:Ø!# d§o¡o×&:Ñ&:Ñ!:ð!<ó =€Dð €Kr   c           	      óŠ  — t         j                  j                  t        j                  |j                  j
                  j                  | «      «      t        j                  |j                  j
                  j                  |«      «      t        j                  |j                  j
                  j                  |«      «      f«      S )a·  
    Return the mask of points whose coordinates are invalid for the axis
    scale they live on (e.g. <=0 on a log axis).

    Parameters
    ----------
    xs, ys, zs : array-like
        The points to check, in data coordinates.
    axes : Axes3D
        The axes whose scales are queried.

    Returns
    -------
    mask : np.ndarray
        Boolean array, ``True`` where any of x/y/z is out of its scale's
        valid domain.
    )	r%   r-   r.   Úlogical_notÚxaxisÚ_scaleÚval_in_rangeÚyaxisÚzaxis)r5   r6   r7   r8   s       r   Ú_scale_invalid_maskrB   d   sƒ   € ô$ �=‰=×ÑÜ
�‰�t—z‘z×(Ñ(×5Ñ5°bÓ9Ó:Ü
�‰�t—z‘z×(Ñ(×5Ñ5°bÓ9Ó:Ü
�‰�t—z‘z×(Ñ(×5Ñ5°bÓ9Ó:ð!<ó =ð =r   c                   ól   ‡ — e Zd ZdZd	d„Zd„ Zd
ˆ fd„	Zd„ Zdd„Ze	j                  d„ «       Zd
d„Zˆ xZS )ÚText3DaJ  
    Text object with 3D position and direction.

    Parameters
    ----------
    x, y, z : float
        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.
    axlim_clip : bool, default: False
        Whether to hide text outside the axes view limits.

        .. versionadded:: 3.10

    Other Parameters
    ----------------
    **kwargs
         All other parameters are passed on to `~matplotlib.text.Text`.
    c                 óÔ   — d|v rt        j                  d«       d|v rt        j                  d«       t        j                  j                  | |||fi |¤Ž | j                  |||«       y )NÚrotationzOThe `rotation` parameter has not yet been implemented and is currently ignored.Úrotation_modezTThe `rotation_mode` parameter has not yet been implemented and is currently ignored.)r   Úwarn_externalÚmtextÚTextÚ__init__Úset_3d_properties)Úselfr    r!   r"   r	   r*   Ú
axlim_clipÚkwargss           r   rK   zText3D.__init__”   sk   € à˜ÑÜ×Ñð,ôð ˜fÑ$Ü×Ñð,ôô 	�
‰
×Ñ˜D ! Q¨Ñ7°Ò7Ø×Ñ˜q $¨
Õ3r   c                 óH   — | j                   | j                  | j                  fS )z*Return the (x, y, z) position of the text.)Ú_xÚ_yÚ_z©rM   s    r   Úget_position_3dzText3D.get_position_3d£   s   € à�w‰w˜Ÿ™ §¡Ð(Ð(r   c                 óx   •— t         ‰| �  |dd «       | j                  |d   «       |�t        |«      | _        yy)ax  
        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. See `.get_dir_vector` for a description of the values.
        Né   )ÚsuperÚset_positionÚset_zr+   Ú_dir_vec)rM   Úxyzr*   Ú	__class__s      €r   Úset_position_3dzText3D.set_position_3d§   s?   ø€ ô 	‰Ñ˜S  !˜WÔ%Ø�
‰
�3�q‘6ÔØÐÜ*¨4Ó0ˆD�Mð r   c                 ó    — || _         d| _        y)zl
        Set the *z* position of the text.

        Parameters
        ----------
        z : float
        TN)rS   Ústale)rM   r"   s     r   rZ   zText3D.set_z¸   s   € ð ˆŒØˆ�
r   c                 óN   — || _         t        |«      | _        || _        d| _        y)aÏ  
        Set the *z* position and direction of the text.

        Parameters
        ----------
        z : float
            The z-position in 3D space.
        zdir : {'x', 'y', 'z', 3-tuple}
            The direction of the text. Default: 'z'.
            See `.get_dir_vector` for a description of the values.
        axlim_clip : bool, default: False
            Whether to hide text outside the axes view limits.

            .. versionadded:: 3.10
        TN)rS   r+   r[   Ú_axlim_clipr`   )rM   r"   r*   rN   s       r   rL   zText3D.set_3d_propertiesÃ   s&   € ð  ˆŒÜ& tÓ,ˆŒØ%ˆÔØˆ�
r   c                 ó˜  — t        | j                  | j                  | j                  | j                  «      }| j
                  r9|t        | j                  | j                  | j                  | j                  «      z  }t        j                  |«      ret        j                  j                  | j                  | j                  | j                  g|t        ¬«      j                  t        j                  «      }n<t        j                  | j                  | j                  | j                  gt        ¬«      }|| j                  z   }t        j                  ||g«      }t!        j"                  |d d …df   |d d …df   |d d …df   | j                  «      }|d   d   |d   d   z
  }|d   d   |d   d   z
  }t%        j&                  t%        j(                  ||«      «      }	t+        j,                  | |d   d   |d   d   t/        |	«      ¬«      5  t0        j2                  j5                  | |«       d d d «       d| _        y # 1 sw Y   d| _        y xY w)N)r9   Údtype©rd   r   r   rW   )rQ   rR   Ú	_rotationF)rB   rQ   rR   rS   r8   rb   r:   r%   ÚanyÚmar&   ÚfloatÚfilledÚnanr[   Úasarrayr   Ú_scale_proj_transformÚmathÚdegreesÚatan2r   Ú_setattr_cmr   rI   rJ   Údrawr`   )
rM   Úrendererr9   Úpos3dÚdir_endÚpointsÚprojÚdxÚdyÚangles
             r   rr   zText3D.drawØ   sÆ  € ä" 4§7¡7¨D¯G©G°T·W±W¸d¿i¹iÓHˆØ×ÒØ”M $§'¡'¨4¯7©7°D·G±G¸T¿Y¹YÓGÑGˆDÜ�6‰6�$Œ<Ü—E‘E—K‘K §¡¨$¯'©'°4·7±7Ð ;Ø%)´ð  ó 8ß8>¹¼r¿v¹v»ñ ô —H‘H˜dŸg™g t§w¡w°·±Ð8ÄÔFˆEà˜$Ÿ-™-Ñ'ˆÜ—‘˜U GÐ,Ó-ˆÜ×+Ñ+Ø’1�a�4‰L˜&¢ A ™,¨ªq°!¨t©°d·i±ióAˆà�!‰W�Q‰Z˜$˜q™' !™*Ñ$ˆØ�!‰W�Q‰Z˜$˜q™' !™*Ñ$ˆÜ—‘œTŸZ™Z¨¨BÓ/Ó0ˆÜ×Ñ˜t¨¨Q©°©
°t¸A±w¸q±zÜ)9¸%Ó)@ôBñ 	,ä�J‰J�O‰O˜D (Ô+÷	,ð ˆ�
÷	,ð ˆ�
ús   È!H9È9I	c                  ó   — y ©Nr   )rM   rs   s     r   Úget_tightbboxzText3D.get_tightbboxï   s   € ð r   )r   r   r   Ú r"   Fr|   ©r   r"   F)Ú__name__Ú
__module__Ú__qualname__Ú__doc__rK   rU   r^   rZ   rL   r   Úallow_rasterizationrr   r}   Ú__classcell__©r]   s   @r   rD   rD   |   s@   ø„ ñó.4ò)õ1ò"	óð* ×Ññó  ð÷,r   rD   c                 ó@   — t         | _        | j                  |||«       y)a˜  
    Convert a `.Text` to a `.Text3D` object.

    Parameters
    ----------
    z : float
        The z-position in 3D space.
    zdir : {'x', 'y', 'z', 3-tuple}
        The direction of the text. Default: 'z'.
        See `.get_dir_vector` for a description of the values.
    axlim_clip : bool, default: False
        Whether to hide text outside the axes view limits.

        .. versionadded:: 3.10
    N)rD   r]   rL   )Úobjr"   r*   rN   s       r   Útext_2d_to_3dr‰   õ   s   € ô  €C„MØ×Ñ˜!˜T :Õ.r   c                   ód   ‡ — e Zd ZdZddœˆ fd„
Zd	d„Zd„ Zd„ Zej                  ˆ fd„«       Z
ˆ xZS )
ÚLine3Da²  
    3D line object.

    .. note:: Use `get_data_3d` to obtain the data associated with the line.
            `~.Line2D.get_data`, `~.Line2D.get_xdata`, and `~.Line2D.get_ydata` return
            the x- and y-coordinates of the projected 2D-line, not the x- and y-data of
            the 3D-line. Similarly, use `set_data_3d` to set the data, not
            `~.Line2D.set_data`, `~.Line2D.set_xdata`, and `~.Line2D.set_ydata`.
    F)rN   c                ób   •— t        ‰| �  g g g|¢­i |¤Ž | j                  |||«       || _        y)aM  

        Parameters
        ----------
        xs : array-like
            The x-data to be plotted.
        ys : array-like
            The y-data to be plotted.
        zs : array-like
            The z-data to be plotted.
        *args, **kwargs
            Additional arguments are passed to `~matplotlib.lines.Line2D`.
        N)rX   rK   Úset_data_3drb   )rM   r5   r6   r7   rN   ÚargsrO   r]   s          €r   rK   zLine3D.__init__  s8   ø€ ô 	‰Ñ˜˜RÐ1 $Ò1¨&Ò1Ø×Ñ˜˜R Ô$Ø%ˆÕr   c                 ó
  — | j                  «       }| j                  «       }t        j                  |«      j	                  «       }t        j                  |t        |«      «      }t        ||||«      | _	        || _
        d| _        y)a(  
        Set the *z* position and direction of the line.

        Parameters
        ----------
        zs : float or array of floats
            The location along the *zdir* axis in 3D space to position the
            line.
        zdir : {'x', 'y', 'z'}
            Plane to plot line orthogonal to. Default: 'z'.
            See `.get_dir_vector` for a description of the values.
        axlim_clip : bool, default: False
            Whether to hide lines with an endpoint outside the axes view limits.

            .. versionadded:: 3.10
        TN)Ú	get_xdataÚ	get_ydatar   Ú_to_unmasked_float_arrayÚravelr%   Úbroadcast_tor(   Újuggle_axesÚ_verts3drb   r`   )rM   r7   r*   rN   r5   r6   s         r   rL   zLine3D.set_3d_properties&  sj   € ð" �^‰^ÓˆØ�^‰^ÓˆÜ×+Ñ+¨BÓ/×5Ñ5Ó7ˆÜ�_‰_˜R¤ R£Ó)ˆÜ# B¨¨B°Ó5ˆŒØ%ˆÔØˆ�
r   c                 ó´   — t        |«      dk(  r|d   }t        d|«      D ](  \  }}t        j                  |«      rŒt	        |› d�«      ‚ || _        d| _        y)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)
        r   r   r\   z must be a sequenceTN)r(   Úzipr%   r'   ÚRuntimeErrorr–   r`   )rM   rŽ   Únamer\   s       r   r�   zLine3D.set_data_3d?  sc   € ô" ˆt‹9˜Š>Ø˜‘7ˆDÜ˜U DÓ)ò 	A‰IˆD�#Ü—;‘;˜sÕ#Ü" d VÐ+>Ð#?Ó@Ð@ð	Að ˆŒØˆ�
r   c                 ó   — | j                   S )z­
        Get the current data

        Returns
        -------
        verts3d : length-3 tuple or array-like
            The current data as a tuple or array-like.
        )r–   rT   s    r   Úget_data_3dzLine3D.get_data_3dX  s   € ð �}‰}Ðr   c                 ó¼  •— t        g | j                  ¢| j                  ‘­Ž }| j                  r$|t	        g | j                  ¢| j                  ‘­Ž z  }t        j                  |«      r–t        j                  |t        | j                  «      g| j                  d   j                  ¢­«      }t
        j                  j                  | j                  t        |¬«      j                  t
        j                  «      \  }}}n| j                  \  }}}t        j                   |||| j                  «      \  }}}	}
| j#                  ||«       t$        ‰| �M  |«       d| _        y )Nr   ©rd   r9   F)rB   r–   r8   rb   r:   r%   rg   r”   r(   Úshaperh   r&   ri   rj   rk   r   Ú_scale_proj_transform_clipÚset_datarX   rr   r`   )rM   rs   Ú
scale_maskr9   Úxs3dÚys3dÚzs3dr5   r6   r7   Útisr]   s              €r   rr   zLine3D.drawc  s  ø€ ä(ÐC¨$¯-©-ÐC¸¿¹ÒCˆ
Ø×ÒØœ-ÐB¨¯©ÐB¸¿	¹	ÒBÑBˆJÜ�6‰6�*ÔÜ—?‘?ØÜ�T—]‘]Ó#Ð= d§m¡m°AÑ&6×&<Ñ&<Ñ=óˆDô  "Ÿu™uŸ{™{¨4¯=©=Ü16¸Tð  +ó  CßCIÁ6Ì"Ï&É&Ã>ñ ˆD�$™ð  $Ÿ}™}ÑˆD�$˜Ü ×;Ñ;¸DÀ$ÈÈdÏiÉiÓX‰ˆˆB��CØ�‰�b˜"ÔÜ‰‰�XÔØˆ�
r   r   )r€   r�   r‚   rƒ   rK   rL   r�   rœ   r   r„   rr   r…   r†   s   @r   r‹   r‹   	  s;   ø„ ñð 6;ö &ó$ò2ò2	ð ×Ñóó  ôr   r‹   c                 ó@   — t         | _        | j                  |||«       y)aÔ  
    Convert a `.Line2D` to a `.Line3D` object.

    Parameters
    ----------
    zs : float
        The location along the *zdir* axis in 3D space to position the line.
    zdir : {'x', 'y', 'z'}
        Plane to plot line orthogonal to. Default: 'z'.
        See `.get_dir_vector` for a description of the values.
    axlim_clip : bool, default: False
        Whether to hide lines with an endpoint outside the axes view limits.

        .. versionadded:: 3.10
    N)r‹   r]   rL   )Úliner7   r*   rN   s       r   Úline_2d_to_3dr©   w  s   € ô" €D„NØ×Ñ˜2˜t ZÕ0r   c                 ó$  — t        j                  |t        | «      «      }| j                  dd¬«      }t	        ||«      D ����cg c]  \  \  \  }}}}|||f‘Œ }}}}}|D ���cg c]  \  }}}t        ||||«      ‘Œ }	}}}|	S c c}}}}w c c}}}w )zConvert a path to a 3D segment.F©ÚsimplifyÚcurves)r%   r”   r(   Úiter_segmentsr˜   r•   )
r
   r7   r*   Úpathsegsr    r!   Úcoder"   ÚsegÚseg3ds
             r   Ú_path_to_3d_segmentr³   Œ  s’   € ô 
�‰˜œS ›YÓ	'€BØ×!Ñ!¨5¸Ð!Ó?€HÜ03°H¸bÓ0A×
BÑ
BÑ,™.™6˜A˜q 4¨!ˆAˆq�!Š9Ð
B€CÓ
BØ9<×=Ð=©I¨Q°°1Œ[˜˜A˜q $Õ'Ð=€EÒ=Ø€Lùõ CùÜ=s   ÁB
Á$Bc           	      ó  — t        j                  |«      s t        j                  |t        | «      «      }n"t        |«      t        | «      k7  rt	        d«      ‚t        | |«      D ��cg c]  \  }}t        |||«      ‘Œ }}}|S c c}}w )z6Convert paths from a collection object to 3D segments.z-Number of z-coordinates does not match paths.)r%   r'   r”   r(   r)   r˜   r³   )Úpathsr7   r*   r
   ÚpathzÚsegss         r   Ú_paths_to_3d_segmentsr¸   –  s{   € ô �;‰;�rŒ?Ü�_‰_˜R¤ U£Ó,‰äˆr‹7”c˜%“jÒ ÜÐLÓMÐMô  # 5¨"›~÷/Ù��eô    e¨TÕ2ð /€Dñ /à€Kùó/s   Á'Bc                 ób  — t        j                  |t        | «      «      }| j                  dd¬«      }t	        ||«      D ����cg c]  \  \  \  }}}}|||f|f‘Œ }}}}}|r/t	        |Ž \  }	}
|	D ���cg c]  \  }}}t        ||||«      ‘Œ }}}}ng }g }
|t        |
«      fS c c}}}}w c c}}}w )z/Convert a path to a 3D segment with path codes.Fr«   )r%   r”   r(   r®   r˜   r•   Úlist)r
   r7   r*   r¯   r    r!   r°   r"   Ú	seg_codesr±   Úcodesr²   s               r   Ú_path_to_3d_segment_with_codesr½   ¤  s¾   € ô 
�‰˜œS ›YÓ	'€BØ×!Ñ!¨5¸Ð!Ó?€HÜ<?ÀÈ"Ó<M×NÑNÑ'8¡~©¨¨A°°q�1�a˜�)˜TÒ"ÐN€IÓNÙÜ˜)�_‰
ˆˆUØ=@×AÐA±	°°A°q”˜Q  1 dÕ+ÐAˆÓAàˆØˆØ”$�u“+ÐÐùõ Oùô Bs   ÁB"
Á3B*c           	      óî   — t        j                  |t        | «      «      }t        | |«      D ��cg c]  \  }}t	        |||«      ‘Œ }}}|rt        |Ž \  }}ng g }}t        |«      t        |«      fS c c}}w )zP
    Convert paths from a collection object to 3D segments with path codes.
    )r%   r”   r(   r˜   r½   rº   )rµ   r7   r*   r
   r¶   Úsegments_codesÚsegmentsr¼   s           r   Ú _paths_to_3d_segments_with_codesrÁ   ³  sz   € ô
 
�‰˜œS ›ZÓ	(€Bä),¨U°B«÷9Ù%˜$ ô 5°T¸5À$ÕGð 9€Nñ 9áÜ˜~Ð.‰ˆ‘%à˜b�%ˆÜ�‹>œ4 ›;Ð&Ð&ùó9s   ¯A1c                   ó   — e Zd ZdZd„ Zy)ÚCollection3DzA collection of 3D paths.c                 óV  — | j                   D ��cg c]  \  }}|‘Œ	 }}}|D �cg c]#  }t        g |j                  ¢| j                  ‘­Ž ‘Œ% }}| j                  r@t        ||«      D ��cg c])  \  }}|t        g |j                  ¢| j                  ‘­Ž z  ‘Œ+ }}}t        ||«      D ��cg c][  \  }}t        j                  |«      r?t        j                  j                  |t        j                  ||j                  «      ¬«      n|‘Œ] }}}|D �cg c]9  }t        j                  |dd…df   |dd…df   |dd…df   | j                  «      ‘Œ; }}t        || j                   «      D ����	cg c]A  \  \  }}}\  }}	t        j                   t        j                  j#                  ||g«      |	«      ‘ŒC c}	}}}| _        t        j&                  |D ��
cg c]  \  }}}
|
‘Œ
 c}
}«      }
t)        |
«      r|
j+                  «       S dS c c}}w c c}w c c}}w c c}}w c c}w c c}	}}}w c c}
}w )z0Project the points according to renderer matrix.©r9   Nr   r   rW   ç    eÍÍA)Ú_3dverts_codesrB   ÚTr8   rb   r˜   r:   r%   rg   rh   r&   r”   rŸ   r   rm   ÚmpathÚPathÚcolumn_stackÚ_pathsÚconcatenater(   Úmin)rM   ÚvsÚ_Úvs_listÚmasksÚmÚ	xyzs_listr5   r6   Úcsr7   s              r   Údo_3d_projectionzCollection3D.do_3d_projectionÅ  sú  € à#'×#6Ñ#6×7™%˜"˜a’2Ð7ˆÑ7ØAHÖI¸2Ô$Ð6 b§d¡dÐ6¨D¯I©IÔ6ÐIˆÐIØ×Òä"% e¨WÓ"5÷7Ù˜˜Bð œÐ8¨¯©Ð8¨d¯i©iÒ8Ó8ð 7ˆEñ 7ô !$ G¨UÓ 3÷5á�r˜1ô —f‘f˜Q”iô —5‘5—;‘;˜r¬¯©¸¸2¿8¹8Ó(D�;ÔEØ%'ñ(ð 5ˆñ 5ð @GöHØ9;ô ×1Ñ1ØŠq�!ˆt‰H�bš˜A˜‘h ¢1 a 4¡¨$¯)©)õ5ð Hˆ	ð Hô 47°yÀ$×BUÑBUÓ3V÷Xñ XÙ/™;˜B  A©¨¨Bô —z‘z¤"§%¡%×"4Ñ"4°b¸"°XÓ">ÀÕCõ XˆŒä�^‰^°	×:¡H A q¨"šRÓ:Ó;ˆÜ˜rœ7ˆr�v‰v‹xÐ+¨Ð+ùó 8ùÚIùó7ùó5ùòHùõXùã:s*   �H£(HÁ(.HÂ(A HÄ>HÅ*AH
ÇH%
N)r€   r�   r‚   rƒ   rÖ   r   r   r   rÃ   rÃ   Â  s
   „ Ù#ó,r   rÃ   c                 ó,  — t        j                  |t        | j                  «       «      «      }t	        | j                  «       |«      D ��cg c]�  \  }}t        j
                  t        g t        j
                  |j                  t        j                  |t        |j                  «      «      g«      j                  ¢|‘­Ž «      |j                  f‘Œƒ c}}| _
         t        j                  t        d«      t        | «      «      | _        || _        yc c}}w )z4Convert a `.Collection` to a `.Collection3D` object.z{}3DN)r%   r”   r(   Ú	get_pathsr˜   rË   r•   ÚverticesrÈ   r¼   rÇ   r   Ú_make_class_factoryrÃ   Útyper]   rb   )Úcolr7   r*   rN   Úpr"   s         r   Úcollection_2d_to_3drÞ   ×  sÔ   € ä	�‰˜œS §¡£Ó1Ó	2€Bô ˜Ÿ™›¨Ó,÷.ñ
 ˆAˆqô	 
�‰œð Ü�_‰_˜aŸj™j¬"¯/©/¸!¼SÀÇÁ»_Ó*MÐNÓO×QÑQðàòó 
ð 
�‰ò	ó.€CÔð D”E×-Ñ-¬l¸FÓCÄDÈÃIÓN€C„MØ €C…Oùó.s   ÁBDc                   ó:   ‡ — e Zd ZdZdˆ fd„	Zd„ Zˆ fd„Zd„ Zˆ xZS )ÚLine3DCollectionz#
    A collection of 3D lines.
    c                 ó4   •— t        ‰| �  |fi |¤Ž || _        y r|   )rX   rK   rb   )rM   r   rN   rO   r]   s       €r   rK   zLine3DCollection.__init__è  s"   ø€ Ü‰Ñ˜Ñ) &Ò)Ø%ˆÔð	r   c                 ó    — || _         d| _        y©z&Set the position to use for z-sorting.TN©Ú
_sort_zposr`   ©rM   Úvals     r   Úset_sort_zposzLine3DCollection.set_sort_zpos  ó   € àˆŒØˆ�
r   c                 ó2   •— || _         t        ‰| �	  g «       y)z"
        Set 3D segments.
        N)Ú_segments3drX   Úset_segments)rM   rÀ   r]   s     €r   rì   zLine3DCollection.set_segments	  s   ø€ ð $ˆÔÜ‰Ñ˜RÕ r   c                 óÒ  — | j                   }|D �cg c]  }t        |«      ‘Œ }}t        t        |«      «      dkD  }|rHt        d„ |D «       «      r t        j
                  j                  |«      }n+t	        j                  |«      }nt	        j                  |«      }|j                  dk(  r&t        j                  | g «       t        j                  S d}t        j
                  j                  |«      r2|j                  t        j
                  j                  ur|j                  }t        |d   |d   |d   | j                   «      }t	        j                  |«      r;|t	        j"                  |dt        j$                  f   g |j&                  ¢d	‘­«      z  }| j(                  rst+        |d   |d   |d   | j                   «      }t	        j                  |«      r=t	        j"                  |dt        j$                  f   g |j&                  ¢d	‘­«      }||z  }t-        j.                  || j                   «      }|dur!t        j
                  j1                  ||¬
«      }|ddd…f   }	|r,t	        j2                  |	t	        j4                  |dd «      «      }	t        j                  | |	«       t        |«      dkD  rt7        |d   j7                  «       d«      }
|
S t        j                  }
|
S c c}w )zB
        Project the points according to renderer matrix.
        r   c              3   óZ   K  — | ]#  }t         j                  j                  |«      –— Œ% y ­wr|   )r%   rh   ÚisMA)Ú.0Úsegments     r   ú	<genexpr>z4Line3DCollection.do_3d_projection.<locals>.<genexpr>  s   è ø€ Ò?¨7”2—5‘5—:‘:˜g×&Ñ?ùs   ‚)+r   F©.r   ©.r   ©.rW   .r#   rÅ   rW   NéÿÿÿÿrÆ   )rë   r(   Úsetrg   r%   rh   rÍ   Ú
asanyarrayÚsizer   rì   rk   rï   r9   ÚnomaskrB   r8   r”   ÚnewaxisrŸ   rb   r:   r   Ú_scale_proj_transform_vectorsr&   ÚsplitÚcumsumrÎ   )rM   rÀ   rñ   Úsegment_lengthsÚraggedr9   r¢   Úviewlim_maskÚxyzsÚsegments_2dÚminzs              r   rÖ   z!Line3DCollection.do_3d_projection  s{  € ð ×#Ñ#ˆð 8@Ö@¨Gœ3˜w�<Ð@ˆÐ@Ü”S˜Ó)Ó*¨QÑ.ˆÙäÑ?°hÔ?Ô?ÜŸ5™5×,Ñ,¨XÓ6‘äŸ>™>¨(Ó3‘ä—}‘} XÓ.ˆHð �=‰=˜AÒÜ×'Ñ'¨¨bÔ1Ü—6‘6ˆMàˆÜ�5‰5�:‰:�hÔ H§M¡M¼¿¹¿¹Ñ$EØ—=‘=ˆDä(¨°&Ñ)9Ø)1°&Ñ)9Ø)1°&Ñ)9Ø)-¯©ó4ˆ
ô �6‰6�*ÔØ”B—O‘O J¨s´B·J±J¨Ñ$?Ø$: j×&6Ñ&6Ð$:¸Ñ$:ó<ñ <ˆDð ×ÒÜ(¨°&Ñ)9Ø)1°&Ñ)9Ø)1°&Ñ)9Ø)-¯©ó4ˆLô �v‰v�lÔ#ä!Ÿ™¨|¸CÄÇÁ¸OÑ/LØ/G°×1CÑ1CÐ/GÀQÑ/Gó I�à˜lÑ*�ä×3Ñ3°H¸d¿i¹iÓHˆØ�uÑÜ—5‘5—;‘;˜t¨$�;Ó/ˆDØ˜3  ! ˜8‘nˆÙÜŸ(™( ;´·	±	¸/È#È2Ð:NÓ0OÓPˆKÜ×#Ñ# D¨+Ô6ô ˆt‹9�qŠ=Ü�t˜F‘|×'Ñ'Ó)¨3Ó/ˆDð ˆô —6‘6ˆDØˆùòi As   ‘K$©F)	r€   r�   r‚   rƒ   rK   rè   rì   rÖ   r…   r†   s   @r   rà   rà   ä  s   ø„ ñõò8ô
!ö;r   rà   c                 ó€   — t        | j                  «       ||«      }t        | _        | j	                  |«       || _        y)z<Convert a `.LineCollection` to a `.Line3DCollection` object.N)r¸   rØ   rà   r]   rì   rb   )rÜ   r7   r*   rN   Ú
segments3ds        r   Úline_collection_2d_to_3dr  N  s2   € ä& s§}¡}£¸¸DÓA€JÜ$€C„MØ×Ñ�ZÔ Ø €C…Or   c                   ó@   ‡ — e Zd ZdZddddœˆ fd„
Zd
d„Zd„ Zd	„ Zˆ xZS )ÚPatch3Dz
    3D patch object.
    r   r"   F©r7   r*   rN   c                óJ   •— t        ‰| �  |i |¤Ž | j                  |||«       y)aí  
        Parameters
        ----------
        verts :
        zs : float
            The location along the *zdir* axis in 3D space to position the
            patch.
        zdir : {'x', 'y', 'z'}
            Plane to plot patch orthogonal to. Default: 'z'.
            See `.get_dir_vector` for a description of the values.
        axlim_clip : bool, default: False
            Whether to hide patches with a vertex outside the axes view limits.

            .. versionadded:: 3.10
        N)rX   rK   rL   )rM   r7   r*   rN   rŽ   rO   r]   s         €r   rK   zPatch3D.__init__[  s)   ø€ ô  	‰Ñ˜$Ð) &Ò)Ø×Ñ˜r 4¨Õ4r   c                 óÈ   — t        j                  |t        |«      «      }t        ||«      D ���cg c]  \  \  }}}t	        ||||«      ‘Œ c}}}| _        || _        yc c}}}w )a'  
        Set the *z* position and direction of the patch.

        Parameters
        ----------
        verts :
        zs : float
            The location along the *zdir* axis in 3D space to position the
            patch.
        zdir : {'x', 'y', 'z'}
            Plane to plot patch orthogonal to. Default: 'z'.
            See `.get_dir_vector` for a description of the values.
        axlim_clip : bool, default: False
            Whether to hide patches with a vertex outside the axes view limits.

            .. versionadded:: 3.10
        N)r%   r”   r(   r˜   r•   Ú
_segment3drb   )rM   Úvertsr7   r*   rN   r    r!   r"   s           r   rL   zPatch3D.set_3d_propertiesn  s]   € ô$ �_‰_˜R¤ U£Ó,ˆä.1°%¸«n÷>ð >Ù*¡  A¨ô ' q¨!¨Q°Õ5ô >ˆŒà%ˆÕùô>s   °Ac                 ó¤   — t        | d«      s9| j                  j                  «       | j                  _        | j	                  «        | j
                  S )NÚ_path2d)Úhasattrr8   Úget_projÚMrÖ   r  rT   s    r   Úget_pathzPatch3D.get_path…  s<   € ô �t˜YÔ'ØŸ)™)×,Ñ,Ó.ˆD�I‰IŒKØ×!Ñ!Ô#Ø�|‰|Ðr   c                 óX  — | j                   }t        |Ž \  }}}t        |||| j                  «      }| j                  r|t        |||| j                  «      z  }t        j                  |«      rNt        j                  j                  t        |Ž t        |¬«      j                  t        j                  «      \  }}}n|||}}}t        j                  |||| j                  «      \  }	}
}}t        j                   t        j                  j#                  |	|
g«      «      | _        t'        |«      S ©Nrž   )r  r˜   rB   r8   rb   r:   r%   rg   rh   r&   ri   rj   rk   r   r    rÉ   rÊ   rË   r  rÎ   ©rM   ÚsÚxs0Úys0Úzs0r9   r5   r6   r7   ÚvxsÚvysÚvzsÚviss                r   rÖ   zPatch3D.do_3d_projection�  sñ   € Ø�O‰OˆÜ˜Q˜‰ˆˆS�#Ü" 3¨¨S°$·)±)Ó<ˆØ×ÒØ”M # s¨C°·±Ó;Ñ;ˆDÜ�6‰6�$Œ<ÜŸ™Ÿ™¤S¨! WÜ+0°tð %ó =ß=C¹VÄBÇFÁF»^ñ ˆB�‘Bð ˜c 3�B�ˆBÜ#×>Ñ>¸rÀ2ÀrÈ4Ï9É9ÓUÑˆˆS�#�sÜ—z‘z¤"§%¡%×"4Ñ"4°c¸3°ZÓ"@ÓAˆŒÜ�3‹xˆr   r   )	r€   r�   r‚   rƒ   rK   rL   r  rÖ   r…   r†   s   @r   r
  r
  V  s%   ø„ ñð "$¨#¸%ö 5ó&&ò.ör   r
  c                   ó.   — e Zd ZdZddddœd„Zd
d„Zd„ Zy	)ÚPathPatch3Dz
    3D PathPatch object.
    r   r"   Fr  c                óX   — t        j                  | fi |¤Ž | j                  ||||«       y)a  
        Parameters
        ----------
        path :
        zs : float
            The location along the *zdir* axis in 3D space to position the
            path patch.
        zdir : {'x', 'y', 'z', 3-tuple}
            Plane to plot path patch orthogonal to. Default: 'z'.
            See `.get_dir_vector` for a description of the values.
        axlim_clip : bool, default: False
            Whether to hide path patches with a point outside the axes view limits.

            .. versionadded:: 3.10
        N)r   rK   rL   )rM   r
   r7   r*   rN   rO   s         r   rK   zPathPatch3D.__init__¢  s)   € ô" 	�‰�tÑ&˜vÒ&Ø×Ñ˜t R¨¨zÕ:r   c                 ón   — t         j                  | |j                  |||¬«       |j                  | _        y)aB  
        Set the *z* position and direction of the path patch.

        Parameters
        ----------
        path :
        zs : float
            The location along the *zdir* axis in 3D space to position the
            path patch.
        zdir : {'x', 'y', 'z', 3-tuple}
            Plane to plot path patch orthogonal to. Default: 'z'.
            See `.get_dir_vector` for a description of the values.
        axlim_clip : bool, default: False
            Whether to hide path patches with a point outside the axes view limits.

            .. versionadded:: 3.10
        r  N)r
  rL   rÙ   r¼   Ú_code3d)rM   r
   r7   r*   rN   s        r   rL   zPathPatch3D.set_3d_properties¶  s1   € ô$ 	×!Ñ! $¨¯©¸"À4Ø-7ð 	"ô 	9à—z‘zˆ�r   c                 ón  — | j                   }t        |Ž \  }}}t        |||| j                  «      }| j                  r|t        |||| j                  «      z  }t        j                  |«      rNt        j                  j                  t        |Ž t        |¬«      j                  t        j                  «      \  }}}n|||}}}t        j                  |||| j                  «      \  }	}
}}t        j                   t        j                  j#                  |	|
g«      | j$                  «      | _        t)        |«      S r  )r  r˜   rB   r8   rb   r:   r%   rg   rh   r&   ri   rj   rk   r   r    rÉ   rÊ   rË   r%  r  rÎ   r  s                r   rÖ   zPathPatch3D.do_3d_projectionÌ  s÷   € Ø�O‰OˆÜ˜Q˜‰ˆˆS�#Ü" 3¨¨S°$·)±)Ó<ˆØ×ÒØ”M # s¨C°·±Ó;Ñ;ˆDÜ�6‰6�$Œ<ÜŸ™Ÿ™¤S¨! WÜ+0°tð %ó =ß=C¹VÄBÇFÁF»^ñ ˆB�‘Bð ˜c 3�B�ˆBÜ#×>Ñ>¸rÀ2ÀrÈ4Ï9É9ÓUÑˆˆS�#�sÜ—z‘z¤"§%¡%×"4Ñ"4°c¸3°ZÓ"@À$Ç,Á,ÓOˆŒÜ�3‹xˆr   Nr   )r€   r�   r‚   rƒ   rK   rL   rÖ   r   r   r   r"  r"  �  s   „ ñð $&¨C¸Eô ;ó("ó,r   r"  c                 ó®   — | j                  «       }| j                  «       }|j                  |«      }t        |«      r|d   S t	        j
                  g «      S )z2Return a list of vertices for the path of a patch.r   )Úget_patch_transformr  Úto_polygonsr(   r%   r&   )ÚpatchÚtransr
   Úpolygonss       r   Ú_get_patch_vertsr-  Ü  sI   € à×%Ñ%Ó'€EØ�>‰>Ó€DØ×Ñ Ó&€HÜ˜hœ-ˆ8�A‰;Ð9¬R¯X©X°b«\Ð9r   c                 óX   — t        | «      }t        | _        | j                  ||||«       y)z*Convert a `.Patch` to a `.Patch3D` object.N)r-  r
  r]   rL   )r*  r"   r*   rN   r  s        r   Úpatch_2d_to_3dr/  ä  s'   € ä˜UÓ#€EÜ€E„OØ	×Ñ˜E 1 d¨JÕ7r   c                 ó¢   — | j                  «       }| j                  «       }|j                  |«      }t        | _        | j                  |||«       y)z2Convert a `.PathPatch` to a `.PathPatch3D` object.N)r  r(  Útransform_pathr"  r]   rL   )Ú	pathpatchr"   r*   r
   r+  rÉ   s         r   Úpathpatch_2d_to_3dr3  ë  sH   € à×ÑÓ€DØ×)Ñ)Ó+€Eà× Ñ  Ó&€EÜ%€IÔØ×Ñ  q¨$Õ/r   c                   ór   ‡ — e Zd ZdZddddddœˆ fd„
Zd„ Z	 dd	„Zd
„ Zdd„Zˆ fd„Z	d„ Z
ˆ fd„Zˆ fd„Zˆ xZS )ÚPatch3DCollectionz%
    A collection of 3D patches.
    r   r"   NF©r7   r*   Ú
depthshadeÚdepthshade_minalpharN   c                ó’   •— |€	t         d   }|€	t         d   }|| _        || _        t        ‰| �  |i |¤Ž | j                  |||«       y)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.

        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.

        *depthshade_minalpha* sets the minimum alpha value applied by
        depth-shading.
        Núaxes3d.depthshadeúaxes3d.depthshade_minalpha)r   Ú_depthshadeÚ_depthshade_minalpharX   rK   rL   ©	rM   r7   r*   r7  r8  rN   rŽ   rO   r]   s	           €r   rK   zPatch3DCollection.__init__ú  s\   ø€ ð8 ÐÜ!Ð"5Ñ6ˆJØÐ&Ü"*Ð+GÑ"HÐØ%ˆÔØ$7ˆÔ!Ü‰Ñ˜$Ð) &Ò)Ø×Ñ˜r 4¨Õ4r   c                 ó   — | j                   S r|   ©r<  rT   s    r   Úget_depthshadez Patch3DCollection.get_depthshade  ó   € Ø×ÑÐr   c                 óD   — |€	t         d   }|| _        || _        d| _        y)a¢  
        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.
        depthshade_minalpha : float, default: :rc:`axes3d.depthshade_minalpha`
            Sets the minimum alpha value used by depth-shading.

            .. versionadded:: 3.11
        Nr;  T©r   r<  r=  r`   ©rM   r7  r8  s      r   Úset_depthshadez Patch3DCollection.set_depthshade"  ó-   € ð$ Ð&Ü"*Ð+GÑ"HÐØ%ˆÔØ$7ˆÔ!Øˆ�
r   c                 ó    — || _         d| _        yrã   rä   ræ   s     r   rè   zPatch3DCollection.set_sort_zpos:  ré   r   c                 ó  — | j                  «        | j                  «       }t        |«      dkD  r|j                  \  }}ng }g }t	        ||t        j                  |«      |«      | _        t        d«      | _	        d| _
        || _        d| _        y)ai  
        Set the *z* positions and direction of the patches.

        Parameters
        ----------
        zs : float or array of floats
            The location or locations to place the patches in the collection
            along the *zdir* axis.
        zdir : {'x', 'y', 'z'}
            Plane to plot patches orthogonal to.
            All patches must have the same direction.
            See `.get_dir_vector` for a description of the values.
        axlim_clip : bool, default: False
            Whether to hide patches with a vertex outside the axes view limits.

            .. versionadded:: 3.10
        r   rö   NT)Úupdate_scalarmappableÚget_offsetsr(   rÈ   r•   r%   Ú
atleast_1dÚ
_offsets3dÚsliceÚ_z_markers_idxÚ_vzsrb   r`   ©rM   r7   r*   rN   Úoffsetsr5   r6   s          r   rL   z#Patch3DCollection.set_3d_properties?  s~   € ð( 	×"Ñ"Ô$Ø×"Ñ"Ó$ˆÜˆw‹<˜!ÒØ—Y‘Y‰FˆB‘àˆBØˆBÜ% b¨"¬b¯m©m¸BÓ.?ÀÓFˆŒÜ# B›iˆÔØˆŒ	Ø%ˆÔØˆ�
r   c                 óä  •— t        g | j                  ¢| j                  ‘­Ž }| j                  r$|t	        g | j                  ¢| j                  ‘­Ž z  }t        j                  |«      r0t
        j                  j                  | j                  |¬«      \  }}}n| j                  \  }}}t        j                  |||| j                  «      \  }}}}|| _        t
        j                  j                  |«      r/t        ‰	| �9  t
        j                  j                  ||g«      «       n$t        ‰	| �9  t        j                  ||g«      «       |j                   dkD  rt#        |«      S t
        j$                  S )NrÅ   r   )rB   rM  r8   rb   r:   r%   rg   rh   r&   r   r    rP  rï   rX   Úset_offsetsrË   rù   rÎ   rk   )
rM   r9   r5   r6   r7   r  r  r  r   r]   s
            €r   rÖ   z"Patch3DCollection.do_3d_projection`  s  ø€ Ü"Ð? D§O¡OÐ?°T·Y±YÒ?ˆØ×ÒØ”MÐ> 4§?¡?Ð>°D·I±IÒ>Ñ>ˆDÜ�6‰6�$Œ<ÜŸ™Ÿ™ T§_¡_¸4˜Ó@‰JˆB�‘BàŸ™‰JˆB��BÜ#×>Ñ>¸rÀ2ÀrÈ4Ï9É9ÓUÑˆˆS�#�sØˆŒ	Ü�5‰5�:‰:�cŒ?Ü‰GÑ¤§¡× 2Ñ 2°C¸°:Ó >Õ?ä‰GÑ¤§¡°°c°
Ó ;Ô<à�8‰8�aŠ<Ü�s“8ˆOä—6‘6ˆMr   c                 ó¨  — | j                   }| j                  �N| j                  rBt        || j                  | j                  ¬«      }|�|j
                  d   dk(  r||d d …df   z  }t        |«      dkD  rI|| j                     }t        j                  |«      dkD  r"t        j                  |«      | j                     }t        j                  ||«      S )N)Ú	min_alphar   é   r#   r   )Ú_alpharP  r<  Ú_zalphar=  rŸ   r(   rO  r%   Úndimrl   ÚmcolorsÚto_rgba_array©rM   Úcolor_arrayÚalphas      r   Ú"_maybe_depth_shade_and_sort_colorsz4Patch3DCollection._maybe_depth_shade_and_sort_colorst  sÄ   € ð —‘ˆØ�9‰9Ð  T×%5Ò%5Ü!ØØ—	‘	Ø×3Ñ3ôˆKð
 Ð  [×%6Ñ%6°qÑ%9¸QÒ%>Ø ªA¨q¨DÑ 1Ñ1�ô ˆ{Ó˜aÒØ% d×&9Ñ&9Ñ:ˆKÜ�w‰w�u‹~ Ò!ÜŸ
™
 5Ó)¨$×*=Ñ*=Ñ>�ä×$Ñ$ [°%Ó8Ð8r   c                 ó>   •— | j                  t        ‰| �	  «       «      S r|   ©r`  rX   Úget_facecolor©rM   r]   s    €r   rc  zPatch3DCollection.get_facecolorŠ  ó   ø€ Ø×6Ñ6´u±wÑ7LÓ7NÓOÐOr   c                 óž   •— t        j                  | j                  d«      r| j                  «       S | j	                  t
        ‰| �  «       «      S ©NÚface©r   r$   Ú_edgecolorsrc  r`  rX   Úget_edgecolorrd  s    €r   rk  zPatch3DCollection.get_edgecolor�  óC   ø€ ô ×Ñ˜D×,Ñ,¨fÔ5Ø×%Ñ%Ó'Ð'Ø×6Ñ6´u±wÑ7LÓ7NÓOÐOr   r|   r  )r€   r�   r‚   rƒ   rK   rA  rF  rè   rL   rÖ   r`  rc  rk  r…   r†   s   @r   r5  r5  õ  sU   ø„ ñð ØØØ Øö#5òJ ð !óò0ó
ôBò(9ô,P÷Pð Pr   r5  c                 óP  — t         j                  j                  | «      sy| j                  «       | j	                  «       z
  }|j                  «       |j	                  «       z
  }|j                  «       |j	                  «       z
  }t        j
                  |dz  |dz  z   |dz  z   «      S )zª
    Estimate the scale of the 3D data for use in depth shading

    Parameters
    ----------
    X, Y, Z : masked arrays
        The data to estimate the scale of.
    r   rW   )r%   rh   ÚcountÚmaxrÎ   Úsqrt)ÚXÚYÚZÚptp_xÚptp_yÚptp_zs         r   Ú_get_data_scalerw  –  s   € ô �5‰5�;‰;�qŒ>Øð
 �E‰E‹G�a—e‘e“gÑ€EØ�E‰E‹G�a—e‘e“gÑ€EØ�E‰E‹G�a—e‘e“gÑ€EÜ�7‰7�5˜A‘: ¨¡
Ñ*¨U°a©ZÑ7Ó8Ð8r   c                   ó¢   ‡ — e Zd ZdZddddddœˆ fd„
Zˆ fd„Zd	„ Zdd
„Zdˆ fd„	Zˆ fd„Z	d„ Z
	 dd„Zd„ Zeˆ fd„«       Zd„ Zˆ fd„Zˆ fd„Zˆ xZS )ÚPath3DCollectionz#
    A collection of 3D paths.
    r   r"   NFr6  c                ó®   •— |€	t         d   }|€	t         d   }|| _        || _        d| _        t	        ‰| �  |i |¤Ž | j                  |||«       d| _        y)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.

        *depthshade_minalpha* sets the minimum alpha value applied by
        depth-shading.
        Nr:  r;  F)r   r<  r=  Ú_in_drawrX   rK   rL   Ú_offset_zorderedr>  s	           €r   rK   zPath3DCollection.__init__²  sk   ø€ ð8 ÐÜ!Ð"5Ñ6ˆJØÐ&Ü"*Ð+GÑ"HÐØ%ˆÔØ$7ˆÔ!ØˆŒÜ‰Ñ˜$Ð) &Ò)Ø×Ñ˜r 4¨Ô4Ø $ˆÕr   c                 óÆ   •— | j                  «       5  t        j                  | d¬«      5  t        ‰| �  |«       d d d «       d d d «       y # 1 sw Y   ŒxY w# 1 sw Y   y xY w)NT)r{  )Ú_use_zordered_offsetr   rq   rX   rr   )rM   rs   r]   s     €r   rr   zPath3DCollection.drawÙ  sZ   ø€ Ø×&Ñ&Ó(ñ 	'Ü×"Ñ" 4°$Ô7ñ 'Ü‘‘˜XÔ&÷'÷	'ð 	'÷'ð 'ú÷	'ð 	'ús!   ’AªAºAÁA	ÁAÁA c                 ó    — || _         d| _        yrã   rä   ræ   s     r   rè   zPath3DCollection.set_sort_zposÞ  ré   r   c                 ó¶  — | j                  «        | j                  «       }t        |«      dkD  r|j                  \  }}ng }g }|| _        t        ||t        j                  |«      |«      | _        | j                  | _
        t        j                  | j                  «      | _        | j                  \  }}}t        d«      | _        d| _        || _        d| _        y)a_  
        Set the *z* positions and direction of the paths.

        Parameters
        ----------
        zs : float or array of floats
            The location or locations to place the paths in the collection
            along the *zdir* axis.
        zdir : {'x', 'y', 'z'}
            Plane to plot paths orthogonal to.
            All paths must have the same direction.
            See `.get_dir_vector` for a description of the values.
        axlim_clip : bool, default: False
            Whether to hide paths with a vertex outside the axes view limits.

            .. versionadded:: 3.10
        r   rö   NT)rJ  rK  r(   rÈ   Ú_zdirr•   r%   rL  rM  Ú_sizesÚ_sizes3dr&   Ú_linewidthsÚ_linewidths3drN  rO  rP  rb   r`   rQ  s          r   rL   z"Path3DCollection.set_3d_propertiesã  sº   € ð( 	×"Ñ"Ô$Ø×"Ñ"Ó$ˆÜˆw‹<˜!ÒØ—Y‘Y‰FˆB‘àˆBØˆBØˆŒ
Ü% b¨"¬b¯m©m¸BÓ.?ÀÓFˆŒð Ÿ™ˆŒÜŸX™X d×&6Ñ&6Ó7ˆÔØ—_‘_‰
ˆˆB�ô
 $ B›iˆÔØˆŒ	à%ˆÔØˆ�
r   c                 óN   •— t         ‰| �  ||«       | j                  s|| _        y y r|   )rX   Ú	set_sizesr{  rƒ  )rM   ÚsizesÚdpir]   s      €r   r‡  zPath3DCollection.set_sizes  s%   ø€ Ü‰Ñ˜% Ô%Ø�}Š}Ø!ˆD�Mð r   c                 ó†   •— t         ‰| �  |«       | j                  s%t        j                  | j
                  «      | _        y y r|   )rX   Úset_linewidthr{  r%   r&   r„  r…  )rM   Úlwr]   s     €r   r‹  zPath3DCollection.set_linewidth  s3   ø€ Ü‰Ñ˜bÔ!Ø�}Š}Ü!#§¡¨$×*:Ñ*:Ó!;ˆDÕð r   c                 ó   — | j                   S r|   r@  rT   s    r   rA  zPath3DCollection.get_depthshade!  rB  r   c                 óD   — |€	t         d   }|| _        || _        d| _        y)aw  
        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.
        depthshade_minalpha : float
            Sets the minimum alpha value used by depth-shading.

            .. versionadded:: 3.11
        Nr;  TrD  rE  s      r   rF  zPath3DCollection.set_depthshade$  rG  r   c                 ó  — d}| j                   D ]1  }t        j                  j                  |«      sŒ#||j                  z  }Œ3 |t        g | j                   ¢| j                  ‘­Ž z  }| j                  r$|t        g | j                   ¢| j                  ‘­Ž z  }t        j                  |«      rpt        j                  |t        | j                   «      g| j                   d   j                  ¢­«      }t        j                  j                  | j                   |¬«      }n| j                   }t        j                  g |¢| j                  ‘­Ž \  }}}}t!        |||«      | _        t        j                  j%                  |«      d d d…   x}| _        || _        t        | j*                  «      dkD  r| j*                  |   | _        t        | j.                  «      dkD  r| j.                  |   | _        t3        j4                  | t        j                  j7                  ||f«      «       ||   }||   }||   }t        j                  j7                  ||f«      | _        |j:                  rt        j<                  |«      S t        j>                  S )NFr   rÅ   rö   r   ) rM  r%   rh   rï   r9   rB   r8   rb   r:   rg   r”   r(   rŸ   r&   r   r    rw  Ú_data_scaleÚargsortrO  rP  rƒ  r‚  r…  r„  r   rT  rË   r|  rù   rÎ   rk   )	rM   r9   r\   r  r  r  r  r   Úz_markers_idxs	            r   rÖ   z!Path3DCollection.do_3d_projection<  s
  € ØˆØ—?‘?ò 	'ˆCÜ�u‰u�z‰z˜#�Ø˜cŸh™h‘‘ð	'ð Ô)ÐF¨4¯?©?ÐF¸D¿I¹IÒFÑFˆØ×ÒØœ-ÐD¨¯©ÐD¸$¿)¹)ÒDÑDˆDÜ�6‰6�$Œ<Ü—?‘? 4Ü$'¨¯©Ó$8Ð#T¸4¿?¹?È1Ñ;M×;SÑ;SÑ#TóVˆDä—5‘5—;‘;˜tŸ™°T�;Ó:‰Dà—?‘?ˆDÜ#×>Ñ>ÐPÀÐPÀdÇiÁiÒPÑˆˆS�#�sÜ*¨3°°SÓ9ˆÔô /1¯e©e¯m©m¸CÓ.@ÁÀ2ÀÑ.FÐFˆ˜Ô+ØˆŒ	ô ˆt�}‰}Ó Ò!ØŸ-™-¨Ñ6ˆDŒKäˆt×!Ñ!Ó" QÒ&Ø#×1Ñ1°-Ñ@ˆDÔä×"Ñ" 4¬¯©×);Ñ);¸SÀ#¸JÓ)GÔHð �-Ñ ˆØ�-Ñ ˆØ�-Ñ ˆô !#§¡× 2Ñ 2°C¸°:Ó >ˆÔà!ŸhšhŒr�v‰v�c‹{Ð2¬B¯F©FÐ2r   c              #   óª   •K  — | j                   €d –— y | j                  }t        ‰| �  | j                   «       	 d –— || _        y # || _        w xY w­wr|   )r|  Ú_offsetsrX   rT  )rM   Ú
old_offsetr]   s     €r   r~  z%Path3DCollection._use_zordered_offseti  sJ   øè ø€ à× Ñ Ð(äð Ÿ™ˆJÜ‰GÑ × 5Ñ 5Ô6ð+Ûà *�•ø 
�•üs   ƒ7A»A ¿AÁ	AÁAc                 ó¾  — | j                   }| j                  �Y| j                  rMt        || j                  | j                  | j
                  ¬«      }|�|j                  d   dk(  r||d d …df   z  }t        |«      dkD  rI|| j                     }t        j                  |«      dkD  r"t        j                  |«      | j                     }t        j                  ||«      S )N)rV  r�  r   rW  r#   r   )rX  rP  r<  rY  r=  r�  rŸ   r(   rO  r%   rZ  rl   r[  r\  r]  s      r   r`  z3Path3DCollection._maybe_depth_shade_and_sort_colorsw  sÍ   € ð —‘ˆØ�9‰9Ð  T×%5Ò%5Ü!ØØ—	‘	Ø×3Ñ3Ø ×,Ñ,ô	ˆKð Ð  [×%6Ñ%6°qÑ%9¸QÒ%>Ø ªA¨q¨DÑ 1Ñ1�ô ˆ{Ó˜aÒØ% d×&9Ñ&9Ñ:ˆKÜ�w‰w�u‹~ Ò!ÜŸ
™
 5Ó)¨$×*=Ñ*=Ñ>�ä×$Ñ$ [°%Ó8Ð8r   c                 ó>   •— | j                  t        ‰| �	  «       «      S r|   rb  rd  s    €r   rc  zPath3DCollection.get_facecolorŽ  re  r   c                 óž   •— t        j                  | j                  d«      r| j                  «       S | j	                  t
        ‰| �  «       «      S rg  ri  rd  s    €r   rk  zPath3DCollection.get_edgecolor‘  rl  r   r  )g      R@r|   )r€   r�   r‚   rƒ   rK   rr   rè   rL   r‡  r‹  rA  rF  rÖ   r   r~  r`  rc  rk  r…   r†   s   @r   ry  ry  ­  sy   ø„ ñð ØØØ Øö%%ôN'ò
ó
2õh"ô
<ò
 ð !óò0+3ðZ ó+ó ð+ò9ô.P÷Pð Pr   ry  )r8  c                óü   — t        | t        «      rt        | _        d| _        nt        | t
        «      rt        | _        |€	t        d   }|€	t        d   }|| _        || _	        d| _
        | j                  |||«       y)a
  
    Convert a `.PatchCollection` into a `.Patch3DCollection` object
    (or a `.PathCollection` into a `.Path3DCollection` object).

    Parameters
    ----------
    col : `~matplotlib.collections.PatchCollection` or `~matplotlib.collections.PathCollection`
        The collection to convert.
    zs : float or array of floats
        The location or locations to place the patches in the collection along
        the *zdir* axis. Default: 0.
    zdir : {'x', 'y', 'z'}
        The axis in which to place the patches. Default: "z".
        See `.get_dir_vector` for a description of the values.
    depthshade : bool, default: :rc:`axes3d.depthshade`
        Whether to shade the patches to give a sense of depth.
    axlim_clip : bool, default: False
        Whether to hide patches with a vertex outside the axes view limits.

        .. versionadded:: 3.10

    depthshade_minalpha : float, default: :rc:`axes3d.depthshade_minalpha`
        Sets the minimum alpha value used by depth-shading.

        .. versionadded:: 3.11
    Nr:  r;  F)Ú
isinstancer   ry  r]   r|  r   r5  r   r<  r=  r{  rL   )rÜ   r7   r*   r7  rN   r8  rŽ   s          r   Úpatch_collection_2d_to_3dr›  š  sz   € ôH �#”~Ô&Ü(ˆŒØ#ˆÕÜ	�CœÔ	)Ü)ˆŒØÐÜÐ1Ñ2ˆ
ØÐ"Ü&Ð'CÑDÐØ €C„OØ2€CÔØ€C„LØ×Ñ˜"˜d JÕ/r   c                   óþ   ‡ — e Zd ZdZdddddœˆ fd„
Zej                  ej                  ej                  dœZ	d„ Z
 ej                  d	«      d
„ «       Zd„ Zdˆ fd„	Zd„ Zdd„Zd„ Zd„ Zˆ fd„Zˆ fd„Zd„ Zd„ Zd„ Zˆ xZS )Ú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.
    ÚaverageFN)ÚzsortÚshadeÚlightsourcerN   c                óÔ  •— |rbt        |«      }|j                  dd«      }	|	�t        |	||«      |d<   |j                  dd«      }
|
�t        |
||«      |d<   |	€|
€t        d«      ‚t	        ‰| �  |g|¢­i |¤Ž t        |t        j                  «      r|j                  dk7  r(t        d«      ‚t        d„ |D «       «      rt        d«      ‚| j                  |«       d| _        || _        y)a½  
        Parameters
        ----------
        verts : list of (N, 3) array-like
            The sequence of polygons [*verts0*, *verts1*, ...] where each
            element *verts_i* defines the vertices of polygon *i* as a 2D
            array-like of shape (N, 3).
        zsort : {'average', 'min', 'max'}, default: 'average'
            The calculation method for the z-order.
            See `~.Poly3DCollection.set_zsort` for details.
        shade : bool, default: False
            Whether to shade *facecolors* and *edgecolors*. When activating
            *shade*, *facecolors* and/or *edgecolors* must be provided.

            .. versionadded:: 3.7

        lightsource : `~matplotlib.colors.LightSource`, optional
            The lightsource to use when *shade* is True.

            .. versionadded:: 3.7

        axlim_clip : bool, default: False
            Whether to hide polygons with a vertex outside the view limits.

            .. versionadded:: 3.10

        *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.
        Ú
facecolorsNÚ
edgecolorszCYou must provide facecolors, edgecolors, or both for shade to work.r#   z)verts must be a list of (N, 3) array-likec              3   ó^   K  — | ]%  }t        t        j                  |«      «      d k7  –— Œ' y­w)rW   N)r(   r%   rŸ   )rð   Úverts     r   rò   z,Poly3DCollection.__init__.<locals>.<genexpr>  s"   è ø€ Ò>°”3”r—x‘x “~Ó&¨!Õ+Ñ>ùs   ‚+-)Ú_generate_normalsÚgetÚ_shade_colorsr)   rX   rK   rš  r%   ÚndarrayrZ  rg   Ú	set_zsortÚ_codes3drb   )rM   r  rŸ  r   r¡  rN   rŽ   rO   Únormalsr£  r¤  r]   s              €r   rK   zPoly3DCollection.__init__â  sÿ   ø€ ñH Ü'¨Ó.ˆGØŸ™ L°$Ó7ˆJØÐ%Ü'4Ø ¨ó(��|Ñ$ð  Ÿ™ L°$Ó7ˆJØÐ%Ü'4Ø ¨ó(��|Ñ$ð Ð! jÐ&8Ü ð%ó&ð &ô 	‰Ñ˜Ð0 Ò0¨Ò0Ü�eœRŸZ™ZÔ(Ø�z‰z˜QŠÜ Ð!LÓMÐMäÑ>¸Ô>Ô>Ü Ð!LÓMÐMØ�‰�uÔØˆŒØ%ˆÕr   )rž  rÎ   ro  c                 óH   — | j                   |   | _        d| _        d| _        y)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`   )rM   rŸ  s     r   r«  zPoly3DCollection.set_zsort(  s$   € ð ×/Ñ/°Ñ6ˆŒØˆŒØˆ�
r   z3.10c                 ó$   — | j                  |«      S r|   )Ú_get_vector)rM   r  s     r   Ú
get_vectorzPoly3DCollection.get_vector6  s   € à×Ñ 
Ó+Ð+r   c                 ó¢  — t        |t        j                  «      r}t        j                  d|¬«       t        |t        j
                  j                  «      r3|j                  | _        |j                  j                  d¬«      | _        y
|| _        d| _        y
t        |«      }t        j                  t        t        |«      t        j                  ¬«      }|j!                  d¬«      }t        j"                  ||d	f«      }t%        |«      D ]  \  }}|||d
t        |«      …f<   Œ || _        t        j&                  |«      |d
d
…d
f   k\  | _        y
)af  
        Optimize points for projection.

        Parameters
        ----------
        segments3d : NumPy array or list of NumPy arrays
            List of vertices of the boundary of every segment. If all paths are
            of equal length and this argument is a NumPy array, then it should
            be of shape (num_faces, num_vertices, 3).
        )NNr#   )r  rö   ©ÚaxisFre   r   )Úinitialr#   N)rš  r%   rª  r   Úcheck_shaperh   ÚMaskedArrayÚdataÚ_facesr9   rg   Ú_invalid_verticesr(   ÚfromiterÚmapÚintpro  ÚemptyÚ	enumerateÚarange)rM   r  Ú	num_facesÚ	num_vertsÚ	max_vertsrÀ   Úirh  s           r   r²  zPoly3DCollection._get_vector:  s	  € ô �j¤"§*¡*Ô-Ü×Ñ˜_¸ÕDÜ˜*¤b§e¡e×&7Ñ&7Ô8Ø(Ÿo™o�”Ø)3¯©×)<Ñ)<À"Ð)<Ó)E�Õ&à(�”Ø).�Õ&ô ˜J›ˆIÜŸ™¤C¬¨ZÓ$8ÄÇÁÔHˆIØ!Ÿ™¨a˜Ó0ˆIÜ—x‘x ¨I°qÐ 9Ó:ˆHÜ$ ZÓ0ò /‘��4Ø*.�˜˜JœS ›Y˜J˜Ò'ð/à"ˆDŒKÜ%'§Y¡Y¨yÓ%9¸YÂqÈ$ÀwÑ=OÑ%OˆDÕ"r   c                 óV   •— | j                  |«       t        ‰| �	  g d«       || _        y)a¾  
        Set 3D vertices.

        Parameters
        ----------
        verts : list of (N, 3) array-like
            The sequence of polygons [*verts0*, *verts1*, ...] where each
            element *verts_i* defines the vertices of polygon *i* as a 2D
            array-like of shape (N, 3).
        closed : bool, default: True
            Whether the polygon should be closed by adding a CLOSEPOLY
            connection at the end.
        FN)r²  rX   Ú	set_vertsÚ_closed)rM   r  Úclosedr]   s      €r   rÈ  zPoly3DCollection.set_vertsY  s)   ø€ ð 	×Ñ˜Ôä‰Ñ˜"˜eÔ$Øˆ�r   c                 ó8   — | j                  |d¬«       || _        y)z Set 3D vertices with path codes.F)rÊ  N)rÈ  r¬  )rM   r  r¼   s      r   Úset_verts_and_codesz$Poly3DCollection.set_verts_and_codesl  s   € ð 	�‰�u UˆÔ+àˆ�r   c                 óþ   — | j                  «        d | _        | j                  d«       t        j                  | «      | _        t        j                  | «      | _        t        j                  | «      | _	        d| _
        y )Nrž  T)rJ  rå   r«  r   rc  Ú_facecolor3drk  Ú_edgecolor3dÚ	get_alphaÚ_alpha3dr`   )rM   rN   s     r   rL   z"Poly3DCollection.set_3d_propertiest  sb   € ð 	×"Ñ"Ô$ØˆŒØ�‰�yÔ!Ü*×8Ñ8¸Ó>ˆÔÜ*×8Ñ8¸Ó>ˆÔÜ&×0Ñ0°Ó6ˆŒØˆ�
r   c                 ó    — || _         d| _        yrã   rä   ræ   s     r   rè   zPoly3DCollection.set_sort_zpos  ré   r   c                 ó8	  — | j                   �J| j                  «        | j                  r| j                  | _        | j
                  r| j                  | _        t        | j                  «      }| j                  t        | j                  d   | j                  d   | j                  d   | j                  «      z  }t        j                  |«      }t        j                  dd¬«      5  t!        j"                  | j                  | j                  «      }ddd«       | j$                  r[t'        | j                  d   | j                  d   | j                  d   | j                  «      }t        j                  |«      rd}||z  }d   }|r!t        j(                  j+                  ||¬«      }| j                  }| j                  }t        |«      |k7  r|j-                  |d	¬
«      }t        |«      |k7  r$t        |«      d	k(  r|}n|j-                  |d	¬
«      }t        |«      d	kD  r| j/                  |d¬
«      }	n|}	|r|	j0                  }	t        j2                  |	d¬
«      ddd…   }
t        |«      d	kD  r||
dd…dd…f   }n|}| j4                  �}t        | j4                  «      d	kD  re|r/||
dd…f    }t7        ||«      D ��cg c]  \  }}||dd…f   ‘Œ }}}|
D �cg c]  }| j4                  |   ‘Œ }}t9        j:                  | ||«       nz|rWt        |«      d	kD  rIt        j<                  ||
dd…df   |j>                  «      }t        j(                  j+                  ||¬«      }t9        j@                  | || jB                  «       t        |«      d	kD  r||
   | _"        n|| _"        t        | j                  «      t        |«      k(  rt        |«      d	kD  r||
   | _#        n| j                  | _#        | jH                  �Yt        jJ                  d	gd	g| jH                  gdgg«      }t!        jL                  || j                  jN                  «      }|d   d	   S |jP                  d	kD  rt        jR                  |«      S t        jT                  S # 1 sw Y   �ŒwxY wc c}}w c c}w )z<
        Perform the 3D projection for this object.
        Nró   rô   rõ   Úignore)ÚinvalidÚdivideTrÅ   r   rµ  rö   rW   r   )+Ú_ArJ  Ú_face_is_mappedÚ_facecolorsrÎ  Ú_edge_is_mappedrj  rÏ  r(   r»  r¼  rB   r8   r%   rg   Úerrstater   rü   rb   r:   rh   r¹  Úrepeatr°  rº  r‘  r¬  r˜   r   rÌ  r”   rŸ   rÈ  rÉ  Ú_facecolors2dÚ_edgecolors2drå   r&   Ú_proj_transform_vecr  rù   rÎ   rk   )rM   rÃ  r9   Úneeds_maskingÚpfacesr  ÚpzsÚcfaceÚcedgeÚface_zÚ
face_orderÚfaces_2dÚsegment_maskrh  Úidxr¼   Úinvalid_vertices_2dÚzvecÚztranss                      r   rÖ   z!Poly3DCollection.do_3d_projection„  s  € ð �7‰7Ðð ×&Ñ&Ô(Ø×#Ò#Ø$(×$4Ñ$4�Ô!Ø×#Ò#Ø$(×$4Ñ$4�Ô!ä˜Ÿ™Ó$ˆ	Ø×%Ñ%Ô(;Ø�K‰K˜Ñ §¡¨VÑ!4Ø�K‰K˜Ñ §¡ó),ñ ,ˆô Ÿ™˜t›ˆô �[‰[ °(Ô;ñ 	RÜ×9Ñ9¸$¿+¹+ÀtÇyÁyÓQˆF÷	Rð ×ÒÜ(¨¯©°VÑ)<¸d¿k¹kÈ&Ñ>QØ)-¯©°VÑ)<¸d¿i¹ióIˆLä�v‰v�lÔ#Ø $�Ø˜lÑ*�à�V‰nˆÙÜ—%‘%×#Ñ# C¨dÐ#Ó3ˆCð ×!Ñ!ˆØ×!Ñ!ˆÜˆu‹:˜Ò"Ø—L‘L °�LÓ3ˆEÜˆu‹:˜Ò"Ü�5‹z˜QŠØ‘àŸ™ Y°Q˜Ó7�äˆs‹8�aŠ<Ø—_‘_ S¨r�_Ó2‰FàˆFÙØ—[‘[ˆFÜ—Z‘Z ¨RÔ0±°2°Ñ6ˆ
äˆv‹;˜Š?Ø˜jª!¨R¨a¨RÐ/Ñ0‰HàˆHØ�=‰=Ð$¬¨T¯]©]Ó);¸aÒ)?ÙØ $ Z² ]Ñ 3Ð3�ä"% h°Ó"=÷?©j¨d°D˜D ¢q ›Mð ?�ñ ?à3=Ö>¨C�T—]‘] 3Ó'Ð>ˆEÐ>Ü×.Ñ.¨t°X¸uÕEá¤ X£°Ò!2Ü&(§o¡oØ˜¢Q¨Ð,Ñ-Ø—N‘Nó'$Ð#ô Ÿ5™5×,Ñ,Ø Ð':ð -ó <�ä×$Ñ$ T¨8°T·\±\ÔBäˆu‹:˜Š>Ø!& zÑ!2ˆDÕà!&ˆDÔÜˆt× Ñ Ó!¤S¨£ZÒ/´C¸³JÀ²NØ!& zÑ!2ˆDÕà!%×!2Ñ!2ˆDÔð �?‰?Ð&Ü—8‘8˜a˜S 1 #¨¯©Ð'8¸1¸#Ð>Ó?ˆDÜ×/Ñ/°°d·i±i·k±kÓBˆFØ˜!‘9˜Q‘<ÐØ�X‰X˜Š\ô —6‘6˜#“;Ðä—6‘6ˆM÷S	Rñ 	RüóP?ùâ>s   Ã$+RÊ<RËRÒRc                 óX   •— t         ‰| �  |«       t        j                  | «      | _        y r|   )rX   Úset_facecolorr   rc  rÎ  ©rM   r   r]   s     €r   rî  zPoly3DCollection.set_facecoloré  ó#   ø€ ä‰Ñ˜fÔ%Ü*×8Ñ8¸Ó>ˆÕr   c                 óX   •— t         ‰| �  |«       t        j                  | «      | _        y r|   )rX   Úset_edgecolorr   rk  rÏ  rï  s     €r   rò  zPoly3DCollection.set_edgecolorî  rð  r   c                 óˆ  — t         j                  j                  | |«       	 t        j                  | j
                  | j                  «      | _        	 t        j                  | j                  | j                  «      | _        d| _        y # t        t        t        f$ r Y ŒNw xY w# t        t        t        f$ r
 Y d| _        y w xY w)NT)r   ÚArtistÚ	set_alphar[  r\  rÎ  rX  ÚAttributeErrorÚ	TypeErrorÚ
IndexErrorrÏ  rj  r`   )rM   r_  s     r   rõ  zPoly3DCollection.set_alphaó  s©   € ä�‰×Ñ  eÔ,ð	Ü '× 5Ñ 5Ø×!Ñ! 4§;¡;ó!0ˆDÔð	Ü&×4Ñ4Ø×%Ñ% t§{¡{ó 4ˆDÔð ˆ�
øô ¤	¬:Ð6ò 	Ùð	ûô
 ¤	¬:Ð6ò 	ØØˆ�
ð	ús#   ¢/B	 Á/B# Â	B ÂB Â#CÃ Cc                 óÊ   — t        | d«      s9| j                  j                  «       | j                  _        | j	                  «        t        j                  | j                  «      S )NrÝ  )r  r8   r  r  rÖ   r%   rl   rÝ  rT   s    r   rc  zPoly3DCollection.get_facecolor  óG   € ô �t˜_Ô-ØŸ)™)×,Ñ,Ó.ˆD�I‰IŒKØ×!Ñ!Ô#Ü�z‰z˜$×,Ñ,Ó-Ð-r   c                 óÊ   — t        | d«      s9| j                  j                  «       | j                  _        | j	                  «        t        j                  | j                  «      S )NrÞ  )r  r8   r  r  rÖ   r%   rl   rÞ  rT   s    r   rk  zPoly3DCollection.get_edgecolor
  rú  r   )Tr  )r€   r�   r‚   rƒ   rK   r%   rž  rÎ   ro  r¯  r«  r   Ú
deprecatedr³  r²  rÈ  rÌ  rL   rè   rÖ   rî  rò  rõ  rc  rk  r…   r†   s   @r   r�  r�  Í  s—   ø„ ñð( ,5¸EØ!¨eö>&ðB —:‘:Ø�v‰vØ�v‰vñÐòð €T‡_�_�VÓñ,ó ð,òPõ>ò&ó	òò
côJ?ô
?ò
ò.ö.r   r�  c                 ó¨   — t        | j                  «       ||«      \  }}t        | _        | j	                  ||«       | j                  «        || _        y)aì  
    Convert a `.PolyCollection` into a `.Poly3DCollection` object.

    Parameters
    ----------
    col : `~matplotlib.collections.PolyCollection`
        The collection to convert.
    zs : float or array of floats
        The location or locations to place the polygons in the collection along
        the *zdir* axis. Default: 0.
    zdir : {'x', 'y', 'z'}
        The axis in which to place the patches. Default: 'z'.
        See `.get_dir_vector` for a description of the values.
    N)rÁ   rØ   r�  r]   rÌ  rL   rb   )rÜ   r7   r*   rN   Úsegments_3dr¼   s         r   Úpoly_collection_2d_to_3drÿ    sJ   € ô :Ø�M‰M‹O˜R ó'Ñ€K�ä$€C„MØ×Ñ˜K¨Ô/Ø×ÑÔØ €C…Or   c                 ó`   — |dk(  r|| |fS |dk(  r| ||fS |d   dk(  rt        | |||«      S | ||fS )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`.
    r    r!   r   ú-)Úrotate_axes©r5   r6   r7   r*   s       r   r•   r•   *  sR   € ð ˆs‚{Ø�2�rˆzÐØ	�ŠØ�2�rˆzÐØ	ˆa‰�CŠÜ˜2˜r 2 tÓ,Ð,à�2�rˆzÐr   c                 ó0   — |dv r||| fS |dv r|| |fS | ||fS )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'.
    )r    z-y)z-xr!   r   r  s       r   r  r  ;  s8   € ð ˆ{ÑØ�2�rˆzÐØ	�Ñ	Ø�2�rˆzÐà�2�rˆzÐr   c                 óî  — t        | «      dk(  st        |«      dk(  rt        j                  d«      S t        j                  |dd«      }|�|dk(  rt        j                  |«      }n3t        j                  d|t        j
                  |«      z
  |z  z
  |d«      }t        j                  t        j                  | «      t        |«      df«      }t        j                  |dd…dd…f   |dd…df   |z  g«      S )z?Modify the alpha values of the color list according to z-depth.r   )r   rW  r   NrW  r#   )
r(   r%   ÚzerosÚclipÚ	ones_likerÎ   r”   r[  r\  rË   )r   r7   rV  r�  ÚsatsÚrgbas         r   rY  rY  I  sÔ   € ô ˆ6ƒ{�aÒœ3˜r›7 aš<Ü�x‰x˜ÓÐô —‘˜	 1 aÓ(€IàÐ˜k¨QÒ.ä�|‰|˜BÓ‰ô �w‰w�q˜B¤§¡¨£™O¨{Ñ:Ñ:¸IÀqÓIˆä�?‰?œ7×0Ñ0°Ó8¼3¸r»7ÀA¸,ÓG€Dô �?‰?˜D¢ B Q B ™K¨ªa°¨d©°dÑ):Ð;Ó<Ð<r   c                 ó<  — t        j                  | «      t        j                  |«      t        j                  |«      }}} t        j                  | ||g«      }|t        j                  |«      j	                  d¬«          }t        j
                  |d¬«      }t        |«      dk  ry||d   z
  dd }|t         j                  j                  |d¬«      dd…t         j                  f   z  }t        j
                  |d¬«      }t        |«      dk  ryt         j                  j                  t        j                  |d   |dd «      d¬«      }t        j                  t        j                  |d|¬«      «      d   dz   }t        j                  ||d¬«      }t        |«      dk  ryt        j                  |d   |d   «      }|t         j                  j                  |«      z  }t        j                  ||j                  «       «      }	t        j                   |	d|¬«      S )	a  
    Check if all points are on the same plane. Note that NaN values are
    ignored.

    Parameters
    ----------
    xs, ys, zs : array-like
        The x, y, and z coordinates of the points.
    atol : float, default: 1e-8
        The tolerance for the equality check.
    r   rµ  r   r#   TNrW   )Úatol)r%   rl   rË   Úisnanrg   Úuniquer(   ÚlinalgÚnormrû   ÚcrossÚwhereÚiscloseÚdeleteÚdotÚ	transposeÚallclose)
r5   r6   r7   r  rv   rÏ   Úcross_normsÚzero_cross_normsÚnÚdotss
             r   Ú_all_points_on_planer  e  s§  € ô —‘˜B“¤§¡¨B£´·±¸B³ˆBˆ€BÜ�_‰_˜b " b˜\Ó*€FØ”R—X‘X˜fÓ%×)Ñ)¨qÐ)Ó1Ð1Ñ2€Fä�Y‰Y�v AÔ&€FÜ
ˆ6ƒ{�aÒØà
�6˜!‘9Ñ
˜a˜bÐ	!€BØ	Œb�i‰i�n‰n˜R aˆnÓ(ª¬B¯J©J¨Ñ7Ñ	7€Bä	�‰�2˜AÔ	€BÜ
ˆ2ƒw�!‚|Øä—)‘)—.‘.¤§¡¨"¨Q©%°°A°B°Ó!8¸q�.ÓA€KÜ—x‘x¤§
¡
¨;¸ÀÔ EÓFÀqÑIÈAÑMÐÜ	�‰�2Ð'¨aÔ	0€BÜ
ˆ2ƒw�!‚|Øä
�‰��A‘˜˜1™Ó€AØ	ŒB�I‰I�N‰N˜1ÓÑ€Aô �6‰6�!�R—\‘\“^Ó$€DÜ�;‰;�t˜Q TÔ*Ð*r   c                 ó`  — t        | t        j                  «      rI| j                  d   }d|dz  d|z  dz  }}}| d|dd…f   | d|dd…f   z
  }| d|dd…f   | d|dd…f   z
  }n¶t        j                  t        | «      df«      }t        j                  t        | «      df«      }t        | «      D ]h  \  }}t        |«      }t        j                  |«      }d|dz  d|z  dz  }}}||dd…f   ||dd…f   z
  ||dd…f<   ||dd…f   ||dd…f   z
  ||dd…f<   Œj t        j                  ||«      S )aA  
    Compute the normals of a list of polygons, one normal per polygon.

    Normals point towards the viewer for a face with its vertices in
    counterclockwise order, following the right hand rule.

    Uses three points equally spaced around the polygon. This method assumes
    that the points are in a plane. Otherwise, more than one shade is required,
    which is not supported.

    Parameters
    ----------
    polygons : list of (M_i, 3) array-like, or (..., M, 3) array-like
        A sequence of polygons to compute normals for, which can have
        varying numbers of vertices. If the polygons all have the same
        number of vertices and array is passed, then the operation will
        be vectorized.

    Returns
    -------
    normals : (..., 3) array
        A normal vector estimated for the polygon.
    éþÿÿÿr   r#   rW   .N)	rš  r%   rª  rŸ   rÀ  r(   rÁ  rl   r  )	r,  r  Úi1Úi2Úi3Úv1Úv2Úpoly_iÚpss	            r   r§  r§  Ž  sI  € ô0 �(œBŸJ™JÔ'ð �N‰N˜2ÑˆØ˜˜1™˜a ™c 1™f�ˆBˆØ�c˜2šq�jÑ! H¨S°"²a¨ZÑ$8Ñ8ˆØ�c˜2šq�jÑ! H¨S°"²a¨ZÑ$8Ñ8‰ô �X‰X”s˜8“} aÐ(Ó)ˆÜ�X‰X”s˜8“} aÐ(Ó)ˆÜ# HÓ-ò 	2‰JˆF�BÜ�B“ˆAÜ—‘˜B“ˆBØ˜A˜q™D ! A¡# q¡&�B�ˆBØ˜r¢1˜u™I¨¨2ªq¨5©	Ñ1ˆBˆv’qˆy‰MØ˜r¢1˜u™I¨¨2ªq¨5©	Ñ1ˆBˆv’qˆyŠMð	2ô �8‰8�B˜ÓÐr   c                 óž  ‡‡	— |€t        j                  dd¬«      }t        j                  d¬«      5  |t        j                  j                  |dd¬	«      z  |j                  z  }ddd«       t        j                  «       }|j                  «       r‹t        j                  d
d«      Št        j                  dd«      j                  Š	ˆˆ	fd„}d|| <   t        j                  | «      } | dd…df   } ||«      dd…t        j                  f   | z  }||dd…df<   |S t        j                  | «      j                  «       }|S # 1 sw Y   ŒßxY w)zÆ
    Shade *color* using normal vectors given by *normals*,
    assuming a *lightsource* (using default position if not given).
    *color* can also be an array of the same length as *normals*.
    Néá   gà-� x3@)ÚazdegÚaltdegrÔ  )rÕ  r   T)r¶  Úkeepdimsrö   ç333333Ó?c                 ó    •—  ‰ ‰| «      «      S r|   r   )r    Úin_normÚout_norms    €€r   r  z_shade_colors.<locals>.normÎ  s   ø€ Ù™G A›JÓ'Ð'r   r   r#   )r[  ÚLightSourcer%   rÛ  r  r  Ú	directionr  rg   Ú	NormalizeÚinverser\  rû   rø   Úcopy)
Úcolorr­  r¡  r   r9   r  r_  r   r-  r.  s
           @@r   r©  r©  º  s,  ù€ ð Ðä×)Ñ)°¸GÔDˆä	�‰˜XÔ	&ñ *ØœBŸI™IŸN™N¨7¸ÀT˜NÓJÑJØ×(Ñ(ñ)ˆ÷*ô �H‰H�U‹OÐ€Dà‡x�x„zä×#Ñ# B¨Ó*ˆÜ×$Ñ$ S¨!Ó,×4Ñ4ˆõ	(ð ˆˆtˆe‰ä×%Ñ% eÓ,ˆð ’a˜�d‘ˆÙ�e“šQ¤§
¡
˜]Ñ+¨eÑ3ˆØˆŠq�!ˆt‰ð €Mô —‘˜uÓ%×*Ñ*Ó,ˆà€M÷3*ð *ús   ²3EÅEr   )r   r"   )r   r"   NF)r+  N)g:Œ0âŽyE>r|   )@rƒ   rn   Únumpyr%   Ú
contextlibr   Ú
matplotlibr   r   r   r   r[  r   r	   rI   r
   rÉ   r   Úmatplotlib.collectionsr   r   r   r   r   Úmatplotlib.patchesr   r~   r   r   r   r+   r:   rB   rJ   rD   r‰   ÚLine2Dr‹   r©   r³   r¸   r½   rÁ   rÃ   rÞ   rà   r  r
  r"  r-  r/  r3  r5  rw  ry  r›  r�  rÿ  r•   r  rY  r  r§  r©  r   r   r   ú<module>r;     sf  ðñ
ó
 ã å %÷÷ ó ÷Qõ Qå $Ý òòòOòDò2=ô0vˆU�Z‰Zô vór/ô(kˆU�\‰\ô kó\1ó*óóó'ô,�:ô ,ó*
!ôg�~ô góT!ôDˆeô DôN<�'ô <ò~:ó8ó0ô^P˜ô ^PòB9ô.jP�~ô jPð^ 	Ø	ØØð00ð ô00ôfC.�~ô C.óL
!ò.ò"ð" Øó	=ó8&+òR)ôX#r   