ó
    {ñ:itÅ  ã                   ó8  • S r SSKrSSKrSSKJr  SSKJrJrJ	r	J
rJrJrJr  SSKJrJrJrJrJr  SSKJr  SSKJr  SS	KJr  S
 rS rS rS r  " S S\RB                  5      r"S3S jr# " S S\RH                  5      r%S3S jr&S4S jr'S4S jr(S4S jr)S4S jr* " S S\5      r+S3S jr, " S S\5      r-S3S jr. " S S\5      r/ " S  S!\/5      r0S" r1S3S# jr2S4S$ jr3 " S% S&\5      r4 " S' S(\5      r5S5S) jr6 " S* S+\5      r7S3S, jr8S- r9S. r:S/ r;S6S0 jr<S1 r=S7S2 jr>g)8zx
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)Ú
CollectionÚLineCollectionÚPolyCollectionÚPatchCollectionÚPathCollection)Ú	Normalize)ÚPatché   )Úproj3dc                 ó,   • U S-   S-  n U S:”  a  U S-
  n U $ )z?Return the given angle normalized to -180 < *a* <= 180 degrees.ih  é´   © ©Úas    Ú]/srv/projetos/modelo_ml_acdoc/venv/lib/python3.13/site-packages/mpl_toolkits/mplot3d/art3d.pyÚ_norm_angler      s$   € à	
ˆS‰�C‰€AØˆ3ƒwØ�‰GˆØ€Hó    c                 ó,   • U S-   S-  n U S:”  a  U S-
  n U $ )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                 ór  • U S:X  a  [         R                  " S5      $ U S:X  a  [         R                  " S5      $ U S:X  a  [         R                  " S5      $ U c  [         R                  " S5      $ [         R                  " U 5      (       a%  [        U 5      S:X  a  [         R                  " U 5      $ [	        S	5      e)
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)ÚnpÚarrayÚiterableÚlenÚ
ValueError)Úzdirs    r   Úget_dir_vectorr*   *   s�   € ð( ˆsƒ{Ü�xŠx˜	Ó"Ð"Ø	�‹Ü�xŠx˜	Ó"Ð"Ø	�‹Ü�xŠx˜	Ó"Ð"Ø	‰Ü�xŠx˜	Ó"Ð"Ü	�Š�T×	Ñ	œs 4›y¨A›~Ü�xŠx˜‹~ÐäÐMÓNÐNr   c           	      ó
  • [         R                  R                  XR                  R                  :  XR                  R
                  :„  XR                  R                  :  XR                  R                  :„  X#R                  R                  :  X#R                  R
                  :„  45      n[         R                  R                  XS9n[         R                  R                  XS9n[         R                  R                  X$S9nXVU4$ )a  
Return original points with points outside the axes view limits masked.

Parameters
----------
xs, ys, zs : array-like
    The points to mask.
axes : Axes3D
    The axes to use for the view limits.

Returns
-------
xs_masked, ys_masked, zs_masked : np.ma.array
    The masked points.
)Úmask)r$   Ú
logical_orÚreduceÚ
xy_viewLimÚxminÚxmaxÚyminÚymaxÚ
zz_viewLimÚmar%   )ÚxsÚysÚzsÚaxesr,   Ú	xs_maskedÚ	ys_maskedÚ	zs_maskeds           r   Ú_viewlim_maskr=   L   sÅ   € ô  �=‰=×Ñ §o¡o×&:Ñ&:Ñ!:Ø!#§o¡o×&:Ñ&:Ñ!:Ø!#§o¡o×&:Ñ&:Ñ!:Ø!#§o¡o×&:Ñ&:Ñ!:Ø!#§o¡o×&:Ñ&:Ñ!:Ø!#§o¡o×&:Ñ&:Ñ!:ð!<ó =€Dô —‘—‘˜B�Ð*€IÜ—‘—‘˜B�Ð*€IÜ—‘—‘˜B�Ð*€IØ Ð*Ð*r   c                   ó~   ^ • \ rS rSrSrSS jrS rSU 4S jjrS rSS jr	\
R                  S 5       rSS	 jrS
rU =r$ )ÚText3Déh   aæ  
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.

Other Parameters
----------------
**kwargs
     All other parameters are passed on to `~matplotlib.text.Text`.
c                 ól   • [         R                  R                  " XX$40 UD6  U R                  X5U5        g ©N)ÚmtextÚTextÚ__init__Úset_3d_properties)Úselfr    r!   r"   r	   r)   Ú
axlim_clipÚkwargss           r   rE   ÚText3D.__init__~   s+   € ä�
‰
×Ò˜D QÑ7°Ò7Ø×Ñ˜q¨
Õ3r   c                 óH   • U R                   U R                  U R                  4$ )z*Return the (x, y, z) position of the text.)Ú_xÚ_yÚ_z©rG   s    r   Úget_position_3dÚText3D.get_position_3dƒ   s   € à�w‰w˜Ÿ™ §¡Ð(Ð(r   c                 óz   >• [         TU ]  USS 5        U R                  US   5        Ub  [        U5      U l        gg)a0  
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)rG   Úxyzr)   Ú	__class__s      €r   Úset_position_3dÚText3D.set_position_3d‡   s?   ø€ ô 	‰Ñ˜S  !˜WÔ%Ø�
‰
�3�q‘6ÔØÑÜ*¨4Ó0ˆD�Mð r   c                 ó   • Xl         SU l        g)zD
Set the *z* position of the text.

Parameters
----------
z : float
TN)rN   Ústale)rG   r"   s     r   rV   ÚText3D.set_z˜   s   € ð ŒØˆ�
r   c                 óJ   • Xl         [        U5      U l        X0l        SU l        g)aS  
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.
TN)rN   r*   rW   Ú_axlim_clipr]   )rG   r"   r)   rH   s       r   rF   ÚText3D.set_3d_properties£   s"   € ð ŒÜ& tÓ,ˆŒØ%ÔØˆ�
r   c                 óˆ  • U R                   (       a†  [        U R                  U R                  U R                  U R
                  5      u  p#n[        R                  R                  X#U45      R                  5       R                  [        R                  5      nO;U R                  U R                  U R                  pCn[        R                  " X#U/5      n[        R                  " XUU R                  -   /U R
                  R                   5      nUS   S   US   S   -
  nUS   S   US   S   -
  n["        R$                  " ["        R&                  " X‡5      5      n	[(        R*                  " XS   S   US   S   [-        U	5      S9   [.        R0                  R3                  X5        S S S 5        SU l        g ! , (       d  f       N= f)Nr   r   )rL   rM   Ú	_rotationF)r`   r=   rL   rM   rN   r9   r$   r5   Ú	row_stackÚravelÚfilledÚnanÚ
asanyarrayr   Ú_proj_trans_pointsrW   ÚMÚmathÚdegreesÚatan2r   Ú_setattr_cmr   rC   rD   Údrawr]   )
rG   Úrendererr6   r7   r8   Ú
position3dÚprojÚdxÚdyÚangles
             r   ro   ÚText3D.draw¶   sR  € à××Ü& t§w¡w°·±¸¿¹À$Ç)Á)ÓL‰JˆB�BÜŸ™Ÿ™¨"°"¨Ó6×<Ñ<Ó>×EÑEÄbÇfÁfÓM‰JàŸ™ $§'¡'¨4¯7©7�BˆBÜŸš¨° |Ó4ˆJä×(Ò(Ø d§m¡mÑ3Ð4°d·i±i·k±kóCˆà�!‰W�Q‰Z˜$˜q™' !™*Ñ$ˆØ�!‰W�Q‰Z˜$˜q™' !™*Ñ$ˆÜ—’œTŸZšZ¨Ó/Ó0ˆÜ×Ò˜t¨Q©°©
°t¸A±w¸q±zÜ)9¸%Ó)@óBä�J‰J�O‰O˜DÔ+÷Bð ˆ�
÷Bõ Bús   Æ F3Æ3
Gc                 ó   • g rB   r   )rG   rp   s     r   Úget_tightbboxÚText3D.get_tightbboxÉ   s   € ð r   )r`   rW   rN   r]   )r   r   r   Ú r"   FrB   ©r   r"   F)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__rE   rP   rZ   rV   rF   r   Úallow_rasterizationro   rx   Ú__static_attributes__Ú__classcell__©rY   s   @r   r?   r?   h   sE   ø† ñô*4ò
)÷1ò"	ôð& ×Ññó  ð÷$ò r   r?   c                 ó>   • [         U l        U R                  XU5        g)aL  
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.
N)r?   rY   rF   )Úobjr"   r)   rH   s       r   Útext_2d_to_3dr‡   Ï   s   € ô €C„MØ×Ñ˜! :Õ.r   c                   ót   ^ • \ rS rSrSrSS.U 4S jjrSS jrS rS r\	R                  U 4S	 j5       rS
rU =r$ )ÚLine3Déá   a–  
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)rH   c                ó`   >• [         TU ]  " / / /UQ70 UD6  U R                  XU5        X@l        g)zõ

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)rT   rE   Úset_data_3dr`   )rG   r6   r7   r8   rH   ÚargsrI   rY   s          €r   rE   ÚLine3D.__init__ì   s4   ø€ ô 	‰Ò˜˜RÐ1 $Ò1¨&Ò1Ø×Ñ˜ Ô$Ø%Õr   c                 ó  • U R                  5       nU R                  5       n[        R                  " U5      R	                  5       n[
        R                  " U[        U5      5      n[        XEX5      U l	        X0l
        SU l        g)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.
TN)Ú	get_xdataÚ	get_ydatar   Ú_to_unmasked_float_arrayre   r$   Úbroadcast_tor'   Újuggle_axesÚ_verts3dr`   r]   )rG   r8   r)   rH   r6   r7   s         r   rF   ÚLine3D.set_3d_propertiesþ   sd   € ð �^‰^ÓˆØ�^‰^ÓˆÜ×+Ò+¨BÓ/×5Ñ5Ó7ˆÜ�_Š_˜R¤ R£Ó)ˆÜ# B¨BÓ5ˆŒØ%ÔØˆ�
r   c                 óÂ   • [        U5      S:X  a  US   n[        SU5       H.  u  p#[        R                  " U5      (       a  M"  [	        U S35      e   Xl        SU l        g)zÿ
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   rX   z must be a sequenceTN)r'   Úzipr$   r&   ÚRuntimeErrorr•   r]   )rG   r�   ÚnamerX   s       r   rŒ   ÚLine3D.set_data_3d  s[   € ô" ˆt‹9˜‹>Ø˜‘7ˆDÜ˜U DÖ)‰IˆDÜ—;’;˜s×#Ó#Ü" d VÐ+>Ð#?Ó@Ð@ñ *ð ŒØˆ�
r   c                 ó   • U R                   $ )z}
Get the current data

Returns
-------
verts3d : length-3 tuple or array-like
    The current data as a tuple or array-like.
)r•   rO   s    r   Úget_data_3dÚLine3D.get_data_3d.  s   € ð �}‰}Ðr   c                 óf  >• U R                   (       a%  [        / U R                  QU R                  P76 u  p#nOU R                  u  p#n[        R
                  " X#UU R                  R                  U R                  R                  5      u  pVpxU R                  XV5        [        T	U ])  U5        SU l        g )NF)r`   r=   r•   r9   r   Ú_proj_transform_cliprj   Ú_focal_lengthÚset_datarT   ro   r]   )
rG   rp   Úxs3dÚys3dÚzs3dr6   r7   r8   ÚtisrY   s
            €r   ro   ÚLine3D.draw9  s‹   ø€ à××Ü,ÐG¨d¯m©mÐG¸T¿Y¹YÒGÑˆD™à#Ÿ}™}ÑˆD˜Ü ×5Ò5°dÀ$Ø6:·i±i·k±kØ6:·i±i×6MÑ6MóO‰ˆ�ð 	�‰�bÔÜ‰‰�XÔØˆ�
r   )r`   r•   r]   r{   )r|   r}   r~   r   r€   rE   rF   rŒ   r�   r   r�   ro   r‚   rƒ   r„   s   @r   r‰   r‰   á   s@   ø† ñð 6;÷ &ð &ô$ò.ò2	ð ×Ñô
ó  ö
r   r‰   c                 ó>   • [         U l        U R                  XU5        g)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.
N)r‰   rY   rF   )Úliner8   r)   rH   s       r   Úline_2d_to_3drª   G  s   € ô €D„NØ×Ñ˜2 ZÕ0r   c                 ó  • [         R                  " U[        U 5      5      nU R                  SSS9n[	        X15       VVVVs/ s H  u  u  u  pEpgXEU4PM     nnnnnU VVVs/ s H  u  pEn[        XEXr5      PM     n	nnnU	$ s  snnnnf s  snnnf )zConvert a path to a 3D segment.F©ÚsimplifyÚcurves)r$   r“   r'   Úiter_segmentsr˜   r”   )
r
   r8   r)   Úpathsegsr    r!   Úcoder"   ÚsegÚseg3ds
             r   Ú_path_to_3d_segmentr´   Z  s‚   € ô 
�Š˜œS ›YÓ	'€BØ×!Ñ!¨5¸Ð!Ð?€HÜ03°HÔ0AÖ
BÒ0AÑ,™.™6˜A 4ˆA�!‹9Ñ0A€CÓ
BÙ9<Õ=º©I¨Q°1Œ[˜˜qÖ'¹€EÒ=Ø€Lùõ CùÜ=s   ÁB 
Á!Bc           	      ó"  • [         R                  " U5      (       d!  [         R                  " U[        U 5      5      nO#[        U5      [        U 5      :w  a  [	        S5      e[        X5       VVs/ s H  u  p4[        X4U5      PM     nnnU$ s  snnf )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´   )Úpathsr8   r)   r
   ÚpathzÚsegss         r   Ú_paths_to_3d_segmentsr¹   d  sz   € ô �;Š;�r�?‰?Ü�_Š_˜R¤ U£Ó,‰äˆr‹7”c˜%“jÓ ÜÐLÓMÐMô  # 5œ~ô/Ú-‘�ô   ¨TÖ2Ù-ð 	ñ /à€Kùó/s   Á.Bc                 ód  • [         R                  " U[        U 5      5      nU R                  SSS9n[	        X15       VVVVs/ s H  u  u  u  pEpgXEU4U4PM     nnnnnU(       a.  [	        U6 u  pšU	 VVVs/ s H  u  pEn[        XEXr5      PM     nnnnO/ n/ n
U[        U
5      4$ s  snnnnf s  snnnf )z/Convert a path to a 3D segment with path codes.Fr¬   )r$   r“   r'   r¯   r˜   r”   Úlist)r
   r8   r)   r°   r    r!   r±   r"   Ú	seg_codesr²   Úcodesr³   s               r   Ú_path_to_3d_segment_with_codesr¾   r  s®   € ô 
�Š˜œS ›YÓ	'€BØ×!Ñ!¨5¸Ð!Ð?€HÜ<?ÀÔ<MÖNÒ<MÑ'8¡~©¨°�1˜�)˜TÓ"Ñ<M€IÓNÞÜ˜)�_‰
ˆÙ=@ÕAºS±	°°q”˜Q 1Ö+¹SˆÒAˆàˆØˆØ”$�u“+ÐÐùõ Oùô Bs   ÁB#
Á4B+c           	      óö   • [         R                  " U[        U 5      5      n[        X5       VVs/ s H  u  p4[	        X4U5      PM     nnnU(       a  [        U6 u  pgO/ / pv[        U5      [        U5      4$ s  snnf )zH
Convert paths from a collection object to 3D segments with path codes.
)r$   r“   r'   r˜   r¾   r»   )r¶   r8   r)   r
   r·   Úsegments_codesÚsegmentsr½   s           r   Ú _paths_to_3d_segments_with_codesrÂ   �  su   € ô
 
�Š˜œS ›ZÓ	(€Bä),¨U¬ô9Ú)7™+˜$ô 5°TÀ$ÖGÙ)7ð ñ 9æÜ˜~Ð.‰ˆ�%à˜b�%Ü�‹>œ4 ›;Ð&Ð&ùó9s   ¯A5c                   ó   • \ rS rSrSrS rSrg)ÚCollection3Di�  zA collection of 3D paths.c                 óP  • U R                    VVs/ s H  u  pUPM	     nnnU R                  (       aX  U Vs/ s HK  n[        R                  R	                  [        / UR                  QU R                  P76 5      R                  PMM     nnU Vs/ s H9  n[        R                  " / UR                  QU R                  R                  P76 PM;     nn[        X@R                   5       VVVVs/ s H@  u  u  pVnu  p'[        R                  " [        R                  R                  XV/5      U5      PMB     snnnnU l        [        R                   " U VVs/ s H  u    p(UPM
     snn5      n[#        U5      (       a  UR%                  5       $ S$ s  snnf s  snf s  snf s  snnnnf s  snnf )z0Project the points according to renderer matrix.ç    eÍÍA)Ú_3dverts_codesr`   r$   r5   rd   r=   ÚTr9   r   Úproj_transformrj   r˜   ÚmpathÚPathÚcolumn_stackÚ_pathsÚconcatenater'   Úmin)	rG   ÚvsÚ_Úvs_listÚ	xyzs_listr6   r7   Úcsr8   s	            r   Údo_3d_projectionÚCollection3D.do_3d_projection“  sG  € à#'×#6Ò#6Ô7Ò#6™%˜"“2Ñ#6ˆÑ7Ø××á!(ó*Ú!(˜2ô —u‘u—‘¤}Ð'F°b·d±dÐ'F¸D¿I¹IÒ'FÓG×IÔIÙ!(ð ð *áIPÓQÊÀ2”V×*Ò*Ð>¨B¯D©DÐ>°$·)±)·+±+Õ>Éˆ	ÐQä36°y×BUÑBUÔ3VöXÚ3VÑ/™;˜B A©¨ô —z’z¤"§%¡%×"4Ñ"4°b°XÓ">ÀÖCÙ3VôXˆŒä�^Š^±	Ô:²	¡H A q›R±	Ò:Ó;ˆÜ˜rŸ7™7ˆr�v‰v‹xÐ+¨Ð+ùó 8ùò*ùâQùõXùã:s   �F
¶AFÂA FÃ*AF
ÅF"
)rÍ   N)r|   r}   r~   r   r€   rÕ   r‚   r   r   r   rÄ   rÄ   �  s
   † Ù#õ
,r   rÄ   c                 ó8  • [         R                  " U[        U R                  5       5      5      n[	        U R                  5       U5       VVs/ s H„  u  pE[         R
                  " [        / [         R
                  " UR                  [         R                  " U[        UR                  5      5      /5      R                  QUP76 5      UR                  4PM†     snnU l
        [        R                  " [        S5      " [        U 5      5      U l        X0l        gs  snnf )z4Convert a `.Collection` to a `.Collection3D` object.z{}3DN)r$   r“   r'   Ú	get_pathsr˜   rÌ   r”   ÚverticesrÈ   r½   rÇ   r   Ú_make_class_factoryrÄ   ÚtyperY   r`   )Úcolr8   r)   rH   Úpr"   s         r   Úcollection_2d_to_3drÞ      sÔ   € ä	�Š˜œS §¡£Ó1Ó	2€Bô ˜Ÿ™›¨Ô,ô.ò
 -‰DˆAô	 
�Šœð Ü�_Š_˜aŸj™j¬"¯/ª/¸!¼SÀÇÁ»_Ó*MÐNÓO×QÑQðàòó 
ð 
�‰ó	ñ -ò.€CÔô ×-Ò-¬l¸FÔCÄDÈÃIÓN€C„MØ …Oùó.s   ÁBDc                   óH   ^ • \ rS rSrSrSU 4S jjrS rU 4S jrS rSr	U =r
$ )	ÚLine3DCollectioni­  z
A collection of 3D lines.
c                 ó4   >• [         TU ]  " U40 UD6  X l        g rB   )rT   rE   r`   )rG   r   rH   rI   rY   s       €r   rE   ÚLine3DCollection.__init__±  s   ø€ Ü‰Ò˜Ñ) &Ò)Ø%Õr   c                 ó   • Xl         SU l        g©z&Set the position to use for z-sorting.TN©Ú
_sort_zposr]   ©rG   Úvals     r   Úset_sort_zposÚLine3DCollection.set_sort_zposµ  ó   € àŒØˆ�
r   c                 ó0   >• Xl         [        TU ]	  / 5        g)z
Set 3D segments.
N)Ú_segments3drT   Úset_segments)rG   rÁ   rY   s     €r   rî   ÚLine3DCollection.set_segmentsº  s   ø€ ð $ÔÜ‰Ñ˜RÕ r   c           	      ó"  • U R                   nU R                  (       a¶  [        R                  R	                  U5      n[        R                  R                  / [        / UR                  QU R                  P76 Q5      nU Vs/ s H  n[        R                  " U5      S   PM     nn[        R                  " U[        R                  " USS 5      5      nU Vs/ s H-  n[        R                  " X`R                  R                  5      PM/     nnU VV	V
s/ s H&  u  p‰n
[        R                  R                  X‰/5      PM(     nn	nn
[        R                   " X5        SnU H  u  p‰n
[#        U[#        U
5      5      nM     U$ s  snf s  snf s  sn
n	nf )z2
Project the points according to renderer matrix.
r   NéÿÿÿÿrÆ   )rí   r`   r$   r5   ÚvstackrÌ   r=   rÈ   r9   ÚshapeÚsplitÚcumsumr   ri   rj   r   rî   rÏ   )rG   rÁ   Ú
all_pointsÚmasked_pointsÚsegmentÚsegment_lengthsÚpointsÚxyslistr6   r7   r8   Úsegments_2dÚminzs                r   rÕ   Ú!Line3DCollection.do_3d_projectionÁ  sP  € ð ×#Ñ#ˆØ××ÜŸ™Ÿ™ hÓ/ˆJÜŸE™E×.Ñ.ð 0K´ð 2JÀ
ÇÁð 2JØ?C¿y¹yò2Jð 0Kó LˆMáCKÓLÂ8¸œrŸxšx¨Ó0°Ô3Á8ˆOÐLÜ—x’x ¬r¯yªy¸ÈÈ"Ð9MÓ/NÓOˆHá!)ó+Ú!)�vô ×,Ò,¨V·Y±Y·[±[ÖAÙ!)ð 	ð +áFMÕNÂg¹
¸À”r—u‘u×)Ñ)¨2¨(Ö3ÁgˆÒNÜ×#Ò# DÔ6ð ˆÛ!‰JˆB�BÜ�tœS ›WÓ%ŠDñ "àˆùò Mùò+ùäNs   Â#F Ã4FÄ-F
)r`   rí   ræ   r]   ©F)r|   r}   r~   r   r€   rE   ré   rî   rÕ   r‚   rƒ   r„   s   @r   rà   rà   ­  s!   ø† ñ÷&òõ
!÷ð r   rà   c                 ó|   • [        U R                  5       X5      n[        U l        U R	                  U5        X0l        g)z<Convert a `.LineCollection` to a `.Line3DCollection` object.N)r¹   rØ   rà   rY   rî   r`   )rÜ   r8   r)   rH   Ú
segments3ds        r   Úline_collection_2d_to_3dr  Ø  s.   € ä& s§}¡}£¸ÓA€JÜ$€C„MØ×Ñ�ZÔ Ø …Or   c                   óN   ^ • \ rS rSrSrSSSS.U 4S jjrSS jrS	 rS
 rSr	U =r
$ )ÚPatch3Dià  z
3D patch object.
r   r"   F©r8   r)   rH   c                óJ   >• [         TU ]  " U0 UD6  U R                  XU5        g)ai  
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.
N)rT   rE   rF   )rG   r8   r)   rH   r�   rI   rY   s         €r   rE   ÚPatch3D.__init__å  s'   ø€ ô 	‰Ò˜$Ð) &Ò)Ø×Ñ˜r¨Õ4r   c                 óÆ   • [         R                  " U[        U5      5      n[        X5       VVVs/ s H  u  u  pVn[	        XVXs5      PM     snnnU l        X@l        gs  snnnf )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.
N)r$   r“   r'   r˜   r”   Ú
_segment3dr`   )rG   Úvertsr8   r)   rH   r    r!   r"   s           r   rF   ÚPatch3D.set_3d_propertiesö  sS   € ô  �_Š_˜R¤ U£Ó,ˆä.1°%¬nõ>Ú.<™{¡ ¨ô ' q¨QÖ5Ù.<ó>ˆŒà%Õùô>s   °Ac                 ó®   • [        U S5      (       d9  U R                  R                  5       U R                  l        U R	                  5         U R
                  $ )NÚ_path2d)Úhasattrr9   Úget_projrj   rÕ   r  rO   s    r   Úget_pathÚPatch3D.get_path  s?   € ô �t˜Y×'Ñ'ØŸ)™)×,Ñ,Ó.ˆD�I‰IŒKØ×!Ñ!Ô#Ø�|‰|Ðr   c                 ó¤  • U R                   nU R                  (       a!  [        / [        U6 QU R                  P76 u  p#nO[        U6 u  p#n[
        R                  " X#UU R                  R                  U R                  R                  5      u  pVpx[        R                  " [        R                  R                  XV/5      5      U l        [        U5      $ rB   )r	  r`   r=   r˜   r9   r   r    rj   r¡   rÊ   rË   r$   r5   rÌ   r  rÏ   ©	rG   Úsr6   r7   r8   ÚvxsÚvysÚvzsÚviss	            r   rÕ   ÚPatch3D.do_3d_projection  s�   € Ø�O‰OˆØ××Ü&Ð;¬¨Q¨Ð;°·±Ò;‰JˆB‘Bä˜a˜‰JˆB�BÜ#×8Ò8¸ÀØ9=¿¹¿¹Ø9=¿¹×9PÑ9PóRÑˆ�#ô —z’z¤"§%¡%×"4Ñ"4°c°ZÓ"@ÓAˆŒÜ�3‹xˆr   )r`   r  r	  r{   )r|   r}   r~   r   r€   rE   rF   r  rÕ   r‚   rƒ   r„   s   @r   r  r  à  s/   ø† ñð "$¨#¸%÷ 5ð 5ô"&ò*÷
ð 
r   r  c                   ó:   • \ rS rSrSrSSSS.S jrSS jrS	 rS
rg)ÚPathPatch3Di   z
3D PathPatch object.
r   r"   Fr  c                óV   • [         R                  " U 40 UD6  U R                  XX45        g)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.
N)r   rE   rF   )rG   r
   r8   r)   rH   rI   s         r   rE   ÚPathPatch3D.__init__%  s%   € ô 	�Š�tÑ&˜vÒ&Ø×Ñ˜t¨Õ:r   c                 ód   • [         R                  XR                  X#US9  UR                  U l        g)a¶  
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.
r  N)r  rF   rÙ   r½   Ú_code3d)rG   r
   r8   r)   rH   s        r   rF   ÚPathPatch3D.set_3d_properties7  s-   € ô  	×!Ñ! $¯©¸"Ø-7ð 	"ñ 	9à—z‘zˆ�r   c                 óº  • U R                   nU R                  (       a!  [        / [        U6 QU R                  P76 u  p#nO[        U6 u  p#n[
        R                  " X#UU R                  R                  U R                  R                  5      u  pVpx[        R                  " [        R                  R                  XV/5      U R                  5      U l        [!        U5      $ rB   )r	  r`   r=   r˜   r9   r   r    rj   r¡   rÊ   rË   r$   r5   rÌ   r  r  rÏ   r  s	            r   rÕ   ÚPathPatch3D.do_3d_projectionK  s£   € Ø�O‰OˆØ××Ü&Ð;¬¨Q¨Ð;°·±Ò;‰JˆB‘Bä˜a˜‰JˆB�BÜ#×8Ò8¸ÀØ9=¿¹¿¹Ø9=¿¹×9PÑ9PóRÑˆ�#ô —z’z¤"§%¡%×"4Ñ"4°c°ZÓ"@À$Ç,Á,ÓOˆŒÜ�3‹xˆr   )r  r  Nr{   )	r|   r}   r~   r   r€   rE   rF   rÕ   r‚   r   r   r   r  r     s   † ñð $&¨C¸Eõ ;ô$"õ(
r   r  c                 óº   • U R                  5       nU R                  5       nUR                  U5      n[        U5      (       a  US   $ [        R
                  " / 5      $ )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)  X  sK   € à×%Ñ%Ó'€EØ�>‰>Ó€DØ×Ñ Ó&€HÜ˜hŸ-™-ˆ8�A‰;Ð9¬R¯XªX°b«\Ð9r   c                 óT   • [        U 5      n[        U l        U R                  XAX#5        g)z*Convert a `.Patch` to a `.Patch3D` object.N)r)  r  rY   rF   )r&  r"   r)   rH   r
  s        r   Úpatch_2d_to_3dr+  `  s#   € ä˜UÓ#€EÜ€E„OØ	×Ñ˜E dÕ7r   c                 ó    • U R                  5       nU R                  5       nUR                  U5      n[        U l        U R                  XQU5        g)z2Convert a `.PathPatch` to a `.PathPatch3D` object.N)r  r$  Útransform_pathr  rY   rF   )Ú	pathpatchr"   r)   r
   r'  rÊ   s         r   Úpathpatch_2d_to_3dr/  g  sF   € à×ÑÓ€DØ×)Ñ)Ó+€Eà× Ñ  Ó&€EÜ%€IÔØ×Ñ ¨$Õ/r   c                   ó€   ^ • \ rS rSrSrSSSSS.U 4S jjrS	 rS
 rS rSS jr	U 4S jr
S rU 4S jrU 4S jrSrU =r$ )ÚPatch3DCollectioniq  z
A collection of 3D patches.
r   r"   TF©r8   r)   Ú
depthshaderH   c                óV   >• X0l         [        TU ]  " U0 UD6  U R                  XU5        g)aJ  
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 to shade the patches in order to give the appearance of depth
(default is *True*). This is typically desired in scatter plots.
N)Ú_depthshaderT   rE   rF   ©rG   r8   r)   r3  rH   r�   rI   rY   s          €r   rE   ÚPatch3DCollection.__init__v  s-   ø€ ð  &ÔÜ‰Ò˜$Ð) &Ò)Ø×Ñ˜r¨Õ4r   c                 ó   • U R                   $ rB   ©r5  rO   s    r   Úget_depthshadeÚ Patch3DCollection.get_depthshadeŠ  ó   € Ø×ÑÐr   c                 ó   • Xl         SU l        g©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©r5  r]   ©rG   r3  s     r   Úset_depthshadeÚ Patch3DCollection.set_depthshade�  ó   € ð &ÔØˆ�
r   c                 ó   • Xl         SU l        grä   rå   rç   s     r   ré   ÚPatch3DCollection.set_sort_zposš  rë   r   c                 ó  • U R                  5         U R                  5       n[        U5      S:”  a  UR                  u  pVO/ n/ n[	        XV[
        R                  " U5      U5      U l        [        S5      U l	        SU l
        X0l        SU l        g)aÝ  
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.
r   rñ   NT)Úupdate_scalarmappableÚget_offsetsr'   rÈ   r”   r$   Ú
atleast_1dÚ
_offsets3dÚsliceÚ_z_markers_idxÚ_vzsr`   r]   ©rG   r8   r)   rH   Úoffsetsr6   r7   s          r   rF   Ú#Patch3DCollection.set_3d_propertiesŸ  sz   € ð$ 	×"Ñ"Ô$Ø×"Ñ"Ó$ˆÜˆw‹<˜!ÓØ—Y‘Y‰FˆB�àˆBØˆBÜ% b¬b¯mªm¸BÓ.?ÀÓFˆŒÜ# B›iˆÔØˆŒ	Ø%ÔØˆ�
r   c                 óÒ  >• U R                   (       a%  [        / U R                  QU R                  P76 u  pnOU R                  u  pn[        R
                  " XUU R                  R                  U R                  R                  5      u  pEpgX`l        [        TU ])  [        R                  R                  XE/5      5        UR                  S:”  a  [        U5      $ [        R                   $ ©Nr   )r`   r=   rJ  r9   r   r    rj   r¡   rM  rT   Úset_offsetsr$   r5   rÌ   ÚsizerÏ   rg   )	rG   r6   r7   r8   r  r  r  r  rY   s	           €r   rÕ   Ú"Patch3DCollection.do_3d_projection¾  s«   ø€ Ø××Ü&ÐC¨¯©ÐC¸¿¹ÒC‰JˆB‘BàŸ™‰JˆB�BÜ#×8Ò8¸ÀØ9=¿¹¿¹Ø9=¿¹×9PÑ9PóRÑˆ�#ð Œ	Ü‰ÑœBŸE™E×.Ñ.°¨zÓ:Ô;à�8‰8�a‹<Ü�s“8ˆOä—6‘6ˆMr   c                 óæ   • U R                   b&  U R                  (       a  [        XR                   5      OUn[        U5      S:”  a  XR                     n[
        R                  " XR                  5      $ ©Nr   ©rM  r5  Ú_zalphar'   rL  ÚmcolorsÚto_rgba_arrayÚ_alpha©rG   Úcolor_arrays     r   Ú"_maybe_depth_shade_and_sort_colorsÚ4Patch3DCollection._maybe_depth_shade_and_sort_colorsÎ  ó^   € ð �y‰yÑ$¨×)9×)9ô �K§¡Ô+àð 	ô
 ˆ{Ó˜aÓØ%×&9Ñ&9Ñ:ˆKÜ×$Ò$ [·+±+Ó>Ð>r   c                 ó>   >• U R                  [        TU ]	  5       5      $ rB   ©r_  rT   Úget_facecolor©rG   rY   s    €r   rd  ÚPatch3DCollection.get_facecolorØ  ó   ø€ Ø×6Ñ6´u±wÑ7LÓ7NÓOÐOr   c                 óª   >• [         R                  " U R                  S5      (       a  U R                  5       $ U R	                  [
        TU ]  5       5      $ ©NÚface©r   Ú
_str_equalÚ_edgecolorsrd  r_  rT   Úget_edgecolorre  s    €r   rn  ÚPatch3DCollection.get_edgecolorÛ  óF   ø€ ô ×Ò˜D×,Ñ,¨f×5Ñ5Ø×%Ñ%Ó'Ð'Ø×6Ñ6´u±wÑ7LÓ7NÓOÐOr   )r`   r5  rJ  ræ   rM  rL  r]   rÿ   )r|   r}   r~   r   r€   rE   r:  rA  ré   rF   rÕ   r_  rd  rn  r‚   rƒ   r„   s   @r   r1  r1  q  sM   ø† ñð
 ˜C¨D¸U÷5ð 5ò( òòô
õ>ò ?õP÷Pó Pr   r1  c                   ó¸   ^ • \ rS rSrSrSSSSS.U 4S jjrU 4S	 jrS
 rSS jrSU 4S jjr	U 4S jr
S rS rS r\U 4S j5       rS rU 4S jrU 4S jrSrU =r$ )ÚPath3DCollectioniä  z
A collection of 3D paths.
r   r"   TFr2  c                ór   >• X0l         SU l        [        TU ]  " U0 UD6  U R	                  XU5        SU l        g)aE  
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 to shade the patches in order to give the appearance of depth
(default is *True*). This is typically desired in scatter plots.
FN)r5  Ú_in_drawrT   rE   rF   Ú_offset_zorderedr6  s          €r   rE   ÚPath3DCollection.__init__é  s<   ø€ ð  &ÔØˆŒÜ‰Ò˜$Ð) &Ò)Ø×Ñ˜r¨Ô4Ø $ˆÕr   c                 óÖ   >• U R                  5          [        R                  " U SS9   [        TU ]  U5        S S S 5        S S S 5        g ! , (       d  f       N= f! , (       d  f       g = f)NT)rt  )Ú_use_zordered_offsetr   rn   rT   ro   )rG   rp   rY   s     €r   ro   ÚPath3DCollection.drawÿ  sH   ø€ Ø×&Ñ&Õ(Ü×"Ò" 4°$Ó7Ü‘‘˜XÔ&÷ 8÷ )Ð(ß7Õ7ú÷ )Õ(ús!   ’A¨A	¸AÁ	
A	ÁAÁ
A(c                 ó   • Xl         SU l        grä   rå   rç   s     r   ré   ÚPath3DCollection.set_sort_zpos  rë   r   c                 ó²  • U R                  5         U R                  5       n[        U5      S:”  a  UR                  u  pVO/ n/ nX l        [        XV[        R                  " U5      U5      U l        U R                  U l
        [        R                  " U R                  5      U l        U R                  u  pVn[        S5      U l        SU l        X0l        SU l        g)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.
r   rñ   NT)rG  rH  r'   rÈ   Ú_zdirr”   r$   rI  rJ  Ú_sizesÚ_sizes3dr%   Ú_linewidthsÚ_linewidths3drK  rL  rM  r`   r]   rN  s          r   rF   Ú"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›iˆÔØˆŒ	à%ÔØˆ�
r   c                 óT   >• [         TU ]  X5        U R                  (       d  Xl        g g rB   )rT   Ú	set_sizesrt  r  )rG   ÚsizesÚdpirY   s      €r   r„  ÚPath3DCollection.set_sizes;  s!   ø€ Ü‰Ñ˜%Ô%Ø�}�}Ø!�Mð r   c                 ó’   >• [         TU ]  U5        U R                  (       d&  [        R                  " U R
                  5      U l        g g rB   )rT   Úset_linewidthrt  r$   r%   r€  r�  )rG   ÚlwrY   s     €r   r‰  ÚPath3DCollection.set_linewidth@  s3   ø€ Ü‰Ñ˜bÔ!Ø�}�}Ü!#§¢¨$×*:Ñ*:Ó!;ˆDÕð r   c                 ó   • U R                   $ rB   r9  rO   s    r   r:  ÚPath3DCollection.get_depthshadeE  r<  r   c                 ó   • Xl         SU l        gr>  r?  r@  s     r   rA  ÚPath3DCollection.set_depthshadeH  rC  r   c                 ód  • U R                   (       a%  [        / U R                  QU R                  P76 u  pnOU R                  u  pn[        R
                  " XUU R                  R                  U R                  R                  5      u  pEpg[        R                  R                  U5      S S S2   =o€l        X`l        [        U R                  5      S:”  a  U R                  U   U l        [        U R                   5      S:”  a  U R                   U   U l        [$        R&                  " U [        R                  R)                  XE45      5        Xh   nXH   nXX   n[        R                  R)                  XE45      U l        UR,                  (       a  [        R.                  " U5      $ [        R0                  $ )Nrñ   r   )r`   r=   rJ  r9   r   r    rj   r¡   r$   r5   ÚargsortrL  rM  r'   r  r~  r�  r€  r   rS  rÌ   ru  rT  rÏ   rg   )	rG   r6   r7   r8   r  r  r  r  Úz_markers_idxs	            r   rÕ   Ú!Path3DCollection.do_3d_projectionU  sL  € Ø××Ü&ÐC¨¯©ÐC¸¿¹ÒC‰JˆB‘BàŸ™‰JˆB�BÜ#×8Ò8¸ÀØ9=¿¹¿¹Ø9=¿¹×9PÑ9PóRÑˆ�#ô /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              #   ó¨   >#   • U R                   c  S v •  g U R                  n[        TU ]  U R                   5         S v •  Xl        g ! Xl        f = f7frB   )ru  Ú_offsetsrT   rS  )rG   Ú
old_offsetrY   s     €r   rx  Ú%Path3DCollection._use_zordered_offsetz  sE   øé € à× Ñ Ñ(äð Ÿ™ˆJÜ‰GÑ × 5Ñ 5Ô6ð+Ûà *•ø 
•üs   ƒ8A¼A Á AÁAÁAc                 óæ   • U R                   b&  U R                  (       a  [        XR                   5      OUn[        U5      S:”  a  XR                     n[
        R                  " XR                  5      $ rW  rX  r]  s     r   r_  Ú3Path3DCollection._maybe_depth_shade_and_sort_colorsˆ  ra  r   c                 ó>   >• U R                  [        TU ]	  5       5      $ rB   rc  re  s    €r   rd  ÚPath3DCollection.get_facecolor’  rg  r   c                 óª   >• [         R                  " U R                  S5      (       a  U R                  5       $ U R	                  [
        TU ]  5       5      $ ri  rk  re  s    €r   rn  ÚPath3DCollection.get_edgecolor•  rp  r   )r`   r5  rt  r€  r�  ru  r•  rJ  r~  r  ræ   rM  rL  r}  r]   rÿ   )g      R@)r|   r}   r~   r   r€   rE   ro   ré   rF   r„  r‰  r:  rA  rÕ   r   rx  r_  rd  rn  r‚   rƒ   r„   s   @r   rr  rr  ä  sr   ø† ñð
 ˜C¨D¸U÷%ð %õ,'ò
ô
0÷d"õ
<ò
 òò#3ðJ ô+ó ð+ò?õP÷Pó Pr   rr  c                 óÒ   • [        U [        5      (       a  [        U l        SU l        O [        U [
        5      (       a  [        U l        X0l        SU l        U R                  XU5        g)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: True
    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.
NF)
Ú
isinstancer   rr  rY   ru  r   r1  r5  rt  rF   )rÜ   r8   r)   r3  rH   s        r   Úpatch_collection_2d_to_3dr   ž  sP   € ô* �#”~×&Ñ&Ü(ˆŒØ#ˆÕÜ	�Cœ×	)Ñ	)Ü)ˆŒØ „OØ€C„LØ×Ñ˜" JÕ/r   c                   ó  ^ • \ rS rSrSrSSSSS.U 4S jjr\R                  \R                  \R                  S.r
S	 r\R                  " S
5      S 5       rS rSU 4S jjrS rSS jrS rS rU 4S jrU 4S jrS rS rS rSrU =r$ )ÚPoly3DCollectioni½  a¿  
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ÚlightsourcerH   c                óú  >• U(       ad  [        U5      nUR                  SS5      n	U	b  [        X˜U5      US'   UR                  SS5      n
U
b  [        X¨U5      US'   U	c  U
c  [        S5      e[        TU ]  " U/UQ70 UD6  [        U[        R                  5      (       a  UR                  S:w  a  [        S5      eO"[        S U 5       5      (       a  [        S5      eU R                  U5        SU l        XPl        g)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.

*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   óf   #   • U  H'  n[        [        R                  " U5      5      S :g  v •  M)     g7f)rS   N)r'   r$   ró   )Ú.0Úverts     r   Ú	<genexpr>Ú,Poly3DCollection.__init__.<locals>.<genexpr>
  s"   é € Ð>º°”3”r—x’x “~Ó&¨!Ö+ºùs   ‚/1)Ú_generate_normalsÚgetÚ_shade_colorsr(   rT   rE   rŸ  r$   ÚndarrayÚndimÚanyÚ	set_zsortÚ_codes3dr`   )rG   r
  r¤  r¥  r¦  rH   r�   rI   Únormalsr¨  r©  rY   s              €r   rE   ÚPoly3DCollection.__init__Ò  s  ø€ öD Ü'¨Ó.ˆ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Ï   Úmaxc                 óH   • U R                   U   U l        SU l        SU l        g)zå
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]   )rG   r¤  s     r   rµ  ÚPoly3DCollection.set_zsort  s$   € ð ×/Ñ/°Ñ6ˆŒØˆŒØˆ�
r   z3.10c                 ó$   • U R                  U5      $ rB   )Ú_get_vector)rG   r  s     r   Ú
get_vectorÚPoly3DCollection.get_vector$  s   € à×Ñ 
Ó+Ð+r   c           	      óš  • [        U5      (       a$  [        R                  " U5      R                  u  p#nO/ / / pCn[        R                  " [        U5      5      n[        R
                  " X#XE/5      U l        S/[        R                  " U Vs/ s H  n[        U5      PM     sn5      Qn/ [        [        USS USS 5      QU l
        gs  snf )zOptimize points for projection.r   Nrñ   r   )r'   r$   rò   rÈ   Úonesr%   Ú_vecrõ   ÚmaprK  Ú
_segslices)rG   r  r6   r7   r8   rÃ  rø   Úindicess           r   r¿  ÚPoly3DCollection._get_vector(  s¥   € äˆz�?‰?ÜŸš :Ó.×0Ñ0‰JˆB‘Bà˜R �BˆBÜ�wŠw”s˜2“wÓˆÜ—H’H˜b bÐ/Ó0ˆŒ	àÐK”r—y’y¹jÓ!Iºj°7¤# g¦,¹jÑ!IÓJÐKˆØBœC¤ w¨s° |°W¸Q¸R°[ÓAÐBˆ�ùò "Js   ÂC
c                 óT   >• U R                  U5        [        TU ]	  / S5        X l        g)af  
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¿  rT   Ú	set_vertsÚ_closed)rG   r
  ÚclosedrY   s      €r   rÊ  ÚPoly3DCollection.set_verts4  s'   ø€ ð 	×Ñ˜Ôä‰Ñ˜"˜eÔ$Ø�r   c                 ó0   • U R                  USS9  X l        g)z Set 3D vertices with path codes.F)rÌ  N)rÊ  r¶  )rG   r
  r½   s      r   Úset_verts_and_codesÚ$Poly3DCollection.set_verts_and_codesG  s   € ð 	�‰�u UˆÑ+à�r   c                 ó  • U R                  5         S U l        U R                  S5        [        R                  " U 5      U l        [        R                  " U 5      U l        [        R                  " U 5      U l	        SU l
        g )Nr£  T)rG  ræ   rµ  r   rd  Ú_facecolor3drn  Ú_edgecolor3dÚ	get_alphaÚ_alpha3dr]   )rG   rH   s     r   rF   Ú"Poly3DCollection.set_3d_propertiesO  sb   € ð 	×"Ñ"Ô$ØˆŒØ�‰�yÔ!Ü*×8Ò8¸Ó>ˆÔÜ*×8Ò8¸Ó>ˆÔÜ&×0Ò0°Ó6ˆŒØˆ�
r   c                 ó   • Xl         SU l        grä   rå   rç   s     r   ré   ÚPoly3DCollection.set_sort_zposZ  rë   r   c           
      óÄ  ^ • T R                   bT  T R                  5         T R                  (       a  T R                  T l        T R
                  (       a  T R                  T l        T R                  (       a¿  [        / T R                  SS QT R                  P76 u  pnT R                  R                  S   S:X  aY  [        R                  R                  UR                   T R                  S   5      n[        R                  R#                  XX4/5      nO.[        R                  R#                  XU/5      nOT R                  n[$        R&                  " UT R                  R(                  5      u  pgnT R*                   V	s/ s H  o–U	   Xy   X‰   4PM     n
n	T R                  nT R                  n[-        U5      [-        U
5      :w  a  UR/                  [-        U
5      SS9n[-        U5      [-        U
5      :w  a+  [-        U5      S:X  a  UnOUR/                  [-        U
5      SS9nU
(       aA  [1        U 4S j[3        [5        X«U5      5       5       S SS9n[5        U6 u  pïT l        T l        nO:/ n[        R:                  " S	5      T l        [        R:                  " S	5      T l        / nT R<                  b8  U Vs/ s H  nT R<                  U   PM     nn[>        R@                  " T UU5        O"[>        RB                  " T UT RD                  5        [-        T R                  5      [-        U5      :w  a  T R                  T l        T RF                  b[  [        R"                  " S/S/T RF                  /S
//5      n[$        R&                  " UT R                  R(                  5      nUS   S   $ URH                  S:”  a  [        RJ                  " U5      $ [        RL                  $ s  sn	f s  snf )z,
Perform the 3D projection for this object.
r   r#   é   ©Úaxisc              3   ó°   >#   • U  HK  u  nu  u  p#pEnTR                  UR                  5      [        R                  R	                  X#/5      XVU4v •  MM     g 7frB   )r¼  Údatar$   r5   rÌ   )r«  Úidxr6   r7   r8   ÚfcÚecrG   s          €r   r­  Ú4Poly3DCollection.do_3d_projection.<locals>.<genexpr>Š  sP   øé € ð ;â9ñ 1�SÑ0™<˜B B¨Rð —/‘/ "§'¡'Ó*¬B¯E©E×,>Ñ,>À¸xÓ,HÈ"ÐRUÕVâ9ùs   ƒAAc                 ó   • U S   $ rR  r   )r    s    r   Ú<lambda>Ú3Poly3DCollection.do_3d_projection.<locals>.<lambda>�  s   € ˜a šdr   T)ÚkeyÚreverse©r   rÚ  r   rS   )'Ú_ArG  Ú_face_is_mappedÚ_facecolorsrÒ  Ú_edge_is_mappedrm  rÓ  r`   r=   rÄ  r9   ró   r$   r5   Úmasked_wherer,   r%   r   Ú_proj_transform_vecrj   rÆ  r'   ÚrepeatÚsortedÚ	enumerater˜   Ú_facecolors2dÚ_edgecolors2dÚemptyr¶  r   rÏ  rÊ  rË  ræ   rT  rÏ   rg   )rG   r6   r7   r8   Úw_maskedÚvecÚtxsÚtysÚtzsÚslÚxyzlistÚcfaceÚcedgeÚz_segments_2drÑ   rü   Úidxsrß  r½   ÚzvecÚztranss   `                    r   rÕ   Ú!Poly3DCollection.do_3d_projection_  s  ø€ ð �7‰7Ñð ×&Ñ&Ô(Ø×#×#Ø$(×$4Ñ$4�Ô!Ø×#×#Ø$(×$4Ñ$4�Ô!Ø××Ü&ÐB¨¯	©	°!°A¨ÐB¸¿	¹	ÒB‰JˆB�BØ�y‰y�‰˜qÑ! QÓ&ÜŸ5™5×-Ñ-¨b¯g©g°t·y±yÀ±|ÓD�Ü—e‘e—k‘k 2¨2Ð"8Ó9‘ä—e‘e—k‘k 2¨2 ,Ó/‘à—)‘)ˆCÜ×2Ò2°3¸¿	¹	¿¹ÓD‰ˆ�#Ø9=¿ºÓIº°2˜‘G˜S™W c¡gÓ.¹ˆÐIð ×!Ñ!ˆØ×!Ñ!ˆÜˆu‹:œ˜W›Ó%Ø—L‘L¤ W£°A�LÐ6ˆEÜˆu‹:œ˜W›Ó%Ü�5‹z˜Q‹Ø‘àŸ™¤S¨£\¸˜Ð:�æä"ô;äœc '°%Ó8Ô9ó;ñ #¨Dñ	2ˆMô �]Ð#ñ IˆA˜DÔ.°Ô0BÁDð ˆKÜ!#§¢¨&Ó!1ˆDÔÜ!#§¢¨&Ó!1ˆDÔØˆDà�=‰=Ñ$Ù37Ó8²4¨C�T—]‘] 3Ô'±4ˆEÐ8Ü×.Ò.¨t°[À%ÕHä×$Ò$ T¨;¸¿¹ÔEäˆt× Ñ Ó!¤S¨£ZÓ/Ø!%×!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ùòc Jùò< 9s   Å;OÊ1Oc                 óZ   >• [         TU ]  U5        [        R                  " U 5      U l        g rB   )rT   Úset_facecolorr   rd  rÒ  ©rG   r   rY   s     €r   r  ÚPoly3DCollection.set_facecolor­  ó#   ø€ ä‰Ñ˜fÔ%Ü*×8Ò8¸Ó>ˆÕr   c                 óZ   >• [         TU ]  U5        [        R                  " U 5      U l        g rB   )rT   Úset_edgecolorr   rn  rÓ  r  s     €r   r	  ÚPoly3DCollection.set_edgecolor²  r  r   c                 ó€  • [         R                  R                  X5         [        R                  " U R
                  U R                  5      U l         [        R                  " U R                  U R                  5      U l        SU l        g ! [        [        [        4 a     NPf = f! [        [        [        4 a     N:f = f)NT)r   ÚArtistÚ	set_alpharZ  r[  rÒ  r\  ÚAttributeErrorÚ	TypeErrorÚ
IndexErrorrÓ  rm  r]   )rG   Úalphas     r   r  ÚPoly3DCollection.set_alpha·  s    € ä�‰×Ñ Ô,ð	Ü '× 5Ò 5Ø×!Ñ! 4§;¡;ó!0ˆDÔð	Ü&×4Ò4Ø×%Ñ% t§{¡{ó 4ˆDÔð ˆ�
øô ¤	¬:Ð6ó 	Ùð	ûô
 ¤	¬:Ð6ó 	Ùð	ús#   ¡0B
 Á0B% Â
B"Â!B"Â%B=Â<B=c                 óÖ   • [        U S5      (       d9  U R                  R                  5       U R                  l        U R	                  5         [
        R                  " U R                  5      $ )Nrò  )r  r9   r  rj   rÕ   r$   Úasarrayrò  rO   s    r   rd  ÚPoly3DCollection.get_facecolorÆ  óJ   € ô �t˜_×-Ñ-ØŸ)™)×,Ñ,Ó.ˆD�I‰IŒKØ×!Ñ!Ô#Ü�zŠz˜$×,Ñ,Ó-Ð-r   c                 óÖ   • [        U S5      (       d9  U R                  R                  5       U R                  l        U R	                  5         [
        R                  " U R                  5      $ )Nró  )r  r9   r  rj   rÕ   r$   r  ró  rO   s    r   rn  ÚPoly3DCollection.get_edgecolorÎ  r  r   )rÕ  r`   rË  r¶  rÓ  rm  ró  rÒ  rò  rÆ  ræ   rÄ  r¼  r]   )Trÿ   )r|   r}   r~   r   r€   rE   r$   r£  rÏ   r¹  r»  rµ  r   Ú
deprecatedrÀ  r¿  rÊ  rÏ  rF   ré   rÕ   r  r	  r  rd  rn  r‚   rƒ   r„   s   @r   r¢  r¢  ½  sŸ   ø† ñð( ,5¸EØ!¨e÷<&ð <&ð~ —:‘:Ø�v‰vØ�v‰vñÐòð 
‡_‚_�VÓñ,ó ð,ò
C÷ò&ô	òò
Lõ\?õ
?ò
ò.÷.ð .r   r¢  c                 ó    • [        U R                  5       X5      u  pE[        U l        U R	                  XE5        U R                  5         X0l        g)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¢  rY   rÏ  rF   r`   )rÜ   r8   r)   rH   Úsegments_3dr½   s         r   Úpoly_collection_2d_to_3dr  ×  sB   € ô :Ø�M‰M‹O˜Ró'Ñ€Kä$€C„MØ×Ñ˜KÔ/Ø×ÑÔØ …Or   c                 ó\   • US:X  a  X U4$ US:X  a  XU4$ US   S:X  a  [        XX#5      $ XU4$ )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©r6   r7   r8   r)   s       r   r”   r”   î  sH   € ð ˆsƒ{Ø�rˆzÐØ	�‹Ø�rˆzÐØ	ˆa‰�C‹Ü˜2 2Ó,Ð,à�rˆzÐr   c                 ó2   • US;   a  XU 4$ US;   a  X U4$ XU4$ )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  ÿ  s2   € ð ˆ{ÓØ�rˆzÐØ	�Ó	Ø�rˆzÐà�rˆzÐr   c                 ó„  • [        U 5      S:X  d  [        U5      S:X  a  [        R                  " S5      $ [        [	        U5      [        U5      5      nSU" U5      S-  -
  n[        R                  " [        R                  " U 5      [        U5      S45      n[        R                  " USS2SS24   USS2S4   U-  /5      $ )z7Modify the alphas of the color list according to depth.r   rè  r   gffffffæ?rÚ  Nr#   )
r'   r$   Úzerosr   rÏ   r¹  r“   rZ  r[  rÌ   )r   r8   ÚnormÚsatsÚrgbas        r   rY  rY    sŸ   € ô ˆ6ƒ{�aÓœ3˜r›7 a›<Ü�xŠx˜ÓÐÜ”S˜“Wœc "›gÓ&€DØ‰t�B‹x˜#‰~Ñ€DÜ�?Š?œ7×0Ò0°Ó8¼3¸r»7ÀA¸,ÓG€DÜ�?Š?˜D¢ B Q B ™K¨ªa°¨d©°dÑ):Ð;Ó<Ð<r   c                 ó$  • [         R                  " U 5      [         R                  " U5      [         R                  " U5      p!n [         R                  " XU/5      nU[         R                  " U5      R	                  SS9)    n[         R
                  " USS9n[        U5      S::  a  gXDS   -
  SS nU[         R                  R                  USS9SS2[         R                  4   -  n[         R
                  " USS9n[        U5      S::  a  g[         R                  R                  [         R                  " US   USS 5      SS9n[         R                  " [         R                  " USUS95      S   S-   n[         R                  " XWSS9n[        U5      S::  a  g[         R                  " US   US   5      nU[         R                  R                  U5      -  n[         R                  " X…R                  5       5      n	[         R                   " U	SUS9$ )	zò
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#   TNrS   )Úatol)r$   r  rÌ   Úisnanr´  Úuniquer'   Úlinalgr$  ÚnewaxisÚcrossÚwhereÚiscloseÚdeleteÚdotÚ	transposeÚallclose)
r6   r7   r8   r(  rú   rÐ   Úcross_normsÚzero_cross_normsÚnÚdotss
             r   Ú_all_points_on_planer8    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ÓØà
˜!‘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�!—\‘\“^Ó$€DÜ�;Š;�t˜Q TÑ*Ð*r   c                 ób  • [        U [        R                  5      (       aH  U R                  S   nSUS-  SU-  S-  pCnU SUSS24   U SUSS24   -
  nU SUSS24   U SUSS24   -
  nO³[        R                  " [        U 5      S45      n[        R                  " [        U 5      S45      n[        U 5       Hb  u  px[        U5      n[        R                  " U5      nSUS-  SU-  S-  pCnX‚SS24   XƒSS24   -
  XWSS24'   XƒSS24   X„SS24   -
  XgSS24'   Md     [        R                  " XV5      $ )aù  
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#   rS   .N)	rŸ  r$   r²  ró   rô  r'   rñ  r  r-  )	r(  r6  Úi1Úi2Úi3Úv1Úv2Úpoly_iÚpss	            r   r¯  r¯  D  s3  € ô0 �(œBŸJ™J×'Ñ'ð �N‰N˜2ÑˆØ˜˜1™˜a ™c 1™f�ˆØ�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Ö-‰JˆFÜ�B“ˆAÜ—’˜B“ˆBØ˜A˜q™D ! A¡# q¡&�BˆBØ¢1˜u™I¨ªq¨5©	Ñ1ˆB’qˆy‰MØ¢1˜u™I¨ªq¨5©	Ñ1ˆB’qˆy‹Mñ .ô �8Š8�BÓÐr   c                 ó®  ^^	• Uc  [         R                  " SSS9n[        R                  " SS9   U[        R                  R                  USSS	9-  UR                  -  nSSS5        [        R                  " W5      ) nUR                  5       (       a�  [         R                  " S
S5      m[         R                  " SS5      R                  m	UU	4S jnSX4) '   [         R                  " U 5      n U SS2S4   nU" U5      SS2[        R                  4   U -  nXgSS2S4'   U$ [        R                  " U 5      R                  5       nU$ ! , (       d  f       Ní= f)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*.
NrŠ   gà-� x3@)ÚazdegÚaltdegÚignore)Úinvalidr   T)rÜ  Úkeepdimsrñ   g333333Ó?c                 ó    >• T" T" U 5      5      $ rB   r   )r    Úin_normÚout_norms    €€r   r$  Ú_shade_colors.<locals>.norm„  s   ø€ Ù™G A›JÓ'Ð'r   r   r#   )rZ  ÚLightSourcer$   Úerrstater+  r$  Ú	directionr)  r´  r   Úinverser[  r,  rh   Úcopy)
Úcolorr·  r¦  r¥  r,   r$  r  r   rI  rJ  s
           @@r   r±  r±  p  s#  ù€ ð Ñä×)Ò)°¸GÑDˆä	�Š˜XÓ	&ØœBŸI™IŸN™N¨7¸ÀT˜NÐJÑJØ×(Ñ(ñ)ˆ÷ 
'ô �HŠH�U‹OÐ€Dà‡x�x‡z�zä×#Ò# B¨Ó*ˆÜ×$Ò$ S¨!Ó,×4Ñ4ˆö	(ð ˆˆe‰ä×%Ò% eÓ,ˆð ’a˜�d‘ˆÙ�e“šQ¤§
¡
˜]Ñ+¨eÑ3ˆØŠq�!ˆt‰ð €Mô —’˜uÓ%×*Ñ*Ó,ˆà€M÷3 
'Õ	&ús   ¯0EÅ
Er{   )r   r"   )r   r"   TF)g:Œ0âŽyE>rB   )?r€   rk   Únumpyr$   Ú
contextlibr   Ú
matplotlibr   r   r   r   rZ  r   r	   rC   r
   rÊ   Úmatplotlib.collectionsr   r   r   r   r   Úmatplotlib.colorsr   Úmatplotlib.patchesr   rz   r   r   r   r*   r=   rD   r?   r‡   ÚLine2Dr‰   rª   r´   r¹   r¾   rÂ   rÄ   rÞ   rà   r  r  r  r)  r+  r/  r1  rr  r   r¢  r  r”   r  rY  r8  r¯  r±  r   r   r   Ú<module>rY     s:  ðñ
ó
 ã å %÷÷ ñ ÷Qõ Qå 'Ý $Ý òòòOòD+ô8dˆU�Z‰Zô dôN/ô$cˆU�\‰\ô côL1ô&ôôô'ô,�:ô ,ô 
!ô(�~ô (ôV!ô=ˆeô =ô@5�'ô 5òp:ô8ô0ôpP˜ô pPôfwP�~ô wPôt0ô>W.�~ô W.ôt!ò.ò"ò=ô&+òR)õX#r   