diff --git a/cad/freecad/Makefile b/cad/freecad/Makefile index 3126f5d8e7a0..127e6707314c 100644 --- a/cad/freecad/Makefile +++ b/cad/freecad/Makefile @@ -1,137 +1,138 @@ PORTNAME= FreeCAD DISTVERSION= 1.1.1 +PORTREVISION= 1 CATEGORIES= cad MAINTAINER= cmt@FreeBSD.org COMMENT= General purpose 3D CAD modeller WWW= https://www.freecadweb.org/ LICENSE= LGPL20+ LICENSE_FILE= ${WRKSRC}/LICENSE CONFLICTS_INSTALL= freecad-devel # bin/FreeCAD BUILD_DEPENDS= doxygen:devel/doxygen \ pybind11-config:devel/py-pybind11@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}pyside6-tools>0:devel/pyside6-tools@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}pivy>0:graphics/py-pivy@${PY_FLAVOR} \ ${PYTHON_SITELIBDIR}/matplotlib/__init__.py:math/py-matplotlib@${PY_FLAVOR} \ microsoft-gsl>0:devel/microsoft-gsl \ googletest>0:devel/googletest \ swig:devel/swig # the ffmpeg4 dependency is inherited via cad/opencascade LIB_DEPENDS= libexpat.so:textproc/expat2 \ libyaml-cpp.so:devel/yaml-cpp \ libfreetype.so:print/freetype2 \ libtbb.so:devel/onetbb \ ${PY_BOOST} \ libpyside6.abi3.so:devel/pyside6@${PY_FLAVOR} \ libCoin.so:graphics/Coin \ libfmt.so:devel/libfmt \ libpng.so:graphics/png \ libtiff.so:graphics/tiff \ libvtksys-${VTK_VER}.so:math/vtk${VTK_VER:R} \ libTKernel.so:cad/opencascade \ libxerces-c.so:textproc/xerces-c3 \ libboost_thread.so:devel/boost-libs \ libfontconfig.so:x11-fonts/fontconfig \ libfreeimage.so:graphics/freeimage \ libavutil.so.60:multimedia/ffmpeg \ libavformat.so.58:multimedia/ffmpeg4 \ libmed.so:french/med \ libshiboken6.abi3.so:devel/shiboken6@${PY_FLAVOR} \ libhdf5.so:science/hdf5 \ libspnav.so:misc/libspnav RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}pivy>0:graphics/py-pivy@${PY_FLAVOR} \ ${PYTHON_SITELIBDIR}/matplotlib/__init__.py:math/py-matplotlib@${PY_FLAVOR} PORTSCOUT= limit:^[0-9\.]*$$ USES= dos2unix compiler:c++20-lang cmake cpe gl eigen:3 fortran gmake jpeg \ localbase:ldflags mpi:openmpi pkgconfig python localbase qt:6 xorg \ desktop-file-utils shared-mime-info shebangfix USE_GITHUB= yes GH_ACCOUNT= FreeCAD:ondselsolver \ FreeCAD:addonmgr GH_PROJECT= OndselSolver:ondselsolver \ AddonManager:addonmgr GH_TAGNAME= 30e9b64e8bf881d438d4b88834f9ba3674865418:ondselsolver \ 937b6877239dc78ef59eeefe8099e5f14243eda1:addonmgr GH_SUBDIR= src/3rdParty/OndselSolver:ondselsolver \ src/Mod/AddonManager:addonmgr USE_XORG= ice sm x11 xext xt USE_GL= gl glu USE_QT= base declarative svg tools USE_LDCONFIG= yes CPE_VENDOR= freecad_project DOS2UNIX_GLOB= *.txt *.h *.cpp *.py *.qss *.csv *.pov *.stp *.ui *.wrl *.WRL SHEBANG_FILES= src/Tools/freecad-thumbnailer.in # our HDF5/CMake integration is messy, so workarounds are required below CMAKE_ARGS+= -DOCC_INCLUDE_DIR="${LOCALBASE}/include/OpenCASCADE" \ -DOPENMPI_INCLUDE_DIRS="${LOCALBASE}/mpi/openmpi/include" \ -DFREECAD_QT_VERSION="6" \ -DPYTHON_LIBRARY="${PYTHONBASE}/lib/libpython${PYTHON_VER}${PYTHON_ABIVER}.so" \ -DPYTHON_INCLUDE_DIR="${PYTHON_INCLUDEDIR}" \ -DPYTHON_PACKAGES_PATH="${PYTHON_SITELIBDIR}" \ -DPYTHON_EXECUTABLE="${PYTHON_CMD}" \ -DBUILD_ASSEMBLY="ON" \ -DBUILD_DESIGNER_PLUGIN="ON" \ -DBUILD_FLAT_MESH="ON" \ -DBUILD_TEST="OFF" \ -DENABLE_DEVELOPER_TESTS="OFF" \ -DBUILD_VR="OFF" \ -DFREECAD_LIBPACK_USE="OFF" \ -DFREECAD_USE_EXTERNAL_FMT="ON" \ -DFREECAD_CREATE_MAC_APP="OFF" \ -DFREECAD_FREECAD_LIBPACK_USE="OFF" \ -DFREECAD_USE_EXTERNAL_KDL="OFF" \ -DFREECAD_USE_EXTERNAL_SMESH="OFF" \ -DFREECAD_USE_FREETYPE="ON" \ -DFREECAD_USE_PYBIND11="ON" \ -DUSE_CUDA="OFF" \ -DUSE_OPENCV="OFF" \ -Dpybind11_DIR="${PYTHON_SITELIBDIR}/pybind11/share/cmake/pybind11" \ -DHDF5_CFLAGS="-I${LOCALBASE}/include" \ -DHDF5_FOUND=TRUE \ -DHDF5_VERSION="1.12.2" \ -DHDF5_INCLUDE_DIRS="${LOCALBASE}/include/hdf5" \ -DHDF5_LIBRARIES="-L${LOCALBASE}/lib -lhdf5" \ -DHDF5_LIBRARY_DIRS="${LOCALBASE}/lib" \ -DBUILD_ENABLE_CXX_STD=C++20 \ -DXDG_DATADIR="${PREFIX}/share" CMAKE_INSTALL_PREFIX= ${PREFIX}/${PORTNAME} OPTIONS_DEFINE= COLLADA COLLADA_DESC= Install pycollada for Collada files import COLLADA_RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}pycollada>0:graphics/py-pycollada@${PY_FLAVOR} .include .if ${ARCH} == aarch64 || ${ARCH} == amd64 || ${ARCH} == i386 PLIST_SUB= WEBENGINE="" USE_QT+= webengine .else CMAKE_ARGS+= -DBUILD_WEB:BOOL=OFF PLIST_SUB= WEBENGINE="@comment " .endif pre-configure: @${REINPLACE_CMD} -e '/self\.rev/s/Unknown/${DISTVERSION:C/.*-//}/' \ ${WRKSRC}/src/Tools/SubWCRev.py # Install XDG icons and files to the standard path @${REINPLACE_CMD} -e 's/CMAKE_INSTALL_DATAROOTDIR/XDG_DATADIR/g' \ ${WRKSRC}/src/XDGData/CMakeLists.txt \ ${WRKSRC}/src/Gui/CMakeLists.txt post-install: ${LN} -s ../${PORTNAME}/bin/FreeCAD ${STAGEDIR}${LOCALBASE}/bin/FreeCAD ${LN} -s ../${PORTNAME}/bin/FreeCADCmd ${STAGEDIR}${LOCALBASE}/bin/FreeCADCmd .include <../../math/vtk9/Makefile.version> .include diff --git a/cad/freecad/files/patch-cMake_FreeCAD__Helspers_SetupCoin3D.cmake b/cad/freecad/files/patch-cMake_FreeCAD__Helpers_SetupCoin3D.cmake similarity index 90% rename from cad/freecad/files/patch-cMake_FreeCAD__Helspers_SetupCoin3D.cmake rename to cad/freecad/files/patch-cMake_FreeCAD__Helpers_SetupCoin3D.cmake index c77c24f4cff3..fcb787f5f7ac 100644 --- a/cad/freecad/files/patch-cMake_FreeCAD__Helspers_SetupCoin3D.cmake +++ b/cad/freecad/files/patch-cMake_FreeCAD__Helpers_SetupCoin3D.cmake @@ -1,29 +1,27 @@ commit 4a5be6da03ed7c56b5e8641ca0812db2243f165d Author: Christoph Moench-Tegeder fix COIN3D_MICRO_VERSION regex for coin 4.0.10 In cMake/FreeCAD_Helpers/SetupCoin3D.cmake, the version of Coin3D we're builing against is extracted from Coin3D's header files via regexes - but the regex only accepts single digit versions. That might be fine for COIN_MAJOR_VERSION (currently 4 and increasing only rarely) and COIN3D_MINOR_VERSION (which is 0 for some years now), but with the release of Coin3D 4.0.10, we should catch all digits in COIN_MICRO_VERSION (now at 10), else the build against the new Coin3D release fails with : CMake Error at cMake/FreeCAD_Helpers/SetupCoin3D.cmake:79 (message): : Coin3D version 4.0.1 mismatches Pivy Coin3D 4.0.10. -diff --git cMake/FreeCAD_Helpers/SetupCoin3D.cmake cMake/FreeCAD_Helpers/SetupCoin3D.cmake -index a026764540..0a4bd7ffdb 100644 ---- cMake/FreeCAD_Helpers/SetupCoin3D.cmake +--- cMake/FreeCAD_Helpers/SetupCoin3D.cmake.orig 2026-04-14 22:09:59 UTC +++ cMake/FreeCAD_Helpers/SetupCoin3D.cmake @@ -29,7 +29,7 @@ macro(SetupCoin3D) set(COIN3D_MAJOR_VERSION "${CMAKE_MATCH_1}") string(REGEX MATCH "define[ \t]+COIN_MINOR_VERSION[ \t]+([0-9?])" _coin3d_minor_version_match "${_coin3d_basic_h}") set(COIN3D_MINOR_VERSION "${CMAKE_MATCH_1}") - string(REGEX MATCH "define[ \t]+COIN_MICRO_VERSION[ \t]+([0-9?])" _coin3d_micro_version_match "${_coin3d_basic_h}") + string(REGEX MATCH "define[ \t]+COIN_MICRO_VERSION[ \t]+([0-9?]+)" _coin3d_micro_version_match "${_coin3d_basic_h}") set(COIN3D_MICRO_VERSION "${CMAKE_MATCH_1}") set(COIN3D_VERSION "${COIN3D_MAJOR_VERSION}.${COIN3D_MINOR_VERSION}.${COIN3D_MICRO_VERSION}") ENDIF () diff --git a/cad/freecad/files/patch-src_3rdParty_salomesmesh_inc_SMESH__ControlsDef.hxx b/cad/freecad/files/patch-src_3rdParty_salomesmesh_inc_SMESH__ControlsDef.hxx new file mode 100644 index 000000000000..1f3f80ea63b4 --- /dev/null +++ b/cad/freecad/files/patch-src_3rdParty_salomesmesh_inc_SMESH__ControlsDef.hxx @@ -0,0 +1,15 @@ +--- src/3rdParty/salomesmesh/inc/SMESH_ControlsDef.hxx.orig 2026-04-14 22:09:59 UTC ++++ src/3rdParty/salomesmesh/inc/SMESH_ControlsDef.hxx +@@ -29,7 +29,12 @@ + #include "SMESH_TypeDefs.hxx" + + #include ++#include ++#if OCC_VERSION_HEX >= 0x080000 ++#include ++#else + #include ++#endif + #include + #include + #include diff --git a/cad/freecad/files/patch-src_3rdParty_salomesmesh_inc_SMESH__MeshVSLink.hxx b/cad/freecad/files/patch-src_3rdParty_salomesmesh_inc_SMESH__MeshVSLink.hxx new file mode 100644 index 000000000000..7ebb66c1c030 --- /dev/null +++ b/cad/freecad/files/patch-src_3rdParty_salomesmesh_inc_SMESH__MeshVSLink.hxx @@ -0,0 +1,11 @@ +--- src/3rdParty/salomesmesh/inc/SMESH_MeshVSLink.hxx.orig 2026-04-14 22:09:59 UTC ++++ src/3rdParty/salomesmesh/inc/SMESH_MeshVSLink.hxx +@@ -27,6 +27,8 @@ + #ifndef _SMESH_MeshVSLink_HeaderFile + #define _SMESH_MeshVSLink_HeaderFile + ++#include ++#include + #if OCC_VERSION_HEX < 0x070000 + #ifndef _Handle_SMESH_MeshVSLink_HeaderFile + #include diff --git a/cad/freecad/files/patch-src_3rdParty_salomesmesh_inc_SMESH__Octree.hxx b/cad/freecad/files/patch-src_3rdParty_salomesmesh_inc_SMESH__Octree.hxx new file mode 100644 index 000000000000..74846f53933f --- /dev/null +++ b/cad/freecad/files/patch-src_3rdParty_salomesmesh_inc_SMESH__Octree.hxx @@ -0,0 +1,15 @@ +--- src/3rdParty/salomesmesh/inc/SMESH_Octree.hxx.orig 2026-04-14 22:09:59 UTC ++++ src/3rdParty/salomesmesh/inc/SMESH_Octree.hxx +@@ -31,7 +31,12 @@ + + #include "SMESH_Utils.hxx" + #include "SMESH_tree.hxx" ++#include ++#if OCC_VERSION_HEX >= 0x080000 ++#include ++#else + #include ++#endif + + //================================================================================ + /*! diff --git a/cad/freecad/files/patch-src_3rdParty_salomesmesh_inc_SMESH__Quadtree.hxx b/cad/freecad/files/patch-src_3rdParty_salomesmesh_inc_SMESH__Quadtree.hxx new file mode 100644 index 000000000000..ac41b0f10bb9 --- /dev/null +++ b/cad/freecad/files/patch-src_3rdParty_salomesmesh_inc_SMESH__Quadtree.hxx @@ -0,0 +1,15 @@ +--- src/3rdParty/salomesmesh/inc/SMESH_Quadtree.hxx.orig 2026-04-14 22:09:59 UTC ++++ src/3rdParty/salomesmesh/inc/SMESH_Quadtree.hxx +@@ -29,7 +29,12 @@ + + #include "SMESH_Utils.hxx" + #include "SMESH_tree.hxx" ++#include ++#if OCC_VERSION_HEX >= 0x080000 ++#include ++#else + #include ++#endif + + /*! + * \brief 2D tree of anything. diff --git a/cad/freecad/files/patch-src_3rdParty_salomesmesh_inc_SMESH__TryCatch.hxx b/cad/freecad/files/patch-src_3rdParty_salomesmesh_inc_SMESH__TryCatch.hxx new file mode 100644 index 000000000000..6108c1173892 --- /dev/null +++ b/cad/freecad/files/patch-src_3rdParty_salomesmesh_inc_SMESH__TryCatch.hxx @@ -0,0 +1,57 @@ +--- src/3rdParty/salomesmesh/inc/SMESH_TryCatch.hxx.orig 2026-04-14 22:09:59 UTC ++++ src/3rdParty/salomesmesh/inc/SMESH_TryCatch.hxx +@@ -65,11 +65,46 @@ + // Two onExceptionFun() are defined here: SMESH::throwSalomeEx() and SMESH::doNothing(). + // To add your own catch close, define SMY_OWN_CATCH macro before including this file. + ++#include ++#if OCC_VERSION_HEX >= 0x080000 + #define SMESH_CATCH( onExceptionFun ) \ + } \ + catch (Standard_Failure& ex) \ + { \ + SMESH_Comment text("OCCT Exception: "); \ ++ text << ": " << ex.ExceptionType(); \ ++ if ( ex.what() && strlen( ex.what() )) \ ++ text << ": " << ex.what(); \ ++ SMESH_CAUGHT onExceptionFun( text ); \ ++ } \ ++ catch ( ::SMESH_ComputeError& ce ) \ ++ { \ ++ if ( !ce.myComment.empty() ) \ ++ SMESH_CAUGHT onExceptionFun( ce.myComment.c_str() ); \ ++ else if ( ce.IsCommon() ) \ ++ SMESH_CAUGHT onExceptionFun( ce.CommonName().c_str() ); \ ++ else \ ++ SMESH_CAUGHT onExceptionFun \ ++ (SMESH_Comment("SMESH_ComputeError: ") << ce.myName ); \ ++ } \ ++ catch ( const std::exception& ex) \ ++ { \ ++ SMESH_CAUGHT onExceptionFun( ex.what() ); \ ++ } \ ++ \ ++ SMY_OWN_CATCH \ ++ \ ++ catch (...) \ ++ { \ ++ SMESH_CAUGHT onExceptionFun("Unknown Exception caught"); \ ++ } ++#else ++#define SMESH_CATCH( onExceptionFun ) \ ++#define SMESH_CATCH( onExceptionFun ) \ ++ } \ ++ catch (Standard_Failure& ex) \ ++ { \ ++ SMESH_Comment text("OCCT Exception: "); \ + text << ": " << ex.DynamicType()->Name(); \ + if ( ex.GetMessageString() && strlen( ex.GetMessageString() )) \ + text << ": " << ex.GetMessageString(); \ +@@ -96,6 +131,7 @@ + { \ + SMESH_CAUGHT onExceptionFun("Unknown Exception caught"); \ + } ++#endif + + //------------------------------------------------------------------------------------- + // Functions that can be used as an argument of SMESH_CATCH diff --git a/cad/freecad/files/patch-src_3rdParty_salomesmesh_inc_StdMeshers__Distribution.hxx b/cad/freecad/files/patch-src_3rdParty_salomesmesh_inc_StdMeshers__Distribution.hxx new file mode 100644 index 000000000000..7e449a4d74c5 --- /dev/null +++ b/cad/freecad/files/patch-src_3rdParty_salomesmesh_inc_StdMeshers__Distribution.hxx @@ -0,0 +1,26 @@ +--- src/3rdParty/salomesmesh/inc/StdMeshers_Distribution.hxx.orig 2026-04-14 22:09:59 UTC ++++ src/3rdParty/salomesmesh/inc/StdMeshers_Distribution.hxx +@@ -34,7 +34,12 @@ + #include + #include + #include ++#include ++#if OCC_VERSION_HEX >= 0x080000 ++#include ++#else + #include ++#endif + #include + + namespace StdMeshers +@@ -86,6 +91,10 @@ class STDMESHERS_EXPORT FunctionTable : public Functio + private: + std::vector myData; + }; ++ ++#if OCC_VERSION_HEX >= 0x080000 ++using Expr_Array1OfNamedUnknown = NCollection_Array1>; ++#endif + + class STDMESHERS_EXPORT FunctionExpr : public Function, public math_Function + { diff --git a/cad/freecad/files/patch-src_3rdParty_salomesmesh_inc_StdMeshers__Quadrangle__2D.hxx b/cad/freecad/files/patch-src_3rdParty_salomesmesh_inc_StdMeshers__Quadrangle__2D.hxx new file mode 100644 index 000000000000..91481c6346ee --- /dev/null +++ b/cad/freecad/files/patch-src_3rdParty_salomesmesh_inc_StdMeshers__Quadrangle__2D.hxx @@ -0,0 +1,15 @@ +--- src/3rdParty/salomesmesh/inc/StdMeshers_Quadrangle_2D.hxx.orig 2026-04-14 22:09:59 UTC ++++ src/3rdParty/salomesmesh/inc/StdMeshers_Quadrangle_2D.hxx +@@ -34,7 +34,12 @@ + #include "StdMeshers_QuadrangleParams.hxx" + + #include ++#include ++#if OCC_VERSION_HEX >= 0x080000 ++#include ++#else + #include ++#endif + + class SMDS_MeshNode; + class SMESH_Mesh; diff --git a/cad/freecad/files/patch-src_3rdParty_salomesmesh_src_Controls_SMESH__Controls.cpp b/cad/freecad/files/patch-src_3rdParty_salomesmesh_src_Controls_SMESH__Controls.cpp new file mode 100644 index 000000000000..8a83ab492a22 --- /dev/null +++ b/cad/freecad/files/patch-src_3rdParty_salomesmesh_src_Controls_SMESH__Controls.cpp @@ -0,0 +1,10 @@ +--- src/3rdParty/salomesmesh/src/Controls/SMESH_Controls.cpp.orig 2026-07-01 15:13:02 UTC ++++ src/3rdParty/salomesmesh/src/Controls/SMESH_Controls.cpp +@@ -51,7 +51,6 @@ + #include + #include + #include +-#include + #include + #include + #include diff --git a/cad/freecad/files/patch-src_3rdParty_salomesmesh_src_DriverSTL_DriverSTL__R__SMDS__Mesh.cpp b/cad/freecad/files/patch-src_3rdParty_salomesmesh_src_DriverSTL_DriverSTL__R__SMDS__Mesh.cpp new file mode 100644 index 000000000000..ceade064aecb --- /dev/null +++ b/cad/freecad/files/patch-src_3rdParty_salomesmesh_src_DriverSTL_DriverSTL__R__SMDS__Mesh.cpp @@ -0,0 +1,158 @@ +--- src/3rdParty/salomesmesh/src/DriverSTL/DriverSTL_R_SMDS_Mesh.cpp.orig 2026-07-01 15:13:02 UTC ++++ src/3rdParty/salomesmesh/src/DriverSTL/DriverSTL_R_SMDS_Mesh.cpp +@@ -44,17 +44,17 @@ namespace + { + union + { +- Standard_Real R[3]; +- Standard_Integer I[6]; ++ double R[3]; ++ int I[6]; + } U; + + point.Coord( U.R[0], U.R[1], U.R[2] ); +- return std::hash{}(U.I[0]/23+U.I[1]/19+U.I[2]/17+U.I[3]/13+U.I[4]/11+U.I[5]/7); ++ return std::hash{}(U.I[0]/23+U.I[1]/19+U.I[2]/17+U.I[3]/13+U.I[4]/11+U.I[5]/7); + } + + size_t operator()(const gp_Pnt& point1, const gp_Pnt& point2) const noexcept + { +- static Standard_Real tab1[3], tab2[3]; ++ static double tab1[3], tab2[3]; + point1.Coord(tab1[0],tab1[1],tab1[2]); + point2.Coord(tab2[0],tab2[1],tab2[2]); + return (memcmp(tab1,tab2,sizeof(tab1)) == 0); +@@ -64,27 +64,27 @@ namespace + //function : HashCode + //purpose : + //======================================================================= +- inline static Standard_Integer HashCode +- (const gp_Pnt& point, Standard_Integer Upper) ++ inline static int HashCode ++ (const gp_Pnt& point, int Upper) + { + union + { +- Standard_Real R[3]; +- Standard_Integer I[6]; ++ double R[3]; ++ int I[6]; + } U; + + point.Coord( U.R[0], U.R[1], U.R[2] ); +- return std::hash{}(U.I[0]/23+U.I[1]/19+U.I[2]/17+U.I[3]/13+U.I[4]/11+U.I[5]/7); ++ return std::hash{}(U.I[0]/23+U.I[1]/19+U.I[2]/17+U.I[3]/13+U.I[4]/11+U.I[5]/7); + } + + //======================================================================= + //function : IsEqual + //purpose : + //======================================================================= +- inline static Standard_Boolean IsEqual ++ inline static bool IsEqual + (const gp_Pnt& point1, const gp_Pnt& point2) + { +- static Standard_Real tab1[3], tab2[3]; ++ static double tab1[3], tab2[3]; + point1.Coord(tab1[0],tab1[1],tab1[2]); + point2.Coord(tab2[0],tab2[1],tab2[2]); + return (memcmp(tab1,tab2,sizeof(tab1)) == 0); +@@ -109,7 +109,7 @@ DriverSTL_R_SMDS_Mesh::DriverSTL_R_SMDS_Mesh() + DriverSTL_R_SMDS_Mesh::DriverSTL_R_SMDS_Mesh() + { + myIsCreateFaces = true; +- myIsAscii = Standard_True; ++ myIsAscii = true; + } + + //======================================================================= +@@ -149,10 +149,10 @@ Driver_Mesh::Status DriverSTL_R_SMDS_Mesh::Perform() + data += HEADER_SIZE; + + // we check 128 characters to detect if we have a non-ascii char +- myIsAscii = Standard_True; ++ myIsAscii = true; + for (int i = 0; i < 128; ++i, ++data) { + if ( !isascii( *data ) && data < file.end() ) { +- myIsAscii = Standard_False; ++ myIsAscii = false; + break; + } + } +@@ -172,11 +172,11 @@ Driver_Mesh::Status DriverSTL_R_SMDS_Mesh::Perform() + + // static methods + +-static Standard_Real readFloat(SMESH_File& theFile) ++static double readFloat(SMESH_File& theFile) + { + union { +- Standard_Boolean i; +- Standard_ShortReal f; ++ bool i; ++ float f; + } u; + + const char* c = theFile; +@@ -208,7 +208,7 @@ static SMDS_MeshNode* readNode(FILE* file, + TDataMapOfPntNodePtr& uniqnodes, + SMDS_Mesh* theMesh) + { +- Standard_ShortReal coord[3]; ++ float coord[3]; + // reading vertex + fscanf(file,"%*s %f %f %f\n",&coord[0],&coord[1],&coord[2]); + +@@ -245,7 +245,7 @@ Driver_Mesh::Status DriverSTL_R_SMDS_Mesh::readAscii(S + FILE* file = fopen( myFile.c_str(),"r"); + + // count the number of lines +- Standard_Integer nbLines = 0; ++ int nbLines = 0; + for (long ipos = 0; ipos < filesize; ++ipos) { + if (getc(file) == '\n') + nbLines++; +@@ -254,17 +254,17 @@ Driver_Mesh::Status DriverSTL_R_SMDS_Mesh::readAscii(S + // go back to the beginning of the file + rewind(file); + +- Standard_Integer nbTri = (nbLines / ASCII_LINES_PER_FACET); ++ int nbTri = (nbLines / ASCII_LINES_PER_FACET); + + TDataMapOfPntNodePtr uniqnodes; + // skip header + while (getc(file) != '\n'); + + // main reading +- for (Standard_Integer iTri = 0; iTri < nbTri; ++iTri) { ++ for (int iTri = 0; iTri < nbTri; ++iTri) { + + // skipping the facet normal +- Standard_ShortReal normal[3]; ++ float normal[3]; + fscanf(file,"%*s %*s %f %f %f\n",&normal[0],&normal[1],&normal[2]); + + // skip the keywords "outer loop" +@@ -306,19 +306,19 @@ Driver_Mesh::Status DriverSTL_R_SMDS_Mesh::readBinary( + if ( (filesize - HEADER_SIZE) % SIZEOF_STL_FACET !=0 + // Commented to allow reading small files (ex: 1 face) + /*|| (filesize < STL_MIN_FILE_SIZE)*/) { +- Standard_NoMoreObject::Raise("DriverSTL_R_SMDS_MESH::readBinary (wrong file size)"); ++ throw Standard_NoMoreObject("DriverSTL_R_SMDS_MESH::readBinary (wrong file size)"); + } + + // don't trust the number of triangles which is coded in the file + // sometimes it is wrong, and with this technique we don't need to swap endians for integer +- Standard_Integer nbTri = ((filesize - HEADER_SIZE) / SIZEOF_STL_FACET); ++ int nbTri = ((filesize - HEADER_SIZE) / SIZEOF_STL_FACET); + + // skip the header + file += HEADER_SIZE; + + TDataMapOfPntNodePtr uniqnodes; + +- for (Standard_Integer iTri = 0; iTri < nbTri; ++iTri) { ++ for (int iTri = 0; iTri < nbTri; ++iTri) { + + // ignore normals + file += 3 * SIZE_OF_FLOAT; diff --git a/cad/freecad/files/patch-src_3rdParty_salomesmesh_src_NETGENPlugin_NETGENPlugin__Mesher.cpp b/cad/freecad/files/patch-src_3rdParty_salomesmesh_src_NETGENPlugin_NETGENPlugin__Mesher.cpp new file mode 100644 index 000000000000..4911bea53d91 --- /dev/null +++ b/cad/freecad/files/patch-src_3rdParty_salomesmesh_src_NETGENPlugin_NETGENPlugin__Mesher.cpp @@ -0,0 +1,15 @@ +--- src/3rdParty/salomesmesh/src/NETGENPlugin/NETGENPlugin_Mesher.cpp.orig 2026-07-01 16:20:28 UTC ++++ src/3rdParty/salomesmesh/src/NETGENPlugin/NETGENPlugin_Mesher.cpp +@@ -62,7 +62,12 @@ + #include + #include + #include ++#include ++#if OCC_VERSION_HEX >= 0x080000 ++#include ++#else + #include ++#endif + #include + #include + #include diff --git a/cad/freecad/files/patch-src_3rdParty_salomesmesh_src_SMESH_GEOMUtils.cpp b/cad/freecad/files/patch-src_3rdParty_salomesmesh_src_SMESH_GEOMUtils.cpp new file mode 100644 index 000000000000..fdea30a8a4ec --- /dev/null +++ b/cad/freecad/files/patch-src_3rdParty_salomesmesh_src_SMESH_GEOMUtils.cpp @@ -0,0 +1,77 @@ +--- src/3rdParty/salomesmesh/src/SMESH/GEOMUtils.cpp.orig 2026-07-01 17:04:15 UTC ++++ src/3rdParty/salomesmesh/src/SMESH/GEOMUtils.cpp +@@ -26,8 +26,6 @@ + # pragma clang diagnostic ignored "-Wimport-preprocessor-directive-pedantic" + #endif + +-#include +- + #include + + #include +@@ -69,7 +67,6 @@ + #include + #include + #include +-#include + #include + + #include +@@ -406,10 +403,10 @@ gp_Vec GEOMUtils::GetVector (const TopoDS_Shape& theSh + Standard_Boolean doConsiderOrientation) + { + if (theShape.IsNull()) +- Standard_NullObject::Raise("Null shape is given for a vector"); ++ throw Standard_NullObject("Null shape is given for a vector"); + + if (theShape.ShapeType() != TopAbs_EDGE) +- Standard_TypeMismatch::Raise("Invalid shape is given, must be a vector or an edge"); ++ throw Standard_TypeMismatch("Invalid shape is given, must be a vector or an edge"); + + TopoDS_Edge anE = TopoDS::Edge(theShape); + +@@ -417,11 +414,11 @@ gp_Vec GEOMUtils::GetVector (const TopoDS_Shape& theSh + TopExp::Vertices(anE, V1, V2, doConsiderOrientation); + + if (V1.IsNull() || V2.IsNull()) +- Standard_NullObject::Raise("Invalid edge is given, it must have two points"); ++ throw Standard_NullObject("Invalid edge is given, it must have two points"); + + gp_Vec aV (BRep_Tool::Pnt(V1), BRep_Tool::Pnt(V2)); + if (aV.Magnitude() < gp::Resolution()) { +- Standard_ConstructionError::Raise("Vector of zero length is given"); ++ throw Standard_ConstructionError("Vector of zero length is given"); + } + + return aV; +@@ -771,7 +768,7 @@ TopoDS_Shape GEOMUtils::GetEdgeNearPoint (const TopoDS + } + + if (nbEdges == 0) +- Standard_NullObject::Raise("Given shape contains no edges"); ++ throw Standard_NullObject("Given shape contains no edges"); + + mapShape.Clear(); + Standard_Integer ind = 1; +@@ -785,7 +782,7 @@ TopoDS_Shape GEOMUtils::GetEdgeNearPoint (const TopoDS + // 2. Classify the point relatively each edge + BRepExtrema_DistShapeShape aDistTool (thePoint, anEdges(ind)); + if (!aDistTool.IsDone()) +- Standard_ConstructionError::Raise("Cannot find a distance from the given point to one of edges"); ++ throw Standard_ConstructionError("Cannot find a distance from the given point to one of edges"); + + aDistances(ind) = aDistTool.Value(); + ind++; +@@ -808,10 +805,10 @@ TopoDS_Shape GEOMUtils::GetEdgeNearPoint (const TopoDS + } + } + if (nbFound > 1) { +- Standard_ConstructionError::Raise("Multiple edges near the given point are found"); ++ throw Standard_ConstructionError("Multiple edges near the given point are found"); + } + else if (nbFound == 0) { +- Standard_ConstructionError::Raise("There are no edges near the given point"); ++ throw Standard_ConstructionError("There are no edges near the given point"); + } + else { + } diff --git a/cad/freecad/files/patch-src_3rdParty_salomesmesh_src_SMESH_SMESH__Algo.cpp b/cad/freecad/files/patch-src_3rdParty_salomesmesh_src_SMESH_SMESH__Algo.cpp new file mode 100644 index 000000000000..9c1f7f7913bf --- /dev/null +++ b/cad/freecad/files/patch-src_3rdParty_salomesmesh_src_SMESH_SMESH__Algo.cpp @@ -0,0 +1,10 @@ +--- src/3rdParty/salomesmesh/src/SMESH/SMESH_Algo.cpp.orig 2026-07-01 15:13:02 UTC ++++ src/3rdParty/salomesmesh/src/SMESH/SMESH_Algo.cpp +@@ -53,7 +53,6 @@ + #include + #include + #include +-#include + #include + #include + #include diff --git a/cad/freecad/files/patch-src_3rdParty_salomesmesh_src_SMESH_SMESH__Block.cpp b/cad/freecad/files/patch-src_3rdParty_salomesmesh_src_SMESH_SMESH__Block.cpp new file mode 100644 index 000000000000..a6a25a87b08a --- /dev/null +++ b/cad/freecad/files/patch-src_3rdParty_salomesmesh_src_SMESH_SMESH__Block.cpp @@ -0,0 +1,23 @@ +--- src/3rdParty/salomesmesh/src/SMESH/SMESH_Block.cpp.orig 2026-07-01 16:20:28 UTC ++++ src/3rdParty/salomesmesh/src/SMESH/SMESH_Block.cpp +@@ -38,7 +38,12 @@ + #include + #include + #include ++#include ++#if OCC_VERSION_HEX >= 0x080000 ++#include ++#else + #include ++#endif + #include + #include + #include +@@ -48,7 +53,6 @@ + #include + #include + #include +-#include + #include + #include + #include diff --git a/cad/freecad/files/patch-src_3rdParty_salomesmesh_src_SMESH_SMESH__Mesh.cpp b/cad/freecad/files/patch-src_3rdParty_salomesmesh_src_SMESH_SMESH__Mesh.cpp new file mode 100644 index 000000000000..16823db76206 --- /dev/null +++ b/cad/freecad/files/patch-src_3rdParty_salomesmesh_src_SMESH_SMESH__Mesh.cpp @@ -0,0 +1,19 @@ +--- src/3rdParty/salomesmesh/src/SMESH/SMESH_Mesh.cpp.orig 2026-07-01 17:17:39 UTC ++++ src/3rdParty/salomesmesh/src/SMESH/SMESH_Mesh.cpp +@@ -71,7 +71,6 @@ + #include + #include + #include +-#include + #include + #include + #include +@@ -83,7 +82,7 @@ + #ifndef WIN32 + #include + #include +-#else ++#else + #include + #include + //#include diff --git a/cad/freecad/files/patch-src_3rdParty_salomesmesh_src_SMESH_SMESH__MeshEditor.cpp b/cad/freecad/files/patch-src_3rdParty_salomesmesh_src_SMESH_SMESH__MeshEditor.cpp new file mode 100644 index 000000000000..5e55b64a5b82 --- /dev/null +++ b/cad/freecad/files/patch-src_3rdParty_salomesmesh_src_SMESH_SMESH__MeshEditor.cpp @@ -0,0 +1,10 @@ +--- src/3rdParty/salomesmesh/src/SMESH/SMESH_MeshEditor.cpp.orig 2026-07-01 15:13:02 UTC ++++ src/3rdParty/salomesmesh/src/SMESH/SMESH_MeshEditor.cpp +@@ -75,7 +75,6 @@ + #include + #include + #include +-#include + #include + #include + #include diff --git a/cad/freecad/files/patch-src_3rdParty_salomesmesh_src_SMESH_SMESH__MesherHelper.cpp b/cad/freecad/files/patch-src_3rdParty_salomesmesh_src_SMESH_SMESH__MesherHelper.cpp new file mode 100644 index 000000000000..7c3c370f6698 --- /dev/null +++ b/cad/freecad/files/patch-src_3rdParty_salomesmesh_src_SMESH_SMESH__MesherHelper.cpp @@ -0,0 +1,12 @@ +--- src/3rdParty/salomesmesh/src/SMESH/SMESH_MesherHelper.cpp.orig 2026-07-01 15:13:02 UTC ++++ src/3rdParty/salomesmesh/src/SMESH/SMESH_MesherHelper.cpp +@@ -50,8 +50,7 @@ + #include + #include + #include +-#include +-#include ++#include + #include + #include + #include diff --git a/cad/freecad/files/patch-src_3rdParty_salomesmesh_src_SMESH_SMESH__Pattern.cpp b/cad/freecad/files/patch-src_3rdParty_salomesmesh_src_SMESH_SMESH__Pattern.cpp new file mode 100644 index 000000000000..6913d4288315 --- /dev/null +++ b/cad/freecad/files/patch-src_3rdParty_salomesmesh_src_SMESH_SMESH__Pattern.cpp @@ -0,0 +1,12 @@ +--- src/3rdParty/salomesmesh/src/SMESH/SMESH_Pattern.cpp.orig 2026-07-01 15:13:02 UTC ++++ src/3rdParty/salomesmesh/src/SMESH/SMESH_Pattern.cpp +@@ -60,7 +60,8 @@ + #include + #include + #include +-#include ++#include ++#include + #include + #include + #include diff --git a/cad/freecad/files/patch-src_3rdParty_salomesmesh_src_SMESH_SMESH__ProxyMesh.cpp b/cad/freecad/files/patch-src_3rdParty_salomesmesh_src_SMESH_SMESH__ProxyMesh.cpp new file mode 100644 index 000000000000..43bc296a35ff --- /dev/null +++ b/cad/freecad/files/patch-src_3rdParty_salomesmesh_src_SMESH_SMESH__ProxyMesh.cpp @@ -0,0 +1,11 @@ +--- src/3rdParty/salomesmesh/src/SMESH/SMESH_ProxyMesh.cpp.orig 2026-07-01 15:13:02 UTC ++++ src/3rdParty/salomesmesh/src/SMESH/SMESH_ProxyMesh.cpp +@@ -26,7 +26,7 @@ + #include "SMDS_SetIterator.hxx" + #include "SMESH_MesherHelper.hxx" + +-#include ++#include + #include + #include + diff --git a/cad/freecad/files/patch-src_3rdParty_salomesmesh_src_SMESH_SMESH__subMesh.cpp b/cad/freecad/files/patch-src_3rdParty_salomesmesh_src_SMESH_SMESH__subMesh.cpp new file mode 100644 index 000000000000..3a8ba83ea880 --- /dev/null +++ b/cad/freecad/files/patch-src_3rdParty_salomesmesh_src_SMESH_SMESH__subMesh.cpp @@ -0,0 +1,25 @@ +--- src/3rdParty/salomesmesh/src/SMESH/SMESH_subMesh.cpp.orig 2026-07-01 16:20:28 UTC ++++ src/3rdParty/salomesmesh/src/SMESH/SMESH_subMesh.cpp +@@ -48,9 +48,9 @@ + #include + #include + #include ++#include + #include + #include +-#include + #include + #include + #include +@@ -1548,7 +1548,11 @@ bool SMESH_subMesh::ComputeStateEngine(int event) + catch (Standard_Failure& ex) { + if ( !_computeError ) _computeError = SMESH_ComputeError::New(); + _computeError->myName = COMPERR_OCC_EXCEPTION; ++#if OCC_VERSION_HEX >= 0x080000 ++ _computeError->myComment += ex.ExceptionType(); ++#else + _computeError->myComment += ex.DynamicType()->Name(); ++#endif + if ( ex.GetMessageString() && strlen( ex.GetMessageString() )) { + _computeError->myComment += ": "; + _computeError->myComment += ex.GetMessageString(); diff --git a/cad/freecad/files/patch-src_3rdParty_salomesmesh_src_StdMeshers_SMESH__MAT2d.cpp b/cad/freecad/files/patch-src_3rdParty_salomesmesh_src_StdMeshers_SMESH__MAT2d.cpp new file mode 100644 index 000000000000..ec6d09fb0c35 --- /dev/null +++ b/cad/freecad/files/patch-src_3rdParty_salomesmesh_src_StdMeshers_SMESH__MAT2d.cpp @@ -0,0 +1,15 @@ +--- src/3rdParty/salomesmesh/src/StdMeshers/SMESH_MAT2d.cpp.orig 2026-07-01 16:20:28 UTC ++++ src/3rdParty/salomesmesh/src/StdMeshers/SMESH_MAT2d.cpp +@@ -32,7 +32,12 @@ + #include + #include + #include ++#include ++#if OCC_VERSION_HEX >= 0x080000 ++#include ++#else + #include ++#endif + //#include + #include + // #include diff --git a/cad/freecad/files/patch-src_3rdParty_salomesmesh_src_StdMeshers_StdMeshers__Adaptive1D.cpp b/cad/freecad/files/patch-src_3rdParty_salomesmesh_src_StdMeshers_StdMeshers__Adaptive1D.cpp new file mode 100644 index 000000000000..c4f5ebe1e47e --- /dev/null +++ b/cad/freecad/files/patch-src_3rdParty_salomesmesh_src_StdMeshers_StdMeshers__Adaptive1D.cpp @@ -0,0 +1,49 @@ +--- src/3rdParty/salomesmesh/src/StdMeshers/StdMeshers_Adaptive1D.cpp.orig 2026-07-01 16:20:28 UTC ++++ src/3rdParty/salomesmesh/src/StdMeshers/StdMeshers_Adaptive1D.cpp +@@ -38,7 +38,10 @@ + #include + #include + #include ++#include ++#if OCC_VERSION_HEX < 0x080000 + #include ++#endif + #include + #include + #include +@@ -48,6 +51,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -73,9 +77,27 @@ namespace // internal utils + */ + struct BBox : public Bnd_B3d + { ++#if OCC_VERSION_HEX >= 0x080000 ++ gp_XYZ Center() const ++ { ++ const auto& myCenter = Bnd_B3d::Center(); ++ return gp_XYZ(myCenter[0], myCenter[1], myCenter[2]); ++ } ++ gp_XYZ HSize() const ++ { ++ const auto& myHSize = Bnd_B3d::HSize(); ++ return gp_XYZ(myHSize[0], myHSize[1], myHSize[2]); ++ } ++ double Size() const ++ { ++ const auto& myHSize = Bnd_B3d::HSize(); ++ return 2 * myHSize[0]; ++ } ++#else + gp_XYZ Center() const { return gp_XYZ( myCenter[0], myCenter[1], myCenter[2] ); } + gp_XYZ HSize() const { return gp_XYZ( myHSize[0], myHSize[1], myHSize[2] ); } + double Size() const { return 2 * myHSize[0]; } ++#endif + }; + //================================================================================ + /*! diff --git a/cad/freecad/files/patch-src_3rdParty_salomesmesh_src_StdMeshers_StdMeshers__CartesianParameters3D.cpp b/cad/freecad/files/patch-src_3rdParty_salomesmesh_src_StdMeshers_StdMeshers__CartesianParameters3D.cpp new file mode 100644 index 000000000000..a1c7fba2137b --- /dev/null +++ b/cad/freecad/files/patch-src_3rdParty_salomesmesh_src_StdMeshers_StdMeshers__CartesianParameters3D.cpp @@ -0,0 +1,10 @@ +--- src/3rdParty/salomesmesh/src/StdMeshers/StdMeshers_CartesianParameters3D.cpp.orig 2026-07-01 15:13:02 UTC ++++ src/3rdParty/salomesmesh/src/StdMeshers/StdMeshers_CartesianParameters3D.cpp +@@ -44,7 +44,6 @@ + #include + #include + #include +-#include + #include + #include + #include diff --git a/cad/freecad/files/patch-src_3rdParty_salomesmesh_src_StdMeshers_StdMeshers__Cartesian__3D.cpp b/cad/freecad/files/patch-src_3rdParty_salomesmesh_src_StdMeshers_StdMeshers__Cartesian__3D.cpp new file mode 100644 index 000000000000..b662976a2c8b --- /dev/null +++ b/cad/freecad/files/patch-src_3rdParty_salomesmesh_src_StdMeshers_StdMeshers__Cartesian__3D.cpp @@ -0,0 +1,27 @@ +--- src/3rdParty/salomesmesh/src/StdMeshers/StdMeshers_Cartesian_3D.cpp.orig 2026-07-01 16:20:28 UTC ++++ src/3rdParty/salomesmesh/src/StdMeshers/StdMeshers_Cartesian_3D.cpp +@@ -55,7 +55,12 @@ + #include + #include + #include ++#include ++#if OCC_VERSION_HEX >= 0x080000 ++#include ++#else + #include ++#endif + #include + #include + #include +@@ -3462,7 +3467,11 @@ namespace + double dist = GEOMUtils::GetMinDistance( plane, allFacesComp, pPlane, pFaces ); + if ( dist < 0 ) + { ++#if OCC_VERSION_HEX >= 0x080000 ++ Bnd_B3 bb; ++#else + Bnd_B3d bb; ++#endif + gp_XYZ corner; + for ( int i = 0; i < 2; ++i ) { + corner.SetCoord( 1, sP[ i*3 ]); diff --git a/cad/freecad/files/patch-src_3rdParty_salomesmesh_src_StdMeshers_StdMeshers__CompositeHexa__3D.cpp b/cad/freecad/files/patch-src_3rdParty_salomesmesh_src_StdMeshers_StdMeshers__CompositeHexa__3D.cpp new file mode 100644 index 000000000000..32f07ad67123 --- /dev/null +++ b/cad/freecad/files/patch-src_3rdParty_salomesmesh_src_StdMeshers_StdMeshers__CompositeHexa__3D.cpp @@ -0,0 +1,10 @@ +--- src/3rdParty/salomesmesh/src/StdMeshers/StdMeshers_CompositeHexa_3D.cpp.orig 2026-07-01 15:13:02 UTC ++++ src/3rdParty/salomesmesh/src/StdMeshers/StdMeshers_CompositeHexa_3D.cpp +@@ -42,7 +42,6 @@ + #include + #include + #include +-#include + #include + #include + #include diff --git a/cad/freecad/files/patch-src_3rdParty_salomesmesh_src_StdMeshers_StdMeshers__CompositeSegment__1D.cpp b/cad/freecad/files/patch-src_3rdParty_salomesmesh_src_StdMeshers_StdMeshers__CompositeSegment__1D.cpp new file mode 100644 index 000000000000..3acb718008d2 --- /dev/null +++ b/cad/freecad/files/patch-src_3rdParty_salomesmesh_src_StdMeshers_StdMeshers__CompositeSegment__1D.cpp @@ -0,0 +1,10 @@ +--- src/3rdParty/salomesmesh/src/StdMeshers/StdMeshers_CompositeSegment_1D.cpp.orig 2026-07-01 15:13:02 UTC ++++ src/3rdParty/salomesmesh/src/StdMeshers/StdMeshers_CompositeSegment_1D.cpp +@@ -45,7 +45,6 @@ + #include + #include + #include +-#include + #include + #include + #include diff --git a/cad/freecad/files/patch-src_3rdParty_salomesmesh_src_StdMeshers_StdMeshers__Import__1D2D.cpp b/cad/freecad/files/patch-src_3rdParty_salomesmesh_src_StdMeshers_StdMeshers__Import__1D2D.cpp new file mode 100644 index 000000000000..9989bf4da01c --- /dev/null +++ b/cad/freecad/files/patch-src_3rdParty_salomesmesh_src_StdMeshers_StdMeshers__Import__1D2D.cpp @@ -0,0 +1,15 @@ +--- src/3rdParty/salomesmesh/src/StdMeshers/StdMeshers_Import_1D2D.cpp.orig 2026-07-01 16:20:28 UTC ++++ src/3rdParty/salomesmesh/src/StdMeshers/StdMeshers_Import_1D2D.cpp +@@ -49,7 +49,12 @@ + #include + #include + #include ++#include ++#if OCC_VERSION_HEX >= 0x080000 ++#include ++#else + #include ++#endif + #include + #include + #include diff --git a/cad/freecad/files/patch-src_3rdParty_salomesmesh_src_StdMeshers_StdMeshers__MEFISTO__2D.cpp b/cad/freecad/files/patch-src_3rdParty_salomesmesh_src_StdMeshers_StdMeshers__MEFISTO__2D.cpp new file mode 100644 index 000000000000..19d1183db431 --- /dev/null +++ b/cad/freecad/files/patch-src_3rdParty_salomesmesh_src_StdMeshers_StdMeshers__MEFISTO__2D.cpp @@ -0,0 +1,10 @@ +--- src/3rdParty/salomesmesh/src/StdMeshers/StdMeshers_MEFISTO_2D.cpp.orig 2026-07-01 15:13:02 UTC ++++ src/3rdParty/salomesmesh/src/StdMeshers/StdMeshers_MEFISTO_2D.cpp +@@ -56,7 +56,6 @@ + #include + #include + #include +-#include + #include + #include + #include diff --git a/cad/freecad/files/patch-src_3rdParty_salomesmesh_src_StdMeshers_StdMeshers__NumberOfSegments.cpp b/cad/freecad/files/patch-src_3rdParty_salomesmesh_src_StdMeshers_StdMeshers__NumberOfSegments.cpp new file mode 100644 index 000000000000..9341c0922132 --- /dev/null +++ b/cad/freecad/files/patch-src_3rdParty_salomesmesh_src_StdMeshers_StdMeshers__NumberOfSegments.cpp @@ -0,0 +1,23 @@ +--- src/3rdParty/salomesmesh/src/StdMeshers/StdMeshers_NumberOfSegments.cpp.orig 2026-07-01 16:20:28 UTC ++++ src/3rdParty/salomesmesh/src/StdMeshers/StdMeshers_NumberOfSegments.cpp +@@ -34,12 +34,20 @@ + #include "SMESH_Comment.hxx" + + #include ++#include ++#if OCC_VERSION_HEX < 0x080000 + #include ++#endif + #include + #include + #include + #include + #include ++ ++ ++#if OCC_VERSION_HEX >= 0x080000 ++using Expr_Array1OfNamedUnknown = NCollection_Array1>; ++#endif + + #if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100 + #define NO_CAS_CATCH diff --git a/cad/freecad/files/patch-src_3rdParty_salomesmesh_src_StdMeshers_StdMeshers__Penta__3D.cpp b/cad/freecad/files/patch-src_3rdParty_salomesmesh_src_StdMeshers_StdMeshers__Penta__3D.cpp new file mode 100644 index 000000000000..fc4ae00d2c64 --- /dev/null +++ b/cad/freecad/files/patch-src_3rdParty_salomesmesh_src_StdMeshers_StdMeshers__Penta__3D.cpp @@ -0,0 +1,10 @@ +--- src/3rdParty/salomesmesh/src/StdMeshers/StdMeshers_Penta_3D.cpp.orig 2026-07-01 15:13:02 UTC ++++ src/3rdParty/salomesmesh/src/StdMeshers/StdMeshers_Penta_3D.cpp +@@ -46,7 +46,6 @@ + #include + #include + #include +-#include + #include + #include + #include diff --git a/cad/freecad/files/patch-src_3rdParty_salomesmesh_src_StdMeshers_StdMeshers__Prism__3D.cpp b/cad/freecad/files/patch-src_3rdParty_salomesmesh_src_StdMeshers_StdMeshers__Prism__3D.cpp new file mode 100644 index 000000000000..909b6013fc1e --- /dev/null +++ b/cad/freecad/files/patch-src_3rdParty_salomesmesh_src_StdMeshers_StdMeshers__Prism__3D.cpp @@ -0,0 +1,22 @@ +--- src/3rdParty/salomesmesh/src/StdMeshers/StdMeshers_Prism_3D.cpp.orig 2026-07-01 16:20:28 UTC ++++ src/3rdParty/salomesmesh/src/StdMeshers/StdMeshers_Prism_3D.cpp +@@ -46,14 +46,18 @@ + + #include + #include ++#include ++#if OCC_VERSION_HEX >= 0x080000 ++#include ++#else + #include ++#endif + #include + #include + #include + #include + #include + #include +-#include + #include + #include + #include diff --git a/cad/freecad/files/patch-src_3rdParty_salomesmesh_src_StdMeshers_StdMeshers__ProjectionUtils.cpp b/cad/freecad/files/patch-src_3rdParty_salomesmesh_src_StdMeshers_StdMeshers__ProjectionUtils.cpp new file mode 100644 index 000000000000..42f3cb9d0e5d --- /dev/null +++ b/cad/freecad/files/patch-src_3rdParty_salomesmesh_src_StdMeshers_StdMeshers__ProjectionUtils.cpp @@ -0,0 +1,16 @@ +--- src/3rdParty/salomesmesh/src/StdMeshers/StdMeshers_ProjectionUtils.cpp.orig 2026-07-01 15:13:02 UTC ++++ src/3rdParty/salomesmesh/src/StdMeshers/StdMeshers_ProjectionUtils.cpp +@@ -57,12 +57,10 @@ + #include + #include + #include +-#include +-#include + #include +-#include + #include + #include ++#include + #include + #include + #include diff --git a/cad/freecad/files/patch-src_3rdParty_salomesmesh_src_StdMeshers_StdMeshers__Projection__1D.cpp b/cad/freecad/files/patch-src_3rdParty_salomesmesh_src_StdMeshers_StdMeshers__Projection__1D.cpp new file mode 100644 index 000000000000..dc0f8f15c43e --- /dev/null +++ b/cad/freecad/files/patch-src_3rdParty_salomesmesh_src_StdMeshers_StdMeshers__Projection__1D.cpp @@ -0,0 +1,10 @@ +--- src/3rdParty/salomesmesh/src/StdMeshers/StdMeshers_Projection_1D.cpp.orig 2026-07-01 15:13:02 UTC ++++ src/3rdParty/salomesmesh/src/StdMeshers/StdMeshers_Projection_1D.cpp +@@ -48,7 +48,6 @@ + #include + #include + #include +-#include + + #include "utilities.h" + diff --git a/cad/freecad/files/patch-src_3rdParty_salomesmesh_src_StdMeshers_StdMeshers__Projection__2D.cpp b/cad/freecad/files/patch-src_3rdParty_salomesmesh_src_StdMeshers_StdMeshers__Projection__2D.cpp new file mode 100644 index 000000000000..d1e096fd31c1 --- /dev/null +++ b/cad/freecad/files/patch-src_3rdParty_salomesmesh_src_StdMeshers_StdMeshers__Projection__2D.cpp @@ -0,0 +1,21 @@ +--- src/3rdParty/salomesmesh/src/StdMeshers/StdMeshers_Projection_2D.cpp.orig 2026-07-01 16:20:28 UTC ++++ src/3rdParty/salomesmesh/src/StdMeshers/StdMeshers_Projection_2D.cpp +@@ -49,13 +49,16 @@ + + #include + #include ++#include ++#if OCC_VERSION_HEX >= 0x080000 ++#include ++#else + #include ++#endif + #include + #include + #include + #include +-#include +-#include + #include + #include + #include diff --git a/cad/freecad/files/patch-src_3rdParty_salomesmesh_src_StdMeshers_StdMeshers__Propagation.cpp b/cad/freecad/files/patch-src_3rdParty_salomesmesh_src_StdMeshers_StdMeshers__Propagation.cpp new file mode 100644 index 000000000000..1d7bb6db386e --- /dev/null +++ b/cad/freecad/files/patch-src_3rdParty_salomesmesh_src_StdMeshers_StdMeshers__Propagation.cpp @@ -0,0 +1,10 @@ +--- src/3rdParty/salomesmesh/src/StdMeshers/StdMeshers_Propagation.cpp.orig 2026-07-01 15:13:02 UTC ++++ src/3rdParty/salomesmesh/src/StdMeshers/StdMeshers_Propagation.cpp +@@ -36,7 +36,6 @@ + #include "SMESH_subMesh.hxx" + + #include +-#include + #include + #include + diff --git a/cad/freecad/files/patch-src_3rdParty_salomesmesh_src_StdMeshers_StdMeshers__Quadrangle__2D.cpp b/cad/freecad/files/patch-src_3rdParty_salomesmesh_src_StdMeshers_StdMeshers__Quadrangle__2D.cpp new file mode 100644 index 000000000000..5c98c5642946 --- /dev/null +++ b/cad/freecad/files/patch-src_3rdParty_salomesmesh_src_StdMeshers_StdMeshers__Quadrangle__2D.cpp @@ -0,0 +1,10 @@ +--- src/3rdParty/salomesmesh/src/StdMeshers/StdMeshers_Quadrangle_2D.cpp.orig 2026-07-01 15:13:02 UTC ++++ src/3rdParty/salomesmesh/src/StdMeshers/StdMeshers_Quadrangle_2D.cpp +@@ -56,7 +56,6 @@ + #include + #include + #include +-#include + #include + #include + diff --git a/cad/freecad/files/patch-src_3rdParty_salomesmesh_src_StdMeshers_StdMeshers__RadialPrism__3D.cpp b/cad/freecad/files/patch-src_3rdParty_salomesmesh_src_StdMeshers_StdMeshers__RadialPrism__3D.cpp new file mode 100644 index 000000000000..c5ba5bf8c713 --- /dev/null +++ b/cad/freecad/files/patch-src_3rdParty_salomesmesh_src_StdMeshers_StdMeshers__RadialPrism__3D.cpp @@ -0,0 +1,10 @@ +--- src/3rdParty/salomesmesh/src/StdMeshers/StdMeshers_RadialPrism_3D.cpp.orig 2026-07-01 15:13:02 UTC ++++ src/3rdParty/salomesmesh/src/StdMeshers/StdMeshers_RadialPrism_3D.cpp +@@ -50,7 +50,6 @@ + #include + #include + #include +-#include + #include + #include + #include diff --git a/cad/freecad/files/patch-src_3rdParty_salomesmesh_src_StdMeshers_StdMeshers__RadialQuadrangle__1D2D.cpp b/cad/freecad/files/patch-src_3rdParty_salomesmesh_src_StdMeshers_StdMeshers__RadialQuadrangle__1D2D.cpp new file mode 100644 index 000000000000..d9fb42198409 --- /dev/null +++ b/cad/freecad/files/patch-src_3rdParty_salomesmesh_src_StdMeshers_StdMeshers__RadialQuadrangle__1D2D.cpp @@ -0,0 +1,10 @@ +--- src/3rdParty/salomesmesh/src/StdMeshers/StdMeshers_RadialQuadrangle_1D2D.cpp.orig 2026-07-01 15:13:02 UTC ++++ src/3rdParty/salomesmesh/src/StdMeshers/StdMeshers_RadialQuadrangle_1D2D.cpp +@@ -50,7 +50,6 @@ + #include + #include + #include +-#include + #include + + diff --git a/cad/freecad/files/patch-src_3rdParty_salomesmesh_src_StdMeshers_StdMeshers__Regular__1D.cpp b/cad/freecad/files/patch-src_3rdParty_salomesmesh_src_StdMeshers_StdMeshers__Regular__1D.cpp new file mode 100644 index 000000000000..ddb5a527d32e --- /dev/null +++ b/cad/freecad/files/patch-src_3rdParty_salomesmesh_src_StdMeshers_StdMeshers__Regular__1D.cpp @@ -0,0 +1,10 @@ +--- src/3rdParty/salomesmesh/src/StdMeshers/StdMeshers_Regular_1D.cpp.orig 2026-07-01 15:13:02 UTC ++++ src/3rdParty/salomesmesh/src/StdMeshers/StdMeshers_Regular_1D.cpp +@@ -63,6 +63,7 @@ + #include + #include + #include ++#include + + #include + #include diff --git a/cad/freecad/files/patch-src_3rdParty_salomesmesh_src_StdMeshers_StdMeshers__ViscousLayers.cpp b/cad/freecad/files/patch-src_3rdParty_salomesmesh_src_StdMeshers_StdMeshers__ViscousLayers.cpp new file mode 100644 index 000000000000..71bcec0e71a2 --- /dev/null +++ b/cad/freecad/files/patch-src_3rdParty_salomesmesh_src_StdMeshers_StdMeshers__ViscousLayers.cpp @@ -0,0 +1,16 @@ +--- src/3rdParty/salomesmesh/src/StdMeshers/StdMeshers_ViscousLayers.cpp.orig 2026-07-01 16:20:28 UTC ++++ src/3rdParty/salomesmesh/src/StdMeshers/StdMeshers_ViscousLayers.cpp +@@ -52,8 +52,13 @@ + #include + #include + #include ++#if OCC_VERSION_HEX >= 0x080000 ++#include ++#include ++#else + #include + #include ++#endif + #include + #include + #include diff --git a/cad/freecad/files/patch-src_3rdParty_salomesmesh_src_StdMeshers_StdMeshers__ViscousLayers2D.cpp b/cad/freecad/files/patch-src_3rdParty_salomesmesh_src_StdMeshers_StdMeshers__ViscousLayers2D.cpp new file mode 100644 index 000000000000..c09076fc46af --- /dev/null +++ b/cad/freecad/files/patch-src_3rdParty_salomesmesh_src_StdMeshers_StdMeshers__ViscousLayers2D.cpp @@ -0,0 +1,25 @@ +--- src/3rdParty/salomesmesh/src/StdMeshers/StdMeshers_ViscousLayers2D.cpp.orig 2026-07-01 16:20:28 UTC ++++ src/3rdParty/salomesmesh/src/StdMeshers/StdMeshers_ViscousLayers2D.cpp +@@ -49,8 +49,14 @@ + #include + #include + #include ++#include ++#if OCC_VERSION_HEX >= 0x080000 ++#include ++#include ++#else + #include + #include ++#endif + #include + #include + #include +@@ -71,7 +77,6 @@ + #include + #include + #include +-#include + #include + #include + #include diff --git a/cad/freecad/files/patch-src_Gui_CMakeLists.txt b/cad/freecad/files/patch-src_Gui_CMakeLists.txt index 9f437154401c..fa74b4ca0c40 100644 --- a/cad/freecad/files/patch-src_Gui_CMakeLists.txt +++ b/cad/freecad/files/patch-src_Gui_CMakeLists.txt @@ -1,11 +1,11 @@ ---- src/Gui/CMakeLists.txt.orig 2024-03-20 18:17:17 UTC +--- src/Gui/CMakeLists.txt.orig 2026-07-01 13:44:31 UTC +++ src/Gui/CMakeLists.txt -@@ -73,7 +73,7 @@ else(MSVC) +@@ -112,7 +112,7 @@ else(MSVC) + set(FreeCADGui_LIBS FreeCADApp - ${COIN3D_LIBRARIES} ${Boost_LIBRARIES} - ${OPENGL_gl_LIBRARY} + ${OPENGL_gl_LIBRARY} -L${CMAKE_INSTALL_PREFIX}/lib ${3DCONNEXION_LINKFLAGS} ) endif(MSVC) diff --git a/cad/freecad/files/patch-src_Mod_CAM_App_Area.cpp b/cad/freecad/files/patch-src_Mod_CAM_App_Area.cpp new file mode 100644 index 000000000000..3d70c9c3b390 --- /dev/null +++ b/cad/freecad/files/patch-src_Mod_CAM_App_Area.cpp @@ -0,0 +1,11 @@ +--- src/Mod/CAM/App/Area.cpp.orig 2026-07-02 14:27:52 UTC ++++ src/Mod/CAM/App/Area.cpp +@@ -381,7 +381,7 @@ static std::vector discretize(const TopoDS_Edg + // + GCPnts_UniformDeflection discretizer(curve, deflection, efirst, elast); + if (!discretizer.IsDone()) { +- Standard_Failure::Raise("Curve discretization failed"); ++ throw Standard_Failure("Curve discretization failed"); + } + if (discretizer.NbPoints() > 1) { + int nbPoints = discretizer.NbPoints(); diff --git a/cad/freecad/files/patch-src_Mod_Import_App_ImportOCAF2.cpp b/cad/freecad/files/patch-src_Mod_Import_App_ImportOCAF2.cpp new file mode 100644 index 000000000000..b93a2fbb1352 --- /dev/null +++ b/cad/freecad/files/patch-src_Mod_Import_App_ImportOCAF2.cpp @@ -0,0 +1,10 @@ +--- src/Mod/Import/App/ImportOCAF2.cpp.orig 2026-07-02 13:42:30 UTC ++++ src/Mod/Import/App/ImportOCAF2.cpp +@@ -38,6 +38,7 @@ + #include + #include + #include ++#include + + + #include diff --git a/cad/freecad/files/patch-src_Mod_Import_App_ImportOCAF2.h b/cad/freecad/files/patch-src_Mod_Import_App_ImportOCAF2.h new file mode 100644 index 000000000000..d7eebabf4a00 --- /dev/null +++ b/cad/freecad/files/patch-src_Mod_Import_App_ImportOCAF2.h @@ -0,0 +1,10 @@ +--- src/Mod/Import/App/ImportOCAF2.h.orig 2026-07-02 13:09:26 UTC ++++ src/Mod/Import/App/ImportOCAF2.h +@@ -35,6 +35,7 @@ + #include + #include + #include ++#include + + #include + #include diff --git a/cad/freecad/files/patch-src_Mod_Import_App_StepShape.cpp b/cad/freecad/files/patch-src_Mod_Import_App_StepShape.cpp new file mode 100644 index 000000000000..893b10049207 --- /dev/null +++ b/cad/freecad/files/patch-src_Mod_Import_App_StepShape.cpp @@ -0,0 +1,10 @@ +--- src/Mod/Import/App/StepShape.cpp.orig 2026-07-02 13:42:30 UTC ++++ src/Mod/Import/App/StepShape.cpp +@@ -34,6 +34,7 @@ + #include + #include + #include ++#include + + #include "StepShape.h" + diff --git a/cad/freecad/files/patch-src_Mod_Import_App_dxf_ImpExpDxf.cpp b/cad/freecad/files/patch-src_Mod_Import_App_dxf_ImpExpDxf.cpp new file mode 100644 index 000000000000..1313e8e66a78 --- /dev/null +++ b/cad/freecad/files/patch-src_Mod_Import_App_dxf_ImpExpDxf.cpp @@ -0,0 +1,12 @@ +--- src/Mod/Import/App/dxf/ImpExpDxf.cpp.orig 2026-07-02 13:42:30 UTC ++++ src/Mod/Import/App/dxf/ImpExpDxf.cpp +@@ -45,6 +45,9 @@ + #include + #include + #include ++#include ++#include ++#include + #include + #include + #include diff --git a/cad/freecad/files/patch-src_Mod_Import_Gui_OCAFBrowser.cpp b/cad/freecad/files/patch-src_Mod_Import_Gui_OCAFBrowser.cpp new file mode 100644 index 000000000000..dc34bbb7ed05 --- /dev/null +++ b/cad/freecad/files/patch-src_Mod_Import_Gui_OCAFBrowser.cpp @@ -0,0 +1,10 @@ +--- src/Mod/Import/Gui/OCAFBrowser.cpp.orig 2026-07-02 13:42:30 UTC ++++ src/Mod/Import/Gui/OCAFBrowser.cpp +@@ -41,7 +41,6 @@ + #include + #include + #include +-#include + #include + #include + #include diff --git a/cad/freecad/files/patch-src_Mod_Inspection_App_InspectionFeature.cpp b/cad/freecad/files/patch-src_Mod_Inspection_App_InspectionFeature.cpp new file mode 100644 index 000000000000..2b2fe78cc37d --- /dev/null +++ b/cad/freecad/files/patch-src_Mod_Inspection_App_InspectionFeature.cpp @@ -0,0 +1,10 @@ +--- src/Mod/Inspection/App/InspectionFeature.cpp.orig 2026-07-02 13:09:26 UTC ++++ src/Mod/Inspection/App/InspectionFeature.cpp +@@ -32,6 +32,7 @@ + #include + #include + #include ++#include + #include + + #include diff --git a/cad/freecad/files/patch-src_Mod_PartDesign_App_FeatureTransformed.cpp b/cad/freecad/files/patch-src_Mod_PartDesign_App_FeatureTransformed.cpp new file mode 100644 index 000000000000..0fc38bdfed91 --- /dev/null +++ b/cad/freecad/files/patch-src_Mod_PartDesign_App_FeatureTransformed.cpp @@ -0,0 +1,11 @@ +--- src/Mod/PartDesign/App/FeatureTransformed.cpp.orig 2026-07-02 13:09:26 UTC ++++ src/Mod/PartDesign/App/FeatureTransformed.cpp +@@ -445,7 +445,7 @@ TopoDS_Shape Transformed::getRemainingSolids(const Top + builder.MakeCompound(compShape); + + if (shape.IsNull()) { +- Standard_Failure::Raise("Shape is null"); ++ throw Standard_Failure("Shape is null"); + } + TopExp_Explorer xp; + xp.Init(shape, TopAbs_SOLID); diff --git a/cad/freecad/files/patch-src_Mod_Part_App_AppPartPy.cpp b/cad/freecad/files/patch-src_Mod_Part_App_AppPartPy.cpp new file mode 100644 index 000000000000..d3c9a766eb95 --- /dev/null +++ b/cad/freecad/files/patch-src_Mod_Part_App_AppPartPy.cpp @@ -0,0 +1,20 @@ +--- src/Mod/Part/App/AppPartPy.cpp.orig 2026-07-01 20:30:18 UTC ++++ src/Mod/Part/App/AppPartPy.cpp +@@ -67,7 +67,7 @@ + #include + #include + #include +-#include ++#include + + #include + +@@ -1633,7 +1633,7 @@ class Module: public Py::ExtensionModule (priv + } + + if (!mkPoly.IsDone()) { +- Standard_Failure::Raise( ++ throw Standard_Failure( + "Cannot create polygon because less than two vertices are given" + ); + } diff --git a/cad/freecad/files/patch-src_Mod_Part_App_BRepFeat_MakePrismPyImp.cpp b/cad/freecad/files/patch-src_Mod_Part_App_BRepFeat_MakePrismPyImp.cpp new file mode 100644 index 000000000000..71d8f1e66739 --- /dev/null +++ b/cad/freecad/files/patch-src_Mod_Part_App_BRepFeat_MakePrismPyImp.cpp @@ -0,0 +1,10 @@ +--- src/Mod/Part/App/BRepFeat/MakePrismPyImp.cpp.orig 2026-07-01 20:50:53 UTC ++++ src/Mod/Part/App/BRepFeat/MakePrismPyImp.cpp +@@ -27,6 +27,7 @@ + #include + #include + #include ++#include + + + #include diff --git a/cad/freecad/files/patch-src_Mod_Part_App_BRepOffsetAPI__MakeOffsetFix.cpp b/cad/freecad/files/patch-src_Mod_Part_App_BRepOffsetAPI__MakeOffsetFix.cpp new file mode 100644 index 000000000000..bc71546e8cd2 --- /dev/null +++ b/cad/freecad/files/patch-src_Mod_Part_App_BRepOffsetAPI__MakeOffsetFix.cpp @@ -0,0 +1,10 @@ +--- src/Mod/Part/App/BRepOffsetAPI_MakeOffsetFix.cpp.orig 2026-07-01 20:50:53 UTC ++++ src/Mod/Part/App/BRepOffsetAPI_MakeOffsetFix.cpp +@@ -37,7 +37,6 @@ + #include + #include + #include +-#include + #include + #include + diff --git a/cad/freecad/files/patch-src_Mod_Part_App_BRepOffsetAPI__MakePipeShellPyImp.cpp b/cad/freecad/files/patch-src_Mod_Part_App_BRepOffsetAPI__MakePipeShellPyImp.cpp new file mode 100644 index 000000000000..41305818fe57 --- /dev/null +++ b/cad/freecad/files/patch-src_Mod_Part_App_BRepOffsetAPI__MakePipeShellPyImp.cpp @@ -0,0 +1,10 @@ +--- src/Mod/Part/App/BRepOffsetAPI_MakePipeShellPyImp.cpp.orig 2026-07-01 20:50:53 UTC ++++ src/Mod/Part/App/BRepOffsetAPI_MakePipeShellPyImp.cpp +@@ -30,7 +30,6 @@ + #include + #include + #include +-#include + + + #include diff --git a/cad/freecad/files/patch-src_Mod_Part_App_BSplineCurvePyImp.cpp b/cad/freecad/files/patch-src_Mod_Part_App_BSplineCurvePyImp.cpp new file mode 100644 index 000000000000..0d65f5036ffc --- /dev/null +++ b/cad/freecad/files/patch-src_Mod_Part_App_BSplineCurvePyImp.cpp @@ -0,0 +1,181 @@ +--- src/Mod/Part/App/BSplineCurvePyImp.cpp.orig 2026-07-02 09:44:54 UTC ++++ src/Mod/Part/App/BSplineCurvePyImp.cpp +@@ -313,7 +313,7 @@ PyObject* BSplineCurvePy::segment(PyObject* args) + tempCurve->Segment(u1, u2); + if (std::abs(tempCurve->FirstParameter() - u1) > Precision::Approximation() + || std::abs(tempCurve->LastParameter() - u2) > Precision::Approximation()) { +- Standard_Failure::Raise("Failed to segment BSpline curve"); ++ throw Standard_Failure("Failed to segment BSpline curve"); + return nullptr; + } + else { +@@ -938,7 +938,7 @@ PyObject* BSplineCurvePy::approximate(PyObject* args, + } + + if (degMin > degMax) { +- Standard_Failure::Raise("DegMin must be lower or equal to DegMax"); ++ throw Standard_Failure("DegMin must be lower or equal to DegMax"); + } + + GeomAbs_Shape c; +@@ -977,7 +977,7 @@ PyObject* BSplineCurvePy::approximate(PyObject* args, + Py_Return; + } + else { +- Standard_Failure::Raise("Smoothing approximation failed"); ++ throw Standard_Failure("Smoothing approximation failed"); + return nullptr; // goes to the catch block + } + } +@@ -998,7 +998,7 @@ PyObject* BSplineCurvePy::approximate(PyObject* args, + Py_Return; + } + else { +- Standard_Failure::Raise("Approximation with parameters failed"); ++ throw Standard_Failure("Approximation with parameters failed"); + return nullptr; // goes to the catch block + } + } +@@ -1022,7 +1022,7 @@ PyObject* BSplineCurvePy::approximate(PyObject* args, + Py_Return; + } + else { +- Standard_Failure::Raise("failed to approximate points"); ++ throw Standard_Failure("failed to approximate points"); + return nullptr; // goes to the catch block + } + } +@@ -1152,7 +1152,7 @@ PyObject* BSplineCurvePy::interpolate(PyObject* args, + } + + if (interpolationPoints->Length() < 2) { +- Standard_Failure::Raise("not enough points given"); ++ throw Standard_Failure("not enough points given"); + } + + Handle(TColStd_HArray1OfReal) parameters; +@@ -1221,14 +1221,18 @@ PyObject* BSplineCurvePy::interpolate(PyObject* args, + Py_Return; + } + else { +- Standard_Failure::Raise("failed to interpolate points"); ++ throw Standard_Failure("failed to interpolate points"); + return nullptr; // goes to the catch block + } + } + catch (Standard_Failure& e) { + std::string err = e.GetMessageString(); + if (err.empty()) { ++#if OCC_VERSION_HEX >= 0x080000 ++ err = e.ExceptionType(); ++#else + err = e.DynamicType()->Name(); ++#endif + } + PyErr_SetString(PartExceptionOCCError, err.c_str()); + return nullptr; +@@ -1285,7 +1289,7 @@ PyObject* BSplineCurvePy::buildFromPoles(PyObject* arg + Py_Return; + } + else { +- Standard_Failure::Raise("failed to create spline"); ++ throw Standard_Failure("failed to create spline"); + return nullptr; // goes to the catch block + } + } +@@ -1306,7 +1310,7 @@ PyObject* BSplineCurvePy::buildFromPoles(PyObject* arg + Py_Return; + } + else { +- Standard_Failure::Raise("failed to create spline"); ++ throw Standard_Failure("failed to create spline"); + return nullptr; // goes to the catch block + } + } +@@ -1354,7 +1358,7 @@ PyObject* BSplineCurvePy::buildFromPolesMultsKnots(PyO + + number_of_poles = list.size(); + if ((number_of_poles) < 2) { +- Standard_Failure::Raise("need two or more poles"); ++ throw Standard_Failure("need two or more poles"); + return nullptr; + } + TColgp_Array1OfPnt occpoles(1, number_of_poles); +@@ -1368,7 +1372,7 @@ PyObject* BSplineCurvePy::buildFromPolesMultsKnots(PyO + if (mults != Py_None && knots != Py_None) { + number_of_knots = PyObject_Length(mults); + if (PyObject_Length(knots) != number_of_knots) { +- Standard_Failure::Raise("number of knots and mults mismatch"); ++ throw Standard_Failure("number of knots and mults mismatch"); + return nullptr; + } + } +@@ -1429,7 +1433,7 @@ PyObject* BSplineCurvePy::buildFromPolesMultsKnots(PyO + // check multiplicity of inner knots + for (Standard_Integer i = 2; i < occmults.Length(); i++) { + if (occmults(i) > degree) { +- Standard_Failure::Raise("multiplicity of inner knot higher than degree"); ++ throw Standard_Failure("multiplicity of inner knot higher than degree"); + } + } + if (knots != Py_None) { // knots are given +@@ -1449,7 +1453,7 @@ PyObject* BSplineCurvePy::buildFromPolesMultsKnots(PyO + } + if (weights != Py_None) { // weights are given + if (PyObject_Length(weights) != number_of_poles) { +- Standard_Failure::Raise("number of poles and weights mismatch"); ++ throw Standard_Failure("number of poles and weights mismatch"); + return nullptr; + } // complain about mismatch + Py::Sequence weightssq(weights); +@@ -1467,7 +1471,7 @@ PyObject* BSplineCurvePy::buildFromPolesMultsKnots(PyO + // check if the number of poles matches the sum of mults + if ((Base::asBoolean(periodic) && sum_of_mults != number_of_poles) + || (!Base::asBoolean(periodic) && sum_of_mults - degree - 1 != number_of_poles)) { +- Standard_Failure::Raise("number of poles and sum of mults mismatch"); ++ throw Standard_Failure("number of poles and sum of mults mismatch"); + return (nullptr); + } + +@@ -1485,7 +1489,7 @@ PyObject* BSplineCurvePy::buildFromPolesMultsKnots(PyO + Py_Return; + } + else { +- Standard_Failure::Raise("failed to create spline"); ++ throw Standard_Failure("failed to create spline"); + return nullptr; // goes to the catch block + } + } +@@ -1564,7 +1568,11 @@ PyObject* BSplineCurvePy::makeC1Continuous(PyObject* a + catch (Standard_Failure& e) { + std::string err = e.GetMessageString(); + if (err.empty()) { ++#if OCC_VERSION_HEX >= 0x080000 ++ err = e.ExceptionType(); ++#else + err = e.DynamicType()->Name(); ++#endif + } + PyErr_SetString(PartExceptionOCCError, err.c_str()); + return nullptr; +@@ -1580,7 +1588,7 @@ PyObject* BSplineCurvePy::scaleKnotsToBounds(PyObject* + } + try { + if (u0 >= u1) { +- Standard_Failure::Raise("Bad parameter range"); ++ throw Standard_Failure("Bad parameter range"); + return nullptr; + } + GeomBSplineCurve* curve = getGeomBSplineCurvePtr(); +@@ -1590,7 +1598,11 @@ PyObject* BSplineCurvePy::scaleKnotsToBounds(PyObject* + catch (Standard_Failure& e) { + std::string err = e.GetMessageString(); + if (err.empty()) { ++#if OCC_VERSION_HEX >= 0x080000 ++ err = e.ExceptionType(); ++#else + err = e.DynamicType()->Name(); ++#endif + } + PyErr_SetString(PartExceptionOCCError, err.c_str()); + return nullptr; diff --git a/cad/freecad/files/patch-src_Mod_Part_App_BSplineSurfacePyImp.cpp b/cad/freecad/files/patch-src_Mod_Part_App_BSplineSurfacePyImp.cpp new file mode 100644 index 000000000000..cba36090ac25 --- /dev/null +++ b/cad/freecad/files/patch-src_Mod_Part_App_BSplineSurfacePyImp.cpp @@ -0,0 +1,135 @@ +--- src/Mod/Part/App/BSplineSurfacePyImp.cpp.orig 2026-07-02 10:00:05 UTC ++++ src/Mod/Part/App/BSplineSurfacePyImp.cpp +@@ -31,6 +31,7 @@ + #include + #include + #include ++#include + + #include + +@@ -1360,11 +1361,11 @@ PyObject* BSplineSurfacePy::approximate(PyObject* args + } + + if (continuity < 0 || continuity > 2) { +- Standard_Failure::Raise("continuity must be between 0 and 2"); ++ throw Standard_Failure("continuity must be between 0 and 2"); + } + + if (interpolationPoints.RowLength() < 2 || interpolationPoints.ColLength() < 2) { +- Standard_Failure::Raise("not enough points given"); ++ throw Standard_Failure("not enough points given"); + } + + GeomAbs_Shape c = GeomAbs_C2; +@@ -1420,7 +1421,11 @@ PyObject* BSplineSurfacePy::approximate(PyObject* args + catch (Standard_Failure& e) { + std::string err = e.GetMessageString(); + if (err.empty()) { ++#if OCC_VERSION_HEX >= 0x080000 ++ err = e.ExceptionType(); ++#else + err = e.DynamicType()->Name(); ++#endif + } + PyErr_SetString(PartExceptionOCCError, err.c_str()); + return nullptr; +@@ -1470,7 +1475,7 @@ PyObject* BSplineSurfacePy::interpolate(PyObject* args + } + + if (interpolationPoints.RowLength() < 2 || interpolationPoints.ColLength() < 2) { +- Standard_Failure::Raise("not enough points given"); ++ throw Standard_Failure("not enough points given"); + } + + GeomAPI_PointsToBSplineSurface surInterpolation; +@@ -1487,7 +1492,11 @@ PyObject* BSplineSurfacePy::interpolate(PyObject* args + catch (Standard_Failure& e) { + std::string err = e.GetMessageString(); + if (err.empty()) { ++#if OCC_VERSION_HEX >= 0x080000 ++ err = e.ExceptionType(); ++#else + err = e.DynamicType()->Name(); ++#endif + } + PyErr_SetString(PartExceptionOCCError, err.c_str()); + return nullptr; +@@ -1570,7 +1579,7 @@ PyObject* BSplineSurfacePy::buildFromPolesMultsKnots(P + } + } + if (occpoles.RowLength() < 2 || occpoles.ColLength() < 2) { +- Standard_Failure::Raise("not enough points given"); ++ throw Standard_Failure("not enough points given"); + } + if (!genweights) { // copy the weights + Py::Sequence list(weights); +@@ -1578,7 +1587,7 @@ PyObject* BSplineSurfacePy::buildFromPolesMultsKnots(P + Py::Sequence col(list.getItem(0)); + Standard_Integer lwv = col.size(); + if (lwu != lu || lwv != lv) { +- Standard_Failure::Raise("weights and poles mismatch"); ++ throw Standard_Failure("weights and poles mismatch"); + } + Standard_Integer index1 = 0; + Standard_Integer index2 = 0; +@@ -1597,7 +1606,7 @@ PyObject* BSplineSurfacePy::buildFromPolesMultsKnots(P + number_of_vknots = PyObject_Length(vmults); + if (((uknots != Py_None) && PyObject_Length(uknots) != number_of_uknots) + || ((vknots != Py_None) && PyObject_Length(vknots) != number_of_vknots)) { +- Standard_Failure::Raise("number of knots and mults mismatch"); ++ throw Standard_Failure("number of knots and mults mismatch"); + return nullptr; + } + // copy mults +@@ -1664,17 +1673,17 @@ PyObject* BSplineSurfacePy::buildFromPolesMultsKnots(P + || (!Base::asBoolean(uperiodic) && sum_of_umults - udegree - 1 != lu) + || (Base::asBoolean(vperiodic) && sum_of_vmults != lv) + || (!Base::asBoolean(vperiodic) && sum_of_vmults - vdegree - 1 != lv)) { +- Standard_Failure::Raise("number of poles and sum of mults mismatch"); ++ throw Standard_Failure("number of poles and sum of mults mismatch"); + } + // check multiplicity of inner knots + for (Standard_Integer i = 2; i < occumults.Length(); i++) { + if (occumults(i) > udegree) { +- Standard_Failure::Raise("multiplicity of inner knot higher than degree"); ++ throw Standard_Failure("multiplicity of inner knot higher than degree"); + } + } + for (Standard_Integer i = 2; i < occvmults.Length(); i++) { + if (occvmults(i) > vdegree) { +- Standard_Failure::Raise("multiplicity of inner knot higher than degree"); ++ throw Standard_Failure("multiplicity of inner knot higher than degree"); + } + } + +@@ -1695,7 +1704,7 @@ PyObject* BSplineSurfacePy::buildFromPolesMultsKnots(P + Py_Return; + } + else { +- Standard_Failure::Raise("failed to create spline"); ++ throw Standard_Failure("failed to create spline"); + return nullptr; // goes to the catch block + } + } +@@ -1923,7 +1932,7 @@ PyObject* BSplineSurfacePy::scaleKnotsToBounds(PyObjec + } + try { + if (u0 >= u1 || v0 >= v1) { +- Standard_Failure::Raise("Bad parameter range"); ++ throw Standard_Failure("Bad parameter range"); + return nullptr; + ; + } +@@ -1934,7 +1943,11 @@ PyObject* BSplineSurfacePy::scaleKnotsToBounds(PyObjec + catch (Standard_Failure& e) { + std::string err = e.GetMessageString(); + if (err.empty()) { ++#if OCC_VERSION_HEX >= 0x080000 ++ err = e.ExceptionType(); ++#else + err = e.DynamicType()->Name(); ++#endif + } + PyErr_SetString(PartExceptionOCCError, err.c_str()); + return nullptr; diff --git a/cad/freecad/files/patch-src_Mod_Part_App_BezierCurvePyImp.cpp b/cad/freecad/files/patch-src_Mod_Part_App_BezierCurvePyImp.cpp new file mode 100644 index 000000000000..7abcd862971f --- /dev/null +++ b/cad/freecad/files/patch-src_Mod_Part_App_BezierCurvePyImp.cpp @@ -0,0 +1,48 @@ +--- src/Mod/Part/App/BezierCurvePyImp.cpp.orig 2026-07-01 20:30:18 UTC ++++ src/Mod/Part/App/BezierCurvePyImp.cpp +@@ -388,7 +388,7 @@ PyObject* BezierCurvePy::interpolate(PyObject* args) + Py::Sequence constraints(obj); + int nb_pts = constraints.size(); + if (nb_pts < 2) { +- Standard_Failure::Raise("not enough points given"); ++ throw Standard_Failure("not enough points given"); + } + + TColStd_Array1OfReal params(1, nb_pts); +@@ -396,7 +396,7 @@ PyObject* BezierCurvePy::interpolate(PyObject* args) + Py::Sequence plist(par); + int param_size = plist.size(); + if (param_size != nb_pts) { +- Standard_Failure::Raise("number of points and parameters don't match"); ++ throw Standard_Failure("number of points and parameters don't match"); + } + int idx = 1; + for (Py::Sequence::iterator pit = plist.begin(); pit != plist.end(); ++pit) { +@@ -416,7 +416,7 @@ PyObject* BezierCurvePy::interpolate(PyObject* args) + num_poles += (int)row.size(); + } + if (num_poles > curve->MaxDegree()) { +- Standard_Failure::Raise("number of constraints exceeds bezier curve capacity"); ++ throw Standard_Failure("number of constraints exceeds bezier curve capacity"); + } + // create a bezier-type knot sequence + TColStd_Array1OfReal knots(1, 2 * num_poles); +@@ -459,15 +459,15 @@ PyObject* BezierCurvePy::interpolate(PyObject* args) + math_Gauss gauss(OCCmatrix); + gauss.Solve(res_x); + if (!gauss.IsDone()) { +- Standard_Failure::Raise("Failed to solve equations"); ++ throw Standard_Failure("Failed to solve equations"); + } + gauss.Solve(res_y); + if (!gauss.IsDone()) { +- Standard_Failure::Raise("Failed to solve equations"); ++ throw Standard_Failure("Failed to solve equations"); + } + gauss.Solve(res_z); + if (!gauss.IsDone()) { +- Standard_Failure::Raise("Failed to solve equations"); ++ throw Standard_Failure("Failed to solve equations"); + } + + TColgp_Array1OfPnt poles(1, num_poles); diff --git a/cad/freecad/files/patch-src_Mod_Part_App_ExtrusionHelper.cpp b/cad/freecad/files/patch-src_Mod_Part_App_ExtrusionHelper.cpp new file mode 100644 index 000000000000..ae331834143b --- /dev/null +++ b/cad/freecad/files/patch-src_Mod_Part_App_ExtrusionHelper.cpp @@ -0,0 +1,117 @@ +--- src/Mod/Part/App/ExtrusionHelper.cpp.orig 2026-07-01 20:50:53 UTC ++++ src/Mod/Part/App/ExtrusionHelper.cpp +@@ -92,13 +92,13 @@ void ExtrusionHelper::makeDraft( + bool bMid = !bFwd || !bRev || -1.0 * AngleFwd != AngleRev; + + if (shape.IsNull()) { +- Standard_Failure::Raise("Not a valid shape"); ++ throw Standard_Failure("Not a valid shape"); + } + + // store all wires of the shape into an array + size_t numWires = addWiresToWireSections(wiresections); + if (numWires == 0) { +- Standard_Failure::Raise("Extrusion: Input must not only consist if a vertex"); ++ throw Standard_Failure("Extrusion: Input must not only consist if a vertex"); + } + + // to store the sections for the loft +@@ -128,7 +128,7 @@ void ExtrusionHelper::makeDraft( + auto tempFace = mkFace.Shape(); + BRepPrimAPI_MakePrism mkPrism(tempFace, vecFwd); + if (!mkPrism.IsDone()) { +- Standard_Failure::Raise("Extrusion: Generating prism failed"); ++ throw Standard_Failure("Extrusion: Generating prism failed"); + } + singlePrism = mkPrism.Shape(); + resultPrisms.push_back(singlePrism); +@@ -287,7 +287,7 @@ void ExtrusionHelper::makeDraft( + } + mkTS.Build(); + if (!mkTS.IsDone()) { +- Standard_Failure::Raise("Extrusion: Loft could not be built"); ++ throw Standard_Failure("Extrusion: Loft could not be built"); + } + + shells.push_back(mkTS.Shape()); +@@ -321,7 +321,7 @@ void ExtrusionHelper::makeDraft( + ); + FCBRepAlgoAPI_Cut mkCut(*itOuter, *itInner); + if (!mkCut.IsDone()) { +- Standard_Failure::Raise("Extrusion: Final cut out failed"); ++ throw Standard_Failure("Extrusion: Final cut out failed"); + } + BRepGProp::VolumeProperties(mkCut.Shape(), tempProperties); + momentOfInertiaFinal = tempProperties.MomentOfInertia( +@@ -415,7 +415,7 @@ void ExtrusionHelper::checkInnerWires( + momentOfInertiaInitial = tempProperties.MomentOfInertia(gp_Ax1(gp_Pnt(), direction)); + FCBRepAlgoAPI_Cut mkCut(*itInner, *itOuter); + if (!mkCut.IsDone()) { +- Standard_Failure::Raise("Extrusion: Cut out failed"); ++ throw Standard_Failure("Extrusion: Cut out failed"); + } + BRepGProp::VolumeProperties(mkCut.Shape(), tempProperties); + momentOfInertiaFinal = tempProperties.MomentOfInertia(gp_Ax1(gp_Pnt(), direction)); +@@ -520,7 +520,7 @@ void ExtrusionHelper::createTaperedPrismOffset( + throw Base::RuntimeError(e.what()); + } + if (!mkOffset.IsDone()) { +- Standard_Failure::Raise("Extrusion: Offset could not be created"); ++ throw Standard_Failure("Extrusion: Offset could not be created"); + } + } + else { +@@ -539,7 +539,7 @@ void ExtrusionHelper::createTaperedPrismOffset( + "This means most probably that the along taper angle is too large or small.\n" + ); + } +- Standard_Failure::Raise("Extrusion: end face of tapered extrusion is empty"); ++ throw Standard_Failure("Extrusion: end face of tapered extrusion is empty"); + } + // assure we return a wire and no edge + TopAbs_ShapeEnum type = offsetShape.ShapeType(); +@@ -592,7 +592,7 @@ void ExtrusionHelper::makeElementDraft( + TopoShape shape = _shape; + TopoShape sourceWire; + if (shape.isNull()) { +- Standard_Failure::Raise("Not a valid shape"); ++ throw Standard_Failure("Not a valid shape"); + } + + if (params.solid && !shape.hasSubShape(TopAbs_FACE)) { +@@ -603,7 +603,7 @@ void ExtrusionHelper::makeElementDraft( + std::vector wires; + TopoShape outerWire = shape.splitWires(&wires, TopoShape::ReorientForward); + if (outerWire.isNull()) { +- Standard_Failure::Raise("Missing outer wire"); ++ throw Standard_Failure("Missing outer wire"); + } + if (wires.empty()) { + shape = outerWire; +@@ -612,7 +612,7 @@ void ExtrusionHelper::makeElementDraft( + unsigned pos = drafts.size(); + makeElementDraft(params, outerWire, drafts, hasher); + if (drafts.size() != pos + 1) { +- Standard_Failure::Raise("Failed to make drafted extrusion"); ++ throw Standard_Failure("Failed to make drafted extrusion"); + } + std::vector inner; + // Inner wires are lofted into separate solids and then cut from the +@@ -626,7 +626,7 @@ void ExtrusionHelper::makeElementDraft( + makeElementDraft(innerParams, innerWire, inner, hasher); + } + if (inner.empty()) { +- Standard_Failure::Raise("Failed to make drafted extrusion with inner hole"); ++ throw Standard_Failure("Failed to make drafted extrusion with inner hole"); + } + inner.insert(inner.begin(), drafts.back()); + drafts.back().makeElementCut(inner); +@@ -650,7 +650,7 @@ void ExtrusionHelper::makeElementDraft( + } + } + else { +- Standard_Failure::Raise("Only a wire or a face is supported"); ++ throw Standard_Failure("Only a wire or a face is supported"); + } + + if (!sourceWire.isNull()) { diff --git a/cad/freecad/files/patch-src_Mod_Part_App_FCBRepAlgoAPI__BooleanOperation.cpp b/cad/freecad/files/patch-src_Mod_Part_App_FCBRepAlgoAPI__BooleanOperation.cpp new file mode 100644 index 000000000000..ee08b7e20859 --- /dev/null +++ b/cad/freecad/files/patch-src_Mod_Part_App_FCBRepAlgoAPI__BooleanOperation.cpp @@ -0,0 +1,20 @@ +--- src/Mod/Part/App/FCBRepAlgoAPI_BooleanOperation.cpp.orig 2026-07-01 20:30:18 UTC ++++ src/Mod/Part/App/FCBRepAlgoAPI_BooleanOperation.cpp +@@ -104,7 +104,7 @@ void FCBRepAlgoAPI_BooleanOperation::Build(const Messa + void FCBRepAlgoAPI_BooleanOperation::Build(const Message_ProgressRange& progressRange) + { + if (progressRange.UserBreak()) { +- Standard_ConstructionError::Raise("User aborted"); ++ throw Standard_ConstructionError("User aborted"); + } + if (myOperation == BOPAlgo_CUT && myArguments.Size() == 1 && myTools.Size() == 1 + && myTools.First().ShapeType() == TopAbs_COMPOUND) { +@@ -130,7 +130,7 @@ void FCBRepAlgoAPI_BooleanOperation::Build(const Messa + #endif + } + if (progressRange.UserBreak()) { +- Standard_ConstructionError::Raise("User aborted"); ++ throw Standard_ConstructionError("User aborted"); + } + } + diff --git a/cad/freecad/files/patch-src_Mod_Part_App_FCBRepAlgoAPI__BooleanOperation.h b/cad/freecad/files/patch-src_Mod_Part_App_FCBRepAlgoAPI__BooleanOperation.h new file mode 100644 index 000000000000..a40ab437e967 --- /dev/null +++ b/cad/freecad/files/patch-src_Mod_Part_App_FCBRepAlgoAPI__BooleanOperation.h @@ -0,0 +1,10 @@ +--- src/Mod/Part/App/FCBRepAlgoAPI_BooleanOperation.h.orig 2026-07-01 20:30:17 UTC ++++ src/Mod/Part/App/FCBRepAlgoAPI_BooleanOperation.h +@@ -31,6 +31,7 @@ + + #include + #include ++#include + + class FCBRepAlgoAPIHelper + { diff --git a/cad/freecad/files/patch-src_Mod_Part_App_FCBRepAlgoAPI__Section.cpp b/cad/freecad/files/patch-src_Mod_Part_App_FCBRepAlgoAPI__Section.cpp new file mode 100644 index 000000000000..ae98d8354e49 --- /dev/null +++ b/cad/freecad/files/patch-src_Mod_Part_App_FCBRepAlgoAPI__Section.cpp @@ -0,0 +1,24 @@ +--- src/Mod/Part/App/FCBRepAlgoAPI_Section.cpp.orig 2026-07-01 20:50:53 UTC ++++ src/Mod/Part/App/FCBRepAlgoAPI_Section.cpp +@@ -48,10 +48,10 @@ FCBRepAlgoAPI_Section::FCBRepAlgoAPI_Section( + : BRepAlgoAPI_Section(S1, S2, false) + { + if (!BRepCheck_Analyzer(S1).IsValid()) { +- Standard_ConstructionError::Raise("Base shape is not valid for boolean operation"); ++ throw Standard_ConstructionError("Base shape is not valid for boolean operation"); + } + if (!BRepCheck_Analyzer(S2).IsValid()) { +- Standard_ConstructionError::Raise("Tool shape is not valid for boolean operation"); ++ throw Standard_ConstructionError("Tool shape is not valid for boolean operation"); + } + setAutoFuzzy(); + SetRunParallel(Standard_True); +@@ -69,7 +69,7 @@ FCBRepAlgoAPI_Section::FCBRepAlgoAPI_Section( + : BRepAlgoAPI_Section(Sh, Pl, false) + { + if (!BRepCheck_Analyzer(Sh).IsValid()) { +- Standard_ConstructionError::Raise("Base shape is not valid for boolean operation"); ++ throw Standard_ConstructionError("Base shape is not valid for boolean operation"); + } + setAutoFuzzy(); + SetRunParallel(Standard_True); diff --git a/cad/freecad/files/patch-src_Mod_Part_App_FaceMakerCheese.cpp b/cad/freecad/files/patch-src_Mod_Part_App_FaceMakerCheese.cpp new file mode 100644 index 000000000000..b5a9abf1b737 --- /dev/null +++ b/cad/freecad/files/patch-src_Mod_Part_App_FaceMakerCheese.cpp @@ -0,0 +1,20 @@ +--- src/Mod/Part/App/FaceMakerCheese.cpp.orig 2026-07-01 20:50:53 UTC ++++ src/Mod/Part/App/FaceMakerCheese.cpp +@@ -88,7 +88,7 @@ TopoDS_Face FaceMakerCheese::validateFace(const TopoDS + TopoDS_Face fixedFace = TopoDS::Face(fix.Shape()); + aChecker.Init(fixedFace); + if (!aChecker.IsValid()) { +- Standard_Failure::Raise("Failed to validate broken face"); ++ throw Standard_Failure("Failed to validate broken face"); + } + return fixedFace; + } +@@ -132,7 +132,7 @@ bool FaceMakerCheese::isInside(const TopoDS_Wire& wire + + BRepBuilderAPI_MakeFace mkFace(wire1); + if (!mkFace.IsDone()) { +- Standard_Failure::Raise("Failed to create a face from wire in sketch"); ++ throw Standard_Failure("Failed to create a face from wire in sketch"); + } + TopoDS_Face face = validateFace(mkFace.Face()); + BRepAdaptor_Surface adapt(face); diff --git a/cad/freecad/files/patch-src_Mod_Part_App_FeatureExtrusion.cpp b/cad/freecad/files/patch-src_Mod_Part_App_FeatureExtrusion.cpp new file mode 100644 index 000000000000..c19df3b4453d --- /dev/null +++ b/cad/freecad/files/patch-src_Mod_Part_App_FeatureExtrusion.cpp @@ -0,0 +1,20 @@ +--- src/Mod/Part/App/FeatureExtrusion.cpp.orig 2026-07-01 20:50:53 UTC ++++ src/Mod/Part/App/FeatureExtrusion.cpp +@@ -349,7 +349,7 @@ void Extrusion::extrudeShape(TopoShape& result, const + std::vector drafts; + ExtrusionHelper::makeElementDraft(params, myShape, drafts, result.Hasher); + if (drafts.empty()) { +- Standard_Failure::Raise("Drafting shape failed"); ++ throw Standard_Failure("Drafting shape failed"); + } + else { + result.makeElementCompound( +@@ -362,7 +362,7 @@ void Extrusion::extrudeShape(TopoShape& result, const + else { + // Regular (non-tapered) extrusion! + if (source.isNull()) { +- Standard_Failure::Raise("Cannot extrude empty shape"); ++ throw Standard_Failure("Cannot extrude empty shape"); + } + + // apply reverse part of extrusion by shifting the source shape diff --git a/cad/freecad/files/patch-src_Mod_Part_App_FeatureMirroring.cpp b/cad/freecad/files/patch-src_Mod_Part_App_FeatureMirroring.cpp new file mode 100644 index 000000000000..3289b4e8796e --- /dev/null +++ b/cad/freecad/files/patch-src_Mod_Part_App_FeatureMirroring.cpp @@ -0,0 +1,11 @@ +--- src/Mod/Part/App/FeatureMirroring.cpp.orig 2026-07-01 20:30:18 UTC ++++ src/Mod/Part/App/FeatureMirroring.cpp +@@ -345,7 +345,7 @@ App::DocumentObjectExecReturn* Mirroring::execute() + gp_Ax2 ax2(gp_Pnt(base.x, base.y, base.z), gp_Dir(norm.x, norm.y, norm.z)); + + if (shape.isNull()) { +- Standard_Failure::Raise("Cannot mirror empty shape"); ++ throw Standard_Failure("Cannot mirror empty shape"); + } + + auto mirrored = TopoShape(0).makeElementMirror(shape, ax2); diff --git a/cad/freecad/files/patch-src_Mod_Part_App_FeatureProjectOnSurface.cpp b/cad/freecad/files/patch-src_Mod_Part_App_FeatureProjectOnSurface.cpp new file mode 100644 index 000000000000..9fca5917b06e --- /dev/null +++ b/cad/freecad/files/patch-src_Mod_Part_App_FeatureProjectOnSurface.cpp @@ -0,0 +1,10 @@ +--- src/Mod/Part/App/FeatureProjectOnSurface.cpp.orig 2026-07-01 20:50:53 UTC ++++ src/Mod/Part/App/FeatureProjectOnSurface.cpp +@@ -38,6 +38,7 @@ + #include + #include + #include ++#include + #include + #include + #include diff --git a/cad/freecad/files/patch-src_Mod_Part_App_Geom2d_BSplineCurve2dPyImp.cpp b/cad/freecad/files/patch-src_Mod_Part_App_Geom2d_BSplineCurve2dPyImp.cpp new file mode 100644 index 000000000000..86f941f41745 --- /dev/null +++ b/cad/freecad/files/patch-src_Mod_Part_App_Geom2d_BSplineCurve2dPyImp.cpp @@ -0,0 +1,142 @@ +--- src/Mod/Part/App/Geom2d/BSplineCurve2dPyImp.cpp.orig 2026-07-02 10:41:24 UTC ++++ src/Mod/Part/App/Geom2d/BSplineCurve2dPyImp.cpp +@@ -846,7 +846,7 @@ PyObject* BSplineCurve2dPy::approximate(PyObject* args + } + + if (degMin > degMax) { +- Standard_Failure::Raise("DegMin must be lower or equal to DegMax"); ++ throw Standard_Failure("DegMin must be lower or equal to DegMax"); + } + + GeomAbs_Shape c; +@@ -889,7 +889,7 @@ PyObject* BSplineCurve2dPy::approximate(PyObject* args + Py_Return; + } + else { +- Standard_Failure::Raise("Smoothing approximation failed"); ++ throw Standard_Failure("Smoothing approximation failed"); + return nullptr; // goes to the catch block + } + } +@@ -910,7 +910,7 @@ PyObject* BSplineCurve2dPy::approximate(PyObject* args + Py_Return; + } + else { +- Standard_Failure::Raise("Approximation with parameters failed"); ++ throw Standard_Failure("Approximation with parameters failed"); + return nullptr; // goes to the catch block + } + } +@@ -934,7 +934,7 @@ PyObject* BSplineCurve2dPy::approximate(PyObject* args + Py_Return; + } + else { +- Standard_Failure::Raise("failed to approximate points"); ++ throw Standard_Failure("failed to approximate points"); + return nullptr; // goes to the catch block + } + } +@@ -1057,7 +1057,7 @@ PyObject* BSplineCurve2dPy::interpolate(PyObject* args + } + + if (interpolationPoints->Length() < 2) { +- Standard_Failure::Raise("not enough points given"); ++ throw Standard_Failure("not enough points given"); + } + + Handle(TColStd_HArray1OfReal) parameters; +@@ -1125,14 +1125,18 @@ PyObject* BSplineCurve2dPy::interpolate(PyObject* args + Py_Return; + } + else { +- Standard_Failure::Raise("failed to interpolate points"); ++ throw Standard_Failure("failed to interpolate points"); + return nullptr; // goes to the catch block + } + } + catch (Standard_Failure& e) { + std::string err = e.GetMessageString(); + if (err.empty()) { ++#if OCC_VERSION_HEX >= 0x080000 ++ err = e.ExceptionType(); ++#else + err = e.DynamicType()->Name(); ++#endif + } + PyErr_SetString(PartExceptionOCCError, err.c_str()); + return nullptr; +@@ -1188,7 +1192,7 @@ PyObject* BSplineCurve2dPy::buildFromPoles(PyObject* a + Py_Return; + } + else { +- Standard_Failure::Raise("failed to create spline"); ++ throw Standard_Failure("failed to create spline"); + return nullptr; // goes to the catch block + } + } +@@ -1209,7 +1213,7 @@ PyObject* BSplineCurve2dPy::buildFromPoles(PyObject* a + Py_Return; + } + else { +- Standard_Failure::Raise("failed to create spline"); ++ throw Standard_Failure("failed to create spline"); + return nullptr; // goes to the catch block + } + } +@@ -1254,7 +1258,7 @@ PyObject* BSplineCurve2dPy::buildFromPolesMultsKnots(P + + number_of_poles = list.size(); + if ((number_of_poles) < 2) { +- Standard_Failure::Raise("need two or more poles"); ++ throw Standard_Failure("need two or more poles"); + return nullptr; + } + TColgp_Array1OfPnt2d occpoles(1, number_of_poles); +@@ -1267,7 +1271,7 @@ PyObject* BSplineCurve2dPy::buildFromPolesMultsKnots(P + if (mults != Py_None && knots != Py_None) { + number_of_knots = PyObject_Length(mults); + if (PyObject_Length(knots) != number_of_knots) { +- Standard_Failure::Raise("number of knots and mults mismatch"); ++ throw Standard_Failure("number of knots and mults mismatch"); + return nullptr; + } + } +@@ -1342,7 +1346,7 @@ PyObject* BSplineCurve2dPy::buildFromPolesMultsKnots(P + } + if (weights != Py_None) { // weights are given + if (PyObject_Length(weights) != number_of_poles) { +- Standard_Failure::Raise("number of poles and weights mismatch"); ++ throw Standard_Failure("number of poles and weights mismatch"); + return nullptr; + } // complain about mismatch + Py::Sequence weightssq(weights); +@@ -1360,7 +1364,7 @@ PyObject* BSplineCurve2dPy::buildFromPolesMultsKnots(P + // check if the number of poles matches the sum of mults + if (((Base::asBoolean(periodic)) && sum_of_mults != number_of_poles) + || (!Base::asBoolean(periodic) && sum_of_mults - degree - 1 != number_of_poles)) { +- Standard_Failure::Raise("number of poles and sum of mults mismatch"); ++ throw Standard_Failure("number of poles and sum of mults mismatch"); + return (nullptr); + } + +@@ -1377,7 +1381,7 @@ PyObject* BSplineCurve2dPy::buildFromPolesMultsKnots(P + Py_Return; + } + else { +- Standard_Failure::Raise("failed to create spline"); ++ throw Standard_Failure("failed to create spline"); + return nullptr; // goes to the catch block + } + } +@@ -1442,7 +1446,11 @@ PyObject* BSplineCurve2dPy::makeC1Continuous(PyObject* + catch (Standard_Failure& e) { + std::string err = e.GetMessageString(); + if (err.empty()) { ++#if OCC_VERSION_HEX >= 0x080000 ++ err = e.ExceptionType(); ++#else + err = e.DynamicType()->Name(); ++#endif + } + PyErr_SetString(PartExceptionOCCError, err.c_str()); + return nullptr; diff --git a/cad/freecad/files/patch-src_Mod_Part_App_Geom2d_Curve2dPyImp.cpp b/cad/freecad/files/patch-src_Mod_Part_App_Geom2d_Curve2dPyImp.cpp new file mode 100644 index 000000000000..771230534738 --- /dev/null +++ b/cad/freecad/files/patch-src_Mod_Part_App_Geom2d_Curve2dPyImp.cpp @@ -0,0 +1,80 @@ +--- src/Mod/Part/App/Geom2d/Curve2dPyImp.cpp.orig 2026-07-02 12:13:06 UTC ++++ src/Mod/Part/App/Geom2d/Curve2dPyImp.cpp +@@ -24,6 +24,7 @@ + + #include + ++#include + #include + #include + #include +@@ -44,7 +45,11 @@ + #include + #include + #include +-#include ++#if OCC_VERSION_HEX >= 0x080000 ++# include ++#else ++# include ++#endif + #include + #include + #include +@@ -602,7 +607,11 @@ PyObject* Curve2dPy::tangent(PyObject* args) + return nullptr; + } + gp_Dir2d dir; ++#if OCC_VERSION_HEX >= 0x080000 ++ GeomLProp_CLProps2d prop(c, u, 2, Precision::Confusion()); ++#else + Geom2dLProp_CLProps2d prop(c, u, 2, Precision::Confusion()); ++#endif + if (prop.IsTangentDefined()) { + prop.Tangent(dir); + } +@@ -630,7 +639,11 @@ PyObject* Curve2dPy::normal(PyObject* args) const + return nullptr; + } + gp_Dir2d dir; ++#if OCC_VERSION_HEX >= 0x080000 ++ GeomLProp_CLProps2d prop(c, u, 2, Precision::Confusion()); ++#else + Geom2dLProp_CLProps2d prop(c, u, 2, Precision::Confusion()); ++#endif + prop.Normal(dir); + + return Py::new_reference_to(Base::Vector2dPy::create(dir.X(), dir.Y())); +@@ -655,7 +668,11 @@ PyObject* Curve2dPy::curvature(PyObject* args) const + if (!PyArg_ParseTuple(args, "d", &u)) { + return nullptr; + } ++#if OCC_VERSION_HEX >= 0x080000 ++ GeomLProp_CLProps2d prop(c, u, 2, Precision::Confusion()); ++#else + Geom2dLProp_CLProps2d prop(c, u, 2, Precision::Confusion()); ++#endif + double C = prop.Curvature(); + return Py::new_reference_to(Py::Float(C)); + } +@@ -679,7 +696,11 @@ PyObject* Curve2dPy::centerOfCurvature(PyObject* args) + if (!PyArg_ParseTuple(args, "d", &u)) { + return nullptr; + } ++#if OCC_VERSION_HEX >= 0x080000 ++ GeomLProp_CLProps2d prop(c, u, 2, Precision::Confusion()); ++#else + Geom2dLProp_CLProps2d prop(c, u, 2, Precision::Confusion()); ++#endif + gp_Pnt2d pnt; + prop.CentreOfCurvature(pnt); + +@@ -737,7 +758,7 @@ PyObject* Curve2dPy::toBSpline(PyObject* args) + ShapeConstruct_Curve scc; + Handle(Geom2d_BSplineCurve) spline = scc.ConvertToBSpline(c, u, v, Precision::Confusion()); + if (spline.IsNull()) { +- Standard_NullValue::Raise("Conversion to B-spline failed"); ++ throw Standard_NullValue("Conversion to B-spline failed"); + } + return new BSplineCurve2dPy(new Geom2dBSplineCurve(spline)); + } diff --git a/cad/freecad/files/patch-src_Mod_Part_App_Geom2d_Line2dPyImp.cpp b/cad/freecad/files/patch-src_Mod_Part_App_Geom2d_Line2dPyImp.cpp new file mode 100644 index 000000000000..614b0dd777e7 --- /dev/null +++ b/cad/freecad/files/patch-src_Mod_Part_App_Geom2d_Line2dPyImp.cpp @@ -0,0 +1,11 @@ +--- src/Mod/Part/App/Geom2d/Line2dPyImp.cpp.orig 2026-07-01 20:30:18 UTC ++++ src/Mod/Part/App/Geom2d/Line2dPyImp.cpp +@@ -93,7 +93,7 @@ int Line2dPy::PyInit(PyObject* args, PyObject* /*kwd*/ + // Create line out of two points + double distance = (v1 - v2).Length(); + if (distance < gp::Resolution()) { +- Standard_Failure::Raise("Both points are equal"); ++ throw Standard_Failure("Both points are equal"); + } + GCE2d_MakeLine ms(gp_Pnt2d(v1.x, v1.y), gp_Pnt2d(v2.x, v2.y)); + if (!ms.IsDone()) { diff --git a/cad/freecad/files/patch-src_Mod_Part_App_Geom2d_Line2dSegmentPyImp.cpp b/cad/freecad/files/patch-src_Mod_Part_App_Geom2d_Line2dSegmentPyImp.cpp new file mode 100644 index 000000000000..bd56806d7f48 --- /dev/null +++ b/cad/freecad/files/patch-src_Mod_Part_App_Geom2d_Line2dSegmentPyImp.cpp @@ -0,0 +1,29 @@ +--- src/Mod/Part/App/Geom2d/Line2dSegmentPyImp.cpp.orig 2026-07-01 20:30:18 UTC ++++ src/Mod/Part/App/Geom2d/Line2dSegmentPyImp.cpp +@@ -140,7 +140,7 @@ int Line2dSegmentPy::PyInit(PyObject* args, PyObject* + // Create line out of two points + double distance = (v1 - v2).Length(); + if (distance < gp::Resolution()) { +- Standard_Failure::Raise("Both points are equal"); ++ throw Standard_Failure("Both points are equal"); + } + GCE2d_MakeSegment ms(gp_Pnt2d(v1.x, v1.y), gp_Pnt2d(v2.x, v2.y)); + if (!ms.IsDone()) { +@@ -241,7 +241,7 @@ void Line2dSegmentPy::setStartPoint(Py::Object arg) + try { + // Create line out of two points + if (p1.Distance(p2) < gp::Resolution()) { +- Standard_Failure::Raise("Both points are equal"); ++ throw Standard_Failure("Both points are equal"); + } + GCE2d_MakeSegment ms(p1, p2); + if (!ms.IsDone()) { +@@ -297,7 +297,7 @@ void Line2dSegmentPy::setEndPoint(Py::Object arg) + try { + // Create line out of two points + if (p1.Distance(p2) < gp::Resolution()) { +- Standard_Failure::Raise("Both points are equal"); ++ throw Standard_Failure("Both points are equal"); + } + GCE2d_MakeSegment ms(p1, p2); + if (!ms.IsDone()) { diff --git a/cad/freecad/files/patch-src_Mod_Part_App_GeomPlate_BuildPlateSurfacePyImp.cpp b/cad/freecad/files/patch-src_Mod_Part_App_GeomPlate_BuildPlateSurfacePyImp.cpp new file mode 100644 index 000000000000..62a3151b9a85 --- /dev/null +++ b/cad/freecad/files/patch-src_Mod_Part_App_GeomPlate_BuildPlateSurfacePyImp.cpp @@ -0,0 +1,13 @@ +--- src/Mod/Part/App/GeomPlate/BuildPlateSurfacePyImp.cpp.orig 2026-07-01 20:50:53 UTC ++++ src/Mod/Part/App/GeomPlate/BuildPlateSurfacePyImp.cpp +@@ -26,6 +26,10 @@ + + #include + ++#include ++#include ++#include ++#include + + #include "GeomPlate/BuildPlateSurfacePy.h" + #include "GeomPlate/BuildPlateSurfacePy.cpp" diff --git a/cad/freecad/files/patch-src_Mod_Part_App_Geometry.cpp b/cad/freecad/files/patch-src_Mod_Part_App_Geometry.cpp new file mode 100644 index 000000000000..4d8d0ec578e8 --- /dev/null +++ b/cad/freecad/files/patch-src_Mod_Part_App_Geometry.cpp @@ -0,0 +1,101 @@ +--- src/Mod/Part/App/Geometry.cpp.orig 2026-07-01 20:30:18 UTC ++++ src/Mod/Part/App/Geometry.cpp +@@ -38,6 +38,9 @@ + #include + #include + #include ++#include ++#include ++#include + #include + #include + #include +@@ -1684,7 +1687,7 @@ void GeomBSplineCurve::interpolate(const std::vector& p, Standard_Boolean periodic) + { + if (p.size() < 2) { +- Standard_ConstructionError::Raise(); ++ throw Standard_ConstructionError(); + } + + double tol3d = Precision::Approximation(); +@@ -1701,10 +1704,10 @@ void GeomBSplineCurve::interpolate(const std::vector& p, const std::vector& t) + { + if (p.size() < 2) { +- Standard_ConstructionError::Raise(); ++ throw Standard_ConstructionError(); + } + if (p.size() != t.size()) { +- Standard_ConstructionError::Raise(); ++ throw Standard_ConstructionError(); + } + + double tol3d = Precision::Approximation(); +@@ -1734,10 +1737,10 @@ void GeomBSplineCurve::getCardinalSplineTangents( + { + // https://de.wikipedia.org/wiki/Kubisch_Hermitescher_Spline#Cardinal_Spline + if (p.size() < 2) { +- Standard_ConstructionError::Raise(); ++ throw Standard_ConstructionError(); + } + if (p.size() != c.size()) { +- Standard_ConstructionError::Raise(); ++ throw Standard_ConstructionError(); + } + + t.resize(p.size()); +@@ -1768,7 +1771,7 @@ void GeomBSplineCurve::getCardinalSplineTangents( + { + // https://de.wikipedia.org/wiki/Kubisch_Hermitescher_Spline#Cardinal_Spline + if (p.size() < 2) { +- Standard_ConstructionError::Raise(); ++ throw Standard_ConstructionError(); + } + + t.resize(p.size()); +@@ -2931,7 +2934,7 @@ void GeomArcOfCircle::setHandle(const Handle(Geom_Trim + { + Handle(Geom_Circle) basis = Handle(Geom_Circle)::DownCast(c->BasisCurve()); + if (basis.IsNull()) { +- Standard_Failure::Raise("Basis curve is not a circle"); ++ throw Standard_Failure("Basis curve is not a circle"); + } + this->myCurve = Handle(Geom_TrimmedCurve)::DownCast(c->Copy()); + } +@@ -3463,7 +3466,7 @@ void GeomArcOfEllipse::setHandle(const Handle(Geom_Tri + { + Handle(Geom_Ellipse) basis = Handle(Geom_Ellipse)::DownCast(c->BasisCurve()); + if (basis.IsNull()) { +- Standard_Failure::Raise("Basis curve is not an ellipse"); ++ throw Standard_Failure("Basis curve is not an ellipse"); + } + this->myCurve = Handle(Geom_TrimmedCurve)::DownCast(c->Copy()); + } +@@ -3936,7 +3939,7 @@ void GeomArcOfHyperbola::setHandle(const Handle(Geom_T + { + Handle(Geom_Hyperbola) basis = Handle(Geom_Hyperbola)::DownCast(c->BasisCurve()); + if (basis.IsNull()) { +- Standard_Failure::Raise("Basis curve is not an hyperbola"); ++ throw Standard_Failure("Basis curve is not an hyperbola"); + } + this->myCurve = Handle(Geom_TrimmedCurve)::DownCast(c->Copy()); + } +@@ -4374,7 +4377,7 @@ void GeomArcOfParabola::setHandle(const Handle(Geom_Tr + { + Handle(Geom_Parabola) basis = Handle(Geom_Parabola)::DownCast(c->BasisCurve()); + if (basis.IsNull()) { +- Standard_Failure::Raise("Basis curve is not a parabola"); ++ throw Standard_Failure("Basis curve is not a parabola"); + } + this->myCurve = Handle(Geom_TrimmedCurve)::DownCast(c->Copy()); + } +@@ -4708,7 +4711,7 @@ void GeomLineSegment::setHandle(const Handle(Geom_Trim + { + Handle(Geom_Line) basis = Handle(Geom_Line)::DownCast(c->BasisCurve()); + if (basis.IsNull()) { +- Standard_Failure::Raise("Basis curve is not a line"); ++ throw Standard_Failure("Basis curve is not a line"); + } + this->myCurve = Handle(Geom_TrimmedCurve)::DownCast(c->Copy()); + } diff --git a/cad/freecad/files/patch-src_Mod_Part_App_Geometry2d.cpp b/cad/freecad/files/patch-src_Mod_Part_App_Geometry2d.cpp new file mode 100644 index 000000000000..c551723001c6 --- /dev/null +++ b/cad/freecad/files/patch-src_Mod_Part_App_Geometry2d.cpp @@ -0,0 +1,174 @@ +--- src/Mod/Part/App/Geometry2d.cpp.orig 2026-07-02 12:43:46 UTC ++++ src/Mod/Part/App/Geometry2d.cpp +@@ -28,7 +28,12 @@ + #include + #include + #include +-#include ++#include ++#if OCC_VERSION_HEX >= 0x080000 ++# include ++#else ++# include ++#endif + #include + #include + #include +@@ -221,7 +226,11 @@ bool Geom2dCurve::tangent(double u, gp_Dir2d& dir) con + bool Geom2dCurve::tangent(double u, gp_Dir2d& dir) const + { + Handle(Geom2d_Curve) c = Handle(Geom2d_Curve)::DownCast(handle()); ++#if OCC_VERSION_HEX >= 0x080000 ++ GeomLProp_CLProps2d prop(c, u, 2, Precision::Confusion()); ++#else + Geom2dLProp_CLProps2d prop(c, u, 2, Precision::Confusion()); ++#endif + if (prop.IsTangentDefined()) { + prop.Tangent(dir); + return true; +@@ -233,7 +242,11 @@ Base::Vector2d Geom2dCurve::pointAtParameter(double u) + Base::Vector2d Geom2dCurve::pointAtParameter(double u) const + { + Handle(Geom2d_Curve) c = Handle(Geom2d_Curve)::DownCast(handle()); ++#if OCC_VERSION_HEX >= 0x080000 ++ GeomLProp_CLProps2d prop(c, u, 0, Precision::Confusion()); ++#else + Geom2dLProp_CLProps2d prop(c, u, 0, Precision::Confusion()); ++#endif + + const gp_Pnt2d& point = prop.Value(); + return {point.X(), point.Y()}; +@@ -242,7 +255,11 @@ Base::Vector2d Geom2dCurve::firstDerivativeAtParameter + Base::Vector2d Geom2dCurve::firstDerivativeAtParameter(double u) const + { + Handle(Geom2d_Curve) c = Handle(Geom2d_Curve)::DownCast(handle()); ++#if OCC_VERSION_HEX >= 0x080000 ++ GeomLProp_CLProps2d prop(c, u, 1, Precision::Confusion()); ++#else + Geom2dLProp_CLProps2d prop(c, u, 1, Precision::Confusion()); ++#endif + + const gp_Vec2d& vec = prop.D1(); + return {vec.X(), vec.Y()}; +@@ -251,7 +268,11 @@ Base::Vector2d Geom2dCurve::secondDerivativeAtParamete + Base::Vector2d Geom2dCurve::secondDerivativeAtParameter(double u) const + { + Handle(Geom2d_Curve) c = Handle(Geom2d_Curve)::DownCast(handle()); ++#if OCC_VERSION_HEX >= 0x080000 ++ GeomLProp_CLProps2d prop(c, u, 2, Precision::Confusion()); ++#else + Geom2dLProp_CLProps2d prop(c, u, 2, Precision::Confusion()); ++#endif + + const gp_Vec2d& vec = prop.D2(); + return {vec.X(), vec.Y()}; +@@ -260,7 +281,11 @@ bool Geom2dCurve::normal(double u, gp_Dir2d& dir) cons + bool Geom2dCurve::normal(double u, gp_Dir2d& dir) const + { + Handle(Geom2d_Curve) c = Handle(Geom2d_Curve)::DownCast(handle()); ++#if OCC_VERSION_HEX >= 0x080000 ++ GeomLProp_CLProps2d prop(c, u, 2, Precision::Confusion()); ++#else + Geom2dLProp_CLProps2d prop(c, u, 2, Precision::Confusion()); ++#endif + if (prop.IsTangentDefined()) { + prop.Normal(dir); + return true; +@@ -466,10 +491,10 @@ void Geom2dBSplineCurve::interpolate(const std::vector + void Geom2dBSplineCurve::interpolate(const std::vector& p, const std::vector& t) + { + if (p.size() < 2) { +- Standard_ConstructionError::Raise(); ++ throw Standard_ConstructionError(); + } + if (p.size() != t.size()) { +- Standard_ConstructionError::Raise(); ++ throw Standard_ConstructionError(); + } + + double tol3d = Precision::Approximation(); +@@ -499,10 +524,10 @@ void Geom2dBSplineCurve::getCardinalSplineTangents( + { + // https://de.wikipedia.org/wiki/Kubisch_Hermitescher_Spline#Cardinal_Spline + if (p.size() < 2) { +- Standard_ConstructionError::Raise(); ++ throw Standard_ConstructionError(); + } + if (p.size() != c.size()) { +- Standard_ConstructionError::Raise(); ++ throw Standard_ConstructionError(); + } + + t.resize(p.size()); +@@ -533,7 +558,7 @@ void Geom2dBSplineCurve::getCardinalSplineTangents( + { + // https://de.wikipedia.org/wiki/Kubisch_Hermitescher_Spline#Cardinal_Spline + if (p.size() < 2) { +- Standard_ConstructionError::Raise(); ++ throw Standard_ConstructionError(); + } + + t.resize(p.size()); +@@ -563,7 +588,7 @@ std::list Geom2dBSplineCurve::toBiArcs(do + + std::list Geom2dBSplineCurve::toBiArcs(double /*tolerance*/) const + { +- Standard_Failure::Raise("Not yet implemented"); ++ throw Standard_Failure("Not yet implemented"); + return {}; + } + +@@ -960,7 +985,7 @@ void Geom2dArcOfCircle::setHandle(const Handle(Geom2d_ + { + Handle(Geom2d_Circle) basis = Handle(Geom2d_Circle)::DownCast(c->BasisCurve()); + if (basis.IsNull()) { +- Standard_Failure::Raise("Basis curve is not a circle"); ++ throw Standard_Failure("Basis curve is not a circle"); + } + this->myCurve = Handle(Geom2d_TrimmedCurve)::DownCast(c->Copy()); + } +@@ -1238,7 +1263,7 @@ void Geom2dArcOfEllipse::setHandle(const Handle(Geom2d + { + Handle(Geom2d_Ellipse) basis = Handle(Geom2d_Ellipse)::DownCast(c->BasisCurve()); + if (basis.IsNull()) { +- Standard_Failure::Raise("Basis curve is not an ellipse"); ++ throw Standard_Failure("Basis curve is not an ellipse"); + } + this->myCurve = Handle(Geom2d_TrimmedCurve)::DownCast(c->Copy()); + } +@@ -1534,7 +1559,7 @@ void Geom2dArcOfHyperbola::setHandle(const Handle(Geom + { + Handle(Geom2d_Hyperbola) basis = Handle(Geom2d_Hyperbola)::DownCast(c->BasisCurve()); + if (basis.IsNull()) { +- Standard_Failure::Raise("Basis curve is not an hyperbola"); ++ throw Standard_Failure("Basis curve is not an hyperbola"); + } + this->myCurve = Handle(Geom2d_TrimmedCurve)::DownCast(c->Copy()); + } +@@ -1775,7 +1800,7 @@ void Geom2dArcOfParabola::setHandle(const Handle(Geom2 + { + Handle(Geom2d_Parabola) basis = Handle(Geom2d_Parabola)::DownCast(c->BasisCurve()); + if (basis.IsNull()) { +- Standard_Failure::Raise("Basis curve is not a parabola"); ++ throw Standard_Failure("Basis curve is not a parabola"); + } + this->myCurve = Handle(Geom2d_TrimmedCurve)::DownCast(c->Copy()); + } +@@ -2001,7 +2026,7 @@ void Geom2dLineSegment::setHandle(const Handle(Geom2d_ + { + Handle(Geom2d_Line) basis = Handle(Geom2d_Line)::DownCast(c->BasisCurve()); + if (basis.IsNull()) { +- Standard_Failure::Raise("Basis curve is not a line"); ++ throw Standard_Failure("Basis curve is not a line"); + } + this->myCurve = Handle(Geom2d_TrimmedCurve)::DownCast(c->Copy()); + } +@@ -2040,7 +2065,7 @@ void Geom2dLineSegment::setPoints(const Base::Vector2d + try { + // Create line out of two points + if (p1.Distance(p2) < gp::Resolution()) { +- Standard_Failure::Raise("Both points are equal"); ++ throw Standard_Failure("Both points are equal"); + } + GCE2d_MakeSegment ms(p1, p2); + if (!ms.IsDone()) { diff --git a/cad/freecad/files/patch-src_Mod_Part_App_GeometrySurfacePyImp.cpp b/cad/freecad/files/patch-src_Mod_Part_App_GeometrySurfacePyImp.cpp new file mode 100644 index 000000000000..a5e75e7a0f60 --- /dev/null +++ b/cad/freecad/files/patch-src_Mod_Part_App_GeometrySurfacePyImp.cpp @@ -0,0 +1,11 @@ +--- src/Mod/Part/App/GeometrySurfacePyImp.cpp.orig 2026-07-01 20:30:18 UTC ++++ src/Mod/Part/App/GeometrySurfacePyImp.cpp +@@ -835,7 +835,7 @@ PyObject* GeometrySurfacePy::toBSpline(PyObject* args, + return new BSplineSurfacePy(new GeomBSplineSurface(cvt.Surface())); + } + else { +- Standard_Failure::Raise("Cannot convert to B-spline surface"); ++ throw Standard_Failure("Cannot convert to B-spline surface"); + } + } + catch (Standard_Failure& e) { diff --git a/cad/freecad/files/patch-src_Mod_Part_App_LinePyImp.cpp b/cad/freecad/files/patch-src_Mod_Part_App_LinePyImp.cpp new file mode 100644 index 000000000000..44adf660d908 --- /dev/null +++ b/cad/freecad/files/patch-src_Mod_Part_App_LinePyImp.cpp @@ -0,0 +1,11 @@ +--- src/Mod/Part/App/LinePyImp.cpp.orig 2026-07-01 20:50:53 UTC ++++ src/Mod/Part/App/LinePyImp.cpp +@@ -83,7 +83,7 @@ int LinePy::PyInit(PyObject* args, PyObject* /*kwd*/) + // Create line out of two points + double distance = Base::Distance(v1, v2); + if (distance < gp::Resolution()) { +- Standard_Failure::Raise("Both points are equal"); ++ throw Standard_Failure("Both points are equal"); + } + GC_MakeLine ms(gp_Pnt(v1.x, v1.y, v1.z), gp_Pnt(v2.x, v2.y, v2.z)); + if (!ms.IsDone()) { diff --git a/cad/freecad/files/patch-src_Mod_Part_App_LineSegmentPyImp.cpp b/cad/freecad/files/patch-src_Mod_Part_App_LineSegmentPyImp.cpp new file mode 100644 index 000000000000..1aa41b2258a9 --- /dev/null +++ b/cad/freecad/files/patch-src_Mod_Part_App_LineSegmentPyImp.cpp @@ -0,0 +1,29 @@ +--- src/Mod/Part/App/LineSegmentPyImp.cpp.orig 2026-07-01 20:30:18 UTC ++++ src/Mod/Part/App/LineSegmentPyImp.cpp +@@ -136,7 +136,7 @@ int LineSegmentPy::PyInit(PyObject* args, PyObject* /* + // Create line out of two points + double distance = Base::Distance(v1, v2); + if (distance < gp::Resolution()) { +- Standard_Failure::Raise("Both points are equal"); ++ throw Standard_Failure("Both points are equal"); + } + GC_MakeSegment ms(gp_Pnt(v1.x, v1.y, v1.z), gp_Pnt(v2.x, v2.y, v2.z)); + if (!ms.IsDone()) { +@@ -239,7 +239,7 @@ void LineSegmentPy::setStartPoint(Py::Object arg) + try { + // Create line out of two points + if (p1.Distance(p2) < gp::Resolution()) { +- Standard_Failure::Raise("Both points are equal"); ++ throw Standard_Failure("Both points are equal"); + } + GC_MakeSegment ms(p1, p2); + if (!ms.IsDone()) { +@@ -297,7 +297,7 @@ void LineSegmentPy::setEndPoint(Py::Object arg) + try { + // Create line out of two points + if (p1.Distance(p2) < gp::Resolution()) { +- Standard_Failure::Raise("Both points are equal"); ++ throw Standard_Failure("Both points are equal"); + } + GC_MakeSegment ms(p1, p2); + if (!ms.IsDone()) { diff --git a/cad/freecad/files/patch-src_Mod_Part_App_PartFeature.cpp b/cad/freecad/files/patch-src_Mod_Part_App_PartFeature.cpp new file mode 100644 index 000000000000..bcb945101cb5 --- /dev/null +++ b/cad/freecad/files/patch-src_Mod_Part_App_PartFeature.cpp @@ -0,0 +1,46 @@ +--- src/Mod/Part/App/PartFeature.cpp.orig 2026-07-02 12:13:06 UTC ++++ src/Mod/Part/App/PartFeature.cpp +@@ -25,7 +25,9 @@ + + #include + #include ++#include + #include ++#include + #include + #include + #include +@@ -38,9 +40,12 @@ + #include + #include + #include ++#include + #include + #include + #include ++#include ++#include + #include + #include + #include +@@ -53,7 +58,7 @@ + #include + #include + #include +-#include ++#include + + + #include +@@ -479,7 +484,11 @@ App::DocumentObject* Feature::getSubObject( + Standard_CString msg = e.GetMessageString(); + + // Avoid name mangling ++#if OCC_VERSION_HEX >= 0x080000 ++ str << e.ExceptionType() << " "; ++#else + str << e.DynamicType()->get_type_name() << " "; ++#endif + + if (msg) { + str << msg; diff --git a/cad/freecad/files/patch-src_Mod_Part_App_PartFeatures.cpp b/cad/freecad/files/patch-src_Mod_Part_App_PartFeatures.cpp new file mode 100644 index 000000000000..ca111c52b417 --- /dev/null +++ b/cad/freecad/files/patch-src_Mod_Part_App_PartFeatures.cpp @@ -0,0 +1,12 @@ +--- src/Mod/Part/App/PartFeatures.cpp.orig 2026-07-01 20:50:53 UTC ++++ src/Mod/Part/App/PartFeatures.cpp +@@ -39,8 +39,7 @@ + #include + #include + #include +-#include +-#include ++#include + + + #include diff --git a/cad/freecad/files/patch-src_Mod_Part_App_PrimitiveFeature.cpp b/cad/freecad/files/patch-src_Mod_Part_App_PrimitiveFeature.cpp new file mode 100644 index 000000000000..d8e3d690ae96 --- /dev/null +++ b/cad/freecad/files/patch-src_Mod_Part_App_PrimitiveFeature.cpp @@ -0,0 +1,25 @@ +--- src/Mod/Part/App/PrimitiveFeature.cpp.orig 2026-07-02 08:28:36 UTC ++++ src/Mod/Part/App/PrimitiveFeature.cpp +@@ -914,11 +914,11 @@ App::DocumentObjectExecReturn* Helix::execute() + Standard_Boolean myLocalCS = LocalCoord.getValue() ? Standard_True : Standard_False; + Standard_Real mySegLen = SegmentLength.getValue(); + if (myPitch < Precision::Confusion()) { +- Standard_Failure::Raise("Pitch too small"); ++ throw Standard_Failure("Pitch too small"); + } + Standard_Real nbTurns = myHeight / myPitch; + if (nbTurns > 1e4) { +- Standard_Failure::Raise("Number of turns too high (> 1e4)"); ++ throw Standard_Failure("Number of turns too high (> 1e4)"); + } + Standard_Real myRadiusTop = myRadius + myHeight * tan(Base::toRadians(myAngle)); + +@@ -1001,7 +1001,7 @@ App::DocumentObjectExecReturn* Spiral::execute() + Standard_Real mySegLen = SegmentLength.getValue(); + + if (myNumRot < Precision::Confusion()) { +- Standard_Failure::Raise("Number of rotations too small"); ++ throw Standard_Failure("Number of rotations too small"); + } + + this->Shape.setValue( diff --git a/cad/freecad/files/patch-src_Mod_Part_App_PropertyTopoShape.cpp b/cad/freecad/files/patch-src_Mod_Part_App_PropertyTopoShape.cpp new file mode 100644 index 000000000000..f37dc6e160c2 --- /dev/null +++ b/cad/freecad/files/patch-src_Mod_Part_App_PropertyTopoShape.cpp @@ -0,0 +1,10 @@ +--- src/Mod/Part/App/PropertyTopoShape.cpp.orig 2026-07-01 20:50:53 UTC ++++ src/Mod/Part/App/PropertyTopoShape.cpp +@@ -33,6 +33,7 @@ + #include + #include + #include ++#include + + #include + #include diff --git a/cad/freecad/files/patch-src_Mod_Part_App_ShapeFix_ShapeFix__FacePyImp.cpp b/cad/freecad/files/patch-src_Mod_Part_App_ShapeFix_ShapeFix__FacePyImp.cpp new file mode 100644 index 000000000000..783a86de974d --- /dev/null +++ b/cad/freecad/files/patch-src_Mod_Part_App_ShapeFix_ShapeFix__FacePyImp.cpp @@ -0,0 +1,10 @@ +--- src/Mod/Part/App/ShapeFix/ShapeFix_FacePyImp.cpp.orig 2026-07-01 20:50:53 UTC ++++ src/Mod/Part/App/ShapeFix/ShapeFix_FacePyImp.cpp +@@ -24,6 +24,7 @@ + + #include + ++#include + #include + + diff --git a/cad/freecad/files/patch-src_Mod_Part_App_ShapeUpgrade_UnifySameDomainPyImp.cpp b/cad/freecad/files/patch-src_Mod_Part_App_ShapeUpgrade_UnifySameDomainPyImp.cpp new file mode 100644 index 000000000000..1d5070e42cc3 --- /dev/null +++ b/cad/freecad/files/patch-src_Mod_Part_App_ShapeUpgrade_UnifySameDomainPyImp.cpp @@ -0,0 +1,10 @@ +--- src/Mod/Part/App/ShapeUpgrade/UnifySameDomainPyImp.cpp.orig 2026-07-01 20:50:53 UTC ++++ src/Mod/Part/App/ShapeUpgrade/UnifySameDomainPyImp.cpp +@@ -29,6 +29,7 @@ + + // Needed for OCCT 7.5.2 + #include ++#include + + #include + diff --git a/cad/freecad/files/patch-src_Mod_Part_App_Tools.cpp b/cad/freecad/files/patch-src_Mod_Part_App_Tools.cpp new file mode 100644 index 000000000000..2814aa9e68b0 --- /dev/null +++ b/cad/freecad/files/patch-src_Mod_Part_App_Tools.cpp @@ -0,0 +1,39 @@ +--- src/Mod/Part/App/Tools.cpp.orig 2026-07-01 20:30:18 UTC ++++ src/Mod/Part/App/Tools.cpp +@@ -56,10 +56,11 @@ + #include + #include + #include +-#include + #include + #include + #include ++#include ++#include + #include + #if OCC_VERSION_HEX < 0x070600 + # include +@@ -164,7 +165,7 @@ Handle(Geom_Surface) Part::Tools::makeSurface( + const Handle(Standard_Transient) & aCur = anIt.Value(); + if (aCur.IsNull()) { + assert(0); +- Standard_ConstructionError::Raise("Tools::makeSurface()"); ++ throw Standard_ConstructionError("Tools::makeSurface()"); + } + #if OCC_VERSION_HEX >= 0x070600 + else if (aCur->IsKind(STANDARD_TYPE(Adaptor3d_CurveOnSurface))) { +@@ -218,12 +219,12 @@ Handle(Geom_Surface) Part::Tools::makeSurface( + aPlateBuilder.Add(aConst); + } + else { +- Standard_TypeMismatch::Raise("Tools::makeSurface()"); ++ throw Standard_TypeMismatch("Tools::makeSurface()"); + } + } + } + else { +- Standard_ConstructionError::Raise("Tools::makeSurface()"); ++ throw Standard_ConstructionError("Tools::makeSurface()"); + } + + // construct diff --git a/cad/freecad/files/patch-src_Mod_Part_App_TopoShape.cpp b/cad/freecad/files/patch-src_Mod_Part_App_TopoShape.cpp new file mode 100644 index 000000000000..704cb6602d4c --- /dev/null +++ b/cad/freecad/files/patch-src_Mod_Part_App_TopoShape.cpp @@ -0,0 +1,403 @@ +--- src/Mod/Part/App/TopoShape.cpp.orig 2026-07-01 20:30:18 UTC ++++ src/Mod/Part/App/TopoShape.cpp +@@ -56,8 +56,8 @@ + #include + #include + #include ++#include + #include +-#include + #include + #include + #include +@@ -139,10 +139,10 @@ + #include + #include + #include +-#include + #include + #include + #include ++#include + #include + #include + +@@ -1855,7 +1855,7 @@ TopoDS_Shape TopoShape::fuse(const std::vector& shapes, Standard_Real tolerance) const + { + if (this->_Shape.IsNull()) { +- Standard_Failure::Raise("Base shape is null"); ++ throw Standard_Failure("Base shape is null"); + } + + FCBRepAlgoAPI_Fuse mkFuse; +@@ -1893,10 +1893,10 @@ TopoDS_Shape TopoShape::section(TopoDS_Shape shape, St + TopoDS_Shape TopoShape::section(TopoDS_Shape shape, Standard_Boolean approximate) const + { + if (this->_Shape.IsNull()) { +- Standard_Failure::Raise("Base shape is null"); ++ throw Standard_Failure("Base shape is null"); + } + if (shape.IsNull()) { +- Standard_Failure::Raise("Tool shape is null"); ++ throw Standard_Failure("Tool shape is null"); + } + FCBRepAlgoAPI_Section mkSection; + mkSection.Init1(this->_Shape); +@@ -1920,7 +1920,7 @@ TopoDS_Shape TopoShape::section( + ) const + { + if (this->_Shape.IsNull()) { +- Standard_Failure::Raise("Base shape is null"); ++ throw Standard_Failure("Base shape is null"); + } + + FCBRepAlgoAPI_Section mkSection; +@@ -1994,7 +1994,7 @@ TopoDS_Shape TopoShape::generalFuse( + ) const + { + if (this->_Shape.IsNull()) { +- Standard_Failure::Raise("Base shape is null"); ++ throw Standard_Failure("Base shape is null"); + } + + BRepAlgoAPI_BuilderAlgo mkGFA; +@@ -2036,13 +2036,13 @@ TopoDS_Shape TopoShape::makePipe(const TopoDS_Shape& p + TopoDS_Shape TopoShape::makePipe(const TopoDS_Shape& profile) const + { + if (this->_Shape.IsNull()) { +- Standard_Failure::Raise("Cannot sweep along empty spine"); ++ throw Standard_Failure("Cannot sweep along empty spine"); + } + if (this->_Shape.ShapeType() != TopAbs_WIRE) { +- Standard_Failure::Raise("Spine shape is not a wire"); ++ throw Standard_Failure("Spine shape is not a wire"); + } + if (profile.IsNull()) { +- Standard_Failure::Raise("Cannot sweep empty profile"); ++ throw Standard_Failure("Cannot sweep empty profile"); + } + BRepOffsetAPI_MakePipe mkPipe(TopoDS::Wire(this->_Shape), profile); + return mkPipe.Shape(); +@@ -2056,10 +2056,10 @@ TopoDS_Shape TopoShape::makePipeShell( + ) const + { + if (this->_Shape.IsNull()) { +- Standard_Failure::Raise("Cannot sweep along empty spine"); ++ throw Standard_Failure("Cannot sweep along empty spine"); + } + if (this->_Shape.ShapeType() != TopAbs_WIRE) { +- Standard_Failure::Raise("Spine shape is not a wire"); ++ throw Standard_Failure("Spine shape is not a wire"); + } + + BRepOffsetAPI_MakePipeShell mkPipeShell(TopoDS::Wire(this->_Shape)); +@@ -2124,7 +2124,7 @@ TopoDS_Shape TopoShape::makeTube(double radius, double + Standard_Integer theMaxSegment = maxsegm; + + if (this->_Shape.IsNull()) { +- Standard_Failure::Raise("Cannot sweep along empty spine"); ++ throw Standard_Failure("Cannot sweep along empty spine"); + } + + #if OCC_VERSION_HEX >= 0x070600 +@@ -2145,7 +2145,7 @@ TopoDS_Shape TopoShape::makeTube(double radius, double + #endif + + else { +- Standard_Failure::Raise("Spine shape is not an edge"); ++ throw Standard_Failure("Spine shape is not an edge"); + } + + // circular profile +@@ -2180,17 +2180,17 @@ TopoDS_Shape TopoShape::makeSweep(const TopoDS_Shape& + { + // http://opencascade.blogspot.com/2009/10/surface-modeling-part2.html + if (this->_Shape.IsNull()) { +- Standard_Failure::Raise("Cannot sweep along empty spine"); ++ throw Standard_Failure("Cannot sweep along empty spine"); + } + if (this->_Shape.ShapeType() != TopAbs_EDGE) { +- Standard_Failure::Raise("Spine shape is not an edge"); ++ throw Standard_Failure("Spine shape is not an edge"); + } + + if (profile.IsNull()) { +- Standard_Failure::Raise("Cannot sweep with empty profile"); ++ throw Standard_Failure("Cannot sweep with empty profile"); + } + if (profile.ShapeType() != TopAbs_EDGE) { +- Standard_Failure::Raise("Profile shape is not an edge"); ++ throw Standard_Failure("Profile shape is not an edge"); + } + + const TopoDS_Edge& path_edge = TopoDS::Edge(this->_Shape); +@@ -2206,7 +2206,7 @@ TopoDS_Shape TopoShape::makeSweep(const TopoDS_Shape& + hPath = Handle(Geom_Curve)::DownCast(hPath->Transformed(loc1.Transformation())); + + if (hPath.IsNull()) { +- Standard_Failure::Raise("invalid curve in path edge"); ++ throw Standard_Failure("invalid curve in path edge"); + } + + BRepAdaptor_Curve prof_adapt(prof_edge); +@@ -2219,7 +2219,7 @@ TopoDS_Shape TopoShape::makeSweep(const TopoDS_Shape& + hProfile = Handle(Geom_Curve)::DownCast(hProfile->Transformed(loc2.Transformation())); + + if (hProfile.IsNull()) { +- Standard_Failure::Raise("invalid curve in profile edge"); ++ throw Standard_Failure("invalid curve in profile edge"); + } + + GeomFill_Pipe mkSweep(hPath, hProfile, static_cast(fillMode)); +@@ -2287,29 +2287,29 @@ TopoDS_Shape TopoShape::makeHelix( + using std::numbers::pi; + + if (fabs(pitch) < Precision::Confusion()) { +- Standard_Failure::Raise("Pitch of helix too small"); ++ throw Standard_Failure("Pitch of helix too small"); + } + + if (fabs(height) < Precision::Confusion()) { +- Standard_Failure::Raise("Height of helix too small"); ++ throw Standard_Failure("Height of helix too small"); + } + + if ((height > 0 && pitch < 0) || (height < 0 && pitch > 0)) { +- Standard_Failure::Raise("Pitch and height of helix not compatible"); ++ throw Standard_Failure("Pitch and height of helix not compatible"); + } + + gp_Ax2 cylAx2(gp_Pnt(0.0, 0.0, 0.0), gp::DZ()); + Handle(Geom_Surface) surf; + if (angle < Precision::Confusion()) { + if (radius < Precision::Confusion()) { +- Standard_Failure::Raise("Radius of helix too small"); ++ throw Standard_Failure("Radius of helix too small"); + } + surf = new Geom_CylindricalSurface(cylAx2, radius); + } + else { + angle = Base::toRadians(angle); + if (angle < Precision::Confusion()) { +- Standard_Failure::Raise("Angle of helix too small"); ++ throw Standard_Failure("Angle of helix too small"); + } + surf = new Geom_ConicalSurface(gp_Ax3(cylAx2), angle, radius); + } +@@ -2361,11 +2361,11 @@ TopoDS_Shape TopoShape::makeLongHelix( + using std::numbers::pi; + + if (pitch < Precision::Confusion()) { +- Standard_Failure::Raise("Pitch of helix too small"); ++ throw Standard_Failure("Pitch of helix too small"); + } + + if (height < Precision::Confusion()) { +- Standard_Failure::Raise("Height of helix too small"); ++ throw Standard_Failure("Height of helix too small"); + } + + gp_Ax2 cylAx2(gp_Pnt(0.0, 0.0, 0.0), gp::DZ()); +@@ -2374,7 +2374,7 @@ TopoDS_Shape TopoShape::makeLongHelix( + + if (std::fabs(angle) < Precision::Confusion()) { // Cylindrical helix + if (radius < Precision::Confusion()) { +- Standard_Failure::Raise("Radius of helix too small"); ++ throw Standard_Failure("Radius of helix too small"); + } + surf = new Geom_CylindricalSurface(cylAx2, radius); + isCylinder = true; +@@ -2451,13 +2451,13 @@ TopoDS_Shape TopoShape::makeSpiralHelix( + // 1000 periods is an OCCT limit. The 3D curve gets truncated + // if the 2D curve spans beyond this limit. + if ((breakperiod < 0) || (breakperiod > 1000)) { +- Standard_Failure::Raise("Break period must be in [0, 1000]"); ++ throw Standard_Failure("Break period must be in [0, 1000]"); + } + if (breakperiod == 0) { + breakperiod = 1000; + } + if (nbturns <= 0) { +- Standard_Failure::Raise("Number of turns must be greater than 0"); ++ throw Standard_Failure("Number of turns must be greater than 0"); + } + + Standard_Real nbPeriods = nbturns / breakperiod; +@@ -2517,19 +2517,19 @@ TopoDS_Shape TopoShape::makeThread( + { + using std::numbers::pi; + if (pitch < Precision::Confusion()) { +- Standard_Failure::Raise("Pitch of thread too small"); ++ throw Standard_Failure("Pitch of thread too small"); + } + + if (depth < Precision::Confusion()) { +- Standard_Failure::Raise("Depth of thread too small"); ++ throw Standard_Failure("Depth of thread too small"); + } + + if (height < Precision::Confusion()) { +- Standard_Failure::Raise("Height of thread too small"); ++ throw Standard_Failure("Height of thread too small"); + } + + if (radius < Precision::Confusion()) { +- Standard_Failure::Raise("Radius of thread too small"); ++ throw Standard_Failure("Radius of thread too small"); + } + + // Threading : Create Surfaces +@@ -2609,7 +2609,7 @@ TopoDS_Shape TopoShape::makeLoft( + } + + if (countShapes < 2) { +- Standard_Failure::Raise("Need at least two vertices, edges or wires to create loft face"); ++ throw Standard_Failure("Need at least two vertices, edges or wires to create loft face"); + } + else { + // close loft by duplicating initial profile as last profile. not perfect. +@@ -2651,7 +2651,7 @@ TopoDS_Shape TopoShape::makeLoft( + aGenerator.Build(); + #endif + if (!aGenerator.IsDone()) { +- Standard_Failure::Raise("Failed to create loft face"); ++ throw Standard_Failure("Failed to create loft face"); + } + + // Base::Console().message("DEBUG: TopoShape::makeLoft returns.\n"); +@@ -2661,7 +2661,7 @@ TopoDS_Shape TopoShape::makePrism(const gp_Vec& vec) c + TopoDS_Shape TopoShape::makePrism(const gp_Vec& vec) const + { + if (this->_Shape.IsNull()) { +- Standard_Failure::Raise("cannot sweep empty shape"); ++ throw Standard_Failure("cannot sweep empty shape"); + } + BRepPrimAPI_MakePrism mkPrism(this->_Shape, vec); + return mkPrism.Shape(); +@@ -2670,7 +2670,7 @@ TopoDS_Shape TopoShape::revolve(const gp_Ax1& axis, do + TopoDS_Shape TopoShape::revolve(const gp_Ax1& axis, double d, Standard_Boolean isSolid) const + { + if (this->_Shape.IsNull()) { +- Standard_Failure::Raise("cannot revolve empty shape"); ++ throw Standard_Failure("cannot revolve empty shape"); + } + + TopoDS_Face f; +@@ -2755,7 +2755,7 @@ TopoDS_Shape TopoShape::makeOffsetShape( + ); + + if (!mkOffset.IsDone()) { +- Standard_Failure::Raise("BRepOffsetAPI_MakeOffsetShape not done"); ++ throw Standard_Failure("BRepOffsetAPI_MakeOffsetShape not done"); + } + const TopoDS_Shape& res = mkOffset.Shape(); + if (!fill) { +@@ -2767,7 +2767,7 @@ TopoDS_Shape TopoShape::makeOffsetShape( + ShapeAnalysis_FreeBoundsProperties freeCheck(this->_Shape); + freeCheck.Perform(); + if (freeCheck.NbClosedFreeBounds() < 1) { +- Standard_Failure::Raise("no closed bounds"); ++ throw Standard_Failure("no closed bounds"); + } + + BRep_Builder builder; +@@ -2783,7 +2783,7 @@ TopoDS_Shape TopoShape::makeOffsetShape( + TopExp_Explorer xp; + for (xp.Init(originalWire, TopAbs_EDGE); xp.More(); xp.Next()) { + if (!img.HasImage(xp.Current())) { +- Standard_Failure::Raise("no image for shape"); ++ throw Standard_Failure("no image for shape"); + } + const TopTools_ListOfShape& currentImage = img.Image(xp.Current()); + TopTools_ListIteratorOfListOfShape listIt; +@@ -2800,7 +2800,7 @@ TopoDS_Shape TopoShape::makeOffsetShape( + if (edgeCount != 1) { + std::ostringstream stream; + stream << "wrong edge count: " << edgeCount << std::endl; +- Standard_Failure::Raise(stream.str().c_str()); ++ throw Standard_Failure(stream.str().c_str()); + } + builder.Add(offsetWire, mappedEdge); + } +@@ -2817,7 +2817,7 @@ TopoDS_Shape TopoShape::makeOffsetShape( + aGenerator.Build(); + #endif + if (!aGenerator.IsDone()) { +- Standard_Failure::Raise("ThruSections failed"); ++ throw Standard_Failure("ThruSections failed"); + } + + builder.Add(perimeterCompound, aGenerator.Shape()); +@@ -3259,7 +3259,7 @@ void TopoShape::transformGeometry(const Base::Matrix4D + { + try { + if (this->_Shape.IsNull()) { +- Standard_Failure::Raise("Cannot transform null shape"); ++ throw Standard_Failure("Cannot transform null shape"); + } + + *this = makeGTransform(rclMat); +@@ -3296,7 +3296,7 @@ TopoDS_Shape TopoShape::transformGShape(const Base::Ma + TopoDS_Shape TopoShape::transformGShape(const Base::Matrix4D& rclTrf, bool copy) const + { + if (this->_Shape.IsNull()) { +- Standard_Failure::Raise("Cannot transform null shape"); ++ throw Standard_Failure("Cannot transform null shape"); + } + + gp_GTrsf mat; +@@ -3322,7 +3322,7 @@ bool TopoShape::transformShape(const Base::Matrix4D& r + bool TopoShape::transformShape(const Base::Matrix4D& rclTrf, bool copy, bool checkScale) + { + if (this->_Shape.IsNull()) { +- Standard_Failure::Raise("Cannot transform null shape"); ++ throw Standard_Failure("Cannot transform null shape"); + } + + return _makeTransform(TopoShape(*this), rclTrf, nullptr, checkScale, copy); +@@ -3339,7 +3339,7 @@ TopoDS_Shape TopoShape::toNurbs() const + TopoDS_Shape TopoShape::toNurbs() const + { + if (this->_Shape.IsNull()) { +- Standard_Failure::Raise("Cannot convert null shape to NURBS"); ++ throw Standard_Failure("Cannot convert null shape to NURBS"); + } + + BRepBuilderAPI_NurbsConvert mkNurbs(this->_Shape); +@@ -3484,7 +3484,7 @@ TopoDS_Shape TopoShape::removeSplitter() const + TopoDS_Shape TopoShape::removeSplitter() const + { + if (_Shape.IsNull()) { +- Standard_Failure::Raise("Cannot remove splitter from empty shape"); ++ throw Standard_Failure("Cannot remove splitter from empty shape"); + } + + if (_Shape.ShapeType() == TopAbs_SOLID) { +@@ -3504,7 +3504,7 @@ TopoDS_Shape TopoShape::removeSplitter() const + } + } + else { +- Standard_Failure::Raise("Removing splitter failed"); ++ throw Standard_Failure("Removing splitter failed"); + return _Shape; + } + } +@@ -3517,7 +3517,7 @@ TopoDS_Shape TopoShape::removeSplitter() const + return uniter.getShell(); + } + else { +- Standard_Failure::Raise("Removing splitter failed"); ++ throw Standard_Failure("Removing splitter failed"); + } + } + else if (_Shape.ShapeType() == TopAbs_COMPOUND) { +@@ -4026,7 +4026,7 @@ TopoDS_Shape TopoShape::defeaturing(const std::vector< + TopoDS_Shape TopoShape::defeaturing(const std::vector& s) const + { + if (this->_Shape.IsNull()) { +- Standard_Failure::Raise("Base shape is null"); ++ throw Standard_Failure("Base shape is null"); + } + BRepAlgoAPI_Defeaturing defeat; + defeat.SetRunParallel(true); diff --git a/cad/freecad/files/patch-src_Mod_Part_App_TopoShapeCache.h b/cad/freecad/files/patch-src_Mod_Part_App_TopoShapeCache.h new file mode 100644 index 000000000000..f20c41879b5b --- /dev/null +++ b/cad/freecad/files/patch-src_Mod_Part_App_TopoShapeCache.h @@ -0,0 +1,12 @@ +--- src/Mod/Part/App/TopoShapeCache.h.orig 2026-07-01 20:30:17 UTC ++++ src/Mod/Part/App/TopoShapeCache.h +@@ -32,7 +32,8 @@ + #include + #include + #include +-#include ++#include ++#include + #include + + #include diff --git a/cad/freecad/files/patch-src_Mod_Part_App_TopoShapeCompSolidPyImp.cpp b/cad/freecad/files/patch-src_Mod_Part_App_TopoShapeCompSolidPyImp.cpp new file mode 100644 index 000000000000..acc067cc5215 --- /dev/null +++ b/cad/freecad/files/patch-src_Mod_Part_App_TopoShapeCompSolidPyImp.cpp @@ -0,0 +1,11 @@ +--- src/Mod/Part/App/TopoShapeCompSolidPyImp.cpp.orig 2026-07-01 20:50:53 UTC ++++ src/Mod/Part/App/TopoShapeCompSolidPyImp.cpp +@@ -95,7 +95,7 @@ PyObject* TopoShapeCompSolidPy::add(PyObject* args) + builder.Add(comp, ts.getShape()); + } + else { +- Standard_Failure::Raise("Cannot empty shape to compound solid"); ++ throw Standard_Failure("Cannot empty shape to compound solid"); + } + } + auto& self = *getTopoShapePtr(); diff --git a/cad/freecad/files/patch-src_Mod_Part_App_TopoShapeEdgePyImp.cpp b/cad/freecad/files/patch-src_Mod_Part_App_TopoShapeEdgePyImp.cpp new file mode 100644 index 000000000000..2d0ddac97017 --- /dev/null +++ b/cad/freecad/files/patch-src_Mod_Part_App_TopoShapeEdgePyImp.cpp @@ -0,0 +1,29 @@ +--- src/Mod/Part/App/TopoShapeEdgePyImp.cpp.orig 2026-07-02 12:13:06 UTC ++++ src/Mod/Part/App/TopoShapeEdgePyImp.cpp +@@ -29,7 +29,6 @@ + #include + #include + #include +-#include + #include + #include + #include +@@ -62,6 +61,7 @@ + #include + #include + #include ++#include + + #include + #include +@@ -214,8 +214,8 @@ PyObject* TopoShapeEdgePy::getParameterByLength(PyObje + BRepAdaptor_Curve adapt(e); + + // transform value of [0,Length] to [First,Last] +- double first = BRepLProp_CurveTool::FirstParameter(adapt); +- double last = BRepLProp_CurveTool::LastParameter(adapt); ++ double first = adapt.FirstParameter(); ++ double last = adapt.LastParameter(); + if (!Precision::IsInfinite(first) && !Precision::IsInfinite(last)) { + double length = GCPnts_AbscissaPoint::Length(adapt, t); + diff --git a/cad/freecad/files/patch-src_Mod_Part_App_TopoShapeExpansion.cpp b/cad/freecad/files/patch-src_Mod_Part_App_TopoShapeExpansion.cpp new file mode 100644 index 000000000000..9a06710a0a2f --- /dev/null +++ b/cad/freecad/files/patch-src_Mod_Part_App_TopoShapeExpansion.cpp @@ -0,0 +1,32 @@ +--- src/Mod/Part/App/TopoShapeExpansion.cpp.orig 2026-07-01 20:30:18 UTC ++++ src/Mod/Part/App/TopoShapeExpansion.cpp +@@ -4982,9 +4982,17 @@ TopoShape& TopoShape::makeElementBSplineFace( + auto e4 = mk4.Edge(); + + ShapeMapper mapper; +- mapper.populate(MappingStatus::Modified, e, {e1, e2, e3, e4}); +- mapper.populate(MappingStatus::Generated, v, {TopExp::FirstVertex(e1)}); +- mapper.populate(MappingStatus::Generated, v, {TopExp::LastVertex(e4)}); ++ mapper.populate(MappingStatus::Modified, e, std::vector {e1, e2, e3, e4}); ++ mapper.populate( ++ MappingStatus::Generated, ++ v, ++ std::vector {TopExp::FirstVertex(e1)} ++ ); ++ mapper.populate( ++ MappingStatus::Generated, ++ v, ++ std::vector {TopExp::LastVertex(e4)} ++ ); + + BRep_Builder builder; + TopoDS_Compound comp; +@@ -5089,7 +5097,7 @@ TopoShape& TopoShape::makeElementBSplineFace( + Handle(Geom_BSplineCurve) spline + = scc.ConvertToBSpline(c_geom, u1, u2, Precision::Confusion()); + if (spline.IsNull()) { +- Standard_Failure::Raise( ++ throw Standard_Failure( + "A curve was not a B-spline and could not be converted into one." + ); + } diff --git a/cad/freecad/files/patch-src_Mod_Part_App_TopoShapeFacePyImp.cpp b/cad/freecad/files/patch-src_Mod_Part_App_TopoShapeFacePyImp.cpp new file mode 100644 index 000000000000..7d797e066bc1 --- /dev/null +++ b/cad/freecad/files/patch-src_Mod_Part_App_TopoShapeFacePyImp.cpp @@ -0,0 +1,98 @@ +--- src/Mod/Part/App/TopoShapeFacePyImp.cpp.orig 2026-07-01 20:50:53 UTC ++++ src/Mod/Part/App/TopoShapeFacePyImp.cpp +@@ -303,11 +303,11 @@ int TopoShapeFacePy::PyInit(PyObject* args, PyObject* + wires.push_back(TopoDS::Wire(sh)); + } + else { +- Standard_Failure::Raise("shape is not a wire"); ++ throw Standard_Failure("shape is not a wire"); + } + } + else { +- Standard_Failure::Raise("shape is not a wire"); ++ throw Standard_Failure("shape is not a wire"); + } + } + +@@ -316,19 +316,19 @@ int TopoShapeFacePy::PyInit(PyObject* args, PyObject* + if (!mkFace.IsDone()) { + switch (mkFace.Error()) { + case BRepBuilderAPI_NoFace: +- Standard_Failure::Raise("No face"); ++ throw Standard_Failure("No face"); + break; + case BRepBuilderAPI_NotPlanar: +- Standard_Failure::Raise("Not planar"); ++ throw Standard_Failure("Not planar"); + break; + case BRepBuilderAPI_CurveProjectionFailed: +- Standard_Failure::Raise("Curve projection failed"); ++ throw Standard_Failure("Curve projection failed"); + break; + case BRepBuilderAPI_ParametersOutOfRange: +- Standard_Failure::Raise("Parameters out of range"); ++ throw Standard_Failure("Parameters out of range"); + break; + default: +- Standard_Failure::Raise("Unknown failure"); ++ throw Standard_Failure("Unknown failure"); + break; + } + } +@@ -340,7 +340,7 @@ int TopoShapeFacePy::PyInit(PyObject* args, PyObject* + return 0; + } + else { +- Standard_Failure::Raise("no wires in list"); ++ throw Standard_Failure("no wires in list"); + } + } + catch (Standard_Failure& e) { +@@ -812,11 +812,11 @@ PyObject* TopoShapeFacePy::cutHoles(PyObject* args) + wires.push_back(TopoDS::Wire(sh)); + } + else { +- Standard_Failure::Raise("shape is not a wire"); ++ throw Standard_Failure("shape is not a wire"); + } + } + else { +- Standard_Failure::Raise("argument is not a shape"); ++ throw Standard_Failure("argument is not a shape"); + } + } + +@@ -829,19 +829,19 @@ PyObject* TopoShapeFacePy::cutHoles(PyObject* args) + if (!mkFace.IsDone()) { + switch (mkFace.Error()) { + case BRepBuilderAPI_NoFace: +- Standard_Failure::Raise("No face"); ++ throw Standard_Failure("No face"); + break; + case BRepBuilderAPI_NotPlanar: +- Standard_Failure::Raise("Not planar"); ++ throw Standard_Failure("Not planar"); + break; + case BRepBuilderAPI_CurveProjectionFailed: +- Standard_Failure::Raise("Curve projection failed"); ++ throw Standard_Failure("Curve projection failed"); + break; + case BRepBuilderAPI_ParametersOutOfRange: +- Standard_Failure::Raise("Parameters out of range"); ++ throw Standard_Failure("Parameters out of range"); + break; + default: +- Standard_Failure::Raise("Unknown failure"); ++ throw Standard_Failure("Unknown failure"); + break; + } + } +@@ -850,7 +850,7 @@ PyObject* TopoShapeFacePy::cutHoles(PyObject* args) + Py_Return; + } + else { +- Standard_Failure::Raise("empty wire list"); ++ throw Standard_Failure("empty wire list"); + } + } + catch (Standard_Failure& e) { diff --git a/cad/freecad/files/patch-src_Mod_Part_App_TopoShapePyImp.cpp b/cad/freecad/files/patch-src_Mod_Part_App_TopoShapePyImp.cpp new file mode 100644 index 000000000000..fb6b6d7e7188 --- /dev/null +++ b/cad/freecad/files/patch-src_Mod_Part_App_TopoShapePyImp.cpp @@ -0,0 +1,23 @@ +--- src/Mod/Part/App/TopoShapePyImp.cpp.orig 2026-07-01 20:30:18 UTC ++++ src/Mod/Part/App/TopoShapePyImp.cpp +@@ -63,8 +63,10 @@ + #include + #include + #include +-#include + #include ++#include ++#include ++#include + + #include + #include +@@ -1539,7 +1541,7 @@ PyObject* TopoShapePy::isClosed(PyObject* args) const + + try { + if (getTopoShapePtr()->getShape().IsNull()) { +- Standard_Failure::Raise("Cannot determine the 'Closed'' flag of an empty shape"); ++ throw Standard_Failure("Cannot determine the 'Closed'' flag of an empty shape"); + } + return Py_BuildValue("O", (getTopoShapePtr()->isClosed() ? Py_True : Py_False)); + } diff --git a/cad/freecad/files/patch-src_Mod_Part_App_TopoShapeShellPyImp.cpp b/cad/freecad/files/patch-src_Mod_Part_App_TopoShapeShellPyImp.cpp new file mode 100644 index 000000000000..053e6957ebc7 --- /dev/null +++ b/cad/freecad/files/patch-src_Mod_Part_App_TopoShapeShellPyImp.cpp @@ -0,0 +1,11 @@ +--- src/Mod/Part/App/TopoShapeShellPyImp.cpp.orig 2026-07-01 20:50:53 UTC ++++ src/Mod/Part/App/TopoShapeShellPyImp.cpp +@@ -120,7 +120,7 @@ PyObject* TopoShapeShellPy::add(PyObject* args) + } + } + else { +- Standard_Failure::Raise("cannot add empty shape"); ++ throw Standard_Failure("cannot add empty shape"); + } + } + catch (Standard_Failure& e) { diff --git a/cad/freecad/files/patch-src_Mod_Part_App_WireJoiner.cpp b/cad/freecad/files/patch-src_Mod_Part_App_WireJoiner.cpp new file mode 100644 index 000000000000..52478a3de9c3 --- /dev/null +++ b/cad/freecad/files/patch-src_Mod_Part_App_WireJoiner.cpp @@ -0,0 +1,12 @@ +--- src/Mod/Part/App/WireJoiner.cpp.orig 2026-07-01 20:50:53 UTC ++++ src/Mod/Part/App/WireJoiner.cpp +@@ -53,6 +53,9 @@ + #include + #include + #include ++#include ++#include ++#include + + #include + #include diff --git a/cad/freecad/files/patch-src_Mod_Part_App_modelRefine.cpp b/cad/freecad/files/patch-src_Mod_Part_App_modelRefine.cpp new file mode 100644 index 000000000000..756b6918c4dc --- /dev/null +++ b/cad/freecad/files/patch-src_Mod_Part_App_modelRefine.cpp @@ -0,0 +1,44 @@ +--- src/Mod/Part/App/modelRefine.cpp.orig 2026-07-01 20:30:18 UTC ++++ src/Mod/Part/App/modelRefine.cpp +@@ -62,10 +62,11 @@ + #include + #include + #include +-#include +-#include +-#include + #include ++#include ++#include ++#include ++#include + + #include + +@@ -1316,7 +1317,7 @@ void Part::BRepBuilderAPI_RefineModel::Build() + #endif + { + if (myShape.IsNull()) { +- Standard_Failure::Raise("Cannot remove splitter from empty shape"); ++ throw Standard_Failure("Cannot remove splitter from empty shape"); + } + + if (myShape.ShapeType() == TopAbs_SOLID) { +@@ -1337,7 +1338,7 @@ void Part::BRepBuilderAPI_RefineModel::Build() + } + } + else { +- Standard_Failure::Raise("Removing splitter failed"); ++ throw Standard_Failure("Removing splitter failed"); + } + } + myShape = mkSolid.Solid(); +@@ -1351,7 +1352,7 @@ void Part::BRepBuilderAPI_RefineModel::Build() + LogModifications(uniter); + } + else { +- Standard_Failure::Raise("Removing splitter failed"); ++ throw Standard_Failure("Removing splitter failed"); + } + } + else if (myShape.ShapeType() == TopAbs_COMPOUND) { diff --git a/cad/freecad/files/patch-src_Mod_Part_Gui_DlgProjectionOnSurface.cpp b/cad/freecad/files/patch-src_Mod_Part_Gui_DlgProjectionOnSurface.cpp new file mode 100644 index 000000000000..423690455a6f --- /dev/null +++ b/cad/freecad/files/patch-src_Mod_Part_Gui_DlgProjectionOnSurface.cpp @@ -0,0 +1,11 @@ +--- src/Mod/Part/Gui/DlgProjectionOnSurface.cpp.orig 2026-07-01 20:50:53 UTC ++++ src/Mod/Part/Gui/DlgProjectionOnSurface.cpp +@@ -43,6 +43,8 @@ + #include + #include + #include ++#include ++#include + + + #include diff --git a/cad/freecad/files/patch-src_Mod_Part_Gui_TaskCheckGeometry.cpp b/cad/freecad/files/patch-src_Mod_Part_Gui_TaskCheckGeometry.cpp new file mode 100644 index 000000000000..cfcaff4ac84f --- /dev/null +++ b/cad/freecad/files/patch-src_Mod_Part_Gui_TaskCheckGeometry.cpp @@ -0,0 +1,11 @@ +--- src/Mod/Part/Gui/TaskCheckGeometry.cpp.orig 2026-07-01 20:50:53 UTC ++++ src/Mod/Part/Gui/TaskCheckGeometry.cpp +@@ -38,7 +38,7 @@ + #include + #include + #include +-#include ++#include + #include + #include + #include diff --git a/cad/freecad/files/patch-src_Mod_ReverseEngineering_App_AppReverseEngineering.cpp b/cad/freecad/files/patch-src_Mod_ReverseEngineering_App_AppReverseEngineering.cpp new file mode 100644 index 000000000000..0e05a1a8957d --- /dev/null +++ b/cad/freecad/files/patch-src_Mod_ReverseEngineering_App_AppReverseEngineering.cpp @@ -0,0 +1,22 @@ +--- src/Mod/ReverseEngineering/App/AppReverseEngineering.cpp.orig 2026-07-02 13:42:31 UTC ++++ src/Mod/ReverseEngineering/App/AppReverseEngineering.cpp +@@ -23,6 +23,7 @@ + ***************************************************************************/ + + #include ++#include + #include + + +@@ -403,7 +404,11 @@ class Module : public Py::ExtensionModule (pri + } + } + ++#if OCC_VERSION_HEX >= 0x080000 ++ TColgp_Array1OfPnt clPoints(pts.size()-1); ++#else + TColgp_Array1OfPnt clPoints(0, pts.size()-1); ++#endif + if (clPoints.Length() < uPoles * vPoles) { + throw Py::ValueError("Too less data points for the specified number of poles"); + } diff --git a/cad/freecad/files/patch-src_Mod_ReverseEngineering_App_ApproxSurface.cpp b/cad/freecad/files/patch-src_Mod_ReverseEngineering_App_ApproxSurface.cpp new file mode 100644 index 000000000000..3803079e226a --- /dev/null +++ b/cad/freecad/files/patch-src_Mod_ReverseEngineering_App_ApproxSurface.cpp @@ -0,0 +1,47 @@ +--- src/Mod/ReverseEngineering/App/ApproxSurface.cpp.orig 2026-07-02 14:13:51 UTC ++++ src/Mod/ReverseEngineering/App/ApproxSurface.cpp +@@ -63,7 +63,7 @@ SplineBasisfunction::SplineBasisfunction( + + if (vKnots.Length() != vMults.Length() || iSize != sum) { + // Throw exception +- Standard_ConstructionError::Raise("BSplineBasis"); ++ throw Standard_ConstructionError("BSplineBasis"); + } + + int k = 0; +@@ -89,7 +89,7 @@ void SplineBasisfunction::SetKnots(TColStd_Array1OfRea + void SplineBasisfunction::SetKnots(TColStd_Array1OfReal& vKnots, int iOrder) + { + if (_vKnotVector.Length() != vKnots.Length()) { +- Standard_RangeError::Raise("BSplineBasis"); ++ throw Standard_RangeError("BSplineBasis"); + } + + _vKnotVector = vKnots; +@@ -105,7 +105,7 @@ void SplineBasisfunction::SetKnots(TColStd_Array1OfRea + + if (vKnots.Length() != vMults.Length() || _vKnotVector.Length() != sum) { + // Throw exception +- Standard_RangeError::Raise("BSplineBasis"); ++ throw Standard_RangeError("BSplineBasis"); + } + int k = 0; + for (int i = vMults.Lower(); i <= vMults.Upper(); i++) { +@@ -166,7 +166,7 @@ void BSplineBasis::AllBasisFunctions(double fParam, TC + void BSplineBasis::AllBasisFunctions(double fParam, TColStd_Array1OfReal& vFuncVals) + { + if (vFuncVals.Length() != _iOrder) { +- Standard_RangeError::Raise("BSplineBasis"); ++ throw Standard_RangeError("BSplineBasis"); + } + + int iIndex = FindSpan(fParam); +@@ -268,7 +268,7 @@ void BSplineBasis::DerivativesOfBasisFunction( + { + int iMax = iMaxDer; + if (Derivat.Length() != iMax + 1) { +- Standard_RangeError::Raise("BSplineBasis"); ++ throw Standard_RangeError("BSplineBasis"); + } + // kth derivatives (k> degrees) are zero + if (iMax >= _iOrder) { diff --git a/cad/freecad/files/patch-src_Mod_Sketcher_Gui_DrawSketchHandlerOffset.h b/cad/freecad/files/patch-src_Mod_Sketcher_Gui_DrawSketchHandlerOffset.h new file mode 100644 index 000000000000..f1e9a640ac5d --- /dev/null +++ b/cad/freecad/files/patch-src_Mod_Sketcher_Gui_DrawSketchHandlerOffset.h @@ -0,0 +1,10 @@ +--- src/Mod/Sketcher/Gui/DrawSketchHandlerOffset.h.orig 2026-07-03 08:39:31 UTC ++++ src/Mod/Sketcher/Gui/DrawSketchHandlerOffset.h +@@ -42,6 +42,7 @@ + #include + #include + #include ++#include + #include + + #include diff --git a/cad/freecad/files/patch-src_Mod_Surface_App_Blending_BlendCurve.cpp b/cad/freecad/files/patch-src_Mod_Surface_App_Blending_BlendCurve.cpp new file mode 100644 index 000000000000..f3953996a461 --- /dev/null +++ b/cad/freecad/files/patch-src_Mod_Surface_App_Blending_BlendCurve.cpp @@ -0,0 +1,30 @@ +--- src/Mod/Surface/App/Blending/BlendCurve.cpp.orig 2026-07-02 13:42:30 UTC ++++ src/Mod/Surface/App/Blending/BlendCurve.cpp +@@ -72,7 +72,7 @@ Handle(Geom_BezierCurve) BlendCurve::compute() + + Handle(Geom_BezierCurve) curve; + if (num_poles > (curve->MaxDegree() + 1)) { // use Geom_BezierCurve max degree +- Standard_Failure::Raise("number of constraints exceeds bezier curve capacity"); ++ throw Standard_Failure("number of constraints exceeds bezier curve capacity"); + } + + TColStd_Array1OfReal knots(1, 2 * num_poles); +@@ -114,15 +114,15 @@ Handle(Geom_BezierCurve) BlendCurve::compute() + math_Gauss gauss(OCCmatrix); + gauss.Solve(res_x); + if (!gauss.IsDone()) { +- Standard_Failure::Raise("Failed to solve equations"); ++ throw Standard_Failure("Failed to solve equations"); + } + gauss.Solve(res_y); + if (!gauss.IsDone()) { +- Standard_Failure::Raise("Failed to solve equations"); ++ throw Standard_Failure("Failed to solve equations"); + } + gauss.Solve(res_z); + if (!gauss.IsDone()) { +- Standard_Failure::Raise("Failed to solve equations"); ++ throw Standard_Failure("Failed to solve equations"); + } + + TColgp_Array1OfPnt poles(1, num_poles); diff --git a/cad/freecad/files/patch-src_Mod_Surface_App_FeatureFilling.cpp b/cad/freecad/files/patch-src_Mod_Surface_App_FeatureFilling.cpp new file mode 100644 index 000000000000..060d9162e835 --- /dev/null +++ b/cad/freecad/files/patch-src_Mod_Surface_App_FeatureFilling.cpp @@ -0,0 +1,66 @@ +--- src/Mod/Surface/App/FeatureFilling.cpp.orig 2026-07-02 13:42:30 UTC ++++ src/Mod/Surface/App/FeatureFilling.cpp +@@ -165,7 +165,7 @@ void Filling::addConstraints( + builder.Add(TopoDS::Edge(edge), cont, bnd); + } + else { +- Standard_Failure::Raise( ++ throw Standard_Failure( + "Boundary edges must be added in a consecutive order" + ); + } +@@ -185,25 +185,25 @@ void Filling::addConstraints( + builder.Add(TopoDS::Edge(edge), TopoDS::Face(face), cont, bnd); + } + else { +- Standard_Failure::Raise( ++ throw Standard_Failure( + "Boundary edges must be added in a consecutive order" + ); + } + } + } + else { +- Standard_Failure::Raise("Sub-shape is not a face"); ++ throw Standard_Failure("Sub-shape is not a face"); + } + } + } + else { +- Standard_Failure::Raise("Sub-shape is not an edge"); ++ throw Standard_Failure("Sub-shape is not an edge"); + } + } + } + } + else { +- Standard_Failure::Raise("Number of links does not match with the number of orders"); ++ throw Standard_Failure("Number of links does not match with the number of orders"); + } + } + +@@ -230,13 +230,13 @@ void Filling::addConstraints( + builder.Add(TopoDS::Face(face), cont); + } + else { +- Standard_Failure::Raise("Sub-shape is not a face"); ++ throw Standard_Failure("Sub-shape is not a face"); + } + } + } + } + else { +- Standard_Failure::Raise("Number of links does not match with the number of orders"); ++ throw Standard_Failure("Number of links does not match with the number of orders"); + } + } + +@@ -319,7 +319,7 @@ App::DocumentObjectExecReturn* Filling::execute() + builder.Build(); + } + if (!builder.IsDone()) { +- Standard_Failure::Raise("Failed to create a face from constraints"); ++ throw Standard_Failure("Failed to create a face from constraints"); + } + + // Return the face diff --git a/cad/freecad/files/patch-src_Mod_Surface_App_FeatureGeomFillSurface.cpp b/cad/freecad/files/patch-src_Mod_Surface_App_FeatureGeomFillSurface.cpp new file mode 100644 index 000000000000..a8b046445a81 --- /dev/null +++ b/cad/freecad/files/patch-src_Mod_Surface_App_FeatureGeomFillSurface.cpp @@ -0,0 +1,93 @@ +--- src/Mod/Surface/App/FeatureGeomFillSurface.cpp.orig 2026-07-02 13:42:30 UTC ++++ src/Mod/Surface/App/FeatureGeomFillSurface.cpp +@@ -69,7 +69,7 @@ void ShapeValidator::checkEdge(const TopoDS_Shape& sha + void ShapeValidator::checkEdge(const TopoDS_Shape& shape) + { + if (shape.IsNull() || shape.ShapeType() != TopAbs_EDGE) { +- Standard_Failure::Raise("Shape is not an edge.\n"); ++ throw Standard_Failure("Shape is not an edge.\n"); + } + + TopoDS_Edge etmp = TopoDS::Edge(shape); // Curve TopoDS_Edge +@@ -120,7 +120,7 @@ void ShapeValidator::checkAndAdd( + } + } + catch (Standard_Failure&) { // any OCC exception means an inappropriate shape in the selection +- Standard_Failure::Raise("Wrong shape type.\n"); ++ throw Standard_Failure("Wrong shape type.\n"); + } + } + +@@ -200,7 +200,7 @@ GeomFill_FillingStyle GeomFillSurface::getFillingStyle + case GeomFill_CurvedStyle: + return static_cast(FillType.getValue()); + default: +- Standard_Failure::Raise("Filling style must be 0 (Stretch), 1 (Coons), or 2 (Curved).\n"); ++ throw Standard_Failure("Filling style must be 0 (Stretch), 1 (Coons), or 2 (Curved).\n"); + return GeomFill_StretchStyle; // this is to shut up the compiler + } + } +@@ -212,7 +212,7 @@ bool GeomFillSurface::getWire(TopoDS_Wire& aWire) + + std::vector boundary = BoundaryList.getSubListValues(); + if (boundary.size() > 4) { // if too many not even try +- Standard_Failure::Raise("Only 2-4 curves are allowed\n"); ++ throw Standard_Failure("Only 2-4 curves are allowed\n"); + } + + ShapeValidator validator; +@@ -224,12 +224,12 @@ bool GeomFillSurface::getWire(TopoDS_Wire& aWire) + } + } + else { +- Standard_Failure::Raise("Curve not from Part::Feature\n"); ++ throw Standard_Failure("Curve not from Part::Feature\n"); + } + } + + if (validator.numEdges() < 2 || validator.numEdges() > 4) { +- Standard_Failure::Raise("Only 2-4 curves are allowed\n"); ++ throw Standard_Failure("Only 2-4 curves are allowed\n"); + } + + // Reorder the curves and fix the wire if required +@@ -244,7 +244,7 @@ bool GeomFillSurface::getWire(TopoDS_Wire& aWire) + aWire = aShFW->Wire(); // Healed Wire + + if (aWire.IsNull()) { +- Standard_Failure::Raise("Wire unable to be constructed\n"); ++ throw Standard_Failure("Wire unable to be constructed\n"); + } + + return validator.isBezier(); +@@ -261,10 +261,10 @@ void GeomFillSurface::createFace(const Handle(Geom_Bou + TopoDS_Face aFace = aFaceBuilder.Face(); + + if (!aFaceBuilder.IsDone()) { +- Standard_Failure::Raise("Face unable to be constructed\n"); ++ throw Standard_Failure("Face unable to be constructed\n"); + } + if (aFace.IsNull()) { +- Standard_Failure::Raise("Resulting Face is null\n"); ++ throw Standard_Failure("Resulting Face is null\n"); + } + this->Shape.setValue(aFace); + } +@@ -291,7 +291,7 @@ void GeomFillSurface::createBezierSurface(TopoDS_Wire& + curves.push_back(bezier); + } + else { +- Standard_Failure::Raise("Curve not a Bezier Curve"); ++ throw Standard_Failure("Curve not a Bezier Curve"); + } + } + +@@ -360,7 +360,7 @@ void GeomFillSurface::createBSplineSurface(TopoDS_Wire + Handle(Geom_BSplineCurve) spline + = scc.ConvertToBSpline(c_geom, u1, u2, Precision::Confusion()); + if (spline.IsNull()) { +- Standard_Failure::Raise( ++ throw Standard_Failure( + "A curve was not a B-spline and could not be converted into one." + ); + } diff --git a/cad/freecad/files/patch-src_Mod_Surface_App_FeatureSections.cpp b/cad/freecad/files/patch-src_Mod_Surface_App_FeatureSections.cpp new file mode 100644 index 000000000000..8a8f79f0ee36 --- /dev/null +++ b/cad/freecad/files/patch-src_Mod_Surface_App_FeatureSections.cpp @@ -0,0 +1,10 @@ +--- src/Mod/Surface/App/FeatureSections.cpp.orig 2026-07-02 13:42:30 UTC ++++ src/Mod/Surface/App/FeatureSections.cpp +@@ -29,6 +29,7 @@ + #include + #include + #include ++#include + #include + #include + diff --git a/cad/freecad/files/patch-src_Mod_Surface_App_FeatureSewing.cpp b/cad/freecad/files/patch-src_Mod_Surface_App_FeatureSewing.cpp new file mode 100644 index 000000000000..e30041a775af --- /dev/null +++ b/cad/freecad/files/patch-src_Mod_Surface_App_FeatureSewing.cpp @@ -0,0 +1,11 @@ +--- src/Mod/Surface/App/FeatureSewing.cpp.orig 2026-07-02 13:42:30 UTC ++++ src/Mod/Surface/App/FeatureSewing.cpp +@@ -84,7 +84,7 @@ App::DocumentObjectExecReturn* Sewing::execute() + } + } + else { +- Standard_Failure::Raise("Shape item not from Part::Feature"); ++ throw Standard_Failure("Shape item not from Part::Feature"); + } + } + diff --git a/cad/freecad/files/patch-src_Mod_Surface_Gui_TaskFilling.cpp b/cad/freecad/files/patch-src_Mod_Surface_Gui_TaskFilling.cpp new file mode 100644 index 000000000000..7411b693f17f --- /dev/null +++ b/cad/freecad/files/patch-src_Mod_Surface_Gui_TaskFilling.cpp @@ -0,0 +1,10 @@ +--- src/Mod/Surface/Gui/TaskFilling.cpp.orig 2026-07-02 13:42:30 UTC ++++ src/Mod/Surface/Gui/TaskFilling.cpp +@@ -31,7 +31,6 @@ + #include + #include + #include +-#include + + #include + #include diff --git a/cad/freecad/files/patch-src_Mod_Surface_Gui_TaskFillingEdge.cpp b/cad/freecad/files/patch-src_Mod_Surface_Gui_TaskFillingEdge.cpp new file mode 100644 index 000000000000..aff50e1f7129 --- /dev/null +++ b/cad/freecad/files/patch-src_Mod_Surface_Gui_TaskFillingEdge.cpp @@ -0,0 +1,10 @@ +--- src/Mod/Surface/Gui/TaskFillingEdge.cpp.orig 2026-07-02 13:42:30 UTC ++++ src/Mod/Surface/Gui/TaskFillingEdge.cpp +@@ -31,7 +31,6 @@ + #include + #include + #include +-#include + + #include + #include diff --git a/cad/freecad/files/patch-src_Mod_TechDraw_App_DrawComplexSection.cpp b/cad/freecad/files/patch-src_Mod_TechDraw_App_DrawComplexSection.cpp new file mode 100644 index 000000000000..1fced6e83c6e --- /dev/null +++ b/cad/freecad/files/patch-src_Mod_TechDraw_App_DrawComplexSection.cpp @@ -0,0 +1,10 @@ +--- src/Mod/TechDraw/App/DrawComplexSection.cpp.orig 2026-07-02 14:27:52 UTC ++++ src/Mod/TechDraw/App/DrawComplexSection.cpp +@@ -84,6 +84,7 @@ + #include + #include + #include ++#include + #include + #include + #include diff --git a/cad/freecad/files/patch-src_Mod_TechDraw_App_DrawProjectSplit.cpp b/cad/freecad/files/patch-src_Mod_TechDraw_App_DrawProjectSplit.cpp new file mode 100644 index 000000000000..30828477f5ec --- /dev/null +++ b/cad/freecad/files/patch-src_Mod_TechDraw_App_DrawProjectSplit.cpp @@ -0,0 +1,21 @@ +--- src/Mod/TechDraw/App/DrawProjectSplit.cpp.orig 2026-07-02 14:27:52 UTC ++++ src/Mod/TechDraw/App/DrawProjectSplit.cpp +@@ -32,7 +32,6 @@ + #include + #include + #include +-#include + #include + #include + #include +@@ -216,8 +215,8 @@ std::vector DrawProjectSplit::split1Edge( + + BRepAdaptor_Curve adapt(e); + Handle(Geom_Curve) c = adapt.Curve().Curve(); +- double first = BRepLProp_CurveTool::FirstParameter(adapt); +- double last = BRepLProp_CurveTool::LastParameter(adapt); ++ double first = adapt.FirstParameter(); ++ double last = adapt.LastParameter(); + if (first > last) { + //TODO parms.reverse(); + Base::Console().message("DPS::split1Edge - edge is backwards!\n"); diff --git a/cad/freecad/files/patch-src_Mod_TechDraw_App_DrawUtil.cpp b/cad/freecad/files/patch-src_Mod_TechDraw_App_DrawUtil.cpp new file mode 100644 index 000000000000..bb335522b183 --- /dev/null +++ b/cad/freecad/files/patch-src_Mod_TechDraw_App_DrawUtil.cpp @@ -0,0 +1,32 @@ +--- src/Mod/TechDraw/App/DrawUtil.cpp.orig 2026-07-02 14:27:52 UTC ++++ src/Mod/TechDraw/App/DrawUtil.cpp +@@ -38,7 +38,6 @@ + #include + #include + #include +-#include + #include + #include + #include +@@ -1172,8 +1171,8 @@ bool DrawUtil::isCrazy(TopoDS_Edge e) + return true; + } + +- double start = BRepLProp_CurveTool::FirstParameter(adapt); +- double end = BRepLProp_CurveTool::LastParameter(adapt); ++ double start = adapt.FirstParameter(); ++ double end = adapt.LastParameter(); + BRepLProp_CLProps propStart(adapt, start, 0, Precision::Confusion()); + const gp_Pnt& vStart = propStart.Value(); + BRepLProp_CLProps propEnd(adapt, end, 0, Precision::Confusion()); +@@ -1934,8 +1933,8 @@ void DrawUtil::dumpEdge(const char* label, int i, Topo + void DrawUtil::dumpEdge(const char* label, int i, TopoDS_Edge e) + { + BRepAdaptor_Curve adapt(e); +- double start = BRepLProp_CurveTool::FirstParameter(adapt); +- double end = BRepLProp_CurveTool::LastParameter(adapt); ++ double start = adapt.FirstParameter(); ++ double end = adapt.LastParameter(); + BRepLProp_CLProps propStart(adapt, start, 0, Precision::Confusion()); + const gp_Pnt& vStart = propStart.Value(); + BRepLProp_CLProps propEnd(adapt, end, 0, Precision::Confusion()); diff --git a/cad/freecad/files/patch-src_Mod_TechDraw_App_DrawViewDimension.cpp b/cad/freecad/files/patch-src_Mod_TechDraw_App_DrawViewDimension.cpp new file mode 100644 index 000000000000..b5717acaf2fc --- /dev/null +++ b/cad/freecad/files/patch-src_Mod_TechDraw_App_DrawViewDimension.cpp @@ -0,0 +1,10 @@ +--- src/Mod/TechDraw/App/DrawViewDimension.cpp.orig 2026-07-02 14:27:52 UTC ++++ src/Mod/TechDraw/App/DrawViewDimension.cpp +@@ -52,6 +52,7 @@ + #include + #include + #include ++#include + + #include + #include diff --git a/cad/freecad/files/patch-src_Mod_TechDraw_App_Geometry.cpp b/cad/freecad/files/patch-src_Mod_TechDraw_App_Geometry.cpp new file mode 100644 index 000000000000..85247aa79815 --- /dev/null +++ b/cad/freecad/files/patch-src_Mod_TechDraw_App_Geometry.cpp @@ -0,0 +1,21 @@ +--- src/Mod/TechDraw/App/Geometry.cpp.orig 2026-07-02 14:27:52 UTC ++++ src/Mod/TechDraw/App/Geometry.cpp +@@ -34,7 +34,6 @@ + # include + # include + # include +-# include + # include + # include + # include +@@ -1712,8 +1711,8 @@ double GeometryUtils::edgeLength(TopoDS_Edge occEdge) + { + BRepAdaptor_Curve adapt(occEdge); + const Handle(Geom_Curve) curve = adapt.Curve().Curve(); +- double first = BRepLProp_CurveTool::FirstParameter(adapt); +- double last = BRepLProp_CurveTool::LastParameter(adapt); ++ double first = adapt.FirstParameter(); ++ double last = adapt.LastParameter(); + try { + GeomAdaptor_Curve adaptor(curve); + return GCPnts_AbscissaPoint::Length(adaptor,first,last,Precision::Confusion()); diff --git a/cad/freecad/files/patch-src_Mod_TechDraw_App_GeometryObject.cpp b/cad/freecad/files/patch-src_Mod_TechDraw_App_GeometryObject.cpp new file mode 100644 index 000000000000..6a62bb2f52bc --- /dev/null +++ b/cad/freecad/files/patch-src_Mod_TechDraw_App_GeometryObject.cpp @@ -0,0 +1,10 @@ +--- src/Mod/TechDraw/App/GeometryObject.cpp.orig 2026-07-02 14:27:52 UTC ++++ src/Mod/TechDraw/App/GeometryObject.cpp +@@ -31,7 +31,6 @@ + #include + #include + #include +-#include + #include + #include + #include diff --git a/cad/freecad/files/patch-src_Mod_TechDraw_App_ShapeUtils.cpp b/cad/freecad/files/patch-src_Mod_TechDraw_App_ShapeUtils.cpp new file mode 100644 index 000000000000..35307ba50301 --- /dev/null +++ b/cad/freecad/files/patch-src_Mod_TechDraw_App_ShapeUtils.cpp @@ -0,0 +1,10 @@ +--- src/Mod/TechDraw/App/ShapeUtils.cpp.orig 2026-07-02 14:27:52 UTC ++++ src/Mod/TechDraw/App/ShapeUtils.cpp +@@ -32,7 +32,6 @@ + #include + #include + #include +-#include + #include + #include + #include diff --git a/cad/freecad/files/patch-src_Mod_TechDraw_App_TechDrawExport.cpp b/cad/freecad/files/patch-src_Mod_TechDraw_App_TechDrawExport.cpp new file mode 100644 index 000000000000..65db82a1bed4 --- /dev/null +++ b/cad/freecad/files/patch-src_Mod_TechDraw_App_TechDrawExport.cpp @@ -0,0 +1,85 @@ +--- src/Mod/TechDraw/App/TechDrawExport.cpp.orig 2026-07-02 14:27:52 UTC ++++ src/Mod/TechDraw/App/TechDrawExport.cpp +@@ -45,6 +45,7 @@ + # include + # include + # include ++# include + # include + # include + # include +@@ -290,7 +291,7 @@ void SVGOutput::printBezier(const BRepAdaptor_Curve& c + printBSpline(spline, id, out); + } + else { +- Standard_Failure::Raise("do it the generic way"); ++ throw Standard_Failure("do it the generic way"); + } + + return; +@@ -301,7 +302,7 @@ void SVGOutput::printBezier(const BRepAdaptor_Curve& c + str << p1.X() << ", " << p1.Y(); + if (bezier->Degree() == 3) { + if (poles != 4) +- Standard_Failure::Raise("do it the generic way"); ++ throw Standard_Failure("do it the generic way"); + gp_Pnt p2 = bezier->Pole(2); + gp_Pnt p3 = bezier->Pole(3); + gp_Pnt p4 = bezier->Pole(4); +@@ -312,7 +313,7 @@ void SVGOutput::printBezier(const BRepAdaptor_Curve& c + } + else if (bezier->Degree() == 2) { + if (poles != 3) +- Standard_Failure::Raise("do it the generic way"); ++ throw Standard_Failure("do it the generic way"); + gp_Pnt p2 = bezier->Pole(2); + gp_Pnt p3 = bezier->Pole(3); + str << " Q" +@@ -321,12 +322,12 @@ void SVGOutput::printBezier(const BRepAdaptor_Curve& c + } + else if (bezier->Degree() == 1) { + if (poles != 2) +- Standard_Failure::Raise("do it the generic way"); ++ throw Standard_Failure("do it the generic way"); + gp_Pnt p2 = bezier->Pole(2); + str << " L" << p2.X() << ", " << p2.Y() << " "; + } + else { +- Standard_Failure::Raise("do it the generic way"); ++ throw Standard_Failure("do it the generic way"); + } + + str << "\" />"; +@@ -367,7 +368,7 @@ void SVGOutput::printBSpline(const BRepAdaptor_Curve& + } + if (bezier->Degree() == 3) { + if (poles != 4) +- Standard_Failure::Raise("do it the generic way"); ++ throw Standard_Failure("do it the generic way"); + gp_Pnt p2 = bezier->Pole(2); + gp_Pnt p3 = bezier->Pole(3); + gp_Pnt p4 = bezier->Pole(4); +@@ -378,7 +379,7 @@ void SVGOutput::printBSpline(const BRepAdaptor_Curve& + } + else if (bezier->Degree() == 2) { + if (poles != 3) +- Standard_Failure::Raise("do it the generic way"); ++ throw Standard_Failure("do it the generic way"); + gp_Pnt p2 = bezier->Pole(2); + gp_Pnt p3 = bezier->Pole(3); + str << " Q" +@@ -387,12 +388,12 @@ void SVGOutput::printBSpline(const BRepAdaptor_Curve& + } + else if (bezier->Degree() == 1) { + if (poles != 2) +- Standard_Failure::Raise("do it the generic way"); ++ throw Standard_Failure("do it the generic way"); + gp_Pnt p2 = bezier->Pole(2); + str << " L" << p2.X() << ", " << p2.Y() << " "; + } + else { +- Standard_Failure::Raise("do it the generic way"); ++ throw Standard_Failure("do it the generic way"); + } + } + diff --git a/cad/freecad/files/patch-src_Mod_TechDraw_Gui_CommandCreateDims.cpp b/cad/freecad/files/patch-src_Mod_TechDraw_Gui_CommandCreateDims.cpp index 40b15780c3a1..a6fed02dafdf 100644 --- a/cad/freecad/files/patch-src_Mod_TechDraw_Gui_CommandCreateDims.cpp +++ b/cad/freecad/files/patch-src_Mod_TechDraw_Gui_CommandCreateDims.cpp @@ -1,43 +1,39 @@ commit 9e5555fe3fd762474a531da72a3aa1a3cdb1b6c4 Author: Chris Date: Mon Apr 13 22:18:38 2026 -0500 TechDraw: Remove explicit template use of std::abs (#28985) Unnecessary, and fails to build on macOS 26. -diff --git src/Mod/TechDraw/Gui/CommandCreateDims.cpp src/Mod/TechDraw/Gui/CommandCreateDims.cpp -index cc3808bf7f..7e55d5993f 100644 ---- src/Mod/TechDraw/Gui/CommandCreateDims.cpp +--- src/Mod/TechDraw/Gui/CommandCreateDims.cpp.orig 2026-07-01 13:44:38 UTC +++ src/Mod/TechDraw/Gui/CommandCreateDims.cpp -@@ -1127,7 +1127,7 @@ protected: +@@ -1103,7 +1103,7 @@ class TDHandlerDimension : public TechDrawHandler, (pr TechDraw::pointPair pp = dim->getLinearPoints(); float dx = pp.first().x - pp.second().x; float dy = pp.first().y - pp.second().y; - int alpha = std::round(Base::toDegrees(std::abs(std::atan(type == "DistanceY" ? (dx / dy) : (dy / dx))))); + int alpha = std::round(Base::toDegrees(std::abs(std::atan(type == "DistanceY" ? (dx / dy) : (dy / dx))))); std::string sAlpha = std::to_string(alpha); std::string formatSpec = dim->FormatSpec.getStrValue(); formatSpec = formatSpec + " x" + sAlpha + "°"; -diff --git src/Mod/TechDraw/Gui/CommandExtensionDims.cpp src/Mod/TechDraw/Gui/CommandExtensionDims.cpp -index e7531ce714..46e6b4be4b 100644 ---- src/Mod/TechDraw/Gui/CommandExtensionDims.cpp +--- src/Mod/TechDraw/Gui/CommandExtensionDims.cpp.orig 2026-07-01 13:44:38 UTC +++ src/Mod/TechDraw/Gui/CommandExtensionDims.cpp -@@ -1984,7 +1984,7 @@ void execCreateHorizChamferDimension(Gui::Command* cmd) { +@@ -1984,7 +1984,7 @@ void execCreateHorizChamferDimension(Gui::Command* cmd dim->Y.setValue(-yMax); float dx = allVertexes[0].point.x - allVertexes[1].point.x; float dy = allVertexes[0].point.y - allVertexes[1].point.y; - float alpha = std::round(Base::toDegrees(std::abs(std::atan(dy / dx)))); + float alpha = std::round(Base::toDegrees(std::abs(std::atan(dy / dx)))); std::string sAlpha = std::to_string((int)alpha); std::string formatSpec = dim->FormatSpec.getStrValue(); formatSpec = formatSpec + " x" + sAlpha + "°"; -@@ -2050,7 +2050,7 @@ void execCreateVertChamferDimension(Gui::Command* cmd) { +@@ -2050,7 +2050,7 @@ void execCreateVertChamferDimension(Gui::Command* cmd) dim->Y.setValue(-mid.y); float dx = allVertexes[0].point.x - allVertexes[1].point.x; float dy = allVertexes[0].point.y - allVertexes[1].point.y; - float alpha = std::round(Base::toDegrees(std::abs(std::atan(dx / dy)))); + float alpha = std::round(Base::toDegrees(std::abs(std::atan(dx / dy)))); std::string sAlpha = std::to_string((int)alpha); std::string formatSpec = dim->FormatSpec.getStrValue(); formatSpec = formatSpec + " x" + sAlpha + "°"; diff --git a/cad/freecad/files/patch-tests_src_Mod_Part_App_TopoShapeExpansion.cpp b/cad/freecad/files/patch-tests_src_Mod_Part_App_TopoShapeExpansion.cpp new file mode 100644 index 000000000000..da2a317a84ce --- /dev/null +++ b/cad/freecad/files/patch-tests_src_Mod_Part_App_TopoShapeExpansion.cpp @@ -0,0 +1,17 @@ +--- tests/src/Mod/Part/App/TopoShapeExpansion.cpp.orig 2026-07-01 20:50:53 UTC ++++ tests/src/Mod/Part/App/TopoShapeExpansion.cpp +@@ -1,5 +1,6 @@ + // SPDX-License-Identifier: LGPL-2.1-or-later + ++#include + #include + #include "src/App/InitApplication.h" + #include +@@ -29,6 +30,7 @@ + #include + #include + #include ++#include + + // NOLINTBEGIN(readability-magic-numbers,cppcoreguidelines-avoid-magic-numbers) +