Ë
    JÿiÕ° ã                  ó¨  — d Z ddlmZ ddl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mZmZmZmZ ddl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 ddl m!Z! ddl"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.m/Z/m0Z0 ddl1m2Z2 ddl3m4Z4 ddl5m6Z6m7Z7 ddl8m9Z9m:Z: ddl;m<Z< ddl=m>Z> ddl?m@Z@ ddlAmBZB ddlCmDZD ddlEmFZFmGZG ddlHmIZI ddlJmKZK ddlLmMZMmNZNmOZOmPZPmQZQmRZRmSZS ddlTmUZUmVZVmWZW ddlXmYZY ddlZm[Z[m\Z\m]Z]m^Z^ dd l_m`Z` dd!lambZb dd"lcmdZdmeZemfZf dd#lgmhZh dd$limjZjmkZk dd%llmmZm dd&lnmoZompZp dd'lqmrZrmsZs dd(ltmuZumvZvmwZw dd)lxmyZymzZzm{Z{ dd*lm|Z|m}Z} dd+l~mZm€Z€ dd,l�m‚Z‚ dd-lƒm„Z„m…Z…m†Z† dd.l‡mˆZˆm‰Z‰mŠZŠm‹Z‹mŒZŒm�Z�mŽZŽ dd/l�m�Z�m‘Z‘m’Z’m“Z“m”Z”m•Z•m–Z–m—Z—m˜Z˜m™Z™mšZš dd0l›mœZœm�Z�mžZžmŸZŸm Z m¡Z¡m¢Z¢m£Z£ dd1l¤m¥Z¥m¦Z¦m§Z§m¨Z¨m©Z©mªZªm«Z«m¬Z¬m­Z­ d2d3l®m¯Z¯m°Z°m±Z±m²Z²m³Z³m´Z´mµZµm¶Z¶m·Z· d2d4l¸m¹Z¹mºZºm»Z»m¼Z¼ d2d5l½m¾Z¾m¿Z¿ erd2d6lÀmÁZÁmÂZÂ d2d7lÃmÄZÄ d2d8lÅmÆZÆmÇZÇmÈZÈmÉZÉ  G d9„ d:e¯«      ZÊ G d;„ d<eÊe¯eŠ   «      ZË G d=„ d>eÊe¯eŽ   «      ZÌdCdDd?„ZÍdEd@„ZÎ	 dF	 	 	 	 	 dGdA„ZÏ	 dF	 	 	 	 	 dHdB„ZÐy)Ias  
build123d topology

name: one_d.py
by:   Gumyr
date: January 07, 2025

desc:

This module defines the classes and methods for one-dimensional geometric entities in the build123d
CAD library. It focuses on `Edge` and `Wire`, representing essential topological elements like
curves and connected sequences of curves within a 3D model. These entities are pivotal for
constructing complex shapes, boundaries, and paths in CAD applications.

Key Features:
- **Edge Class**:
  - Represents curves such as lines, arcs, splines, and circles.
  - Supports advanced operations like trimming, offsetting, splitting, and projecting onto shapes.
  - Includes methods for geometric queries like finding tangent angles, normals, and intersection
    points.

- **Wire Class**:
  - Represents a connected sequence of edges forming a continuous path.
  - Supports operations such as closure, projection, and edge manipulation.

- **Mixin1D**:
  - Shared functionality for both `Edge` and `Wire` classes, enabling splitting, extrusion, and
    1D-specific operations.

This module integrates deeply with OpenCascade, leveraging its robust geometric and topological
operations. It provides utility functions to create, manipulate, and query 1D geometric entities,
ensuring precise and efficient workflows in 3D modeling tasks.

license:

    Copyright 2025 Gumyr

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

        http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.

é    )ÚannotationsN)ÚIterable)Úcombinations)ÚradiansÚinfÚpiÚcosÚcopysignÚceilÚfloor)ÚLiteralÚoverloadÚTYPE_CHECKING)ÚSelf)Úndarray)Úminimize)Ú
ConvexHull)Ú	BRep_Tool)ÚBRepAdaptor_CompCurveÚBRepAdaptor_Curve)ÚBRepAlgoAPI_CommonÚBRepAlgoAPI_SectionÚBRepAlgoAPI_Splitter)ÚBRepBuilderAPI_DisconnectedWireÚBRepBuilderAPI_EmptyWireÚBRepBuilderAPI_MakeEdgeÚBRepBuilderAPI_MakeFaceÚBRepBuilderAPI_MakePolygonÚBRepBuilderAPI_MakeWireÚBRepBuilderAPI_NonManifoldWire)ÚBRepExtrema_DistShapeShape)ÚBRepFilletAPI_MakeFillet2d)Ú	BRepGPropÚBRepGProp_Face)ÚBRepLibÚBRepLib_FindSurface)ÚBRepOffset_MakeOffset)ÚBRepOffsetAPI_MakeOffset)ÚBRepPrimAPI_MakeHalfSpace)ÚBRepProj_Projection)Ú	BRepTools)ÚGC_MakeArcOfCircleÚGC_MakeArcOfEllipse)ÚGCPnts_AbscissaPoint)ÚGProp_GProps)ÚGeom_BezierCurveÚGeom_ConicalSurfaceÚGeom_CylindricalSurfaceÚ
Geom_PlaneÚGeom_SurfaceÚGeom_TrimmedCurveÚ	Geom_Line)ÚGeom2d_CurveÚGeom2d_LineÚGeom2d_TrimmedCurve)ÚGeom2dAPI_InterCurveCurve)ÚGeomAPI_IntCSÚGeomAPI_InterpolateÚGeomAPI_PointsToBSplineÚGeomAPI_ProjectPointOnCurve)ÚGeomAbs_JoinType)ÚGeomAdaptor_Curve)ÚGeomFill_CorrectedFrenetÚGeomFill_FrenetÚGeomFill_TrihedronLaw)ÚHLRAlgo_Projector)ÚHLRBRep_AlgoÚHLRBRep_HLRToShape)ÚShapeAnalysis_FreeBounds)ÚShapeFix_ShapeÚShapeFix_Wireframe)ÚStandard_FailureÚStandard_NoSuchObject)ÚTColStd_Array1OfRealÚTColStd_HArray1OfBooleanÚTColStd_HArray1OfReal)ÚTColgp_Array1OfPntÚTColgp_Array1OfVecÚTColgp_HArray1OfPnt)ÚTopAbs_OrientationÚTopAbs_ShapeEnum)ÚTopExpÚTopExp_Explorer)ÚTopLoc_Location)ÚTopTools_HSequenceOfShapeÚ)TopTools_IndexedDataMapOfShapeListOfShapeÚTopTools_ListOfShape)ÚTopoDSÚTopoDS_CompoundÚTopoDS_EdgeÚTopoDS_FaceÚTopoDS_ShapeÚTopoDS_ShellÚTopoDS_Wire)Úgp_Ax1Úgp_Ax2Úgp_Ax3Úgp_CircÚgp_DirÚgp_Dir2dÚgp_ElipsÚgp_PntÚgp_Pnt2dÚgp_TrsfÚgp_Vec)ÚAngularDirectionÚCenterOfÚFrameMethodÚGeomTypeÚKeepÚKindÚPositionModeÚSide)	ÚDEG2RADÚ	TOLERANCEÚAxisÚColorÚLocationÚPlaneÚVectorÚ
VectorLikeÚloggeré   )	ÚShapeÚ	ShapeListÚ	SkipCleanÚTrimmingToolÚdowncastÚget_top_level_topods_shapesÚ	shapetypeÚ
topods_dimÚunwrap_topods_compound)Ú_extrude_topods_shapeÚ	isclose_bÚ_make_topods_face_from_wiresÚ_topods_bool_op)Útopo_explore_common_vertexÚVertex)ÚFaceÚShell)ÚSolid)ÚCompoundÚCurveÚSketchÚPartc                  óÚ  — e Zd ZdZed.d„«       Zed/d„«       Zed/d„«       Zed/d„«       Zed0d„«       Z	ed0d„«       Z
ed0d„«       Zed1d	„«       Ze	 	 	 	 	 	 d2d
„«       Z	 	 	 	 d3d„Zd4d„Zd4d„Zd5d„Zej(                  fd6d„Zd7d„Zd8d„Zd9d„Zd:d„Zej6                  ej:                  df	 	 	 	 	 	 	 	 	 d;d„Zej6                  ej:                  df	 	 	 	 	 	 	 	 	 d<d„Zd:d„Z e!jD                  e#jH                  df	 	 	 	 	 	 	 	 	 d=d„Z%d>d„Z&e'jP                  f	 	 	 	 	 	 	 d?d„Z)ej6                  f	 	 	 	 	 d@d„Z*ej6                  f	 	 	 	 	 dAd„Z+	 dB	 	 	 	 	 	 	 dCd„Z,	 	 dD	 	 	 	 	 	 	 dEd „Z-e.	 	 	 	 	 	 dFd!„«       Z/e.dGd"„«       Z/e.dHd#„«       Z/e.dId$„«       Z/e0jb                  fdJd%„Z/d:d&„Z2d'ej6                  e'jP                  f	 	 	 	 	 	 	 dKd(„Z3d'ej6                  f	 	 	 	 	 dLd)„Z4dMd*„Z5dNd+„Z6dOd,„Z7dPd-„Z8y)QÚMixin1Dz+Methods to add to the Edge and Wire classesc                 ó   — y)zDimension of Edges and Wiresr}   © ©Úselfs    úi/workspace/moltex-experiments/.pixi/envs/default/lib/python3.12/site-packages/build123d/topology/one_d.pyÚ_dimzMixin1D._dimÕ   s   € ð ó    c                ón   — | j                   €t        d«      ‚t        j                  | j                   «      S )z#Are the start and end points equal?z/Can't determine if empty Edge or Wire is closed)ÚwrappedÚ
ValueErrorr   Ú
IsClosed_sr˜   s    rš   Ú	is_closedzMixin1D.is_closedÚ   s/   € ð �<‰<ÐÜÐNÓOÐOÜ×#Ñ# D§L¡LÓ1Ð1rœ   c                ó†   — | j                   €t        d«      ‚| j                   j                  «       t        j                  k(  S )z*Does the Edge/Wire loop forward or reversez/Can't determine direction of empty Edge or Wire)rž   rŸ   ÚOrientationrR   ÚTopAbs_FORWARDr˜   s    rš   Ú
is_forwardzMixin1D.is_forwardá   s9   € ð �<‰<ÐÜÐNÓOÐOØ�|‰|×'Ñ'Ó)Ô-?×-NÑ-NÑNÐNrœ   c                ó*  — t        | «      }|D �cg c]  }t        || j                  dz  «      ‘Œ }}t        |d   |d   d¬«      }|j	                  «        |j                  «       }t        |t        j                  «      }|j                  «       S c c}w )a1  
        Check if the edge is an interior edge.

        An interior edge lies between surfaces that are part of the body (internal
        to the geometry) and does not form part of the exterior boundary.

        Returns:
            bool: True if the edge is an interior edge, False otherwise.
        éd   r   r}   F)Ú
PerformNow)
Útopo_explore_connected_facesÚoffset_topods_faceÚlengthr   ÚBuildr~   rU   ÚtaÚTopAbs_EDGEÚMore)r™   Útopods_face_pairÚfÚoffset_face_pairÚ	sectionorÚface_intersection_resultÚexplorers          rš   Úis_interiorzMixin1D.is_interiorè   s˜   € ô 8¸Ó=Ðá>Nó
Ù>N¸Ô˜q $§+¡+°Ñ"3Õ4Ð>Nð 	ð 
ô
 (Ø˜QÑÐ!1°!Ñ!4Àô
ˆ	ð 	�‰ÔØ#,§?¡?Ó#4Ð ô #Ð#;¼R¿^¹^ÓLˆØ�}‰}‹Ðùò
s   � Bc                óH   — t        j                  | j                  «       «      S )zEdge or Wire length)r.   ÚLength_sÚgeom_adaptorr˜   s    rš   r«   zMixin1D.length  s   € ô $×,Ñ,¨T×->Ñ->Ó-@ÓAÐArœ   c                óª   — | j                  «       }	 |j                  «       }|j                  «       S # t        t        f$ r}t	        d«      |‚d}~ww xY w)a  Calculate the radius.

        Note that when applied to a Wire, the radius is simply the radius of the first edge.

        Args:

        Returns:
          radius

        Raises:
          ValueError: if kernel can not reduce the shape to a circular edge

        z&Shape could not be reduced to a circleN)r¹   ÚCirclerK   rJ   rŸ   ÚRadius)r™   ÚgeomÚcircÚerrs       rš   ÚradiuszMixin1D.radius	  sY   € ð × Ñ Ó"ˆð	PØ—;‘;“=ˆDð �{‰{‹}Ðøô &Ô'7Ð8ò 	PÜÐEÓFÈCÐOûð	Pús   ’2 ²AÁAÁAc                 ó   — y)z>volume - the volume of this Edge or Wire, which is always zeroç        r—   r˜   s    rš   ÚvolumezMixin1D.volume  s   € ð rœ   c                ó¼   — t         j                  t        t         j                  t        t         j
                  t        i}t        |«      } ||   t        |«      «      S )z6Returns the right type of wrapper, given a OCCT object)	r­   ÚTopAbs_VERTEXrŒ   r®   ÚEdgeÚTopAbs_WIREÚWirer„   r‚   )ÚclsÚobjÚconstructor_lutÚ
shape_types       rš   ÚcastzMixin1D.cast&  sI   € ô ×ÑœfÜ�N‰NœDÜ�N‰NœDð
ˆô ˜s“^ˆ
à*ˆ˜zÑ*¬8°C«=Ó9Ð9rœ   c                ó   — t         S )z9Unused - only here because Mixin1D is a subclass of Shape)ÚNotImplemented©rÉ   rÊ   Ú	directions      rš   ÚextrudezMixin1D.extrude5  s
   € ô
 Ðrœ   c                óÀ  — |€g }n@t        |t        «      r|gn|D ��cg c]   }|�t        |j                  «      D ]  }|‘Œ Œ" }}}|s| S t	        d„ |D «       «      st        d«      ‚|D �cg c]  }t        j                  |«      ‘Œ }}|D ��cg c]  }|j                  «       D ]  }|‘Œ Œ }}}| j                  €!t        |«      dk(  r|d   }	n3	 t        |«      }	n&	 t        | j                  «       t        |«      z   «      }	t         j"                  r t        |	t$        «      s|	j#                  «       }	t        |	j                  «       «      dk(  r|	j'                  «       }	|	S |	}	|	S c c}}w c c}w c c}}w # t        $ rA  |d   j                  |dd Ž }	t        | «      j                  dk(  r t        | «      |	«      }	Y Œ¼w xY w# t        $ r  | j                  |Ž }	Y ŒÚw xY w)z"fuse shape to wire/edge operator +Nc              3  ó8   K  — | ]  }t        |«      d k(  –— Œ y­w)r}   N)r…   )Ú.0Úsummands     rš   Ú	<genexpr>z"Mixin1D.__add__.<locals>.<genexpr>R  s   è ø€ ÐD¹8°”:˜gÓ&¨!Õ+¹8ùs   ‚z0Only shapes with the same dimension can be addedr}   r   é   )Ú
isinstancer~   rƒ   rž   ÚallrŸ   r•   rÍ   ÚedgesÚlenrÈ   Ú	ExceptionÚfuseÚtypeÚorderr   r€   ÚcleanÚlistÚedge)
r™   ÚotherÚsummandsÚoÚshapeÚsrÖ   ÚeÚsummand_edgesÚ	sum_shapes
             rš   Ú__add__zMixin1D.__add__>  sä  € ð ˆ=Ø‰Hô
 &0°´uÔ%=˜5™'À5ÐHôñ I�AØ�=Ü8¸¿¹ÖC�Eò	 ð Dð	 àHð ñ ñ ØˆKäÑD¹8ÓDÔDÜÐOÓPÐPñ .6Ó6©X¨”G—L‘L •O¨XˆÐ6Ù*2ÔL©(˜w¸G¿M¹M¾O°qš¸O˜¨(ˆÑLà�<‰<ÐÜ�8‹} Ò!Ø$ Q™K‘	ð:Ü $ ]Ó 3‘Ið1Ü  §¡£´	¸-Ó0HÑ!HÓI�	ô �?Š?¤:¨i¼Ô#>Ø!Ÿ™Ó)ˆIô ),¨I¯O©OÓ,=Ó(>À!Ò(C�I—N‘NÓ$ˆ	àÐð JSˆ	àÐùóQùò 7ùÛLøô !ò :Ø 0 ¨¡× 0Ñ 0°(¸1¸2°,Ð ?�IÜ˜D“z×'Ñ'¨1Ò,Ø$.¤D¨£J¨yÓ$9˜	ùð:ûô ò 1Ø%˜DŸI™I xÐ0’	ð1ús6   ž%E$Á+E*ÂE/ÃE5 Ã%G Å5AF?Æ>F?ÇGÇGc                ó$   — | j                  |«      S )zPosition on wire operator @©Úposition_at©r™   Úpositions     rš   Ú
__matmul__zMixin1D.__matmul__q  ó   € à×Ñ Ó)Ð)rœ   c                ó$   — | j                  |«      S )zTangent on wire operator %)Ú
tangent_atrð   s     rš   Ú__mod__zMixin1D.__mod__u  s   € à�‰˜xÓ(Ð(rœ   c                ó$   — | j                  |«      S )zLocation on wire operator ^©Úlocation_atrð   s     rš   Ú__xor__zMixin1D.__xor__y  ró   rœ   c                ód  — |t         j                  k(  r| j                  d«      }|S |t         j                  k(  rEt	        «       }t        j                  | j                  |«       t        |j                  «       «      }|S |t         j                  k(  r| j                  «       j                  «       }S )zàCenter of object

        Return the center based on center_of

        Args:
            center_of (CenterOf, optional): centering option. Defaults to CenterOf.GEOMETRY.

        Returns:
            Vector: center
        ç      à?)rm   ÚGEOMETRYrï   ÚMASSr/   r#   ÚLinearProperties_srž   rz   ÚCentreOfMassÚBOUNDING_BOXÚbounding_boxÚcenter)r™   Ú	center_ofÚmiddleÚ
propertiess       rš   r  zMixin1D.center}  s˜   € ð œ×)Ñ)Ò)Ø×%Ñ% cÓ*ˆFð ˆð œ(Ÿ-™-Ò'Ü%›ˆJÜ×(Ñ(¨¯©°zÔBÜ˜J×3Ñ3Ó5Ó6ˆFð ˆð œ(×/Ñ/Ò/Ø×&Ñ&Ó(×/Ñ/Ó1ˆFØˆrœ   c                óâ  ‡— g }| g|¢D �cg c]  }|€Œ|‘Œ	 }}t        d„ |D «       «      rt        d«      ‚d}|D ��cg c]  }|j                  «       D ]  }|‘Œ Œ }}}t        d„ |D «       «      r”|D �cg c]  }t	        |dz  |dz  «      ‘Œ }	}t        d„ t        |	d«      D «       «      rY|	d   j                  }
|	d   j                  }|	d   j                  «       j                  }t        |
|¬«      Š‰j                  d	«      }|�€¼t        t        d
„ |«      «      }t        d„ |«      }|D �cg c]  }|j                  dd«      ‘Œ }}||z   }|D ]`  }|j                  t         j"                  k(  rdnd}|j%                  t'        |«      D �cg c]  }|j)                  ||dz
  z  «      ‘Œ c}«       Œb t        t+        |«      «      }i }t        |d«      D ];  }|d   |d   z
  }|d   |d   z
  }d|j-                  |«      j.                  z  }|||<   Œ= |t1        t        |j3                  «       «      «      d      }|d   |d   z
  j5                  «       }|d   |d   z
  j-                  |«      }	 t        t7        |t9        ddd«      «      dz  |¬«      Š‰j                  d	«      Št        ˆfd„|D «       «      }|r‰}|S d}|S |S c c}w c c}}w c c}w c c}w c c}w # t        $ r d}Y |S w xY w)a‡  common_plane

        Find the plane containing all the edges/wires (including self). If there
        is no common plane return None. If the edges are coaxial, select one
        of the infinite number of valid planes.

        Args:
            lines (sequence of Edge | Wire): edges in common with self

        Returns:
            None |  Plane: Either the common plane or None
        Nc              3  óJ   K  — | ]  }t        |t        t        f«       –— Œ y ­w©N)rÙ   rÆ   rÈ   )rÕ   Úlines     rš   r×   z'Mixin1D.common_plane.<locals>.<genexpr>¦  s   è ø€ ÐH¹i°d”:˜d¤T¬4 LÓ1Ô1¹iùs   ‚!#zOnly Edges or Wires are validc              3  óV   K  — | ]!  }|j                   t        j                  k(  –— Œ# y ­wr	  )Ú	geom_typero   ÚLINE©rÕ   ré   s     rš   r×   z'Mixin1D.common_plane.<locals>.<genexpr>¬  s   è ø€ Ð?±Y°ˆq�{‰{œhŸm™mÕ+±Yùs   ‚')r   c              3  óD   K  — | ]  \  }}|j                  |«      –— Œ y ­wr	  )Ú
is_coaxial)rÕ   Úa0Úa1s      rš   r×   z'Mixin1D.common_plane.<locals>.<genexpr>®  s    è ø€ ÐLÑ3K©¨¨R�2—=‘= ×$Ñ3Kùs   ‚ é   )Úz_dir)r   r   c                ó    — | j                   dk  S ©Ngšd~ÅQJ©r«   ©r
  s    rš   Ú<lambda>z&Mixin1D.common_plane.<locals>.<lambda>·  s   € °D·K±KÀ4Ò4Grœ   c                ó    — | j                   dkD  S r  r  r  s    rš   r  z&Mixin1D.common_plane.<locals>.<lambda>¸  s   € °·±¸tÒ1Crœ   rü   é
   é   r}   é   éÿÿÿÿ)Úoriginr  c              3  ó@   •K  — | ]  }‰j                  |«      –— Œ y ­wr	  ©Úcontains)rÕ   ÚpÚc_planes     €rš   r×   z'Mixin1D.common_plane.<locals>.<genexpr>Ø  s   øè ø€ ÐA¹&°Q˜W×-Ñ-¨a×0¹&ùó   ƒ)ÚanyrŸ   rÛ   rÚ   rv   r   rñ   rÑ   Úto_planeÚx_dirry   Úshift_originrâ   ÚfilterÚtrim_to_lengthr  ro   r  ÚextendÚrangerï   ÚsetÚcrossr«   ÚsortedÚkeysÚ
normalizedÚsumrz   )r™   ÚlinesÚpointsr
  Ú	all_linesÚresultÚlré   Ú	all_edgesÚas_axisr  r(  r  Únormal_linesÚinfinite_linesÚshortened_linesÚ
num_pointsÚiÚextreme_areasÚsubsetÚvector1Úvector2ÚareaÚextremesÚcommonr$  s                            @rš   Úcommon_planezMixin1D.common_plane’  s  ø€ ð   "ˆà"˜^ U™^ó(
Ù+�T¨tÑ/?ŠD˜^ð 	ð (
ô ÑH¹iÓHÔHÜÐ<Ó=Ð=àˆá,5Ô I©I q¸q¿w¹w¾y¸!¢¸y ¨Iˆ	Ñ IÜÑ?±YÓ?Ô?Ù3<Ó=±9¨a”t˜A ™E 1 q¡5Õ)°9ˆGÐ=ÜÑL´<ÀÈÔ3KÓLÔLØ  ™×,Ñ,�Ø ™
×,Ñ,�Ø ™
×+Ñ+Ó-×3Ñ3�Ü ¨eÔ4�Ø ×-Ñ-¨fÓ5�à‰>ä¤Ñ'GÈÓ SÓTˆLÜ#Ñ$CÀYÓOˆNÙBPÓQÁ.¸Q˜q×/Ñ/°°RÕ8À.ˆOÐQØ$ Ñ6ˆIã!�Ø"&§.¡.´H·M±MÒ"A™QÀq�
Ø—‘ÜEJÈ:ÔEVÓWÑEVÀ�T×%Ñ% a¨:¸©>Ñ&:Õ;ÐEVÑWõð "ô
 œ#˜f›+Ó&ˆFØˆMÜ& v¨qÖ1�Ø  ™) f¨Q¡iÑ/�Ø  ™) f¨Q¡iÑ/�Ø˜gŸm™m¨GÓ4×;Ñ;Ñ<�Ø&,�˜dÒ#ð	 2ð %¤V¬D°×1CÑ1CÓ1EÓ,FÓ%GÈÑ%KÑLˆHð ˜a‘[ 8¨A¡;Ñ.×:Ñ:Ó<ˆEØ˜a‘[ 8¨A¡;Ñ.×5Ñ5°eÓ<ˆEð5ÜÜ ¬&°°A°q«/Ó:¸QÑ>Àuô�ð "×.Ñ.¨vÓ6�ô ÓA¹&ÓAÓA�Ù$*˜�àˆð 15�àˆˆvˆùòq(
ùó !Jùâ=ùò Rùò Xøô( ò à‘ð ˆðús3   ‹K“K½K
Á4KÄ.KÆK
É/6K ËK.Ë-K.c                ó.   — t        j                  | d«      S )zReturn the EdgerÆ   ©r~   Úget_single_shaper˜   s    rš   rã   zMixin1D.edgeÝ  ó   € ä×%Ñ% d¨FÓ3Ð3rœ   c                óV   — t        j                  | d«      }|j                  d„ d¬«      S )z#edges - all the edges in this ShaperÆ   c                ó@   — t        j                  | j                  «      S r	  )r   ÚDegenerated_srž   )ré   s    rš   r  zMixin1D.edges.<locals>.<lambda>å  s   € ”i×-Ñ-¨a¯i©iÔ8rœ   T)Úreverse)r~   Úget_shape_listÚ	filter_by)r™   Ú	edge_lists     rš   rÛ   zMixin1D.edgesá  s1   € ä×(Ñ(¨¨vÓ6ˆ	Ø×"Ñ"Ù8À$ð #ó 
ð 	
rœ   c                óv   — | j                  «       }|j                  «       }t        |j                  |«      «      S )zhThe end point of this edge.

        Note that circles may have identical start and end points.
        )r¹   ÚLastParameterrz   ÚValue)r™   ÚcurveÚumaxs      rš   Ú	end_pointzMixin1D.end_pointè  s4   € ð
 ×!Ñ!Ó#ˆØ×"Ñ"Ó$ˆä�e—k‘k $Ó'Ó(Ð(rœ   Fc           
     ó  — | j                  «       }|t        j                  k(  r| j                  |«      }n| j                  || j                  z  «      }|t
        j                  k(  rt        «       }n
t        «       }|j                  |«       t        «       t        «       t        «       }
}	}|j                  |||	|
«       |j                  |«      }t        «       }|rH|j                  t        |t!        ddd«      t!        |	j#                  «       «      «      t        «       «       nS|j                  t        |t!        |j#                  «       «      t!        |	j#                  «       «      «      t        «       «       t%        t'        |«      «      S )au  Locations along curve

        Generate a location along the underlying curve.

        Args:
            distance (float): distance or parameter value
            position_mode (PositionMode, optional): position calculation mode.
                Defaults to PositionMode.PARAMETER.
            frame_method (FrameMethod, optional): moving frame calculation method.
                Defaults to FrameMethod.FRENET.
            planar (bool, optional): planar mode. Defaults to False.

        Returns:
            Location: A Location object representing local coordinate system
                at the specified distance.
        r   r}   )r¹   rr   Ú	PARAMETERÚparam_atr«   rn   ÚFRENETrB   rA   ÚSetCurverk   ÚD0rU  rj   ÚSetTransformationrc   re   ÚXYZrx   rV   )r™   ÚdistanceÚposition_modeÚframe_methodÚplanarrV  ÚparamÚlawÚtangentÚnormalÚbinormalÚpntÚtransformations                rš   rù   zMixin1D.location_atò  s'  € ð. ×!Ñ!Ó#ˆàœL×2Ñ2Ò2Ø—M‘M (Ó+‰Eà—M‘M (¨T¯[©[Ñ"8Ó9ˆEð œ;×-Ñ-Ò-Ü!Ó#‰Cä*Ó,ˆCà�‰�UÔä$*£H¬f«h¼»˜�ˆà�‰ˆu�g˜v xÔ0Ø�k‰k˜%Ó ˆä ›ˆÙØ×,Ñ,Ü�sœF 1 a¨›O¬V°F·J±J³LÓ-AÓBÄFÃHõð ×,Ñ,Ü�sœF 7§;¡;£=Ó1´6¸&¿*¹*»,Ó3GÓHÌ&Ë(ôô œ¨Ó7Ó8Ð8rœ   c           	     óP   — |D �cg c]  }| j                  ||||«      ‘Œ c}S c c}w )a„  Locations along curve

        Generate location along the curve

        Args:
            distances (Iterable[float]): distance or parameter values
            position_mode (PositionMode, optional): position calculation mode.
                Defaults to PositionMode.PARAMETER.
            frame_method (FrameMethod, optional): moving frame calculation method.
                Defaults to FrameMethod.FRENET.
            planar (bool, optional): planar mode. Defaults to False.

        Returns:
            list[Location]: A list of Location objects representing local coordinate
                systems at the specified distances.
        rø   )r™   Ú	distancesrb  rc  rd  Úds         rš   Ú	locationszMixin1D.locations)  s8   € ñ0 OXó
ÙNWÈˆD×Ñ˜Q ¨|¸VÕDÈiñ
ð 	
ùò 
s   …#c                ó`  — | j                  «       }| j                  }|t        j                  k(  r9|j	                  «       }t        |j                  «       j                  «       «      }|S |t        j                  k(  r9|j                  «       }t        |j                  «       j                  «       «      }|S t        | j                  d¬«      }|j                  «       }t        |t        «      r9|j                  «       }t        |j                  «       j                  «       «      }|S t!        d«      ‚)zˆCalculate the normal Vector. Only possible for planar curves.

        :return: normal vector

        Args:

        Returns:

        T)Ú	OnlyPlanezNormal not defined)r¹   r  ro   ÚCIRCLEr»   rz   rv   Ú	DirectionÚELLIPSEÚEllipser&   rž   ÚSurfacerÙ   r3   ÚPlnrŸ   )	r™   rV  Úgtyper¾   Úreturn_valueÚellÚfind_surfaceÚsurfÚplns	            rš   rh  zMixin1D.normalD  só   € ð ×!Ñ!Ó#ˆØ—‘ˆà”H—O‘OÒ#Ø—<‘<“>ˆDÜ! $§)¡)£+×"7Ñ"7Ó"9Ó:ˆLð Ðð ”h×&Ñ&Ò&Ø—-‘-“/ˆCÜ! #§(¡(£*×"6Ñ"6Ó"8Ó9ˆLð Ðô /¨t¯|©|ÀtÔLˆLØ×'Ñ'Ó)ˆDä˜$¤
Ô+Ø—h‘h“j�Ü% c§h¡h£j×&:Ñ&:Ó&<Ó=�ð Ðô !Ð!5Ó6Ð6rœ   Tc           	     óR  — t         j                  t        j                  t         j                  t        j
                  t         j                  t        j                  i}t        | t        «      r| nt        | g«      }t        |j                  «       «      dk(  rM|j                  «       d   }|j                  dd«      |j                  dd«      g}t        |«      j                  }	n|j                  }	t        «       }
|
j                  ||   «       |
j!                  |	«       |
j#                  |«       t%        |
j'                  «       «      }t        |t(        «      rt+        |d¬«      }t        |t,        «      rt        |«      }nt/        d«      ‚|t0        j2                  k7  �rT|j                  «       }g g g g}d}|D ]u  }|j4                  t6        j8                  k(  rB|j:                  |j=                  d«      k(  s|j:                  |j=                  d«      k(  r|dz  }Œb||   j?                  |«       Œw |dxx   |d	   z  cc<   |dd	 D �cg c]  }t        |«      ‘Œ }}|D �cg c]  }|j=                  d«      ‘Œ }}|D �cg c]4  }|jA                  d«      jC                  ||j=                  d«      z
  «      ‘Œ6 }}|t0        jD                  k(  r|tG        |d   |d   kD  «         }n|tG        |d   |d   k  «         }|r÷|j=                  d«      }|j=                  d«      }|j=                  d«      }|j=                  d«      }||z
  jH                  tK        |«      z
  tL        k  r-tN        jQ                  ||«      }tN        jQ                  ||«      }n,tN        jQ                  ||«      }tN        jQ                  ||«      }t        |j                  «       |j                  «       z   tS        ||g«      z   «      }|j                  «       }t        |«      dk(  r|d   S |S c c}w c c}w c c}w )
aB  2d Offset

        Offsets a planar edge/wire

        Args:
            distance (float): distance from edge/wire to offset
            kind (Kind, optional): offset corner transition. Defaults to Kind.ARC.
            side (Side, optional): side to place offset. Defaults to Side.BOTH.
            closed (bool, optional): if Side!=BOTH, close the LEFT or RIGHT
                offset. Defaults to True.
        Raises:
            RuntimeError: Multiple Wires generated
            RuntimeError: Unexpected result type

        Returns:
            Wire: offset wire
        r}   r   rÂ   rü   ç      ð?T)ÚfullyzUnexpected result typer  )*rq   ÚARCr?   ÚGeomAbs_ArcÚINTERSECTIONÚGeomAbs_IntersectionÚTANGENTÚGeomAbs_TangentrÙ   rÈ   rÜ   rÛ   Útrimrž   r(   ÚInitÚAddWireÚPerformr‚   r~   r[   r†   r`   ÚRuntimeErrorrs   ÚBOTHr  ro   rr  Ú
arc_centerrï   Úappendrõ   Úget_signed_angleÚLEFTÚintr«   Úabsru   rÆ   Ú	make_liner   )r™   ra  ÚkindÚsideÚclosedÚ	kind_dictr
  rã   rÛ   Útopods_wireÚoffset_builderrÊ   Úoffset_wireÚoffset_edgesÚedges_to_keepr?  ÚwiresÚwÚcentersÚcÚanglesÚself0Úself1Úend0Úend1Úedge0Úedge1s                              rš   Ú	offset_2dzMixin1D.offset_2dc  s¤  € ô4 �H‰HÔ&×2Ñ2Ü×ÑÔ/×DÑDÜ�L‰LÔ*×:Ñ:ð
ˆ	ô
 " $¬Ô-‰t´4¸¸³<ˆô ˆt�z‰z‹|Ó Ò!Ø—:‘:“< ‘?ˆDØ—Y‘Y˜s CÓ(¨$¯)©)°C¸Ó*=Ð>ˆEÜ˜u›+×-Ñ-‰KàŸ,™,ˆKä1Ó3ˆØ×Ñ˜I d™OÔ,à×Ñ˜{Ô+Ø×Ñ˜xÔ(ä�~×+Ñ+Ó-Ó.ˆÜ�cœ?Ô+Ü(¨°DÔ9ˆCÜ�cœ;Ô'Ü˜s›)‰KäÐ7Ó8Ð8à”4—9‘9Óà&×,Ñ,Ó.ˆLØ.0°"°b¨\ˆMØˆAÛ$�Ø—>‘>¤X§_¡_Ò4Ø—O‘O t×'7Ñ'7¸Ó':Ò:Ø—‘¨$×*:Ñ*:¸1Ó*=Ò=à˜‘F‘Aà! !Ñ$×+Ñ+¨DÕ1ð %ð ˜!Ó ¨aÑ 0Ñ0ÓØ.;¸A¸aÑ.@ÓAÑ.@ U”T˜%•[Ð.@ˆEÐAÙ38Ó9±5¨a�q—}‘} SÕ)°5ˆGÐ9ñ !óá �Að —‘ Ó"×3Ñ3°A¸×8HÑ8HÈÓ8KÑ4KÕLØ ð ð ð ”t—y‘yÒ Ø#¤C¨¨q©	°F¸1±IÑ(=Ó$>Ñ?‘à#¤C¨¨q©	°V¸A±YÑ(>Ó$?Ñ@�áØ×(Ñ(¨Ó+�Ø×(Ñ(¨Ó+�Ø"×.Ñ.¨qÓ1�Ø"×.Ñ.¨qÓ1�Ø˜D‘L×(Ñ(¬3¨x«=Ñ8¼IÒEÜ ŸN™N¨5°$Ó7�EÜ ŸN™N¨5°$Ó7‘Eä ŸN™N¨5°$Ó7�EÜ ŸN™N¨5°$Ó7�EÜ"Ø—J‘J“L ;×#4Ñ#4Ó#6Ñ6¼ÀEÈ5À>Ó9RÑRó�ð #×(Ñ(Ó*ˆÜ"% lÓ"3°qÒ"8ˆ|˜A‰ÐI¸kÐIùò7 BùÚ9ùòs   É	PÉ!PÉ?9P$c                ó¤   — | j                  «       }t        j                  |«      }t        |||z  |j                  «       «      j	                  «       S )zèParameter along a curve

        Compute parameter value at the specified normalized distance.

        Args:
            d (float): normalized distance (0.0 >= d >= 1.0)

        Returns:
            float: parameter value
        )r¹   r.   r¸   ÚFirstParameterÚ	Parameter)r™   ra  rV  r«   s       rš   r[  zMixin1D.param_atÄ  sK   € ð ×!Ñ!Ó#ˆä%×.Ñ.¨uÓ5ˆÜ#Ø�6˜HÑ$ e×&:Ñ&:Ó&<ó
ç
‰)‹+ð	rœ   c                óî   — | j                  |«      }t        || j                  |«      |j                  ¬«      }t        j                  ||j                  |z  dz  z   ||j                  |z  dz  z
  «      }|S )a‹  perpendicular_line

        Create a line on the given plane perpendicular to and centered on beginning of self

        Args:
            length (float): line length
            u_value (float): position along line between 0.0 and 1.0
            plane (Plane, optional): plane containing perpendicular line. Defaults to Plane.XY.

        Returns:
            Edge: perpendicular line
        )r  r(  r  r  )rï   ry   rõ   r  rÆ   r“  Úy_dir)r™   r«   Úu_valueÚplaneÚstartÚlocal_planer
  s          rš   Úperpendicular_linezMixin1D.perpendicular_lineÖ  sy   € ð × Ñ  Ó)ˆÜØ §¡°Ó 8ÀÇÁô
ˆô �~‰~Ø�K×%Ñ%¨Ñ.°Ñ2Ñ2Ø�K×%Ñ%¨Ñ.°Ñ2Ñ2ó
ˆð ˆrœ   c                óÜ   — | j                  «       }|t        j                  k(  r| j                  |«      }n| j                  || j                  z  «      }t        |j                  |«      «      S )a`  Position At

        Generate a position along the underlying curve.

        Args:
            distance (float): distance or parameter value
            position_mode (PositionMode, optional): position calculation mode. Defaults to
                PositionMode.PARAMETER.

        Returns:
            Vector: position on the underlying curve
        )r¹   rr   rZ  r[  r«   rz   rU  )r™   ra  rb  rV  re  s        rš   rï   zMixin1D.position_atï  sY   € ð ×!Ñ!Ó#ˆàœL×2Ñ2Ò2Ø—M‘M (Ó+‰Eà—M‘M (¨T¯[©[Ñ"8Ó9ˆEä�e—k‘k %Ó(Ó)Ð)rœ   c                óL   — |D �cg c]  }| j                  ||«      ‘Œ c}S c c}w )ao  Positions along curve

        Generate positions along the underlying curve

        Args:
            distances (Iterable[float]): distance or parameter values
            position_mode (PositionMode, optional): position calculation mode.
                Defaults to PositionMode.PARAMETER.

        Returns:
            list[Vector]: positions along curve
        rî   )r™   rm  rb  rn  s       rš   Ú	positionszMixin1D.positions  s*   € ñ" =FÓF¹I°q�× Ñ   MÕ2¸IÑFÐFùÒFs   …!c                ó  — | j                   €t        d«      ‚t        | j                   |j                   t        |«      j	                  «       «      }|j                  «       }|r‹t        «       }|j                  | j                   «       t        }t        |«      D ]P  }|j                  |«       |j                  «        |j                  «       }	|	|k  sŒ:|	}t        j                  |«      }
ŒR 
S t        d„ t        |«      D «       «      }
|
S )zÄProject onto a face along the specified direction

        Args:
          face: Face:
          direction: VectorLike:
          closest: bool:  (Default value = True)

        Returns:

        z#Can't project an empty Edge or Wirec              3  óF   K  — | ]  }t         j                  |«      –— Œ y ­wr	  )r•   rÍ   )rÕ   rç   s     rš   r×   z"Mixin1D.project.<locals>.<genexpr>C  s   è ø€ ð %Ù1T¨”—‘˜U×#Ñ1Tùs   ‚!)rž   rŸ   r*   rz   Úto_dirr~   r!   ÚLoadS1r   rƒ   ÚLoadS2rŠ  rU  r•   rÍ   r   )r™   ÚfacerÑ   ÚclosestÚbldrÚshapesÚ	dist_calcÚmin_distrç   Údistry  s              rš   ÚprojectzMixin1D.project  sñ   € ð �<‰<ÐÜÐBÓCÐCä"Ø�L‰L˜$Ÿ,™,¬¨yÓ(9×(@Ñ(@Ó(Bó
ˆð #'§*¡*£,ˆñ
 Ü2Ó4ˆIØ×Ñ˜TŸ\™\Ô*äˆHô 5°VÖ<�Ø× Ñ  Ô'Ø×!Ñ!Ô#Ø —‘Ó(�à˜(“?Ø#�HÜ#*§<¡<°Ó#6‘Lð =ð Ðô	 %ñ %Ü1LÈVÔ1Tó%ó ˆLð Ðrœ   Nc                ó¸  — d„ }t        «       }|j                  | j                  «       t        |«      }|rt        |«      n| j	                  «       }||z
  j                  «       }t        |«      j                  «       }t        «       }|j                  t        |j                  «       |j                  «       «      «       |j                  |j                  «       «       t        |«      }|j                  |«       |j                  «        |j                  «        t!        |«      }	g }
|	j#                  «       |	j%                  «       |	j'                  «       fD ]3  }|j)                  «       rŒ|
j+                   |t-        |«      «      «       Œ5 g }|	j/                  «       |	j1                  «       |	j3                  «       fD ]3  }|j)                  «       rŒ|j+                   |t-        |«      «      «       Œ5 |
D ]  }t5        j6                  |t8        «       Œ |D ]  }t5        j6                  |t8        «       Œ t;        d„ |
D «       «      }
t;        d„ |D «       «      }|
|fS )aÿ  project_to_viewport

        Project a shape onto a viewport returning visible and hidden Edges.

        Args:
            viewport_origin (VectorLike): location of viewport
            viewport_up (VectorLike, optional): direction of the viewport y axis.
                Defaults to (0, 0, 1).
            look_at (VectorLike, optional): point to look at.
                Defaults to None (center of shape).

        Returns:
            tuple[ShapeList[Edge],ShapeList[Edge]]: visible & hidden Edges
        c                óô   — g }t        | t        j                  «      }|j                  «       rKt	        |j                  «       «      }|j                  |«       |j                  «        |j                  «       rŒK|S r	  )rU   rS   r®   r¯   r‚   ÚCurrentrŽ  ÚNext)ÚcompoundrÛ   rµ   rã   s       rš   Úextract_edgesz2Mixin1D.project_to_viewport.<locals>.extract_edges^  sa   € ØˆEô ' xÔ1A×1MÑ1MÓNˆHð —-‘-”/Ü × 0Ñ 0Ó 2Ó3�Ø—‘˜TÔ"Ø—‘”ð —-‘-•/ð
 ˆLrœ   c              3  ó2   K  — | ]  }t        |«      –— Œ y ­wr	  ©rÆ   r  s     rš   r×   z.Mixin1D.project_to_viewport.<locals>.<genexpr>œ  s   è ø€ Ð!A±=¨a¤$ q§'±=ùó   ‚c              3  ó2   K  — | ]  }t        |«      –— Œ y ­wr	  rÊ  r  s     rš   r×   z.Mixin1D.project_to_viewport.<locals>.<genexpr>�  s   è ø€ Ð ?±,¨Q¤ a§±,ùrË  )rE   ÚAddrž   rz   r  r2  rb   ÚSetAxisra   Úto_pntr¸  ÚSetYDirectionrD   Ú	ProjectorÚUpdateÚHiderF   Ú	VCompoundÚRg1LineVCompoundÚOutLineVCompoundÚIsNullr,  r‚   Ú	HCompoundÚOutLineHCompoundÚRg1LineHCompoundr%   ÚBuildCurves3d_sru   r   )r™   Úviewport_originÚviewport_upÚlook_atrÈ  Úhidden_line_removalÚprojection_dirÚcamera_coordinate_systemÚ	projectorÚ
hlr_shapesÚvisible_edgesrÛ   Úhidden_edgesrã   s                 rš   Úproject_to_viewportzMixin1D.project_to_viewportI  s  € ò*	ô +›nÐØ×Ñ §¡Ô-ä  Ó1ˆÙ%,”&˜”/°$·+±+³-ˆØ"1°GÑ";×!GÑ!GÓ!IˆÜ˜[Ó)×4Ñ4Ó6ˆÜ#)£8Ð Ø ×(Ñ(Ü�?×)Ñ)Ó+¨^×-BÑ-BÓ-DÓEô	
ð 	!×.Ñ.¨{×/AÑ/AÓ/CÔDÜ%Ð&>Ó?ˆ	à×%Ñ% iÔ0Ø×"Ñ"Ô$Ø× Ñ Ô"ä'Ð(;Ó<ˆ
ð ˆà× Ñ Ó"Ø×'Ñ'Ó)Ø×'Ñ'Ó)ó
ˆEð
 —<‘<•>Ø×$Ñ$¡]´8¸E³?Ó%CÕDð
ð ˆà× Ñ Ó"Ø×'Ñ'Ó)Ø×'Ñ'Ó)ó
ˆEð
 —<‘<•>Ø×#Ñ#¡M´(¸5³/Ó$BÕCð
ó "ˆDÜ×#Ñ# D¬)Õ4ð "ã ˆDÜ×#Ñ# D¬)Õ4ð !ô "Ñ!A±=Ó!AÓAˆÜ Ñ ?±,Ó ?Ó?ˆà˜|Ð,Ð,rœ   c                 ó   — y)z split and keep inside or outsideNr—   ©r™   ÚtoolÚkeeps      rš   ÚsplitzMixin1D.split¡  ó   � rœ   c                 ó   — y)z%split and return the unordered piecesNr—   rè  s      rš   rë  zMixin1D.split§  rì  rœ   c                 ó   — y)z!split and keep inside and outsideNr—   rè  s      rš   rë  zMixin1D.split«  rì  rœ   c                 ó   — y)zsplit and keep inside (default)Nr—   )r™   ré  s     rš   rë  zMixin1D.split²  rì  rœ   c                ó8  ‡ — t        «       }|j                  ‰ j                  «       t        |t        «      r#t        |j                  «      j                  «       n|j                  }t        «       }|j                  |«       t        «       }|j                  |«       |j                  |«       |j                  «        t        |j                  «       «      }t        |t        «      rt        |d«      }|t        j                   k(  rt#        ˆ fd„t%        |«      D «       «      S t        |t        «      �s&t        |t&        «      r>t)        |t*        j,                  «      }t/        j0                  |j3                  «       «      }	n|}	t5        «       }
t7        «       }t9        j:                  |	«      \  }}}}t=        |	«      j?                  ||z   dz  ||z   dz  |
|«       tA        |jC                  «       |jE                  «       |jG                  «       «      jI                  «       }tA        |
«      }
|
|z   }tK        ||jM                  «       «      }|jO                  «       }g }g }tQ        «       }t%        |«      D ]³  }‰ jR                  jU                  |«      }t        |t        «      r-|jW                  |«      jY                  «       jF                  dk\  }nDt[        |fft]        «       «      }t_        j`                  ||«       |jc                  «       td        k\  }|r|n|jg                  |«       Œµ |sdnti        |«      dk(  r|d   n|}|sdnti        |«      dk(  r|d   n|}|t        jj                  k(  r||fS |t        jl                  k(  r|S |t        jn                  k(  r|S y)aH  split

        Split this shape by the provided plane or face.

        Args:
            surface (Plane | Face): surface to segment shape
            keep (Keep, optional): which object(s) to save. Defaults to Keep.TOP.

        Returns:
            Shape: result of split
        Returns:
            Self | list[Self] | None,
            Tuple[Self | list[Self] | None]: The result of the split operation.

            - **Keep.TOP**: Returns the top as a `Self` or `list[Self]`, or `None`
              if no top is found.
            - **Keep.BOTTOM**: Returns the bottom as a `Self` or `list[Self]`, or `None`
              if no bottom is found.
            - **Keep.BOTH**: Returns a tuple `(inside, outside)` where each element is
              either a `Self` or `list[Self]`, or `None` if no corresponding part is found.
        Tc              3  óT   •K  — | ]  }‰j                   j                  |«      –— Œ! y ­wr	  )Ú	__class__rÍ   )rÕ   Úpartr™   s     €rš   r×   z Mixin1D.split.<locals>.<genexpr>ê  s(   øè ø€ ð áE�Dð —‘×#Ñ# D×)ÙEùs   ƒ%(r  r   Nr}   )8rY   ÚAppendrž   rÙ   ry   r   r�   r   ÚSetArgumentsÚSetToolsr¬   r‚   r~   r[   r†   rp   ÚALLr   rƒ   r_   rU   r­   ÚTopAbs_FACErZ   ÚFace_srÅ  rh   rk   r+   Ú
UVBounds_sr$   ÚNormalrz   ÚXÚYÚZr2  r)   rÏ  r�   r/   rò  rÍ   Úto_local_coordsr  rŠ   r   r#   rÿ   ÚMassru   rŽ  rÜ   rŒ  ÚTOPÚBOTTOM)r™   ré  rê  Ú
shape_listÚ	trim_toolÚ	tool_listÚsplitterÚsplit_resultÚfaceExplorerÚ	tool_faceÚsurface_pointÚsurface_normalÚu_minÚu_maxÚv_minÚv_maxÚnormalized_surface_normalÚ	ref_pointÚhalfSpaceMakerÚ
tool_solidÚtopsÚbottomsr  ró  Ú	sub_shapeÚis_upÚ	is_up_objÚtopÚbottoms   `                            rš   rë  zMixin1D.split¶  s  ø€ ô, *Ó+ˆ
Ø×Ñ˜$Ÿ,™,Ô'ô
 ˜$¤Ô&ô $ D§L¡LÓ1×6Ñ6Ô8à—‘ð 	ô
 )Ó*ˆ	Ø×Ñ˜Ô#ô (Ó)ˆð 	×Ñ˜jÔ)Ø×Ñ˜)Ô$ð 	�‰Ôä §¡Ó 0Ó1ˆä�l¤OÔ4Ü1°,ÀÓEˆLð ”4—8‘8ÒÜó ä7¸ÔEóó ð ô
 ˜$¤Õ&ä˜)¤\Ô2Ü.¨y¼"¿.¹.ÓI�Ü"ŸM™M¨,×*>Ñ*>Ó*@ÓA‘	à%�	ô #›HˆMÜ#›XˆNÜ)2×)=Ñ)=¸iÓ)HÑ&ˆE�5˜% Ü˜9Ó%×,Ñ,Ø˜‘ !Ñ# e¨e¡m°qÑ%8¸-Èôô )/Ø× Ñ Ó" N×$4Ñ$4Ó$6¸×8HÑ8HÓ8Jó)ç‰j‹lð &ô # =Ó1ˆMØ%Ð(AÑAˆIô 7°yÀ)×BRÑBRÓBTÓUˆNØ'×-Ñ-Ó/ˆJàˆØ!ˆÜ!“^ˆ
Ü/°Ö=ˆDØŸ™×+Ñ+¨DÓ1ˆIÜ˜$¤Ô&Ø×,Ñ,¨YÓ7×>Ñ>Ó@×BÑBÀaÑG‘ô ,Ø�G˜j˜]Ô,>Ó,@ó�	ô ×,Ñ,¨Y¸
ÔCà"Ÿ™Ó)¬YÑ6�Ù‰T ×/Ñ/°	Õ:ð >ñ ‰d¬s°4«y¸Aª~ D¨¢GÀ4ˆÙ$‘¼¸G»ÈÒ8I¨'°!ª*Èwˆà”4—9‘9ÒØ˜�=Ð Ø”4—8‘8ÒØˆJØ”4—;‘;ÒØˆMØrœ   c                óv   — | j                  «       }|j                  «       }t        |j                  |«      «      S )ziThe start point of this edge

        Note that circles may have identical start and end points.
        )r¹   rª  rz   rU  )r™   rV  Úumins      rš   Ústart_pointzMixin1D.start_point%  s4   € ð
 ×!Ñ!Ó#ˆØ×#Ñ#Ó%ˆä�e—k‘k $Ó'Ó(Ð(rœ   rü   c                ó‚   — | j                  ||«      }|j                  j                  ||j                  «      dz   dz  }|S )aæ  tangent_angle_at

        Compute the tangent angle at the specified location

        Args:
            location_param (float, optional): distance or parameter value. Defaults to 0.5.
            position_mode (PositionMode, optional): position calculation mode.
                Defaults to PositionMode.PARAMETER.
            plane (Plane, optional): plane line was constructed on. Defaults to Plane.XY.

        Returns:
            float: angle in degrees between 0 and 360
        éh  ç     €v@)rõ   r(  r�  r  )r™   Úlocation_paramrb  r¯  Ú
tan_vectorÚangles         rš   Útangent_angle_atzMixin1D.tangent_angle_at/  s>   € ð& —_‘_ ^°]ÓCˆ
Ø—‘×-Ñ-¨j¸%¿+¹+ÓFÈÑLÐPUÑUˆØˆrœ   c                ó2  — t        |t        t        f«      rT| j                  «       }|t        j
                  k(  r| j                  |«      }nï| j                  || j                  z  «      }nÐ	 t        |«      }| j                  «       }t        |«      D ��	cg c]  \  }}	|	j                  |«      |f‘Œ }
}}	t        |
d„ ¬«      }||d   d      }|j                  d«      }|j                  d«      }t        j                   |j"                  ||«      }t%        |j'                  «       |«      }|j)                  «       }t+        «       }t-        «       }|j/                  |||«       t        t1        |«      «      S # t        $ r}t        d«      |‚d}~ww xY wc c}	}w )a/  tangent_at

        Find the tangent at a given position on the 1D shape where the position
        is either a float (or int) parameter or a point that lies on the shape.

        Args:
            position (float |  VectorLike): distance, parameter value, or
                point on shape. Defaults to 0.5.
            position_mode (PositionMode, optional): position calculation mode.
                Defaults to PositionMode.PARAMETER.

        Raises:
            ValueError: invalid position

        Returns:
            Vector: tangent value
        z#position must be a float or a pointNc                ó   — | d   S ©Nr   r—   ©Úxs    rš   r  z$Mixin1D.tangent_at.<locals>.<lambda>k  s   € ¸qÀºtrœ   ©Úkeyr   r}   )rÙ   Úfloatr‘  r¹   rr   rZ  r[  r«   rz   rÝ   rŸ   rÛ   Ú	enumerateÚdistance_tor0  r   ÚCurve_srž   r>   rÏ  ÚLowerDistanceParameterrh   rk   ÚD1re   )r™   rñ   rb  rV  Ú	parameterrj  ÚexcÚmy_edgesr?  ré   rm  Úsorted_distancesÚclosest_edgeÚfirstÚlastrâ  ÚtmpÚress                     rš   rõ   zMixin1D.tangent_atF  sm  € ô, �h¤¬ Ô-Ø×%Ñ%Ó'ˆEØ¤× 6Ñ 6Ò6Ø ŸM™M¨(Ó3‘	à ŸM™M¨(°T·[±[Ñ*@ÓA‘	ðQÜ˜XÓ&�ð
 $(§:¡:£<ˆHÜ=FÀxÔ=PÔQÑ=P±T°Q¸˜!Ÿ-™-¨Ó,¨aÒ0Ð=PˆIÑQÜ% i±^ÔDÐØ#Ð$4°QÑ$7¸Ñ$:Ñ;ˆLà'×0Ñ0°Ó3ˆEØ&×/Ñ/°Ó2ˆDä×%Ñ% l×&:Ñ&:¸EÀ4ÓHˆEÜ3°C·J±J³LÀ%ÓHˆIØ!×8Ñ8Ó:ˆIä‹hˆÜ‹hˆØ�‰�˜C Ô%ä”f˜S“kÓ"Ð"øô) ò QÜ Ð!FÓGÈSÐPûðQüó
 Rs   Á,E6 ÂFÅ6	FÅ?FÆFc                ó.   — t        j                  | d«      S )zReturn the VertexrŒ   rI  r˜   s    rš   ÚvertexzMixin1D.vertex{  s   € ä×%Ñ% d¨HÓ5Ð5rœ   c                ó.   — t        j                  | d«      S )z)vertices - all the vertices in this ShaperŒ   ©r~   rP  r˜   s    rš   ÚverticeszMixin1D.vertices  s   € ä×#Ñ# D¨(Ó3Ð3rœ   c                ó.   — t        j                  | d«      S )zReturn the WirerÈ   rI  r˜   s    rš   ÚwirezMixin1D.wireƒ  rK  rœ   c                ó.   — t        j                  | d«      S )z#wires - all the wires in this ShaperÈ   r>  r˜   s    rš   r�  zMixin1D.wires‡  s   € ä×#Ñ# D¨&Ó1Ð1rœ   )Úreturnr‘  )rC  Úbool)rC  r,  )rÊ   r^   rC  zVertex | Edge | Wire)rÊ   r~   rÑ   r{   rC  z&Edge | Face | Shell | Solid | Compound)rä   zNone | Shape | Iterable[Shape]rC  zEdge | Wire | ShapeList[Edge])rñ   r,  rC  rz   )rñ   r,  rC  rx   )r  rm   rC  rz   )r4  zEdge | Wire | NonerC  zNone | Plane)rC  úEdge | None©rC  úShapeList[Edge]©rC  rz   )
ra  r,  rb  rr   rc  rn   rd  rD  rC  rx   )
rm  úIterable[float]rb  rr   rc  rn   rd  rD  rC  úlist[Location])
ra  r,  r”  rq   r•  rs   r–  rD  rC  úEdge | Wire)ra  r,  rC  r,  )r«   r,  r®  r,  r¯  ry   rC  rÆ   )ra  r,  rb  rr   rC  rz   )rm  rI  rb  rr   rC  zlist[Vector]©T)r»  r�   rÑ   r{   r¼  rD  rC  z$Edge | Wire | ShapeList[Edge | Wire])©r   r   r}   N)rÜ  r{   rÝ  r{   rÞ  úVectorLike | NonerC  z'tuple[ShapeList[Edge], ShapeList[Edge]])ré  r�   rê  zLiteral[Keep.TOP, Keep.BOTTOM]rC  úSelf | list[Self] | None)ré  r�   rê  zLiteral[Keep.ALL]rC  z
list[Self])ré  r�   rê  zLiteral[Keep.BOTH]rC  z9tuple[Self | list[Self] | None, Self | list[Self] | None])ré  r�   rC  rO  )ré  r�   rê  rp   )r!  r,  rb  rr   r¯  ry   rC  r,  )rñ   zfloat | VectorLikerb  rr   rC  rz   )rC  zVertex | None)rC  zShapeList[Vertex])rC  zWire | None)rC  úShapeList[Wire])9Ú__name__Ú
__module__Ú__qualname__Ú__doc__Úpropertyr›   r¡   r¥   r¶   r«   rÀ   rÃ   ÚclassmethodrÍ   rÒ   rì   rò   rö   rú   rm   rý   r  rG  rã   rÛ   rX  rr   rZ  rn   r\  rù   ro  rh  rq   r�  rs   rŒ  r¨  r[  ry   ÚXYr²  rï   rµ  rÂ  ræ  r   rë  rp   r  r  r$  rõ   r<  r?  rA  r�  r—   rœ   rš   r•   r•   Ð   s  „ Ù5ð òó ðð ò2ó ð2ð òOó ðOð òó ðð6 òBó ðBð òó ðð* òó ðð ò:ó ð:ð ðØðØ$.ðà	/òó ðð1Ø3ð1à	&ó1óf*ó)ó*ð ,4×+<Ñ+<ô ó*IóV4ó
ó)ð '3×&<Ñ&<Ø$/×$6Ñ$6Øð59àð59ð $ð59ð "ð	59ð
 ð59ð 
ó59ðt '3×&<Ñ&<Ø$/×$6Ñ$6Øð
à"ð
ð $ð
ð "ð	
ð
 ð
ð 
ó
ó6ðD —X‘XØ—Y‘YØð_Jàð_Jð ð_Jð ð	_Jð
 ð_Jð 
ó_JóBð& =B¿H¹HðØðØ&+ðØ49ðà	óð4 >J×=SÑ=Sð*Øð*Ø.:ð*à	ó*ð6 '3×&<Ñ&<ðGà"ðGð $ðGð 
ó	Gð( BFð-Øð-Ø%/ð-Ø:>ð-à	-ó-ðd #,Ø%)ð	V-à#ðV-ð  ðV-ð #ð	V-ð
 
1óV-ðp ð/Ø ð/Ø(Fð/à	!ò/ó ð/ð
 ò4ó ð4ð ò0ó ð0ð ò.ó ð.ð 6:·X±Xô mó^)ð !$Ø&2×&<Ñ&<Ø—x‘xð	àðð $ðð ð	ð
 
óð2 (+Ø&2×&<Ñ&<ð3#à$ð3#ð $ð3#ð 
ó	3#ój6ó4ó4ô2rœ   r•   c                  ó  ‡ — e Zd ZdZdZ	 	 	 	 d!	 	 	 	 	 	 	 d"ˆ fd„Zed#d„«       Zed$d„«       Z	eddœ	 	 	 	 	 d%d„«       Z
eej                  d	d
ej                  f	 	 	 	 	 	 	 	 	 	 	 d&d„«       Zeej                  d	d	ej                  f	 	 	 	 	 	 	 	 	 	 	 	 	 d'd„«       Ze	 	 	 	 d(	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 d)d„«       Zed*d„«       Zed+d,d„«       Ze	 	 	 	 	 d-	 	 	 	 	 	 	 	 	 	 	 	 	 d.d„«       Ze	 	 	 	 d/	 	 	 	 	 	 	 	 	 	 	 d0d„«       Ze	 	 	 	 	 	 	 	 d1d„«       Ze	 	 	 	 	 	 	 	 d2d„«       Zd3d„Z	 	 	 d4	 	 	 	 	 	 	 	 	 	 	 d5d„Zdef	 	 	 	 	 d6d„Z	 	 	 	 d7d„Zd8d„Z	 	 	 	 d9d„Zd:d„Z	 	 d;	 	 	 	 	 	 	 d<d„Z d=d„Z!d>d„Z"d?d„Z#d@d„Z$dAd „Z%ˆ xZ&S )BrÆ   a  An Edge in build123d is a fundamental element in the topological data structure
    representing a one-dimensional geometric entity within a 3D model. It encapsulates
    information about a curve, which could be a line, arc, or other parametrically
    defined shape. Edge is crucial in for precise modeling and manipulation of curves,
    facilitating operations like filleting, chamfering, and Boolean operations. It
    serves as a building block for constructing complex structures, such as wires
    and faces.r  Nc                óò   •— t        |t        «      rSt        t        |j                  j                  «       |j                  j                  «       «      «      j                  «       }t        ‰| �)  ||||¬«       y)aD  Build an Edge from an OCCT TopoDS_Shape/TopoDS_Edge

        Args:
            obj (TopoDS_Edge | Axis, optional): OCCT Edge or Axis.
            label (str, optional): Defaults to ''.
            color (Color, optional): Defaults to None.
            parent (Compound, optional): assembly parent. Defaults to None.
        ©rÊ   ÚlabelÚcolorÚparentN)rÙ   rv   r   r6   rñ   rÏ  rÑ   r¸  rÆ   ÚsuperÚ__init__)r™   rÊ   r[  r\  r]  rò  s        €rš   r_  zEdge.__init__š  sm   ø€ ô  �cœ4Ô Ü)ÜØ—L‘L×'Ñ'Ó)Ø—M‘M×(Ñ(Ó*óó÷
 ‰d‹fð ô 	‰ÑØØØØð	 	õ 	
rœ   c                ó~  — | j                   }| j                  «       }|t        j                  k(  r7t	        |j                  «       j                  «       j                  «       «      }|S |t        j                  k(  r7t	        |j                  «       j                  «       j                  «       «      }|S t        |› d�«      ‚)z3center of an underlying circle or ellipse geometry.z has no arc center)r  r¹   ro   rr  rz   r»   ÚPositionrx   rt  ru  rŸ   )r™   r  r¹   ry  s       rš   r�  zEdge.arc_center»  s¦   € ð —N‘Nˆ	Ø×(Ñ(Ó*ˆàœŸ™Ò'Ü! ,×"5Ñ"5Ó"7×"@Ñ"@Ó"B×"KÑ"KÓ"MÓNˆLð Ðð œ(×*Ñ*Ò*Ü! ,×"6Ñ"6Ó"8×"AÑ"AÓ"C×"LÑ"LÓ"NÓOˆLð Ðô  	˜{Ð*<Ð=Ó>Ð>rœ   c                óf   — t        t        j                  t        |j                  |«      «      «      S )a1  extrude

        Extrude a Vertex into an Edge.

        Args:
            direction (VectorLike): direction and magnitude of extrusion

        Raises:
            ValueError: Unsupported class
            RuntimeError: Generated invalid result

        Returns:
            Edge: extruded shape
        )rÆ   rZ   ÚEdge_sr‡   rž   rÐ   s      rš   rÒ   zEdge.extrudeÍ  s$   € ô  ”F—M‘MÔ"7¸¿¹ÀYÓ"OÓPÓQÐQrœ   )Úweightsc               ó|  — t        |«      dk  rt        d«      ‚t        |«      dkD  rt        d«      ‚|r"t        |«      t        |«      k7  rt        d«      ‚|D �cg c]  }t        |«      j                  «       ‘Œ }}t	        dt        |«      «      }t        |«      D ]  \  }}|j                  |dz   |«       Œ |rSt        dt        |«      «      }t        |«      D ]#  \  }}	|j                  |dz   t        |	«      «       Œ% t        ||«      }
nt        |«      }
 | t        |
«      j                  «       «      S c c}w )aª  make_bezier

        Create a rational (with weights) or non-rational bezier curve.  The first and last
        control points represent the start and end of the curve respectively.  If weights
        are provided, there must be one provided for each control point.

        Args:
            cntl_pnts (sequence[VectorLike]): points defining the curve
            weights (list[float], optional): control point weights list. Defaults to None.

        Raises:
            ValueError: Too few control points
            ValueError: Too many control points
            ValueError: A weight is required for each control point

        Returns:
            Edge: bezier curve
        r  z9At least two control points must be provided (start, end)é   z*The maximum number of control points is 25z0A weight must be provided for each control pointr}   )rÜ   rŸ   rz   rÏ  rO   r-  ÚSetValuerL   r,  r0   r   rÆ   )rÉ   rd  Ú	cntl_pntsÚcntl_pntÚcntl_gp_pntsÚpolesr?  Úcntl_gp_pntÚpole_weightsÚweightÚbezier_curves              rš   Úmake_bezierzEdge.make_bezierß  s)  € ô, ˆy‹>˜AÒÜØKóð ô ˆy‹>˜BÒÜÐIÓJÐJÙÜ�9‹~¤ W£Ò-Ü Ð!SÓTÐTáBKÓLÁ)°hœ˜xÓ(×/Ñ/Õ1À)ˆÐLô # 1¤c¨,Ó&7Ó8ˆÜ'¨Ö5‰NˆAˆ{Ø�N‰N˜1˜q™5 +Õ.ð 6ñ Ü/°´3°w³<Ó@ˆLÜ& wÖ/‘	��6Ø×%Ñ% a¨!¡e¬U°6«]Õ;ð 0ä+¨E°<Ó@‰Lä+¨EÓ2ˆLáÔ*¨<Ó8×=Ñ=Ó?Ó@Ð@ùò Ms   Á D9r   r  c                ó€  — t        |j                  «       |«      }||k(  r! | t        |«      j                  «       «      }|S |t        j
                  k(  }|rt        |«      }	t        |«      }
nt        |«      }	t        |«      }
t        ||	|
|«      j                  «       } | t        |«      j                  «       «      }|S )a1  make circle

        Create a circle centered on the origin of plane

        Args:
            radius (float): circle radius
            plane (Plane, optional): base plane. Defaults to Plane.XY.
            start_angle (float, optional): start of arc angle. Defaults to 360.0.
            end_angle (float, optional): end of arc angle. Defaults to 360.
            angular_direction (AngularDirection, optional): arc direction.
                Defaults to AngularDirection.COUNTER_CLOCKWISE.

        Returns:
            Edge: full or partial circle
        )	rd   Ú	to_gp_ax2r   rÆ   rl   ÚCOUNTER_CLOCKWISEr   r,   rU  )rÉ   rÀ   r¯  Ústart_angleÚ	end_angleÚangular_directionÚ	circle_gpry  Úccwr°  ÚendÚcircle_geoms               rš   Úmake_circlezEdge.make_circle  s¶   € ô0 ˜EŸO™OÓ-¨vÓ6ˆ	à˜)Ò#ÙÔ6°yÓA×FÑFÓHÓIˆLð Ðð $Ô'7×'IÑ'IÑIˆCÙÜ Ó,�Ü˜iÓ(‘ä 	Ó*�Ü˜kÓ*�Ü,¨Y¸¸sÀCÓH×NÑNÓPˆKÙÔ6°{ÓC×HÑHÓJÓKˆLØÐrœ   c                ó8  — t        |j                  j                  «       |j                  j	                  «       «      }||kD  r5dt
        z  }t        |j                  «       ||«      j                  ||«      }	nd}t        |j                  «       ||«      }	||k(  r! | t        |	«      j                  «       «      }
|
S t        |	|t
        z  |z
  |t
        z  |z
  |t        j                  k(  «      j                  «       } | t        |«      j                  «       «      }
|
S )a‹  make ellipse

        Makes an ellipse centered at the origin of plane.

        Args:
            x_radius (float): x radius of the ellipse (along the x-axis of plane)
            y_radius (float): y radius of the ellipse (along the y-axis of plane)
            plane (Plane, optional): base plane. Defaults to Plane.XY.
            start_angle (float, optional): Defaults to 360.0.
            end_angle (float, optional): Defaults to 360.0.
            angular_direction (AngularDirection, optional): arc direction.
                Defaults to AngularDirection.COUNTER_CLOCKWISE.

        Returns:
            Edge: full or partial ellipse
        g     €V@rÂ   )ra   r  rÏ  r  r¸  rt   rg   rr  ÚRotatedr   rÆ   r-   rl   rs  rU  )rÉ   Úx_radiusÚy_radiusr¯  rt  ru  rv  Úax1Úcorrection_angleÚ
ellipse_gpÚellipseÚellipse_geoms               rš   Úmake_ellipsezEdge.make_ellipse8  s  € ô4 �U—\‘\×(Ñ(Ó*¨E¯K©K×,>Ñ,>Ó,@ÓAˆà�hÒð  $¤g™~ÐÜ! %§/¡/Ó"3°X¸xÓH×PÑPØÐ%ó‰Jð  #ÐÜ! %§/¡/Ó"3°X¸xÓHˆJà˜)Ò#ÙÔ1°*Ó=×BÑBÓDÓEˆGð ˆô /ØØœgÑ%Ð(8Ñ8ØœGÑ#Ð&6Ñ6Ø!Ô%5×%GÑ%GÑGó	÷
 ‰e‹gð ñ Ô1°,Ó?×DÑDÓFÓGˆGàˆrœ   c                óÈ  — |dk(  rEt        t        t        |«      j                  «       t        |«      j	                  «       «      |«      }nLt        t        t        |«      j                  «       t        |«      j	                  «       «      |t        z  |«      }|rdnd}	t        |	dz  t        z  |«      j                  «       }
||
j                  z  t        t        |«      «      z  }t        t        dd«      t        |
j                  |
j                  «      «      }t!        |d|d¬«      }t#        ||«      }|j%                  «       }t'        j(                  |dd	¬
«        | |«      S )a³  make_helix

        Make a helix with a given pitch, height and radius. By default a cylindrical surface is
        used to create the helix. If the :angle: is set (the apex given in degree) a conical
        surface is used instead.

        Args:
            pitch (float): distance per revolution along normal
            height (float): total height
            radius (float):
            center (VectorLike, optional): Defaults to (0, 0, 0).
            normal (VectorLike, optional): Defaults to (0, 0, 1).
            angle (float, optional): conical angle. Defaults to 0.0.
            lefthand (bool, optional): Defaults to False.

        Returns:
            Wire: helix
        rÂ   r  r}   r  r   T)ÚtheAdjustPeriodicç•Ö&è.>iÐ  )Ú
MaxSegment)r2   rc   rz   rÏ  r¸  r1   rt   r   r2  rý  r	   r   r8   ri   rf   rü  r9   r   rÆ   r%   rÛ  )rÉ   ÚpitchÚheightrÀ   r  rh  r#  ÚlefthandÚ	geom_surfÚ	line_signÚline_dirÚline_lenÚ
helix_lineÚhelix_curveÚedge_builderÚtopods_edges                   rš   Ú
make_helixzEdge.make_helixm  s+  € ð> �CŠ<Ü&=Ü”v˜f“~×,Ñ,Ó.´°v³×0EÑ0EÓ0GÓHÈ&ó'‰Iô ,Ü”v˜f“~×,Ñ,Ó.´°v³×0EÑ0EÓ0GÓHØœ‘ØóˆIñ #‘B¨ˆ	Ü˜) a™-¬"Ñ,¨eÓ4×?Ñ?ÓAˆØ˜XŸZ™ZÑ'¬3¬w°u«~Ó+>Ñ>ˆô !¤¨!¨Q£´¸(¿*¹*ÀhÇjÁjÓ1QÓRˆ
ä)Ø˜˜8°tô
ˆô
 /¨{¸IÓFˆØ"×'Ñ'Ó)ˆô 	×Ñ ¨T¸dÕCá�;ÓÐrœ   c                óž   —  | t        t        |«      j                  «       t        |«      j                  «       «      j                  «       «      S )a   Create a line between two points

        Args:
          point1: VectorLike: that represents the first point
          point2: VectorLike: that represents the second point

        Returns:
          A linear edge between the two provided points

        )r   rz   rÏ  rÆ   )rÉ   Úpoint1Úpoint2s      rš   r“  zEdge.make_line®  s?   € ñ Ü#Ü�v“×%Ñ%Ó'¬°«×)>Ñ)>Ó)@óç‰d‹fó
ð 	
rœ   c           
     ó8  — |j                  «       j                  |j                  «       «      }dD �cg c]L  }t        j                  |j	                  |«      |j	                  |rd|z
  n|«      «      j	                  |«      ‘ŒN }}t        j                  |Ž S c c}w )aõ  make line between edges

        Create a new linear Edge between the two provided Edges. If the Edges are parallel
        but in the opposite directions one Edge is flipped such that the mid way Edge isn't
        truncated.

        Args:
            first (Edge): first reference Edge
            second (Edge): second reference Edge
            middle (float, optional): factional distance between Edges. Defaults to 0.5.

        Returns:
            Edge: linear Edge between two Edges
        )r   r}   r}   )Úto_axisÚis_oppositerÆ   r“  rï   )rÉ   r7  Úsecondr  Úflipr?  Úpntss          rš   Úmake_mid_wayzEdge.make_mid_wayÀ  s˜   € ð  �}‰}‹×*Ñ*¨6¯>©>Ó+;Ó<ˆñ
 ó	
ñ �ô �N‰NØ×!Ñ! !Ó$ f×&8Ñ&8Á$¸¸QºÈAÓ&Nóç‰k˜&Ó!ñ"ð ð	 	ð 
ô �~‰~˜tÐ$Ð$ùò
s   ²ABc                ó  — |D �cg c]  }t        |«      ‘Œ }}|rt        d„ |D «       «      }	t        dt        |«      «      }
t	        |«      D ](  \  }}|
j                  |dz   |j                  «       «       Œ* |€t        |
||«      }nˆt        |«      t        |«      |z   k7  r#t        dt        |«      › dt        |«      › �«      ‚t        dt        |«      «      }t	        |«      D ]  \  }}|j                  |dz   |«       Œ t        |
|||«      }|�rt        	«      dk(  r<t        |«      dk7  r.|j                  |	d   j                  |	d   j                  |«       nÎt        |	«      t        |«      k7  r#t        dt        |	«      › dt        |«      › �«      ‚t        dt        |	«      «      }t        dt        |	«      «      }t	        |	«      D ]I  \  }}|j                  |dz   |du«       |�|n	t        «       }|j                  |dz   |j                  «       ŒK |j                  |||«       |j                  «        |j                  «       st        d	«      ‚|j!                  «       } | t#        |«      j%                  «       «      S c c}w )
aé  Spline

        Interpolate a spline through the provided points.

        Args:
            points (list[VectorLike]):  the points defining the spline
            tangents (list[VectorLike], optional): start and finish tangent.
                Defaults to None.
            periodic (bool, optional): creation of periodic curves. Defaults to False.
            parameters (list[float], optional): the value of the parameter at each
                interpolation point. (The interpolated curve is represented as a vector-valued
                function of a scalar parameter.) If periodic == True, then len(parameters)
                must be len(interpolation points) + 1, otherwise len(parameters)
                must be equal to len(interpolation points). Defaults to None.
            scale (bool, optional): whether to scale the specified tangent vectors before
                interpolating. Each tangent is scaled, so it's length is equal to the derivative
                of the Lagrange interpolated curve. I.e., set this to True, if you want to use
                only the direction of the tangent vectors specified by `tangents` , but not
                their magnitude. Defaults to True.
            tol (float, optional): tolerance of the algorithm (consult OCC documentation).
                Used to check that the specified points are not too close to each other, and
                that tangent vectors are not too short. (In either case interpolation may fail.).
                Defaults to 1e-6.

        Raises:
            ValueError: Parameter for each interpolation point
            ValueError: Tangent for each interpolation point
            ValueError: B-spline interpolation failed

        Returns:
            Edge: the spline
        c              3  ó2   K  — | ]  }t        |«      –— Œ y ­wr	  ©rz   ©rÕ   Úvs     rš   r×   z#Edge.make_spline.<locals>.<genexpr>  s   è ø€ Ð#@±x°!¤F¨1§I±xùrË  r}   NzuThere must be one parameter for each interpolation point (plus one if periodic), or none specified. Parameter count: z, point count: r  r   zgThere must be one tangent for each interpolation point, or just two end point tangents. Tangent count: zB-spline interpolation failed)rz   ÚtuplerQ   rÜ   r-  rg  rÏ  r<   rŸ   rN   ÚLoadrž   rP   rM   rŠ  ÚIsDoner‘   r   rÆ   )rÉ   r5  ÚtangentsÚperiodicÚ
parametersÚscaleÚtolÚpointÚpoint_vectorsÚtangent_vectorsrž  r?  Úspline_builderÚparameters_arrayÚp_indexÚp_valueÚtangents_arrayÚtangent_enabled_arrayÚt_indexÚt_valueÚtangent_vecÚspline_geoms                         rš   Úmake_splinezEdge.make_splineÙ  sˆ  € ñV 5;Ó;±F¨5œ �°FˆÐ;ÙÜ#Ñ#@±xÓ#@Ó@ˆOÜ" 1¤c¨-Ó&8Ó9ˆÜ! -Ö0‰HˆAˆuØ�M‰M˜!˜a™% §¡£Õ0ð 1ð ÐÜ0°°xÀÓE‰Nä�:‹¤3 }Ó#5¸Ñ#@ÒAÜ ðSä˜:“Ð' ´s¸=Ó7IÐ6JðLóð ô
  5°Q¼¸J»ÓHÐÜ$-¨jÖ$9Ñ �˜Ø ×)Ñ)¨'°A©+°wÕ?ð %:ô 1°Ð7GÈÐSVÓWˆNâÜ�?Ó# qÒ(¬S°Ó-?À1Ò-Dà×#Ñ#Ø# AÑ&×.Ñ.°ÀÑ0B×0JÑ0JÈEõô �Ó'¬3¨}Ó+=Ò=Ü$ðJä˜Ó/Ð0°ÄÀMÓ@RÐ?SðUóð ô "4°A´s¸?Ó7KÓ!L�Ü(@Ø”s˜?Ó+ó)Ð%ô )2°/Ö(BÑ$�G˜WØ)×2Ñ2°7¸Q±;ÀÈtÐ@SÔTØ-4Ð-@¡'ÄfÃh�KØ"×+Ñ+¨G°a©K¸×9LÑ9LÕMð )Cð
 ×#Ñ# NÐ4IÈ5ÔQà×ÑÔ Ø×$Ñ$Ô&ÜÐ<Ó=Ð=à$×*Ñ*Ó,ˆáÔ*¨;Ó7×<Ñ<Ó>Ó?Ð?ùòm <s   …Jc                ó‚  — t        dt        |«      «      }t        |«      D ]1  \  }}|j                  |dz   t	        |«      j                  «       «       Œ3 |rt        |g|¢­||dœŽ}	nt        ||||¬«      }	|	j                  «       st        d«      ‚|	j                  «       }
 | t        |
«      j                  «       «      S )a²  make_spline_approx

        Approximate a spline through the provided points.

        Args:
            points (list[Vector]):
            tol (float, optional): tolerance of the algorithm. Defaults to 1e-3.
            smoothing (Tuple[float, float, float], optional): optional tuple of 3 weights
                use for variational smoothing. Defaults to None.
            min_deg (int, optional): minimum spline degree. Enforced only when smoothing
                is None. Defaults to 1.
            max_deg (int, optional): maximum spline degree. Defaults to 6.

        Raises:
            ValueError: B-spline approximation failed

        Returns:
            Edge: spline
        r}   )ÚDegMaxÚTol3D)ÚDegMinr¼  r½  zB-spline approximation failed)rQ   rÜ   r-  rg  rz   rÏ  r=   r§  rŸ   r‘   r   rÆ   )rÉ   r5  r¬  Ú	smoothingÚmin_degÚmax_degrž  r?  r­  r°  r¹  s              rš   Úmake_spline_approxzEdge.make_spline_approx<  sÁ   € ô8 # 1¤c¨&£kÓ2ˆÜ! &Ö)‰HˆAˆuØ�M‰M˜!˜a™%¤¨£×!5Ñ!5Ó!7Õ8ð *ñ Ü4ØðØ ñØ)0¸ò‰Nô 5Ø˜W¨W¸CôˆNð ×$Ñ$Ô&ÜÐ<Ó=Ð=à$×*Ñ*Ó,ˆáÔ*¨;Ó7×<Ñ<Ó>Ó?Ð?rœ   c                óø   — t        t        |«      j                  «       t        |«      j                  t        |«      j                  «       «      j	                  «       } | t        |«      j                  «       «      S )a4  Tangent Arc

        Makes a tangent arc from point start, in the direction of tangent and ends at end.

        Args:
            start (VectorLike): start point
            tangent (VectorLike): start tangent
            end (VectorLike): end point

        Returns:
            Edge: circular arc
        )r,   rz   rÏ  rž   rU  r   rÆ   )rÉ   r°  rg  ry  rz  s        rš   Úmake_tangent_arczEdge.make_tangent_arcl  s_   € ô  )Ü�5‹M× Ñ Ó"¤F¨7£O×$;Ñ$;¼VÀC»[×=OÑ=OÓ=Qó
ç
‰%‹'ð 	ñ Ô*¨;Ó7×<Ñ<Ó>Ó?Ð?rœ   c                ó   — t        t        |«      j                  «       t        |«      j                  «       t        |«      j                  «       «      j                  «       } | t	        |«      j                  «       «      S )a6  Three Point Arc

        Makes a three point arc through the provided points

        Args:
            point1 (VectorLike): start point
            point2 (VectorLike): middle point
            point3 (VectorLike): end point

        Returns:
            Edge: a circular arc through the three points
        )r,   rz   rÏ  rU  r   rÆ   )rÉ   r—  r˜  Úpoint3rz  s        rš   Úmake_three_point_arczEdge.make_three_point_arc‚  sb   € ô  )Ü�6‹N×!Ñ!Ó#¤V¨F£^×%:Ñ%:Ó%<¼fÀV»n×>SÑ>SÓ>Uó
ç
‰%‹'ð 	ñ Ô*¨;Ó7×<Ñ<Ó>Ó?Ð?rœ   c                óZ   — | j                   st        | g«      j                  «       }|S | }|S )zClose an Edge)r¡   rÈ   Úclose)r™   ry  s     rš   rÉ  z
Edge.closeš  s2   € à�~Š~Ü  ›<×-Ñ-Ó/ˆLð Ðð  ˆLàÐrœ   c                óÖ   — |dk  rt        d«      ‚t        |«      D �cg c]  }||||z
  z  |dz
  z  z   ‘Œ }}| j                  |«      }|r|D ]  }t        ddd«      |_        Œ |S c c}w )a6  Distribute Locations

        Distribute locations along edge or wire.

        Args:
          self: Wire:Edge:
          count(int): Number of locations to generate
          start(float): position along Edge|Wire to start. Defaults to 0.0.
          stop(float): position along Edge|Wire to end. Defaults to 1.0.
          positions_only(bool): only generate position not orientation. Defaults to False.

        Returns:
          list[Location]: locations distributed along Edge|Wire

        Raises:
          ValueError: count must be two or greater

        r  zcount must be two or greaterr}   r   )rŸ   r-  ro  rz   Úorientation)	r™   Úcountr°  ÚstopÚpositions_onlyr?  Út_valuesro  Úlocs	            rš   Údistribute_locationszEdge.distribute_locations£  s~   € ð2 �1Š9ÜÐ;Ó<Ð<äFKÈEÄlÓSÁlÀ�E˜A ¨¡Ñ.°%¸!±)Ñ<Ó<ÀlˆÐSà—N‘N 8Ó,ˆ	ÙÛ �Ü"(¨¨A¨q£/�•ð !ð Ðùò Ts   žA&c           
     ó¾  — t        |t        «      r¡| j                  «       j                  t	        |j
                  «      j                  «       «      }t        j                  |j
                  |j                  d|j                  z  z  z   |j
                  |j                  |j                  z  z   «      }| j                  |«      }|€t        d«      ‚t        |j                  «      j                  «       }t        j                   |«      }t        j"                  | j                  |t%        «       | j'                  d«      | j'                  d«      «      }|�Wt        j"                  |j                  |t%        «       |j'                  d«      |j'                  d«      «      }t)        |||«      }	nt)        ||«      }	t+        |	j-                  «       «      D �
cg c]N  }
t/        |	j1                  |
dz   «      j3                  «       |	j1                  |
dz   «      j5                  «       «      ‘ŒP }}
|D �cg c]  }|j7                  |«      ‘Œ }}g }|D ]p  }	 |�B| j9                  |«      t:        k  rS|j9                  |«      t:        k  r;|j=                  |«       n)| j9                  |«      t:        k  r|j=                  |«       Œr t?        |«      S c c}
w c c}w # t        $ r Y Œ“w xY w)a‰  find_intersection_points

        Determine the points where a 2D edge crosses itself or another 2D edge

        Args:
            other (Axis | Edge): curve to compare with
            tolerance (float, optional): the precision of computing the intersection points.
                 Defaults to TOLERANCE.

        Returns:
            ShapeList[Vector]: list of intersection points
        r  z%All objects must be on the same planer   r}   ) rÙ   rv   r  ÚaddrŒ   rñ   rÆ   r“  rÑ   ÚdiagonalrG  rŸ   r   rž   r�   r   Ú	Surface_sÚCurveOnPlane_srV   r[  r:   r-  ÚNbPointsrz   ÚPointrü  rý  Úfrom_local_coordsr.  ru   rŽ  r   )r™   rä   Ú	toleranceÚself_bbox_w_edger¯  Ú	pln_shapeÚedge_surfaceÚself_2d_curveÚedge_2d_curveÚintersectorr?  Úcrossesr#  Úvalid_crossesrj  s                  rš   Úfind_intersection_pointszEdge.find_intersection_pointsÈ  s“  € ô  �eœTÔ"Ø#×0Ñ0Ó2×6Ñ6Ü�u—~‘~Ó&×3Ñ3Ó5ó Ðô —N‘NØ—‘ §¡°BÐ9I×9RÑ9RÑ4RÑ!SÑSØ—‘ §¡Ð3C×3LÑ3LÑ!LÑLóˆEð
 ×!Ñ! %Ó(ˆØˆ=ÜÐDÓEÐEä+¨E¯M©MÓ:×?Ñ?ÓAˆ	Ü ×*Ñ*¨9Ó5ˆä&/×&>Ñ&>Ø�L‰LØÜÓØ�M‰M˜!ÓØ�M‰M˜!Óó'
ˆð ÐÜ*3×*BÑ*BØ—‘ØÜÓ!Ø—‘˜qÓ!Ø—‘˜qÓ!ó+ˆMô 4Ø˜}¨ió‰Kô 4°MÀ9ÓMˆKô ˜;×/Ñ/Ó1Ô2ó
á2�ô �;×$Ñ$ Q¨¡UÓ+×-Ñ-Ó/°×1BÑ1BÀ1ÀqÁ5Ó1I×1KÑ1KÓ1MÕNØ2ð 	ð 
ñ
 8?Ó?±w°!�5×*Ñ*¨1Õ-°wˆÐ?ð ˆÛˆCðØÐ$à×(Ñ(¨Ó-´Ò:Ø!×-Ñ-¨cÓ2´iÒ?à%×,Ñ,¨SÕ1à×'Ñ'¨Ó,´	Ò9Ø%×,Ñ,¨SÔ1øð ô ˜Ó'Ð'ùò1
ùò
 @øô  ò Ùðús    ÇAKÈ*KÉA-KË	KËKc                ód  — |dz  }| j                   t        j                  k(  r| j                  d«      |k(  rdg}|S g }|S t	        | j
                  «      }g }d}d}t        d|z
  «      D ]^  }| j                  |dz  «      |dz  z   }|�(t        ||z
  «      dkD  rt        d||z
  «      }|d|z  z  }|}|j                  |dz  |f«       Œ` t        j                  |«      }	|	j                  «       }
dt        |
j                  j                  dz  «      z  }dt!        |
j"                  j                  dz  «      z  }g }t        ||d	z   d«      D ]D  }t        j%                  d||z   dfd||z   df«      }|j'                  |	j)                  |«      «       ŒF |D �cg c]  }|j*                  ‘Œ }}|S c c}w )
zïfind_tangent

        Find the parameter values of self where the tangent is equal to angle.

        Args:
            angle (float): target angle in degrees

        Returns:
            list[float]: u values between 0.0 and 1.0
        r  r   NrÂ   ée   r§   i,  r  r}   )r  ro   r  r$  r‘  r¡   r-  r’  r
   rŽ  rÆ   rº  r  r   Úminrý  r   Úmaxr“  r,  rã  rü  )r™   r#  Úu_valuesr©  Útan_pntsÚprevious_tangentÚdiscontinuitiesr?  rg  Ú	tan_curveÚtan_curve_bboxÚ	min_rangeÚ	max_rangeÚintercept_pntsr
  r#  s                   rš   Úfind_tangentzEdge.find_tangent  sÝ  € ð ˜‘ˆð �>‰>œXŸ]™]Ò*Ø×$Ñ$ QÓ'¨5Ò0Ø˜3�ðN ˆðK �ðJ ˆôE ˜4Ÿ>™>Ó*ˆHØ)+ˆHØ#Ðð "ˆOÜ˜3 ™>Ö*�Ø×/Ñ/°°C±Ó8¸?ÈSÑ;PÑP�à$Ð0ÜÐ,¨wÑ6Ó7¸#Ò=ä&.¨sÐ4DÀwÑ4NÓ&O�OØ˜s _Ñ4Ñ4�GØ#*Ð Ø—‘  S¡¨'Ð 2Õ3ð +ô ×(Ñ(¨Ó2ˆIð '×3Ñ3Ó5ˆNØœu ^×%7Ñ%7×%9Ñ%9¸CÑ%?Ó@ÑAˆIØœt N×$6Ñ$6×$8Ñ$8¸3Ñ$>Ó?Ñ@ˆIð ,.ˆNÜ˜9 i°!¡m°SÖ9�Ü—~‘~ q¨%°!©)°QÐ&7¸#¸uÀq¹yÈ!Ð9LÓM�Ø×%Ñ% i×&HÑ&HÈÓ&NÕOð :ñ &4Ó4¡^ ˜Ÿ› ^ˆHÐ4àˆùò 5s   ÆF-c                ó,   — t        | j                  «      S )z$Return the Geom Curve from this Edge)r   rž   r˜   s    rš   r¹   zEdge.geom_adaptorS  s   € ä  §¡Ó.Ð.rœ   c           
     óX  ‡— g }g }g }|D ]�  }|xt         d˜ x�\    |j                  t        |«      «       Œ, xt        d˜ x�\    |j                  |«       ŒL t        d˜ x�\   |j                  |«       Œj 	 t	        dt        |«      › �«      ‚ g }t        | g|z   d«      D ]3  }|d   j                  |d   «      }|j                  t        |«      «       Œ5 t        d„ | j                  «       D «       «      }	t        d„ |D «       «      }
t        j                  |	|
«      }t        j                  | g|z   |«      D �]  \  }Št        j                  |j                  |j!                  d«      |j!                  d«      «      }t#        ‰j$                  «      }t'        ||«      }g }|j)                  «       rAt+        |j-                  «       «      D �cg c]  }t/        |j1                  |dz   «      «      ‘Œ! }}|j                  t        |«      «       t3        ˆfd	„|j5                  d
„ t+        d«      D «       «      D «       «      s�Œ	|j                  |«       �Œ |j7                  |«       t        j                  |Ž }|j9                  |«      D �cg c]  }t;        |«      ‘Œ }}g }|r*| j=                  | f|t?        «       «      jA                  «       }|s|rPtC        |«      dk(  rtC        |«      dk(  r|d   S tC        |«      dk(  rtC        |«      dk(  r|d   S tE        ||z   «      S yc c}w c c}w )z¶intersect Edge with Edge or Axis

        Args:
            other (Edge |  Axis): other object

        Returns:
            Shape |  None: Compound of vertices and/or edges
        r—   NzUnknown object type: r  r   r}   c              3  ó2   K  — | ]  }t        |«      –— Œ y ­wr	  r¢  r£  s     rš   r×   z!Edge.intersect.<locals>.<genexpr>y  s   è ø€ ÐA±¨Aœf QŸi±ùrË  c              3  ó\   K  — | ]$  }|j                  «       D ]  }t        |«      –— Œ Œ& y ­wr	  )r?  rz   )rÕ   rã   r¤  s      rš   r×   z!Edge.intersect.<locals>.<genexpr>z  s#   è ø€ ÐS±E¨DÀ4Ç=Á=Æ?¸aœf QŸiÀ?˜i±Eùs   ‚*,c              3  ó@   •K  — | ]  }‰j                  |«      –— Œ y ­wr	  r!  )rÕ   r¤  r¯  s     €rš   r×   z!Edge.intersect.<locals>.<genexpr>Ž  s   øè ø€ ð Ù+R a�—‘˜q×!Ñ+Rùr%  c              3  ó&   K  — | ]	  }|d z  –— Œ y­w)é   Nr—   )rÕ   r?  s     rš   r×   z!Edge.intersect.<locals>.<genexpr>�  s   è ø€ Ð9RÉÀA¸!¸a½%Éùs   ‚r  )#rv   rŽ  rÆ   ry   rŸ   rß   r   rã  r.  r?  ÚintersectionÚ	itertoolsÚproductr   r/  rž   r[  r3   Úlocal_coord_systemr;   r§  r-  r×  rz   rØ  rÚ   rµ  r,  ÚunionrŒ   Ú_bool_opr   rÛ   rÜ   r   )r™   Úto_intersectrÛ   ÚplanesÚedges_common_to_planesrÊ   Úpoints_setsÚ	edge_pairÚintersection_pointsÚself_end_pointsÚedge_end_pointsÚcommon_end_pointsrã   Ú	geom_lineÚ
geom_planeÚintersection_calculatorÚplane_intersection_pointsr?  Úcommon_pointsrj  Úcommon_verticesÚcommon_edgesr¯  s                         @rš   Ú	intersectzEdge.intersectW  s  ø€ ð ˆØ ˆØ-/ÐãˆCØØ”T–VØ—L‘L¤ c£Õ+ð à”T–VØ—L‘L Õ%ð ä•WØ—M‘M #Õ&ð àÜ$Ð'<¼TÀ#»Y¸KÐ%HÓIÐIð  ð *,ˆä% t f¨u¡n°aÖ8ˆIØ"+¨A¡,×"GÑ"GÈ	ÐRSÉÓ"UÐØ×ÑœsÐ#6Ó7Õ8ð 9ô
 ÑA°·±´ÓAÓAˆÜÑS±EÓSÓSˆÜ×,Ñ,¨_¸oÓNÐô %×,Ñ,¨d¨V°e©^¸V×D‰KˆD�%ä!×)Ñ)Ø—‘˜dŸm™m¨AÓ.°·±¸aÓ0@óˆIô $ E×$<Ñ$<Ó=ˆJÜ&3°I¸zÓ&JÐ#Ø68Ð%Ø&×-Ñ-Ô/ô #Ð#:×#CÑ#CÓ#EÔFó-áF˜ô Ð2×8Ñ8¸¸Q¹Ó?Õ@ØFð *ð -ð ×ÑœsÐ#<Ó=Ô>ô ó Ø+/¯>©>Ñ9RÌÈqÌÓ9RÔ+Róö ð '×-Ñ-¨dÖ3ð' Eð* 	�‰Ð+Ô,ô ×(Ñ(¨+Ð6ˆà#0×#6Ñ#6Ð7HÔ#Ió
Ù#I˜CŒF�3�KÐ#Ið 	ð 
ð
 $&ˆÙØŸ=™=¨$¨°%Ô9KÓ9MÓN×TÑTÓVˆLá™lä�?Ó# qÒ(¬S°Ó->À!Ò-CØ& qÑ)Ð)Ü�?Ó# qÒ(¬S°Ó->À!Ò-CØ# A‘Ð&Ü˜_¨|Ñ;Ó<Ð<ØùòA-ùò 
s   Ç$L"ÊL'c           
     óf  ‡ ‡— t        ‰«      Št        ‰ j                  ‰«      dt        ¬«      st	        d‰› d�«      ‚dˆˆ fd„}t        dt        d‰‰ j                  d«      z
  j                  ‰ j                  z  «      «      }t        ||dd	gt        ¬
«      }t        |j                  d   «      }|S )z(Normalized parameter at point along Edger   )Úabs_tolzpoint (z) is not on edgec                óF   •— ‰j                  | d   «      ‰z
  j                  S r'  )rï   r«   )re  r­  r™   s    €€rš   Úfuncz!Edge.param_at_point.<locals>.func¿  s#   ø€ Ø×$Ñ$ U¨1¡XÓ.°Ñ6×>Ñ>Ð>rœ   rÂ   r  zNelder-Mead)rÂ   r  )Úx0ÚmethodÚboundsr¬  )re  r   rC  r,  )rz   rˆ   r.  ru   rŸ   rç  ræ  rï   r«   r   r,  r)  )r™   r­  r  Úinitial_guessr7  r®  s   ``    rš   Úparam_at_pointzEdge.param_at_point©  s¬   ù€ ô  �u“ˆä˜×)Ñ)¨%Ó0°!¼YÕGÜ˜w u gÐ-=Ð>Ó?Ð?ö	?ô Ø”�S˜5 4×#3Ñ#3°AÓ#6Ñ6×>Ñ>ÀÇÁÑLÓMó
ˆô ØØØ Ø�<Üô
ˆô ˜Ÿ™ ™Ó$ˆØˆrœ   c                óŽ   — t        | g«      }|j                  |||«      }|D �cg c]  }|j                  «       d   ‘Œ }}|S c c}w )aÂ  Project Edge

        Project an Edge onto a Shape generating new wires on the surfaces of the object
        one and only one of `direction` or `center` must be provided. Note that one or
        more wires may be generated depending on the topology of the target object and
        location/direction of projection.

        To avoid flipping the normal of a face built with the projected wire the orientation
        of the output wires are forced to be the same as self.

        Args:
          target_object: Object to project onto
          direction: Parallel projection direction. Defaults to None.
          center: Conical center of projection. Defaults to None.
          target_object: Shape:
          direction: VectorLike:  (Default value = None)
          center: VectorLike:  (Default value = None)

        Returns:
          : Projected Edge(s)

        Raises:
          ValueError: Only one of direction or center must be provided

        r   )rÈ   Úproject_to_shaperÛ   )r™   Útarget_objectrÑ   r  rA  Úprojected_wiresrž  Úprojected_edgess           rš   r  zEdge.project_to_shapeÐ  sM   € ô> �T�F‹|ˆØ×/Ñ/°¸yÈ&ÓQˆÙ1@ÓA±¨A˜1Ÿ7™7›9 Q›<°ˆÐAØÐùò Bs   ¤Ac                óZ  — t        j                  | «      }| j                  d«      }| j                  d«      }t        j                  | j
                  ||«      }|j                  |«      }|j                  |«      }t        |j                  «       ||«      j                  «       }||_        |S )z3Return a copy of self with the opposite orientationr   r}   )
ÚcopyÚdeepcopyr[  r   r/  rž   ÚReversedParameterr   ÚReversedrÆ   )r™   Úreversed_edger7  r8  rV  r”  s         rš   ÚreversedzEdge.reversedô  s�   € äŸ™ dÓ+ˆØ—}‘} QÓ'ˆØ—m‘m AÓ&ˆÜ×!Ñ! $§,¡,°°tÓ<ˆØ×'Ñ'¨Ó.ˆØ×&Ñ& tÓ,ˆÜ-¨e¯n©nÓ.>ÀÀeÓL×QÑQÓSˆØ +ˆÔØÐrœ   c                óä   — | j                   t        j                  k7  rt        d| j                   › �«      ‚t	        | j                  d«      | j                  d«      | j                  d«      z
  «      S )z"Translate a linear Edge to an Axisz+to_axis is only valid for linear Edges not r   r}   )r  ro   r  rŸ   rv   rï   r˜   s    rš   rš  zEdge.to_axis   sd   € à�>‰>œXŸ]™]Ò*ÜØ=¸d¿n¹nÐ=MÐNóð ô �D×$Ñ$ QÓ'¨×)9Ñ)9¸!Ó)<¸t×?OÑ?OÐPQÓ?RÑ)RÓSÐSrœ   c                ó   — t        | g«      S )zEdge as Wire)rÈ   r˜   s    rš   Úto_wirezEdge.to_wire  s   € ä�T�F‹|Ðrœ   c                óz  — ||k\  rt        d|› d|› d�«      ‚t        j                  t        j                  | «      j
                  | j                  d«      | j                  d«      «      }| j                  |«      }| j                  |«      }t        |||«      }t        |«      j                  «       }t        |«      S )a)  trim

        Create a new edge by keeping only the section between start and end.

        Args:
            start (float): 0.0 <= start < 1.0
            end (float): 0.0 < end <= 1.0

        Raises:
            ValueError: start >= end

        Returns:
            Edge: trimmed edge
        zstart (z) must be less than end (Ú)r   r}   )
rŸ   r   r/  r  r   rž   r[  r5   r   rÆ   )r™   r°  ry  Ú	new_curveÚ
parm_startÚparm_endÚtrimmed_curveÚnew_edges           rš   r‡  z	Edge.trim  s®   € ð �CŠ<Ü˜w u gÐ-FÀsÀeÈ1ÐMÓNÐNä×%Ñ%Ü�M‰M˜$Ó×'Ñ'¨¯©°qÓ)9¸4¿=¹=ÈÓ;Kó
ˆ	ð —]‘] 5Ó)ˆ
Ø—=‘= Ó%ˆÜ)ØØØó
ˆô
 +¨=Ó9×>Ñ>Ó@ˆÜ�H‹~Ðrœ   c                óz  — t        j                  t        j                  | «      j                  | j                  d«      | j                  d«      «      }t        |«      }| j                  |«      }t        |||«      }|j                  «       }t        |||«      }t        |«      j                  «       }	t        |	«      S )a  trim_to_length

        Create a new edge starting at the given normalized parameter of a
        given length.

        Args:
            start (float): 0.0 <= start < 1.0
            length (float): target length

        Returns:
            Edge: trimmed edge
        r   r}   )r   r/  r  r   rž   r[  r@   r.   r«  r5   r   rÆ   )
r™   r°  r«   r*  Úadaptor_curver+  Úabscissa_pointr,  r-  r.  s
             rš   r+  zEdge.trim_to_length+  s£   € ô ×%Ñ%Ü�M‰M˜$Ó×'Ñ'¨¯©°qÓ)9¸4¿=¹=ÈÓ;Kó
ˆ	ô
 *¨)Ó4ˆð —]‘] 5Ó)ˆ
Ü-¨m¸VÀZÓPˆð "×+Ñ+Ó-ˆô *¨)°ZÀÓJˆä*¨=Ó9×>Ñ>Ó@ˆÜ�H‹~Ðrœ   )NÚ NN)rÊ   z TopoDS_Edge | Axis | None | Noner[  Ústrr\  úColor | Noner]  úCompound | NonerH  )rÊ   rŒ   rÑ   r{   rC  rÆ   )rh  r{   rd  úlist[float] | NonerC  rÆ   )rÀ   r,  r¯  ry   rt  r,  ru  r,  rv  rl   rC  rÆ   )r~  r,  r  r,  r¯  ry   rt  r,  ru  r,  rv  rl   rC  rÆ   ))r   r   r   rM  rÂ   F)rŠ  r,  r‹  r,  rÀ   r,  r  r{   rh  r{   r#  r,  rŒ  rD  rC  rÈ   )r—  r{   r˜  r{   rC  rÆ   )rü   )r7  rÆ   rœ  rÆ   r  r,  rC  rÆ   )NFNTç�íµ ÷Æ°>)r5  úlist[VectorLike]r¨  zlist[VectorLike] | Noner©  rD  rª  r6  r«  rD  r¬  r,  rC  rÆ   )çü©ñÒMbP?Nr}   é   )r5  r8  r¬  r,  r¿  z!tuple[float, float, float] | NonerÀ  r‘  rÁ  r‘  rC  rÆ   )r°  r{   rg  r{   ry  r{   rC  rÆ   )r—  r{   r˜  r{   rÆ  r{   rC  rÆ   )rC  rK  )rÂ   r  F)r™   zWire | EdgerÌ  r‘  r°  r,  rÍ  r,  rÎ  rD  rC  rJ  )rä   zAxis | Edge | NonerÚ  r,  rC  zShapeList[Vector])r#  r,  rC  zlist[float])rC  r   )rÿ  zEdge | Axis | PlanerC  z/None | Vertex | Edge | ShapeList[Vertex | Edge]©r­  r{   rC  r,  ©NN)r  r~   rÑ   rN  r  rN  rC  ú
list[Edge])rC  rÆ   )rC  rv   ©rC  rÈ   )r°  r,  ry  r,  rC  rÆ   )r°  r,  r«   r,  rC  rÆ   )'rQ  rR  rS  rT  rà   r_  rU  r�  rV  rÒ   rp  ry   rW  rl   rs  r{  r…  r•  r“  rŸ  rº  rÂ  rÄ  rÇ  rÉ  rÑ  ru   rã  rñ  r¹   r  r  r  r$  rš  r'  r‡  r+  Ú__classcell__©rò  s   @rš   rÆ   rÆ   Œ  so  ø„ ñð €Eð
 15ØØ"Ø"&ð
à-ð
ð ð
ð ð	
ð
  õ
ðB òó ðð" òRó ðRð" àCGñ.AØ#ð.AØ.@ð.Aà	ò.Aó ð.Að` ð —x‘xØ"ØØ.>×.PÑ.Pð%àð%ð ð%ð ð	%ð
 ð%ð ,ð%ð 
ò%ó ð%ðN ð
 —x‘xØ"Ø Ø.>×.PÑ.Pð2àð2ð ð2ð ð	2ð
 ð2ð ð2ð ,ð2ð 
ò2ó ð2ðh ð 'Ø&ØØð> àð> ð ð> ð ð	> ð
 ð> ð ð> ð ð> ð ð> ð 
ò> ó ð> ð@ ò
ó ð
ð" ó%ó ð%ð0 ð -1ØØ)-ØØð`@à ð`@ð *ð`@ð ð	`@ð
 'ð`@ð ð`@ð ð`@ð 
ò`@ó ð`@ðD ð Ø7;ØØð-@à ð-@ð ð-@ð 5ð	-@ð
 ð-@ð ð-@ð 
ò-@ó ð-@ð^ ð@Øð@Ø)3ð@Ø:Dð@à	ò@ó ð@ð* ð@Øð@Ø)3ð@Ø=Gð@à	ò@ó ð@ó.ð ØØ$ð#Øð#àð#ð ð#ð ð	#ð
 ð#ð 
ó#ðL +/À9ðM(Ø'ðM(Ø;@ðM(à	óM(ð^:àð:ð 
ó:óx/ðPØ0ðPà	8óPód%ðT (,Ø$(ð	"àð"ð %ð"ð "ð	"ð
 
ó"óH
óTóó÷>rœ   rÆ   c                  óÈ  ‡ — e Zd ZdZdZe	 	 	 d	 	 	 	 	 	 	 d d„«       Ze	 	 	 d	 	 	 	 	 	 	 d!d„«       Ze	 	 	 d	 	 	 	 	 	 	 d"d„«       Ze	 	 	 d	 	 	 	 	 	 	 d#d„«       Ze	 	 	 	 d$	 	 	 	 	 	 	 	 	 d%d„«       Zˆ fd„Zed&d'd	„«       Ze	 d(	 	 	 	 	 d)d
„«       Z	ed*d„«       Z
eej                  fd+d„«       Zed,d-d„«       Zeej                  ddej                   df	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 d.d„«       Zed/d0d„«       Zeej                  f	 	 	 	 	 	 	 d1d„«       Ze	 	 	 	 	 	 d2d„«       Z	 d3	 	 	 	 	 	 	 	 	 d4d„Zd5d„Zd6d„Zd7d„Zd8d„Zd9d„Zd:d„Z	 	 d;	 	 	 	 	 	 	 d<d„Zd=d„Zd5d„Zd>d„Z ˆ xZ!S )?rÈ   ax  A Wire in build123d is a topological entity representing a connected sequence
    of edges forming a continuous curve or path in 3D space. Wires are essential
    components in modeling complex objects, defining boundaries for surfaces or
    solids. They store information about the connectivity and order of edges,
    allowing precise definition of paths within a 3D model.g      ø?c                 ó   — y)a'  Build a wire from an OCCT TopoDS_Wire

        Args:
            obj (TopoDS_Wire, optional): OCCT Wire.
            label (str, optional): Defaults to ''.
            color (Color, optional): Defaults to None.
            parent (Compound, optional): assembly parent. Defaults to None.
        Nr—   )r™   rÊ   r[  r\  r]  s        rš   r_  zWire.__init__W  rì  rœ   c                 ó   — y)a  Build a Wire from an Edge

        Args:
            edge (Edge): Edge to convert to Wire
            label (str, optional): Defaults to ''.
            color (Color, optional): Defaults to None.
            parent (Compound, optional): assembly parent. Defaults to None.
        Nr—   )r™   rã   r[  r\  r]  s        rš   r_  zWire.__init__h  rì  rœ   c                 ó   — y)aP  Build a Wire from an Wire - used when the input could be an Edge or Wire.

        Args:
            wire (Wire): Wire to convert to another Wire
            label (str, optional): Defaults to ''.
            color (Color, optional): Defaults to None.
            parent (Compound, optional): assembly parent. Defaults to None.
        Nr—   ©r™   rA  r[  r\  r]  s        rš   r_  zWire.__init__y  rì  rœ   c                 ó   — y)a  Build a Wire from an Curve.

        Args:
            curve (Curve): Curve to convert to a Wire
            label (str, optional): Defaults to ''.
            color (Color, optional): Defaults to None.
            parent (Compound, optional): assembly parent. Defaults to None.
        Nr—   rE  s        rš   r_  zWire.__init__Š  rì  rœ   c                 ó   — y)aw  Build a wire from Edges

        Build a Wire from the provided unsorted Edges. If sequenced is True the
        Edges are placed in such that the end of the nth Edge is coincident with
        the n+1th Edge forming an unbroken sequence. Note that sequencing a list
        is relatively slow.

        Args:
            edges (Iterable[Edge]): Edges to assemble
            sequenced (bool, optional): arrange in order. Defaults to False.
            label (str, optional): Defaults to ''.
            color (Color, optional): Defaults to None.
            parent (Compound, optional): assembly parent. Defaults to None.
        Nr—   )r™   rÛ   Ú	sequencedr[  r\  r]  s         rš   r_  zWire.__init__›  rì  rœ   c           	     ó²  •— d\	  }}}}}}}	}
}|�rt        |«      }t        |d   t        «      r|d d dd|z
  z  z   \  }}	}
}nÐt        |d   t        «      r|d d dd|z
  z  z   \  }}	}
}n©t        |d   t        «      r|d d dd|z
  z  z   \  }}	}
}n‚t        |d   d«      rLt        |d   j                  t        «      r/t        |d   j                  «      dk(  r|d d dd|z
  z  z   \  }}	}
}n't        |d   t        «      r|d d dd|z
  z  z   \  }}}	}
}dj                  t        |j                  «       «      j                  g d	¢«      «      }|rt        d
|› �«      ‚|j                  d|«      }|j                  d|«      }|j                  d|«      }|j                  d|«      }|j                  d|	«      }	|j                  d|
«      }
|j                  d|«      }|j                  d|«      }|j                  d|«      }|�|g}n|�|j!                  «       }|�|j                  }n|rt        j#                  ||€dn|«      }t$        ‰| �M  ||	€dn|	|
|¬«       y )N)	NNNNNNNNNr   rØ   r	  rž   r}   é   z, )	rV  rA  rã   rÛ   rH  rÊ   r[  r\  r]  zUnexpected argument(s) rÊ   rã   rÛ   rH  r[  r\  r]  rA  rV  Fr2  rZ  )rÜ   rÙ   r`   rÆ   rÈ   Úhasattrrž   r[   r…   r   Újoinr.  r1  Ú
differencerŸ   ÚgetrÛ   Ú
_make_wirer^  r_  )r™   ÚargsÚkwargsrV  rã   rÛ   rA  rH  rÊ   r[  r\  r]  Úl_aÚunknown_argsrò  s                 €rš   r_  zWire.__init__³  s‚  ø€ ØITÑFˆˆt�U˜D )¨S°%¸ÀâÜ�d“)ˆCÜ˜$˜q™'¤;Ô/Ø,0°°!¨H°wÀ!ÀcÁ'Ñ7JÑ,JÑ)��U˜E¡6Ü˜D ™G¤TÔ*Ø-1°"°1¨X¸À1ÀsÁ7Ñ8KÑ-KÑ*��e˜U¡FÜ˜D ™G¤TÔ*Ø-1°"°1¨X¸À1ÀsÁ7Ñ8KÑ-KÑ*��e˜U¡Fô ˜˜Q™ Ô+Ü˜t A™wŸ™´Ô@Ü˜t A™wŸ™Ó/°1Ò4à.2°2°A¨h¸ÀAÈÁGÑ9LÑ.LÑ+��u˜e¡VÜ˜D ™G¤XÔ.Ø9=¸b¸q¸ÀGÈqÐSVÉwÑDWÑ9WÑ6��y %¨°à—y‘yÜ�—‘“Ó×)Ñ)ò
óó
ˆñ ÜÐ6°|°nÐEÓFÐFà�j‰j˜ Ó$ˆØ�z‰z˜& $Ó'ˆØ—
‘
˜7 EÓ*ˆØ—J‘J˜{¨IÓ6ˆ	Ø—
‘
˜7 EÓ*ˆØ—
‘
˜7 EÓ*ˆØ—‘˜H fÓ-ˆØ�z‰z˜& $Ó'ˆØ—
‘
˜7 EÓ*ˆàÐØ�F‰EØÐØ—K‘K“MˆEØÐØ—,‘,‰CÙÜ—/‘/ %°)Ð2C©ÈÓSˆCä‰ÑØØ˜‘"¨5ØØð	 	õ 	
rœ   c                óÒ  — dd„}t        |«      }|r^|j                  d«      g}|}|rF |t        |«      |«      }|j                  |«      }|j	                  |j                  |«      «       |rŒF|}t        «       }t        «       }	|D ]  }
|	j                  |
j                  «       Œ |j                  |	«       |j                  «        |j                  «       s‚|j                  «       t        k(  r't        j                  dd¬«       |j                  «       S |j                  «       t         k(  rt#        d«      ‚|j                  «       t$        k(  rt'        d«      ‚|j                  «       S )	ah  _make_wire

        Build a Wire from the provided unsorted Edges. If sequenced is True the
        Edges are placed in such that the end of the nth Edge is coincident with
        the n+1th Edge forming an unbroken sequence. Note that sequencing a list
        is relatively slow.

        Args:
            edges (Iterable[Edge]): Edges to assemble
            sequenced (bool, optional): arrange in order. Defaults to False.

        Raises:
            ValueError: Edges are disconnected and can't be sequenced.
            RuntimeError: Wire is empty

        Returns:
            Wire: assembled edges
        c                óP   ‡— | j                  d«      Št        |ˆfd„¬«      }|d   S )z/Return the Edge closest to the end of last_edger}   c                óŒ   •— t        ‰| j                  d«      z
  j                  ‰| j                  d«      z
  j                  «      S )Nr   r}   )ræ  rï   r«   )ré   Útarget_points    €rš   r  z9Wire._make_wire.<locals>.closest_to_end.<locals>.<lambda>	  s8   ø€ œcØ! A§M¡M°!Ó$4Ñ4×<Ñ<Ø! A§M¡M°!Ó$4Ñ4×<Ñ<ôrœ   r*  r   )rï   r0  )ÚcurrentÚunplaced_edgesÚsorted_edgesrW  s      @rš   Úclosest_to_endz'Wire._make_wire.<locals>.closest_to_end	  s1   ø€ à"×.Ñ.¨qÓ1ˆLä!ØóôˆLð   ‘?Ð"rœ   r   z8Wire is non manifold (e.g. branching, self intersecting)r  )Ú
stacklevelzWire is emptyzEdges are disconnected)rX  rÈ   rY  r=  rC  rÆ   )râ   ÚpoprÈ   ÚindexrŽ  r   rY   rô  rž   rÍ  r¬   r§  ÚErrorr    ÚwarningsÚwarnr   r‹  r   rŸ   )rÉ   rÛ   rH  r[  Úplaced_edgesrY  Ú	next_edgeÚnext_edge_indexÚwire_builderÚcombined_edgesrã   s              rš   rO  zWire._make_wireö  sE  € ó*	#ô �U“ˆÙØ!ŸI™I a›L˜>ˆLØ"ˆNá Ù*¬4°Ó+=¸~ÓN�	Ø"0×"6Ñ"6°yÓ"A�Ø×#Ñ# N×$6Ñ$6°Ó$GÔHò !ð
 !ˆEä.Ó0ˆÜ-Ó/ˆÛˆDØ×!Ñ! $§,¡,Õ/ð à×Ñ˜Ô(à×ÑÔØ×"Ñ"Ô$Ø×!Ñ!Ó#Ô'EÒEÜ—‘ØNØ õð × Ñ Ó"Ð"ð ×#Ñ#Ó%Ô)AÒAÜ" ?Ó3Ð3Ø×#Ñ#Ó%Ô)HÒHÜ Ð!9Ó:Ð:à× Ñ Ó"Ð"rœ   c                ó²  — t        «       }t        «       }|D ��cg c]  }|j                  «       D ]  }|‘Œ Œ c}}D ]  }|j                  |j                  «       Œ t	        j
                  ||d|«       t        «       }t        |j                  «       «      D ]7  }|j                  t        t        |j                  |dz   «      «      «      «       Œ9 |S c c}}w )a
  combine

        Combine a list of wires and edges into a list of Wires.

        Args:
            wires (Iterable[Wire |  Edge]): unsorted
            tol (float, optional): tolerance. Defaults to 1e-9.

        Returns:
            ShapeList[Wire]: Wires
        Fr}   )rW   rÛ   rô  rž   rG   ÚConnectEdgesToWires_sr   r-  ÚLengthrŽ  rÈ   r‚   rU  )	rÉ   r�  r¬  Úedges_inÚ	wires_outrž  ré   rã   r?  s	            rš   ÚcombinezWire.combine8	  s¯   € ô  -Ó.ˆÜ-Ó/ˆ	á %Ô9¡˜1¨q¯w©w®y¨!’Q¨y�Q Õ9ˆDØ�O‰O˜DŸL™LÕ)ð :ô 	!×6Ñ6°xÀÀeÈYÔWä“ˆÜ�y×'Ñ'Ó)Ö*ˆAØ�L‰Lœœh y§¡°q¸1±uÓ'=Ó>Ó?Õ@ð +ð ˆùó :s   šCc                ó   — t        d«      ‚)z$extrude - invalid operation for Wirez#Wires can't be created by extrusion)ÚNotImplementedErrorrÐ   s      rš   rÒ   zWire.extrudeV	  s   € ô "Ð"GÓHÐHrœ   c                óH   — t         j                  ||¬«      }t        |g«      S )zîmake_circle

        Makes a circle centered at the origin of plane

        Args:
            radius (float): circle radius
            plane (Plane): base plane. Defaults to Plane.XY

        Returns:
            Wire: a circle
        )r¯  )rÆ   r{  rÈ   )rÉ   rÀ   r¯  Úcircle_edges       rš   r{  zWire.make_circle[	  s&   € ô ×&Ñ& v°UÐ&Ó;ˆÜ�[�MÓ"Ð"rœ   c                óþ  — t        |«      }t        d|z  «      }i }g }t        |«      D ][  \  }}t        |«      D ]H  }||dz
  z  }	|j	                  |j                  |	«      j                  «       dd «       ||	f|||z  |z   <   ŒJ Œ] t        |«      }
g }i }|
j                  D �]+  }||d      d   }||d      d   }||k7  r|||vr
|d   g||<   n||   j	                  |d   «       ||vr
|d   g||<   n||   j	                  |d   «       |j	                  |||d      d   |d   f|||d      d   |d   ff«       Œ›t        |d   |d   z
  «      dk7  sŒ³t        |j                  «       «      }t        |j                  «       «      }||vr||g||<   n||   j                  ||g«       |j	                  |||   d   |f|||   d   |ff«       �Œ. i }|j                  «       D ]d  \  }}t        |«      }g }t        dt!        |«      dz
  d«      D ]1  }||   ||dz      k7  sŒ|j	                  t#        |||dz    «      «       Œ3 |||<   Œf |D �cg c]<  }t$        j'                  ||d   d      |d   d   z  ||d   d      |d   d   z  «      ‘Œ> }}|j                  «       D ���cg c]3  \  }}|D ])  }||   j)                  ||d      d   ||d      d   «      ‘Œ+ Œ5 }}}}t+        ||z   d¬«      }|S c c}w c c}}}w )aÑ  make_convex_hull

        Create a wire of minimum length enclosing all of the provided edges.

        Note that edges can't overlap each other.

        Args:
            edges (Iterable[Edge]): edges defining the convex hull
            tolerance (float): allowable error as a fraction of each edge length.
                Defaults to 1e-3.

        Raises:
            ValueError: edges overlap

        Returns:
            Wire: convex hull perimeter
        r  r}   Nr   T)rH  )râ   r‘  r-  r-  rŽ  rï   Úto_tupler   Ú	simplicesr’  ræ  Útolistrç  r,  Úitemsr0  rÜ   r¥  rÆ   r“  r‡  rÈ   )rÉ   rÛ   rÚ  Úfragments_per_edgeÚpoints_lookupr5  Ú
edge_indexrã   r?  re  Úconvex_hullÚconnecting_edge_dataÚtrim_pointsÚsimplicer¦  r§  Ú	start_pntÚend_pntÚ	trim_dataÚstart_end_pntsÚs_pointsÚf_pointsr
  Úconnecting_edgesÚ
trim_pairsÚ	trim_pairÚtrimmed_edgesÚ	hull_wires                               rš   Úmake_convex_hullzWire.make_convex_hullk	  sË  € ôT �U“ˆÜ   Y¡Ó/ÐØˆØˆô !*¨%Ö 0ÑˆJ˜ÜÐ-Ö.�ØÐ/°!Ñ3Ñ4�Ø—‘˜d×.Ñ.¨uÓ5×>Ñ>Ó@ÀÀ!ÐDÔEØFPÐRWÐEX�˜jÐ+=Ñ=ÀÑAÒBñ /ð !1ô ! Ó(ˆð  "ÐØ,.ˆØ#×-Õ-ˆHØ! (¨1¡+Ñ.¨qÑ1ˆEØ! (¨1¡+Ñ.¨qÑ1ˆEà˜Š~Ø Ñ+Ø*2°1©+¨�K Ò&à Ñ&×-Ñ-¨h°q©kÔ:Ø Ñ+Ø*2°1©+¨�K Ò&à Ñ&×-Ñ-¨h°q©kÔ:Ø$×+Ñ+à ¨h°q©kÑ :¸1Ñ =¸xÈ¹{ÐKØ ¨h°q©kÑ :¸1Ñ =¸xÈ¹{ÐKðõô �X˜a‘[ 8¨A¡;Ñ.Ó/°1Ó4Ü §¡Ó 1Ó2�	Ü˜hŸo™oÓ/Ó0�Ø Ñ+Ø*3°WÐ)=�K Ò&à Ñ&×-Ñ-¨y¸'Ð.BÔCØ$×+Ñ+à ¨iÑ 8¸Ñ ;¸YÐGØ ¨gÑ 6°qÑ 9¸7ÐCðöð7 .ðD ˆ	Ø*5×*;Ñ*;Ö*=Ñ&ˆJ˜Ü˜nÓ-ˆHØˆHÜ˜1œc (›m¨aÑ/°Ö3�Ø˜A‘; (¨1¨q©5¡/Ó1Ø—O‘O¤E¨(°1°q¸1±uÐ*=Ó$>Õ?ð 4ð %-ˆI�jÒ!ð +>ñ -ó	
ñ -�ô �N‰NØ�d˜1‘g˜a‘jÑ! D¨¡G¨A¡JÑ.°°d¸1±g¸a±jÑ0AÀDÈÁGÈAÁJÑ0Nõð -ð	 	ð 
ð +4¯/©/Ô*;õ	
ñ +<Ñ&�
˜JÛ'�	ð	 �*Ñ×"Ñ"Ø˜i¨™lÑ+¨AÑ.°¸iÈ¹lÑ0KÈAÑ0Nõð (ð	ð +<ð	 	ò 
ô Ð)¨MÑ9ÀTÔJˆ	ØÐùò
ùô
s   ÉAK3Ê%8K8r   Tc                óâ   — t         j                  ||||||«      }||k7  rC|rAt         j                  |j                  «       |j	                  «       «      }	t        ||	g«      }
|
S t        |g«      }
|
S )aâ  make ellipse

        Makes an ellipse centered at the origin of plane.

        Args:
            x_radius (float): x radius of the ellipse (along the x-axis of plane)
            y_radius (float): y radius of the ellipse (along the y-axis of plane)
            plane (Plane, optional): base plane. Defaults to Plane.XY.
            start_angle (float, optional): _description_. Defaults to 360.0.
            end_angle (float, optional): _description_. Defaults to 360.0.
            angular_direction (AngularDirection, optional): arc direction.
                Defaults to AngularDirection.COUNTER_CLOCKWISE.
            closed (bool, optional): close the arc. Defaults to True.

        Returns:
            Wire: an ellipse
        )rÆ   r…  r“  rX  r  rÈ   )rÉ   r~  r  r¯  rt  ru  rv  r–  Úellipse_edger
  rA  s              rš   r…  zWire.make_ellipseá	  sy   € ô8 ×(Ñ(Ø�h  {°IÐ?Pó
ˆð ˜)Ò#©Ü—>‘> ,×"8Ñ"8Ó":¸L×<TÑ<TÓ<VÓWˆDÜ˜ tÐ,Ó-ˆDð ˆô ˜˜Ó'ˆDàˆrœ   c                ó,  — |D �cg c]  }t        |«      ‘Œ }}|d   |d   z
  j                  t        kD  r|r|j                  |d   «       t	        «       }|D ]!  }|j                  |j                  «       «       Œ#  | |j                  «       «      S c c}w )a  make_polygon

        Create an irregular polygon by defining vertices

        Args:
            vertices (Iterable[VectorLike]):
            close (bool, optional): close the polygon. Defaults to True.

        Returns:
            Wire: an irregular polygon
        r   r  )rz   r«   ru   rŽ  r   rÍ  rÏ  rÈ   )rÉ   r?  rÉ  r¤  Úvectorsre  r<  s          rš   Úmake_polygonzWire.make_polygon	
  sŠ   € ñ '/Ó/¡h ”6˜!•9 hˆÐ/Ø�A‰J˜ ™Ñ$×,Ñ,¬yÒ8¹UØ�N‰N˜7 1™:Ô&ä1Ó3ˆÛˆFØ×Ñ˜VŸ]™]›_Õ-ð ñ �<×$Ñ$Ó&Ó'Ð'ùò 0s   …Bc                óÂ   — |dz  |dz  f|dz  |dz  f|dz  |dz  f|dz  |dz  fg}|D �cg c]  }|j                  |«      ‘Œ }}t        j                  |d¬«      S c c}w )aS  Make Rectangle

        Make a Rectangle centered on center with the given normal

        Args:
            width (float): width (local x)
            height (float): height (local y)
            plane (Plane, optional): plane containing rectangle. Defaults to Plane.XY.

        Returns:
            Wire: The centered rectangle
        r  éþÿÿÿT)rÉ  )rÙ  rÈ   r�  )rÉ   Úwidthr‹  r¯  Úcorners_localr   Úcorners_worlds          rš   Ú	make_rectzWire.make_rect 
  s‰   € ð( �Q‰Y˜ ™
Ð#Ø�Q‰Y˜ ™Ð$Ø�R‰Z˜ "™Ð%Ø�R‰Z˜ !™Ð$ð	
ˆñ >KÓK¹]¸˜×0Ñ0°Õ3¸]ˆÐKÜ× Ñ  °dÐ Ó;Ð;ùò Ls   «Ac                óN   — | r"|\  }}|| k(  r||fS || k(  r||fS t        d«      ‚|S )z9Order the edges of a chamfer relative to a reference Edgezreference edge not in edges)rŸ   )Úreference_edgerÛ   r§  Úedge2s       rš   Úorder_chamfer_edgeszWire.order_chamfer_edges>
  sE   € ñ
 Ø ‰LˆE�5Ø˜Ò&Ø˜e�|Ð#Ø˜Ò&Ø˜e�|Ð#ÜÐ:Ó;Ð;Øˆrœ   c                ó  — |}t        | j                  «      }t        |«      }t        «       }t	        j
                  |t        j                  t        j                  |«       |D ]¶  }	|j                  |	j                  «      }
t        |
j                  «       «      t        |
j                  «       «      f}t        j                  ||«      \  }}|j                  t!        j"                  |j                  «      t!        j"                  |j                  «      ||«       Œ¸ |j%                  «        |j'                  «       }t)        |«      }|j+                  «        t-        |j'                  «       «      }t        t/        j0                  |«      «      S )aŽ  chamfer_2d

        Apply 2D chamfer to a wire

        Args:
            distance (float): chamfer length
            distance2 (float): chamfer length
            vertices (Iterable[Vertex]): vertices to chamfer
            edge (Edge): identifies the side where length is measured. The vertices must be
                part of the edge

        Returns:
            Wire: chamfered wire
        )r‰   rž   r"   rX   rT   ÚMapShapesAndAncestors_sr­   rÅ   r®   ÚFindFromKeyrÆ   ÚFirstÚLastrÈ   r—  Ú
AddChamferrZ   rc  r¬   r~   rH   rŠ  r‚   r+   ÚOuterWire_s)r™   ra  Ú	distance2r?  rã   r•  Úunchamfered_faceÚchamfer_builderÚvertex_edge_mapr¤  rR  rÛ   r§  r–  Úchamfered_faceÚ	shape_fixs                   rš   Ú
chamfer_2dzWire.chamfer_2dN
  s5  € ð* ˆô 8¸¿¹ÓEÐÜ4Ð5EÓFˆäCÓEˆÜ×&Ñ&Øœb×.Ñ.´·±Àô	
ó ˆAØ'×3Ñ3°A·I±IÓ>ˆIô ˜)Ÿ/™/Ó+Ó,¬d°9·>±>Ó3CÓ.DÐEˆEä×3Ñ3°NÀEÓJ‰LˆE�5à×&Ñ&Ü—‘˜eŸm™mÓ,Ü—‘˜eŸm™mÓ,ØØõ	ð ð  	×ÑÔØ(×.Ñ.Ó0ˆä" >Ó2ˆ	Ø×ÑÔÜ! )§/¡/Ó"3Ó4ˆä”I×)Ñ)¨.Ó9Ó:Ð:rœ   c                ó¾   — | j                   sNt        j                  | j                  «       | j	                  «       «      }t
        j                  | |f«      d   }|S | }|S )zClose a Wirer   )r¡   rÆ   r“  rX  r  rÈ   rl  )r™   rã   ry  s      rš   rÉ  z
Wire.close‡
  sU   € à�~Š~Ü—>‘> $§.¡.Ó"2°D×4DÑ4DÓ4FÓGˆDÜŸ<™<¨¨t¨Ó5°aÑ8ˆLð Ðð  ˆLàÐrœ   c                ó  — t        | j                  «      }t        |«      }|D ]  }|j                  |j                  |«       Œ  |j	                  «        t        |j                  «       «      }t        t        j                  |«      «      S )zÎfillet_2d

        Apply 2D fillet to a wire

        Args:
            radius (float):
            vertices (Iterable[Vertex]): vertices to fillet

        Returns:
            Wire: filleted wire
        )
r‰   rž   r"   Ú	AddFilletr¬   r‚   r~   rÈ   r+   rž  )r™   rÀ   r?  Úunfilleted_faceÚfillet_builderr<  Úfilleted_faces          rš   Ú	fillet_2dzWire.fillet_2d‘
  so   € ô 7°t·|±|ÓDˆä3°OÓDˆÛˆFØ×$Ñ$ V§^¡^°VÕ<ð à×ÑÔÜ  ×!5Ñ!5Ó!7Ó8ˆä”I×)Ñ)¨-Ó8Ó9Ð9rœ   c                óô   — t        | j                  «      }|j                  |«       |j                  d«       |j	                  «        |j                  «        t        t        |j                  «       «      «      S )zÔfix_degenerate_edges

        Fix a Wire that contains degenerate (very small) edges

        Args:
            precision (float): minimum value edge length

        Returns:
            Wire: fixed wire
        r7  )	rI   rž   ÚSetPrecisionÚSetMaxToleranceÚFixSmallEdgesÚFixWireGapsrÈ   r‚   r~   )r™   Ú	precisionÚsf_ws      rš   Úfix_degenerate_edgeszWire.fix_degenerate_edges¨
  s\   € ô " $§,¡,Ó/ˆØ×Ñ˜)Ô$Ø×Ñ˜TÔ"Ø×ÑÔØ×ÑÔÜ”H˜TŸZ™Z›\Ó*Ó+Ð+rœ   c                ó,   — t        | j                  «      S )z(Return the Geom Comp Curve for this Wire)r   rž   r˜   s    rš   r¹   zWire.geom_adaptorº
  s   € ä$ T§\¡\Ó2Ð2rœ   c                ó²   — | j                  «       j                  | «      D �cg c]   }|j                  r|n|j                  «       ‘Œ" }}t	        |«      S c c}w )zBReturn the edges in self ordered by wire direction and orientation)rÛ   Úsort_byr¥   r$  r   )r™   ré   Úordered_edgess      rš   Úorder_edgeszWire.order_edges¾
  sU   € ð :>¿¹»×9MÑ9MÈdÔ9Só
Ù9S°A�—’‰A 1§:¡:£<Ñ/Ð9Sð 	ð 
ô ˜Ó'Ð'ùò
s   ¢%Ac                óX  ‡— | j                   }| j                  «       }| j                  d«      Šd}d}|rât        |ˆfd„¬«      d   }|j	                  |j                  |«      «       |j                  d«      }|j                  d«      }‰|z
  j                   ‰|z
  j                   kD  }	|	r|n|Š|j                  |«      t        k  r>d}|j                  |«      }
|	r|d|
z
  |j                   z  z  }n||
|j                   z  z  }n||j                   z  }|rŒâ|st        |› d�«      ‚||z  S )	zParameter at point on Wirer   rÂ   Fc                ó&   •— | j                  ‰«      S r	  )r.  )ré   Útargets    €rš   r  z%Wire.param_at_point.<locals>.<lambda>Ô
  s   ø€ °1·=±=ÀÔ3Hrœ   r*  r}   Tz not on wire)
r«   rÛ   rï   r0  r]  r^  r.  ru   r  rŸ   )r™   r­  Úwire_lengthrR  ra  Úfoundrã   Úedge_p0Úedge_p1Úflippedr®  r¼  s              @rš   r  zWire.param_at_pointÅ
  s9  ø€ ð —k‘kˆØ—J‘J“Lˆ	Ø×!Ñ! !Ó$ˆØˆØˆáä˜)Ó)HÔIÈ!ÑLˆDØ�M‰M˜)Ÿ/™/¨$Ó/Ô0ð ×&Ñ& qÓ)ˆGØ×&Ñ& qÓ)ˆGØ Ñ'×/Ñ/°6¸GÑ3C×2KÑ2KÑKˆGñ !(‘W¨WˆFð ×Ñ Ó&¬)Ò3Ø�Ø×-Ñ-¨eÓ4�ÙØ  W¡°·±Ñ ;Ñ;‘Hà ¨$¯+©+Ñ 5Ñ5�HØØ˜Ÿ™Ñ#ˆHò- ñ0 Ü ˜w lÐ3Ó4Ð4à˜+Ñ%Ð%rœ   c                ó.  — | j                   �|j                   €t        d«      ‚|du |du z  st        d«      ‚|�$t        |«      j                  «       }t        «       }nd}t        |«      }|�6t	        | j                   |j                   t        |j                  «       Ž «      }n5t	        | j                   |j                   t        |j                  «       Ž «      }g }| j                   j                  «       }|j                  «       r‡|j                  «       }	||	j                  «       k(  r|j                  t        |	«      «       n(|j                  t        |	j                  «       «      «       |j                  «        |j                  «       rŒ‡t        j                   dt#        |«      «       t#        |«      dkD  rØg }
| j%                  «       }|D ]}  }|j%                  «       }|�I||z
  j                  «       }|j'                  |«      dk\  sŒ=|
j                  |||z
  j(                  f«       Œ^|
j                  |||z
  j(                  f«       Œ |
j+                  d„ ¬«       t        j                   d	t#        |
«      «       |
D �cg c]  }|d   ‘Œ	 }}|S c c}w )
aÁ  Project Wire

        Project a Wire onto a Shape generating new wires on the surfaces of the object
        one and only one of `direction` or `center` must be provided. Note that one or
        more wires may be generated depending on the topology of the target object and
        location/direction of projection.

        To avoid flipping the normal of a face built with the projected wire the orientation
        of the output wires are forced to be the same as self.

        Args:
          target_object: Object to project onto
          direction: Parallel projection direction. Defaults to None.
          center: Conical center of projection. Defaults to None.
          target_object: Shape:
          direction: VectorLike:  (Default value = None)
          center: VectorLike:  (Default value = None)

        Returns:
          : Projected wire(s)

        Raises:
          ValueError: Only one of direction or center must be provided

        Nz,Can't project empty Wires or to empty Shapesz2One of either direction or center must be providedz!wire generated %d projected wiresr}   r   c                ó   — | d   S )Nr}   r—   r(  s    rš   r  z'Wire.project_to_shape.<locals>.<lambda>Q  s   € °a¸²drœ   r*  z8projected, filtered and sorted wire list is of length %d)rž   rŸ   rz   r2  r*   re   rr  rh   r£   r¯   rÅ  rŽ  rÈ   r"  rÆ  r|   ÚdebugrÜ   r  Údotr«   Úsort)r™   r  rÑ   r  Údirection_vectorÚcenter_pointÚprojection_objectÚoutput_wiresÚtarget_orientationÚprojected_wireÚoutput_wires_distancesÚplanar_wire_centerÚoutput_wireÚoutput_wire_centerÚoutput_wire_directionrž  s                   rš   r  zWire.project_to_shapeï
  s„  € ð@ �<‰<Ð =×#8Ñ#8Ð#@ÜÐKÓLÐLà˜TÐ! f° nÒ5ÜÐQÓRÐRØÐ Ü% iÓ0×;Ñ;Ó=ÐÜ!›8‰Là#ÐÜ! &›>ˆLð Ð'Ü 3Ø—‘Ø×%Ñ%ÜÐ(×1Ñ1Ó3Ð4ó!Ñô !4Ø—‘Ø×%Ñ%Ü˜×-Ñ-Ó/Ð0ó!Ðð ˆØ!Ÿ\™\×5Ñ5Ó7ÐØ×$Ñ$Ô&Ø.×6Ñ6Ó8ˆNØ! ^×%?Ñ%?Ó%AÒAØ×#Ñ#¤D¨Ó$8Õ9à×#Ñ#¤D¨×)@Ñ)@Ó)BÓ$CÔDØ×"Ñ"Ô$ð  ×$Ñ$Õ&ô 	�‰Ð8¼#¸lÓ:KÔLô
 ˆ|Ó˜qÒ Ø%'Ð"Ø!%§¡£ÐÛ+�Ø%0×%7Ñ%7Ó%9Ð"Ø#Ð/à*Ð-?Ñ?ß ‘j“lð *ð -×0Ñ0Ð1AÓBÀaÓGØ.×5Ñ5à +Ø!3Ð6HÑ!H× PÑ Pðõð +×1Ñ1à'Ø/°,Ñ>×FÑFðõð  ,ð* #×'Ñ'©NÐ'Ô;Ü�L‰LØJÜÐ*Ó+ôñ +AÓAÑ*@ Q˜A˜a›DÐ*@ˆLÐAàÐùò Bs   ÊJc                ó@  — t        «       }|j                  t        j                  | j                  «      «       |j                  t        j                  |j                  «      «       |j                  «        | j                  j                  |j                  «       «      S )zXAttempt to stich wires

        Args:
          other: Wire:

        Returns:

        )	r   rÍ  rZ   ÚWire_srž   r¬   rò  rÍ   rÈ   )r™   rä   re  s      rš   ÚstitchzWire.stitchZ  sl   € ô /Ó0ˆØ×ÑœŸ™ t§|¡|Ó4Ô5Ø×ÑœŸ™ u§}¡}Ó5Ô6Ø×ÑÔà�~‰~×"Ñ" <×#4Ñ#4Ó#6Ó7Ð7rœ   c                ó   — | S )zGReturn Wire - used as a pair with Edge.to_wire when self is Wire | Edger—   r˜   s    rš   r'  zWire.to_wirek  s   € àˆrœ   c                ó.  — ||k\  rt        d«      ‚| j                  «       }t        |«      dk(  rt        |d   j	                  ||«      g«      S g }d}|D ]î  }| j                  |j                  d«      «      }| j                  |j                  d«      «      }| j                  r||rt        |d«      st        |d«      rd|z
  n|}|rt        |d«      st        |d«      rd|z
  n|}t        |d«      xs, t        |d«      xs t        |d«      xs t        |d«      xs |}||kD  r||fn||f\  }}|j                  |||f«       Œð g }	|D �]?  \  }}}||k  s||kD  rŒ||k  r||k  r|	j                  |«       Œ/||k\  rw||k  rr|j                  | j                  |«      «      }
|j                  | j                  |«      «      }|
|kD  r||
fn|
|f\  }
}|	j                  |j	                  |
|«      «       Œ«||k  rH|j                  | j                  |«      «      }
|
dk7  sŒÖ|	j                  |j	                  d|
«      «       Œø|j                  | j                  |«      «      }|dk7  s�Œ|	j                  |j	                  |d«      «       �ŒB t        |	«      S )a)  trim

        Create a new wire by keeping only the section between start and end.

        Args:
            start (float): 0.0 <= start < 1.0
            end (float): 0.0 < end <= 1.0

        Raises:
            ValueError: start >= end

        Returns:
            Wire: trimmed wire
        zstart must be less than endr}   r   F)
rŸ   rÛ   rÜ   rÈ   r‡  r  rï   r¡   rˆ   rŽ  )r™   r°  ry  rÛ   Úedges_uv_valuesÚfound_end_of_wirerã   Úur¤  r†  Úu_edgeÚv_edges               rš   r‡  z	Wire.trimo  s«  € ð" �CŠ<ÜÐ:Ó;Ð;à—
‘
“ˆô ˆu‹:˜Š?Ü˜˜q™Ÿ™ u¨cÓ2Ð3Ó4Ð4ð <>ˆØ!ÐãˆDØ×#Ñ# D×$4Ñ$4°QÓ$7Ó8ˆAØ×#Ñ# D×$4Ñ$4°QÓ$7Ó8ˆAØ�~Š~ñ )¬i¸¸1¬oÄÈ1ÈaÄð ˜’Eàð ñ )¬i¸¸1¬oÄÈ1ÈaÄð ˜’Eàð ô ˜a “Oò )Ü   A“ò)ä   A“ò)ô !  A“ò)ð )ð "ð  šU�A�q‘6¨¨A¨‰DˆAˆqà×"Ñ" A q¨$ <Õ0ð3 ð6 ˆÜ)‰JˆAˆq�$Ø�5Šy˜A šGØà˜Šz˜a 3šhØ×$Ñ$ TÕ*à˜!’  q¢Ø×,Ñ,¨T×-=Ñ-=¸eÓ-DÓE�Ø×,Ñ,¨T×-=Ñ-=¸cÓ-BÓC�à(.°ª�V˜VÑ$¸fÀfÐ=Mñ �˜ð ×$Ñ$ T§Y¡Y¨v°vÓ%>Õ?à˜!’Ø×,Ñ,¨T×-=Ñ-=¸cÓ-BÓC�Ø˜Q“;Ø!×(Ñ(¨¯©°1°fÓ)=Õ>ð ×,Ñ,¨T×-=Ñ-=¸eÓ-DÓE�Ø˜Q”;Ø!×(Ñ(¨¯©°6¸1Ó)=Ö>ð/ *ô2 �MÓ"Ð"rœ   )r2  NN)rÊ   r`   r[  r3  r\  r4  r]  r5  )rã   rÆ   r[  r3  r\  r4  r]  r5  )rA  rÈ   r[  r3  r\  r4  r]  r5  )rA  r‘   r[  r3  r\  r4  r]  r5  )Fr2  NN)
rÛ   úIterable[Edge]rH  rD  r[  r3  r\  r4  r]  r5  )F)rÛ   rÜ  rH  rD  rC  r`   )rˆ  )r�  zIterable[Wire | Edge]r¬  r,  rC  rP  )rÊ   r~   rÑ   r{   rC  rÈ   )rÀ   r,  r¯  ry   rC  rÈ   )r9  )rÛ   rÜ  rÚ  r,  rC  rÈ   )r~  r,  r  r,  r¯  ry   rt  r,  ru  r,  rv  rl   r–  rD  rC  rÈ   rL  )r?  zIterable[VectorLike]rÉ  rD  rC  rÈ   )r�  r,  r‹  r,  r¯  ry   rC  rÈ   )r•  rE  rÛ   útuple[Edge, Edge]rC  rÝ  r	  )
ra  r,  rŸ  r,  r?  úIterable[Vertex]rã   rE  rC  rÈ   r>  )rÀ   r,  r?  rÞ  rC  rÈ   )r²  r,  rC  rÈ   )rC  r   rF  r;  r<  )r  r~   rÑ   rN  r  rN  rC  z
list[Wire])rä   rÈ   rC  rÈ   )r™   rÈ   r°  r,  ry  r,  rC  rÈ   )"rQ  rR  rS  rT  rà   r   r_  rV  rO  rl  rÒ   ry   rW  r{  rˆ  rl   rs  r…  r�  r“  Ústaticmethodr—  r¥  rÉ  r¬  r´  r¹   r¹  r  r  rÔ  r'  r‡  r?  r@  s   @rš   rÈ   rÈ   M  s«  ø„ ñ?ð €Eð ð Ø"Ø"&ðàðð ðð ð	ð
  òó ðð  ð Ø"Ø"&ðàðð ðð ð	ð
  òó ðð  ð Ø"Ø"&ðàðð ðð ð	ð
  òó ðð  ð Ø"Ø"&ðàðð ðð ð	ð
  òó ðð  ð  ØØ"Ø"&ðàðð ðð ð	ð
 ðð  òó ðô.?
ðF ó?#ó ð?#ðB à8<ðØ)ðØ05ðà	òó ðð: òIó ðIð Ø7<·x±xó #ó ð#ð ósó ðsðj ð
 —x‘xØ"Ø Ø.>×.PÑ.PØð%àð%ð ð%ð ð	%ð
 ð%ð ð%ð ,ð%ð ð%ð 
ò%ó ð%ðN ó(ó ð(ð, ð
 —x‘xð	<àð<ð ð<ð ð	<ð
 
ò<ó ð<ð: ðØ#ðØ,=ðà	òó ðð( !ð7;àð7;ð ð7;ð #ð	7;ð
 ð7;ð 
ó7;óró:ó.,ó$3ó(ó(&ðZ (,Ø$(ð	iàðið %ðið "ð	ið
 
óióV8ó"÷T#rœ   rÈ   c                óŠ  — t        «       }t        «       }| D ]*  }|j                  €Œ|j                  |j                  «       Œ, t        j                  ||d|«       t        «       }t        |j                  «       «      D ]A  }|j                  t        t        j                  |j                  |dz   «      «      «      «       ŒC |S )z‡Convert edges to a list of wires.

    Args:
      edges: Iterable[Edge]:
      tol: float:  (Default value = 1e-6)

    Returns:

    Fr}   )rW   rž   rô  rG   rh  r   r-  ri  rŽ  rÈ   rZ   rÓ  rU  )rÛ   r¬  rj  rk  rã   r�  r?  s          rš   Úedges_to_wiresrá  Æ  s›   € ô )Ó*€HÜ)Ó+€IãˆØ�<‰<Ñ#Ø�O‰O˜DŸL™LÕ)ð ô ×2Ñ2°8¸SÀ%ÈÔSä&›[€EÜ�9×#Ñ#Ó%Ö&ˆà�‰”Tœ&Ÿ-™-¨	¯©¸¸A¹Ó(>Ó?Ó@ÕAð 'ð €Lrœ   c                ó†   — t        «       }|j                  | |t        ¬«       |j                  «        |j	                  «       S )zOffset a topods_face)ÚOffsetÚTol)r'   Ú
Initializeru   ÚMakeOffsetShaper~   )r»  ÚamountÚoffsetors      rš   rª   rª   á  s8   € ä$Ó&€HØ×Ñ˜ V´ÐÔ;Ø×ÑÔà�>‰>ÓÐrœ   c                ó†  — |�|n| j                   }|€t        d«      ‚| j                  }|€t        d«      ‚t        «       }|j	                  «       D �cg c]  }|j                  €Œ|j                  ‘Œ }}|D ]2  }|j                  |«      rŒt        ||«      €Œ"|j                  |«       Œ4 t        d„ |D «       «      S c c}w )zFGiven an edge extracted from a Shape, return the edges connected to itúedge has no valid parentzedge is emptyc              3  ó2   K  — | ]  }t        |«      –— Œ y ­wr	  rÊ  r  s     rš   r×   z/topo_explore_connected_edges.<locals>.<genexpr>  s   è ø€ Ð6¡o ”T˜!—W¡oùrË  )	Útopo_parentrŸ   rž   r.  rÛ   ÚIsSamer‹   rÓ  r   )rã   r]  Úgiven_topods_edgeÚconnected_edgesré   Útopods_edgesr”  s          rš   Útopo_explore_connected_edgesrñ  ê  sÂ   € ð
 Ð)‰V¨t×/?Ñ/?€FØ€~ÜÐ3Ó4Ð4ØŸ™ÐØÐ Ü˜Ó)Ð)Ü“e€Oð (.§|¡|¤~ÓO¡~ !¸¿¹Ñ9N�A—I“I ~€LÐOã#ˆà×#Ñ# KÔ0Øä%Ð&7¸ÓEÑQØ×Ñ Õ,ð $ô Ñ6¡oÓ6Ó6Ð6ùò Ps   ÁB>Á%B>c                óÈ  — |�|n| j                   }|€t        d«      ‚t        «       }t        j                  |j
                  t        j                  t        j                  |«       g }|j                  | j
                  «      rF|j                  | j
                  «      }|D ]&  }|j                  t        j                  |«      «       Œ( t        |«      dk7  rt        d«      ‚|S )zMGiven an edge extracted from a Shape, return the topods_faces connected to itrê  r  z)Invalid # of faces connected to this edge)rì  rŸ   rX   rT   r™  rž   r­   r®   rø  ÚContainsrš  rŽ  rZ   rù  rÜ   r‹  )rã   r]  Úedge_face_mapÚfacesÚ	face_listr»  s         rš   r©   r©     s¾   € ð
 Ð)‰V¨t×/?Ñ/?€FØ€~ÜÐ3Ó4Ð4ô >Ó?€MÜ
×"Ñ"Ø�‰œŸ™¬¯©¸ôð
 €EØ×Ñ˜dŸl™lÔ+Ø!×-Ñ-¨d¯l©lÓ;ˆ	ÛˆDØ�L‰LœŸ™ tÓ,Õ-ð ô ˆ5ƒz�Q‚ÜÐFÓGÐGà€Lrœ   )r7  )rÛ   rÜ  r¬  r,  rC  rP  )r»  r]   rç  r,  rC  r^   r	  )rã   rÆ   r]  úShape | NonerC  rG  )rã   rÆ   r]  r÷  rC  zlist[TopoDS_Face])ÑrT  Ú
__future__r   r  rú  r`  Úcollections.abcr   r   Úmathr   r   r   r	   r
   r   r   Útypingr   r   r   Útyping_extensionsr   Únumpyr   Úscipy.optimizer   Úscipy.spatialr   Ú
OCP.TopAbsÚTopAbsr­   ÚOCP.BRepr   ÚOCP.BRepAdaptorr   r   ÚOCP.BRepAlgoAPIr   r   r   ÚOCP.BRepBuilderAPIr   r   r   r   r   r   r    ÚOCP.BRepExtremar!   ÚOCP.BRepFilletAPIr"   ÚOCP.BRepGPropr#   r$   ÚOCP.BRepLibr%   r&   ÚOCP.BRepOffsetr'   ÚOCP.BRepOffsetAPIr(   ÚOCP.BRepPrimAPIr)   ÚOCP.BRepProjr*   ÚOCP.BRepToolsr+   ÚOCP.GCr,   r-   Ú
OCP.GCPntsr.   Ú	OCP.GPropr/   ÚOCP.Geomr0   r1   r2   r3   r4   r5   r6   Ú
OCP.Geom2dr7   r8   r9   ÚOCP.Geom2dAPIr:   ÚOCP.GeomAPIr;   r<   r=   r>   ÚOCP.GeomAbsr?   ÚOCP.GeomAdaptorr@   ÚOCP.GeomFillrA   rB   rC   ÚOCP.HLRAlgorD   ÚOCP.HLRBReprE   rF   ÚOCP.ShapeAnalysisrG   ÚOCP.ShapeFixrH   rI   ÚOCP.StandardrJ   rK   ÚOCP.TColStdrL   rM   rN   Ú
OCP.TColgprO   rP   rQ   rR   rS   Ú
OCP.TopExprT   rU   Ú
OCP.TopLocrV   ÚOCP.TopToolsrW   rX   rY   Ú
OCP.TopoDSrZ   r[   r\   r]   r^   r_   r`   ÚOCP.gpra   rb   rc   rd   re   rf   rg   rh   ri   rj   rk   Úbuild123d.build_enumsrl   rm   rn   ro   rp   rq   rr   rs   Úbuild123d.geometryrt   ru   rv   rw   rx   ry   rz   r{   r|   Ú
shape_corer~   r   r€   r�   r‚   rƒ   r„   r…   r†   Úutilsr‡   rˆ   r‰   rŠ   Úzero_dr‹   rŒ   Útwo_dr�   rŽ   Úthree_dr�   Ú	compositer�   r‘   r’   r“   r•   rÆ   rÈ   rá  rª   rñ  r©   r—   rœ   rš   Ú<module>r-     sé  ðñ1õf #ã Û Û Ý $Ý "ß =× =Ñ =ß 3Ñ 3Ý "Ý Ý #Ý $å Ý ß D÷ñ ÷
÷ ñ õ 7Ý 8ß 3ß 4Ý 0Ý 6Ý 5Ý ,Ý #ß :Ý +Ý "÷÷ ñ ÷ FÑ EÝ 3÷ó õ )Ý -÷ñ õ
 *ß 8Ý 6ß ;ß @÷ñ ÷
 SÑ Rß ;ß .Ý &÷ñ ÷
÷ ñ ÷÷ ÷ ñ ÷	÷ 	ó 	÷
÷ 
õ 
÷
÷ 
õ 
÷ó ÷ 7ñ ß"Ýß8Ó8ôy2ˆeô y2ôx~ˆ7�E˜+Ñ&ô ~ôBv#ˆ7�E˜+Ñ&ô v#ôró6ð (,ð7Ø
ð7Ø$ð7àó7ð8 (,ðØ
ðØ$ðàôrœ   