+
    i#                    v   ^ RI Ht ^ RIHtHt ^ RIHt ^ RIt^ RI	H
t
HtHt ^ RIHtHtHtHtHtHt ]'       d   ^ RIHt R R ltR	 R
 ltR R ltR R ltR R ltR R ltR R ltR R ltR R ltR R lt R R lt!R R lt"R R  lt#R! R" lt$R# R$ lt%R% R& lt&R' R( lt'R) R* lt(R+ R, lt)R- R. lt*R# )/    )annotations)chainpairwise)TYPE_CHECKINGN)check_code_arraycheck_offset_arraycheck_point_array)	CLOSEPOLYLINETOMOVETO
code_dtypeoffset_dtypepoint_dtypec                    V ^8  d   QhRRRR/# )   offsetscpy.OffsetArrayreturncpy.CodeArray )formats   "o/Users/tonyclaw/.openclaw/workspace/skills/math-calculator/venv/lib/python3.14/site-packages/contourpy/array.py__annotate__r      s     	 	 	M 	    c                    \        V 4       V R,          p\        P                  ! V\        \        R7      p\
        W RR &   \        W R,          ^,
          &   V# )zSDetermine codes from offsets, assuming they all correspond to closed polygons.
    dtypeN   NN)r   npfullr   r   r   r
   )r   ncodess   &  r   codes_from_offsetsr%      sJ     wAGGAvZ0E E#2,&E"+/Lr   c               $    V ^8  d   QhRRRRRR/# )r   r   r   pointscpy.PointArrayr   r   r   )r   s   "r   r   r      s&       r   c                .   \        V 4       \        V4       \        P                  ! \	        V4      \
        \        R7      p\        W RR &   V R,          ^,
          p\        P                  ! WRR ,          W,          8H  ^R7      p\        W#V,          &   V# )zDetermine codes from offsets and points, using the equality of the start and end points of
each line to determine if lines are closed or not.
r   Nr   axisr    )
r   r	   r!   r"   lenr   r   r   allr
   )r   r'   r$   end_offsetscloseds   &&   r   codes_from_offsets_and_pointsr0      sx     wfGGCKz:E E#2,"+/KVVF3B<(F,??aHF!*Ef
Lr   c                    V ^8  d   QhRRRR/# )r   r'   r(   r   r   r   )r   s   "r   r   r   /   s      n  r   c                    \        V 4       \        V 4      p\        P                  ! V\        \
        R7      p\        V^ &   \        P                  ! V ^ ,          V R,          8H  4      '       d
   \        VR&   V# )z}Determine codes for a single line, using the equality of the start and end points to
determine if the line is closed or not.
r   r    )	r	   r,   r!   r"   r   r   r   r-   r
   )r'   r#   r$   s   &  r   codes_from_pointsr3   /   sZ     fFAGGAvZ0EE!H	vvfQi6":%&&b	Lr   c                    V ^8  d   QhRRRR/# )r   list_of_codeslist[cpy.CodeArray]r   r   r   )r   s   "r   r   r   =   s     ; ; 3 ; ;r   c                `    V '       g   \        R4      h\        P                  ! V \        R7      # )zAConcatenate a list of codes arrays into a single code array.
    z!Empty list passed to concat_codesr   )
ValueErrorr!   concatenater   )r5   s   &r   concat_codesr:   =   s$     <==>>-z::r   c                    V ^8  d   QhRRRR/# )r   list_of_codes_or_nonezlist[cpy.CodeArray | None]r   zcpy.CodeArray | Noner   )r   s   "r   r   r   F   s      0J Oc r   c                b    V  Uu. uF
  qf   K  VNK  	  ppV'       d   \        V4      # R# u upi )zQConcatenate a list of codes arrays or None into a single code array or None.
    N)r:   )r<   r$   r5   s   &  r   concat_codes_or_noner>   F   s3     )>S(=uUU(=MSM**	 T   ,,c                    V ^8  d   QhRRRR/# r   list_of_offsetszlist[cpy.OffsetArray]r   r   r   )r   s   "r   r   r   P   s      $9 o r   c                8  a a S '       g   \        R4      h\        S 4      p\        P                  ! S  Uu. uF  q"R,          NK  	  up\        R7      o\        P
                  ! S ^ ,          .VV 3R l\        V^,
          4       4       O5\        R7      pV# u upi )zEConcatenate a list of offsets arrays into a single offset array.
    z#Empty list passed to concat_offsetsr   c              3  n   <"   T F*  pSV^,           ,          R,          SV,          ,           x  K,  	  R# 5i)r   r   Nr   ).0i
cumulativerB   s   & r   	<genexpr>!concat_offsets.<locals>.<genexpr>Y   s-     \Q[Aqs3B7*Q-GGQ[s   25r    )r8   r,   r!   cumsumr   r9   range)rB   r#   r   retrG   s   f   @r   concat_offsetsrM   P   s     >??OAGGBKKG|\J>>		]\QVWXYZWZQ[\]C J Hs   Bc                    V ^8  d   QhRRRR/# )r   list_of_offsets_or_nonezlist[cpy.OffsetArray | None]r   zcpy.OffsetArray | Noner   )r   s   "r   r   r   _   s     	 	9		r   c                b    V  Uu. uF
  qf   K  VNK  	  ppV'       d   \        V4      # R# u upi )zUConcatenate a list of offsets arrays or None into a single offset array or None.
    N)rM   )rO   r   rB   s   &  r   concat_offsets_or_nonerQ   _   s4    
 /F].E7ww.EO]o..	 ^r?   c                    V ^8  d   QhRRRR/# r   list_of_pointslist[cpy.PointArray]r   r(   r   )r   s   "r   r   r   k   s     = ="6 => =r   c                `    V '       g   \        R4      h\        P                  ! V \        R7      # )zBConcatenate a list of point arrays into a single point array.
    z"Empty list passed to concat_pointsr   )r8   r!   r9   r   )rT   s   &r   concat_pointsrW   k   s$     =>>>>.<<r   c                    V ^8  d   QhRRRR/# r   list_of_points_or_nonezlist[cpy.PointArray | None]r   zcpy.PointArray | Noner   )r   s   "r   r   r   t   s     	 	7		r   c                b    V  Uu. uF
  qf   K  VNK  	  ppV'       d   \        V4      # R# u upi )zRConcatenate a list of point arrays or None into a single point array or None.
    N)rW   rZ   r'   rT   s   &  r   concat_points_or_noner]   t   s4    
 ,BX+Aff+ANX^,,	 Yr?   c                    V ^8  d   QhRRRR/# rY   r   )r   s   "r   r   r      s     
 
7

r   c                b    V  Uu. uF
  qf   K  VNK  	  ppV'       d   \        V4      # R# u upi )znConcatenate a list of points or None into a single point array or None, with NaNs used to
separate each line.
N)concat_points_with_nanr\   s   &  r   concat_points_or_none_with_nanra      s4     ,BX+Aff+ANX%n55	 Yr?   c                    V ^8  d   QhRRRR/# rS   r   )r   s   "r   r   r      s     - -+? -N -r   c                "  a V '       g   \        R4      h\        V 4      ^8X  d
   V ^ ,          # \        P                  ! R\        P                  \
        R7      oV ^ ,          .\        \        V3R lV R,           4       !  4      Op \        V 4      # )zaConcatenate a list of points into a single point array with NaNs used to separate each line.
    z+Empty list passed to concat_points_with_nanr   c              3  ,   <"   T F	  pSV3x  K  	  R # 5i)Nr   )rE   x
nan_spacers   & r   rH   )concat_points_with_nan.<locals>.<genexpr>   s     'TASAQASs   r   )r   r   )	r8   r,   r!   r"   nanr   listr   rW   )rT   rf   s   &@r   r`   r`      s|     FGG
>aa  WWVRVV;?
(+ X'TPRAS'T UVX^,,r   c               $    V ^8  d   QhRRRRRR/# )r   r'   r(   r   r   r   r   )r   s   "r   r   r      s&     U U. U? U~ Ur   c                8   \        V 4       \        V4       \        V4      ^8:  d   V # \        P                  ! \        P
                  \        P
                  .\        R7      p\        P                  ! W^R P                  \        P                  4      V^ R7      # )zNInsert NaNs into a point array at locations specified by an offset array.
    r   r*   r    )
r	   r   r,   r!   arrayrh   r   insertastypeint64)r'   r   rf   s   && r   insert_nan_at_offsetsrp      sk     fw
7|qXXrvvrvv.kB
yy2!5!5bhh!?RSTTr   c                    V ^8  d   QhRRRR/# )r   r$   r   r   r   r   )r   s   "r   r   r      s     V Vm V Vr   c                    \        V 4       \        P                  ! \        P                  ! V \        8H  4      ^ ,          \        V 4      4      P                  \        4      # )zBDetermine offsets from codes using locations of MOVETO codes.
    )r   r!   appendnonzeror   r,   rn   r   )r$   s   &r   offsets_from_codesru      s>     U99RZZ03SZ@GGUUr   c                    V ^8  d   QhRRRR/# )r   rT   rU   r   r   r   )r   s   "r   r   r      s     W W)= W/ Wr   c           	         V '       g   \        R4      h\        P                  ! ^ .V  Uu. uF  p\        V4      NK  	  up,           \        R7      # u upi )z4Determine offsets from lengths of point arrays.
    z)Empty list passed to offsets_from_lengthsr   r8   r!   rJ   r,   r   )rT   lines   & r   offsets_from_lengthsrz      sA     DEE99aS.A.$CI.AAVVAs   A
c                    V ^8  d   QhRRRR/# )r   r5   r6   r   r   r   )r   s   "r   r   r      s     ) )4G )O )r   c           
         V '       g   \        R4      h\        P                  ! ^ .V  Uu. uF   p\        P                  ! V\        8H  4      NK"  	  up,           \
        R7      # u upi )zHDetermine outer offsets from codes using locations of MOVETO codes.
    z5Empty list passed to outer_offsets_from_list_of_codesr   )r8   r!   rJ   count_nonzeror   r   )r5   r$   s   & r    outer_offsets_from_list_of_codesr~      sQ     PQQ99aS=Y=%B,,Uf_==YY') )Ys   &A#
c                    V ^8  d   QhRRRR/# rA   r   )r   s   "r   r   r      s      ` `8M `Ra `r   c           	         V '       g   \        R4      h\        P                  ! ^ .V  Uu. uF  p\        V4      ^,
          NK  	  up,           \        R7      # u upi )z4Determine outer offsets from a list of offsets.
    z7Empty list passed to outer_offsets_from_list_of_offsetsr   rx   )rB   r   s   & r   "outer_offsets_from_list_of_offsetsr      sH     RSS99aS/J/wCLNN/JJR^__Js   A
c                    V ^8  d   QhRRRR/# )r   r'   r(   r   z&tuple[cpy.PointArray, cpy.OffsetArray]r   )r   s   "r   r   r      s      ~ *P r   c                   \        V 4       \        P                  ! \        P                  ! V R,          4      4      ^ ,          p\	        V4      ^ 8X  d*   V \        P
                  ! ^ \	        V 4      .\        R7      3# \        P                  ! W^ R7      p V\        P                  ! \	        V4      4      ,          p\        P                  ! \	        V4      ^,           \        R7      p^ V^ &   W^R% \	        V 4      VR&   W3# )z^Remove NaN from a points array, also return the offsets corresponding to the NaN removed.
    r   r*   :NNNr   r    )
r	   r!   rt   isnanr,   rl   r   deletearangeempty)r'   nan_offsetsr   s   &  r   
remove_nanr      s     f**RXXfTl34Q7K
;1rxxCK 0EEE6Q7ryy[!122#%88C,<Q,>l#S
#"&kr   c               $    V ^8  d   QhRRRRRR/# )r   r$   r   r   r   r   r6   r   )r   s   "r   r   r      s"     	 	- 	/ 	Na 	r   c                    \        V 4       \        V4       \        V4      ^8  d   \        P                  ! W^R 4      # V .# )z]Split a code array at locations specified by an offset array into a list of code arrays.
    r    )r   r   r,   r!   split)r$   r   s   &&r   split_codes_by_offsetsr      s<     Uw
7|axxq}--wr   c               $    V ^8  d   QhRRRRRR/# )r   r'   r(   r   r   r   rU   r   )r   s   "r   r   r      s&       r   c                    \        V 4       \        V4       \        V4      ^8  d   \        P                  ! W^R 4      # V .# )z_Split a point array at locations specified by an offset array into a list of point arrays.
    r    )r	   r   r,   r!   r   )r'   r   s   &&r   split_points_by_offsetsr      s<     fw
7|axx"..xr   c                    V ^8  d   QhRRRR/# )r   r'   r(   r   rU   r   )r   s   "r   r   r      s     
A 
A 
A3G 
Ar   c                R   \        V 4       \        P                  ! \        P                  ! V R,          4      4      ^ ,          p\	        V4      ^ 8X  d   V .# \        P
                  ! R.V\	        V 4      .34      p\        V4       UUu. uF  w  r#W^,           V NK  	  upp# u uppi )z>Split a points array at NaNs into a list of point arrays.
    r   r    )r	   r!   rt   r   r,   r9   r   )r'   r   ses   &   r   split_points_at_nanr      s     f**RXXfTl34Q7K
;1xnnrdK#f+%GH*2;*?@*?$!s1*?@@@s   	B#)+
__future__r   	itertoolsr   r   typingr   numpyr!   contourpy.typecheckr   r   r	   contourpy.typesr
   r   r   r   r   r   contourpy._contourpy
_contourpycpyr%   r0   r3   r:   r>   rM   rQ   rW   r]   ra   r`   rp   ru   rz   r~   r   r   r   r   r   r   r   r   <module>r      s    " %    W W \ \&	(;	=	
-UVW)`$	
Ar   