Ë
    Jÿià  ã                  óz   — d 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
 ddlmZmZ ddlmZmZmZ  G d„ d	e«      Zy
)aò  
BuildLine

name: build_line.py
by:   Gumyr
date: July 12th 2022

desc:
    This python module is a library used to build lines in three dimensional space.

license:

    Copyright 2022 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)ÚUnion)ÚBuilderÚWorkplaneListÚlogger)ÚMode)ÚLocationÚPlane)ÚCurveÚEdgeÚFacec                  óÐ   ‡ — e Zd ZdZd ZdZeZeZ	e
j                  ej                  f	 	 	 dˆ fd„Zedd„«       Zej"                  dd„«       ZeZd„ Zd„ Zd„ Zd	„ Zd
„ Zddœdd„Zˆ xZS )Ú	BuildLinea  BuildLine

    The BuildLine class is a subclass of Builder for building lines (objects
    with length but not area or volume). It has an _obj property that returns
    the current line being built. The class overrides the faces and solids methods
    of Builder since they don't apply to lines.

    BuildLine only works with a single workplane which is used to convert tuples
    as inputs to global coordinates. For example:

    .. code::

        with BuildLine(Plane.YZ) as radius_arc:
            RadiusArc((1, 2), (2, 1), 1)

    creates an arc from global points (0, 1, 2) to (0, 2, 1). Note that points
    entered as Vector(x, y, z) are considered global and are not localized.

    The workplane is also used to define planes parallel to the workplane that
    arcs are created on.

    Args:
        workplane (Union[Face, Plane, Location], optional): plane used when local
            coordinates are used and when creating arcs. Defaults to Plane.XY.
        mode (Mode, optional): combination mode. Defaults to Mode.ADD.
    Úlinec                ó|   •— d | _         t        ‰| �	  ||¬«       t        | j                  «      dkD  rt        d«      ‚y )N©Úmodeé   z$BuildLine only accepts one workplane)Ú_lineÚsuperÚ__init__ÚlenÚ
workplanesÚ
ValueError)ÚselfÚ	workplaner   Ú	__class__s      €úe/workspace/moltex-experiments/.pixi/envs/default/lib/python3.12/site-packages/build123d/build_line.pyr   zBuildLine.__init__H   s@   ø€ ð
 $(ˆŒ
Ü‰Ñ˜¨ÐÔ.Üˆt�‰Ó !Ò#ÜÐCÓDÐDð $ó    c                ó   — | j                   S )zGet the current line©r   )r   s    r   r   zBuildLine.lineR   s   € ð �z‰zÐr   c                ó   — || _         y)zSet the current lineNr!   )r   Úvalues     r   r   zBuildLine.lineW   s   € ð ˆ�
r   c                ój  — | j                   j                  | j                  «       | j                  ��| j                  t
        j                  k7  rp| j                  �dt        j                  dt        | j                  «      j                  «       | j                  j                  | j                  | j                  ¬«       t        j                  «       j                  | _        | j                  r| j"                  j%                  ddd«       t        j&                  dt        | «      j                  «       y)z6Upon exiting restore context and send object to parentNzTransferring object(s) to %sr   z
Exiting %s)Ú_currentÚresetÚ
_reset_tokÚbuilder_parentr   r   ÚPRIVATEr   r   ÚdebugÚtypeÚ__name__Ú_add_to_contextr   Ú_get_contextr   Úexit_workplanesÚworkplanes_contextÚ__exit__Úinfo)r   Úexception_typeÚexception_valueÚ	tracebacks       r   r1   zBuildLine.__exit__^   sÕ   € à�‰×Ñ˜DŸO™OÔ,ð ×ÑÐ+Ø—	‘	œTŸ\™\Ò)Ø—	‘	Ð%ä�L‰LØ.´°T×5HÑ5HÓ0I×0RÑ0Rôð ×Ñ×/Ñ/°·	±	ÀÇ	Á	Ð/ÔJä,×9Ñ9Ó;×FÑFˆÔð �?Š?Ø×#Ñ#×,Ñ,¨T°4¸Ô>ä�‰�L¤$ t£*×"5Ñ"5Õ6r   c                ó   — t        d«      ‚)zfaces() not implementedz"faces() doesn't apply to BuildLine©ÚNotImplementedError©r   Úargss     r   ÚfaceszBuildLine.facesu   ó   € ä!Ð"FÓGÐGr   c                ó   — t        d«      ‚)zface() not implementedz!face() doesn't apply to BuildLiner7   r9   s     r   ÚfacezBuildLine.facey   s   € ä!Ð"EÓFÐFr   c                ó   — t        d«      ‚)zsolids() not implementedz#solids() doesn't apply to BuildLiner7   r9   s     r   ÚsolidszBuildLine.solids}   s   € ä!Ð"GÓHÐHr   c                ó   — t        d«      ‚)zsolid() not implementedz"solid() doesn't apply to BuildLiner7   r9   s     r   ÚsolidzBuildLine.solid�   r<   r   N)Ú
face_planec               ó   — t        d«      ‚)z_add_to_pending not implementedz*_add_to_pending doesn't apply to BuildLiner7   )r   rC   Úobjectss      r   Ú_add_to_pendingzBuildLine._add_to_pending…   s   € ä!Ð"NÓOÐOr   )r   zFace | Plane | Locationr   r   )ÚreturnzCurve | None)r#   r   rG   ÚNone)rE   zEdge | FacerC   zPlane | None)r,   Ú
__module__Ú__qualname__Ú__doc__Ú_tagÚ	_obj_namer   Ú_shaper   Ú
_sub_classr
   ÚXYr   ÚADDr   Úpropertyr   ÚsetterÚ_objr1   r;   r>   r@   rB   rF   Ú__classcell__)r   s   @r   r   r   '   s«   ø„ ñð6 €DØ€IØ€FØ€Jð .3¯X©XØ—X‘XðEà*ðEð õEð òó ðð 
‡[�[òó ðð €Dò7ò.HòGòIòHð QU÷ Pñ Pr   r   N)rK   Ú
__future__r   Útypingr   Úbuild123d.build_commonr   r   r   Úbuild123d.build_enumsr   Úbuild123d.geometryr	   r
   Úbuild123d.topologyr   r   r   r   © r   r   Ú<module>r]      s4   ðñõ8 #å ç AÑ AÝ &ß .ß 0Ñ 0ô`P�õ `Pr   