question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Preview: Juypter CadQuery now has a Viewer component for debugging in IDEs

See original GitHub issue

This 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

image

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)

viewer

Debugging session with dark theme

jcv -d -w 650 -h 400

debugging

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:11 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
bernhard-42commented, May 7, 2021

@Jojain correct. @jmwright The show function imported will tessellate the objects provided and then send the numpy arrays via zmq to the viewer. So you can call python 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 set reset_camera=False, different calls to show 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 called jcv first and tell voila to use it. Will update the git repo today or tomorrow. Up to then jupyter lab will do the trick

0reactions
bernhard-42commented, May 15, 2021

Release RC1 of Jupyter-CadQuery, so closing this issue

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found