Ë
    Jÿi�‡  ã                  óv  — d Z ddlmZ ddlZddlmZmZmZm	Z	m
Z
 ddlmZ ddlmZ ddlmZ ddlmZmZmZ dd	lmZmZmZmZmZ dd
lmZ ddlmZmZm Z m!Z!m"Z" ddl#m$Z$m%Z%m&Z&m'Z' d4d„Z( G d„ de&«      Z) G d„ de$«      Z* G d„ de*«      Z+ G d„ de*«      Z, G d„ de*«      Z- G d„ de*«      Z. G d„ de*«      Z/ G d„ de*«      Z0 G d„ de)«      Z1 G d „ d!e*«      Z2 G d"„ d#e*«      Z3 G d$„ d%e*«      Z4 G d&„ d'e*«      Z5 G d(„ d)e)«      Z6 G d*„ d+e*«      Z7 G d,„ d-e*«      Z8 G d.„ d/e*«      Z9 G d0„ d1e*«      Z: G d2„ d3e*«      Z;y)5aï  
Curve Objects

name: objects_curve.py
by:   Gumyr
date: March 22nd 2023

desc:
    This python module contains objects (classes) that create 1D Curves.

license:

    Copyright 2023 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)ÚcopysignÚcosÚradiansÚsinÚsqrt)Úminimize)ÚUnion)ÚIterable)ÚWorkplaneListÚflatten_sequenceÚvalidate_inputs)ÚAngularDirectionÚGeomTypeÚKeepÚ
LengthModeÚMode)Ú	BuildLine)ÚAxisÚPlaneÚVectorÚ
VectorLikeÚ	TOLERANCE)ÚEdgeÚFaceÚWireÚCurvec                ó  — t        j                  d¬«      }|�gt        |t         «      rVt        | t        «      r! |j                  | j                  «       d|iŽ yt        | t        «      r|j	                  | |¬«       yyyy)zÀHelper function to add a curve to the context.

    Args:
        curve (Union[Wire, Edge]): curve to add to the context (either a Wire or an Edge).
        mode (Mode): combination mode.
    F)ÚlogNÚmode©r    )r   Ú_get_contextÚ
isinstancer   Ú_add_to_contextÚedgesr   )Úcurver    Úcontexts      úh/workspace/moltex-experiments/.pixi/envs/default/lib/python3.12/site-packages/build123d/objects_curve.pyÚ_add_curve_to_contextr)   -   sr   € ô !*× 6Ñ 6¸5Ô A€GàÐœz¨'´9Ô=Ü�eœTÔ"Ø#ˆG×#Ñ# U§[¡[£]Ð>¸Ó>Ü˜œtÔ$Ø×#Ñ# E°Ð#Õ5ð %ð  >Ðó    c                  óV   ‡ — e Zd ZdZej
                  gZej                  fdˆ fd„Z	ˆ xZ
S )ÚBaseLineObjectz¡BaseLineObject specialized for Wire.

    Args:
        curve (Wire): wire to create.
        mode (Mode, optional): combination mode. Defaults to Mode.ADD.
    c                óP   •— t        ||«       t        ‰| �	  |j                  «       y ©N©r)   ÚsuperÚ__init__Úwrapped©Úselfr&   r    Ú	__class__s      €r(   r1   zBaseLineObject.__init__G   ó   ø€ ä˜e TÔ*Ü‰Ñ˜Ÿ™Õ'r*   )r&   r   r    r   ©Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   Ú_tagÚ_applies_tor   ÚADDr1   Ú__classcell__©r5   s   @r(   r,   r,   =   ó'   ø„ ñð —>‘>Ð"€Kà15·±÷ (ò (r*   r,   c                  óV   ‡ — e Zd ZdZej
                  gZej                  fdˆ fd„Z	ˆ xZ
S )ÚBaseEdgeObjectz¡BaseEdgeObject specialized for Edge.

    Args:
        curve (Edge): edge to create.
        mode (Mode, optional): combination mode. Defaults to Mode.ADD.
    c                óP   •— t        ||«       t        ‰| �	  |j                  «       y r.   r/   r3   s      €r(   r1   zBaseEdgeObject.__init__W   r6   r*   )r&   r   r    r   r7   r@   s   @r(   rC   rC   M   rA   r*   rC   c                  ód   ‡ — e Zd ZdZej
                  gZdej                  dœ	 	 	 	 	 dˆ fd„Z	ˆ xZ
S )ÚBezieraþ  Line Object: Bezier Curve

    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.
        mode (Mode, optional): combination mode. Defaults to Mode.ADD.
    N)Úweightsr    c               óÈ   •— t        j                  | «      }t        || «       t        |Ž }t	        j
                  |Ž }t        j                  |d|iŽ}t        ‰| �%  ||¬«       y )NrG   r!   )
r   r"   r   r   r   Úlocalizer   Úmake_bezierr0   r1   )	r4   rG   r    Ú	cntl_pntsr'   Úcntl_pnt_listÚpollsr&   r5   s	           €r(   r1   zBezier.__init__l   s`   ø€ ô %.×$:Ñ$:¸4Ó$@ˆÜ˜ Ô&ä(¨)Ð4ˆÜ×&Ñ&¨Ð6ˆÜ× Ñ  %Ð9°Ñ9ˆä‰Ñ˜ TÐÕ*r*   )rK   r   rG   zlist[float] | Noner    r   r7   r@   s   @r(   rF   rF   ]   sH   ø„ ñ
ð —>‘>Ð"€Kð
 '+Ø—X‘Xñ	+àð+ð $ð+ð ÷	+ñ +r*   rF   c                  óh   ‡ — e Zd ZdZej
                  gZej                  f	 	 	 	 	 	 	 	 	 dˆ fd„Z	ˆ xZ
S )Ú	CenterArca5  Line Object: Center Arc

    Add center arc to the line.

    Args:
        center (VectorLike): center point of arc
        radius (float): arc radius
        start_angle (float): arc staring angle
        arc_size (float): arc size
        mode (Mode, optional): combination mode. Defaults to Mode.ADD.
    c                óÚ  •— t        j                  | «      }t        || «       t        j                  |«      }|€t
        j                  }n4t        j                  t        j                  «       j                  d   «      }||_
        |dkD  rt        j                  nt        j                  }	|dz   dz  }||z   }
|dk(  r|
n|}t        j                  ||||
|	¬«      }t         ‰| �E  ||¬«       y )Nr   g     €v@)Ústart_angleÚ	end_angleÚangular_directionr!   )r   r"   r   r   rI   r   ÚXYÚcopy_moduleÚcopyÚ
workplanesÚoriginr   ÚCOUNTER_CLOCKWISEÚ	CLOCKWISEr   Úmake_circler0   r1   )r4   ÚcenterÚradiusrQ   Úarc_sizer    r'   Úcenter_pointÚcircle_workplaneÚarc_directionrR   Úarcr5   s               €r(   r1   zCenterArc.__init__‹   sï   ø€ ô %.×$:Ñ$:¸4Ó$@ˆÜ˜ Ô&ä$×-Ñ-¨fÓ5ˆØˆ?Ü$Ÿx™xÑä*×/Ñ/Ü×*Ñ*Ó,×7Ñ7¸Ñ:ó Ðð #/ÐÔð ˜!Š|ô ×.Ò.ä!×+Ñ+ð 	ð
 ˜uÑ$¨Ñ-ˆØ (Ñ*ˆ	Ø#+¨uÒ#4‘i¸+ˆÜ×ÑØØØ#ØØ+ô
ˆô 	‰Ñ˜ 4ÐÕ(r*   )
r\   r   r]   ÚfloatrQ   rc   r^   rc   r    r   r7   r@   s   @r(   rO   rO   |   sY   ø„ ñ
ð —>‘>Ð"€Kð —X‘Xð#)àð#)ð ð#)ð ð	#)ð
 ð#)ð ÷#)ñ #)r*   rO   c                  ó~   ‡ — e Zd ZdZej
                  gZej                  e	j                  f	 	 	 	 	 	 	 	 	 dˆ fd„Zˆ xZS )ÚDoubleTangentArcaÝ  Line Object: Double Tangent Arc

    Create an arc defined by a point/tangent pair and another line which the other end
    is tangent to.

    Contains a solver.

    Args:
        pnt (VectorLike): starting point of tangent arc
        tangent (VectorLike): tangent at starting point of tangent arc
        other (Union[Curve, Edge, Wire]): reference line
        keep (Keep, optional): selector for which arc to keep when two arcs are
            possible. The arc generated with TOP or BOTTOM depends on the geometry
            and isn't necessarily easy to predict. Defaults to Keep.TOP.
        mode (Mode, optional): combination mode. Defaults to Mode.ADD.

    Raises:
        RunTimeError: no double tangent arcs found
    c           	     ó‚  •‡‡— t        j                  | «      }t        || «       t        j                  |«      Št        j                  |«      j                  «       }t        j                  «       �"t        j                  «       j                  d   }nD t        j                  ‰‰|z   «      j                  ‰j                  «       Ž }|€t        d«      ‚| }t        d|j                  «      }	d‰j                  «       j                  ‰«      j                   z  }
ˆˆfd„}g }dD ]ç  }|j#                  |	|«      }t%        |d|dd|
fgt&        ¬	«      }|j(                  d   }‰||z  z   }t        j*                  |t-        ||	j.                  ¬
«      «      }‰j1                  |«      \  }}}|t&        kD  rŒŽt        |‰j3                  |«      «      }t        ||j3                  |«      «      }|j5                  |d«      sŒ×|j7                  |«       Œé t9        |«      dk(  rt;        d«      ‚|t<        j>                  k(  r|dd }n|t<        j@                  k(  r|dd  }t        «       5 }|D ]%  }‰j1                  |«      \  }}}tC        ‰||¬«       Œ' 	 d d d «       tD        ‰| ��  jI                  «       |¬«       y # 1 sw Y   Œ)xY w)Nr   z-DoubleTangentArc only works on a single plane©r   r   r   é
   c                óX   •— ‰|| d   z  z   }‰j                  |«      }t        || z
  «      S )Nr   )Údistance_toÚabs)r]   Úperpendicular_bisectorr\   Ú
separationÚarc_ptÚothers       €€r(   Úfuncz'DoubleTangentArc.__init__.<locals>.funcã   s7   ø€ ØÐ4°v¸a±yÑ@Ñ@ˆFØ×*Ñ*¨6Ó2ˆJÜ�z FÑ*Ó+Ð+r*   )éZ   é¦ÿÿÿç        zNelder-Mead)Úx0ÚargsÚmethodÚboundsÚtol)Úz_dirgš™™™™™©?zNo double tangent arcs foundé   éÿÿÿÿ)Útangentr!   )%r   r"   r   r   rI   Ú
normalizedrW   r   Ú	make_lineÚcommon_planer%   Ú
ValueErrorr   ry   Úbounding_boxÚaddÚdiagonalÚrotater	   r   Úxr[   r   Ú	directionÚdistance_to_with_closest_pointsÚ
tangent_atÚis_parallelÚappendÚlenÚRuntimeErrorr   ÚTOPÚBOTTOMÚ
TangentArcr0   r1   Úwire)r4   Úpntr|   ro   Úkeepr    r'   Úarc_tangentÚ	workplaneÚrotation_axisÚmax_sizerp   Úarc_centersÚanglerl   ÚresultÚ
arc_radiusÚ
arc_centerÚcircleÚdistÚp1Úp2Ú
other_axisÚcircle_axisÚdoubler\   Ú_rn   r5   s      `                       @€r(   r1   zDoubleTangentArc.__init__È   s�  ú€ ô %.×$:Ñ$:¸4Ó$@ˆÜ˜ Ô&ä×'Ñ'¨Ó,ˆÜ#×,Ñ,¨WÓ5×@Ñ@ÓBˆÜ×%Ñ%Ó'Ð3Ü%×2Ñ2Ó4×?Ñ?ÀÑB‰IàQœŸ™ v¨v¸Ñ/CÓD×QÑQØ—‘“ðˆIð Ð Ü Ð!PÓQÐQØ"˜
ˆIÜ˜Y¨	¯©Ó8ˆà˜×*Ñ*Ó,×0Ñ0°Ó8×AÑAÑAˆõ	,ð ˆÛˆEØ%0×%7Ñ%7¸ÀuÓ%MÐ"ÜØØØ+Ø$Ø˜h˜Ð(ÜôˆFð  Ÿ™ !™ˆJØÐ"8¸:Ñ"EÑEˆJô ×%Ñ%ØœE *°M×4KÑ4KÔLóˆFð !×@Ñ@ÀÓH‰LˆD�"�bØ”iÒØÜ˜b %×"2Ñ"2°2Ó"6Ó7ˆJÜ˜r 6×#4Ñ#4°RÓ#8Ó9ˆKØ×%Ñ% k°4Õ8Ø×"Ñ" :Õ.ð/ ô2 ˆ{Ó˜qÒ ÜÐ=Ó>Ð>ð ”4—8‘8ÒØ% a¨Ð*‰KØ”T—[‘[Ò Ø% b cÐ*ˆKäŒ[˜FÛ%�Ø ×@Ñ@ÀÓH‘��2�qÜ˜6 2¨{Ö;ñ &÷ ô
 	‰Ñ˜Ÿ™›¨TÐÕ2÷ ˆ[ús   É!+J5Ê5J>)
r‘   r   r|   r   ro   úCurve | Edge | Wirer’   r   r    r   )r8   r9   r:   r;   r   r<   r=   r   r�   r   r>   r1   r?   r@   s   @r(   re   re   ±   sg   ø„ ñð( —>‘>Ð"€Kð —X‘XØ—X‘XðI3àðI3ð ðI3ð #ð	I3ð
 ðI3ð ÷I3ñ I3r*   re   c                  óˆ   — e Zd ZdZej
                  gZdddej                  e	j                  f	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 dd„Zy)ÚEllipticalStartArca\  Line Object: Elliptical Start Arc

    Makes an arc of an ellipse from the start point.

    Args:
        start (VectorLike): initial point of arc
        end (VectorLike): final point of arc
        x_radius (float): semi-major radius
        y_radius (float): semi-minor radius
        rotation (float, optional): the angle from the x-axis of the plane to the x-axis
            of the ellipse. Defaults to 0.0.
        large_arc (bool, optional): True if the arc spans greater than 180 degrees.
            Defaults to True.
        sweep_flag (bool, optional): False if the line joining center to arc sweeps through
            decreasing angles, or True if it sweeps through increasing angles. Defaults to True.
        plane (Plane, optional): base plane. Defaults to Plane.XY.
        mode (Mode, optional): combination mode. Defaults to Mode.ADD.
    rs   FTc
                ó   — t        d«      ‚)NzImplementation incomplete)rŒ   )
r4   ÚstartÚendÚx_radiusÚy_radiusÚrotationÚ	large_arcÚ
sweep_flagÚplaner    s
             r(   r1   zEllipticalStartArc.__init__*  s   € ô Ð6Ó7Ð7r*   N)r¨   r   r©   r   rª   rc   r«   rc   r¬   rc   r­   Úboolr®   r°   r¯   r   r    r   )r8   r9   r:   r;   r   r<   r=   r   rT   r   r>   r1   © r*   r(   r¦   r¦     s‹   „ ñð& —>‘>Ð"€Kð ØØØ—x‘xØ—X‘Xð8àð8ð ð8ð ð	8ð
 ð8ð ð8ð ð8ð ð8ð ð8ð ô8r*   r¦   c                  ó�   ‡ — e Zd ZdZej
                  gZdddej                  e	j                  f	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 dˆ fd„Zˆ xZS )ÚEllipticalCenterArcaö  Line Object: Elliptical Center Arc

    Makes an arc of an ellipse from a center point.

    Args:
        center (VectorLike): ellipse center
        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)
        start_angle (float, optional): Defaults to 0.0.
        end_angle (float, optional): Defaults to 90.0.
        rotation (float, optional): amount to rotate arc. Defaults to 0.0.
        angular_direction (AngularDirection, optional): arc direction.
            Defaults to AngularDirection.COUNTER_CLOCKWISE.
        plane (Plane, optional): base plane. Defaults to Plane.XY.
        mode (Mode, optional): combination mode. Defaults to Mode.ADD.
    rs   g     €V@c	                óÞ  •— t        j                  | «      }	t        |	| «       t        j                  |«      }
|	€t
        j                  }n4t        j                  t        j                  «       j                  d   «      }|
|_
        t        j                  ||||||¬«      j                  t        |j                  |j                  j!                  «       «      |«      }t"        ‰| �I  ||¬«       y )Nr   )rª   r«   r¯   rQ   rR   rS   r!   )r   r"   r   r   rI   r   rT   rU   rV   rW   rX   r   Úmake_ellipser„   r   ry   Úto_dirr0   r1   )r4   r\   rª   r«   rQ   rR   r¬   rS   r    r'   Ú
center_pntÚellipse_workplaner&   r5   s                €r(   r1   zEllipticalCenterArc.__init__’  sÙ   ø€ ô %.×$:Ñ$:¸4Ó$@ˆÜ˜ Ô&ä"×+Ñ+¨FÓ3ˆ
Øˆ?Ü %§¡Ñä +× 0Ñ 0Ü×*Ñ*Ó,×7Ñ7¸Ñ:ó!Ðð $.ÐÔ Ü×!Ñ!ØØØ#Ø#ØØ/ô
÷ ‰&ÜÐ"×)Ñ)Ð+<×+BÑ+B×+IÑ+IÓ+KÓLÈhó
ð 	ô 	‰Ñ˜ TÐÕ*r*   )r\   r   rª   rc   r«   rc   rQ   rc   rR   rc   r¬   rc   rS   r   r    r   )r8   r9   r:   r;   r   r<   r=   r   rY   r   r>   r1   r?   r@   s   @r(   r³   r³   ~  s‰   ø„ ñð" —>‘>Ð"€Kð !ØØØ.>×.PÑ.PØ—X‘Xð!+àð!+ð ð!+ð ð	!+ð
 ð!+ð ð!+ð ð!+ð ,ð!+ð ÷!+ñ !+r*   r³   c                  ó|   ‡ — e Zd ZdZej
                  gZddddej                  f	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 dˆ fd„Z	ˆ xZ
S )ÚHelixa=  Line Object: Helix

    Add a helix to the line.

    Args:
        pitch (float): distance between successive loops
        height (float): helix size
        radius (float): helix radius
        center (VectorLike, optional): center point. Defaults to (0, 0, 0).
        direction (VectorLike, optional): direction of central axis. Defaults to (0, 0, 1).
        cone_angle (float, optional): conical angle. Defaults to 0.
        lefthand (bool, optional): left handed helix. Defaults to False.
        mode (Mode, optional): combination mode. Defaults to Mode.ADD.
    rg   )r   r   rz   r   Fc	           	     óÊ   •— t        j                  | «      }	t        |	| «       t        j                  |«      }
t        j                  ||||
|||«      }t        ‰| �!  ||¬«       y )Nr!   )	r   r"   r   r   rI   r   Ú
make_helixr0   r1   )r4   ÚpitchÚheightr]   r\   r†   Ú
cone_angleÚlefthandr    r'   r·   Úhelixr5   s               €r(   r1   zHelix.__init__È  s`   ø€ ô %.×$:Ñ$:¸4Ó$@ˆÜ˜ Ô&ä"×+Ñ+¨FÓ3ˆ
Ü—‘Ø�6˜6 :¨y¸*Àhó
ˆô 	‰Ñ˜ TÐÕ*r*   )r½   rc   r¾   rc   r]   rc   r\   r   r†   r   r¿   rc   rÀ   r°   r    r   r7   r@   s   @r(   rº   rº   ¶  sƒ   ø„ ñð —>‘>Ð"€Kð 'Ø )ØØØ—X‘Xð+àð+ð ð+ð ð	+ð
 ð+ð ð+ð ð+ð ð+ð ÷+ñ +r*   rº   c                  óh   ‡ — e Zd ZdZej
                  gZdej                  dœ	 	 	 	 	 	 	 dˆ fd„Z	ˆ xZ
S )ÚFilletPolylinea*  Line Object: FilletPolyline

    Add a sequence of straight lines defined by successive points that
    are filleted to a given radius.

    Args:
        pts (Union[VectorLike, Iterable[VectorLike]]): sequence of two or more points
        radius (float): radius of filleted corners
        close (bool, optional): close by generating an extra Edge. Defaults to False.
        mode (Mode, optional): combination mode. Defaults to Mode.ADD.

    Raises:
        ValueError: Two or more points not provided
        ValueError: radius must be positive
    F©Úcloser    c               ój  •— t        j                  | «      }t        || «       t        |Ž }t	        |«      dk  rt        d«      ‚|dk  rt        d«      ‚t        j                  |Ž }t        t	        |«      dz
  «      D �cg c]!  }t        j                  ||   ||dz      «      ‘Œ# }	}|rO|	d   dz  |	d   dz  z
  j                  dkD  r1|	j                  t        j                  |	d   dz  |	d   dz  «      «       t        |	«      }
g }|D ]m  }|
j                  «       D �ci c]!  }|t        |«      t        |Ž z
  j                  “Œ# }}|j                  t!        |j#                  «       d„ ¬	«      d   d   «       Œo |D ��ci c]4  }||
j%                  «       D �cg c]  }||j                  «       v sŒ|‘Œ c}“Œ6 }}}g }|j#                  «       D ]Ö  \  }}t	        |«      dk7  rŒ|D ��ch c]  }|j                  «       D ]
  }||k7  sŒ	|’Œ Œ! }}}t        j                  |D �cg c]  }|j'                  «       ‘Œ c}Ž }t)        t        ||gz   «      «      j+                  ||g«      }|j                  |j%                  «       j-                  t.        j0                  «      d   «       ŒØ |rGt        t	        |«      «      D �cg c]'  }t        j                  ||dz
     dz  ||   dz  «      ‘Œ) }}g }n{t3        |dd  «      D ��cg c]$  \  }}t        j                  ||   dz  |dz  «      ‘Œ& }}}t        j                  |
dz  |d   dz  «      t        j                  |d   dz  |
dz  «      g}t        ||z   |z   «      }t4        ‰| �m  ||¬
«       y c c}w c c}w c c}w c c}}w c c}}w c c}w c c}w c c}}w )Né   z'FilletPolyline requires two or more ptsr   zradius must be positiverz   r{   çñhãˆµøä>c                ó   — | d   S )Nrz   r±   )r…   s    r(   Ú<lambda>z)FilletPolyline.__init__.<locals>.<lambda>  s   € È1ÈQÊ4r*   )Úkeyr!   )r   r"   r   r   r‹   r€   r   rI   Úranger   r~   ÚlengthrŠ   r   Úverticesr   ÚsortedÚitemsr%   Úto_tupler   Ú	fillet_2dÚ	filter_byr   ÚCIRCLEÚ	enumerater0   r1   )r4   r]   rÅ   r    Úptsr'   ÚpointsÚ	lines_ptsÚiÚ	new_edgesÚwire_of_linesÚordered_verticesÚpntsÚvÚdistanceÚeÚvertex_to_edgesÚfilletsÚvertexr%   ÚveÚother_verticesÚ
third_edgeÚfillet_faceÚinterior_edgesÚ	end_edgesÚfÚnew_wirer5   s                               €r(   r1   zFilletPolyline.__init__ð  sÆ  ø€ ô %.×$:Ñ$:¸4Ó$@ˆÜ˜ Ô&ä! 3Ð'ˆäˆv‹;˜Š?ÜÐFÓGÐGØ�QŠ;ÜÐ6Ó7Ð7ä!×*Ñ*¨FÐ3ˆ	ô
 œ3˜y›>¨AÑ-Ô.ó
á.�ô �N‰N˜9 Q™<¨°1°q±5Ñ)9Õ:Ø.ð 	ð 
ñ �i ‘l QÑ&¨°2©¸Ñ):Ñ:×BÑBÀTÒIØ×ÑœTŸ^™^¨I°b©M¸AÑ,=¸yÈ¹|ÈaÑ?OÓPÔQÜ˜Y›ˆð ÐÛˆDà?L×?UÑ?UÔ?WóÙ?W¸!�”F˜4“L¤6¨1 :Ñ-×5Ñ5Ñ5Ð?Wð ð ð ×#Ñ#¤F¨8¯>©>Ó+;ÁÔ$PÐQRÑ$SÐTUÑ$VÕWð	 ñ &ô
á%�ð ˜=×.Ñ.Ô0ÓFÑ0�a°A¸¿¹»Ò4E’Ð0ÑFÑFØ%ð 	ñ 
ð ˆØ,×2Ñ2Ö4‰MˆF�EÜ�5‹z˜QŠØÙ*/ÔW©% Q¸!¿*¹*¾,°BÈ"ÐPVË,šb¸,˜b¨%ˆNÑWÜŸ™ÁÓ)OÁ¸1¨!¯*©*­,ÀÑ)OÐPˆJÜœt E¨Z¨LÑ$8Ó9Ó:×DÑDÀVÈfÈXÓVˆKØ�N‰N˜;×,Ñ,Ó.×8Ñ8¼¿¹ÓIÈ!ÑLÕMð 5ñ ô œs 7›|Ô,óá,�Aô —‘˜w q¨1¡u™~°Ñ1°7¸1±:À±>ÕBØ,ð ð ð ‰Iô CLÈGÐTUÐTVÈKÔBXôÙBX¹$¸!¸Q”—‘˜w q™z¨A™~¨q°1©uÕ5ÐBXð ñ ô —‘˜}¨qÑ0°'¸!±*¸q±.ÓAÜ—‘˜w r™{¨Q™°ÀÑ0AÓBðˆIô
 ˜	 NÑ2°WÑ<Ó=ˆä‰Ñ˜¨ÐÕ-ùòk
ùòùò Gùó
ùó XùÚ)OùòùósH   Á?&N
Ä&NÅ<NÆNÆ,NÆ0NÇ$NÈNÈN%
Ê;,N*Ë=)N/ÎN)rÖ   ú!VectorLike | Iterable[VectorLike]r]   rc   rÅ   r°   r    r   r7   r@   s   @r(   rÃ   rÃ   Ý  sX   ø„ ñð  —>‘>Ð"€Kð Ø—X‘XñI.à/ðI.ð ðI.ð ð	I.ð
 ÷I.ñ I.r*   rÃ   c                  óh   ‡ — e Zd ZdZej
                  gZej                  f	 	 	 	 	 	 	 	 	 dˆ fd„Z	ˆ xZ
S )ÚJernArcaô  JernArc

    Circular tangent arc with given radius and arc_size

    Args:
        start (VectorLike): start point
        tangent (VectorLike): tangent at start point
        radius (float): arc radius
        arc_size (float): arc size in degrees (negative to change direction)
        mode (Mode, optional): combination mode. Defaults to Mode.ADD.

    Attributes:
        start (Vector): start point
        end_of_arc (Vector): end point of arc
        center_point (Vector): center of arc
    c                óº  •— t        j                  | «      }t        || «       t        j                  |«      }|| _        |€t        j                  }n4t        j                  t        j                  «       j                  d   «      }||_        t        |«      j                  |j                  d¬«      }t        d|«      }	||j!                  t#        ||j$                  «      |	dz  «      t'        |«      z  z   | _        | j(                  || j(                  z
  j!                  t#        ||j$                  «      |«      z   | _        t'        |«      dk\  r[t        j                  |«      }
| j(                  |
_        | j
                  |
j                  z
  |
_        t/        j0                  ||
«      }n!t/        j2                  ||| j*                  «      }t4        ‰| �m  ||¬«       y )Nr   T)Úis_directionç      ð?rq   ih  r!   )r   r"   r   r   rI   r¨   r   rT   rU   rV   rW   rX   r   Ú	transformÚreverse_transformr   r„   r   ry   rk   r_   Ú
end_of_arcÚx_dirr   r[   Úmake_tangent_arcr0   r1   )r4   r¨   r|   r]   r^   r    r'   Újern_workplaneÚstart_tangentra   Úcircle_planerb   r5   s               €r(   r1   zJernArc.__init__P  s¡  ø€ ô %.×$:Ñ$:¸4Ó$@ˆÜ˜ Ô&ä×&Ñ& uÓ-ˆØˆŒ
Øˆ?Ü"ŸX™X‰Nä(×-Ñ-Ü×*Ñ*Ó,×7Ñ7¸Ñ:óˆNð !&ˆÔÜ˜w›×1Ñ1Ø×,Ñ,¸4ð 2ó 
ˆô !  hÓ/ˆØ! M×$8Ñ$8Ü�˜×,Ñ,Ó-¨}¸rÑ/Aó%
ä�‹Kñ%ñ ˆÔð ×+Ñ+¨u°t×7HÑ7HÑ/H×.PÑ.PÜ�˜×,Ñ,Ó-¨xó/
ñ 
ˆŒô ˆx‹=˜CÒÜ&×+Ñ+¨NÓ;ˆLØ"&×"3Ñ"3ˆLÔØ!%§¡¨l×.AÑ.AÑ!AˆLÔÜ×"Ñ" 6¨<Ó8‰Cä×'Ñ'¨¨}¸d¿o¹oÓNˆCä‰Ñ˜ 4ÐÕ(r*   )
r¨   r   r|   r   r]   rc   r^   rc   r    r   r7   r@   s   @r(   rî   rî   <  sY   ø„ ñð" —>‘>Ð"€Kð —X‘Xð')àð')ð ð')ð ð	')ð
 ð')ð ÷')ñ ')r*   rî   c                  óX   ‡ — e Zd ZdZej
                  gZej                  dœdˆ fd„Z	ˆ xZ
S )ÚLinea"  Line Object: Line

    Add a straight line defined by two end points.

    Args:
        pts (Union[VectorLike, Iterable[VectorLike]]): sequence of two points
        mode (Mode, optional): combination mode. Defaults to Mode.ADD.

    Raises:
        ValueError: Two point not provided
    r!   c               óB  •— t        |Ž }t        |«      dk7  rt        d«      ‚t        j                  | «      }t        || «       t        j                  |Ž }|D �cg c]  }t        |«      ‘Œ }}t        j                  |d   |d   «      }t        ‰	| �1  ||¬«       y c c}w )NrÇ   zLine requires two ptsr   rz   r!   )r   r‹   r€   r   r"   r   r   rI   r   r   r~   r0   r1   )
r4   r    rÖ   r×   r'   Úpoints_localizedÚprØ   Únew_edger5   s
            €r(   r1   zLine.__init__‰  s™   ø€ Ü! 3Ð'ˆÜˆv‹;˜!ÒÜÐ4Ó5Ð5ä$-×$:Ñ$:¸4Ó$@ˆÜ˜ Ô&ä(×1Ñ1°6Ð:Ðá(8Ó9Ñ(8 1”V˜A•YÐ(8ˆ	Ð9ä—>‘> )¨A¡,°	¸!±Ó=ˆÜ‰Ñ˜¨ÐÕ-ùò :s   ÁB©rÖ   rì   r    r   r7   r@   s   @r(   rû   rû   z  s'   ø„ ñ
ð —>‘>Ð"€KàMQÏXÉX÷ .ó .r*   rû   c                  ód   ‡ — e Zd ZdZej
                  gZej                  f	 	 	 	 	 	 	 dˆ fd„Z	ˆ xZ
S )ÚIntersectingLineac  Intersecting Line Object: Line

    Add a straight line that intersects another line at a given parameter and angle.

    Args:
        start (VectorLike): start point
        direction (VectorLike): direction to make line
        other (Edge): stop at the intersection of other
        mode (Mode, optional): combination mode. Defaults to Mode.ADD.

    c                ó  •— t        j                  | «      }t        || «       t        j                  |«      }t        j                  |«      j                  «       }t        ||«      }|j                  «       D ��cg c]  }|j                  |«      D ]  }|‘Œ Œ }	}}|	st        d«      ‚|	D �
cg c]  }
||
z
  j                  ‘Œ }}
t        |«      }t        j                  ||||z  z   «      }t        ‰| �=  ||¬«       y c c}}w c c}
w )NzNo intersections foundr!   )r   r"   r   r   rI   r}   r   r%   Úfind_intersection_pointsr€   rÍ   Úminr   r~   r0   r1   )r4   r¨   r†   ro   r    r'   ÚaxisÚedgerÙ   Úintersection_pntsrþ   Ú	distancesrÍ   rÿ   r5   s                 €r(   r1   zIntersectingLine.__init__¨  sý   ø€ ô %.×$:Ñ$:¸4Ó$@ˆÜ˜ Ô&ä×&Ñ& uÓ-ˆÜ!×*Ñ*¨9Ó5×@Ñ@ÓBˆ	Ü�E˜9Ó%ˆð  Ÿ+™+œ-ô
Ù'�$°×1NÑ1NÈtÖ1T¨AŠAÐ1TˆA˜-ð 	ñ 
ñ !ÜÐ5Ó6Ð6á1BÓCÑ1B¨A�e˜a‘i×'Ó'Ð1Bˆ	ÐCÜ�Y“ˆÜ—>‘> %¨°¸VÑ1CÑ)CÓDˆÜ‰Ñ˜¨ÐÕ-ùó
ùò Ds   Á:C>Â-D)r¨   r   r†   r   ro   r¤   r    r   r7   r@   s   @r(   r  r  ™  sO   ø„ ñ
ð —>‘>Ð"€Kð —X‘Xð.àð.ð ð.ð #ð	.ð
 ÷.ñ .r*   r  c                  ó†   ‡ — e Zd ZdZej
                  gZddej                  e	j                  f	 	 	 	 	 	 	 	 	 	 	 dˆ fd„Zˆ xZS )Ú	PolarLinea  Line Object: Polar Line

    Add line defined by a start point, length and angle.

    Args:
        start (VectorLike): start point
        length (float): line length
        angle (float): angle from the local "X" axis.
        length_mode (LengthMode, optional): length value specifies a diagonal, horizontal
            or vertical value. Defaults to LengthMode.DIAGONAL
        mode (Mode, optional): combination mode. Defaults to Mode.ADD.

    Raises:
        ValueError: Either angle or direction must be provided
    Nc                ó   •— t        j                  | «      }t        || «       t        j                  |«      }|€t
        j                  }n4t        j                  t        j                  «       j                  d   «      }|�2t        j                  |«      }	t        ddd«      j                  |	«      }n>|�1|j                  j                  t        d|j                  «      |«      }	nt!        d«      ‚|t"        j$                  k(  r|	|z  }
n[|t"        j&                  k(  r|	|t)        t+        |«      «      z  z  }
n-|t"        j,                  k(  r|	|t/        t+        |«      «      z  z  }
t1        j2                  ||
z   «      }t4        ‰| �m  ||¬«       y )Nr   rz   rg   z*Either angle or direction must be providedr!   )r   r"   r   r   rI   r   rT   rU   rV   rW   r   Ú	get_anglerõ   r„   r   ry   r€   r   ÚDIAGONALÚ
HORIZONTALr   r   ÚVERTICALr   r   r~   r0   r1   )r4   r¨   rÍ   r˜   r†   Úlength_moder    r'   Úpolar_workplaneÚdirection_localizedÚlength_vectorrÿ   r5   s               €r(   r1   zPolarLine.__init__Õ  s_  ø€ ô %.×$:Ñ$:¸4Ó$@ˆÜ˜ Ô&ä×&Ñ& uÓ-ˆØˆ?Ü#Ÿh™h‰Oä)×.Ñ.Ü×*Ñ*Ó,×7Ñ7¸Ñ:óˆOð Ð Ü"/×"8Ñ"8¸Ó"CÐÜ˜1˜a “O×-Ñ-Ð.AÓB‰EØÐØ"1×"7Ñ"7×">Ñ">Ü�Y × 5Ñ 5Ó6Øó#Ñô
 ÐIÓJÐJàœ*×-Ñ-Ò-Ø/°&Ñ8‰MØœJ×1Ñ1Ò1Ø/°6¼CÄÈÃÓ<OÑ3OÑP‰MØœJ×/Ñ/Ò/Ø/°6¼CÄÈÃÓ<OÑ3OÑPˆMä—>‘> %¨°Ñ)>Ó?ˆä‰Ñ˜¨ÐÕ-r*   )r¨   r   rÍ   rc   r˜   zfloat | Noner†   zVectorLike | Noner  r   r    r   )r8   r9   r:   r;   r   r<   r=   r   r  r   r>   r1   r?   r@   s   @r(   r  r  Â  sr   ø„ ñð  —>‘>Ð"€Kð #Ø'+Ø",×"5Ñ"5Ø—X‘Xð(.àð(.ð ð(.ð ð	(.ð
 %ð(.ð  ð(.ð ÷(.ñ (.r*   r  c                  ód   ‡ — e Zd ZdZej
                  gZdej                  dœ	 	 	 	 	 dˆ fd„Z	ˆ xZ
S )ÚPolylinea¢  Line Object: Polyline

    Add a sequence of straight lines defined by successive point pairs.

    Args:
        pts (Union[VectorLike, Iterable[VectorLike]]): sequence of two or more points
        close (bool, optional): close by generating an extra Edge. Defaults to False.
        mode (Mode, optional): combination mode. Defaults to Mode.ADD.

    Raises:
        ValueError: Two or more points not provided
    FrÄ   c          	     ó*  •— t        j                  | «      }t        || «       t        |Ž }t	        |«      dk  rt        d«      ‚t        j                  |Ž }t        t	        |«      dz
  «      D �cg c]!  }t        j                  ||   ||dz      «      ‘Œ# }}|rO|d   dz  |d   dz  z
  j                  dkD  r1|j                  t        j                  |d   dz  |d   dz  «      «       t        ‰	| �9  t        j                   |«      d   |¬«       y c c}w )NrÇ   z!Polyline requires two or more ptsrz   r   r{   rÈ   r!   )r   r"   r   r   r‹   r€   r   rI   rÌ   r   r~   rÍ   rŠ   r0   r1   r   Úcombine)
r4   rÅ   r    rÖ   r'   r×   rØ   rÙ   rÚ   r5   s
            €r(   r1   zPolyline.__init__  s  ø€ ô %.×$:Ñ$:¸4Ó$@ˆÜ˜ Ô&ä! 3Ð'ˆÜˆv‹;˜Š?ÜÐ@ÓAÐAä!×*Ñ*¨FÐ3ˆ	ô œ3˜y›>¨AÑ-Ô.ó
á.�ô �N‰N˜9 Q™<¨°1°q±5Ñ)9Õ:Ø.ð 	ð 
ñ �i ‘l QÑ&¨°2©¸Ñ):Ñ:×BÑBÀTÒIØ×ÑœTŸ^™^¨I°b©M¸AÑ,=¸yÈ¹|ÈaÑ?OÓPÔQä‰ÑœŸ™ iÓ0°Ñ3¸$ÐÕ?ùò
s   Á/&D)rÖ   rì   rÅ   r°   r    r   r7   r@   s   @r(   r  r     sM   ø„ ñð —>‘>Ð"€Kð
 Ø—X‘Xñ	@à/ð@ð ð@ð ÷	@ñ @r*   r  c                  ój   ‡ — e Zd ZdZej
                  gZdej                  f	 	 	 	 	 	 	 	 	 dˆ fd„Z	ˆ xZ
S )Ú	RadiusArcaå  Line Object: Radius Arc

    Add an arc defined by two end points and a radius

    Args:
        start_point (VectorLike): start
        end_point (VectorLike): end
        radius (float): radius
        short_sagitta (bool): If True selects the short sagitta, else the
            long sagitta crossing the center. Defaults to True.
        mode (Mode, optional): combination mode. Defaults to Mode.ADD.

    Raises:
        ValueError: Insufficient radius to connect end points
    Tc                ó  •— t        j                  | «      }t        || «       t        j                  ||«      \  }}|j                  |«      j                  dz  }		 |r!t        |«      t        |dz  |	dz  z
  «      z
  }
n!t        |«       t        |dz  |	dz  z
  «      z
  }
|dkD  rt        |||
t        j                  ¬«      }nt        |||
 t        j                  ¬«      }t        ‰| �9  ||¬«       y # t        $ r}t        d«      |‚d }~ww xY w)Ng       @rÇ   z6Arc radius is not large enough to reach the end point.r   r!   )r   r"   r   r   rI   ÚsubrÍ   rk   r   r€   Ú
SagittaArcr   ÚPRIVATEr0   r1   )r4   Ústart_pointÚ	end_pointr]   Úshort_sagittar    r'   r¨   r©   rÍ   ÚsagittaÚ	exceptionrb   r5   s                €r(   r1   zRadiusArc.__init__<  s  ø€ ô %.×$:Ñ$:¸4Ó$@ˆÜ˜ Ô&ä"×+Ñ+¨K¸ÓC‰
ˆˆsà—‘˜“×&Ñ&¨Ñ,ˆð	ÙÜ˜f›+¬¨V°Q©Y¸À¹Ñ-BÓ(CÑC‘ä˜v›;˜,¬¨f°a©i¸&À!¹)Ñ.CÓ)DÑD�ð �AŠ:Ü˜U C¨´t·|±|ÔD‰Cä˜U C¨'¨¼¿¹ÔEˆCä‰Ñ˜ 4ÐÕ(øô ò 	ÜØHóàðûð	ús   ÁAC2 Ã2	DÃ;DÄD)
r  r   r   r   r]   rc   r!  r°   r    r   r7   r@   s   @r(   r  r  )  s\   ø„ ñð  —>‘>Ð"€Kð #Ø—X‘Xð)àð)ð ð)ð ð	)ð
 ð)ð ÷)ñ )r*   r  c                  ód   ‡ — e Zd ZdZej
                  gZej                  f	 	 	 	 	 	 	 dˆ fd„Z	ˆ xZ
S )r  a*  Line Object: Sagitta Arc

    Add an arc defined by two points and the height of the arc (sagitta).

    Args:
        start_point (VectorLike): start
        end_point (VectorLike): end
        sagitta (float): arc height
        mode (Mode, optional): combination mode. Defaults to Mode.ADD.
    c                ó*  •— t        j                  | «      }t        || «       t        j                  ||«      \  }}||z   dz  }|€t
        j                  }	n4t        j                  t        j                  «       j                  d   «      }	||z
  j                  «       t        |«      z  }
|
j                  t        |	j                  |	j                  «      |dkD  rdnd«      }
||
z   }t!        |||t"        j$                  ¬«      }t&        ‰| �Q  ||¬«       y )Ng      à?r   rq   rr   r!   )r   r"   r   r   rI   r   rT   rU   rV   rW   r}   rk   r„   r   rX   ry   ÚThreePointArcr   r  r0   r1   )r4   r  r   r"  r    r'   r¨   r©   Ú	mid_pointÚsagitta_workplaneÚsagitta_vectorÚ	sag_pointrb   r5   s                €r(   r1   zSagittaArc.__init__k  sü   ø€ ô %.×$:Ñ$:¸4Ó$@ˆÜ˜ Ô&ä"×+Ñ+¨K¸ÓC‰
ˆˆsØ˜5‘[ CÑ'ˆ	Øˆ?Ü %§¡Ñä +× 0Ñ 0Ü×*Ñ*Ó,×7Ñ7¸Ñ:ó!Ðð #&¨¡+×!9Ñ!9Ó!;¼cÀ'»lÑ!JˆØ'×.Ñ.ÜÐ"×)Ñ)Ð+<×+BÑ+BÓCØ˜A’+‰B 3ó
ˆð
  Ñ.ˆ	ä˜E 9¨c¼¿¹ÔEˆÜ‰Ñ˜ 4ÐÕ(r*   )r  r   r   r   r"  rc   r    r   r7   r@   s   @r(   r  r  ]  sO   ø„ ñ	ð —>‘>Ð"€Kð —X‘Xð)àð)ð ð)ð ð	)ð
 ÷)ñ )r*   r  c                  óp   ‡ — e Zd ZdZej
                  gZdddej                  dœ	 	 	 	 	 	 	 	 	 dˆ fd„Z	ˆ xZ
S )ÚSplinea6  Line Object: Spline

    Add a spline through the provided points optionally constrained by tangents.

    Args:
        pts (Union[VectorLike, Iterable[VectorLike]]): sequence of two or more points
        tangents (Iterable[VectorLike], optional): tangents at end points. Defaults to None.
        tangent_scalars (Iterable[float], optional): change shape by amplifying tangent.
            Defaults to None.
        periodic (bool, optional): make the spline periodic. Defaults to False.
        mode (Mode, optional): combination mode. Defaults to Mode.ADD.
    NF)ÚtangentsÚtangent_scalarsÚperiodicr    c               ó€  •— t        |Ž }t        j                  | «      }t        || «       t	        j
                  |Ž }|r1|D �	cg c]%  }	t	        j
                  |	«      j                  «       ‘Œ' }
}	nd }
|�|€dgt        t        |«      «      z  }n|�t        |«      ng }t        j                  |D �cg c]  }t        |t        «      r|nt        |Ž ‘Œ c}|
r=t        |
|«      D ��cg c]%  \  }}t        |t        «      r||z  n
t        |Ž |z  ‘Œ' c}}nd ||d u ¬«      }t        ‰| �=  ||¬«       y c c}	w c c}w c c}}w )Nrñ   )r-  r/  Úscaler!   )r   r   r"   r   r   rI   r}   r‹   Úlistr   Úmake_spliner#   r   Úzipr0   r1   )r4   r-  r.  r/  r    rÖ   r×   r'   Ú
spline_ptsr|   Úspline_tangentsÚscalarsrþ   ÚtÚsÚspliner5   s                   €r(   r1   zSpline.__init__™  sT  ø€ ô " 3Ð'ˆÜ$-×$:Ñ$:¸4Ó$@ˆÜ˜ Ô&ä"×+Ñ+¨VÐ4ˆ
ááLTóÙLTÀ”×&Ñ& wÓ/×:Ñ:Õ<ÈHð ñ ð #ˆOàÐ OÐ$;Ø�eœc¤$ x£.Ó1Ñ1‰Gà/>Ð/J”d˜?Ô+ÐPRˆGä×!Ñ!ÙAKÓLÁ¸A”*˜Q¤Ô'‰Q¬V°Q¨ZÑ7ÀÑLñ #ô !$ O°WÔ =ôá =™˜˜1ô (¨¬6Ô2�A˜’E¼À¸
ÀQ¹ÑFØ =óð
 àØ! TÐ)ô
ˆô 	‰Ñ˜ dÐÕ+ùò1ùò Mùós   Á*D0Â1!D5Ã%*D:)
rÖ   rì   r-  zIterable[VectorLike] | Noner.  zIterable[float] | Noner/  r°   r    r   r7   r@   s   @r(   r,  r,  ‰  sb   ø„ ñð —>‘>Ð"€Kð
 15Ø26ØØ—X‘Xñ',à/ð',ð .ð',ð 0ð	',ð
 ð',ð ÷',ñ ',r*   r,  c                  óh   ‡ — e Zd ZdZej
                  gZdej                  dœ	 	 	 	 	 	 	 dˆ fd„Z	ˆ xZ
S )r�   a  Line Object: Tangent Arc

    Add an arc defined by two points and a tangent.

    Args:
        pts (Union[VectorLike, Iterable[VectorLike]]): sequence of two points
        tangent (VectorLike): tangent to constrain arc
        tangent_from_first (bool, optional): apply tangent to first point. Note, applying
            tangent to end point will flip the orientation of the arc. Defaults to True.
        mode (Mode, optional): combination mode. Defaults to Mode.ADD.

    Raises:
        ValueError: Two points are required
    T)Útangent_from_firstr    c               óh  •— t        |Ž }t        j                  | «      }t        || «       t	        |«      dk7  rt        d«      ‚t        j                  |Ž }t        j                  |«      j                  «       }|rdnd}	t        j                  ||	d      |||	d      «      }
t        ‰| �1  |
|¬«       y )NrÇ   ztangent_arc requires two points)r   r{   )r{   r   r   rz   r!   )r   r   r"   r   r‹   r€   r   rI   r}   r   rö   r0   r1   )r4   r|   r<  r    rÖ   r×   r'   Úarc_ptsr“   Úpoint_indicesrb   r5   s              €r(   r1   zTangentArc.__init__Õ  s²   ø€ ô " 3Ð'ˆÜ$-×$:Ñ$:¸4Ó$@ˆÜ˜ Ô&äˆv‹;˜!ÒÜÐ>Ó?Ð?Ü×(Ñ(¨&Ð1ˆÜ#×,Ñ,¨WÓ5×@Ñ@ÓBˆá#5™¸7ˆÜ×#Ñ#Ø�M !Ñ$Ñ% {°G¸MÈ!Ñ<LÑ4Mó
ˆô 	‰Ñ˜ 4ÐÕ(r*   )rÖ   rì   r|   r   r<  r°   r    r   r7   r@   s   @r(   r�   r�   Ã  sR   ø„ ñð —>‘>Ð"€Kð $(Ø—X‘Xñ)à/ð)ð ð)ð !ð	)ð
 ÷)ñ )r*   r�   c                  óX   ‡ — e Zd ZdZej
                  gZej                  dœdˆ fd„Z	ˆ xZ
S )r&  a-  Line Object: Three Point Arc

    Add an arc generated by three points.

    Args:
        pts (Union[VectorLike, Iterable[VectorLike]]): sequence of three points
        mode (Mode, optional): combination mode. Defaults to Mode.ADD.

    Raises:
        ValueError: Three points must be provided
    r!   c               óô   •— t        j                  | «      }t        || «       t        |Ž }t	        |«      dk7  rt        d«      ‚t        j                  |Ž }t        j                  |Ž }t        ‰| �-  ||¬«       y )Né   z#ThreePointArc requires three pointsr!   )r   r"   r   r   r‹   r€   r   rI   r   Úmake_three_point_arcr0   r1   )r4   r    rÖ   r'   r×   rý   rb   r5   s          €r(   r1   zThreePointArc.__init__ü  ss   ø€ Ü$-×$:Ñ$:¸4Ó$@ˆÜ˜ Ô&ä! 3Ð'ˆÜˆv‹;˜!ÒÜÐBÓCÐCÜ(×1Ñ1°6Ð:ÐÜ×'Ñ'Ð)9Ð:ˆä‰Ñ˜ 4ÐÕ(r*   r   r7   r@   s   @r(   r&  r&  í  s'   ø„ ñ
ð —>‘>Ð"€KàMQÏXÉX÷ 
)ó 
)r*   r&  )r    r   )<r;   Ú
__future__r   rV   rU   Úmathr   r   r   r   r   Úscipy.optimizer	   Útypingr
   Úcollections.abcr   Úbuild123d.build_commonr   r   r   Úbuild123d.build_enumsr   r   r   r   r   Úbuild123d.build_liner   Úbuild123d.geometryr   r   r   r   r   Úbuild123d.topologyr   r   r   r   r)   r,   rC   rF   rO   re   r¦   r³   rº   rÃ   rî   rû   r  r  r  r  r  r,  r�   r&  r±   r*   r(   Ú<module>rN     s9  ðñõ8 #ã ß 2Õ 2Ý #Ý å $ç SÑ Sß TÕ TÝ *ß IÕ Iß 6Ó 6ó6ô (�Tô (ô (�Tô (ô +ˆ^ô +ô>2)�ô 2)ôj`3�~ô `3ôF#8˜ô #8ôT5+˜.ô 5+ôp$+ˆNô $+ôN\.�^ô \.ô~;)ˆnô ;)ô|.ˆ>ô .ô>&.�~ô &.ôR;.�ô ;.ô|&@ˆ~ô &@ôR1)�ô 1)ôh))�ô ))ôX7,ˆ^ô 7,ôt')�ô ')ôT)�Nõ )r*   