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
This commit is contained in:
tslater2006
2021-10-06 14:25:20 -05:00
parent abad334798
commit 359809ca83
+1 -1
View File
@@ -850,7 +850,7 @@ namespace UVtools.Core.Managers
var overlappingGroupIndexes = new List<int>();
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]))