
    h=!                        S SK Jr  S SKJrJrJr  S SKrS SKrS SKJ	r	  S SK
Jr  S SKJrJrJr  \(       a  S SKJrJrJrJrJrJr  \R,                  " S5      r    SS	 jr    SS
 jr    SS jr        SS jrSS jrSS jrSS jrg)    )annotations)TYPE_CHECKINGIterableUnionN)factory)VERTEXNAMES)Vec3bulge_to_arcOCS)
LWPolylinePolylineLineArcFace3dPolymeshezdxfc              #  ~  #    U R                  5       S:X  d   eU R                  S5      n[        U5      S:  a  gU R                  (       a  UR	                  US   5        [        UU R                  R                  U R                  R                  SS5      U R                  5       U R                  S9 Sh  vN   g N7f)zYields 'virtual' entities of LWPOLYLINE as LINE or ARC objects.

These entities are located at the original positions, but are not stored in
the entity database, have no handle and are not assigned to any layout.

(internal API)


LWPOLYLINExyb   Nr   	extrusionpoints	elevationr   
dxfattribsdoc)dxftype
get_pointslenclosedappend_virtual_polyline_entitiesdxfr   getgraphic_propertiesr   )
lwpolyliner   s     G/var/www/html/env/lib/python3.13/site-packages/ezdxf/render/polyline.pyvirtual_lwpolyline_entitiesr(      s      <///""5)F
6{QfQi )..**..$$[$7002NN  s   B3B=5B;6B=c                   U R                  5       S:X  d   eU R                  (       a  [        U 5      $ U R                  (       a  [	        U 5      $ U R
                  (       a  [        U 5      $ U R                  (       a  [        U 5      $ / $ )zYields 'virtual' entities of POLYLINE as LINE, ARC or 3DFACE objects.

These entities are located at the original positions, but are not stored in
the entity database, have no handle and are not assigned to any layout.

(internal API)

POLYLINE)	r   is_2d_polylinevirtual_polyline2d_entitiesis_3d_polylinevirtual_polyline3d_entitiesis_polygon_meshvirtual_polymesh_entitiesis_poly_face_meshvirtual_polyface_entities)polylines    r'   virtual_polyline_entitiesr4   /   sp     +++*844		 	 *844		!	!(22		#	#(22I    c           	   #    #    U R                  5       S:X  d   eU R                  (       d   e[        U R                  5      S:  a  gU R                   Vs/ s HW  oR                  R
                  R                  UR                  R
                  R                  UR                  R                  4PMY     nnU R                  (       a  UR                  US   5        [        U[        U R                  R                  SS5      5      R                  U R                  R                  SS5      U R                  5       U R                   S9 Sh  vN   gs  snf  N
7f)	zYields 'virtual' entities of 2D POLYLINE as LINE or ARC objects.

These entities are located at the original positions, but are not stored in
the entity database, have no handle and are not assigned to any layout.

(internal API)

r*   r   Nr   r   )r   r   r   r   r   )r   r+   r   verticesr#   locationxybulge	is_closedr!   r"   r	   r$   zr%   r   )r3   vr   s      r'   r,   r,   F   s     +++""""
8! DLCTCTCTa		155>>++QUU[[9CT   fQi )x||''Y?@BB,,"";5..0LL  s    AEAE2BEE	Ec              #  b  #    U(       a  [        U5      O	[        5       nS nSnU  GH  u  pn
[        XU5      nUc  UnU
nM  [        U5      nUS:w  a  [        XkU5      u  pnnUS:  a}  [        UR                  UR
                  U5      US'   UUS'   [        R                  " U5      US'   [        R                  " U5      US'   U(       a  X,S'   [        R                  " SXS	9v   O?UR                  U5      US
'   UR                  U5      US'   [        R                  " SXS	9v   UnU
nGM     g 7f)Ng        r   centerradiusstart_angle	end_angler   ARCr   r   r   startendLINE)r   r	   dictr
   r9   r:   mathdegreesr   newto_wcs)r   r   r   r   r   ocs
prev_point
prev_bulger9   r:   r;   pointattribsr@   rB   rC   rA   s                    r'   r"   r"   e   s&     &#i.35C"JJeQ9%JJz"5A:62FF z$(688Y$G!$*!)-k)B&'+||I'>$+4K(kk%GMM"zz*5GG ZZ.GEN++fJJ

3 s   D-D/c              #    #    U R                  5       S:X  d   eU R                  (       d   e[        U R                  5      S:  a  gU R                  nU R                  nU R                  5       nU R                  (       a  SOSn[        U[        U5      S-
  5       HS  nX%   R                  R                  US'   X%S-      R                  R                  US'   [        R                  " S	X1S
9v   MU     g7f)zYields 'virtual' entities of 3D POLYLINE as LINE objects.

This entities are located at the original positions, but are not stored in
the entity database, have no handle and are not assigned to any layout.

(internal API)

r*   r   Nr      rF   rG   rH   rE   )r   r-   r   r7   r   r%   r<   ranger#   r8   r   rL   )r3   r   r7   r   rF   indexs         r'   r.   r.      s      +++""""
8!
,,C  H,,.J$$B!Euc(ma/0&o11::
7$QY/33<<
5kk&ZII 1s   C1C3c              #  d  #    U nUR                  5       S:X  d   eUR                  (       d   eUR                  nUR                  5       nUR	                  5       nUR
                  R                  nUR
                  R                  nU[        UR                  (       + 5      -
  nU[        UR                  (       + 5      -
  n[        U5       H`  n	[        U5       HN  n
U	S-   U-  nU
S-   U-  nX9U
4   US'   X;U
4   US'   X;U4   US'   X9U4   US'   [        R                  " SXBS9v   MP     Mb     g	7f)
zYields 'virtual' entities of POLYMESH as 3DFACE objects.

This entities are located at the original positions, but are not stored in
the entity database, have no handle and are not assigned to any layout.

(internal API)

r*   rU   vtx0vtx1vtx2vtx33DFACErE   N)r   r/   r   get_mesh_vertex_cacher%   r#   m_countn_countintis_m_closedis_n_closedrV   r   rL   )r3   polymeshr   meshr   r_   r`   m_rangen_rangemnnext_mnext_ns                r'   r0   r0      s/     $H+++####
,,C))+D,,.Jll""Gll""G 4 4455G 4 4455G7^wA!ew&F!ew&F!%dJv!%aiJv!%fn!5Jv!%iJv++h:OO   s   D.D0c           
   #    ^#    U R                  5       S:X  d   eU R                  (       d   eU R                  nU R                  nU R	                  5       nS U 5       nU GH!  m[
        SS  Hg  nTR                  R                  U5      (       a  M%  [        R                  S[        T5       S[        U R                  R                  5       S35        Mi     [        U5      nUR                  TR	                  5       5        SnS	nU4S
 j[
         5       n	U	 H<  u  pU
S:  a  [        U
5      n
Xx-  nX*S	-
     R                  R                  Xe'   US	-  nM>     SU;  a  US   US'   XvS'   [         R"                  " SXaS9v   GM$     g7f)zYields 'virtual' entities of POLYFACE as 3DFACE objects.

This entities are located at the original positions, but are not stored in
the entity database, have no handle and are not assigned to any layout.

(internal API)

r*   c              3  J   #    U  H  oR                   (       d  M  Uv   M     g 7fN)is_face_record).0r>   s     r'   	<genexpr>,virtual_polyface_entities.<locals>.<genexpr>   s     <x!+;+;AAxs   #	#NrT   zskipped face z+ with less than 3 verticesin PolyFaceMesh(#)r   rU   c              3     >#    U  HD  nTR                   R                  U5      (       d  M%  TR                   R                  U5      U4v   MF     g 7frn   )r#   hasattrr$   )rp   namefaces     r'   rq   rr      s;      
3>4$((BRBRSWBX&TXX\\$&;s
   $A$Ar\   r[   	invisibler]   rE   )r   r1   r   r7   r%   r   r#   ru   loggerinfostrhandlerI   updateabsr8   r   rL   )r3   r   r7   base_attribsface_recordsrv   face3d_attribsrx   posindicesrW   rw   s              @r'   r2   r2      s     +++%%%%
,,C  H..0L<x<L$D88##D))#CI; /((+HLL,?,?(@'AD  % l+d5578	
3>
 #KEqyE
 	#+AI#6#:#:#C#CN AIC # ' &4F%;N6"&/{#kk(~OOI s   BFC5F)r&   r   returnIterable[Union[Line, Arc]])r3   r   r   z"Iterable[Union[Line, Arc, Face3d]])r3   r   r   r   )r   floatr   r	   r   rI   r   r   )r3   r   r   zIterable[Line])r3   r   r   zIterable[Face3d])
__future__r   typingr   r   r   loggingrJ   ezdxf.entitiesr   ezdxf.lldxf.constr   
ezdxf.mathr	   r
   r   r   r   r   r   r   r   	getLoggerry   r(   r4   r,   r"   r.   r0   r2    r5   r'   <module>r      s    # 1 1   " ) . .PP			7	#:'.>  )- ;?  FJ.PB5Pr5   