Ë
    ÛvžjnI  ã            E       ó¨  — d dl Z d dlmZ d dlmZ ddlmZmZ d dl	m
Z ddl
m
Z
 d dlmZmZ g d¢Zd	„ Z	 	 	 	 	 	 	 	 	 	 	 dd
„ZdddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddœDd„Z	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 dd„Zy)é    N)Úviewer_args)Úopen_vieweré   )Úsend_measure_requestÚsend_backend)Úlogo)Ú_showÚ_show_object)r   ÚshowÚshow_objectc                 ó€   — |€g }t        | «      j                  «       D ��ci c]  \  }}|€Œ	||vsŒ||“Œ c}}S c c}}w )N)ÚdictÚitems)ÚdÚexcludesÚkÚvs       úf/workspace/moltex-experiments/.pixi/envs/default/lib/python3.12/site-packages/jupyter_cadquery/show.pyÚnone_filterr   "   sB   € ØÐØˆÜ! !›WŸ]™]œ_ÔT™_‘T�Q˜°±À!È8ÒBSˆAˆq‰D˜_ÒTÐTùÓTs   ¡
:¬:±:c                 ó8  — t        | |||||||||	|
¬«      }t        j                  t        «      }d|d   d<    |j                  |d   fi t        |d   «      ¤ddi¤Ž t        dt        i|j                  j                  ¬	«       t        |j                  _        |S )
N)ÚtitleÚanchorÚ	cad_widthÚ
tree_widthÚaspect_ratioÚheightÚthemeÚglassÚtoolsÚpinningÚdefaultÚRÚconfigÚcollapseÚdataÚ_is_logoTÚmodel)Újcv_id)Ú_open_viewerÚorjsonÚloadsr   Ú
add_shapesr   r   Úb_logoÚwidgetÚidr   Úmeasure_callback)r   r   r   r   r   r   r   r   r   r    r!   ÚviewerÚls                r   r   r   (   sž   € ô ØØØØØ!ØØØØØØô€Fô 	�‰”TÓ€AØ!€A€h�K�
ÑØ€F×Ñ�a˜‘iÑK¤;¨q°©{Ó#;ÑKÀdÓKä�'œ6Ð"¨6¯=©=×+;Ñ+;Õ<Ü%9€F‡M�MÔ"à€Mó    ú-+*cF)DÚnamesÚcolorsÚalphasr1   r   r   r   r   r    Úprogressr   r   r   ÚaxesÚaxes0ÚgridÚorthoÚtransparentÚdefault_opacityÚblack_edgesÚorbit_controlÚtabÚcontrolr$   ÚexplodeÚticksÚcenter_gridÚupÚzoomÚpositionÚ
quaternionÚtargetÚreset_cameraÚclip_slider_0Úclip_slider_1Úclip_slider_2Úclip_normal_0Úclip_normal_1Úclip_normal_2Úclip_intersectionÚclip_planesÚclip_object_colorsÚ	pan_speedÚrotate_speedÚ
zoom_speedÚ	deviationÚangular_toleranceÚedge_accuracyÚdefault_colorÚdefault_edgecolorÚdefault_facecolorÚdefault_thickedgecolorÚdefault_vertexcolorÚambient_intensityÚdirect_intensityÚ	metalnessÚ	roughnessÚrender_edgesÚrender_normalsÚrender_matesÚrender_jointsÚshow_parentÚshow_sketch_localÚhelper_scaleÚ
mate_scaleÚdebugÚtimeitÚ_force_in_debugc        D         óB   — t        t        «       dg«      }Et        Di |E¤ŽS )aY  Show CAD objects in Visual Studio Code
    Parameters
        cad_objs:                All cad objects that should be shown as positional parameters

    Valid keywords for the CAD object attributes:
        names:                   List of names for the cad_objs. Needs to have the same length as cad_objs
        colors:                  List of colors for the cad_objs. Needs to have the same length as cad_objs
        alphas:                  List of alpha values for the cad_objs. Needs to have the same length as cad_objs

    Valid keywords for the viewer location:
        viewer                   The name of the viewer. If None or "", then the viewer will be opened in the cell output
        anchor:                  The location where to open the viewer
                                 (sidecar: "right", split windows: "split-right", "split-left", "split-top", "split-bottom")
        cad_width:               The width of the viewer canvas for cell based viewers (viewer is None or "") (default=800)
        height:                  The height of the viewer canvas for cell based viewers (viewer is None or "") (default=600)

    Valid keywords to configure the viewer:
    - UI
        glass:                   Use glass mode where tree is an overlay over the cad object (default=False)
        tools:                   Show tools (default=True)
        tree_width:              Width of the object tree (default=240)
        theme:                   The theme of the viewer ("light" or "dark")
        pinning:                 Whether cell based viewers (viewer is None or "") can be pinned as png

    - Viewer
        axes:                    Show axes (default=False)
        axes0:                   Show axes at (0,0,0) (default=False)
        grid:                    Show grid (default=False)
        ortho:                   Use orthographic projections (default=True)
        transparent:             Show objects transparent (default=False)
        default_opacity:         Opacity value for transparent objects (default=0.5)
        black_edges:             Show edges in black color (default=False)
        orbit_control:           Mouse control use "orbit" control instead of "trackball" control (default=False)
        collapse:                Collapse.LEAVES: collapse all single leaf nodes,
                                 Collapse.ROOT: expand root only,
                                 Collapse.ALL: collapse all nodes,
                                 Collapse.NONE: expand all nodes
                                 (default=Collapse.ROOT)
        ticks:                   Hint for the number of ticks in both directions (default=10)
        center_grid:             Center the grid at the origin or center of mass (default=False)
        up:                      Use z-axis ('Z') or y-axis ('Y') as up direction for the camera (default="Z")
        explode:                 Turn on explode mode (default=False)

        zoom:                    Zoom factor of view (default=1.0)
        position:                Camera position
        quaternion:              Camera orientation as quaternion
        target:                  Camera look at target
        reset_camera:            Camera.RESET: Reset camera position, rotation, zoom and target
                                 Camera.CENTER: Keep camera position, rotation, zoom, but look at center
                                 Camera.KEEP: Keep camera position, rotation, zoom, and target
                                 (default=Camera.RESET)

        clip_slider_0:           Setting of clipping slider 0 (default=None)
        clip_slider_1:           Setting of clipping slider 1 (default=None)
        clip_slider_2:           Setting of clipping slider 2 (default=None)
        clip_normal_0:           Setting of clipping normal 0 (default=None)
        clip_normal_1:           Setting of clipping normal 1 (default=None)
        clip_normal_2:           Setting of clipping normal 2 (default=None)
        clip_intersection:       Use clipping intersection mode (default=False)
        clip_planes:             Show clipping plane helpers (default=False)
        clip_object_colors:      Use object color for clipping caps (default=False)

        pan_speed:               Speed of mouse panning (default=1)
        rotate_speed:            Speed of mouse rotate (default=1)
        zoom_speed:              Speed of mouse zoom (default=1)

    - Renderer
        deviation:               Shapes: Deviation from linear deflection value (default=0.1)
        angular_tolerance:       Shapes: Angular deflection in radians for tessellation (default=0.2)
        edge_accuracy:           Edges: Precision of edge discretization (default: mesh quality / 100)

        default_color:           Default mesh color (default=(232, 176, 36))
        default_edgecolor:       Default color of the edges of a mesh (default=#707070)
        default_facecolor:       Default color of the edges of a mesh (default=#ee82ee)
        default_thickedgecolor:  Default color of the edges of a mesh (default=#ba55d3)
        default_vertexcolor:     Default color of the edges of a mesh (default=#ba55d3)
        ambient_intensity:       Intensity of ambient light (default=1.00)
        direct_intensity:        Intensity of direct light (default=1.10)
        metalness:               Metalness property of the default material (default=0.30)
        roughness:               Roughness property of the default material (default=0.65)

        render_edges:            Render edges  (default=True)
        render_normals:          Render normals (default=False)
        render_mates:            Render mates for MAssemblies (default=False)
        render_joints:           Render build123d joints (default=False)
        show_parent:             Render parent of faces, edges or vertices as wireframe (default=False)
        show_sketch_local:       In build123d show local sketch in addition to relocate sketch (default=True)
        helper_scale:            Scale of rendered helpers (locations, axis, mates for MAssemblies) (default=1)
        progress:                Show progress of tessellation with None is no progress indicator. (default="-+*c")
                                 for object: "-": is reference,
                                             "+": gets tessellated with Python code,
                                             "*": gets tessellated with native code,
                                             "c": from cache

    - Debug
        debug:                   Show debug statements to the VS Code browser console (default=False)
        timeit:                  Show timing information from level 0-3 (default=False)
    Úcad_objs)r   Úlocalsr	   )Fr5   r6   r7   r1   r   r   r   r   r    r8   r   r   r   r9   r:   r;   r<   r=   r>   r?   r@   rA   rB   r$   rC   rD   rE   rF   rG   rH   rI   rJ   rK   rL   rM   rN   rO   rP   rQ   rR   rS   rT   rU   rV   rW   rX   rY   rZ   r[   r\   r]   r^   r_   r`   ra   rb   rc   rd   re   rf   rg   rh   ri   rj   rk   rl   rm   rn   rp   ÚkwargssF                                                                         r   r   r   L   s%   € ôT œ› J <Ó0€FÜ�(Ð%˜fÑ%Ð%r3   cD                 óD   — t        t        «       dg«      }Dt        | fi |D¤ŽS )a   Incrementally show CAD objects in Visual Studio Code

    Parameters:
        obj:                     The CAD object to be shown

    Valid keywords for the CAD object attributes:
        name:                    The name of the CAD object
        options:                 A dict of color and alpha value: {"alpha":0.5, "color": (64, 164, 223)}
                                 0 <= alpha <= 1.0 and color is a 3-tuple of values between 0 and 255
        clear:                   In interactice mode, clear the stack of objects to be shown (typically used for the first object)
        parent:                  Add another object, usually the parent of e.g. edges or vertices with alpha=0.25

    Valid keywords for the viewer location:
        viewer                   The name of the viewer. If None or "", then the viewer will be opened in the cell output
        anchor:                  The location where to open the viewer
                                 (sidecar: "right", split windows: "split-right", "split-left", "split-top", "split-bottom")
        cad_width:               The width of the viewer canvas for cell based viewers (viewer is None or "") (default=800)
        height:                  The height of the viewer canvas for cell based viewers (viewer is None or "") (default=600)

    Valid keywords to configure the viewer (**kwargs):
    - UI
        glass:                   Use glass mode where tree is an overlay over the cad object (default=False)
        tools:                   Show tools (default=True)
        tree_width:              Width of the object tree (default=240)
        theme:                   The theme of the viewer ("light" or "dark")
        pinning:                 Whether cell based viewers (viewer is None or "") can be pinned as png

    - Viewer
        axes:                    Show axes (default=False)
        axes0:                   Show axes at (0,0,0) (default=False)
        grid:                    Show grid (default=False)
        ortho:                   Use orthographic projections (default=True)
        transparent:             Show objects transparent (default=False)
        default_opacity:         Opacity value for transparent objects (default=0.5)
        black_edges:             Show edges in black color (default=False)
        orbit_control:           Mouse control use "orbit" control instead of "trackball" control (default=False)
        collapse:                Collapse.LEAVES: collapse all single leaf nodes,
                                 Collapse.ROOT: expand root only,
                                 Collapse.ALL: collapse all nodes,
                                 Collapse.NONE: expand all nodes
                                 (default=Collapse.ROOT)
        ticks:                   Hint for the number of ticks in both directions (default=10)
        center_grid:             Center the grid at the origin or center of mass (default=False)
        up:                      Use z-axis ('Z') or y-axis ('Y') as up direction for the camera (default="Z")

        zoom:                    Zoom factor of view (default=1.0)
        position:                Camera position
        quaternion:              Camera orientation as quaternion
        target:                  Camera look at target
        reset_camera:            Camera.RESET: Reset camera position, rotation, zoom and target
                                 Camera.CENTER: Keep camera position, rotation, zoom, but look at center
                                 Camera.KEEP: Keep camera position, rotation, zoom, and target
                                 (default=Camera.RESET)

        clip_slider_0:           Setting of clipping slider 0 (default=None)
        clip_slider_1:           Setting of clipping slider 1 (default=None)
        clip_slider_2:           Setting of clipping slider 2 (default=None)
        clip_normal_0:           Setting of clipping normal 0 (default=[-1,0,0])
        clip_normal_1:           Setting of clipping normal 1 (default=[0,-1,0])
        clip_normal_2:           Setting of clipping normal 2 (default=[0,0,-1])
        clip_intersection:       Use clipping intersection mode (default=[False])
        clip_planes:             Show clipping plane helpers (default=False)
        clip_object_colors:      Use object color for clipping caps (default=False)

        pan_speed:               Speed of mouse panning (default=1)
        rotate_speed:            Speed of mouse rotate (default=1)
        zoom_speed:              Speed of mouse zoom (default=1)

    - Renderer
        deviation:               Shapes: Deviation from linear deflection value (default=0.1)
        angular_tolerance:       Shapes: Angular deflection in radians for tessellation (default=0.2)
        edge_accuracy:           Edges: Precision of edge discretization (default: mesh quality / 100)

        default_color:           Default mesh color (default=(232, 176, 36))
        default_edgecolor:       Default color of the edges of a mesh (default=(128, 128, 128))
        default_facecolor:       Default color of the edges of a mesh (default=#ee82ee / Violet)
        default_thickedgecolor:  Default color of the edges of a mesh (default=#ba55d3 / MediumOrchid)
        default_vertexcolor:     Default color of the edges of a mesh (default=#ba55d3 / MediumOrchid)
        ambient_intensity:       Intensity of ambient light (default=1.00)
        direct_intensity:        Intensity of direct light (default=1.10)
        metalness:               Metalness property of the default material (default=0.30)
        roughness:               Roughness property of the default material (default=0.65)


        render_edges:            Render edges  (default=True)
        render_normals:          Render normals (default=False)
        render_mates:            Render mates for MAssemblies (default=False)
        render_joints:           Render build123d joints (default=False)
        show_parent:             Render parent of faces, edges or vertices as wireframe (default=False)
        show_sketch_local:       In build123d show local sketch in addition to relocate sketch (default=True)
        helper_scale:            Scale of rendered helpers (locations, axis, mates for MAssemblies) (default=1)
        progress:                Show progress of tessellation with None is no progress indicator. (default="-+*c")
                                 for object: "-": is reference,
                                             "+": gets tessellated with Python code,
                                             "*": gets tessellated with native code,
                                             "c": from cache

    - Debug
        debug:                   Show debug statements to the VS Code browser console (default=False)
        imeit:                   Show timing information from level 0-3 (default=False)
    Úobj)r   rq   r
   )Ert   ÚnameÚoptionsr1   r   r   r   r   r    ÚparentÚclearÚportr8   r   r   r   r9   r:   r;   r<   r=   r>   r?   r@   rA   r$   rD   rE   rF   rG   rH   rI   rJ   rK   rL   rM   rN   rO   rP   rQ   rR   rS   rT   rU   rV   rW   rX   rY   rZ   r[   r]   r^   r_   r\   r`   rb   rc   ra   rd   re   rf   rg   rh   ri   rj   rk   rl   rm   rr   sE                                                                        r   r   r   ú   s%   € ôZ œ› E 7Ó+€FÜ˜Ñ&˜vÑ&Ð&r3   )NÚrighti   éú   iX  NÚbrowserTTTT)CNNNNNNNNNFNr4   NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN)r*   Úcad_viewer_widget.utilsr   Úcad_viewer_widgetr   r)   Úcommsr   r   Úocp_vscode.backend_logor   r-   Úocp_vscode.showr	   r
   Ú__all__r   r   r   © r3   r   Ú<module>r„      sþ  ðó" Ý /õ÷ 6Ý 2Ý ß /ò€òUð ØØØØØØ
Ø
Ø
ØØó!ðL ØØØØØØØ
ØØØ
Ø
ØØ	Ø
Ø	Ø
ØØØØØØØØØ
ØØØ	ØØØØØØØØØØØØØØØØØØØØØØØØØØØØØØØØØØØØØ
ØØôKk&ð` 
ØØØØØØ
ØØØ
Ø	ØØ
Ø
ØØ	Ø
Ø	Ø
ØØØØØØØ
ØØØ	ØØØØØØØØØØØØØØØØØØØØØØØØØØØØØØØØØØØØØ
ØôIn'r3   