Files
intellecton/venv/lib/python3.12/site-packages/contourpy/__pycache__/array.cpython-312.pyc
T

78 lines
12 KiB
Plaintext
Raw Normal View History

Ë
†Rj#ãóHddlmZddlmZmZddlmZddlZddl m
Z
m Z m Z ddl
mZmZmZmZmZmZerddlmZddZ ddZdd „Zdd
Zdd Zd d Z d!d
Zd"dZ d#dZ d#dZ d"dZ!d$dZ"d%dZ#d&dZ$d'dZ%d dZ&d(dZ'd)dZ( d*dZ)d+dZ*y),é)Ú annotations)ÚchainÚpairwise)Ú
TYPE_CHECKINGN)Úcheck_code_arrayÚcheck_offset_arrayÚcheck_point_array)Ú CLOSEPOLYÚLINETOÚMOVETOÚ
code_dtypeÚ offset_dtypeÚ point_dtypecóœt|«|d}tj|tt¬«}t
||dd<t ||dddz
<|S)zSDetermine codes from offsets, assuming they all correspond to closed polygons.
éÿÿÿÿ©ÚdtypeNé)rÚnpÚfullr r
r r
)ÚoffsetsÚcodess úR/home/antigravity/intellecton/venv/lib/python3.12/site-packages/contourpy/array.pyÚcodes_from_offsetsrsPôà €AÜ G‰GA”v¤ZÔ 0€EÜ €Eˆ'#2ˆÜ&€Eˆ'!"ˆ+˜‰/ÑØ €Lócó
t|«t|«tjt |«t
t ¬«}t||dd<|dddz
}tj||dd||k(d¬«}t|||<|S)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.
rNrr©Úaxis)
rr rrÚlenr r
r Úallr
)rÚpointsrÚ end_offsetsÚcloseds rÚcodes_from_offsets_and_pointsr%sôÜä G‰G”C˜“K¤¬zÔ :€EÜ €Eˆ'#2ˆà˜!˜"+ /€KÜ
V‰VF˜7 3 B˜(¨F°;Ñ,?Ñ?ÀaÔ
H€FÜ!*€Eˆ+
Ñà €LrcóÒt|«t|«}tj|tt
¬«}t |d<tj|d|dk(«r t|d<|S)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.
rrr) r r rrr r
r r!r
)r"rrs rÚcodes_from_pointsr'/sWôä ˆF‹ €AÜ G‰GA”v¤ZÔ 0€EÜ€Eˆ! ‡vvˆfQ‰i˜6 "™:шˆb‰ Ø €LrcóR|s td«tj|t¬«S)zAConcatenate a list of codes arrays into a single code array.
z!Empty list passed to concat_codesr)Ú
ValueErrorrÚ concatenater
)Ú
list_of_codess rÚ concat_codesr,=s$ñ ÜÐ
>‰>˜-¬zÔ :rcóL|Dcgc]}|Œ|Œ }}|r t|«Sycc}w)zQConcatenate a list of codes arrays or None into a single code array or None.
N)r,)Úlist_of_codes_or_nonerr+s rÚconcat_codes_or_noner/Fs3ð)>ÖS˜ÑAR’UÐS€MÐܘMÓùò Tó!!có s td«t«}tjDcgc]}|dŒ c}t¬«Štj
dgˆˆfdt
|dz
«D«¢­t¬«}|Scc}w)zEConcatenate a list of offsets arrays into a single offset array.
z#Empty list passed to concat_offsetsrrrc3ó@K|]}|dzdd|zŒy­w)r)Ú.0Ú
cumulativeÚlist_of_offsetss €€rú <genexpr>z!concat_offsets.<locals>.<genexpr>Ys*øèø€Ò\ÈA˜¨q°©sÑ3°A°BÐ7¸*ÀQ¹-Õ\ùsƒr)r)r rÚcumsumrr*Úrange)r7rrÚretr6s` @rÚconcat_offsetsr<Ps~ù€ñ ÜÐ ˆOÓ€AܰÖG¨G˜G B›KÒGÌ|Ô\€JÜŸ>™>Ø ˜Ñ Ð\ÔQVÐWXÐYZÑWZÓQ[Ôô€Cð €Jùò Hs® BcóL|Dcgc]}|Œ|Œ }}|r t|«Sycc}w)zUConcatenate a list of offsets arrays or None into a single offset array or None.
N)r<)Úlist_of_offsets_or_nonerr7s rÚconcat_offsets_or_noner?_s4ð
/FÖ] ÑI\’wÐ]€OÐܘoÓùò ^r0cóR|s td«tj|t¬«S)zBConcatenate a list of point arrays into a single point array.
z"Empty list passed to concat_pointsr)r)rr*r)Úlist_of_pointss rÚ
concat_pointsrBks$ñ ÜÐ
>‰>˜.´ Ô <rcóL|Dcgc]}|Œ|Œ }}|r t|«Sycc}w)zRConcatenate a list of point arrays or None into a single point array or None.
N)rB©Úlist_of_points_or_noner"rAs rÚconcat_points_or_nonerFts4ð
,BÖX ÀVÑEW’fÐX€NÐܘùò Yr0cóL|Dcgc]}|Œ|Œ }}|r t|«Sycc}w)zvConcatenate a list of points or None into a single point array or None, with NaNs used to
separate each line.
N)Úconcat_points_with_nanrDs rÚconcat_points_or_none_with_nanrIs4ð ,BÖX ÀVÑEW’fÐX€NÐÜ% ùò Yr0c óô|s td«t|«dk(r|dStjdtjt
¬«Š|dgt
tˆfd|ddD«Ž«¢}t|«S)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_nanrr)rérc3ó&K|]}|fŒ
y­w)Nr3)r4Ú
nan_spacers €rr8z)concat_points_with_nan.<locals>.<genexpr>˜søèø€Ò'T¸°Q¬Ñ'TùsƒN) r)r rrÚnanrÚlistrrB)rArNs @rrHrHsø€ñ ÜÐ
ˆ>Ó˜aÒØ˜aÑ Ð ä—W‘W˜V¤R§V¡V´;Ô
ØÑXܤÓ'TÀÐPQÐPRÐASÔ'TÐ UÓXˆä˜,rcó2t|«t|«t|«dkr|Stjtj
tj
gt ¬«}tj||ddjtj«|d¬«S)zNInsert NaNs into a point array at locations specified by an offset array.
rKrrrrr)
r rr rÚarrayrOrÚinsertÚastypeÚint64)r"rrNs rÚinsert_nan_at_offsetsrVœsmôÜä
ˆ7ƒ|؈
ä—X‘XœrŸv™v¤r§v¡vÐ.´kÔ
äy‰y˜ ¨¨2 ×!5Ñ!5´b·h±hÓ!?ÀÐRSÔTrcó¶t|«tjtj|tk(«dt |««j
t«S)zBDetermine offsets from codes using locations of MOVETO codes.
r)rrÚappendÚnonzeror r rTr)rs rÚoffsets_from_codesrZªs>ôä
9‰9”R—Z‘Z ¬¡ÓÑ3´S¸³ZÓ Ó Urc ó’|s td«tjdg|Dcgc]
}t|«Œc}zt¬«Scc}w)z4Determine offsets from lengths of point arrays.
z)Empty list passed to offsets_from_lengthsrr©r)rr9r r)rAÚlines rÚoffsets_from_lengthsr^²s=ñ ÜÐ
9‰9aS°.ÖA¨$œC Ô VùÒAs£A
c
ó´|s td«tjdg|Dcgc]}tj|tk(«Œ c}zt
¬«Scc}w)zHDetermine outer offsets from codes using locations of MOVETO codes.
z5Empty list passed to outer_offsets_from_list_of_codesrr)r)rr9Ú
count_nonzeror r)r+rs rÚ outer_offsets_from_list_of_codesra»sMñ ÜÐ
9‰9aSÈ=ÖYÀ%œB×,¨U´f©_Õ )ùÒYs£#A
c ó˜|s td«tjdg|Dcgc]}t|«dz
Œc}zt¬«Scc}w)z4Determine outer offsets from a list of offsets.