mirror of
https://github.com/ajisaacs/OpenNest.git
synced 2026-12-03 13:19:25 -05:00
refactor: share duplicated fill, cache, settings and toggle code
- fill_plate and fill_area share one MCP fill helper - FillLinear uses FillHelpers.HasOverlappingParts - BestFitCache and FillResultCache entries derive from DrawingCacheEntry - NestDefaults and ClampSettings read through SettingsFile.TryReadText - MainForm view toggles share one ToggleView handler Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
4b61d249c0
commit
d77693aaff
10 files changed
+178
-217
No files matched your search
@@ -222,7 +222,18 @@ namespace OpenNest.Engine.Strategies
|
||||
/// Checks if any pair of parts geometrically overlap. Uses bounding box
|
||||
/// pre-filtering for performance, then falls back to shape intersection.
|
||||
/// </summary>
|
||||
internal static bool HasOverlappingParts(List<Part> parts)
|
||||
internal static bool HasOverlappingParts(List<Part> parts) =>
|
||||
HasOverlappingParts(parts, out _, out _);
|
||||
|
||||
/// <summary>
|
||||
/// Finds the first pair of overlapping parts, reporting their indices
|
||||
/// (or -1 when none overlap).
|
||||
/// </summary>
|
||||
internal static bool HasOverlappingParts(
|
||||
List<Part> parts,
|
||||
out int overlapA,
|
||||
out int overlapB
|
||||
)
|
||||
{
|
||||
var checker = new PartOverlapChecker();
|
||||
|
||||
@@ -243,10 +254,16 @@ namespace OpenNest.Engine.Strategies
|
||||
continue;
|
||||
|
||||
if (checker.Overlaps(parts[i], parts[j]))
|
||||
{
|
||||
overlapA = i;
|
||||
overlapB = j;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
overlapA = -1;
|
||||
overlapB = -1;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user