Commit Graph
5 Commits
Author SHA1 Message Date
ajandClaude Opus 5.5 a84f8d1298 feat(fill): spread the spiral to fit another part in its center
The spiral packed its four blocks tight to the bin origin, so a center gap
just short of a part stayed empty while slack sat at the far edges. Move
the far blocks (Q3/Q4 along X, Q2/Q4 along Y) into that slack, only as far
as the best center count needs; with no gain they stay put. Combination
selection counts the spread center too.

An 11.8 x 3.8 rectangle on a 60 x 120 sheet above the clamp rails goes from
134 to 135 parts. The 12 x 6.1 clamp case now fills the clamp-free strip
with 83 parts (was 82 beside the clamps), so the dropped-clamp gap-fill
test moves to 15 x 7 parts, where the gap fill still adds one (57 -> 58).
The mixed-items Vertical Remnant layout keeps its 35 parts with a new
digest: the full-sheet fill is trimmed to demand afterward, so its notched
parts now take the spread spiral.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 13:56:12 -05:00
ajandClaude Opus 5.5 12819198f9 feat(fill): search every spiral combination in rectangle best fit
The spiral used only the least-waste rows and columns. Those often make
one pair of blocks the larger on both axes, so it overlapped itself and
placed nothing, leaving Fill at two blocks. It now also tries every
four-block combination and takes one that holds more parts than both the
least-waste spiral and the two-block layout, so ties keep today's layout.

A 9 x 6.5 part on a 60 x 120 sheet goes from 109 to 112.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-01 23:42:25 -05:00
aj 451841401a refactor(engine): align namespaces with directory layout under OpenNest.Engine
All 132 OpenNest.Engine source files now declare namespaces matching
their nested directories: Jobs/, Jobs/Placement/, Jobs/Adapters/,
Fill/, RectanglePacking/, CirclePacking/, and engine-root types moved
from 'OpenNest' to 'OpenNest.Engine'. RootNamespace updated accordingly.
Consumers (Api, Console, Mcp, Benchmark, Training, desktop app, tests)
gained the explicit usings the move requires; CLAUDE.md updated.
2026-09-21 13:18:34 -04:00
aj aec0523062 style: apply CSharpier formatting to all C# sources
Repo-wide sweep with the pinned CSharpier 1.3.0 tool. Whitespace and
line-wrapping only; OpenNest.Engine.Tests (109) and OpenNest.IO.Tests
pass after reformat, full solution builds 0 errors.

Added .csharpierignore so csproj/config XML keeps its existing layout
(CSharpier's XML wrapping churns attributes with zero benefit).

Formatting is now enforceable: dotnet csharpier check . passes.
2026-09-20 16:41:50 -04:00
ajandClaude Opus 4.6 c5943e22eb fix: correct Width/Length axis mapping and add spiral center-fill
Box constructor and derived properties (Right, Top, Center, Translate, Offset)
had Width and Length swapped — Length is X axis, Width is Y axis. Corrected
across Core geometry, plate bounding box, rectangle packing, fill algorithms,
tests, and UI renderers.

Added FillSpiral with center remnant detection and recursive FillBest on
the gap between the 4 spiral quadrants. RectFill.FillBest now compares
spiral+center vs full best-fit fairly. BestCombination returns a
CombinationResult record instead of out params.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-03 21:22:55 -04:00