Ë
    £èh+–  ã                  ó˜  — U d Z ddlmZ ddlmZmZmZmZmZm	Z	m
Z
mZmZ ddlmZmZ ddlZddlZddlZddlZddlmZmZmZmZmZ ddlmZmZmZ ddl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( g d¢Z)dZ*dZ+dZ,dZ-dZ.dZ/dZ0dZ1dZ2dZ3dZ4dZ5dZ6dZ7dZ8dZ9h d£Z:ee;ef   Z<de=d<   eee<gdf   Z>de=d <    G d!„ d"ej~                  «      Z@e9d#f	 	 	 	 	 	 	 dFd%„ZAe@j„                  dfdd&œ	 	 	 	 	 dGd'„ZCdHd(„ZDeegef   ZEde=d)<    G d*„ d$«      ZFdId+„ZGdJd,„ZHdKd-„ZIdLd.„ZJdMdNd/„ZKe9d#f	 	 	 	 	 	 	 dOd0„ZLdPd1„ZM	 	 	 	 	 	 	 	 dQd2„ZNd3„ ZOe9d#f	 	 	 	 	 	 	 dRd4„ZPdSd5„ZQdTd6„ZRdUdVd7„ZSdWd8„ZTdXd9„ZUdXd:„ZVd;ZWd<ZX ej²                  d=eXd>z  eWd>z  z  z
  «      ZZej¶                  d?z  Z\ejº                  d?z  Z^ejº                  d@z  Z_dYdA„Z`dZd[dB„Zad\d]dC„Zbd^dD„Zcd_dE„Zdy)`aQ  
Implementation of the `__geo_interface__`: https://gist.github.com/sgillies/2217756

Which is also supported by Shapely: https://pypi.org/project/Shapely/

Type definitions see GeoJson Standard: https://tools.ietf.org/html/rfc7946
and examples : https://tools.ietf.org/html/rfc7946#appendix-A

GeoJSON Linter: https://geojsonlint.com/

é    )Úannotations)	ÚIterableÚIteratorÚUnionÚcastÚCallableÚSequenceÚOptionalÚAnyÚMutableMapping)Ú	TypeAliasÚSelfN)ÚVec3Úhas_clockwise_orientationÚMatrix44Úworld_mercator_to_gpsÚgps_to_world_mercator)Ú	make_pathÚfrom_hatch_boundary_pathÚmake_polygon_structure)Ú
DXFGraphicÚ
LWPolylineÚPointÚPolylineÚLine)Ú
DXFPolygon)Úconst)Úfactory)ÚproxyÚdxf_entitiesÚgfilterÚGeoProxyÚPolygonConversionÚtypeÚcoordinatesr   Ú
MultiPointÚ
LineStringÚMultiLineStringÚPolygonÚMultiPolygonÚGeometryCollectionÚ
geometriesÚgeometryÚfeaturesÚFeatureÚ
propertiesÚFeatureCollectiongš™™™™™¹?>   ÚARCÚLINEÚHATCHÚPOINTÚSOLIDÚTRACEÚ3DFACEÚCIRCLEÚSPLINEÚELLIPSEÚMPOLYGONÚPOLYLINEÚ
LWPOLYLINEr   Ú
GeoMappingÚPostProcessFuncc                  ó    — e Zd ZdZdZdZdZdZy)r#   z“Polygon conversion types as :class:`IntEnum`.

    Attributes:
        HATCH:
        POLYLINE:
        HATCH_AND_POLYLINE:
        MPOLYGON:

    é   é   é   é   N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r4   r=   ÚHATCH_AND_POLYLINEr<   © ó    ú0lib/python3.12/site-packages/ezdxf/addons/geo.pyr#   r#   S   s   „ ñð €EØ€HØÐØ�HrL   r#   Fr"   c                ó0   — t         j                  | ||«      S )aÛ  Returns a :class:`GeoProxy` object.

    Args:
        entity: a single DXF entity or iterable of DXF entities
        distance: maximum flattening distance for curve approximations
        force_line_string: by default this function returns Polygon objects for
            closed geometries like CIRCLE, SOLID, closed POLYLINE and so on,
            by setting argument `force_line_string` to ``True``, this entities
            will be returned as LineString objects.

    )r"   Úfrom_dxf_entities)ÚentityÚdistanceÚforce_line_strings      rM   r   r   d   s   € ô  ×%Ñ% f¨hÐ8IÓJÐJrL   ©Úpost_processc               óP   — t         j                  | «      j                  |||¬«      S )aG  Returns ``__geo_interface__`` mappings as DXF entities.

    The enum `polygon` determines the method to convert polygons,
    use :attr:`PolygonConversion.HATCH` for :class:`~ezdxf.entities.Hatch` entity,
    :attr:`PolygonConversion.POLYLINE` for :class:`~ezdxf.entities.LWPolyline` or
    :attr:`PolygonConversion.HATCH_AND_POLYLINE` for both.
    Option :attr:`PolygonConversion.POLYLINE` returns for the exterior path and each hole
    a separated :class:`LWPolyline` entity. The :class:`Hatch` entity supports holes,
    but has no explicit borderline.

    Yields :class:`Hatch` always before :class:`LWPolyline` entities.

    :attr:`PolygonConversion.MPOLYGON` support was added in v0.16.6, which is
    like a :class:`~ezdxf.entities.Hatch` entity  with additional borderlines,
    but the MPOLYGON entity is not a core DXF entity and DXF viewers,
    applications and libraries my not support this entity. The DXF attribute
    `color` defines the borderline color and `fill_color` the color of the
    solid filling.

    The returned DXF entities can be added to a layout by the
    :meth:`Layout.add_entity` method.

    Args:
        geo_mapping: ``__geo__interface__`` mapping as :class:`dict` or a Python
            object with a :attr:`__geo__interface__` property
        polygon: see :class:`PolygonConversion`
        dxfattribs: dict with additional DXF attributes
        post_process: post process function of type :class:`PostProcessFunc` that get the
            created DXF entity and the geo mapping as input, see reference implementation
            :func:`assign_layers`

    rS   )r"   ÚparseÚto_dxf_entities)Úgeo_mappingÚpolygonÚ
dxfattribsrT   s       rM   r    r    w   s-   € ôN �>‰>˜+Ó&×6Ñ6Ø�¨,ð 7ó ð rL   c              #  ó¬   K  — | D ]K  }t        |t        «      r|j                  s|j                  sŒ,|–— Œ1|j	                  «       t
        v sŒH|–— ŒM y­w)zuFilter DXF entities from iterable `entities`, which are incompatible to
    the ``__geo_reference__`` interface.
    N)Ú
isinstancer   Úis_2d_polylineÚis_3d_polylineÚdxftypeÚSUPPORTED_DXF_TYPES)ÚentitiesÚes     rM   r!   r!   £   sF   è ø€ ó ˆÜ�aœÔ"Ø×Ò 1×#3Ó#3Ø“Ø�Y‰Y‹[Ô/Ò/Ø‹Gñ ùs   ‚.A±AÁAÚTFuncc                  óü   — e Zd ZdZddd„Zedd„«       Zedd„«       Zed„ «       Z	dd„Z
e
Zedd„«       Zdd„Zdd	„Zddd„Zddd„Zdd„Zdd„Zdd„Zeedf	 	 	 	 	 	 	 dd„«       Zej.                  d
fd
dœ	 	 	 d d„Zy
)!r"   aƒ  Stores the ``__geo_interface__`` mapping in a parsed and compiled form.

    Stores coordinates as :class:`Vec3` objects and represents "Polygon"
    always as tuple (exterior, holes) even without holes.

    The GeoJSON specification recommends 6 decimal places for latitude and
    longitude which equates to roughly 10cm of precision. You may need
    slightly more for certain applications, 9 decimal places would be
    sufficient for professional survey-grade GPS coordinates.

    Args:
        geo_mapping: parsed and compiled ``__geo_interface__`` mapping
        places: decimal places to round for ``__geo_interface__`` export

    c                ó    — || _         || _        y ©N)Ú_rootÚplaces)ÚselfrX   rh   s      rM   Ú__init__zGeoProxy.__init__Ã   s   € Ø ˆŒ
Øˆ�rL   c                óT   — t        |d«      r|j                  } | t        |«      «      S )aE  Parse and compile a ``__geo_interface__`` mapping as :class:`dict`
        or a Python object with a ``__geo_interface__`` property, does some
        basic syntax checks, converts all coordinates into :class:`Vec3`
        objects, represents "Polygon" always as tuple (exterior, holes) even
        without holes.

        Ú__geo_interface__)Úhasattrrl   rV   )ÚclsrX   s     rM   rV   zGeoProxy.parseÇ   s*   € ô �;Ð 3Ô4Ø%×7Ñ7ˆKÙ”5˜Ó%Ó&Ð&rL   c                ó   — | j                   S rf   ©rg   ©ri   s    rM   ÚrootzGeoProxy.rootÔ   s   € à�z‰zÐrL   c                ó8   — | j                   j                  d«      S )z7Property returns the top level entity type or ``None``.r$   )rg   Úgetrq   s    rM   ÚgeotypezGeoProxy.geotypeØ   s   € ð �z‰z�~‰~˜fÓ%Ð%rL   c                ó,   — t        j                  | «      S )zReturns a deep copy.)ÚcopyÚdeepcopyrq   s    rM   Ú__copy__zGeoProxy.__copy__Ý   s   € ä�}‰}˜TÓ"Ð"rL   c                óB   — t        | j                  | j                  «      S )zWReturns the ``__geo_interface__`` compatible mapping as
        :class:`dict`.
        )Ú_rebuildrg   rh   rq   s    rM   rl   zGeoProxy.__geo_interface__ã   s   € ô
 ˜Ÿ
™
 D§K¡KÓ0Ð0rL   c              #  óR   ‡K  — dˆfd„Š ‰| j                   «      E d{  –—†  y7 Œ­w)a+  Iterate over all geometry entities.

        Yields only "Point", "LineString", "Polygon", "MultiPoint",
        "MultiLineString" and "MultiPolygon" objects, returns the content of
        "GeometryCollection", "FeatureCollection" and "Feature" as geometry
        objects ("Point", ...).

        c              3  óD  •K  — | t            }|t        k(  r| t           D ]  } ‰|«      E d {  –—†  Œ y |t        k(  r| t           D ]  } ‰|«      E d {  –—†  Œ y |t
        k(  r/| t           }|t            t        k(  r ‰|«      E d {  –—†  y |–— y | –— y 7 Œl7 ŒF7 Œ­wrf   ©ÚTYPEÚFEATURE_COLLECTIONÚFEATURESÚGEOMETRY_COLLECTIONÚ
GEOMETRIESÚFEATUREÚGEOMETRY)ÚnodeÚtype_Úfeaturer-   Ú_iters       €rM   r‰   z GeoProxy.__iter__.<locals>._iterô   sŸ   øè ø€ Øœ‘JˆEØÔ*Ò*Ø#¤Hœ~�GÙ$ W›~×-Ñ-ñ  .àÔ-Ò-Ø $¤ZÔ 0�HÙ$ X›×.Ñ.ñ !1àœ'Ò!Ø¤™>�ØœD‘>Ô%8Ò8Ù$ X›×.Ñ.à"“Nà“
ð .øð /øð /ús3   ƒ*B ­B®'B ÁBÁ4B Â
BÂB ÂB ÂB N)r†   r?   ÚreturnúIterator[GeoMapping]rp   )ri   r‰   s    @rM   Ú__iter__zGeoProxy.__iter__ê   s    øè ø€ õ	ñ" ˜Ÿ™Ó$×$Ò$ús   ƒ'Ÿ% 'c                óZ   ‡‡‡— dˆfd„Šdˆˆˆfd„Š ‰| j                   «      si | _         yy)zýRemoves all mappings for which `func()` returns ``False``.
        The function only has to handle Point, LineString and Polygon entities,
        other entities like MultiPolygon are divided into separate entities
        also any collection.

        c           	     ó¼   •— g }| t            D ]1  } ‰t        t        |t         |i«      «      sŒ!|j                  |«       Œ3 || t         <   t	        t        |«      «      S rf   )ÚCOORDINATESr"   r   ÚappendÚboolÚlen)rr   r‡   r%   rP   Úfuncs       €rM   Úmulti_entityz%GeoProxy.filter.<locals>.multi_entity  sW   ø€ ØˆKØœ{Ô+�Ùœ¤$¨¬{¸FÐ!CÓDÕEØ×&Ñ& vÕ.ð ,ð !,ˆD”ÑÜœ˜KÓ(Ó)Ð)rL   c                ót  •— | t            }|t        k(  rB| t           D �cg c]  } ‰|«      sŒ|‘Œ c}| t        <   t        t	        | t           «      «      S |t
        k(  rB| t           D �cg c]  } ‰|«      sŒ|‘Œ c}| t        <   t        t	        | t           «      «      S |t        k(  r3 ‰| t           «      r	| t           ni | t        <   t        | t           «      S |t        k(  r ‰| t        «      S |t        k(  r ‰| t        «      S |t        k(  r ‰| t        «      S  ‰t        | «      «      S c c}w c c}w rf   )r   r€   r�   r‘   r’   r‚   rƒ   r„   r…   ÚMULTI_POINTr5   ÚMULTI_LINE_STRINGÚLINE_STRINGÚMULTI_POLYGONÚPOLYGONr"   )rr   r‡   rˆ   r-   Úcheckr“   r”   s       €€€rM   r›   zGeoProxy.filter.<locals>.check  s&  ø€ Øœ‘JˆEØÔ*Ò*à+/´ª>ó"Ù+9 ¹UÀ7½^’G¨>ñ"�”X‘ô œC ¤X¡Ó/Ó0Ð0ØÔ-Ò-à-1´*Ò-=ó$Ù-= ÁÀxÅ’HÐ-=ñ$�”ZÑ ô œC ¤ZÑ 0Ó1Ó2Ð2Øœ'Ò!Ù38¸¼h¹Ô3H ¤h¢Èb�”X‘Ü˜D¤™NÓ+Ð+Øœ+Ò%Ù# D¬%Ó0Ð0ØÔ+Ò+Ù# D¬+Ó6Ð6Øœ-Ò'Ù# D¬'Ó2Ð2áœH T›NÓ+Ð+ùò'"ùò
$s   ŸD0­D0Á*D5Á8D5N)rŠ   r‘   rp   )ri   r“   r›   r”   s    `@@rM   ÚfilterzGeoProxy.filter  s'   ú€ õ	*÷	,ñ0 �T—Z‘ZÔ ØˆD�Jð !rL   Nc                ó6   — |€t         }| j                  |«       y)a¢  Transform all coordinates recursive from globe representation
        in longitude and latitude in decimal degrees into 2D map representation
        in meters.

        Default is WGS84 `EPSG:4326 <https://epsg.io/4326>`_ (GPS) to WGS84
        `EPSG:3395 <https://epsg.io/3395>`_ World Mercator function
        :func:`wgs84_4326_to_3395`.

        Use the `pyproj <https://pypi.org/project/pyproj/>`_ package to write
        a custom projection function as needed.

        Args:
            func: custom transformation function, which takes one
                :class:`Vec3` object as argument and returns the result as
                a :class:`Vec3` object.

        N)Úwgs84_4326_to_3395Úapply©ri   r“   s     rM   Úglobe_to_mapzGeoProxy.globe_to_map2  ó   € ð$ ˆ<Ü%ˆDØ�
‰
�4ÕrL   c                ó6   — |€t         }| j                  |«       y)a   Transform all coordinates recursive from 2D map representation in
        meters into globe representation as longitude and latitude in decimal
        degrees.

        Default is WGS84 `EPSG:3395 <https://epsg.io/3395>`_ World Mercator
        to WGS84 `EPSG:4326 <https://epsg.io/4326>`_ GPS function
        :func:`wgs84_3395_to_4326`.

        Use the `pyproj <https://pypi.org/project/pyproj/>`_ package to write
        a custom projection function as needed.

        Args:
            func: custom transformation function, which takes one
                :class:`Vec3` object as argument and returns the result as
                a :class:`Vec3` object.

        N)Úwgs84_3395_to_4326rŸ   r    s     rM   Úmap_to_globezGeoProxy.map_to_globeH  r¢   rL   c                ó:   — | j                  |j                  «       y)a  Transform all coordinates recursive from CRS into
        :ref:`WCS` coordinates by transformation matrix `crs` inplace,
        see also :meth:`GeoProxy.wcs_to_crs`.

        Args:
            crs: transformation matrix of type :class:`~ezdxf.math.Matrix44`

        N)rŸ   Úucs_vertex_from_wcs©ri   Úcrss     rM   Ú
crs_to_wcszGeoProxy.crs_to_wcs^  s   € ð 	�
‰
�3×*Ñ*Õ+rL   c                ó:   — | j                  |j                  «       y)aì  Transform all coordinates recursive from :ref:`WCS` coordinates into
        Coordinate Reference System (CRS) by transformation matrix `crs`
        inplace.

        The CRS is defined by the :class:`~ezdxf.entities.GeoData` entity,
        get the :class:`GeoData` entity from the modelspace by method
        :meth:`~ezdxf.layouts.Modelspace.get_geodata`.
        The CRS transformation matrix can be acquired form the :class:`GeoData`
        object by :meth:`~ezdxf.entities.GeoData.get_crs_transformation` method:

        .. code:: Python

            doc = ezdxf.readfile('file.dxf')
            msp = doc.modelspace()
            geodata = msp.get_geodata()
            if geodata:
                matrix, axis_ordering = geodata.get_crs_transformation()

        If `axis_ordering` is ``False`` the CRS is not compatible with the
        ``__geo_interface__`` or GeoJSON (see chapter 3.1.1).

        Args:
            crs: transformation matrix of type :class:`~ezdxf.math.Matrix44`

        N)rŸ   Ú	transformr¨   s     rM   Ú
wcs_to_crszGeoProxy.wcs_to_crsi  s   € ð6 	�
‰
�3—=‘=Õ!rL   c                óL   ‡— dˆfd„}| j                  «       D ]
  } ||«       Œ y)z«Apply the transformation function `func` recursive to all
        coordinates.

        Args:
            func: transformation function as Callable[[Vec3], Vec3]

        c                ó@   •‡— ˆˆfd„Š ‰| t            «      | t         <   y )Nc                ój   •— t        | t        «      r ‰| «      S | D �cg c]
  } ‰|«      ‘Œ c}S c c}w rf   )r\   r   )ÚcoordsÚcr“   r¬   s     €€rM   r¬   z2GeoProxy.apply.<locals>.process.<locals>.transform�  s3   ø€ Ü˜f¤dÔ+Ù ›<Ð'á28Ó9±&¨Q™I a�L°&Ñ9Ð9ùÒ9s   ž0)r�   )rP   r¬   r“   s    @€rM   ÚprocesszGeoProxy.apply.<locals>.process�  s   ù€ õ:ñ #,¨F´;Ñ,?Ó"@ˆF”;ÒrL   N)rP   r?   )rŒ   )ri   r“   r³   rP   s    `  rM   rŸ   zGeoProxy.apply†  s"   ø€ õ	Að —m‘m–oˆFÙ�F�Oñ &rL   Fc                óh   — t        |t        «      rt        |||«      }nt        |||«      } | |«      S )a  Constructor from a single DXF entity or an iterable of DXF entities.

        Args:
            entity: DXF entity or entities
            distance: maximum flattening distance for curve approximations
            force_line_string: by default this function returns Polygon objects for
                closed geometries like CIRCLE, SOLID, closed POLYLINE and so on,
                by setting argument `force_line_string` to ``True``, this entities
                will be returned as LineString objects.

        )r\   r   ÚmappingÚ
collection)rn   rP   rQ   rR   Úms        rM   rO   zGeoProxy.from_dxf_entities›  s5   € ô$ �fœjÔ)Ü˜ Ð*;Ó<‰Aä˜6 8Ð->Ó?ˆAÙ�1‹vˆrL   rS   c             #  óœ  ‡‡‡	‡
‡‡‡‡K  — dˆfd„Šdˆfd„Šdˆ
ˆˆˆfd„Š	 	 	 	 	 	 	 	 dˆfd„Š	dˆ	fd„Š
dˆ	fd„Šdˆˆˆfd„}‰dk  s‰d	kD  rt        d
‰› �«      ‚t        ‰xs i «      Št        | j                  «      D ]J  \  }}|j	                  t
        «      } |||j	                  t        «      «      D ]  }|r	 |||«       |–— Œ ŒL y­w)aŠ  Returns stored ``__geo_interface__`` mappings as DXF entities.

        The `polygon` argument determines the method to convert polygons,
        use 1 for :class:`~ezdxf.entities.Hatch` entity, 2 for
        :class:`~ezdxf.entities.LWPolyline` or 3 for both.
        Option 2 returns for the exterior path and each hole a separated
        :class:`LWPolyline` entity. The :class:`Hatch` entity supports holes,
        but has no explicit borderline.

        Yields :class:`Hatch` always before :class:`LWPolyline` entities.

        :class:`~ezdxf.entities.MPolygon` support was added in v0.16.6, which is
        like a :class:`~ezdxf.entities.Hatch` entity  with additional borderlines,
        but the MPOLYGON entity is not a core DXF entity and DXF viewers,
        applications and libraries my not support this entity. The DXF attribute
        `color` defines the borderline color and `fill_color` the color of the
        solid filling.

        The returned DXF entities can be added to a layout by the
        :meth:`Layout.add_entity` method.

        Args:
            polygon: see :class:`PolygonConversion`
            dxfattribs: dict with additional DXF attributes
            post_process: post process function of type :class:`PostProcesFunc` that get the
                created DXF entity and the geo mapping as input, see reference implementation
                :func:`assign_layers`

        c                ót   •— t        t        t        j                  d‰¬«      «      }| |j                  _        |S )Nr5   ©rZ   )r   r   r   ÚnewÚdxfÚlocation)ÚvertexÚpointrZ   s     €rM   r¿   z'GeoProxy.to_dxf_entities.<locals>.pointØ  s+   ø€ Üœ¤§¡¨GÀ
Ô KÓLˆEØ!'ˆE�I‰IÔØˆLrL   c                óx   •— t        t        t        j                  d‰¬«      «      }|j	                  | d¬«       |S )Nr>   rº   Úxy)Úformat)r   r   r   r»   Úappend_points)ÚverticesÚpolylinerZ   s     €rM   Ú
lwpolylinez,GeoProxy.to_dxf_entities.<locals>.lwpolylineÝ  s7   ø€ ÜÜœGŸK™K¨ÀÔLóˆHð ×"Ñ" 8°DÐ"Ô9ØˆOrL   c              3  óÚ   •K  — ‰t         j                  k(  r ‰| |«      –— y ‰t         j                  z  r ‰| |«      –— ‰t         j                  z  r| g|z   D ]  } ‰|«      –— Œ y y ­wrf   )r#   r<   r4   r=   )ÚexteriorÚholesÚpathÚhatch_rÆ   Ú	mpolygon_rY   s      €€€€rM   Úpolygon_z*GeoProxy.to_dxf_entities.<locals>.polygon_ä  st   øè ø€ ØÔ+×4Ñ4Ò4Ù ¨%Ó0Ò0ð ØÔ*×0Ñ0Ò0Ù˜X uÓ-Ò-ØÔ*×3Ñ3Ò3Ø%˜J¨Ô.�DÙ$ TÓ*Ó*ñ /ð 4ùs   ƒA(A+c                óJ  •— t        t        t        j                  | ‰¬«      «      }t        j
                  |j                  _        |j                  j                  |t        j                  ¬«       |D ]-  }|j                  j                  |t        j                  ¬«       Œ/ |S )Nrº   )Úflags)r   r   r   r»   r   ÚHATCH_STYLE_OUTERMOSTr¼   Úhatch_styleÚpathsÚadd_polyline_pathÚBOUNDARY_PATH_EXTERNALÚBOUNDARY_PATH_OUTERMOST)r_   rÈ   rÉ   Údxf_polygonÚholerZ   s        €rM   Údxf_polygon_z.GeoProxy.to_dxf_entities.<locals>.dxf_polygon_ð  sŠ   ø€ ô œz¬7¯;©;°wÈ:Ô+VÓWˆKÜ*/×*EÑ*EˆK�O‰OÔ'Ø×Ñ×/Ñ/Ø¤× <Ñ <ð 0ô ó �Ø×!Ñ!×3Ñ3Ø¤× =Ñ =ð 4õ ð ð ÐrL   c                ó   •—  ‰d| |«      S )Nr4   rK   ©rÈ   rÉ   rØ   s     €rM   rË   z(GeoProxy.to_dxf_entities.<locals>.hatch_þ  s   ø€ Ù ¨°5Ó9Ð9rL   c                ó   •—  ‰d| |«      S )Nr<   rK   rÚ   s     €rM   rÌ   z+GeoProxy.to_dxf_entities.<locals>.mpolygon_  s   ø€ Ù 
¨H°eÓ<Ð<rL   c              3  ó`  •K  — | t         k(  r ‰|«      –— y | t        k(  r ‰|«      –— y | t        k(  r|\  }} ‰||«      E d {  –—†  y | t        k(  r|D ]  } ‰|«      –— Œ y | t        k(  r|D ]  } ‰|«      –— Œ y | t
        k(  r|D ]  }|\  }} ‰||«      E d {  –—†  Œ y y 7 Œc7 Œ
­wrf   )r5   r˜   rš   r–   r—   r™   )r‡   r%   rÈ   rÉ   ÚdatarÆ   r¿   rÍ   s        €€€rM   rP   z(GeoProxy.to_dxf_entities.<locals>.entity  sÂ   øè ø€ ØœŠ~Ù˜KÓ(Ó(Øœ+Ò%Ù  Ó-Ó-Øœ'Ò!Ø"-‘�˜%Ù# H¨eÓ4×4Ñ4Øœ+Ò%Û'�DÙ ›+Ó%ñ (àÔ+Ò+Û'�DÙ$ TÓ*Ó*ñ (àœ-Ò'Û'�DØ&*‘O�H˜eÙ'¨°%Ó8×8Ñ8ñ (ð (ð 5øð 9ús%   ƒAB.ÁB*ÁAB.Â!B,Â"	B.Â,B.rB   rE   zinvalid value for polygon: N)r¾   r	   rŠ   r   )rÄ   r	   rŠ   r   )rÈ   ÚlistrÉ   rÞ   rŠ   úIterator[DXFGraphic])r_   ÚstrrÈ   r	   rÉ   r	   rŠ   r   )rÈ   r	   rÉ   r	   rŠ   r   )rŠ   rß   )Ú
ValueErrorÚdictÚiter_featuresrg   rt   r   r�   )ri   rY   rZ   rT   rP   rˆ   r-   r‡   rb   rØ   rË   rÆ   rÌ   r¿   rÍ   s    ``      @@@@@@rM   rW   zGeoProxy.to_dxf_entities³  sÓ   ÿè ø€ õJ	õ
	÷
	+ð 
	+ð	Øð	Ø$,ð	Ø5=ð	àõ	õ	:õ	=÷	9ð& �QŠ;˜' Aš+ÜÐ:¸7¸)ÐDÓEÐEä˜*Ò*¨Ó+ˆ
Ü!.¨t¯z©zÖ!:ÑˆG�XØ—L‘L¤Ó&ˆEÙ˜E 8§<¡<´Ó#<Ö=�ÙÙ   GÔ,Ø“ñ >ñ ";ùs   ŠCC©é   )rX   r?   rh   Úint)rX   r?   rŠ   r   )rŠ   r?   )rŠ   r"   )rŠ   r‹   )r“   zCallable[[GeoProxy], bool]rŠ   ÚNonerf   )r“   zOptional[TFunc]rŠ   rç   )r©   r   rŠ   rç   )r“   rc   rŠ   rç   ©rP   z'Union[DXFGraphic, Iterable[DXFGraphic]]rQ   ÚfloatrR   r‘   rŠ   r"   )rT   úOptional[PostProcessFunc]rŠ   rß   )rF   rG   rH   rI   rj   ÚclassmethodrV   Úpropertyrr   ru   ry   rw   rl   rŒ   rœ   r¡   r¥   rª   r­   rŸ   ÚMAX_FLATTENING_DISTANCErO   r#   r4   rW   rK   rL   rM   r"   r"   ²   s  „ ñô ð ò
'ó ð
'ð òó ðð ñ&ó ð&ó#ð €Dàò1ó ð1ó%ó:)ôVô,ó,	,ó"ó:ð* ð 2Ø"'ð	à7ðð ðð  ð	ð
 
òó ðð2 "×'Ñ'Øðmð
 37ñmð
 0ðmð 
ômrL   c              #  óF   ‡‡K  — i Šdˆˆfd„Š ‰| «      E d{  –—†  y7 Œ­w)a,  Yields all geometries of a ``__geo_mapping__`` as (`feature`, `geometry`) tuples.

    If no feature is defined the `feature` value is an empty ``dict``. When a `feature`
    contains `GeometryCollections`, the function yields for each sub-geometry a separate
    (`feature`, `geometry`) tuple.

    c              3  óP  •K  — | t            }|t        k(  r| t           D ]  } ‰|«      E d {  –—†  Œ y |t        k(  r| t           D ]  } ‰|«      E d {  –—†  Œ y |t
        k(  r3| Š| t           }|t            t        k(  r ‰|«      E d {  –—†  y ‰|f–— y ‰| f–— y 7 Œr7 ŒL7 Œ­wrf   r~   )r†   r‡   rˆ   r-   Úcurrent_featurer.   s       €€rM   r.   ziter_features.<locals>.features-  sµ   øè ø€ ð ”T‘
ˆØÔ&Ò&Ø¤œ>�Ù# GÓ,×,Ñ,ñ *àÔ)Ò)Ø ¤Ô,�Ù# HÓ-×-Ñ-ñ -à”gÒØ"ˆOØœH‘~ˆHØœ‰~Ô!4Ò4Ù# HÓ-×-Ñ-à% xÐ/Ó/à! 4Ð'Ó'ð -øð .øð
 .ús3   ƒ*B&­B ®'B&ÁB"Á6B&ÂB$ÂB&Â"B&Â$B&N)r†   r?   rŠ   ú'Iterator[tuple[GeoMapping, GeoMapping]]rK   )rX   rð   r.   s    @@rM   rã   rã   #  s#   ùè ø€ ð #%€Oö(ñ( ˜Ó$×$Ò$ús   „!™š!c                ó¦  — t        j                  | «      } | j                  t        «      }|€t	        dt        › d�«      ‚|t
        k(  rL| j                  t        «      }|r"|D �cg c]  }t        |«      ‘Œ c}| t        <   | S t	        dt        › d�«      ‚|t        k(  rL| j                  t        «      }|r"|D �cg c]  }t        |«      ‘Œ c}| t        <   | S t	        dt        › d�«      ‚|t        k(  rHt        | v r-| j                  t        «      }|rt        |«      nd| t        <   | S t	        dt        › d�«      ‚|t        t        t        t        t         t"        hv rÓ| j                  t$        «      }|€t	        dt$        › d|› d	�«      ‚|t        k(  rt'        |«      }n†|t        t        fv rt'        j(                  |«      }nb|t        k(  rt+        |«      }nM|t         k(  r#|D �cg c]  }t'        j(                  |«      ‘Œ }}n!|t"        k(  r|D �cg c]  }t+        |«      ‘Œ }}|| t$        <   | S t-        d
|› d�«      ‚c c}w c c}w c c}w c c}w )z´Parse ``__geo_interface__`` convert all coordinates into
    :class:`Vec3` objects, Polygon['coordinates'] is always a
    tuple (exterior, holes), holes maybe an empty list.

    NzRequired key "z" not found.zMissing key "z" in FeatureCollection.z" in GeometryCollection.z" in Feature.z" in Ú.zInvalid type "z".)rw   rx   rt   r   rá   r€   r�   rV   r‚   rƒ   r„   r…   r5   r˜   rš   r–   r—   r™   r�   r   rÞ   Ú_parse_polygonÚ	TypeError)	rX   r‡   r.   Úfr,   Úgr-   r%   Úvs	            rM   rV   rV   D  sI  € ô —-‘- Ó,€KØ�O‰OœDÓ!€EØ€}Ü˜>¬$¨¨|Ð<Ó=Ð=àÔ"Ò"à—?‘?¤8Ó,ˆÙÙ7?Ó$@±x°!¤U¨1¥X°xÑ$@ˆKœÑ!ðT ÐôQ ˜}¬X¨JÐ6MÐNÓOÐOØ	Ô%Ò	%à —_‘_¤ZÓ0ˆ
ÙÙ9CÓ&D¹°A¤u¨Q¥x¸Ñ&DˆKœ
Ñ#ðF ÐôC ˜}¬Z¨LÐ8PÐQÓRÐRØ	”'Ò	ô �{Ñ"Ø"—‘¤xÓ0ˆHÙ7?¤E¨(¤OÀTˆKœÑ!ð6 Ðô3 ˜}¬X¨J°mÐDÓEÐEØ	ÜÜÜÜÜÜðñ 
ð "—o‘o¤kÓ2ˆØÐÜ˜}¬[¨M¸¸u¸gÀQÐGÓHÐHØ”EŠ>Ü˜{Ó+‰KØ”{¤KÐ0Ñ0ÜŸ)™) KÓ0‰KØ”gÒÜ(¨Ó5‰KØÔ'Ò'Ù1<Ó=±¨Aœ4Ÿ9™9 Q�<°ˆKÑ=Ø”mÒ#Ù6AÓB±k°œ>¨!Õ,°kˆKÐBØ#.ˆ”KÑ ð Ðô ˜.¨¨¨rÐ2Ó3Ð3ùòS %Aùò 'Eùò: >ùâBs   Á$H?Â9IÇ%I	ÈIc                óà   — t        | t        «      st        d«      ‚t        | «      dk(  rt        d«      ‚| d   }t        |«      dk(  rt        d«      ‚t        |d   t        j
                  «      S )z¡Returns ``True`` for a sequence of coordinates like [(0, 0), (1, 0)]
    and ``False`` for a sequence of sequences:
    [[(0, 0), (1, 0)], [(2, 0), (3, 0)]]
    zInvalid coordinate sequence.r   )r\   r	   rá   r’   ÚnumbersÚReal)r%   Ú
first_items     rM   Ú_is_coordinate_sequencerý   €  si   € ô
 �k¤8Ô,ÜÐ7Ó8Ð8Ü
ˆ;Ó˜1ÒÜÐ7Ó8Ð8Ø˜Q‘€JÜ
ˆ:ƒ˜!ÒÜÐ7Ó8Ð8Ü�j ‘m¤W§\¡\Ó2Ð2rL   c                ó°   — t        | «      r| }g }n
| d   }| dd }t        j                  |«      |D �cg c]  }t        j                  |«      ‘Œ c}fS c c}w )z8Returns polygon definition as tuple (exterior, [holes]).r   rB   N)rý   r   rÞ   )r%   rÈ   rÉ   Úhs       rM   rô   rô   �  sV   € ä˜{Ô+ØˆØ‰à˜q‘>ˆØ˜A˜B�ˆÜ�9‰9�XÓ±uÓ =±u°!¤§¡¨1¥°uÑ =Ð=Ð=ùÒ =s   ³Ac           	     ór  ‡‡— dˆfd„Šˆfd„}t        | «      }|t           }|t        k(  r)|t           D �cg c]  }t	        |«      ‘Œ c}|t        <   |S |t
        k(  r)|t           D �cg c]  }t	        |«      ‘Œ c}|t        <   |S |t        k(  rt	        |t           «      |t        <   |S |t        k(  r|t           } ‰|«      |t        <   |S |t        t        fv r(|t           }|D �cg c]
  } ‰|«      ‘Œ c}|t        <   |S |t        k(  r@g }|t           D ]'  }	|j                  |	D �cg c]
  } ‰|«      ‘Œ c}«       Œ) ||t        <   |S |t        k(  r ||t           Ž |t        <   |S |t         k(  r*|t           D �
�cg c]  \  }
} ||
|«      ‘Œ c}}
|t        <   |S c c}w c c}w c c}w c c}w c c}}
w )zrReturns ``__geo_interface__`` compatible mapping as :class:`dict` from
    compiled internal representation.

    c                ó\   •— t        | j                  ‰«      t        | j                  ‰«      fS rf   )ÚroundÚxÚy)rø   rh   s    €rM   Úpntz_rebuild.<locals>.pnt   s$   ø€ Ü�Q—S‘S˜&Ó!¤5¨¯©¨fÓ#5Ð5Ð5rL   c           
     ón   •— | g|z   D ��cg c]  }|D �cg c]
  } ‰|«      ‘Œ c}‘Œ c}}S c c}w c c}}w rf   rK   )rÈ   rÉ   Úringrø   r  s       €rM   Ú_polygonz_rebuild.<locals>._polygon£  s<   ø€ ð 5=°:ÀÒ3EÔFÑ3E¨4¡Ó&¡˜A‘�Q• Ó&Ð3EÒFÐFùÒ&ùÓFs   ‹	1”,£1¬1)rø   r   rŠ   ztuple[float, float])râ   r   r€   r�   r{   r‚   rƒ   r„   r…   r5   r�   r˜   r–   r—   r�   rš   r™   )rX   rh   r  Úgeo_interfacer‡   rö   r÷   rø   r%   ÚlinerÈ   rÉ   r  s    `          @rM   r{   r{   š  sï  ù€ õ6ôGô
 ˜Ó%€MØœ$Ñ€EØÔ"Ò"Ø8EÄhÒ8OÓ"PÑ8O°1¤8¨A¥;Ð8OÑ"Pˆ”hÑð, Ðð+ 
Ô%Ò	%Ø:GÌ
Ò:SÓ$TÑ:S°Q¤X¨a¥[Ð:SÑ$Tˆ”jÑ!ð( Ðð' 
”'Ò	Ü"*¨=¼Ñ+BÓ"Cˆ”hÑð$ Ðð# 
”%ŠØœ+Ñ&ˆÙ%(¨£Vˆ”kÑ"ð Ðð 
”;¤Ð,Ñ	,Ø#¤KÑ0ˆÙ6AÓ%B±k°¡c¨!¥f°kÑ%Bˆ”kÑ"ð Ðð 
Ô#Ò	#ØˆØ!¤+Ô.ˆDØ×Ñ±Ó5±¨1¡ A¥°Ñ5Õ6ð /à%0ˆ”kÑ"ð Ðð 
”'Ò	Ù%-¨}¼[Ñ/IÐ%Jˆ”kÑ"ð
 Ðð	 
”-Ò	à=JÌ;Ò=Wô&
Ù=W©/¨(°E‰H�X˜uÕ%Ð=Wò&
ˆ”kÑ"ð Ðùò- #Qùâ$Tùò &Cùò  6ùó
&
s   ¶FÁ(F$Ã(F)Ä)F.
Å?F3c                óB  — | j                  «       }t        | t        «      r&t        t        t
        | j                  j                  iS t        | t        «      r5t        | j                  j                  | j                  j                  g«      S t        | t        «      rT| j                  s| j                  r1t        | «      }t!        |j#                  |«      «      }t%        ||«      S t'        d«      ‚t        | t(        «      r1t        | «      }t!        |j#                  |«      «      }t%        ||«      S |dv r$t%        t!        | j#                  |«      «      |«      S |dv rt%        | j+                  d¬«      |«      S t        | t,        «      rt/        | ||«      S t'        |«      ‚)a¿  Create the compiled ``__geo_interface__`` mapping as :class:`dict`
    for the given DXF `entity`, all coordinates are :class:`Vec3` objects and
    represents "Polygon" always as tuple (exterior, holes) even without holes.


    Internal API - result is **not** a valid ``_geo_interface__`` mapping!

    Args:
        entity: DXF entity
        distance: maximum flattening distance for curve approximations
        force_line_string: by default this function returns Polygon objects for
            closed geometries like CIRCLE, SOLID, closed POLYLINE and so on,
            by setting argument `force_line_string` to ``True``, this entities
            will be returned as LineString objects.

    z$Polymesh and Polyface not supported.>   r2   r9   r:   r;   >   r6   r7   r8   T)Úclose)r_   r\   r   r   r5   r�   r¼   r½   r   Úline_string_mappingÚstartÚendr   r^   r]   r   rÞ   Ú
flatteningÚ_line_string_or_polygon_mappingrõ   r   Úwcs_verticesr   Ú_hatch_as_polygon)rP   rQ   rR   r_   rÊ   Úpointss         rM   rµ   rµ   Ä  se  € ð, �n‰nÓ€GÜ�&œ%Ô Ü”eœ[¨&¯*©*×*=Ñ*=Ð>Ð>Ü	�FœDÔ	!Ü" F§J¡J×$4Ñ$4°f·j±j·n±nÐ#EÓFÐFÜ	�FœHÔ	%Ø× Ò  F×$9Ò$9ä˜VÓ$ˆDÜ˜$Ÿ/™/¨(Ó3Ó4ˆFÜ2°6Ð;LÓMÐMäÐBÓCÐCÜ	�FœJÔ	'ä˜Ó ˆÜ�d—o‘o hÓ/Ó0ˆÜ.¨vÐ7HÓIÐIØ	Ð:Ñ	:Ü.Ü�×"Ñ" 8Ó,Ó-Ð/@ó
ð 	
ð 
Ð0Ñ	0Ü.Ø×Ñ dÐÓ+Ð->ó
ð 	
ô 
�FœJÔ	'Ü  ¨Ð3DÓEÐEä˜Ó Ð rL   c                ó    — t        | «      }|dk  rt        d«      ‚|dk(  s|rt        | «      S t        | «      rt	        | g «      S t        | «      S )NrC   zInvalid vertex count.)r’   rá   r  Úis_linear_ringÚpolygon_mapping)r  rR   Úlen_s      rM   r  r  ú  sS   € Üˆv‹;€DØˆa‚xÜÐ0Ó1Ð1Øˆq‚yÑ%Ü" 6Ó*Ð*ä˜&Ô!Ü" 6¨2Ó.Ð.ä& vÓ.Ð.rL   c                ó4  ‡‡‡‡— dˆˆˆfd„}dˆfd„Š| j                   j                  j                  Š| j                  «       Š| j                   j                  }t        | j                  j                  |«      «      }t        |«      }|dk(  rt        | j                  «       › d�«      ‚|d   }|dk(  s|t        j                  k(  r ||«      }t        ||«      S |rM ||«      }t        ||«      g}	|dd  D ]%  }
 ||
«      }|	j                  t        ||«      «       Œ' t        |	«      S g }t!        |‰‰«      D ]<  \  }} ‰|«      }|j                  t#        ||D �
cg c]
  }
 ‰|
«      ‘Œ c}
«      «       Œ> t        |«      dkD  rt        |«      S |d   S c c}
w )Nc                ó.   •— t        | ‰‰«      } ‰|«      S rf   ©r   )ÚboundaryrÊ   Ú	elevationÚocsÚpath_to_verticess     €€€rM   Úboundary_to_verticesz/_hatch_as_polygon.<locals>.boundary_to_vertices
  s   ø€ Ü'¨°#°yÓAˆÙ Ó%Ð%rL   c                óX   •— | j                  «        t        | j                  ‰«      «      S rf   )r  rÞ   r  )rÊ   rQ   s    €rM   r  z+_hatch_as_polygon.<locals>.path_to_vertices  s    ø€ Ø�
‰
ŒÜ�D—O‘O HÓ-Ó.Ð.rL   r   z without any boundary path.rB   )rŠ   ú
list[Vec3])r¼   r  Úzr  rÑ   rÞ   rÒ   Úrendering_pathsr’   rá   r_   r   ÚHATCH_STYLE_IGNOREr  r�   Újoin_multi_single_type_mappingsÚ_boundaries_to_polygonsr  )ÚhatchrQ   rR   r   rÑ   Ú
boundariesÚcountrÈ   r  r,   r×   ÚpolygonsrÉ   r  r  r  s    `           @@@rM   r  r    s•  û€ ÷&õ/ð —	‘	×#Ñ#×%Ñ%€IØ
�)‰)‹+€CØ—)‘)×'Ñ'€Kô �e—k‘k×1Ñ1°+Ó>Ó?€JÜ�
‹O€EØ�‚zÜ˜EŸM™M›OÐ,Ð,GÐHÓIÐIà˜!‰}€HØ�‚z�[¤E×$<Ñ$<Ò<Ù% hÓ/ˆÜ.¨vÐ7HÓIÐIáá)¨(Ó3ˆFÜ9¸&ÐBSÓTÐUˆJà" 1 2›�Ù-¨dÓ3�Ø×!Ñ!Ü3°FÐ<MÓNõð 'ô
 3°:Ó>Ð>ð ˆHÜ#:¸:ÀsÈIÖ#V‘�˜%Ù)¨(Ó3�Ø—‘Ü# FÑPUÓ,VÑPUÈÑ-=¸dÕ-CÐPUÑ,VÓWõð $Wô
 �8‹}˜qÒ Ü6°xÓ@Ð@Ø˜A‘;Ðùò	 -Ws   ÅFc              #  ó�   ‡‡K  — ˆˆfd„| D «       }t        |«      D ]!  }|d   }||dd  D �cg c]  }|d   ‘Œ	 c}f–— Œ# y c c}w ­w)Nc              3  ó8   •K  — | ]  }t        |‰‰«      –— Œ y ­wrf   r  )Ú.0r  r  r  s     €€rM   Ú	<genexpr>z*_boundaries_to_polygons.<locals>.<genexpr>>  s   øè ø€ ð ÙKU¸xÔ  ¨3°	×:É:ùs   ƒr   rB   )r   )r)  r  r  rÒ   rY   rÈ   r×   s    ``    rM   r'  r'  =  sY   ùè ø€ ôÙKUó€Eô *¨%Ö0ˆØ˜1‘:ˆà¨W°Q°R©[Ó9©[ T˜˜a›¨[Ñ9Ð9Ó9ñ 1ùò :ùs   „(A¬A¸Ac                ó¬   — | D �cg c]  }t        |||«      ‘Œ }}t        d„ |D «       «      }t        |«      dkD  rt        |«      S t	        |«      S c c}w )a;  Create the ``__geo_interface__`` mapping as :class:`dict` for the
    given DXF `entities`, see https://gist.github.com/sgillies/2217756

    Returns a "MultiPoint", "MultiLineString" or "MultiPolygon" collection if
    all entities return the same GeoJSON type ("Point", "LineString", "Polygon")
    else a "GeometryCollection".

    Internal API - result is **not** a valid ``_geo_interface__`` mapping!

    Args:
        entities: iterable of DXF entities
        distance: maximum flattening distance for curve approximations
        force_line_string: by default this function returns "Polygon" objects for
            closed geometries like CIRCLE, SOLID, closed POLYLINE and so on,
            by setting argument `force_line_string` to ``True``, this entities
            will be returned as "LineString" objects.
    c              3  ó.   K  — | ]  }|t            –— Œ y ­wrf   )r   )r.  r÷   s     rM   r/  zcollection.<locals>.<genexpr>^  s   è ø€ Ð#¡˜A�”$•¡ùs   ‚rB   )rµ   Úsetr’   Úgeometry_collection_mappingr&  )ra   rQ   rR   rb   r·   Útypess         rM   r¶   r¶   G  sZ   € ñ, ;CÓC¹(°QŒ��HÐ/Õ	0¸(€AÐCÜÑ#¡Ó#Ó#€EÜ
ˆ5ƒz�A‚~Ü*¨1Ó-Ð-ä.¨qÓ1Ð1ùò 	Ds   …Ac                ó&   — t         t        t        | iS )zÐReturns a "LineString" mapping.

    .. code::

        {
            "type": "LineString",
            "coordinates": [
                (100.0, 0.0),
                (101.0, 1.0)
            ]
        }
    )r   r˜   r�   ©r  s    rM   r  r  e  s   € ô ”+œ{¨FÐ3Ð3rL   c                ó0   — | d   j                  | d   «      S )Nr   éÿÿÿÿ)Úiscloser6  s    rM   r  r  v  s   € Ø�!‰9×Ñ˜V B™ZÓ(Ð(rL   c                ó  — t        | «      dk  rt        dt        | «      › �«      ‚| d   j                  | d   «      s| j                  | d   «       t	        | «      r|r| j                  «        | S |s| j                  «        | S )z¹Return `points` as linear ring (last vertex == first vertex),
    argument `ccw` defines the winding orientation, ``True`` for counter-clock
    wise and ``False`` for clock wise.

    rD   zInvalid vertex count: r   r8  )r’   rá   r9  r�   r   Úreverse)r  Úccws     rM   Úlinear_ringr=  }  s|   € ô ˆ6ƒ{�Q‚ÜÐ1´#°f³+°Ð?Ó@Ð@Ø�!‰9×Ñ˜V B™ZÔ(Ø�‰�f˜Q‘iÔ ä  Ô(ÙØ�N‰NÔð
 €Mñ Ø�N‰NÔà€MrL   c                ó”   — t        | d¬«      }|r|D �cg c]  }t        |d¬«      ‘Œ }}||f}n|g f}t        t        t        |iS c c}w )a8  Returns a "Polygon" mapping.

    .. code::

        {
            "type": "Polygon",
            "coordinates": [
                 [
                     (100.0, 0.0),
                     (101.0, 0.0),
                     (101.0, 1.0),
                     (100.0, 1.0),
                     (100.0, 0.0)
                 ],
                 [
                     (100.8, 0.8),
                     (100.8, 0.2),
                     (100.2, 0.2),
                     (100.2, 0.8),
                     (100.8, 0.8)
                 ]
            ]
        }
    T)r<  F)r=  r   rš   r�   )r  rÉ   rÈ   r×   Úringss        rM   r  r  ’  sZ   € ô4 ˜6 tÔ,€HÙÙ:?Ó@¹%°$”˜T uÖ-¸%ˆÐ@Ø˜%�‰à˜"�ˆäŒgÜ�Uðð ùò	 As   ”Ac                óL  — t        «       }t        «       }| D ]2  }|j                  |t           «       |j	                  |t
           «       Œ4 t        |«      dkD  rt        dt        |«      › �«      ‚t        |«      dk(  r
t        «       S t        dt        |«      d   z   t
        |iS )zdReturns multiple geometries as a "MultiPoint", "MultiLineString" or
    "MultiPolygon" mapping.
    rB   zType mismatch: r   ÚMulti)r2  rÞ   Úaddr   r�   r�   r’   rõ   rà   râ   Útuple)r,   r4  rÝ   r÷   s       rM   r&  r&  ¸  s�   € ô ‹E€EÜ‹6€DÛˆØ�	‰	�!”D‘'ÔØ�‰�A”k‘NÕ#ð ô ˆ5ƒz�A‚~Ü˜/¬#¨e«*¨Ð6Ó7Ð7Ü	ˆU‹�qŠÜ‹vˆä�g¤ e£¨Q¡Ñ/´¸dÐCÐCrL   c                ó8   — t         t        t        t        | «      iS )z>Returns multiple geometries as a "GeometryCollection" mapping.)r   r‚   rƒ   rÞ   )r,   s    rM   r3  r3  Ê  s   € äÔ%¤z´4¸
Ó3CÐDÐDrL   i™Ra gQÚÄ?XAg      ð?rC   g       @g      @c                óT   — t        t        | j                  | j                  «      «      S )aÐ  Transform WGS84 `EPSG:4326 <https://epsg.io/4326>`_ location given as
    latitude and longitude in decimal degrees as used by GPS into World Mercator
    cartesian 2D coordinates in meters `EPSG:3395 <https://epsg.io/3395>`_.

    Args:
        location: :class:`Vec3` object, x-attribute represents the longitude
            value (East-West) in decimal degrees and the y-attribute
            represents the latitude value (North-South) in decimal degrees.
    )r   r   r  r  )r½   s    rM   rž   rž   Þ  s   € ô Ô% h§j¡j°(·*±*Ó=Ó>Ð>rL   c                óV   — t        t        | j                  | j                  |«      «      S )ak  Transform WGS84 World Mercator `EPSG:3395 <https://epsg.io/3395>`_
    location given as cartesian 2D coordinates x, y in meters into WGS84 decimal
    degrees as longitude and latitude `EPSG:4326 <https://epsg.io/4326>`_ as
    used by GPS.

    Args:
        location: :class:`Vec3` object, z-axis is ignored
        tol: accuracy for latitude calculation

    )r   r   r  r  )r½   Útols     rM   r¤   r¤   ë  s!   € ô Ô% h§j¡j°(·*±*¸cÓBÓCÐCrL   c                óF   — | t        |«      dz  z   t        |«      dz  z   }|S )z6Convert degree, minutes, seconds into decimal degrees.é<   é  )ré   )Údr·   ÚsÚdds       rM   Údms2ddrN  ù  s&   € à	
ŒU�1‹X˜‰]Ñ	œU 1›X¨™_Ñ	,€BØ€IrL   c                óN   — t        | dz  d«      \  }}t        |d«      \  }}|||fS )z6Convert decimal degrees into degree, minutes, seconds.rJ  rI  )Údivmod)rM  r·   rL  rK  s       rM   Údd2dmsrQ  ÿ  s0   € ä�"�t‘)˜RÓ �D€A€qÜ�!�R‹=�D€A€qØˆa�ˆ7€NrL   c                ó~   — |j                  t        «      }|€y|j                  d«      }|r|| j                  _        yy)zsReference implementation for a :func:`post_process` function.

    .. seealso::

        :func:`dxf_entities`

    NÚlayer)rt   Ú
PROPERTIESr¼   rS  )rP   rµ   r0   rS  s       rM   Úassign_layersrU    s=   € ð —‘œZÓ(€JØÐØØ�N‰N˜7Ó#€EÙØ ˆ�
‰
Õð rL   rè   )rX   r?   rT   rê   rŠ   rß   )ra   úIterable[DXFGraphic]rŠ   rß   )rX   r?   rŠ   rñ   )rX   r?   rŠ   r?   )r%   r	   rŠ   r‘   )r%   r	   rŠ   r	   rä   )rX   r?   rh   ræ   rŠ   r?   )rP   r   rQ   ré   rR   r‘   rŠ   r?   )r  r"  rR   r‘   )r(  r   rQ   ré   rR   r‘   rŠ   r?   )ra   rV  rQ   ré   rR   r‘   rŠ   r?   )r  r"  rŠ   r?   )r  r"  )T)r  r"  rŠ   r"  )r  r"  rÉ   zlist[list[Vec3]]rŠ   r?   )r,   zIterable[GeoMapping]rŠ   r?   )r½   r   rŠ   r   )g�íµ ÷Æ°>)r½   r   rG  ré   rŠ   r   )r   r   )rK  ré   r·   ré   rL  ré   rŠ   ré   )rM  ré   rŠ   ztuple[float, float, float])rP   r   rµ   r?   rŠ   rç   )erI   Ú
__future__r   Útypingr   r   r   r   r   r	   r
   r   r   Útyping_extensionsr   r   rú   rw   ÚmathÚenumÚ
ezdxf.mathr   r   r   r   r   Ú
ezdxf.pathr   r   r   Úezdxf.entitiesr   r   r   r   r   Úezdxf.entities.polygonr   Úezdxf.lldxfr   r   Ú__all__r   r�   r5   r–   r˜   r—   rš   r™   r‚   rƒ   r…   r�   r„   rT  r€   rí   r`   rà   r?   Ú__annotations__r@   ÚIntEnumr#   r   r4   r    r!   rc   r"   rã   rV   rý   rô   r{   rµ   r  r  r'  r¶   r  r  r=  r  r&  r3  ÚWGS84_SEMI_MAJOR_AXISÚWGS84_SEMI_MINOR_AXISÚsqrtÚWGS84_ELLIPSOID_ECCENTRICrb   ÚCONST_E2ÚpiÚ
CONST_PI_2Ú
CONST_PI_4rž   r¤   rN  rQ  rU  rK   rL   rM   Ú<module>rl     s×  ðò
õ #÷
÷ 
õ 
÷ .Û Û Û Û ÷õ ÷ SÑ Rß HÕ HÝ -Ý Ý "ò P€à€Ø€Ø€Ø€Ø€Ø%Ð Ø
€Ø€Ø*Ð Ø€
Ø€Ø€Ø
€Ø€
Ø(Ð ØÐ òÐ ð  ' s¨C xÑ0€
ˆIÓ 0Ø% z°:Ð&>ÀÐ&DÑE€�Ó Eô˜Ÿ™ô ð& .Ø#ðKØ3ðKàðKð ðKð ó	Kð* ×#Ñ#Øð)ð
 /3ñ)Øð)ð
 ,ð)ð ó)óX	ð ˜T˜F D˜LÑ)€€yÓ )÷nñ nób%óB9óx3ó>ô'ðX .Ø#ð3!Øð3!àð3!ð ð3!ð ó	3!ól
/ð3Øð3Ø!&ð3Ø;?ð3àó3òl:ð .Ø#ð2Ø"ð2àð2ð ð2ð ó	2ó<4ó")ôó*#óLDó$Eð  Ð Ø$Ð Ø%˜DŸI™IØÐ
 Ñ
"Ð%:¸AÑ%=Ñ
=Ñ=óÐ ð �6‰6�C‰<€Ø�W‰W�s‰]€
Ø�W‰W�s‰]€
ó
?ôDôóô!rL   