mirror of
https://github.com/ajisaacs/OpenNest.git
synced 2026-11-26 05:27:39 -05:00
fix(fill): keep interlocked pairs that end within tolerance of an inner edge
With clamps on the sheet, Fill Area's clamp-clear check allowed only 1e-6 of overhang at an area edge that is not the sheet's, while the fillers allow the geometry tolerance at every edge. An interlocked pair whose partner ended a few millionths past the selected box lost both parts, so a box that holds two pairs of triangles got two singles. Inner edges sit at least the part spacing (or a clamp keep-out's spacing slack) from material, so allow the tolerance there when the spacing covers it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
d4ad7a6201
commit
95e933b1ea
2 files changed
+30
-3
No files matched your search
@@ -541,10 +541,15 @@ public static partial class PlateFillService
|
||||
{
|
||||
var bounds = part.BoundingBox;
|
||||
var full = plate.WorkArea();
|
||||
// The packer permits a tiny overhang only at a real sheet edge,
|
||||
// never across a remnant boundary cut by a clamp or another part.
|
||||
double Slack(double edge, double sheet) => System.Math.Abs(edge - sheet) < 1e-9
|
||||
// The fillers permit the geometry tolerance's overhang at every edge of their area. A
|
||||
// sheet edge always allows it. An inner edge is an occupant (or cut-off) held off by the
|
||||
// part spacing, or a clamp keep-out inflated by at least the spacing slack, so the
|
||||
// overhang stays inside that margin when the spacing is at least the slack; the material
|
||||
// checks below still confirm occupants and clamps. Without that margin, hold the edge.
|
||||
var innerSlack = plate.PartSpacing >= NestTolerances.SpacingSlack
|
||||
? NestTolerances.WorkAreaSlack : 1e-6;
|
||||
double Slack(double edge, double sheet) => System.Math.Abs(edge - sheet) < 1e-9
|
||||
? NestTolerances.WorkAreaSlack : innerSlack;
|
||||
if (bounds.Left < area.Left - Slack(area.Left, full.Left)
|
||||
|| bounds.Right > area.Right + Slack(area.Right, full.Right)
|
||||
|| bounds.Bottom < area.Bottom - Slack(area.Bottom, full.Bottom)
|
||||
|
||||
Reference in new issue
Block a user