Skip to content
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

cq.vis.show improvements #1726

Merged
merged 25 commits into from
Dec 18, 2024
Merged

cq.vis.show improvements #1726

merged 25 commits into from
Dec 18, 2024

Conversation

adam-urbanczyk
Copy link
Member

@adam-urbanczyk adam-urbanczyk commented Dec 6, 2024

  • Handle vtkProp
  • specular
  • tests
  • mention show in docs
  • non-blocking show

afbeelding

@adam-urbanczyk adam-urbanczyk mentioned this pull request Dec 6, 2024
6 tasks
Copy link

codecov bot commented Dec 6, 2024

Codecov Report

Attention: Patch coverage is 96.66667% with 1 line in your changes missing coverage. Please review.

Project coverage is 95.32%. Comparing base (2726421) to head (76c2c68).
Report is 2 commits behind head on master.

Files with missing lines Patch % Lines
cadquery/vis.py 96.66% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1726      +/-   ##
==========================================
- Coverage   95.33%   95.32%   -0.01%     
==========================================
  Files          27       27              
  Lines        6774     6788      +14     
  Branches     1010     1013       +3     
==========================================
+ Hits         6458     6471      +13     
  Misses        193      193              
- Partials      123      124       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@adam-urbanczyk adam-urbanczyk marked this pull request as draft December 8, 2024 20:26
@adam-urbanczyk
Copy link
Member Author

afbeelding

@adam-urbanczyk
Copy link
Member Author

@lorenzncode @jmwright would you be able to test this locally? Specifically, if non-blocking show does work for you?

@lorenzncode
Copy link
Member

I created a new conda env from the cadquery environment.yml.

My first try failed with:

ImportError: Cannot load either PyQt or PySide

I installed pyqt:

mamba install pyqt

Second try failed with:

(cqshow) [lorenzn@fedora tmp]$ python test1.py
QWidget: Must construct a QApplication before a QWidget
Aborted (core dumped)
#0  __pthread_kill_implementation (threadid=, signo=signo@entry=6, no_tid=no_tid@entry=0) at pthread_kill.c:44
#1  0x00007fbfc79d6913 in __pthread_kill_internal (signo=6, threadid=) at pthread_kill.c:78
#2  0x00007fbfc79848ee in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
#3  0x00007fbfc796c8ff in __GI_abort () at abort.c:79
#4  0x00007fbf15a99ad1 in QMessageLogger::fatal(char const*, ...) const () from /home/lorenzn/tools/miniforge_241208/envs/cqshow/lib/python3.12/site-packages/PyQt5/../../../libQt5Core.so.5
#5  0x00007fbf12565442 in ?? () from /home/lorenzn/tools/miniforge_241208/envs/cqshow/lib/python3.12/site-packages/PyQt5/../../../libQt5Widgets.so.5
#6  0x00007fbf126b7390 in QMainWindow::QMainWindow(QWidget*, QFlags) ()
   from /home/lorenzn/tools/miniforge_241208/envs/cqshow/lib/python3.12/site-packages/PyQt5/../../../libQt5Widgets.so.5
#7  0x00007fbf12e3b119 in sipQMainWindow::sipQMainWindow(QWidget*, QFlags) () from /home/lorenzn/tools/miniforge_241208/envs/cqshow/lib/python3.12/site-packages/PyQt5/QtWidgets.abi3.so
#8  0x00007fbf12e3b204 in init_type_QMainWindow () from /home/lorenzn/tools/miniforge_241208/envs/cqshow/lib/python3.12/site-packages/PyQt5/QtWidgets.abi3.so
#9  0x00007fbf16f8a7b9 in sipSimpleWrapper_init () from /home/lorenzn/tools/miniforge_241208/envs/cqshow/lib/python3.12/site-packages/PyQt5/sip.cpython-312-x86_64-linux-gnu.so
#10 0x0000558438201a5c in type_call (kwds=0x0, args=0x55843863bee8 <_PyRuntime+76264>, type=) at /usr/local/src/conda/python-3.12.0/Objects/typeobject.c:1673
#11 _PyObject_MakeTpCall (tstate=0x558438699850 <_PyRuntime+459600>, callable=0x5584460c1640, args=, nargs=, keywords=0x0)
    at /usr/local/src/conda/python-3.12.0/Objects/call.c:240
#12 0x00005584381061f3 in _PyEval_EvalFrameDefault (tstate=, frame=0x7fbfc7c30090, throwflag=) at Python/bytecodes.c:2711
#13 0x00005584382cb55e in PyEval_EvalCode (co=co@entry=0x7fbfc786e130, globals=globals@entry=0x7fbfc7935b80, locals=locals@entry=0x7fbfc7935b80) at /usr/local/src/conda/python-3.12.0/Python/ceval.c:570
#14 0x00005584382ef01a in run_eval_code_obj (tstate=tstate@entry=0x558438699850 <_PyRuntime+459600>, co=co@entry=0x7fbfc786e130, globals=globals@entry=0x7fbfc7935b80,
    locals=locals@entry=0x7fbfc7935b80) at /usr/local/src/conda/python-3.12.0/Python/pythonrun.c:1693
#15 0x00005584382ea1bb in run_mod (mod=mod@entry=0x558440c06b98, filename=filename@entry=0x7fbfba0e9d40, globals=globals@entry=0x7fbfc7935b80, locals=locals@entry=0x7fbfc7935b80,
    flags=flags@entry=0x7ffd9d3cf238, arena=arena@entry=0x7fbfc7857c70) at /usr/local/src/conda/python-3.12.0/Python/pythonrun.c:1714
#16 0x0000558438300b20 in pyrun_file (fp=fp@entry=0x558440bacf40, filename=filename@entry=0x7fbfba0e9d40, start=start@entry=257, globals=globals@entry=0x7fbfc7935b80,
    locals=locals@entry=0x7fbfc7935b80, closeit=closeit@entry=1, flags=0x7ffd9d3cf238) at /usr/local/src/conda/python-3.12.0/Python/pythonrun.c:1614
#17 0x000055843830021e in _PyRun_SimpleFileObject (fp=0x558440bacf40, filename=0x7fbfba0e9d40, closeit=1, flags=0x7ffd9d3cf238) at /usr/local/src/conda/python-3.12.0/Python/pythonrun.c:433
#18 0x00005584382fff34 in _PyRun_AnyFileObject (fp=0x558440bacf40, filename=filename@entry=0x7fbfba0e9d40, closeit=closeit@entry=1, flags=flags@entry=0x7ffd9d3cf238)
    at /usr/local/src/conda/python-3.12.0/Python/pythonrun.c:78
#19 0x00005584382f9fa8 in pymain_run_file_obj (skip_source_first_line=0, filename=0x7fbfba0e9d40, program_name=0x7fbfc7938690) at /usr/local/src/conda/python-3.12.0/Modules/main.c:360
#20 pymain_run_file (config=0x55843863c450 <_PyRuntime+77648>) at /usr/local/src/conda/python-3.12.0/Modules/main.c:379
#21 pymain_run_python (exitcode=0x7ffd9d3cf234) at /usr/local/src/conda/python-3.12.0/Modules/main.c:610
#22 Py_RunMain () at /usr/local/src/conda/python-3.12.0/Modules/main.c:689
#23 0x00005584382b5c37 in Py_BytesMain (argc=, argv=) at /usr/local/src/conda/python-3.12.0/Modules/main.c:743
#24 0x00007fbfc796e14a in __libc_start_call_main (main=main@entry=0x5584382b5b70 , argc=argc@entry=2, argv=argv@entry=0x7ffd9d3cf498) at ../sysdeps/nptl/libc_start_call_main.h:58
#25 0x00007fbfc796e20b in __libc_start_main_impl (main=0x5584382b5b70 , argc=2, argv=0x7ffd9d3cf498, init=, fini=, rtld_fini=,
    stack_end=0x7ffd9d3cf488) at ../csu/libc-start.c:360
#26 0x00005584382b5ab5 in _start ()

mamba info

(cqshow) [lorenzn@fedora tmp]$ mamba info
      mamba version : 1.5.9
 active environment : cqshow
active env location : /home/lorenzn/tools/miniforge_241208/envs/cqshow
        shell level : 2
   user config file : /home/lorenzn/.condarc

populated config files : /home/lorenzn/tools/miniforge_241208/.condarc
/home/lorenzn/.condarc
conda version : 24.9.2
conda-build version : not installed
python version : 3.12.7.final.0
solver : libmamba (default)
virtual packages : __archspec=1=zen2
__conda=24.9.2=0
__glibc=2.38=0
__linux=6.11.9=0
__unix=0=0
base environment : /home/lorenzn/tools/miniforge_241208 (writable)
conda av data dir : /home/lorenzn/tools/miniforge_241208/etc/conda
conda av metadata url : None
channel URLs : https://conda.anaconda.org/conda-forge/linux-64
https://conda.anaconda.org/conda-forge/noarch
https://conda.anaconda.org/nodefaults/linux-64
https://conda.anaconda.org/nodefaults/noarch
package cache : /home/lorenzn/tools/miniforge_241208/pkgs
/home/lorenzn/.conda/pkgs
envs directories : /home/lorenzn/tools/miniforge_241208/envs
/home/lorenzn/.conda/envs
platform : linux-64
user-agent : conda/24.9.2 requests/2.32.3 CPython/3.12.7 Linux/6.11.9-100.fc39.x86_64 fedora/39 glibc/2.38 solver/libmamba conda-libmamba-solver/24.9.0 libmambapy/1.5.9
UID:GID : 1000:1000
netrc file : None
offline mode : False

mamba list

# packages in environment at /home/lorenzn/tools/miniforge_241208/envs/cqshow:
#
# Name                    Version                   Build  Channel
_libgcc_mutex             0.1                 conda_forge    conda-forge
_openmp_mutex             4.5                       2_gnu    conda-forge
_x86_64-microarch-level   3                        2_zen2    conda-forge
aiohappyeyeballs          2.4.4              pyhd8ed1ab_1    conda-forge
aiohttp                   3.11.9          py312h178313f_0    conda-forge
aiosignal                 1.3.1              pyhd8ed1ab_1    conda-forge
alabaster                 0.7.16             pyhd8ed1ab_0    conda-forge
alsa-lib                  1.2.13               hb9d3cd8_0    conda-forge
ampl-asl                  1.0.0                h5888daf_2    conda-forge
aom                       3.9.1                hac33072_0    conda-forge
appdirs                   1.4.4              pyh9f0ad1d_0    conda-forge
asttokens                 3.0.0              pyhd8ed1ab_1    conda-forge
attr                      2.5.1                h166bdaf_1    conda-forge
attrs                     24.2.0             pyh71513ae_1    conda-forge
babel                     2.16.0             pyhd8ed1ab_1    conda-forge
black                     0.1.dev631+gef9d467          pypi_0    pypi
blosc                     1.21.6               hef167b5_0    conda-forge
brotli                    1.1.0                hb9d3cd8_2    conda-forge
brotli-bin                1.1.0                hb9d3cd8_2    conda-forge
brotli-python             1.1.0           py312h2ec8cdc_2    conda-forge
bzip2                     1.0.8                h4bc722e_7    conda-forge
c-ares                    1.34.3               hb9d3cd8_1    conda-forge
ca-certificates           2024.8.30            hbcca054_0    conda-forge
cadquery                  2.5.0.dev0                dev_0    
cairo                     1.18.0               h3faef2a_0    conda-forge
casadi                    3.6.7           py312h0385bb2_0    conda-forge
certifi                   2024.8.30          pyhd8ed1ab_0    conda-forge
cffi                      1.17.1          py312h06ac9bb_0    conda-forge
charset-normalizer        3.4.0              pyhd8ed1ab_1    conda-forge
click                     8.1.7           unix_pyh707e725_1    conda-forge
codecov                   2.1.13             pyhd8ed1ab_0    conda-forge
colorama                  0.4.6              pyhd8ed1ab_1    conda-forge
coverage                  7.6.9           py312h178313f_0    conda-forge
dav1d                     1.2.1                hd590300_0    conda-forge
dbus                      1.13.6               h5008d03_3    conda-forge
decorator                 5.1.1              pyhd8ed1ab_1    conda-forge
docutils                  0.17.1          py312h7900ff3_6    conda-forge
double-conversion         3.3.0                h59595ed_0    conda-forge
eigen                     3.4.0                h00ab1b0_0    conda-forge
exceptiongroup            1.2.2              pyhd8ed1ab_1    conda-forge
executing                 2.1.0              pyhd8ed1ab_1    conda-forge
expat                     2.5.0                hcb278e6_1    conda-forge
ezdxf                     1.3.0           py312h3eaf749_0    conda-forge
ffmpeg                    6.1.1           gpl_h853fe30_113    conda-forge
font-ttf-dejavu-sans-mono 2.37                 hab24e00_0    conda-forge
font-ttf-inconsolata      3.000                h77eed37_0    conda-forge
font-ttf-source-code-pro  2.038                h77eed37_0    conda-forge
font-ttf-ubuntu           0.83                 h77eed37_3    conda-forge
fontconfig                2.14.2               h14ed4e7_0    conda-forge
fonts-conda-ecosystem     1                             0    conda-forge
fonts-conda-forge         1                             0    conda-forge
fonttools                 4.55.2          py312h178313f_0    conda-forge
freeimage                 3.18.0              h3a85593_22    conda-forge
freetype                  2.12.1               h267a509_2    conda-forge
fribidi                   1.0.10               h36c2ea0_0    conda-forge
frozenlist                1.5.0           py312h66e93f0_0    conda-forge
gettext                   0.22.5               he02047a_3    conda-forge
gettext-tools             0.22.5               he02047a_3    conda-forge
gl2ps                     1.4.2                hae5d5c5_1    conda-forge
glew                      2.1.0                h9c3ff4c_2    conda-forge
glib                      2.82.2               h44428e9_0    conda-forge
glib-tools                2.82.2               h4833e2c_0    conda-forge
gmp                       6.3.0                hac33072_2    conda-forge
gnutls                    3.7.9                hb077bed_0    conda-forge
graphite2                 1.3.13            h59595ed_1003    conda-forge
gst-plugins-base          1.22.9               h8e1006c_0    conda-forge
gstreamer                 1.22.9               h98fc4e7_0    conda-forge
h2                        4.1.0              pyhd8ed1ab_1    conda-forge
harfbuzz                  8.5.0                hfac3d4d_0    conda-forge
hdf4                      4.2.15               h2a13503_7    conda-forge
hdf5                      1.14.3          nompi_h2d575fe_108    conda-forge
hpack                     4.0.0              pyhd8ed1ab_1    conda-forge
hyperframe                6.0.1              pyhd8ed1ab_1    conda-forge
icu                       73.2                 h59595ed_0    conda-forge
idna                      3.10               pyhd8ed1ab_1    conda-forge
imagesize                 1.4.1              pyhd8ed1ab_0    conda-forge
imath                     3.1.12               h7955e40_0    conda-forge
importlib-metadata        8.5.0              pyha770c72_1    conda-forge
iniconfig                 2.0.0              pyhd8ed1ab_1    conda-forge
ipopt                     3.14.16             h59d4785_11    conda-forge
ipython                   8.30.0             pyh707e725_0    conda-forge
jedi                      0.19.2             pyhd8ed1ab_1    conda-forge
jinja2                    3.1.4              pyhd8ed1ab_1    conda-forge
jsoncpp                   1.9.5                h4bd325d_1    conda-forge
jxrlib                    1.1                  hd590300_3    conda-forge
keyutils                  1.6.1                h166bdaf_0    conda-forge
krb5                      1.21.3               h659f571_0    conda-forge
lame                      3.100             h166bdaf_1003    conda-forge
lcms2                     2.16                 hb7c19ff_0    conda-forge
ld_impl_linux-64          2.43                 h712a8e2_2    conda-forge
lerc                      4.0.0                h27087fc_0    conda-forge
libabseil                 20240116.2      cxx17_he02047a_1    conda-forge
libaec                    1.1.3                h59595ed_0    conda-forge
libasprintf               0.22.5               he8f35ee_3    conda-forge
libasprintf-devel         0.22.5               he8f35ee_3    conda-forge
libass                    0.17.1               h8fe9dca_1    conda-forge
libblas                   3.9.0           25_linux64_openblas    conda-forge
libblasfeo                0.1.3              had105d5_303    conda-forge
libbrotlicommon           1.1.0                hb9d3cd8_2    conda-forge
libbrotlidec              1.1.0                hb9d3cd8_2    conda-forge
libbrotlienc              1.1.0                hb9d3cd8_2    conda-forge
libcap                    2.71                 h39aace5_0    conda-forge
libcblas                  3.9.0           25_linux64_openblas    conda-forge
libclang                  15.0.7          default_h127d8a8_5    conda-forge
libclang13                15.0.7          default_h5d6823c_5    conda-forge
libcups                   2.3.3                h4637d8d_4    conda-forge
libcurl                   8.10.1               hbbe4b11_0    conda-forge
libdeflate                1.22                 hb9d3cd8_0    conda-forge
libdrm                    2.4.124              hb9d3cd8_0    conda-forge
libedit                   3.1.20191231         he28a2e2_2    conda-forge
libev                     4.33                 hd590300_2    conda-forge
libevent                  2.1.12               hf998b51_1    conda-forge
libexpat                  2.5.0                hcb278e6_1    conda-forge
libfatrop                 0.0.4                h5888daf_0    conda-forge
libffi                    3.4.2                h7f98852_5    conda-forge
libflac                   1.4.3                h59595ed_0    conda-forge
libgcc                    14.2.0               h77fa898_1    conda-forge
libgcc-ng                 14.2.0               h69a702a_1    conda-forge
libgcrypt-lib             1.11.0               hb9d3cd8_2    conda-forge
libgettextpo              0.22.5               he02047a_3    conda-forge
libgettextpo-devel        0.22.5               he02047a_3    conda-forge
libgfortran               14.2.0               h69a702a_1    conda-forge
libgfortran-ng            14.2.0               h69a702a_1    conda-forge
libgfortran5              14.2.0               hd5240d6_1    conda-forge
libglib                   2.82.2               h2ff4ddf_0    conda-forge
libglu                    9.0.0             hac7e632_1003    conda-forge
libgomp                   14.2.0               h77fa898_1    conda-forge
libgpg-error              1.51                 hbd13f7d_1    conda-forge
libhwloc                  2.11.2          default_he43201b_1000    conda-forge
libiconv                  1.17                 hd590300_2    conda-forge
libidn2                   2.3.7                hd590300_0    conda-forge
libjpeg-turbo             3.0.0                hd590300_1    conda-forge
liblapack                 3.9.0           25_linux64_openblas    conda-forge
libllvm15                 15.0.7               hb3ce162_4    conda-forge
liblzma                   5.6.3                hb9d3cd8_1    conda-forge
liblzma-devel             5.6.3                hb9d3cd8_1    conda-forge
libnetcdf                 4.9.2           nompi_h135f659_114    conda-forge
libnghttp2                1.64.0               h161d5f1_0    conda-forge
libnsl                    2.0.1                hd590300_0    conda-forge
libogg                    1.3.5                h4ab18f5_0    conda-forge
libopenblas               0.3.28          pthreads_h94d23a6_1    conda-forge
libopenvino               2024.2.0             h2da1b83_1    conda-forge
libopenvino-auto-batch-plugin 2024.2.0             hb045406_1    conda-forge
libopenvino-auto-plugin   2024.2.0             hb045406_1    conda-forge
libopenvino-hetero-plugin 2024.2.0             h5c03a75_1    conda-forge
libopenvino-intel-cpu-plugin 2024.2.0             h2da1b83_1    conda-forge
libopenvino-intel-gpu-plugin 2024.2.0             h2da1b83_1    conda-forge
libopenvino-intel-npu-plugin 2024.2.0             he02047a_1    conda-forge
libopenvino-ir-frontend   2024.2.0             h5c03a75_1    conda-forge
libopenvino-onnx-frontend 2024.2.0             h07e8aee_1    conda-forge
libopenvino-paddle-frontend 2024.2.0             h07e8aee_1    conda-forge
libopenvino-pytorch-frontend 2024.2.0             he02047a_1    conda-forge
libopenvino-tensorflow-frontend 2024.2.0             h39126c6_1    conda-forge
libopenvino-tensorflow-lite-frontend 2024.2.0             he02047a_1    conda-forge
libopus                   1.3.1                h7f98852_1    conda-forge
libosqp                   0.6.3                h5888daf_1    conda-forge
libpciaccess              0.18                 hd590300_0    conda-forge
libpng                    1.6.44               hadc24fc_0    conda-forge
libpq                     16.6                 h035377e_1    conda-forge
libprotobuf               4.25.3               hd5b35b9_1    conda-forge
libqdldl                  0.1.7                hcb278e6_0    conda-forge
libraw                    0.21.3               hca62329_0    conda-forge
libscotch                 7.0.4                h2fe6a88_5    conda-forge
libsndfile                1.2.2                hc60ed4a_1    conda-forge
libspral                  2024.05.08           h2b245be_4    conda-forge
libsqlite                 3.47.0               hadc24fc_1    conda-forge
libssh2                   1.11.1               hf672d98_0    conda-forge
libstdcxx                 14.2.0               hc0a3c3a_1    conda-forge
libstdcxx-ng              14.2.0               h4852527_1    conda-forge
libsystemd0               256.9                h2774228_0    conda-forge
libtasn1                  4.19.0               h166bdaf_0    conda-forge
libtheora                 1.1.1             h4ab18f5_1006    conda-forge
libtiff                   4.7.0                hc4654cb_2    conda-forge
libunistring              0.9.10               h7f98852_0    conda-forge
libuuid                   2.38.1               h0b41bf4_0    conda-forge
libva                     2.21.0               h4ab18f5_2    conda-forge
libvorbis                 1.3.7                h9c3ff4c_0    conda-forge
libvpx                    1.14.1               hac33072_0    conda-forge
libwebp-base              1.4.0                hd590300_0    conda-forge
libxcb                    1.15                 h0b41bf4_0    conda-forge
libxkbcommon              1.7.0                h662e7e4_0    conda-forge
libxml2                   2.12.7               h4c95cb1_3    conda-forge
libzip                    1.11.2               h6991a6a_0    conda-forge
libzlib                   1.3.1                hb9d3cd8_2    conda-forge
loguru                    0.7.2           py312h7900ff3_2    conda-forge
lz4-c                     1.9.4                hcb278e6_0    conda-forge
markupsafe                3.0.2           py312h178313f_1    conda-forge
matplotlib-inline         0.1.7              pyhd8ed1ab_1    conda-forge
metis                     5.1.0             hd0bcaf9_1007    conda-forge
mpg123                    1.32.9               hc50e24c_0    conda-forge
msgpack-python            1.1.0           py312h68727a3_0    conda-forge
multidict                 6.1.0           py312h178313f_1    conda-forge
multimethod               1.12               pyhd8ed1ab_0    conda-forge
mumps-include             5.7.3                ha770c72_5    conda-forge
mumps-seq                 5.7.3                h27a6a8b_0    conda-forge
munkres                   1.1.4              pyh9f0ad1d_0    conda-forge
mypy                      1.13.0          py312h66e93f0_0    conda-forge
mypy_extensions           1.0.0              pyha770c72_1    conda-forge
mysql-common              8.0.33               hf1915f5_6    conda-forge
mysql-libs                8.0.33               hca2cd23_6    conda-forge
ncurses                   6.5                  he02047a_1    conda-forge
nettle                    3.9.1                h7ab15ed_0    conda-forge
nlohmann_json             3.11.3               he02047a_1    conda-forge
nlopt                     2.9.0           py312h1d0b465_0    conda-forge
nspr                      4.36                 h5888daf_0    conda-forge
nss                       3.107                hdf54f9c_0    conda-forge
numpy                     1.26.4          py312heda63a1_0    conda-forge
occt                      7.7.2           all_h4c9f3c6_201    conda-forge
ocl-icd                   2.3.2                hb9d3cd8_2    conda-forge
ocp                       7.7.2.1         py312h4aa6242_0    conda-forge
opencl-headers            2024.10.24           h5888daf_0    conda-forge
openexr                   3.3.2                hccdc605_0    conda-forge
openh264                  2.4.1                h59595ed_0    conda-forge
openjpeg                  2.5.2                h488ebb8_0    conda-forge
openssl                   3.4.0                hb9d3cd8_0    conda-forge
p11-kit                   0.24.1               hc5aa10d_0    conda-forge
packaging                 24.2               pyhd8ed1ab_2    conda-forge
parso                     0.8.4              pyhd8ed1ab_1    conda-forge
path                      17.0.0          py312h7900ff3_0    conda-forge
pathspec                  0.12.1             pyhd8ed1ab_1    conda-forge
pcre2                     10.44                hba22ea6_2    conda-forge
pexpect                   4.9.0              pyhd8ed1ab_1    conda-forge
pickleshare               0.7.5           pyhd8ed1ab_1004    conda-forge
pip                       24.3.1             pyh8b19718_0    conda-forge
pixman                    0.43.2               h59595ed_0    conda-forge
pluggy                    1.5.0              pyhd8ed1ab_1    conda-forge
ply                       3.11               pyhd8ed1ab_3    conda-forge
proj                      9.3.1                h1d62c97_0    conda-forge
prompt-toolkit            3.0.48             pyha770c72_1    conda-forge
propcache                 0.2.1           py312h66e93f0_0    conda-forge
proxsuite                 0.6.7           py312h68727a3_2    conda-forge
psutil                    6.1.0           py312h66e93f0_0    conda-forge
pthread-stubs             0.4               hb9d3cd8_1002    conda-forge
ptyprocess                0.7.0              pyhd8ed1ab_1    conda-forge
pugixml                   1.14                 h59595ed_0    conda-forge
pulseaudio-client         16.1                 hb77b528_5    conda-forge
pure_eval                 0.2.3              pyhd8ed1ab_1    conda-forge
pybind11-abi              4                    hd8ed1ab_3    conda-forge
pycparser                 2.22               pyh29332c3_1    conda-forge
pygments                  2.18.0             pyhd8ed1ab_1    conda-forge
pyparsing                 3.2.0              pyhd8ed1ab_2    conda-forge
pyqt                      5.15.9          py312h949fe66_5    conda-forge
pyqt5-sip                 12.12.2         py312h30efb56_5    conda-forge
pysocks                   1.7.1              pyha55dd90_7    conda-forge
pytest                    8.3.4              pyhd8ed1ab_1    conda-forge
pytest-cov                6.0.0              pyhd8ed1ab_1    conda-forge
python                    3.12.0          hab00c5b_0_cpython    conda-forge
python_abi                3.12                    5_cp312    conda-forge
pytz                      2024.2             pyhd8ed1ab_1    conda-forge
qt-main                   5.15.8              h5810be5_19    conda-forge
rapidjson                 1.1.0.post20240409      hac33072_1    conda-forge
readline                  8.2                  h8228510_1    conda-forge
regex                     2024.11.6       py312h66e93f0_0    conda-forge
requests                  2.32.3             pyhd8ed1ab_1    conda-forge
scipy                     1.14.1          py312h62794b6_2    conda-forge
setuptools                75.6.0             pyhff2d567_1    conda-forge
simde                     0.8.2                h84d6215_0    conda-forge
sip                       6.7.12          py312h30efb56_0    conda-forge
snappy                    1.2.1                h8bd8927_1    conda-forge
snowballstemmer           2.2.0              pyhd8ed1ab_0    conda-forge
sphinx                    5.0.1              pyh6c4a22f_0    conda-forge
sphinx_rtd_theme          2.0.0              pyha770c72_0    conda-forge
sphinxcontrib-applehelp   2.0.0              pyhd8ed1ab_0    conda-forge
sphinxcontrib-devhelp     2.0.0              pyhd8ed1ab_0    conda-forge
sphinxcontrib-htmlhelp    2.1.0              pyhd8ed1ab_0    conda-forge
sphinxcontrib-jquery      4.1                pyhd8ed1ab_0    conda-forge
sphinxcontrib-jsmath      1.0.1              pyhd8ed1ab_0    conda-forge
sphinxcontrib-qthelp      2.0.0              pyhd8ed1ab_0    conda-forge
sphinxcontrib-serializinghtml 1.1.10             pyhd8ed1ab_0    conda-forge
sqlite                    3.47.0               h9eae976_1    conda-forge
stack_data                0.6.3              pyhd8ed1ab_1    conda-forge
svt-av1                   2.1.0                hac33072_0    conda-forge
tbb                       2022.0.0             hceb3a55_0    conda-forge
tbb-devel                 2022.0.0             h1f99690_0    conda-forge
tinyxml2                  10.0.0               h59595ed_0    conda-forge
tk                        8.6.13          noxft_h4845f30_101    conda-forge
toml                      0.10.2             pyhd8ed1ab_0    conda-forge
tomli                     2.2.1              pyhd8ed1ab_1    conda-forge
traitlets                 5.14.3             pyhd8ed1ab_1    conda-forge
typed-ast                 1.5.5           py312h98912ed_1    conda-forge
typing_extensions         4.12.2             pyha770c72_1    conda-forge
typish                    1.9.3              pyhd8ed1ab_0    conda-forge
tzdata                    2024b                hc8b5060_0    conda-forge
unicodedata2              15.1.0          py312h66e93f0_1    conda-forge
urllib3                   2.2.3              pyhd8ed1ab_1    conda-forge
utfcpp                    4.0.6                h005c6e1_0    conda-forge
vtk                       9.2.6           qt_py312h1234567_223    conda-forge
vtk-base                  9.2.6           qt_py312h1234567_223    conda-forge
vtk-io-ffmpeg             9.2.6           qt_py312h1234567_223    conda-forge
wcwidth                   0.2.13             pyhd8ed1ab_1    conda-forge
wheel                     0.45.1             pyhd8ed1ab_1    conda-forge
wslink                    2.2.1              pyhd8ed1ab_1    conda-forge
x264                      1!164.3095           h166bdaf_2    conda-forge
x265                      3.5                  h924138e_3    conda-forge
xcb-util                  0.4.0                hd590300_1    conda-forge
xcb-util-image            0.4.0                h8ee46fc_1    conda-forge
xcb-util-keysyms          0.4.0                h8ee46fc_1    conda-forge
xcb-util-renderutil       0.3.9                hd590300_1    conda-forge
xcb-util-wm               0.4.1                h8ee46fc_1    conda-forge
xkeyboard-config          2.42                 h4ab18f5_0    conda-forge
xorg-fixesproto           5.0               hb9d3cd8_1003    conda-forge
xorg-kbproto              1.0.7             hb9d3cd8_1003    conda-forge
xorg-libice               1.1.1                hb9d3cd8_1    conda-forge
xorg-libsm                1.2.4                he73a12e_1    conda-forge
xorg-libx11               1.8.9                h8ee46fc_0    conda-forge
xorg-libxau               1.0.11               hb9d3cd8_1    conda-forge
xorg-libxdmcp             1.1.5                hb9d3cd8_0    conda-forge
xorg-libxext              1.3.4                h0b41bf4_2    conda-forge
xorg-libxfixes            5.0.3             h7f98852_1004    conda-forge
xorg-libxrender           0.9.11               hd590300_0    conda-forge
xorg-libxt                1.3.0                hd590300_1    conda-forge
xorg-renderproto          0.11.1            hb9d3cd8_1003    conda-forge
xorg-xextproto            7.3.0             hb9d3cd8_1004    conda-forge
xorg-xf86vidmodeproto     2.3.1             hb9d3cd8_1005    conda-forge
xorg-xproto               7.0.31            hb9d3cd8_1008    conda-forge
xz                        5.6.3                hbcc6ac9_1    conda-forge
xz-gpl-tools              5.6.3                hbcc6ac9_1    conda-forge
xz-tools                  5.6.3                hb9d3cd8_1    conda-forge
yarl                      1.18.3          py312h66e93f0_0    conda-forge
zipp                      3.21.0             pyhd8ed1ab_1    conda-forge
zlib                      1.3.1                hb9d3cd8_2    conda-forge
zstandard                 0.23.0          py312hef9b889_1    conda-forge
zstd                      1.5.6                ha6fb4c9_0    conda-forge

@adam-urbanczyk
Copy link
Member Author

adam-urbanczyk commented Dec 9, 2024

Thanks @lorenzncode ! Could you try also with ipython for completeness? I will put this functionality anyway behind a switch.

@jmwright
Copy link
Member

jmwright commented Dec 9, 2024

ImportError: Cannot load either PyQt or PySide
QWidget: Must construct a QApplication before a QWidget
Aborted (core dumped)

My pip environment has this same problem with both PySide2 and PyQt5.

pip install pyside2

...or...

pip install PyQt5

@lorenzncode
Copy link
Member

It seems to also fail with ipython.

I tried constructing a QApplication. This is an experiment - it worked in my env.:

lorenzncode@4e9b227

@adam-urbanczyk
Copy link
Member Author

It seems to also fail with ipython.

I tried constructing a QApplication. This is an experiment - it worked in my env.:

lorenzncode@4e9b227

And after running %gui qt?

@adam-urbanczyk
Copy link
Member Author

Alright, I moved the interactive part to another branch/PR. It does not look like a good last-minute feature just before the release.

@lorenzncode
Copy link
Member

And after running %gui qt?

OK now there is no error.

Using %load a single window remains open with the sphere, the window with box is closed.

In [6]: # %load test2.py
   ...:
   ...: from cadquery.vis import show
   ...: from cadquery.occ_impl.shapes import *
   ...:
   ...:
   ...: o1 = box(1, 1, 1)
   ...: o2 = sphere(1)
   ...:
   ...: show(o1)
   ...: show(o2)
   ...:
Out[6]: <PyQt5.QtWidgets.QMainWindow at 0x7f1674cc5130>

With %run test2.py the windows appear but then immediately close.

@adam-urbanczyk
Copy link
Member Author

adam-urbanczyk commented Dec 12, 2024

Thanks again for checking! This only confirms that this particular functionality requires more thought. For now I'll try to address the other points and let's handle this thing after 2.5 in #1727

@adam-urbanczyk adam-urbanczyk marked this pull request as ready for review December 15, 2024 14:05
@adam-urbanczyk adam-urbanczyk added this to the 2.5 milestone Dec 15, 2024
@jmwright
Copy link
Member

@adam-urbanczyk I see that you pushed additional commits. Is this ready for review?

@adam-urbanczyk
Copy link
Member Author

Yes, ready. Those were unrelated ci fixes

Copy link
Member

@jmwright jmwright left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @adam-urbanczyk there are some cool additions here!

doc/primer.rst Outdated Show resolved Hide resolved
doc/primer.rst Outdated Show resolved Hide resolved
doc/primer.rst Outdated Show resolved Hide resolved
doc/vis.rst Outdated Show resolved Hide resolved
doc/vis.rst Outdated Show resolved Hide resolved
doc/vis.rst Outdated Show resolved Hide resolved
doc/vis.rst Outdated Show resolved Hide resolved
cadquery/vis.py Outdated Show resolved Hide resolved
@adam-urbanczyk
Copy link
Member Author

Alright, are you OK with merging?

@jmwright
Copy link
Member

+1 to merge

@adam-urbanczyk adam-urbanczyk merged commit 6b3b14a into master Dec 18, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants