fix(engine): fix FillExtents competition and vertical gap bugs
- FillExtents.Fill reported progress internally which overwrote the UI's temporary parts even when a better result (e.g. Pairs with 70 parts) won the competition. Added final ReportProgress call in FindBestFill and Fill(groupParts) to ensure the UI always shows the actual winner. - FillExtents vertical copy distance clamp (Math.Max with pairHeight + spacing) prevented geometry-aware compaction from ever occurring, causing visible gaps between rows. Boundaries are already inflated by halfSpacing so the calculated distance is correct; only fall back to bounding-box distance on non-positive results. - PairFiller now sets RemainderPatterns on FillLinear so remainder strips get pair-based filling instead of only individual parts (+1 part in tight layouts). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -50,6 +50,12 @@ namespace OpenNest
|
||||
var pairParts = result.BuildParts(item.Drawing);
|
||||
var angles = result.HullAngles;
|
||||
var engine = new FillLinear(workArea, partSpacing);
|
||||
|
||||
// Let the remainder strip try pair-based filling too.
|
||||
var p0 = DefaultNestEngine.BuildRotatedPattern(pairParts, 0);
|
||||
var p90 = DefaultNestEngine.BuildRotatedPattern(pairParts, Angle.HalfPI);
|
||||
engine.RemainderPatterns = new List<Pattern> { p0, p90 };
|
||||
|
||||
var filled = DefaultNestEngine.FillPattern(engine, pairParts, angles, workArea);
|
||||
|
||||
if (filled != null && filled.Count > 0)
|
||||
|
||||
Reference in New Issue
Block a user