Jupyter-CadQuery Release v3.0.0 (24.02.2022)

329 views
Skip to first unread message

bwal...@gmail.com

unread,
Feb 24, 2022, 1:12:22 PM2/24/22
to CadQuery
I'd like to announce Jupyter-CadQuery 3.0.0 !

This release is a complete rewrite of Jupyter-CadQuery: While the selection of pythreejs and JupyterLab's sidecar looked reasonable in 2019, it turned out they had too many limitations: pythreejs is stuck with an outdated version of threejs and the JupyterLab sidecar project did not improve usability to a level I would have liked to have.

New features

  • Jupyter-CadQuery is now a 3 layer project
    1. three-cad-viewer (https://github.com/bernhard-42/three-cad-viewer): This is the complete CAD viewer written in Javascript with threejs being the only dependency. There are a bunch of live examples and an API documentation. This layer could also serve as the viewer for a CadQuery integration into VS Code (anybody willing to give it a try?)
    2. cad-view-widget (https://github.com/bernhard-42/cad-viewer-widget): A thin layer on top of cad-viewer-widget that wraps the CAD viewer into an ipywidget. The API documentation can be found here.
    3. jupyter-cadquery: (https://github.com/bernhard-42/jupyter-cadquery): The actual CadQuery viewer, collecting and tessellating CadQuery objects, using cad-view-widget to visualize the objects. It was written with the intent to be as compatible with Jupyter-CadQuery 2.x as reasonable.
  • Performance
    • By removing the back and forth communication from pythreejs (Python) to threejs (Javascript), the new version is significantly faster in showing multi object assemblies.
  • CadQuery feature support
    • Supports the latest CadQuery Sketch class.
  • New CAD View Controller
    • Besides the orbit controller (with z-axis being restricted to show up) it now also supports a trackball controller with full freedom of moving the CAD objects. The trackball controller uses the holroyd algorithm (see e.g. https://www.mattkeeter.com/projects/rotation/) to have better control of movements and avoid the usual trackball tumbling.
  • A full re-implementation of Sidecar
    • Sidecars will be reused based on name of the sidecar
    • Supports different anchors (right, split-right, split-left, split-top, split-bottom).
    • Sidecars opening with anchor right will adapt the size to the the size of the CAD view
  • WebGL contexts
    • In a browser only a limited number of WebGL context can be shown at the same time (e.g. 16 in Chrome on my Mac). Hence, Jupyter-CadQuery now thoroughly tracks WebGL contexts, i.e. releases WebGL context when sidecar gets closed.
  • Replay mode
    • Supports CadQuery Sketch class.
    • Replay mode now can show bounding box instead of result to compare step with result.
  • New features
    • Jupyter-CadQuery now allows to show all three grids (xy, xz, yz).
    • A new parameter 'show_bbox' additionally shows the bounding box.
    • CAD viewer icons are scalable svg icons.
    • Clipping supports an intersection mode.
    • The animation controller is now part of the Javascript component.
    • 'export_html' exports the whole view (with tools) as a HTML page
    • 'export_png' export the CAD view (without tools) as a PNG

More details, how to install and how to migrate from Jupyter-CadQuery 2, see https://github.com/bernhard-42/jupyter-cadquery

Jeremy Wright

unread,
Feb 25, 2022, 7:06:00 AM2/25/22
to CadQuery
This looks great! I played around a little with it in MyBinder and everything worked well.

Thanks for all your work on this.

trayracing

unread,
Apr 19, 2022, 8:51:54 PM4/19/22
to CadQuery
Very cool! Not only was I able to run in Jupyter, but I could also run a simple cadquery Jupyter notebook from Visual Studio Code into the standalone viewer. The animated rotating disk arm example didn't work in the VSC/Viewer combo, but did in Jupyter.

On Thursday, February 24, 2022 at 1:12:22 PM UTC-5 bwal...@gmail.com wrote:
Reply all
Reply to author
Forward
0 new messages