Ë
    £èh2"  ã                  ó  — d dl mZ d dlmZmZmZ d dlZd dlZd dlm	Z	 d dl
mZ d dlmZmZmZ erd dlmZmZmZmZmZmZ  ej,                  d«      Z	 	 	 	 dd	„Z	 	 	 	 dd
„Z	 	 	 	 dd„Z	 	 	 	 	 	 	 	 dd„Zdd„Zdd„Zdd„Zy)é    )Úannotations)ÚTYPE_CHECKINGÚIterableÚUnionN)Úfactory)ÚVERTEXNAMES)ÚVec3Úbulge_to_arcÚOCS)Ú
LWPolylineÚPolylineÚLineÚArcÚFace3dÚPolymeshÚezdxfc              #  óv  K  — | j                  «       dk(  sJ ‚| j                  d«      }t        |«      dk  ry| j                  r|j	                  |d   «       t        || j                  j                  | j                  j                  dd«      | j                  «       | j                  ¬«      E d{  –—†  y7 Œ­w)zöYields '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     ú5lib/python3.12/site-packages/ezdxf/render/polyline.pyÚvirtual_lwpolyline_entitiesr(      sŸ   è ø€ ð ×ÑÓ <Ò/Ð/Ð/à×"Ñ" 5Ó)€FÜ
ˆ6ƒ{�Q‚Øà×ÒØ�‰�f˜Q‘iÔ ä)ØØ—.‘.×*Ñ*Ø—.‘.×$Ñ$ [°$Ó7Ø×0Ñ0Ó2Ø�N‰Nô÷ ò ús   ‚B/B9Â1B7Â2B9c                óè   — | j                  «       dk(  sJ ‚| j                  rt        | «      S | j                  rt	        | «      S | j
                  rt        | «      S | j                  rt        | «      S g S )züYields '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           	   #  ó˜  K  — | j                  «       dk(  sJ ‚| j                  sJ ‚t        | j                  «      dk  ry| j                  D �cg c]W  }|j                  j
                  j                  |j                  j
                  j                  |j                  j                  f‘ŒY }}| j                  r|j                  |d   «       t        |t        | j                  j                  dd«      «      j                  | j                  j                  dd«      | j                  «       | j                   ¬«      E d{  –—†  yc c}w 7 Œ
­w)	z÷Yields '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×CTÒCTóÙCT¸aˆ�‰�‰×	Ñ	˜1Ÿ5™5Ÿ>™>×+Ñ+¨Q¯U©U¯[©[Ò9ÐCTð ð ð ×ÒØ�‰�f˜Q‘iÔ ä)ØÜ�x—|‘|×'Ñ'¨°YÓ?Ó@×BÑBØ—,‘,×"Ñ" ;°Ó5Ø×.Ñ.Ó0Ø�L‰Lô÷ ñ ùòðús    ‚AE
ÁAEÂ)BE
Ä=EÄ>E
c              #  óT  K  — |rt        |«      n	t        «       }d }d}| D �]  \  }}	}
t        ||	|«      }|€|}|
}Œt        |«      }|dk7  r’t        |||«      \  }}}}|dkD  r½t        |j                  |j
                  |«      |d<   ||d<   t        j                  |«      |d<   t        j                  |«      |d<   |r||d<   t        j                  d||¬	«      –— nB|j                  |«      |d
<   |j                  |«      |d<   t        j                  d||¬	«      –— |}|
}�Œ y ­w)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   s4  è ø€ ñ &Œ#ˆiŒ.¬3«5€CØ"€JØ€Jä‰ˆˆ1ˆeÜ�Q˜˜9Ó%ˆØÐØˆJØˆJØä�zÓ"ˆØ˜ÒÜ5AØ˜E :ó6Ñ2ˆF�K ¨Fð ˜ŠzÜ$(¨¯©°6·8±8¸YÓ$G�˜Ñ!Ø$*�˜Ñ!Ü)-¯©°kÓ)B�˜Ñ&Ü'+§|¡|°IÓ'>�˜Ñ$ÙØ+4�G˜KÑ(Ü—k‘k¨%¸GÈÔMÓMà"Ÿz™z¨*Ó5ˆG�GÑØ ŸZ™Z¨Ó.ˆG�E‰NÜ—+‘+ f¸ÀcÔJÒJØˆ
ØŠ
ñ3 ùs   ‚D&D(c              #  óØ  K  — | j                  «       dk(  sJ ‚| j                  sJ ‚t        | j                  «      dk  ry| j                  }| j                  }| j                  «       }| j                  rdnd}t        |t        |«      dz
  «      D ]W  }||   j                  j                  |d<   ||dz      j                  j                  |d<   t        j                  d	||¬
«      –— ŒY y­w)zïYields '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   Néÿÿÿÿr   é   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Ü�uœc (›m¨aÑ/Ö0ˆØ& u™o×1Ñ1×:Ñ:ˆ
�7ÑØ$ U¨Q¡YÑ/×3Ñ3×<Ñ<ˆ
�5ÑÜ�k‰k &°ZÀSÔIÓIñ 1ùs   ‚C(C*c              #  óN  K  — | }|j                  «       dk(  sJ ‚|j                  sJ ‚|j                  }|j                  «       }|j	                  «       }|j
                  j                  }|j
                  j                  }|t        |j                   «      z
  }|t        |j                   «      z
  }t        |«      D ]d  }	t        |«      D ]T  }
|	dz   |z  }|
dz   |z  }||	|
f   |d<   |||
f   |d<   |||f   |d<   ||	|f   |d<   t        j                  d||¬«      –— ŒV Œf y	­w)
zîYields '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Ø�l‰l×"Ñ"€GØ�l‰l×"Ñ"€GØœ × 4Ñ 4Ð4Ó5Ñ5€GØœ × 4Ñ 4Ð4Ó5Ñ5€Gä�7Ž^ˆÜ�w–ˆAØ˜!‘e˜wÑ&ˆFØ˜!‘e˜wÑ&ˆFà!% a¨ d¡ˆJ�vÑØ!% f¨a i¡ˆJ�vÑØ!% f¨f nÑ!5ˆJ�vÑØ!% a¨ i¡ˆJ�vÑÜ—+‘+ h¸:È3ÔOÓOñ  ñ ùs   ‚D#D%c           
   #  óö  ‡K  — | j                  «       dk(  sJ ‚| j                  sJ ‚| j                  }| j                  }| j	                  «       }d„ |D «       }|D �]  Št
        dd D ]`  }‰j                  j                  |«      rŒt        j                  dt        ‰«      › dt        | j                  j                  «      › d�«       Œb t        |«      }|j                  ‰j	                  «       «       d}d	}ˆfd
„t
        D «       }	|	D ]>  \  }
}|
dk  rt        |
«      }
||z  }||
d	z
     j                  j                  ||<   |d	z  }Œ@ d|vr|d   |d<   ||d<   t!        j"                  d||¬«      –— �Œ y­w)zîYields '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  ó:   K  — | ]  }|j                   sŒ|–— Œ y ­w©N)Úis_face_record)Ú.0r>   s     r'   Ú	<genexpr>z,virtual_polyface_entities.<locals>.<genexpr>Ð   s   è ø€ Ð<™x˜!¨1×+;Ó+;”A™xùs   ‚”NrT   zskipped face z+ with less than 3 verticesin PolyFaceMesh(#Ú)r   rU   c              3  ó�   •K  — | ]=  }‰j                   j                  |«      sŒ‰j                   j                  |«      |f–— Œ? y ­wrn   )r#   Úhasattrr$   )rp   ÚnameÚfaces     €r'   rq   z,virtual_polyface_entities.<locals>.<genexpr>â   s9   øè ø€ ð 
Ù3>¨4À$Ç(Á(×BRÑBRÐSWÕBXˆT�X‰X�\‰\˜$Ó Ô&±;ùs
   ƒ A¤"Ar\   r[   Ú	invisibler]   rE   )r   r1   r   r7   r%   r   r#   rt   ÚloggerÚinfoÚstrÚhandlerI   ÚupdateÚabsr8   r   rL   )r3   r   r7   Úbase_attribsÚface_recordsru   Úface3d_attribsrw   ÚposÚindicesrW   rv   s              @r'   r2   r2   À   s�  øè ø€ ð ×ÑÓ Ò+Ð+Ð+Ø×%Ò%Ð%Ð%à
�,‰,€CØ× Ñ €HØ×.Ñ.Ó0€Lá<™xÓ<€LÜˆä  Ó$ˆDØ—8‘8×#Ñ# DÕ)Ü—‘Ø#¤C¨£I ;ð /(Ü(+¨H¯L©L×,?Ñ,?Ó(@Ð'AÀðDôð ð %ô ˜lÓ+ˆØ×Ñ˜d×5Ñ5Ó7Ô8Øˆ	Øˆó
Ý3>ó
ˆó #‰KˆE�4à�qŠyÜ˜E›
�Ø˜SÑ �	à#+¨E°A©IÑ#6×#:Ñ#:×#CÑ#CˆN˜4Ñ à�A‰I‰Cð #ð ˜Ñ'ð &4°FÑ%;ˆN˜6Ñ"à&/ˆ�{Ñ#Ü�k‰k (°~È3ÔOÔOñI ùs   ƒBE9ÂC3E9)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   Ú	getLoggerrx   r(   r4   r,   r"   r.   r0   r2   © r5   r'   Ú<module>rŽ      sµ   ðõ #ß 1Ñ 1Û Û å "Ý )ß .Ñ .áßP×Pà	ˆ×	Ñ	˜7Ó	#€ðØðàóð:Øðà'óð.Øðàóð> Øð Ø)-ð Ø;?ð àó óFJó.PôB5Pr5   