Package cad_viewer_widget
Sub-modules
cad_viewer_widget.sidecar
cad_viewer_widget.utils
-
Utility functions
cad_viewer_widget.widget
-
This module is the Python part of the CAD Viewer widget
Functions
def open_viewer(title=None,
anchor='right',
cad_width=800,
tree_width=250,
height=600,
aspect_ratio=0.75,
theme='browser',
glass=True,
tools=True,
pinning=True,
default=True)def set_default_sidecar(title, anchor='right')
def show(shapes,
tracks=None,
title=None,
anchor=None,
cad_width=None,
tree_width=None,
aspect_ratio=None,
height=None,
theme=None,
glass=None,
tools=None,
pinning=None,
new_tree_behavior=True,
normal_len=None,
default_edgecolor=None,
default_opacity=None,
ambient_intensity=None,
direct_intensity=None,
metalness=None,
roughness=None,
up=None,
control=None,
ortho=None,
axes=None,
axes0=None,
grid=None,
center_grid=None,
explode=None,
ticks=None,
transparent=None,
black_edges=None,
collapse=None,
reset_camera=None,
clip_slider_0=None,
clip_slider_1=None,
clip_slider_2=None,
clip_normal_0=None,
clip_normal_1=None,
clip_normal_2=None,
clip_intersection=None,
clip_planes=None,
clip_object_colors=None,
position=None,
quaternion=None,
target=None,
zoom=None,
zoom_speed=None,
pan_speed=None,
rotate_speed=None,
timeit=None,
debug=None)-
Show CAD objects in JupyterLab
- shapes: Serialized nested tessellated shapes
Valid keywords:
-
UI glass: Use glass mode where tree is an overlay over the cad object (default=True) tools: Show tools (default=True) cad_width: Width of the cad canvas (default=800) height: Height of the cad canvas (default=600) tree_width: Width of the object tree (default=240) theme: Theme "light" or "dark" (default="light") pinning: Allow replacing the CAD View by a canvas screenshot (default=True in cells, else False) new_tree_behavior: Whether to hide the complete shape when clicking on the eye (True, default) or only the faces (False)
-
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) control: Mouse control use "orbit" control instead of "trackball" control (default="trackball") collapse: "1": collapse all single leaf nodes, "R": expand root only, "C": collapse all nodes, "E"": expand all nodes (default="R"") 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=[-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 default_edgecolor: Default mesh color (default=(128, 128, 128)) 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)
-
Debug debug: Show debug statements to the VS Code browser console (default=False) timeit: Show timing information from level 0-3 (default=False)