Add GUI elements to fig.Figure#1943
Conversation
|
@lorenzncode this is by far not finished, but I remember you were interested in this. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1943 +/- ##
==========================================
+ Coverage 95.96% 96.40% +0.43%
==========================================
Files 29 29
Lines 7857 9837 +1980
Branches 1174 1558 +384
==========================================
+ Hits 7540 9483 +1943
- Misses 183 212 +29
- Partials 134 142 +8 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
At the moment this is still meant for dogfooding. |
|
@adam-urbanczyk Does this feature only work in Windows? I see that the |
|
Only win CI works out of the box with UI AFAIK and I don't want to maintain something like CQ-editor has/had. The feature as such should work on all systems. What kind of errors are we talking about? |
|
@adam-urbanczyk Here is the error I get. Maybe I'm not setting things up correctly? $ python
Python 3.13.5 (main, Jun 25 2025, 18:55:22) [GCC 14.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from cadquery.fig import Figure
>>> fig = Figure()
Traceback (most recent call last):
File "<python-input-1>", line 1, in <module>
fig = Figure()
File "/home/jwright/repos/cadquery/cadquery/fig.py", line 196, in __init__
self.view = vtk_widgets.VtkRemoteView(
~~~~~~~~~~~~~~~~~~~~~~~~~^
win, interactive_ratio=1, interactive_quality=100
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
)
^
File "/home/jwright/venvs/cq-fig/lib/python3.13/site-packages/trame_vtk/widgets/vtk/common.py", line 690, in __init__
self._helper.has_capabilities("web", "rendering")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'has_capabilities' |
|
@jmwright It is working for me locally. I tried with both python 3.12 and 3.13. I'm currently experimenting with pixi but expect same with conda/mamba.
|
|
I installed via |
|
Thanks @lorenzncode , I think I fixed it. @jmwright could you list what ends up in your env? |
Yes, confirmed! |
|
@adam-urbanczyk Here's the $ pip list
Package Version Editable project location
----------------------- ------------- ----------------------------
aiohappyeyeballs 2.6.1
aiohttp 3.13.3
aiosignal 1.4.0
asttokens 3.0.1
attrs 25.4.0
cadquery 2.7.dev0 /home/jwright/repos/cadquery
cadquery-ocp 7.8.1.1.post1
cadquery_vtk 9.3.1
casadi 3.7.2
decorator 5.2.1
docutils 0.22.4
executing 2.2.1
ezdxf 1.4.3
fonttools 4.61.1
frozenlist 1.8.0
idna 3.11
iniconfig 2.3.0
ipython 9.9.0
ipython_pygments_lexers 1.1.1
jedi 0.19.2
matplotlib-inline 0.2.1
more-itertools 10.8.0
msgpack 1.1.2
multidict 6.7.1
multimethod 1.12
nlopt 2.10.0
numpy 2.4.1
packaging 26.0
parso 0.8.5
path 17.1.1
pexpect 4.9.0
pip 25.1.1
pluggy 1.6.0
prompt_toolkit 3.0.52
propcache 0.4.1
ptyprocess 0.7.0
pure_eval 0.2.3
Pygments 2.19.2
pyparsing 3.3.2
pytest 9.0.2
PyYAML 6.0.3
runtype 0.5.3
stack-data 0.6.3
traitlets 5.14.3
trame 3.12.0
trame-client 3.11.2
trame-common 1.1.1
trame-components 2.5.0
trame-server 3.10.0
trame-vtk 2.10.3
trame-vuetify 3.2.0
typing_extensions 4.15.0
wcwidth 0.5.2
wslink 2.5.0
yarl 1.22.0 |
|
@jmwright I'm mainly developing on Windows right now. With the following env everything is working fine. with python 3.13 and |
|
@adam-urbanczyk I'm fine with merging as-is. |
|
Thanks! Could you though shed some light on |
|
cadquery-vtk exists to add support for platforms and Python versions that the stock VTK package does not. Ideally, it would not exist, but older official VTK packages on PyPI do not get updated for newer Python versions. |
|
Is there a delta in the build configuration? Where can I actually see how it is built or open an issue? |
|
Background cadquery-vtk was an attempt to support Python 3.13 for OCP 7.8 on pypi.org. VTK wasn't available on pypi for Python 3.13 these days, hence I built a standard VTK package for it and we published it as cadquery_vtk for Python 3.13 only. And cadquery_ocp 7.8 for Python 3.13 relies on it. In the meantime, I don't think it was a too good idea, hence we did not build it anymore. OCCT's dependency on VTK restricts the Python and OS version support for cadquery_ocp on pypi to what VTK supports. Plus, at least for the pypi version, it forced users to use exactly the VTK version cadquery_ocp was built against, which could lead to conflicts. ocp-build-system builds cadquery_ocp in a vtk and a novtk version since OCP 7.8. But for OCP 7.9 we do not build cadquery_vtk for Python 3.14 any more, so the Python support for OCP 7.9 on pypi is:
Re:
I wouldn't spend time on it, see above. With OCP 7.9 it is not used any more. And cadquery_ocp (the vtk version) 7.9 has the same full OCCT bindings including IVTK as the conda version. If you are nevertheless interested: https://github.com/CadQuery/ocp-build-system/tree/5ab1918e870820915c2a253025712905c12f22f1 (it has been already deleted on master) How to avoid cadquery_vtk For cadquery_ocp 7.8.1.1.post1 use Python 3.12 or use cadquery_ocp 7.9.3.0 Hope that helps |


This PR adds a toolbar and minimal objects list to
fig.Figure: