From acfafc0b2bdbbab754c0a2eb88a816db14138874 Mon Sep 17 00:00:00 2001 From: Sebastian Hoogen Date: Wed, 18 Feb 2015 20:21:54 +0100 Subject: [PATCH] Use multiple tool shapes for MultiFuse Feature issue #1971 --- src/Mod/Part/App/FeaturePartFuse.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/Mod/Part/App/FeaturePartFuse.cpp b/src/Mod/Part/App/FeaturePartFuse.cpp index ffa7db288..5dd11b4b8 100644 --- a/src/Mod/Part/App/FeaturePartFuse.cpp +++ b/src/Mod/Part/App/FeaturePartFuse.cpp @@ -86,6 +86,7 @@ App::DocumentObjectExecReturn *MultiFuse::execute(void) if (s.size() >= 2) { try { std::vector history; +#if OCC_VERSION_HEX <= 0x060800 TopoDS_Shape resShape = s.front(); if (resShape.IsNull()) throw Base::Exception("Input shape is null"); @@ -112,6 +113,25 @@ App::DocumentObjectExecReturn *MultiFuse::execute(void) history.push_back(hist2); } } +#else + BRepAlgoAPI_Fuse mkFuse; + TopTools_ListOfShape shapeArguments,shapeTools; + shapeArguments.Append(s.front()); + for (std::vector::iterator it = s.begin()+1; it != s.end(); ++it) { + if (it->IsNull()) + throw Base::Exception("Input shape is null"); + shapeTools.Append(*it); + } + mkFuse.SetArguments(shapeArguments); + mkFuse.SetTools(shapeTools); + mkFuse.Build(); + if (!mkFuse.IsDone()) + throw Base::Exception("MultiFusion failed"); + TopoDS_Shape resShape = mkFuse.Shape(); + for (std::vector::iterator it = s.begin(); it != s.end(); ++it) { + history.push_back(buildHistory(mkFuse, TopAbs_FACE, resShape, *it)); + } +#endif if (resShape.IsNull()) throw Base::Exception("Resulting shape is null");