[Part] Extrude: fix a thinko introduced by previous commit

- the handling of all inner wires must be done within the recursion
This commit is contained in:
Uwe
2022-01-30 17:41:40 +01:00
parent 29997d5e71
commit 55f71f4015

View File

@@ -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<bool>& 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);