Preview: Juypter CadQuery now has a Viewer component for debugging in IDEs
See original GitHub issueThis is a beta version (beta1) of the CadQuery viewer for IDEs I talked about earlier.
If you want to give it a try, happy to get feedback.
Installation
It can be installed in an existing conda environment
pip install git+https://github.com/bernhard-42/jupyter-cadquery.git@viewer2
However, since it is quite young, I’d recommend to try it in a fresh conda environment with CadQuery 2.1 being installed:
conda create -n jcv python=3.8
conda activate jcv
conda install pywin32 # Windows users only
conda install -c conda-forge -c cadquery cadquery=2.1
pip install git+https://github.com/bernhard-42/jupyter-cadquery.git@viewer2
pip install git+https://github.com/bernhard-42/cadquery-massembly # for the animated examples
Test from the terminal
Starting (on Mac, Linux and Windows)
jcv -w 800 -h 600
As a simple test add the following code to test.py
:
import cadquery as cq
from jupyter_cadquery.viewer.client import show
box = cq.Workplane().box(1, 1, 1).faces(">Z").hole(0.6).edges().fillet(0.05)
cyl = cq.Workplane().circle(0.1).extrude(1)
show(box, cyl, axes=True, transparent=True)
Debugging session with dark theme
jcv -d -w 650 -h 400
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:11 (9 by maintainers)
Top Results From Across the Web
Working Example of CadQuery in Jupyter Notebooks
Hello all, I threw together a working example of a jupyter notebook with CadQuery. I've seen a few topics here and there mentioning...
Read more >A visual debugger for Jupyter
The debugger extension for JupyterLab provides what users would typically expect from an IDE: a sidebar with a variable explorer, a list of ......
Read more >Chart List - TrueCharts
App Container Source Description
aria2 Not Found aria server for downloading web content
ariang leonismoe/ariang A modern web frontend making aria2 easier to use
autobrr ghcr.io/autobrr/autobrr...
Read more >Visual Debugger for Jupyter Lab/IPython Notebooks - YouTube
Get started with the new Visual Debugger for Jupyterlab. Learn how to set breakpoints, inspect variables, and navigate the call stack right ...
Read more >an assembly with the same simple name - You.com | The Search ...
You.com is an ad-free, private search engine that you control. Customize search results with 150 apps alongside web results. Access a zero-trace private ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@Jojain correct. @jmwright The
show
function imported will tessellate the objects provided and then send the numpy arrays viazmq
to the viewer. So you can callpython test.py
from the command line or run it in VSCode or any other editor from anywhere. You only need to use the python interpreter of the conda env you’ve installed the viewer into. The viewer is stateless, so you can even send (show) objects from different editor instances. If you setreset_camera=False
, different calls toshow
will use the same angle to look at the object.So basically, when the voila thing works (see below) you don’t even see jupyter. And restarting the viewer simply is a browser page refresh.
This also means that there is no dependency for the viewer part on Cadquery. The viewer only deals with numpy arrays and pythreejs. Only the show function uses Cadquery code. And if jupyter cadquery is deployed to the same env as your cadquery, the versions will fit automatically.
Additionally, I found the issue around
voila
: I need to create a kernelspec calledjcv
first and tellvoila
to use it. Will update the git repo today or tomorrow. Up to thenjupyter lab
will do the trickRelease RC1 of Jupyter-CadQuery, so closing this issue