Commit Graph
718 Commits
Author SHA1 Message Date
ajandClaude Fable 5.2 0b84835ba6 fix(fill): keep leftover pairs and packs off the clamp keep-outs
Whole jobs placed by the fill strategies could put parts on a clamp
keep-out in three ways:

- A best-fit pair left flush on a keep-out was compacted with the clamp
  obstacles held at the part spacing, so it already read as inside that
  spacing; the push ignores contacts that already overlap and carried
  the pair through the clamp to the sheet edge. CompactPair now holds
  clamps at zero spacing, as the settle does.
- The pack area was narrowed to a clamp-free remnant only after a fill
  had placed parts. With nothing filled the leftovers were packed across
  the whole sheet, clamps included. They now get the same remnant.
- A rail with zero clearance left placement no margin over the
  validator's keep-out, whose outlines are rounded to a 0.0001 grid, so
  a flush edge could read as inside the zone. Placement keep-outs now
  grow by at least the spacing slack (0.0005). The expand-spacing walls
  keep the exact clamp clearance (WallRectangles).

No tolerance or validator changed.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-20 21:26:53 -05:00
ajandClaude Fable 5.2 5f1d5c443d feat(fill): offer unplaced parts to every remnant after a whole-plate nest
Lattice and the two Remnant strategies packed only items that were never
filled, into one remnant, and dropped whatever a fill left of its own
item. The fills see each earlier fill as one envelope, so a part's box
can still fit between the parts of the finished layout, and the one
remnant the pack tried is often a sliver that holds nothing.

After the pack-first or pairs-first step and before the settle, every
item with demand left is now offered to the remnants of the whole work
area through LeftoverPacker, clamp keep-outs counted as occupied. The
earlier steps are untouched, so a nest with nothing unplaced comes out
as before.

Three pinned nests gained parts and none lost one: mixed Fill 34 to 35,
mixed Horizontal Remnant 30 to 35, learned-angle Horizontal Remnant 24
to 26.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-20 21:26:53 -05:00
ajandClaude Fable 5.2 ed8fccbe72 fix(fill): keep the part spacing beside a pattern copy's path
Linear fill finds how far a pattern's next copy must sit by sliding each
part of the copy against the parts of the pattern, and it skipped every
pair whose bounding boxes do not overlap across the slide. A part whose
box lies beside the copy's path by less than the part spacing was never
measured, so the copy could pass it closer than the spacing: columns of
a gusset pair tiled 0.04 apart (the pattern Irregular's band search had
to reject), and an Extents column pair of D-shapes 0.01 apart.

The copy distance now skips a pair only when the boxes are beside each
other by the spacing or more. A part beside the path moves the copy only
when it needs more than Epsilon beyond what the parts in the path need,
so a corner-to-corner contact at the same distance leaves layouts as
they were.

The Strip strategy's mixed pinned nest then filled a valid, denser row
of D-shapes and lost its single rectangle: the pack step tried only the
first remnant, now a sliver along the top edge. Strip offers its
leftovers to the remnants in order instead (LeftoverPacker), packs the
first that takes a part, finds the remnants again and stops when none
takes one. The nest holds 35 parts again, and the whole-plate
characterization nests are now validated as they are solved.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-20 21:25:57 -05:00
ajandClaude Opus 5.5 1206f04114 fix(fill): lay remnant quantities of round parts across the full side
A Vertical or Horizontal Remnant fill of a quantity of round parts left
a deep remnant on the table: twelve 8 in. flanges took 25.6 in. of a
60 in. sheet's length and stopped 16 in. short of its far edge, where
two full-height columns need 15.1 in. Three causes:

- The low-quantity shrink scaled both sides, so stripes could not span
  the side the remnant runs along. It now narrows only the trimmed axis.
- The ranking compared untrimmed counts, so the full-sheet layout always
  beat the full-height columns and was then trimmed. It now ranks the
  layout as it will be kept.
- The trim kept overlapping bounding boxes as interlocked pairs, which
  staggered discs always are. Discs are now trimmed one by one.

The circle strategy also offers each stagger mode's stripes in both
directions to a remnant ranking. Every change is limited to remnant
fills of round parts: applied to other shapes, the trimmed ranking let
a tilted bar layout block the rest of a nest, and the disc trim moved
the Irregular engine's sample layout, so every other fill is unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 20:23:05 -05:00
ajandClaude Fable 5.2 d2c392270d feat(engine): band every group and give each a trial in Irregular
On a saved nest of the README sample parts (130 copies, 60 x 120, 0.3
spacing, bottom clamp rail) Auto Nest ended at 105.8 where a hand layout
of tidy bands ends at 103.1. Three things kept the banded fill from it:

- Lattice's first pattern for the 24 gussets set two columns 0.04 apart.
  The band's certification rejected it and the band search stopped, so
  the gussets had no band and filled the gaps as ragged columns. The
  search now asks again just short of the rejected pattern
  (BlockCatalog.RejectedBandLength).
- Building patterns is charged to the same work meter as the trials of
  narrower and lower bands, and with the lower bands it spent the whole
  budget, so the last types in the order never had a trial. Trials now
  go round the types and may spend 25,000 work whatever the budget.
- A band taller than the height clear of the clamps lost members to
  them. The first lower band is now asked for at that height and
  searched like the full band; where such a band would stand whole in
  place of one that loses members, the bands are searched a second time
  with it there and the better sheet kept. A lower band no longer than
  the full one stands first in its place, leaving a strip beside it.

That nest now ends at 103.1, the same parts built from the README DXFs
at 104.0 instead of 106.6, the help tutorial nest at 33.6 instead of
34.2; N26-2HH stays at 103.9 and the other benchmark jobs are unchanged.
Solves of these jobs take about a tenth longer.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-20 17:30:23 -05:00
ajandClaude Fable 5.2 7c1b7a30f5 refactor(engine): split Irregular's block catalog into named steps
BlockCatalog keeps the Lattice (Fill) patterns the frontier packer takes
as blocks and the banded fill takes as bands, and decides when each one
is charged to the solve's work meter. Its rules were hard to see. Get
and Band each threaded (type, quantity, rectangle, token) through four
methods and repeated the same four-part guard, both caches were keyed by
an anonymous four-part tuple, Propose answered with a (members, poses)
tuple in which exactly one half was ever set, and the limits lived in
the code as bare numbers: three copies in four places, eight attempts,
two rectangles, two unrelated 0.001 margins and the rounding digits of a
certified pose. Band did its lookup, proposal, deferred charge and
binding in one body, and the certification ran quantizing, the rotation
check and the pair test together.

A request is now a Request (type, quantity, rectangle) that knows its
PatternKey, whether anything can come of it and what its Fill costs.
Get reads as its rules: kept block, CannotPrepare (too small, the type's
preparations spent, the budget spent), count, Prepare. Band finds or
proposes its entry in BandFor and keeps only the charge and the binding;
its two overloads are one method with an optional prefetch drawing, so
no call site changes. Propose returns the certified poses or null, and a
BandEntry without poses is an empty pattern. Certify is QuantizedPoses,
IsAllowed and KeepSpacing, Bind takes its orientation from
OrientationAt, Rectangles ranks what FreeRegion leaves, and Footprint is
a type built from HullWidth and Perimeter. The limits and margins are
named constants, the band's wider fill spacing is computed once, and the
exceptions that make a proposal empty have one definition.

No layout changes, and nothing about the meter moves: a block is still
charged before its rectangle is tested, a band on its first ordinary
request whichever request built it, a prefetch charges and binds
nothing, and the attempt count, cache keys, locks and floating-point
expressions are as they were. Drawing ownership and release are
untouched. Traced before and after: every progress report, plan,
alternative, repeat batch, tail re-plan (with its work-meter reading)
and final result of 73 solves (one, few and seven part types in
quantity with automatic, fixed and swept rotations, one to three stocks,
two and three spacings in one job, finite stock, clamp rails, outlined
sheets, three quadrants, priorities, costs with salvage, both offcut
axes, a sheet cap, work budgets of 20,000 and zero, grouped and banded
passes on and off, five searches until cancelled); 1,735 direct catalog
calls on 13 catalogs (Get, Band, single and parallel prefetches followed
by their ordinary requests, repeated calls, cancelled calls, Rectangles,
Resolve; with and without pairs, shared and owned drawings, a budget
that runs out), each with its members' orientations and poses as raw
bits, the meter reading and the preparation count; and 72 frontier and
banded fills over one catalog on eight jobs, with and without a clamp
rail. The 94 traces (81,689 lines) are byte-identical. Engine suite
(3,692 passed, 2 skipped) and the problem-nest corpus's auto-nest area
pass, both nests at their baseline sheet counts and ends.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-20 13:38:16 -05:00
ajandClaude Fable 5.2 ddcfbce072 refactor(engine): split Irregular's frontier packer into named steps
FrontierPacker.Fill was one 165-line method: three local functions
(Track, Block, PrepareBlocks) closed over nine variables of the fill in
progress, the seated-parts pass repeated Block's parallel loop inline,
and the placement loop carried its retirement rules between them.
Choose kept its leader in seven loose variables behind a local function,
and BestVertex took twelve parameters, four of them outs that every
TryLowest threaded back out. Every pass of the engine goes through this
class, so the next change to the placement rule had to be made inside
all of that.

Fill now reads as its steps: TrackDemand, Seat, PrepareBlocks, then
Choose and Place until nothing fits. The fill in progress is a Sheet
(copies left, regions, pairs, blocks, parts placed, front) passed to
each step, the leader of a choice is a Leader that Consider updates, and
a candidate's point and scores travel as one Spot, with the inner-fit
box and the piece's box as Extents. The repeated expressions have one
definition each: the part's reach along the front axis, a region losing
what a part blocks, the parallel blocking pass, the two retirements of
emptied regions and pairs, and the "lower across, then lower leading
edge" tie-break shared by Choose and BestVertex. The tolerances and the
block limits (two preparations per fill, four types, three copies) are
named constants. PackAxis, Placed and SheetFill, which the whole engine
uses, have their own files.

The constructor keeps its shape: most call sites name its optional
arguments already. The two that passed positional nulls now name them.

No layout changes, and no change to the order work is metered or to the
parallel passes: a placement still blocks one pass per part. Traced
before and after: every progress report, plan, alternative, repeat
batch, tail re-plan (with its work-meter reading) and final result of
70 solves (one to three stocks, mixed spacings, finite stock, a sheet
cap, priorities, explicit costs with salvage and both offcut axes, clamp
rails, outlined sheets, oversize parts, all four quadrants, grouped and
banded jobs, four engine settings, seven searches until cancelled), the
poses and work-meter reading of 2,298 direct Fill calls (pairs, blocks,
type weights, group ranks, reach, within, seated parts, a starting
front, clamps, outline and cutout boundaries with obstacles, pair-only
orientations), and six cutout proposals. The traces are byte-identical.
Engine suite and the problem-nest corpus's auto-nest area pass.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-20 12:25:17 -05:00
ajandClaude Fable 5.2 9aed8dcda1 refactor(engine): split Irregular's engine into passes, solver and plan
IrregularNestingEngine.cs was one 1,000-line file: Solve ran its nine
passes inline over 135 lines, each repeating the same "decode, report
the alternatives, take the plan if it beats the best, re-plan its tail,
report again" by hand; the nested Solver took eleven constructor
arguments and held the decode, the banded sheet, three plan-improvement
passes and the per-stock caches together; and Decode was a single
135-line loop threading ten parameters. The next pass or decode rule had
to be added inside all of that.

Solve now reads as the list of passes. A Search holds the best plan and
the reporting, so each pass is a short method (QuickPlan,
StrategyVariants, GroupedVariants, BandedVariant, ReduceSheets,
SqueezeLastSheet, SeededVariants) over three shared steps (Offer, Adopt,
Replace). The Solver takes the engine instead of its settings one by
one, and is split in two files: decoding a strategy into a plan
(TrySheets, FillSheet, Choose, PassedOver, Copies) and improving a plan
already made (ImproveTail/ReplanTail, ReduceSheets/OnOneSheetFewer/
PackEdgeFirst, Squeeze). A decode's front direction, exponent, weights
and sheet rule travel as one Strategy rather than five arguments, with
the grouped/banded flag pair as a SheetRule. Plan, Run, Trial and the
sheet costing have their own file, as does WorkCounter.

The test hooks build their solver as Solve does, so they now also pass
on TailReplanning and PruneStockTrials; no test sets either on a hook.

No layout changes. Every progress report, plan, alternative, repeat
batch, tail re-plan (with its work-meter reading) and final result was
traced before and after on 96 solves: 26 jobs (one to three stocks,
finite stock, a sheet cap, priorities, explicit costs with salvage,
clamp rail, outlined sheets, oversize parts, mixed spacings), six engine
settings, ten searches until cancelled and the plan and quick-plan
hooks. The traces are byte-identical. Engine suite and the problem-nest
corpus's auto-nest area pass.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-20 11:16:19 -05:00
ajandClaude Fable 5.2 10386ec233 refactor(engine): split Irregular's banded fill into named steps
BandedFill.FillStrips was one 135-line method: the beam loop, the
look-ahead for band searches, the strip offers (a local function closing
over eight variables) and the beam selection all ran together, and Fill
carried its order search and hold-back pass inline the same way. The
next change to either pass had to be made inside that.

Each step is now its own method (BestOrder, HoldBack, NextStrips, Strip,
Densest, SearchesAhead, ColumnWidths, Finish), the work area and part
spacing are fields rather than a parameter threaded through every call,
the repeated "largest part left", "packer behind the strip" and
"full-height bands" expressions have one definition each, and the
tolerances and the three-copy column limit are named constants.

No layout changes. Every BandedFill result (poses and work-meter reading
after each call) was traced before and after on six jobs covering the
bands, strips and beam-of-one paths, with and without a clamp rail, one
to four sheets: the traces and the final layouts are byte-identical.
Engine suite and the problem-nest corpus's auto-nest area pass.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-20 09:33:50 -05:00
ajandClaude Fable 5.2 b137df8428 fix(review): a round part resting on an outlined sheet's edge is not flagged
On a sheet with a custom outline the plate edge review, Auto Nest's layout
check and the runner's candidate validation tested the part's spacing
outline against the usable area. That outline circumscribes arcs by up to
0.001, more than any of their slacks, so a disc whose true bounds rest on
the work-area edge read as inside the outline's edge spacing (or off the
plate at zero spacing) while the same disc on a rectangular sheet, judged
on its true bounds, was clean.

The outline test now works as the part-spacing check does: the spacing
outline finds the candidates and a failure is confirmed on the part's
native contour (NativeContours.Region: arcs circumscribed at 0.000025 and
clipped to the perimeter's true bounds). Both regions contain the material,
so a part past the usable edge by more than the slack still fails; no slack
changed. The runner now calls the layout check's own outline test
(NestLayoutCheck.InsideOutline): its separately flattened candidate could
accept a pose on a slanted edge that the layout check then rejected.

Pushes on an outlined sheet measured the same circumscribed perimeter so a
part would rest where the review passed, and box pushes stopped 0.0012
short of a wall for it. With the review confirming on native contours they
slide the material's own lines and arcs, so a round part rests on a wall
exactly as on the plate edge, and a box push rests the box on the wall.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-20 08:49:00 -05:00
ajandClaude Fable 5.2 e84542e5f6 feat(engine): squeeze the last sheet in Irregular
The frontier rule lets the sheet state pick the next part and sends
small parts first, so a part as long as the layout can end up behind
them and set the sheet's length. On N26-2CJ (two 55" plates, rings,
sectors, an arc and strips on 48 x 96) Auto Nest ended at 75.2" where
the hand layout, both plates stacked along one edge, ends at 63.5".

After the search, pack the last sheet's parts again in a given order,
largest first, each at the lowest point across a strip that ends short
of where they reach now, and search the order (single-part moves, then
seeded swaps) for one that fits them all. Each strip that takes them
is followed by a shorter one. Parts that may turn freely are also
offered every 30 degrees. Work is counted, the seed is fixed, and the
squeezed sheet replaces the plan's only when the plan then ranks
better. N26-2CJ now ends at 62.1", leaving 33.4 x 47.5 against
20.3 x 47.5.

A search over few parts runs out of new orders, and decodes it has
already made cost no work, so it also ends after a run of rounds that
place nothing new, and its per-strip budget shrinks with the part
count.

CurvedPartsClearEveryInflatedClampInEveryQuadrant asked for a disc on
the sheet edge between the clamps. The squeezed sheet is 0.1" shorter
with that disc wedged on a clamp's corner, so the test now asks for a
disc below the clamps' tops.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-20 08:11:05 -05:00
ajandClaude Fable 5.2 606088e56a perf(engine): union Irregular's no-fit polygon sums in stages
A concave no-fit polygon is the union of the convex sums of every pair
of pieces of the two footprints. One Clipper union of all of them meets
each overlap of each pair of sums, on the order of (p*q)^2 pairs: two
line-only arc outlines of 150 vertices took minutes, and an eleven-part
job of rings, sectors and an arc spent 110 s of its Irregular solve
there.

Union the sums of each piece of the moving footprint first, then merge
those results in neighboring pairs. The same job solves in 3.3 s with
the same layout, and the benchmark jobs keep their placements.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-20 08:11:04 -05:00
ajandClaude Fable 5.2 f5fae5c9e1 fix(plate): pushes stop at an outlined sheet's edge; outline import keeps straight edges exact
A plate with a custom outline was pushed against its bounding box only, so
a part pushed toward a missing corner ran through it to the box edge and
ended off the sheet. Compactor's plate pushes (Push, PushBoundingBox,
SettlePlacement, Settle) now also stop at the walls of the outline: the
part of the work area that is not usable material (a missing corner, an
obstacle, each grown by the largest edge spacing). A mover is measured as
the edge review measures it, by the circumscribed perimeter of its clean
material without leads, so it rests where that review still passes. A box
push stops 0.0012 short of a wall so the geometry push after it starts
clear. A rectangular sheet has no walls and pushes exactly as before.

SheetOutline.FromGeometry eroded the whole imported outline by the chord
tolerance, so a sheet drawn 60 x 27 was stored as 59.998 x 26.998 with a
chamfer at every inside corner. Each arc is now chorded on the side that
takes material away (ClipperBridge.FlattenOneSided) and straight edges are
kept exactly. The plate header, the plate list and Edit Plate's outline
size show the size rounded to four decimals instead of the raw double.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-20 07:49:11 -05:00
ajandClaude Opus 5.5 0a413dd242 feat(engine): lower, clamp-aware bands in Irregular's banded fill
Bands were always the full work-area height and placed flush to the
bottom or top edge. On N26-2HH (20 + 20 formed legs, 60 x 120, bottom
clamp rail) the larger leg's full-height band had less slack than the
rail's depth, so three copies dropped to the gap fill and Auto Nest
ended at 104.71 against a hand layout at 104.0.

Each type now also offers up to three lower bands, each asked for just
short of the last band's height and searched over three lengths, which
leave a strip along the sheet for the remaining parts. A band that would
lose members to clamps also tries the top edge and just past the clamps
lining either edge (ClampObstacles.ClearOfEdges, moved out of
EdgeFirstFill). N26-2HH now ends at 103.87; the README sample, help
tutorial and N26-2GT layouts are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-19 21:11:42 -05:00
ajandClaude Opus 5.5 7f92a637d7 fix(irregular): keep block preparation and plan reporting as before the quick plan
Stock-trial pruning in tail re-plans now starts only once the block budget
is spent. Before that, a skipped trial left a Lattice block attempt and its
work unspent, so a later trial could prepare a block it was refused before
and the decode could choose differently.

The quick plan no longer demotes the normal search's plans to
alternatives. The deadline wrapper, the only caller that enables
SearchUntilCancelled, already keeps the best reported plan that passes the
layout check, so a quick plan that failed the check could have hidden
valid plans. The docs drop the measured timings.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-18 01:36:19 -05:00
ajandClaude Opus 5.5 e589731828 perf(irregular): skip tail re-plan stock trials that cannot win
A tail re-plan's decode no longer packs a stock whose least possible net
cost (the whole sheet, less full salvage credit) already exceeds the best
estimate so far and whose cost ratio over the remaining part area cannot
beat the best so far. Later trials only lower the ratio and the estimates,
so the skipped trial could neither be chosen nor change the choice.

On N26-2GT this skips ~60% of the tail re-plans' trials, a fifth of the
ungrouped search's packing time. Layouts and reported plans are unchanged
on every unlimited benchmark job and on the N26-2GT and readme-mixed
oracles; first-nest's unlimited Irregular solve ran in 75 s rather than
100 s. Whole-job variants still pack every trial, since a skipped stock
may have finished the job.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-18 01:36:19 -05:00
ajandClaude Opus 5.5 08a47dafa5 perf(irregular): report a quick plan first under a time limit
A solve that can end only at its limit (SearchUntilCancelled, a cancellable
token and a listener) now decodes the first variant once without Lattice
blocks before its normal search and reports it. Block preparation for each
stock trial of the first sheet takes most of the first decode on big jobs:
on N26-2GT Default showed Irregular's first plan after ~29 s, now ~5 s.

The quick decode runs on its own work meter and shares only job-determined
caches, so the normal search decides as before; until one of its plans beats
the quick plan, they are reported as alternatives. Unlimited solves never
make a quick plan, so their results and reports are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-18 01:36:19 -05:00
ajandClaude Opus 5.5 fcf205ab44 perf(irregular): skip Lattice fills in rectangles that cannot hold a block
A free rectangle narrower than the part at every rotation (its convex-hull
width, less the outline's flattening tolerance), or smaller than three
copies, can only give Fill two members or fewer, which never form a block.
Block and band requests for such rectangles no longer run the Fill. They
still count as a preparation and are charged as before, so the work meter
and every layout stay byte-identical. On N26-2GT this skips 31 fills
(about 7.6 s of fill time across the solve, 0.4 s before the first plan).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-18 01:36:19 -05:00
ajandClaude Opus 5.5 683ece4d3c perf(engine): run pair grid overlap checks only where the ranking needs them
FillLinear.FillDeferred returns a grid whose final overlap check has not
run; Resolve runs it and returns exactly what Fill returns, and Fill is
FillDeferred(...).Resolve(). PairFiller sorts a candidate's grids with
CompareByCount, which answers from the counts a pending grid can still
have (its tiling or its bounding-box fallback) and runs the check only
when they could order the pair differently; the early abort and the
remnant pass resolve the grids they use. Every answer equals the checked
comparison, so List.Sort makes the same moves, ties included, and
layouts are bit-identical. A check that throws during the sort surfaces
unwrapped. On the bracket fill this skips about 35% of the pair grids'
final checks by work.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-18 01:36:19 -05:00
ajandClaude Opus 5.5 538ccebd6d perf(engine): reuse stripe convergences across a fill pipeline
The Row and Column strategies converge identical stripe layouts (both lay
rows along both axes), every pair remnant strip along a full side of the
work area repeats the Row strategy's spans, and the expanding and
shrinking variants revisit each other's angles, often cycling between
two. StripeConvergenceCache, kept in the pipeline's shared state and
handed to the pair remnant strips, stores each convergence, the pair's
turned bounds and each estimate row by angle; one thread tiles a row
while others wait. Every value is a pure function of its key, so layouts
are bit-identical. On a 30-copy fill of an 80-vertex bracket this cut
estimate-row tilings from 3,226 to 560.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-18 01:36:19 -05:00
ajandClaude Opus 5.5 d4103a3b9f feat(fill): shift a tiling to fit parts of the copy before it
A multi-part pattern tiles from the work area's leading edge, so the copy
before the first one never fits whole. When the tiling leaves room at its
far end, FillLinear now moves it forward by the smallest shift that fits
the most parts of that previous copy and adds them. On an arch/cup
herringbone this fits the cup row under the first arch row: 121 -> 132.

Comparisons against the frozen fillers turn the new step off through an
internal LeadingParts flag and check the default fill separately.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 03:08:10 -05:00
ajandClaude Fable 5.2 bb23024000 feat(fill): fill with a copied common-line group as whole joined groups
Ctrl+F while pasting one common-line group fills the area with the group's
single merged outline as one part, then turns each placed copy back into its
parts joined at the source kerf. The old pattern fill tiled the members as
loose parts, added lone parts and joined nothing.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-16 20:43:59 -05:00
ajandClaude Fable 5.2 92bf653c8f feat(cutting): route around tabbed parts before passing over them
A tabbed part stays in the sheet, so rapids were free to pass over it and
the planner never looked for a way around. Plan Cutting now searches first
with every tabbed outside as an obstacle once its part is cut. Where a pass
stalls at a part whose approach crosses a tabbed part, only the crossed
parts become crossable and the search goes on along the same order. A
capture that search cannot plan is planned as before. Plates without
tabbed outsides are searched once, unchanged.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-16 20:00:50 -05:00
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 e1ccd69291 fix(cutting): keep configured tab lead-outs and warn; count every tabbed part as steady
5776fa80 dropped a tabbed outside's lead-out when it would reach the lead-in,
which silently changed the user's cutting settings. The emitter now keeps the
lead-out as configured again. Plan Cutting plans strictly first, as before;
only when that is refused because such a lead-out may cut its tab free does it
plan again keeping the lead-outs. Each affected part gets a "Tab lead-out"
issue (new PostVerificationKind.TabLeadOut), is treated as cut free for later
rapids, and the plan is UNVERIFIED, so applying it needs explicit acceptance.
The short reorder pass never settles for such a plan, so a clean route still
wins. Locked, fixed and posted programs keep the incomplete-check finding.

The "no single tab can steady it" support warnings caused more trouble than
they solved, so a tabbed part now counts as steady wherever its tab is: Plan
Cutting and the pre-post review warn only about a part cut with no tab at
all, and a tabbed part stays crossable once cut instead of being avoided as
one that may tip. Entry choice still prefers the steadiest tab point.

The problem-nest corpus is unchanged except N26-2AM, whose baseline is now
BestEffort with 15 tab lead-out warnings.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 12:34:34 -05:00
ajandClaude Opus 5.5 618996d2e0 feat(fill): line the clamped row up between the clamps
The gap pass only fills around the parts a clamped fill keeps, so a row
laid on the clamp-blind grid can still waste most of each space between
two clamps. Also take the clamped edge's row out and refill it slot by
slot, one slot between each pair of clamp keep-outs and one past each
end, each reaching the next part at the part spacing, then fill any gaps
left. Slots never overlap, so a wide rectangle above the clamps cannot
take a slot's space first. The repacked row is kept only when it places
more parts than gap-filling alone.

On a 120 x 60 sheet of 3.8 x 11.8 parts with front clamps at 20/40/60/80,
the clamped layout goes from 129 to 131 parts (the lifted layout's 134
still wins there).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 10:03:49 -05:00
ajandClaude Opus 5.5 42880d947c feat(fill): fill the gaps left where parts hit a clamp
A clamped fill lays parts out as if the clamps were absent and drops the
ones that hit a clamp, which can leave room for a part between two clamps
or beside one. After dropping, fill each clear rectangle the part fits
with the remaining demand, certified like the main fill, and report the
gap-filled layout as a preview. Existing parts never move.

On a 120 x 60 sheet with front clamps at 20/40/60/80, the dropped layout
of 12 x 6 parts goes from 81 to 82 parts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 10:03:49 -05:00
ajandClaude Fable 5.2 fcfb3e6c1b feat(auto-nest): offer each sheet size that finishes the job as its own layout
Irregular picks each sheet's stock on an estimate of what the leftovers
will cost, so a size that took every remaining part could lose the pick
to a plan that ended up dearer, and its trial sheet was thrown away.
Each pass now keeps those finished plans: one that beats the pass's own
plan replaces it, and the rest are reported as alternatives (at most six
a pass). No extra sheets are packed.

The progress window's layout families now include the sheet sizes, so a
one-sheet 60 x 120 layout is offered beside a one-sheet 48 x 144 best
instead of being dropped as a near copy.

With 48 x 96, 48 x 144 and 60 x 120 offered, the seven sample parts (130
copies) still take one 48 x 144 sheet and now end at 130.7" instead of
136.6"; the tutorial and synthetic nests are unchanged.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-15 22:50:50 -05:00
ajandClaude Fable 5.2 b96e0853b5 feat(auto-nest): offer the top layouts in the progress window with each sheet's free strip
The Auto Nest progress window lists up to three whole-job layouts as
cards, the engine's best first and then the best of each other family
(sheet count and free-strip direction). Every sheet shows the distance
from its parts to the right edge (vertical strips) or the top
(horizontal strips), dimensioned on the sheet. Any card can be used:
during the search it stops it, and a finished search with more than one
layout waits for the pick. The layout used is validated and bound like
the engine's own result.

Engines may report plans that lost to their best as
NestJobStage.PlanAlternative; Irregular, Default and the time-limited
solve do. Reporting never changes a layout.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-15 18:04:21 -05:00
ajandClaude Opus 5.5 bf734ea743 perf(engine): speed up Irregular's banded and strip pass without changing layouts
- Lattice band certification prepares each member's outline once instead of
  re-inflating both parts for every pair (about 40% of each pattern's cost).
- Strip packing builds each beam level's band searches ahead in parallel,
  each on its own drawing copy; prefetched patterns charge no work and bind
  no orientations until requested in strip order, so the work meter and
  results match building them in turn.
- FrontierPacker blocks seated parts in one parallel pass, not one per part.

Layouts and work counts are unchanged on the README, clamp-rail, 2x and
tutorial jobs and the synthetic nests.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 14:34:19 -05:00
ajandClaude Opus 5.5 163c23e8bd feat(engine): place large parts first and keep small ones as filler in strips
A sheet that cannot take all the remaining parts now keeps whichever
places more part area: the ordinary fill or strips largest part first.
The ordinary fill spent skinny parts early because they cover the most
area per length, leaving awkward ones for a ragged last sheet.

Inside a strip, the strip's own part fills its column first and the
others fill around it; before, pairs of smaller parts (counted as twice
a part's area) took the strip and the large part lost it. Bands also try
largest part first as a third order.

At about twice the README sample quantities the second sheet ends at
99.9" instead of 106.2" on master (104.7" before this change), and the
help tutorial's parts at 33.6" instead of 34.9". Every other benchmark
job is unchanged or better; mixed jobs solve about two to three times
slower than master.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 14:33:38 -05:00
ajandClaude Opus 5.5 81e70af5b6 feat(engine): pack mixed jobs in full-height strips in Irregular
Irregular decodes the job once more in full-height strips along X when
like parts group and every part shares one priority. A sheet that can
take all the remaining parts is packed two ways and the better kept:

- Bands: each type of three or more copies as its Lattice pattern in the
  narrowest strip that holds all its copies, bands side by side, the
  held-back copies and one-offs filling the gaps.
- Strips: each strip holds the largest remaining part, as its band or a
  column one to three copies wide, every other part filling its gaps; a
  beam of the four densest partial sheets carries strip to strip.

Band patterns are filled one grid unit wider than the spacing so a stack
of rings passes the strict certification, members on a clamp go to the
gap fill, and a short band moves flush to the far edge when that keeps
it off the clamps. The plan replaces the result only by beating it.

On seven sample parts (130 copies, 60 x 120) the layout ends at 102.9"
instead of 107.7", and at 104.6" instead of 108.6" with the desktop's
edge spacing and bottom clamp rail; at about twice the quantities the
second sheet ends at 104.7" instead of 106.2". Every other benchmark job
is unchanged. Solves of these jobs take about twice as long.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 14:33:38 -05:00
ajandClaude Fable 5.2 07f30c1236 fix(engine): settle best-fit pairs sideways so they close to the part spacing
The pair search slid part 2 in from offsets on a 0.25 step grid, so a pair
that locks in a corner (two interlocking channels) stopped up to a step short
of the tightest fit. Each resting position is now also slid sideways, both
ways, and the new resting positions join the candidates.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-13 18:25:25 -05:00
ajandClaude Fable 5.2 9b7082e92f fix(clone): keep Shift+click copies at the part spacing
The coarse bounding-box pass only stopped at obstacles whose box lay in
the push path, so a copy could drop past a neighbor beside the path and
end inside its spacing. A box push now also stops at an obstacle nearer
than the spacing to the side of the path.

A push ignores a part the copy starts on, so a settle could slide out of
that part and stop clear of it yet inside its spacing. SettlePlacement
now prefers a push order that keeps the part spacing, and a named order
that ends too close falls back to the other order.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-13 15:43:47 -05:00
ajandClaude Fable 5.2 bc0136e3f7 refactor(core): move cut-offs into OpenNest.CutOffs
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-12 19:42:45 -05:00
ajandClaude Fable 5.2 c8e899c493 refactor(core): move common lines into OpenNest.CommonLines
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-12 19:40:26 -05:00
ajandClaude Fable 5.2 cd5a400a22 refactor(core): move clamps into OpenNest.Clamps
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-12 19:38:20 -05:00
ajandClaude Opus 5.5 e6d438629f feat(cutting): slice slugs the support grid can't hold level
On an enclosed machine a cutout slug that tips once cut free can stand up
above the sheet and catch the enclosure door when the pallet changes. The
head already keeps off cut cutouts, so this is about clearing the door, not
the head.

Cutting Settings > Cutouts > "Slice slugs the support grid can't hold
level" (CuttingParameters.SliceTippingSlugs, off by default, saved per
machine thickness and written only when on) makes Plan Cutting cut each
such slug along the bed's contact lines (grid rows and columns, slat center
lines) before the cutout, so no piece keeps a contact and the pieces drop
between the supports. Each slice stops a kerf short of the cutout, so the
pieces stay attached until the cutout's own kerf frees them together. A
slug the bed holds level, or one on no contact, is left whole; a cutout
holding another part or another of its part's cuts is never sliced.

Slices are break cuts emitted right after the drawing's own break cuts,
pierced on themselves and led straight back to their start. The
released-contour proof now leaves out straight break cuts lying wholly
inside one of the part's closed holes, since the grid cells they free are
scrap; break cuts in material still take part. The plan fingerprint only
changes when the setting is on.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 17:04:27 -05:00
ajandClaude Opus 5.5 cafb34b510 feat(clone): choose Shift+click push order and add box-only Ctrl+click
Shift+click in Clone Parts always kept whichever axis order landed the
copy nearest the origin, which can park it in a pocket the user didn't
want. Options > Clone push placement now picks Closest to origin (the old
behavior, still the default), Push left then down, or Push down then left.

Ctrl+click settles the copy on bounding boxes alone, so it stops square
to its neighbors' boxes instead of nesting into their shapes. Shift+click
keeps its box pass then geometry settle; both follow the chosen order.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 07:53:24 -05:00
ajandClaude Opus 5.5 beccbae106 perf(fill): skip copy-distance searches whose result is thrown away
One Irregular decode of a small job took seconds because each block in the
catalog is built by the full Fill pipeline (PrivatePlateFill), and inside it
StripeFiller's estimate rows spent about 85% of the CPU in FillLinear's
perpendicular TilePattern. A stripe estimate is exactly one pattern tall, so
the pattern's copy distance, an all-pairs slide search, always exceeded the
room left and the copies were discarded after the search had run in full.

TilePattern now passes FindPatternCopyDistance the largest distance that
could still place a copy: for a whole copy, the room past the pattern; for a
pattern that may tile partially, the most room past any one of its parts. The distance
is the maximum over every pair, so the search stops as soon as it passes that
bound and the tile returns empty, which is what the full search led to. The
public CopyDistance is unchanged. StripeFiller's angle searches also reuse
each rotated pattern's bounding box per angle instead of cloning and
rotating the parts again on every probe.

Output is identical: the layouts of every benchmark job that finishes match
the previous build. Measured A/B on this machine, alternating builds per job
(Benchmark --engines Irregular --parallel 1, benchmark ms):

- N26-2A5: 15.5 s -> 8.8 s (12.6 s -> ~7.2 s in quieter runs)
- 73 of the 80 bench jobs (the other 7 time out at 5 minutes in both
  builds): 1,990 s -> 1,578 s total (-21%), process CPU 6,486 s -> 3,842 s
  (-41%), median job 0.91x. N26-295 now finishes in 242 s with the same
  layout where it hit the 5-minute limit before.
- Problem-nest corpus auto-nest and fill areas: all at baseline.

A parallel herringbone pair build was tried and dropped: it saved 1.2 s on
N26-2A5 but cost 10 s and 45 s more CPU on P241017-01.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 18:08:12 -05:00
ajandClaude Opus 5.5 6867ae2ee4 feat(arrange): let Fix Spacing clear overlaps on packed plates and tilt as a last resort
On a plate packed edge to edge, an overlap left by hand-placing extra
parts could not be fixed: straight push chains ran into the edge and
the relaxation gave up on pairs that share material, which have no
contact normal. The relaxation now pushes such a pair along its
shortest straight way out and lets the rest settle, which cleared a
0.92 sq in overlap on a 38-part plate with every part kept square.

When moves alone still cannot settle, the relaxation runs again as a
rigid one: an off-center push also turns a part, up to 3 degrees, if
its drawing is free to rotate. Moves stay first because a tilt turns
every part the push reaches.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 14:45:54 -05:00
ajandClaude Opus 5.5 821c97e8dc feat(arrange): add Fix Spacing to push apart only flagged parts
Expand Spacing opens up a whole selection; nests that are a hair short
of fitting need the opposite: move only the parts the overlap check
flags, by the shortfall, and leave everything else where it is.

Fix Spacing pushes one part of each flagged pair straight away from the
other and ripples the push into neighbors it crowds, so rows already
locked in at the spacing can make room. When a plate is packed edge to
edge and no straight push fits, a constraint relaxation shares each
shortfall between both parts along the closest-point normal. Every
result is confirmed by the overlap check before any part moves, and is
applied only when it has fewer findings and nothing new.

NativeContours gains a coarse-flattening overload, Translated, Nested
and a closest-points GapTo for the search.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 14:29:10 -05:00
ajandClaude Opus 5.5 9273a44258 feat(engine): squeeze the Rectangles sheet that finishes the job
Auto Nest left N26-2A5 (14 door stops, 14 lock plates on a clamped 26x26
sheet) 8.0 high, while the shop's hand layout holds all 28 under 7.5 and
leaves a half-inch-deeper drop. Every MaxRects fit rule packs into the
whole sheet, so with room to spare it spreads the parts out and never
looks for the shortest strip.

When a rule places all the remaining demand, Rectangles now repacks it
into shorter and narrower bins, every rule and mode per probe, and offers
the tightest complete layout per axis to the stock loop, which still
picks by cost and offcut. Fit is not monotonic in bin size (7.5 packs,
7.62 and 7.74 do not), so probes walk down through stack heights (sums of
spaced part sides from the bin edge or a reached clamp) instead of
bisecting. A placement budget skips sheets finishing ~2000+ parts.

Benchmark, Rectangles on 80 recent production nests with salvage credit:
11 cheaper, 0 worse, all valid, total time 14.7 s -> 13.2 s.

The zero-clamp hash is re-captured (the squeezed layout is narrower);
the far-clamp test now compares poses, since the clamp can reorder an
identical layout.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 11:10:06 -05:00
ajandClaude Opus 5.5 7dc471bbf8 fix(engine): keep Strip layouts clear of clamp keep-outs
The Strip whole-job engine laid its strips, settled them and picked its pack
remnant from the bare work area, never adding the plate's clamp keep-outs the
Lattice orchestration uses. On a clamped sheet it put parts over the clamp, the
runner's layout check rejected the candidate, and Strip produced nothing (N26-2A5
rev 5: door stop at (21.09,1.50) over clamp-1).

NestStrips now treats InteractiveClamps.ClearanceRectangles as occupied space for
the iterative shrink strips (through RemnantFiller), settles with the clamp
obstacles when there are zones, and finds the pack remnant around them even
before any strip is placed. Unclamped plates take the old path unchanged.

A FixedStrategyNestingEngine theory runs all four fixed strategies on a clamped
26 x 26 sheet; only Strip failed it before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 10:59:21 -05:00
aj 49603eddf9 fix(geometry): nest the same on Windows and Linux
Geometry, nesting and import code now call PortableMath instead of
System.Math for Sin, Cos, Tan, Atan, Atan2, Asin and Acos (Core, Engine,
IO, Data; 269 calls in 64 files). A test fails if those projects call the
runtime's trig again.

With the runtime's trig, Windows and Linux disagreed in the last bit at
non-quarter angles and the same job could nest differently: the
learned-angle nests (a cross fixture) placed 23 parts in Strip on Windows
and 28 on Linux. Now every Engine.Tests pin gives the same layout on both
(3600 passing on Linux and on DesktopPC), Linux layouts are unchanged, and
the learned-angle rows are re-pinned to the shared layouts, which pass the
overlap and work-area checks, and run on every platform again.

Fixes Project Memory 518f3b58.
2026-11-09 19:18:00 -05:00
ajandClaude Opus 5.5 735c076afb feat(fill): tile herringbone pairs at the part's hull angles
Fill paired a 9" angle bracket at 90/270 degrees (75 on a 48 x 96 plate)
while a hand-laid herringbone at 315/135 holds 84. Its pair touches only at
the legs' ends, so it ranked ~888th by pair box area, and pairs are tiled
at the pair's own hull angles, never the part's 45-degree edge.

The pairs phase now also builds herringbone pairs: the part turned so a
hull edge lies along a sheet axis, its 180-degree copy slid onto the row
the part makes along that axis, tiled and remnant-filled like best-fit
pairs. Fill now finds the 84.

The chevron in the learned-angle fixture became a herringbone whatever
angles were learned, so a cross replaces it; the learned-angle and Strip
mixed nests are re-pinned.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 23:39:11 -05:00
ajandClaude Opus 5.5 f62f73533e feat(fill): tile pair grids into narrow leftover strips
Fill tiled 8" gussets on a 16.85 x 60 strip as seven pairs in a 10.35"
column (14) and left a strip too narrow for a gusset square on. Sliding
each pair along its hypotenuse so six span the height narrows the column
to 8.75" and leaves a strip that holds eight more turned 45 degrees (20),
as laid out by hand.

- The pair remnant filler tries strips down to the part's narrowest hull
  width and tiles single best-fit pairs as a grid there, taking the grid
  only when it places more than the rows of pairs.
- After the pair filler's early exit it also tries skipped candidates
  whose grid plus an optimistic leftover-strip estimate could still win,
  keeping one only when it places more parts.
- The optimistic remnant bound counts parts by true area, not bounding
  box, so interlocking parts no longer prune winning candidates.

The mixed Fill nest pin now places 34 instead of 33; the mixed Strip nest
keeps 35 with its L-shapes laid out differently. Both pass the layout check.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 22:24:49 -05:00
ajandClaude Opus 5.5 5adcddc748 feat(fill): refill the outer row's end to fit one more part
After the fill strategies, the winning layout's outermost row on each side
is pushed into the edge slack, slid toward one end, and copies of its end
part are slid in from the freed end. Lifting a staggered hexagon row straight
over the one below opens a notch where one more nests: a 7" hex cover on a
60 x 120 sheet now fills 181 instead of 180. The policy's comparer must
prefer the result and the requested quantity caps it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 21:46:03 -05:00
ajandClaude Opus 5.5 3c561566cd fix(clamps): drop the origin rapid from the keep-out outline
The exact clamp check built each keep-out from a program whose opening
rapid from (0, 0) joined the outline, stretching every keep-out into a
wedge back to the origin. Parts clear of a clamp but inside that wedge
were dropped from fills (two L's on a clamped sheet). Build the
rectangle from four lines instead.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 20:11:35 -05:00
ajandClaude Opus 5.5 74937b7952 feat(cutting): start the owner's outline on its common line
The part cut first no longer makes a separate uncompensated centerline
cut with its own lead-in and lead-out, then re-pierces for its
remainder. It cuts its outside compensated, which puts its shared edge
on the kerf centerline, starting on the common line: a straight lead-in
from the scrap along the shared edge, then the line and on round its
perimeter with no lead-out. A member with spans already cut stops in
that kerf and cuts its last stretch from it, ending beside the part it
is cut before. Partners still cut only their remainders.

Replay's tabbed-ring accounting now accepts pieces that tile each span
exactly once, and the pre-post review counts a span as cut by a
member's compensated edge (or an older centerline cut).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 16:57:35 -05:00