Created attachment 264545 [details] diff file pythonocc provides 3D modeling and dataexchange features. It is intended to CAD/PDM/PLM/BIM development. The module is based on the OpenCascade Technology modeling kernel. Features -------- pythonocc provides the following features: * a full access from Python to almost all af the thousand OpenCascade C++ classes. Classes and methods/functions share the same names, and, as possible as it can be, the same signature * 3D visualization from the most famous Python Gui (tkinter, pyQt5 and 6, PySide2 and 6, wxPython) * 3D visualization in a web browser using threejs or x3dom frameworks * 3D visualization and work within a jupyter notebook * data exchange using most famous formats IGES/STEP/STL/PLY/OBJ/GLTF * Utility Python classes/methods for Topology operations, inertia computations,and more The port is tested under 16 current and 14.3 (Q3/Q4)
Created attachment 264546 [details] format-patch file
Comment on attachment 264546 [details] format-patch file Triage: either way of submitting is sufficient; we don't need both, thanks.
Created attachment 265035 [details] diff file
Small update for opencascade version 7.9.2 (It compiles for both 7.9.1 and 7.9.2) Tested and build with poudriere on 16 current and 14.3 realease (2025Q4)
Comment on attachment 265035 [details] diff file Need an update for SWIG dependency version 4.3.1 (was max 4.3.0)
Created attachment 265293 [details] Updated diff file Small update for SWIG (4.2.1...4.3.1) Tested and build with poudriere: -14.3 RELEASE (quarterly) -16 CURRENT
Created attachment 266291 [details] Updated diff file CMakeLists.txt updated for OpenCASCADE 7.9.3 Tested and build with poudriere: -14.3 RELEASE (quarterly) -15.0 RELEASE (quarterly) -16 CURRENT
Sorry for the delay! Meanwhile, OpenCascade 8.0.0 entered in the ports tree, and it seems that even the latest release of pythonocc-core does not support it, but there is a PR: https://github.com/tpaviot/pythonocc-core/pull/1493 Could you please upgrade your patch until a tagname including the corresponding commits? Some other remarks: - cmake is listed as a BUILD_DEPENDS, but also in USES; - python is hard-coded to 3.11, although 3.12 (the default) and more recent version are supported, and cython3 is now cython; - it is sufficient to list libTKernel.so in LIB_DEPENDS to get cad/opencascade, you could remove the other libs; - SWIG release is now 4.4.1, don't set a upper limit if not needed; - pkg-descr lists several visualization methods (tkinter, pyQt, PySide, etc.), but there is no corresponding dependencies in the Makefile: do you plan to add some options?
Hello Thierry Thomas, thank you for having a look at this! I was not aware of a PR concerning pythonocc-core for 8.0.0. So yes, I will work on an update for this. Thank you also for the other remarks. The situation of python is actually much better, I will work on the possibility to add flavors. "- pkg-descr lists several visualization methods (tkinter, pyQt, PySide, etc.), but there is no corresponding dependencies in the Makefile: do you plan to add some options?" No, if I remember there is only an option/possibility in the CMakeList.txt to disable completely the visualization, I do not think this make sense. Numpy is also a hard dependency despite the option in the CmakeList.txt
(In reply to Thierry Thomas from comment #8) I could adapt the patch, but it fails in the port tree. (it compiles outside the port tree) Make configure gives: --------------------------------------------------------------------- ... ... 104 warnings generated. [465/465] Linking target numpy/_core/_multiarray_umath.cpython-312.so [890/890] /usr/ports/math/py-numpy/work-py312/numpy-2.4.6/numpy/_core/tests/examples/limited_api/setup.py Successfully built numpy-2.4.6-cp312-cp312-freebsd_16_0_current_amd64.whl ===> Staging for py312-numpy-2.4.6_1,1 ===> py312-numpy-2.4.6_1,1 depends on executable: gfortran14 - found ===> py312-numpy-2.4.6_1,1 depends on file: /usr/local/bin/python3.12 - found ===> Generating temporary packing list /usr/bin/find /usr/ports/math/py-numpy/work-py312/stage/usr/local/lib/python3.12/site-packages -name '*.so' -exec /usr/local/bin/strip {} + /usr/bin/unzip -qo /usr/ports/distfiles/numpy-2.4/numpy-html.zip -d /usr/ports/math/py-numpy/work-py312/stage/usr/local/share/doc/py312-numpy ===> Creating unique files: Move MAN files needing SUFFIX ===> Creating unique files: Move files needing SUFFIX Move: bin/f2py --> bin/f2py-3.12 Link: @bin/f2py --> bin/f2py-3.12 Move: bin/numpy-config --> bin/numpy-config-3.12 Link: @bin/numpy-config --> bin/numpy-config-3.12 ====> Compressing man pages (compress-man) ====> Running Q/A tests (stage-qa) ===> Installing for py312-numpy-2.4.6_1,1 ===> Checking if py312-numpy is already installed ===> Registering installation for py312-numpy-2.4.6_1,1 as automatic Installing py312-numpy-2.4.6_1,1... ===> py312-pythonocc-core-8.0.0.a depends on executable: py312-numpy - not found *** Error code 1 ------------------------------------------------------------------------- Because it compiles outside the port tree, I suppose the error is in my Makefile. Also posted in the forum: https://forums.freebsd.org/threads/porting-pythonocc-core.98942/post-770524
Created attachment 273418 [details] actual stand
Thanks for your follow-up, but as I wrote previously I cannot see how the the visualization programs could be built, because there is no dependencies for them! pkg-descr announces 3D visualization from the most famous Python (tkinter, pyQt5 and 6, PySide2 and 6, wxPython), in a web browser and within a jupyter notebook Gui, but none of them is declared in the Makefile. Note: we prefer a file in format .diff to one in format .zip, and don't forget to run portlint - see https://docs.freebsd.org/en/books/porters-handbook/book/index.html
(In reply to Thierry Thomas from comment #12) The backend for the visualisation is choosen with this preference: PyQt5, PySide2, PyQt6, PySide6, wx And a fallback to tk (supposed to be installed on all plateform) when no previous packages are found. You are right, since tk is not part of the default python installation this will be a problem. I will investigate this (some backends have probably advantages over the others). My preference would be to set a default one and display a message after installation. Would this be acceptable? Concerning the opencascade version, now at 8.0.1 See also: https://forums.freebsd.org/threads/porting-pythonocc-core.98942/post-770624 I could create some patches according the migration notes from: https://github.com/Open-Cascade-SAS/OCCT/releases/tag/V8_0_0_p1 So the port compiles now with 8.0.1, but I am not able to go deeper in all the changes, so some advanced functions will probably fail. (I am not really happy with this situation)
Ideally it would be great to use flavors for the various back-ends, but we could just pick one to begin. ATM opencascade uses Qt5, therefore it is already installed and I would suggest to use it, even if next release could upgrade to Qt6.