From b05c32675b662aeb7a8d471c828f2ce9a4a88a8b Mon Sep 17 00:00:00 2001 From: Christopher Lackner Date: Mon, 14 Apr 2025 08:34:59 +0200 Subject: [PATCH] check for binary output for older occ versions --- libsrc/occ/python_occ_shapes.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/libsrc/occ/python_occ_shapes.cpp b/libsrc/occ/python_occ_shapes.cpp index ea6a8f0f..00bd925c 100644 --- a/libsrc/occ/python_occ_shapes.cpp +++ b/libsrc/occ/python_occ_shapes.cpp @@ -14,7 +14,9 @@ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdeprecated-declarations" +#if OCC_VERSION_MAJOR>=7 && OCC_VERSION_MINOR>=6 #include +#endif // OCC_VERSION_MAJOR>=7 && OCC_VERSION_MINOR>=4 #include #include #include @@ -840,8 +842,12 @@ DLL_HEADER void ExportNgOCCShapes(py::module &m) { if(binary) { +#if OCC_VERSION_MAJOR>=7 && OCC_VERSION_MINOR>=6 BinTools_FormatVersion v = version ? BinTools_FormatVersion(*version) : BinTools_FormatVersion_CURRENT; BinTools::Write(shape, filename.c_str(), withTriangles, withNormals, v); +# else // OCC_VERSION_MAJOR>=7 && OCC_VERSION_MINOR>=6 + throw Exception("Binary BREP export not supported in this version of OpenCascade"); +#endif // OCC_VERSION_MAJOR>=7 && OCC_VERSION_MINOR>=6 } else {