ENH: fix conner case of sandwich wall order

Updated sandwich mode code to cater for edge case where two sets of internal perimeters were causing the perimeters of another island to not be re-ordered correctly.

Github pull request: #2182

Change-Id: Ib58722db8cb76aa6b6474412c71993bb8e4dc007
This commit is contained in:
igiannakas 2023-08-22 11:36:48 +01:00 committed by Lane.Wei
parent 1e83346277
commit 7b33a7e86b
1 changed files with 3 additions and 3 deletions

View File

@ -1608,16 +1608,16 @@ void PerimeterGenerator::process_arachne()
outer = arr_i; outer = arr_i;
break; break;
case 1: // first internal wall case 1: // first internal wall
if (first_internal == -1 && arr_i > outer) if (first_internal==-1 && arr_i>outer && outer!=-1)
first_internal = arr_i; first_internal = arr_i;
break; break;
case 2: // second internal wall case 2: // second internal wall
if (ordered_extrusions[arr_i].extrusion->inset_idx == 2 && second_internal == -1 && if (ordered_extrusions[arr_i].extrusion->inset_idx == 2 && second_internal == -1 &&
arr_i > first_internal) arr_i > first_internal && outer!=-1)
second_internal = arr_i; second_internal = arr_i;
break; break;
} }
if (second_internal != -1) if (outer >-1 && first_internal>-1 && second_internal>-1)
break; // found all three perimeters to re-order break; // found all three perimeters to re-order
} }
if (outer > -1 && first_internal > -1 && second_internal > -1) { // found perimeters to re-order? if (outer > -1 && first_internal > -1 && second_internal > -1) { // found perimeters to re-order?