From 54af8014c401bca14120ad0065c74f0c52569803 Mon Sep 17 00:00:00 2001 From: Joachim Schoeberl Date: Sat, 24 Jul 2021 16:18:22 +0200 Subject: [PATCH] back to trying both occ surface-meshing versions --- libsrc/occ/occgenmesh.cpp | 5 +++-- libsrc/occ/python_occ.cpp | 15 +++++++++++++++ 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/libsrc/occ/occgenmesh.cpp b/libsrc/occ/occgenmesh.cpp index 5b024b62..aca4fbfe 100644 --- a/libsrc/occ/occgenmesh.cpp +++ b/libsrc/occ/occgenmesh.cpp @@ -643,7 +643,7 @@ namespace netgen Box<3> bb = geom.GetBoundingBox(); // int projecttype = PLANESPACE; - int projecttype = PARAMETERSPACE; + // int projecttype = PARAMETERSPACE; static Timer tinit("init"); tinit.Start(); @@ -840,7 +840,8 @@ namespace netgen cout << "retry Surface " << k << endl; k--; - projecttype*=-1; + // projecttype*=-1; + projecttype = PLANESPACE; notrys++; continue; } diff --git a/libsrc/occ/python_occ.cpp b/libsrc/occ/python_occ.cpp index 6cbb60f9..ac19d5cb 100644 --- a/libsrc/occ/python_occ.cpp +++ b/libsrc/occ/python_occ.cpp @@ -15,6 +15,7 @@ #include #include #include +#include @@ -244,6 +245,7 @@ DLL_HEADER void ExportNgOCC(py::module &m) .def("__mul__", [] (const TopoDS_Shape & shape1, const TopoDS_Shape & shape2) { // https://dev.opencascade.org/doc/occt-7.3.0/overview/html/occt_user_guides__boolean_operations.html#occt_algorithms_10a + BOPAlgo_MakerVolume aMV; // BOPAlgo_Section aMV; // only vertices + edges // BOPAlgo_Builder aMV; @@ -257,6 +259,19 @@ DLL_HEADER void ExportNgOCC(py::module &m) aMV.Perform(); // aMV.Build(); return aMV.Shape(); + + /* + // ????? + // auto cut = BRepAlgoAPI_Cut (shape1, shape2); + auto cut = BRepAlgoAPI_Section (shape1, shape2); + TopTools_ListOfShape aLSObjects; + aLSObjects.Append (cut); + + BOPAlgo_MakerVolume aMV; + aMV.SetArguments(aLSObjects); + aMV.Perform(); + return aMV.Shape(); + */ }); ;