Ë
    JÿiVY  ã            	      ó´  — d 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
mZ ddlmZ ddl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d	lm Z m!Z!m"Z"m#Z# d
d
d
d
d
dddejH                  f		 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 dd„Z%d
ddejH                  f	 	 	 	 	 	 	 	 	 dd„Z&d
ejN                  e
jP                  dejH                  f	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 dd„Z)	 	 	 	 	 	 	 	 	 	 dd„Z*d
ejV                  ddejH                  f	 	 	 	 	 	 	 	 	 	 	 dd„Z,d
ejZ                  ddej\                  f	 	 	 	 	 	 	 	 	 	 	 dd„Z/d
d
d
ddejH                  f	 	 	 	 	 	 	 	 	 	 	 	 	 dd„Z0y
)aõ  
Part Operations

name: operations_part.py
by:   Gumyr
date: March 17th 2023

desc:
    This python module contains operations (functions) that work on Parts.

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.

é    )Úannotations)Úcast)ÚIterable)ÚModeÚUntilÚKindÚSide)Ú	BuildPart)ÚAxisÚPlaneÚVectorÚ
VectorLike)ÚCompoundÚCurveÚEdgeÚFaceÚShellÚSolidÚWireÚPartÚSketchÚ	ShapeListÚVertex)ÚloggerÚWorkplaneListÚflatten_sequenceÚvalidate_inputsNFg        Tc	           
     ó&  — t        j                  d«      }	t        |	d| «       | €@|	�3|	j                  r'|	j                  }
|	j                  }g |	_        g |	_        nct        d«      ‚t        | t        t        t        f«      rg | ¢n| j                  «       }
g }|
D ]"  }	 t        |«      }|€Œ|j                  |«       Œ$ g }|�O|
D �cg c]D  }t        |j                  «       |j                  j                  j                   t#        |«      «      ‘ŒF }}t%        |«      t%        |
«      k7  rt        d«      ‚t'        j(                  dt%        |
«      t%        |«      «       t+        |
|«      D ]ö  \  }}|rddgndgD ]å  }|�t|dk(  r7|j                  t-        j.                  ||j0                  |z  |z  ¬	«      «       ŒA|j                  t-        j2                  ||j0                  |z  |z  |¬
«      «       Œy|€t        d«      ‚|€|	€t        d«      ‚|	j4                  }n|}|€t        d«      ‚|j                  t-        j6                  |||j0                  |z  |¬«      «       Œç Œø |	� |	j8                  |||dœŽ n_t%        |«      dkD  r2 |j;                  «       j<                  |Ž }t        |t        «      r|n|g}|r|D �cg c]  }|j?                  «       ‘Œ }}tA        tC        |«      jE                  «       «      S # t
        $ r d}Y �Œ^w xY wc c}w c c}w )a¦  Part Operation: extrude

    Extrude a sketch or face by an amount or until another object.

    Args:
        to_extrude (Union[Face, Sketch], optional): object to extrude. Defaults to None.
        amount (float, optional): distance to extrude, sign controls direction. Defaults to None.
        dir (VectorLike, optional): direction. Defaults to None.
        until (Until, optional): extrude limit. Defaults to None.
        target (Shape, optional): extrude until target. Defaults to None.
        both (bool, optional): extrude in both directions. Defaults to False.
        taper (float, optional): taper angle. Defaults to 0.0.
        clean (bool, optional): Remove extraneous internal structure. Defaults to True.
        mode (Mode, optional): combination mode. Defaults to Mode.ADD.

    Raises:
        ValueError: No object to extrude
        ValueError: No target object

    Returns:
        Part: extruded object
    ÚextrudeNú!A face or sketch must be providedz4dir must be provided when extruding non-planar facesz)%d face(s) to extrude on %d face plane(s)é   éÿÿÿÿr   )Ú	direction)r#   Útaperz'Either amount or until must be providedz A target object must be providedzNo target object provided)ÚsectionÚtarget_objectr#   Úuntil©ÚcleanÚmode)#r
   Ú_get_contextr   Úpending_facesÚpending_face_planesÚ
ValueErrorÚ
isinstanceÚtupleÚlistÚfilterÚfacesr   ÚappendÚcenterÚcenter_locationÚx_axisr#   r   Úlenr   ÚinfoÚzipr   r   Úz_dirÚextrude_taperÚpartÚextrude_untilÚ_add_to_contextÚpopÚfuser)   r   r   Úsolids)Ú
to_extrudeÚamountÚdirr'   ÚtargetÚbothr$   r)   r*   ÚcontextÚto_extrude_facesÚface_planesÚfaceÚplaneÚ
new_solidsr#   r&   Úfused_solidsÚsolids                      új/workspace/moltex-experiments/.pixi/envs/default/lib/python3.12/site-packages/build123d/operations_part.pyr   r   :   s*  € ôD !*× 6Ñ 6°yÓ A€GÜ�G˜Y¨
Ô3ð ÐØÐ 7×#8Ò#8à&×4Ñ4ÐØ!×5Ñ5ˆKØ$&ˆGÔ!Ø*,ˆGÕ'äÐ@ÓAÐAô
 ˜*¤u¬d´FÐ&;Ô<ð ˆj‰Mà×!Ñ!Ó#ð 	ð
 ˆÛ$ˆDðÜ˜d›�ð Ñ Ø×"Ñ" 5Õ)ð %ð !€Jà
€ñ )ó
á(�ô �$—+‘+“- ×!5Ñ!5×!<Ñ!<×!FÑ!FÌÈsËÕTØ(ð 	ð 
ô ˆ;Óœ3Ð/Ó0Ò0ÜÐOÓPÐPä
‡K�KØ3ÜÐÓÜˆKÓôô Ð+¨[Ö9‰ˆˆeÙ$(˜!˜R™¨q¨cÒ1ˆIØÐ!Ø˜A’:Ø×%Ñ%ÜŸ™Ø Ø&+§k¡k°FÑ&:¸YÑ&Fôõð ×%Ñ%Ü×+Ñ+Ø Ø&+§k¡k°FÑ&:¸YÑ&FØ"'ôõð �=Ü$Ð%NÓOÐOØ�>Ø�Ü(Ð)KÓLÐLØ$+§L¡L‘Mà$*�MØ Ð(Ü$Ð%@ÓAÐAà×!Ñ!Ü×'Ñ'Ø $Ø&3Ø"'§+¡+°	Ñ"9Ø#ô	õñ= 2ð :ðP ÐØˆ×Ñ °5¸tÔDäˆz‹?˜QÒØ0˜:Ÿ>™>Ó+×0Ñ0°*Ð=ˆLä *¨<¼Ô >‘À\ÀNð ñ Ù5?Ó@±Z¨E˜%Ÿ+™+�-°ZˆJÐ@ä”	˜*Ó%×,Ñ,Ó.Ó/Ð/øôS ò Ø“ðüò
ùò| As   ÂK7ÃA	L	Ê<LË7LÌLc                óª  — t        j                  d«      }t        | «      }t        |d|«       t	        |D �cg c]  }|du ‘Œ c}«      rR|�|�|j
                  st        d«      ‚|j
                  D �cg c]  }|j                  «       ‘Œ }}g |_        g |_        �nQt        d„ |D «       «      s6|D �	�cg c]'  }	|	j                  «       D ]  }|j                  «       ‘Œ Œ) }}	}�n	t        d„ |D «       «      rÚt        d„ |D «       «      rÈt        d„ |dd	 D «       «      rt        d
«      ‚g }|D ]   }t        |t        «      r|j                  |«       Œ%t        |t        «      r |j                  |j                  «       «       ŒUt        |t        «      sŒf|j!                  |j                  «       D �
cg c]  }
|
j                  «       ‘Œ c}
«       Œ¢ nt	        d„ |D «       «      rt        d«      ‚t#        j$                  |«      }|j'                  «       sft#        j(                  t+        j,                  |j                  «       |z   «      «      }|r|j/                  «       }|j'                  «       st1        d«      ‚|�|j3                  |||¬«       n|r|j/                  «       }t5        t7        |g«      j8                  «      S c c}w c c}w c c}}	w c c}
w )aB  Part Operation: loft

    Loft the pending sketches/faces, across all workplanes, into a solid.

    Args:
        sections (Vertex, Face, Sketch): slices to loft into object. If not provided, pending_faces
            will be used. If vertices are to be used, a vertex can be the first, last, or
            first and last elements.
        ruled (bool, optional): discontiguous layer tangents. Defaults to False.
        clean (bool, optional): Remove extraneous internal structure. Defaults to True.
        mode (Mode, optional): combination mode. Defaults to Mode.ADD.
    ÚloftNzNo sections providedc              3  ó<   K  — | ]  }t        |t        «      –— Œ y ­w©N©r/   r   ©Ú.0Úss     rP   Ú	<genexpr>zloft.<locals>.<genexpr>ß   s   è ø€ Ð?±,¨Q”:˜a¤×(±,ùó   ‚c              3  ó<   K  — | ]  }t        |t        «      –— Œ y ­wrT   rU   rV   s     rP   rY   zloft.<locals>.<genexpr>å   ó   è ø€ Ð=±¨1”˜Aœv×&±ùrZ   c              3  óH   K  — | ]  }t        |t        t        f«      –— Œ y ­wrT   )r/   r   r   rV   s     rP   rY   zloft.<locals>.<genexpr>å   s    è ø€ ð F
Ù3?¨aŒJ�qœ4¤˜.×)±<ùs   ‚ "c              3  ó<   K  — | ]  }t        |t        «      –— Œ y ­wrT   rU   rV   s     rP   rY   zloft.<locals>.<genexpr>è   s   è ø€ ÐEÑ2D¨Q”:˜a¤×(Ñ2DùrZ   r!   r"   z<Vertices must be the first, last, or first and last elementsc              3  ó<   K  — | ]  }t        |t        «      –— Œ y ­wrT   rU   rV   s     rP   rY   zloft.<locals>.<genexpr>ô   r\   rZ   z`At least one face/sketch is required if vertices are the first, last, or first and last elementszFailed to create valid loftr(   )r
   r+   r   r   Úallr,   r.   Ú
outer_wirer-   Úanyr3   r/   r   r4   r   r   Úextendr   Ú	make_loftÚis_validÚ
make_solidr   Ú
make_shellr)   ÚRuntimeErrorr?   r   r   Úwrapped)ÚsectionsÚruledr)   r*   rH   Úsection_listrX   rK   Ú
loft_wiresr%   ÚfÚ	new_solids               rP   rR   rR   Á   s‘  € ô$ !*× 6Ñ 6°vÓ >€Gä# HÓ-€LÜ�G˜V \Ô2ä
™|Ó,™|˜!ˆA�ŠI˜|Ñ,Ô-Øˆ?˜wÐ2¸7×;PÒ;PÜÐ3Ó4Ð4Ø4;×4IÒ4IÓJÑ4I¨D�d—o‘oÕ'Ð4Iˆ
ÐJØ "ˆÔØ&(ˆÖ#äÑ?±,Ó?Ô?ñ  ,ôá+�GØ#ŸM™MžO�Dð —‘Õ!à+ð "Ø+ð ó ô
 Ñ=±Ó=Ô=Ä#ñ F
Ù3?óF
ô C
ô ÑE°,¸qÀÑ2DÓEÔEÜ ØRóð ð ˆJÛ!�Ü˜a¤Ô(Ø×%Ñ% aÕ(Ü ¤4Ô(Ø×%Ñ% a§l¡l£nÕ5Ü ¤6Õ*Ø×%Ñ%¸q¿w¹w¼yÓ&I¹y¸! q§|¡|¥~¸yÑ&IÕJñ "ô Ñ=±Ó=Ô=Üð-óð ô
 —‘ 
¨EÓ2€Ið ×ÑÔÜ×$Ñ$¤U×%5Ñ%5°i·o±oÓ6GÈ,Ñ6VÓ%WÓXˆ	ÙØ!Ÿ™Ó)ˆIØ×!Ñ!Ô#ÜÐ<Ó=Ð=àÐØ×Ñ 	°¸TÐÕBÙ	Ø—O‘OÓ%ˆ	ä”˜)˜Ó%×-Ñ-Ó.Ð.ùòc -ùò Kùó
ùò& 'Js   ·K Á2KÂ2,K
Æ.K
c           	     ó   — t        j                  d«      }t        |d«       |�Et        |t        «      r|j                  «       d   }nGt        |t        t        f«      s1t        d«      ‚|�|j                  �|j                  }nt        d«      ‚|j                  | ||d¬«      }|j                  «       }		 t        t        |«      «      }
t        «       }|j                  «       }t        |t         t"        f«      r|gt%        |«      z  }n't        |t&        «      rt)        |«      }nt+        d	«      ‚|D ]»  }|	j-                  t/        |j0                  |j2                  |j4                  «      «      }|d
d D ]w  }t7        t/        ||z
  j9                  «       Ž j:                  | z
  «      dk  sŒ6|j=                  t        j>                  |j9                  «       |j9                  «       «      «        Œ» Œ½ |jA                  |«      }t%        |«      t%        |«      k7  rt        dt%        |«      › d�«      ‚tC        ||«      D ��cg c])  \  }}t        jD                  ||
jF                  |z  ¬«      ‘Œ+ }}}|jI                  «       jA                  |«      }g }tK        t%        |«      d
z
  «      D ]6  }|j=                  tM        jN                  ||   ||d
z      g||   ¬«      «       Œ8 t%        |«      d
kD  r!tQ        tR        tS        jT                  |Ž «      }n|d   }|�|jW                  |||¬«       n|r|jY                  «       }tS        t[        |g«      j\                  «      S # t        $ r}t        d«      |‚d}~ww xY wc c}}w )a  make_brake_formed

    Create a part typically formed with a sheet metal brake from a single outline.
    The line parameter describes how the material is to be bent. Either a single
    width value or a width value at each vertex or station is provided to control
    the width of the end part.  Note that if multiple values are provided there
    must be one for each vertex and that the resulting part is composed of linear
    segments.

    Args:
        thickness (float): sheet metal thickness
        station_widths (Union[float, Iterable[float]]): width of part at
            each vertex or a single value. Note that this width is perpendicular
            to the provided line/plane.
        line (Union[Edge, Wire, Curve], optional): outline of part. Defaults to None.
        side (Side, optional): offset direction. Defaults to Side.LEFT.
        kind (Kind, optional): offset intersection type. Defaults to Kind.ARC.
        clean (bool, optional): clean the resulting solid. Defaults to True.
        mode (Mode, optional): combination mode. Defaults to Mode.ADD.

    Raises:
        ValueError: invalid line type
        ValueError: not line provided
        ValueError: line not suitable
        ValueError: incorrect # of width values

    Returns:
        Part: sheet metal part
    Úmake_brake_formedNr   z)line must be either a Curve, Edge or WirezA line must be providedT)ÚdistanceÚkindÚsideÚclosedz%line not suitable - probably straightz<station_widths must be either a single number or an iterabler!   g{®Gáz„?z^widths must either be a single number or an iterable with a length of the # vertices in line (Ú))Úobjr#   )Úpathr(   )/r
   r+   r   r/   r   Úwiresr   r   r.   Úpending_edges_as_wireÚ	offset_2dÚverticesr   r   Ú	Exceptionr   ÚfloatÚintr8   r   r1   Ú	TypeErrorÚsort_by_distancer   ÚXÚYÚZÚabsÚto_tupleÚlengthr4   Ú	make_lineÚsort_byr:   r   r;   ÚedgesÚranger   Úsweep_multir   r   rA   r?   r)   r   ri   )Ú	thicknessÚstation_widthsÚlinert   rs   r)   r*   rH   Úoffset_lineÚoffset_verticesrL   ÚexcÚstation_edgesÚline_verticesÚstation_widths_listÚvertexÚothersÚotherÚeÚwÚstation_facesÚsweep_pathsrj   Úiro   s                            rP   rq   rq     s8  € ôN !*× 6Ñ 6Ð7JÓ K€GÜ�GÐ0Ô1àÐÜ�dœEÔ"Ø—:‘:“< ‘?‰DÜ˜D¤4¬ ,Ô/ÜÐHÓIÐIØ	Ð	 ×!>Ñ!>Ð!JØ×,Ñ,‰äÐ2Ó3Ð3ð —.‘.¨)¸$ÀTÐRV�.ÓW€KØ!×*Ñ*Ó,€OðKÜ”d˜;Ó'Ó(ˆô
 &/£[€MØ—M‘M“O€Mä�.¤5¬# ,Ô/Ø-Ð.´°]Ó1CÑCÑÜ	�N¤HÔ	-Ü" >Ó2ÑäÐVÓWÐWãˆØ ×1Ñ1´&¸¿¹À6Ç8Á8ÈVÏXÉXÓ2VÓWˆØ˜A˜B“ZˆEÜ”6˜F U™N×4Ñ4Ó6Ð7×>Ñ>ÀÑJÓKÈdÓRØ×$Ñ$Ü—N‘N 6§?¡?Ó#4°e·n±nÓ6FÓGôñ ñ  ð  ð "×)Ñ)¨$Ó/€Mä
ÐÓ¤3 }Ó#5Ò5Üð3Ü36°}Ó3EÐ2FÀaðIó
ð 	
ô ˜Ð':Ô;ôá;‰DˆAˆqô 	�‰˜ e§k¡k°A¡oÖ6Ø;ð ñ ð —*‘*“,×&Ñ& tÓ,€KØ€HÜ”3�}Ó%¨Ñ)Ö*ˆØ�‰Ü×ÑØ˜qÑ! =°°Q±Ñ#7Ð8¸{È1¹~ôõ	
ð +ô ˆ8ƒ}�qÒÜœœtŸy™y¨(Ð3Ó4‰	à˜Q‘Kˆ	àÐØ×Ñ 	°¸TÐÕBÙ	Ø—O‘OÓ%ˆ	ä”˜)˜Ó%×-Ñ-Ó.Ð.øôg ò KÜÐ@ÓAÀsÐJûðKüó:s   Â5M È?.M:Í	M7Í&M2Í2M7c                ó  — t        j                  d«      }|�t        |t         «      st        d«      ‚t        | t        «      rt        | «      n
t        | «      } t        |«      j                  «       }t        |«      j                  «       }| ||z  z   }t        ||¬«      }t        j                  dd|¬«      }t        | |z   |«      }|j                  |«      }	|	st        d«      ‚|	d   d   |z
  }
|
|_        |j                  «        |S )a
  Part Operation: project_workplane

    Return a plane to be used as a BuildSketch or BuildLine workplane
    with a known origin and x direction. The plane's origin will be
    the projection of the provided origin (in 3D space). The plane's
    x direction will be the projection of the provided x_dir (in 3D space).

    Args:
        origin (Union[VectorLike, Vertex]): origin in 3D space
        x_dir (Union[VectorLike, Vertex]): x direction in 3D space
        projection_dir (VectorLike): projection direction
        distance (float): distance from origin to workplane

    Raises:
        RuntimeError: Not suitable for BuildLine or BuildSketch
        ValueError: x_dir perpendicular to projection_dir

    Returns:
        Plane: workplane aligned for projection
    Úproject_workplanezIprojection_workplane can only be used from a BuildPart context or algebra)r;   g    eÍÍA)rL   z%x_dir perpendicular to projection_dirr   )r
   r+   r/   rh   r   r   Ú
normalizedr   r   Ú	make_rectr   Úfind_intersection_pointsr.   Úx_dirÚ_calc_transforms)Úoriginr£   Úprojection_dirrr   rH   Úworkplane_originÚ	workplaneÚscreenÚx_dir_point_axisÚ
projectionÚworkplane_x_dirs              rP   rŸ   rŸ   |  s  € ô4 !*× 6Ñ 6Ð7JÓ K€GàÐ¤:¨g´yÔ#AÜØWó
ð 	
ô  *¨&´&Ô9ŒV�FŒ^¼vÀf»~€FÜ�5‹M×$Ñ$Ó&€EÜ˜NÓ+×6Ñ6Ó8€Nð  °Ñ 9Ñ9ÐÜÐ&¨nÔ=€Iô �^‰^˜C ¨IÔ6€FÜ˜F U™N¨NÓ;ÐØ×0Ñ0Ð1AÓB€JÙÜÐ@ÓAÐAð ! ‘m AÑ&Ð)9Ñ9€OØ%€I„OØ×ÑÔ àÐó    ç     €v@c                ó&  — t        j                  d«      }t        | «      }t        |d|«       |dz  }|dk(  rdn|}t	        |D �cg c]  }|du ‘Œ c}«      r6|�|�|j
                  st        d«      ‚|j
                  }	g |_        g |_        n|j                  «       }	|	D �
cg c]  }
t        j                  |
||«      ‘Œ }}
t        |«      }|� |j                  |||dœŽ n|r|j                  «       }t        |j                  «      S c c}w c c}
w )aª  Part Operation: Revolve

    Revolve the profile or pending sketches/face about the given axis.
    Note that the most common use case is when the axis is in the same plane as the
    face to be revolved but this isn't required.

    Args:
        profiles (Face, optional): 2D profile(s) to revolve.
        axis (Axis, optional): axis of rotation. Defaults to Axis.Z.
        revolution_arc (float, optional): angular size of revolution. Defaults to 360.0.
        clean (bool, optional): Remove extraneous internal structure. Defaults to True.
        mode (Mode, optional): combination mode. Defaults to Mode.ADD.

    Raises:
        ValueError: Invalid axis of revolution
    Úrevolver®   r   NzNo profiles providedr(   )r
   r+   r   r   r`   r,   r.   r-   r3   r   r°   r   r?   r)   r   ri   )ÚprofilesÚaxisÚrevolution_arcr)   r*   rH   Úprofile_listÚanglerX   Úprofile_facesÚprofilerM   ro   s                rP   r°   r°   ´  s  € ô. !*× 6Ñ 6°yÓ A€Gä# HÓ-€Lä�G˜Y¨Ô5ð ˜UÑ"€EØ˜a’Z‰E U€Eä
™|Ó,™|˜!ˆA�ŠI˜|Ñ,Ô-Øˆ?˜wÐ2¸7×;PÒ;PÜÐ3Ó4Ð4Ø×-Ñ-ˆØ "ˆÔØ&(ˆÕ#à$×*Ñ*Ó,ˆáERÓSÁ]¸'”%—-‘- ¨°Õ5À]€JÐSä˜Ó$€IØÐØˆ×Ñ °5¸tÔDÙ	Ø—O‘OÓ%ˆ	ä�	×!Ñ!Ó"Ð"ùò# -ùò Ts   ÁD	Â!Dc                óº  — t        j                  d«      }t        |dd«       | �| }n&|�|j                  �|j                  }nt	        d«      ‚|j                  d¬«      j                  }|�t        |t        «      r|n|g}n,|�t        j                  «       j                  }nt	        d«      ‚|D �	cg c]N  }	t        j                  d|z  d|z  t        |	j                  |	j                  |z  z   |	j                  ¬«      «      ‘ŒP }
}	| €&|�|j                   �|j                  } nt	        d	«      ‚g }|
D ]I  }	|j#                  |	«      }t        |t$        «      r|j'                  |«       Œ6|€Œ9|j)                  |«       ŒK |� |j*                  |d||d
œŽ n|r|D �cg c]  }|j-                  «       ‘Œ }}t/        t1        |«      j2                  «      S c c}	w c c}w )a  Part Operation: section

    Slices current part at the given height by section_by or current workplane(s).

    Args:
        obj (Part, optional): object to section. Defaults to None.
        section_by (Plane, optional): plane(s) to section object.
            Defaults to None.
        height (float, optional): workplane offset. Defaults to 0.0.
        clean (bool, optional): Remove extraneous internal structure. Defaults to True.
        mode (Mode, optional): combination mode. Defaults to Mode.INTERSECT.
    r%   NzNo object to sectionF)Úoptimalz&Plane(s) must be provide to section byé   )r¥   r;   zobj must be provided)Úfaces_to_pendingr)   r*   )r
   r+   r   r=   r.   Úbounding_boxÚdiagonalr/   r   r   Ú
workplanesr   r¡   r   r¥   r;   Ú_objÚ	intersectr   rc   r4   r?   r)   r   r   ri   )rw   Ú
section_byÚheightr)   r*   rH   Ú
to_sectionÚmax_sizeÚsection_planesrL   ÚplanesÚnew_objectsÚintersectionÚrs                 rP   r%   r%   ê  sÝ  € ô& !*× 6Ñ 6°yÓ A€GÜ�G˜Y¨Ô-à
€Ø‰
Ø	Ð	 §¡Ð!9Ø—\‘\‰
äÐ/Ó0Ð0à×&Ñ&¨uÐ&Ó5×>Ñ>€HàÐä$ Z´Ô:‰JÀÀñ 	ð 
Ð	Ü&×3Ñ3Ó5×@Ñ@‰äÐAÓBÐBñ $óñ $ˆEô 	�‰Ø�‰LØ�‰LÜ˜Ÿ™¨¯©°fÑ(<Ñ<ÀEÇKÁKÔPõ	
ð
 $ð ð ð €{ØÐ 7§<¡<Ð#;Ø—,‘,‰CäÐ3Ó4Ð4à&(€KÛˆØ!×+Ñ+¨EÓ2ˆÜ�l¤IÔ.Ø×Ñ˜|Õ,ØÑ%Ø×Ñ˜|Õ,ð ð ÐØˆ×ÑØ¨5¸ÀDô	
ñ Ù.9Ó:©k¨˜1Ÿ7™7�9¨kˆKÐ:ä”(˜;Ó'×/Ñ/Ó0Ð0ùò=ùò8 ;s   Â2AGÆGc                ó2  — t        j                  d«      }t        |d| «       |€t        d«      ‚| €4|�'|j                  r|j                  }g |_        g |_        n:t        d«      ‚t        | t        t        t        f«      rg | ¢n| j                  «       }g }t        j                  dt        |«      «       |D ]W  }	|�|n|	j                  «       }
|rddgndgD ]5  }|j                  t!        j"                  |	|t%        |
«      |z  ¬«      «       Œ7 ŒY |� |j&                  |||dœŽ nNt        |«      dkD  r!t)        t*        t+        j,                  |Ž «      g}|r|D �cg c]  }|j/                  «       ‘Œ }}t+        t1        |«      j2                  «      S c c}w )	aö  Part Operation: thicken

    Create a solid(s) from a potentially non planar face(s) by thickening along the normals.

    Args:
        to_thicken (Union[Face, Sketch], optional): object to thicken. Defaults to None.
        amount (float): distance to extrude, sign controls direction.
        normal_override (Vector, optional): The normal_override vector can be used to
            indicate which way is 'up', potentially flipping the face normal direction
            such that many faces with different normals all go in the same direction
            (direction need only be +/- 90 degrees from the face normal). Defaults to None.
        both (bool, optional): thicken in both directions. Defaults to False.
        clean (bool, optional): Remove extraneous internal structure. Defaults to True.
        mode (Mode, optional): combination mode. Defaults to Mode.ADD.

    Raises:
        ValueError: No object to extrude
        ValueError: No target object

    Returns:
        Part: extruded object
    ÚthickenzAn amount must be providedr    z%d face(s) to thickenr!   r"   )ÚdepthÚnormal_overrider(   )r
   r+   r   r.   r,   r-   r/   r0   r1   r2   r3   r   r9   r8   Ú	normal_atr4   r   rË   r   r?   r   r   rA   r)   r   ri   )Ú
to_thickenrD   rÍ   rG   r)   r*   rH   Úto_thicken_facesrM   rK   Úface_normalr#   rO   s                rP   rË   rË   3  s•  € ô< !*× 6Ñ 6°yÓ A€GÜ�G˜Y¨
Ô3ð €~ÜÐ5Ó6Ð6àÐØÐ 7×#8Ò#8à&×4Ñ4ÐØ$&ˆGÔ!Ø*,ˆGÕ'äÐ@ÓAÐAô
 ˜*¤u¬d´FÐ&;Ô<ð ˆj‰Mà×!Ñ!Ó#ð 	ð !€Jä
‡K�KÐ'¬Ð-=Ó)>Ô?ã ˆà.Ð:‰OÀÇÁÓ@Pð 	ñ %)˜!˜R™¨q¨cÒ1ˆIØ×ÑÜ—‘Ø ¼¸{Ó8KÈiÑ8Wôõñ 2ð	 !ð ÐØˆ×Ñ °5¸tÔDäˆz‹?˜QÒÜœt¤T§Y¡Y°
Ð%;Ó<Ð=ˆJÙÙ5?Ó@±Z¨E˜%Ÿ+™+�-°ZˆJÐ@ä”˜Ó$×,Ñ,Ó-Ð-ùò As   ÅF)rC   úFace | Sketch | NonerD   úfloat | NonerE   úVectorLike | Noner'   zUntil | NonerF   zCompound | Solid | NonerG   Úboolr$   r~   r)   rÕ   r*   r   Úreturnr   )
rj   z7Face | Sketch | Iterable[Vertex | Face | Sketch] | Nonerk   rÕ   r)   rÕ   r*   r   rÖ   r   )r�   r~   rŽ   zfloat | Iterable[float]r�   zEdge | Wire | Curve | Nonert   r	   rs   r   r)   rÕ   r*   r   rÖ   r   )
r¥   úVectorLike | Vertexr£   r×   r¦   r   rr   r~   rÖ   r   )r±   zFace | Iterable[Face] | Noner²   r   r³   r~   r)   rÕ   r*   r   rÖ   r   )rw   zPart | NonerÁ   zPlane | Iterable[Plane]rÂ   r~   r)   rÕ   r*   r   rÖ   r   )rÏ   rÒ   rD   rÓ   rÍ   rÔ   rG   rÕ   r)   rÕ   r*   r   rÖ   r   )1Ú__doc__Ú
__future__r   Útypingr   Úcollections.abcr   Úbuild123d.build_enumsr   r   r   r	   Úbuild123d.build_partr
   Úbuild123d.geometryr   r   r   r   Úbuild123d.topologyr   r   r   r   r   r   r   r   r   r   r   Úbuild123d.build_commonr   r   r   r   ÚADDr   rR   ÚLEFTÚARCrq   rŸ   r„   r°   ÚXZÚPRIVATEr%   rË   © r­   rP   Ú<module>rç      sê  ðñõ8 #Ý å $ß 9Ó 9Ý *ß >Ó >÷÷ ÷ ñ ÷ó ð (,ØØ!ØØ&*ØØØØ—‘ðD0Ø$ðD0àðD0ð 
ðD0ð ð	D0ð
 $ðD0ð ðD0ð ðD0ð ðD0ð ðD0ð 
óD0ðP IMØØØ—‘ð	H/ØEðH/àðH/ð ðH/ð ð	H/ð
 
óH/ð\ (,Ø—‘Ø—‘ØØ—‘ðm/Øðm/à+ðm/ð %ðm/ð ð	m/ð
 ðm/ð ðm/ð ðm/ð 
óm/ð`5Øð5àð5ð ð5ð ð	5ð
 ó5ðr .2Ø—‘Ø!ØØ—‘ð3#Ø*ð3#à
ð3#ð ð3#ð ð	3#ð
 ð3#ð 
ó3#ðn Ø*/¯(©(ØØØ—‘ðF1Ø	ðF1à'ðF1ð ðF1ð ð	F1ð
 ðF1ð óF1ðT (,ØØ)-ØØØ—‘ðM.Ø$ðM.àðM.ð 'ðM.ð ð	M.ð
 ðM.ð ðM.ð 
ôM.r­   