From 359809ca8354637f8204e05413b67476592c48ef Mon Sep 17 00:00:00 2001 From: tslater2006 Date: Wed, 6 Oct 2021 14:25:20 -0500 Subject: [PATCH] Fixed issue of contour duplication When looking for candidate groups to check intersection of contours, we used to restrict this to only groups whose last item's layer was 1 above tthe current layer. However, in the event that 2 contours on the same layer intersect with the same group end up in a situation where the "last item" has a layer index of the current layer. To fix this we loosen the restriction and now scan groups that have a lowest layer index of either current layer index or current layer index + 1 --- UVtools.Core/Managers/IssueManager.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/UVtools.Core/Managers/IssueManager.cs b/UVtools.Core/Managers/IssueManager.cs index 515b492..678bb96 100644 --- a/UVtools.Core/Managers/IssueManager.cs +++ b/UVtools.Core/Managers/IssueManager.cs @@ -850,7 +850,7 @@ namespace UVtools.Core.Managers var overlappingGroupIndexes = new List(); for (var groupIndex = 0; groupIndex < resinTrapGroups.Count; groupIndex++) { - if (resinTrapGroups[groupIndex].Last().layerIndex != layerIndex + 1) continue; + if (resinTrapGroups[groupIndex][^1].layerIndex != layerIndex + 1 && resinTrapGroups[groupIndex][^1].layerIndex != layerIndex) continue; if (EmguContours.ContoursIntersect(resinTrapGroups[groupIndex].Last().contour, resinTraps[layerIndex][x]))