From 55f71f401516a8a2fb28c864ce20e87f79b8d031 Mon Sep 17 00:00:00 2001 From: Uwe Date: Sun, 30 Jan 2022 17:41:40 +0100 Subject: [PATCH] [Part] Extrude: fix a thinko introduced by previous commit - the handling of all inner wires must be done within the recursion --- src/Mod/Part/App/FeatureExtrusion.cpp | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/Mod/Part/App/FeatureExtrusion.cpp b/src/Mod/Part/App/FeatureExtrusion.cpp index c7d8bb01a9..2d902a53d9 100644 --- a/src/Mod/Part/App/FeatureExtrusion.cpp +++ b/src/Mod/Part/App/FeatureExtrusion.cpp @@ -408,17 +408,12 @@ void Extrusion::makeDraft(const ExtrusionParameters& params, const TopoDS_Shape& // finally check reecursively for inner wires checkInnerWires(isInnerWire, params, checklist, false, resultPrisms); - // if all wires are inner ones, we take the first one and issue a warning + // count the number of inner wires int numInnerWires = 0; for (auto isInner : isInnerWire) { if (isInner) ++numInnerWires; } - if ((numWires - numInnerWires) == 0) { - isInnerWire[0] = false; - Base::Console().Warning("Extrusion: could not determine what structure is the outer one.\n\ - The first input one will now be taken as outer one.\n"); - } // at first create offset wires for the reversed part of extrusion // it is important that these wires are the first loft section @@ -642,6 +637,16 @@ void Extrusion::checkInnerWires(std::vector& isInnerWire, const ExtrusionP checklist[i] = false; ++i; } + + // if all wires are inner ones, we take the first one and issue a warning + if (numCheckWires == isInnerWire.size()) { + isInnerWire[0] = false; + checklist[0] = false; + --numCheckWires; + Base::Console().Warning("Extrusion: could not determine what structure is the outer one.\n\ + The first input one will now be taken as outer one.\n"); + } + // recursively call the function until all wires are checked if (numCheckWires > 1) checkInnerWires(isInnerWire, params, checklist, !forInner, prisms);