-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Preview: Juypter CadQuery now has a Viewer component for debugging in IDEs #42
Comments
Thanks for the work it looks amazing. I've tried to run it by typing EDIT : I tried to install the regular jupyter-cadquery in another new conda env and I had the same error so I assume it's something wrong on my side. I manually installed the lib via
I can import I don't know that much about ipython kernel and stuff so I don't know what can happen |
You could also just start from jupyter_cadquery.viewer.server import start_viewer
start_viewer() into a cell and execute it (voila just automates that) |
A simpler test whether the installation worked would be
I am surprised that in your case a kernel 597585c0-bc20-4126-936a-8287d64ef80b is selected. Usually it should be
|
It works when running it directly from jupyter lab! |
Nice! I will look into voila and its kernel issue, since that would be easier.
Would that help? |
@bernhard-42 I'm not understanding to how execute code. I have the viewer open, and you say above to add code to test.py. It looks in the gif like you're adding code in VS Code (maybe?), so I'm not sure how to make that work. Where is test.py located? |
@jmwright I think you can run the code test.py from wherever you want, if I understand it well, when you run your python script the show function send the data to the ipython kernel so it's displayed in jupyterlab. For my case I got it working by running test.py from vscode in the conda env where jcv is installed after having started jupyterlab as explained by @bernhard-42 |
@Jojain correct. 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. Additionally, I found the issue around |
Ah, ok. It's working now for me. That's mind warping for me to run Python on the command line and have it update in the browser. Nice work! I think that once you release this integration I'll put a note at the top of the cadquery-gui readme that this is the best replacement for that project since I really only do security updates on it now. I'm assuming this will display assemblies and do animations as well, correct? |
Yes, it can show everything jupyter-cadquery can - except animations for now (see below) A little more details:
This ensures that whatever I build into jupyter-cadquery will also be available for the viewer. I didn't want to maintain 2 code streams ... For the time being, there is no message defined to push animation data to the viewer. This is some future feature I will consider in the next release. This release will cover everything except animations. |
Release RC1 of Jupyter-CadQuery, so closing this 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
However, since it is quite young, I'd recommend to try it in a fresh conda environment with CadQuery 2.1 being installed:
Test from the terminal
Starting (on Mac, Linux and Windows)
As a simple test add the following code to
test.py
:Debugging session with dark theme
The text was updated successfully, but these errors were encountered: