fix(engine): allow 0.0005 spacing slack in layout validation
Layouts placed exactly at the part spacing can land ~1e-4 short once rotated, rounded (e.g. PEP's 4-decimal exports) and snapped to the Clipper grid, so both validators rejected layouts that were correct in practice. NestTolerances.SpacingSlack (0.0005, far below anything a cutting machine resolves) is now subtracted from the spacing by NestLayoutCheck's inflation and NestJobPlacementValidator's edge-distance check. The frozen LegacyNestValidator takes the same rule so the equivalence tests keep comparing like with like. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -251,10 +251,13 @@ namespace OpenNest.Tests.Benchmark
|
||||
var raw = new PartOutline[parts.Count];
|
||||
var inflated = new PartOutline[parts.Count];
|
||||
|
||||
// The one intended rule change since the freeze: the shared spacing slack.
|
||||
var inflateBy = System.Math.Max(0, spacing - NestTolerances.SpacingSlack);
|
||||
|
||||
for (var i = 0; i < parts.Count; i++)
|
||||
{
|
||||
raw[i] = Outline(parts[i], 0);
|
||||
inflated[i] = spacing > Tolerance.Epsilon ? Outline(parts[i], spacing) : raw[i];
|
||||
inflated[i] = inflateBy > Tolerance.Epsilon ? Outline(parts[i], inflateBy) : raw[i];
|
||||
}
|
||||
|
||||
var order = Enumerable
|
||||
|
||||
Reference in New Issue
Block a user