
    'jfe                    X   d dl mZ d dlmZmZmZmZmZmZm	Z	m
Z
 d dlmZ d dlmZ d dlmZ d dlmZ d dlmZ ee         Z eed	          Zd
ddddddddddddZddddddZ G d d          Ze	 	 d;d<d)            Z G d* d+          Z	 d=d>d2Zd?d@d5ZdAd8Z  e!d9          Z"d:Z#d,S )B    )annotations)TextIOBinaryIOUnionSequenceIterablecastIteratorOptional)contextmanager)partial)StringIO)Path)BinaryTagWriter   )ndigitsr   r   )   r   )   r   )r   r   )r   r   )r   r   )r   r   )r   r   )r   r   )r      )r   r   )r   r   )LEFTCENTERRIGHTBOTTOM_LEFTBOTTOM_CENTERBOTTOM_RIGHTMIDDLE_LEFTMIDDLE_CENTERMIDDLE_RIGHTTOP_LEFT
TOP_CENTER	TOP_RIGHT
      (   )   *   )xysebc                      e Zd Zd
dZddZd	S )BinaryDXFWriterstreamr   c                    || _         t          | j         ddd          | _        | j                                         d S )NAC1009Fcp1252)
dxfversionwrite_handlesencoding)_streamr   
_tagwriterwrite_signature)selfr/   s     P/DATA/AppData/hermes/venv/lib/python3.11/site-packages/ezdxf/addons/r12writer.py__init__zBinaryDXFWriter.__init__.   sI    )L	
 
 
 	'')))))    r*   strreturnNonec                :    | j                             |           d S N)r7   	write_str)r9   r*   s     r:   writezBinaryDXFWriter.write8   s    !!!$$$$$r<   N)r/   r   )r*   r=   r>   r?   )__name__
__module____qualname__r;   rC    r<   r:   r.   r.   -   s<        * * * *% % % % % %r<   r.   Fascr/   "Union[TextIO, BinaryIO, str, Path]fixed_tablesboolfmtr=   r>   Iterator[R12FastStreamWriter]c           	   #    K   d}|                     d          r1t          | t          t          f          rt	          | dd          }|} n|                     d          rt          | t          t          f          r3t	          | d          }t          t          t          |                    } nIt          t          t          t          t          |                               } nt          d| d	          t          t          t          |           |          }	 |V  |                                 |r|                                 dS dS # |                                 |r|                                 w w xY w)
a=  Context manager for writing DXF entities to a stream/file. `stream` can
    be any file like object with a :func:`write` method or just a string for
    writing DXF entities to the file system. If `fixed_tables` is ``True``, a
    standard TABLES section is written in front of the ENTITIES
    section and some predefined text styles and line types can be used.

    Set argument `fmt` to "asc" to write ASCII DXF file (default) or "bin" to
    write Binary DXF files. ASCII DXF require a :class:`TextIO` stream and
    Binary DXF require a :class:`BinaryIO` stream.

    NrH   wtr2   )r5   binwbzUnknown format 'z'.)
startswith
isinstancer=   r   openr	   r   r.   r   
ValueErrorR12FastStreamWriterclose)r/   rJ   rL   r6   writers        r:   	r12writerrY   <   si     " .2G
~~e 5fsDk** 	64(;;;GF			 5fsDk** 	K64((G&/'":":;;FF&/$x2H2H"I"IJJFF 3C333444 ff!5!5|DDF 	MMOOOOO	 	 	 	MMOOOO	s   E -E;c                      e Zd ZdZdFdGdZdHdZ	 	 	 dIdJdZ	 	 	 dIdKdZ	 	 	 	 	 dLdMdZ	 	 	 dIdNdZ		 	 	 	 dOdPd"Z
	 	 	 dIdQd#ZdRd&Z	 	 	 	 dSdTd)Z	 	 	 	 	 	 	 dUdVd0Z	 	 	 dIdWd3Z	 	 	 	 dXdYd7Z	 	 	 	 	 	 	 	 	 dZd[dEZd
S )\rV   aU  Fast stream writer to create simple DXF R12 drawings.

    Args:
        stream: a file like object with a :func:`write` method.
        fixed_tables: if `fixed_tables` is ``True``, a standard TABLES section
            is written in front of the ENTITIES section and some predefined text
            styles and line types can be used.

    Fr/   r   c                v    || _         |r|                    t                     |                    d           d S )Nz0
SECTION
2
ENTITIES
)r/   rC   PREFACE)r9   r/   rJ   s      r:   r;   zR12FastStreamWriter.__init__p   s<     	"LL!!!011111r<   r>   r?   c                :    | j                             d           dS )zmWrites the DXF tail. Call is not necessary when using the context
        manager :func:`r12writer`.
        z0
ENDSEC
0
EOF
Nr/   rC   )r9   s    r:   rW   zR12FastStreamWriter.closev   s!     	/00000r<   0NstartVertexendlayerr=   colorOptional[int]linetypeOptional[str]c                >   dg}|                     t          |||                     |                     t          |d                     |                     t          |d                     | j                            d                    |                     dS )aV  Add a LINE entity from `start` to `end`.

        Args:
            start: start vertex as ``(x, y[, z])`` tuple
            end: end vertex as  as ``(x, y[, z])`` tuple
            layer: layer name as string, without a layer definition the assigned
                color = ``7`` (black/white) and line type is ``'Continuous'``.
            color: color as :ref:`ACI` in the range from ``0`` to ``256``,
                ``0`` is `ByBlock` and ``256`` is `ByLayer`, default is `ByLayer`
                which is always color = ``7`` (black/white) without a layer
                definition.
            linetype: line type as string, if FIXED-TABLES are written some
                predefined line types are available, else line type is always
                `ByLayer`, which is always ``'Continuous'`` without a LAYERS
                table.

        z0
LINE
r#   code    Nappenddxf_attribs
dxf_vertexr/   rC   join)r9   r`   rb   rc   rd   rf   dxfs          r:   add_linezR12FastStreamWriter.add_line|   s    2 m

;ueX66777

:e"---...

:c+++,,,"''#,,'''''r<   centerradiusfloatc           
     l   dg}|                     t          |||                     |                     t          |                     |                     t          dt	          t          |                                         | j                            d                    |                     dS )aL  Add a CIRCLE entity.

        Args:
            center: circle center point as ``(x, y)`` tuple
            radius: circle radius as float
            layer: layer name as string see :meth:`add_line`
            color: color as :ref:`ACI` see :meth:`add_line`
            linetype: line type as string see :meth:`add_line`

        z	0
CIRCLE
r%   rl   N	rn   ro   rp   dxf_tagr=   rndr/   rC   rq   )r9   rt   ru   rc   rd   rf   rr   s          r:   
add_circlezR12FastStreamWriter.add_circle   s    $ o

;ueX66777

:f%%&&&

72s3v;;//00111"''#,,'''''r<   r   h  c           
     `   dg}|                     t          |||                     |                     t          |                     |                     t          dt	          t          |                                         |                     t          dt	          t          |                                         |                     t          dt	          t          |                                         | j                            d                    |                     dS )a  Add an ARC entity. The arc goes counter-clockwise from `start` angle
        to `end` angle.

        Args:
            center: arc center point as ``(x, y)`` tuple
            radius: arc radius as float
            start: arc start angle in degrees as float
            end: arc end angle in degrees as float
            layer: layer name as string see :meth:`add_line`
            color: color as :ref:`ACI` see :meth:`add_line`
            linetype: line type as string see :meth:`add_line`

        z0
ARC
r%   2   3   rl   Nrx   )	r9   rt   ru   r`   rb   rc   rd   rf   rr   s	            r:   add_arczR12FastStreamWriter.add_arc   s    . l

;ueX66777

:f%%&&&

72s3v;;//00111

72s3u:://000

72s3s88}}--..."''#,,'''''r<   locationc                    dg}|                     t          |||                     |                     t          |                     | j                            d                    |                     dS )a+  
        Add a POINT entity.

        Args:
            location: point location as ``(x, y [,z])`` tuple
            layer: layer name as string see :meth:`add_line`
            color: color as :ref:`ACI` see :meth:`add_line`
            linetype: line type as string see :meth:`add_line`

        z0
POINT
rl   Nrm   )r9   r   rc   rd   rf   rr   s         r:   	add_pointzR12FastStreamWriter.add_point   si    " n

;ueX66777

:h''((("''#,,'''''r<   verticesIterable[Vertex]	invisibleintc                :    |                      d|||||           dS )a  Add a 3DFACE entity. 3DFACE is a spatial area with 3 or 4 vertices,
        all vertices have to be in the same plane.

        Args:
            vertices: iterable of 3 or 4 ``(x, y, z)`` vertices.
            invisible: bit coded flag to define the invisible edges,

                1. edge = 1
                2. edge = 2
                3. edge = 4
                4. edge = 8

                Add edge values to set multiple edges invisible,
                1. edge + 3. edge = 1 + 4 = 5, all edges = 15

            layer: layer name as string see :meth:`add_line`
            color: color as :ref:`ACI` see :meth:`add_line`
            linetype: line type as string see :meth:`add_line`

        3DFACEN_add_quadrilateral)r9   r   r   rc   rd   rf   s         r:   
add_3dfacezR12FastStreamWriter.add_3dface   s3    8 	h	5%	
 	
 	
 	
 	
r<   c                :    |                      d|d|||           dS )a  Add a SOLID entity. SOLID is a solid filled area with 3 or 4 edges
        and SOLID is a 2D entity.

        Args:
            vertices: iterable of 3 or 4 ``(x, y[, z])`` tuples, z-axis will be
                ignored.
            layer: layer name as string see :meth:`add_line`
            color: color as :ref:`ACI` see :meth:`add_line`
            linetype: line type as string see :meth:`add_line`

        SOLIDr   Nr   )r9   r   rc   rd   rf   s        r:   	add_solidzR12FastStreamWriter.add_solid  s(    $ 	1eUHMMMMMr<   dxftypeflagsc                8   d|z  g}|                     t          |||                     t          |          }t          |          dk     rt	          d|z            t          |          dk    r|                     |d                    |                    d t          |d          D                        |r0|                     t          dt          |                               | j	        
                    d	                    |                     d S )
Nz0
%s
r   z%s needs 3 or 4 vertices.c              3  <   K   | ]\  }}t          ||          V  d S rA   )rp   ).0rj   vertexs      r:   	<genexpr>z9R12FastStreamWriter._add_quadrilateral.<locals>.<genexpr>,  sD       
 
f vt$$
 
 
 
 
 
r<   r#   )r`   F   rl   )rn   ro   listlenrU   extend	enumeratery   r=   r/   rC   rq   )r9   r   r   r   rc   rd   rf   rr   s           r:   r   z&R12FastStreamWriter._add_quadrilateral  s    7"#

;ueX66777>>x==187BCCC]]aOOHRL)))

 
 
 )(" = = =
 
 
 	
 	
 	
  	0JJwr3u::..///"''#,,'''''r<   closedrK   c           	        dg}|                     t          |||                     |                     t          dd                     |                     t          ddt          |          z                        | j                            d                    |                     dt          |          z   t          dd          z   }|D ]}| j                            |           t          |          }t          |          }	|	d	k     rt          d
          |	d	k    r|d         |d         df}| j                            t          |dd                              | j                            d           dS )a  Add a 3D POLYLINE entity.

        Args:
            vertices: iterable of ``(x, y[, z])`` tuples, z-axis is ``0`` by
                default
            closed: ``True`` creates a closed polyline
            layer: layer name as string see :meth:`add_line`
            color: color as :ref:`ACI` see :meth:`add_line`
            linetype: line type as string see :meth:`add_line`

        0
POLYLINE
B   r   r      rl   	0
VERTEX
    r   z,Vertices require at least a x- and a y-axis.r   Nr   	0
SEQEND
)rn   ro   ry   r   r/   rC   rq   tupler   rU   rp   )
r9   r   r   rc   rd   rf   rr   vertex_templater   
len_vertexs
             r:   add_polylinez R12FastStreamWriter.add_polyline4  s^   & 

;ueX66777

72q>>"""

72q3v;;//000"''#,,''''+e*<*<<wr2N 	6 	6FKo...6]]FVJA~~ !OPPPq )VAY2Kj445555-(((((r<   xypointsIterable[Sequence]formatstart_width	end_widthc	                v   dfd}	dg}
|
                     t          |||                     |
                     t          dd                     |
                     t          d	t          |                               |r#|
                     t          d
|                     |r#|
                     t          d|                     | j                            d                    |
                     dt          |          z   t          d	d          z   }|D ]}| j                            |            |	|          }D ]V}|                    |d          }|dk    r|dv r#| j                            t          t          |         |                     W| j                            d           dS )a  Add a 2D POLYLINE entity with start width, end width and bulge value
        support.

        Format codes:

        === =================================
        x   x-coordinate
        y   y-coordinate
        s   start width
        e   end width
        b   bulge value
        v   (x, y) tuple (z-axis is ignored)
        === =================================

        Args:
            points: iterable of (x, y, [start_width, [end_width, [bulge]]])
                tuple, value order according to the `format` string, unset
                values default to ``0``
            format: format: format string, default is ``'xy'``
            closed: ``True`` creates a closed polyline
            start_width: default start width, default is ``0``
            end_width: default end width, default is ``0``
            layer: layer name as string see :meth:`add_line`
            color: color as :ref:`ACI` see :meth:`add_line`
            linetype: line type as string see :meth:`add_line`

        datar   r>   dictc                    t                      }t          |           D ]6\  }}|dk    r&t          |          }|d         |d<   |d         |d<   1|||<   7|S )Nvr   r(   r   r)   )r   zipr   )r   attribsrj   valuer   r   s        r:   vertex_attribsz;R12FastStreamWriter.add_polyline_2d.<locals>.vertex_attribs  si    ffG"6400 * *e3;;$U||H#+A;GCL#+A;GCLL$)GDMMNr<   r   r   r   r   r%   r&   rl   r   r   sebr   N)r   r   r>   r   )	rn   ro   ry   r   r/   rC   rq   getVERTEX_GROUP_CODES)r9   r   r   r   r   r   rc   rd   rf   r   rr   r   pointr   format_coder   s     `             r:   add_polyline_2dz#R12FastStreamWriter.add_polyline_2dY  s   N		 		 		 		 		 		 

;ueX66777

72q>>"""

72s6{{++,,, 	1JJwr;//000 	/JJwr9--..."''#,,''''+e*<*<<wr1~~M 		 		EKo...$nU++G%  K33A::+"6"6!!.{;UCC   	 	-(((((r<   facesIterable[Sequence[int]]c                4    dd fd}ddfd}ddfd
} |            \  }	 |            \  }
 |              j                             |	            j                             |
            j                             d           dS )a  Add a POLYFACE entity. The POLYFACE entity supports only faces of
        maximum 4 vertices, more indices will be ignored. A simple square would
        be::

            v0 = (0, 0, 0)
            v1 = (1, 0, 0)
            v2 = (1, 1, 0)
            v3 = (0, 1, 0)
            dxf.add_polyface(vertices=[v0, v1, v2, v3], faces=[(0, 1, 2, 3)])

        All 3D form functions of the :mod:`ezdxf.render.forms` module return
        :class:`~ezdxf.render.MeshBuilder` objects, which provide the required
        vertex and face lists.

        See sphere example: https://github.com/mozman/ezdxf/blob/master/examples/r12writer.py

        Args:
            vertices: iterable of ``(x, y, z)`` tuples
            faces: iterable of 3 or 4 vertex indices, indices have to be 0-based
            layer: layer name as string see :meth:`add_line`
            color: color as :ref:`ACI` see :meth:`add_line`
            linetype: line type as string see :meth:`add_line`

        @   r   r   r>   r?   c                   dg}|                     t                               |                     t          dd                     |                     t          d|                      |                     t          d                     |                     t          d                     j                            d                    |                     d S )Nr   r   r   r   G   H   rl   rn   ro   ry   r/   rC   rq   )r   rr   rd   
face_countrc   rf   r9   vertex_counts     r:   write_polylinez8R12FastStreamWriter.add_polyface.<locals>.write_polyline  s    "#CJJ{5%::;;;JJwr1~~&&&JJwr5))***JJwr<00111JJwr:..///Kbggcll+++++r<      c                D   t                      }d}dt                    z   t          d|           z   }D ]>}|dz  }|                    |           |                    t	          |                     ?|                                }|                                 ||fS Nr   r   r   r   )r   ro   ry   rC   rp   getvaluerW   )r   bufcountr*   r   rc   r   s        r:   write_verticesz8R12FastStreamWriter.add_polyface.<locals>.write_vertices  s    **CEE 2 22WR5G5GGA" . .
		!		*V,,----AIIKKK!8Or<      c           	        t                      }d}dt          	          z   t          d|           z   t          d          z   }D ]X}|dz  }|                    |           t          d|          D ]+\  }}|                    t          ||dz                        ,Y|                                }|                                 ||fS )Nr   r   r   )r   r   r   r   )r   r   I   J   )r   ro   ry   rp   rC   r   r   rW   )
r   r   r   r*   facerj   indexrd   r   rc   s
          r:   write_facesz5R12FastStreamWriter.add_polyface.<locals>.write_faces  s    **CEeU++,"e$$% Y''(   8 8
		!#&'7#>#> 8 8KD%IIgdEAI6677778AIIKKK!8Or<   r   Nr   r   r   r>   r?   )r   )r   r   )r   r^   )r9   r   r   rc   rd   rf   r   r   r   
vertex_strface_strr   r   s   ``````     @@r:   add_polyfacez R12FastStreamWriter.add_polyface  s   B	, 	, 	, 	, 	, 	, 	, 	, 	, 	, 	, 	,
	 
	 
	 
	 
	 
	 
	 
		 	 	 	 	 	 	 	 	$ $2>#3#3 j*{}}
H*%%%(###-(((((r<   FFsizetuple[int, int]c           
         
 |\  
|\  dd
 fd}dd fd} |              |            }	
z  |	k    rt          d	           j                            d
           dS )ao  Add a POLYMESH entity. A POLYMESH is a mesh of m rows and n columns,
        each mesh vertex has its own x-, y- and z coordinates. The mesh can be
        closed in m- and/or n-direction. The vertices have to be in column
        order:  (m0, n0), (m0, n1), (m0, n2), (m1, n0), (m1, n1), (m1, n2), ...

        See example: https://github.com/mozman/ezdxf/blob/master/examples/r12writer.py

        Args:
            vertices: iterable of ``(x, y, z)`` tuples, in column order
            size: mesh dimension as (m, n)-tuple, requirement:
                ``len(vertices) == m*n``
            closed: (m_closed, n_closed) tuple, for closed mesh in m and/or n
                direction
            layer: layer name as string see :meth:`add_line`
            color: color as :ref:`ACI` see :meth:`add_line`
            linetype: line type as string see :meth:`add_line`

           r   r   r>   r?   c                   r| dz  } r| dz  } dg}|                     t                               |                     t          dd                     |                     t          d|                      |                     t          d                     |                     t          d                     	j                            d                    |                     d S )	Nr   r   r   r   r   r   r   rl   r   )
r   rr   rd   rc   rf   mm_closednn_closedr9   s
     r:   r   z8R12FastStreamWriter.add_polymesh.<locals>.write_polyline  s     
 "#CJJ{5%::;;;JJwr1~~&&&JJwr5))***JJwr1~~&&&JJwr1~~&&&Kbggcll+++++r<   r   c                    d}dt                    z   t          d|           z   }D ]H}|dz  }j                            |           j                            t	          |                     I|S r   )ro   ry   r/   rC   rp   )r   r   r*   r   rc   r9   r   s       r:   r   z8R12FastStreamWriter.add_polymesh.<locals>.write_vertices  s}    EE 2 22WR5G5GGA" 6 6
!!!$$$!!*V"4"45555Lr<   zInvalid mesh dimensions.r   N)r   r   r   )r   r   r>   r   )rU   r/   rC   )r9   r   r   r   rc   rd   rf   r   r   r   r   r   r   r   s   ``  ```   @@@@r:   add_polymeshz R12FastStreamWriter.add_polymesh  s    6 1#(	, 	, 	, 	, 	, 	, 	, 	, 	, 	, 	, 	, 	, 	,	 	 	 	 	 	 	 	 	 	  q5E>>7888-(((((r<   r         ?r           STANDARDtextinsertheightwidthalignrotationobliquestylec           
        dg}|                     t          |	|
                     |                     t          |d                     |                     t          dt	          |                               |                     t          dt	          t          |                                         |dk    r=|                     t          dt	          t          |                                         |dk    r=|                     t          d	t	          t          |                                         |dk    r=|                     t          d
t	          t          |                                         |dk    r0|                     t          dt	          |                               t          |                                         \  }}|                     t          dt	          |                               |                     t          dt	          |                               |                     t          |d                     | j        	                    d
                    |                     dS )aA  Add a one line TEXT entity.

        Args:
            text: the text as string
            insert: insert location as ``(x, y)`` tuple
            height: text height in drawing units
            width: text width as factor
            align: text alignment, see table below
            rotation: text rotation in degrees as float
            oblique: oblique in degrees as float, vertical = ``0`` (default)
            style: text style name as string, if FIXED-TABLES are written some
                predefined text styles are available, else text style is
                always ``'STANDARD'``.
            layer: layer name as string see :meth:`add_line`
            color: color as :ref:`ACI` see :meth:`add_line`

        ============   =============== ================= =====
        Vert/Horiz     Left            Center            Right
        ============   =============== ================= =====
        Top            ``TOP_LEFT``    ``TOP_CENTER``    ``TOP_RIGHT``
        Middle         ``MIDDLE_LEFT`` ``MIDDLE_CENTER`` ``MIDDLE_RIGHT``
        Bottom         ``BOTTOM_LEFT`` ``BOTTOM_CENTER`` ``BOTTOM_RIGHT``
        Baseline       ``LEFT``        ``CENTER``         ``RIGHT``
        ============   =============== ================= =====

        The special alignments ``ALIGNED`` and ``FIT`` are not available.

        z0
TEXT
r#   ri   r   r%   r   r&   r   r~   r   r      r   r   rk   rl   N)rn   ro   rp   ry   r=   rz   TEXT_ALIGN_FLAGSupperr/   rC   rq   )r9   r   r   r   r   r   r   r   r   rc   rd   rr   halignvaligns                 r:   add_textzR12FastStreamWriter.add_text-  s   T m

;ue,,---

:f2...///

71c$ii(()))

72s3v;;//00111C<<JJwr3s5zz??33444s??JJwr3s8}}#5#566777c>>JJwr3s7||#4#455666JJJwq#e**--...)%++--8

72s6{{++,,,

72s6{{++,,,

:f2...///"''#,,'''''r<   )F)r/   r   )r>   r?   )r_   NN)r`   ra   rb   ra   rc   r=   rd   re   rf   rg   r>   r?   )rt   ra   ru   rv   rc   r=   rd   re   rf   rg   r>   r?   )r   r|   r_   NN)rt   ra   ru   rv   r`   rv   rb   rv   rc   r=   rd   re   rf   rg   r>   r?   )
r   ra   rc   r=   rd   re   rf   rg   r>   r?   )r   r_   NN)r   r   r   r   rc   r=   rd   re   rf   rg   r>   r?   )
r   r   rc   r=   rd   re   rf   rg   r>   r?   )r   r=   r   r   r   r   rc   r=   rd   re   rf   rg   r>   r?   )Fr_   NN)r   r   r   rK   rc   r=   rd   re   rf   rg   r>   r?   )r   Fr   r   r_   NN)r   r   r   r=   r   rK   r   rv   r   rv   rc   r=   rd   re   rf   rg   r>   r?   )r   r   r   r   rc   r=   rd   re   rf   rg   r>   r?   )r   r_   NN)r   r   r   r   rc   r=   rd   re   rf   rg   r>   r?   )	r   r   r   r   r   r   r   r_   N)r   r=   r   ra   r   rv   r   rv   r   r=   r   rv   r   rv   r   r=   rc   r=   rd   re   r>   r?   )rD   rE   rF   __doc__r;   rW   rs   r{   r   r   r   r   r   r   r   r   r   r   rG   r<   r:   rV   rV   e   s.        2 2 2 2 21 1 1 1 #"&( ( ( ( (F #"&( ( ( ( (8 #"&( ( ( ( (D #"&( ( ( ( (2 #"&
 
 
 
 
F #"&N N N N N(( ( ( (6 #"&#) #) #) #) #)P #"&G) G) G) G) G)Z #"&M) M) M) M) M)f #"&:) :) :) :) :)~  #;( ;( ;( ;( ;( ;( ;(r<   rV   Nrc   rd   re   rf   rg   c                    d| z  g}||                     d|z             |Edt          |          cxk    rdk     rn n|                     d|z             nt          d          d                    |          S )Nz8
%s
z6
%s
r   i  z62
%d
z6color has to be an integer in the range from 0 to 256.rl   )rn   r   rU   rq   )rc   rd   rf   rr   s       r:   ro   ro   k  s     u
C

9x'(((E

    S     JJzE)****H   773<<r<   r   ra   c           
         g }| D ];}|                     d|t          t          |                    fz             |dz  }<d                    |          S )N%d
%s
r#   rl   )rn   r=   rz   rq   )r   rj   rr   cs       r:   rp   rp   {  sY    
C  

:s3q66{{ 33444
773<<r<   rj   r   c                    d| |fz  S )Nr   rG   )rj   r   s     r:   ry   ry     s    u%%r<   xysebva9    0
SECTION
  2
HEADER
  9
$ACADVER
  1
AC1009
  9
$DWGCODEPAGE
  3
ANSI_1252
  0
ENDSEC
  0
SECTION
  2
TABLES
  0
TABLE
  2
LTYPE
  5
431
 70
20
  0
LTYPE
  5
40F
  2
CONTINUOUS
 70
0
  3
Solid line
 72
65
 73
0
 40
0.0
  0
LTYPE
  5
410
  2
CENTER
 70
0
  3
Center ____ _ ____ _ ____ _ ____ _ ____ _ ____
 72
65
 73
4
 40
2.0
 49
1.25
 49
-0.25
 49
0.25
 49
-0.25
  0
LTYPE
  5
411
  2
DASHED
 70
0
  3
Dashed __ __ __ __ __ __ __ __ __ __ __ __ __ _
 72
65
 73
2
 40
0.75
 49
0.5
 49
-0.25
  0
LTYPE
  5
412
  2
PHANTOM
 70
0
  3
Phantom ______  __  __  ______  __  __  ______
 72
65
 73
6
 40
2.5
 49
1.25
 49
-0.25
 49
0.25
 49
-0.25
 49
0.25
 49
-0.25
  0
LTYPE
  5
413
  2
HIDDEN
 70
0
  3
Hidden __ __ __ __ __ __ __ __ __ __ __ __ __ __
 72
65
 73
2
 40
9.525
 49
6.345
 49
-3.175
  0
LTYPE
  5
43B
  2
CENTERX2
 70
0
  3
Center (2x) ________  __  ________  __  ________
 72
65
 73
4
 40
3.5
 49
2.5
 49
-0.25
 49
0.5
 49
-0.25
  0
LTYPE
  5
43C
  2
CENTER2
 70
0
  3
Center (.5x) ____ _ ____ _ ____ _ ____ _ ____
 72
65
 73
4
 40
1.0
 49
0.625
 49
-0.125
 49
0.125
 49
-0.125
  0
LTYPE
  5
43D
  2
DASHEDX2
 70
0
  3
Dashed (2x) ____  ____  ____  ____  ____  ____
 72
65
 73
2
 40
1.2
 49
1.0
 49
-0.2
  0
LTYPE
  5
43E
  2
DASHED2
 70
0
  3
Dashed (.5x) _ _ _ _ _ _ _ _ _ _ _ _ _ _
 72
65
 73
2
 40
0.3
 49
0.25
 49
-0.05
  0
LTYPE
  5
43F
  2
PHANTOMX2
 70
0
  3
Phantom (2x)____________    ____    ____    ____________
 72
65
 73
6
 40
4.25
 49
2.5
 49
-0.25
 49
0.5
 49
-0.25
 49
0.5
 49
-0.25
  0
LTYPE
  5
440
  2
PHANTOM2
 70
0
  3
Phantom (.5x) ___ _ _ ___ _ _ ___ _ _ ___ _ _ ___
 72
65
 73
6
 40
1.25
 49
0.625
 49
-0.125
 49
0.125
 49
-0.125
 49
0.125
 49
-0.125
  0
LTYPE
  5
441
  2
DASHDOT
 70
0
  3
Dash dot __ . __ . __ . __ . __ . __ . __ . __
 72
65
 73
4
 40
1.4
 49
1.0
 49
-0.2
 49
0.0
 49
-0.2
  0
LTYPE
  5
442
  2
DASHDOTX2
 70
0
  3
Dash dot (2x) ____  .  ____  .  ____  .  ____
 72
65
 73
4
 40
2.4
 49
2.0
 49
-0.2
 49
0.0
 49
-0.2
  0
LTYPE
  5
443
  2
DASHDOT2
 70
0
  3
Dash dot (.5x) _ . _ . _ . _ . _ . _ . _ . _
 72
65
 73
4
 40
0.7
 49
0.5
 49
-0.1
 49
0.0
 49
-0.1
  0
LTYPE
  5
444
  2
DOT
 70
0
  3
Dot .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .
 72
65
 73
2
 40
0.2
 49
0.0
 49
-0.2
  0
LTYPE
  5
445
  2
DOTX2
 70
0
  3
Dot (2x) .    .    .    .    .    .    .    .
 72
65
 73
2
 40
0.4
 49
0.0
 49
-0.4
  0
LTYPE
  5
446
  2
DOT2
 70
0
  3
Dot (.5) . . . . . . . . . . . . . . . . . . .
 72
65
 73
2
 40
0.1
 49
0.0
 49
-0.1
  0
LTYPE
  5
447
  2
DIVIDE
 70
0
  3
Divide __ . . __ . . __ . . __ . . __ . . __
 72
65
 73
6
 40
1.6
 49
1.0
 49
-0.2
 49
0.0
 49
-0.2
 49
0.0
 49
-0.2
  0
LTYPE
  5
448
  2
DIVIDEX2
 70
0
  3
Divide (2x) ____  . .  ____  . .  ____  . .  ____
 72
65
 73
6
 40
2.6
 49
2.0
 49
-0.2
 49
0.0
 49
-0.2
 49
0.0
 49
-0.2
  0
LTYPE
  5
449
  2
DIVIDE2
 70
0
  3
Divide(.5x) _ . _ . _ . _ . _ . _ . _ . _
 72
65
 73
6
 40
0.8
 49
0.5
 49
-0.1
 49
0.0
 49
-0.1
 49
0.0
 49
-0.1
  0
ENDTAB
  0
TABLE
  2
STYLE
  5
433
 70
18
  0
STYLE
  5
417
  2
STANDARD
 70
0
 40
0.0
 41
1.0
 50
0.0
 71
0
 42
0.2
  3
txt
  4

  0
STYLE
  5
44A
  2
OpenSans
 70
0
 40
0.0
 41
1.0
 50
0.0
 71
0
 42
1.0
  3
OpenSans-Regular.ttf
  4

  0
STYLE
  5
44F
  2
OpenSansCondensed-Light
 70
0
 40
0.0
 41
1.0
 50
0.0
 71
0
 42
1.0
  3
OpenSansCondensed-Light.ttf
  4

  0
ENDTAB
  0
TABLE
  2
VIEW
  5
434
 70
0
  0
ENDTAB
  0
ENDSEC
)FrH   )r/   rI   rJ   rK   rL   r=   r>   rM   )NN)rc   r=   rd   re   rf   rg   r>   r=   )r#   )r   ra   r>   r=   )rj   r   r>   r=   )$
__future__r   typingr   r   r   r   r   r	   r
   r   
contextlibr   	functoolsr   ior   pathlibr   ezdxf.lldxf.tagwriterr   rv   ra   roundrz   r   r   r.   rY   rV   ro   rp   ry   	frozensetFORMAT_CODESr\   rG   r<   r:   <module>r     s0   # " " " " "	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 & % % % % %                   1 1 1 1 1 1	%geQ    BRbrBB % % % % % % % %  % % % % %PC( C( C( C( C( C( C( C(N HL         & & & & y""H	r<   