Commit Graph
2476 Commits
Author SHA1 Message Date
ajandClaude Opus 5.5 692fc280f6 feat(options): redesign Options as category pages with a server grid
Options is now a sidebar of pages (General, Nesting & Cutting, Fill
Strategies, Nest Server, MaterialLedger, Updates), each with a heading,
a summary and hints under its fields; the window is resizable and
reopens on the last page used.

Nest Server lists the saved servers in an editable grid (add in the blank
last row, remove any but the active one) with an Active server dropdown.
The list saves with the dialog's Save after every row is checked, so a
bad address saves nothing and keeps the dialog open.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 21:48:18 -05:00
ajandClaude Opus 5.5 05afb23a5a fix(simplify): keep simplified contours closed and free of added corners
The mirror pass replaced an arc with its mirror image whenever the image
landed within the fit tolerance of the arc's endpoints, leaving gaps of up
to that tolerance; it now only lends its radius to a refit through the
arc's own endpoints, and only when that keeps the arc's end tangents.

Arc fitting fell back to tangent-free fits when the next arc could not
leave along the previous arc's end tangent, putting corners where the
drawing is smooth (two same-way arcs across an inflection). Chained arcs
now start exactly tangent, shortening the previous arc when that lets the
next one reach further, and an arc is kept only if it turns no more
sharply against its neighbors than the original polyline (plus 1 deg);
otherwise it is trimmed or its lines stay.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 21:46:53 -05:00
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 c8ba250adc feat(cad-converter): separate a file that draws several parts
A file such as a sheet of ornaments imported as one drawing, with every
part but the largest treated as a cutout. PartBodies (Core) now finds the
separate parts by contour nesting, and the CAD Converter offers a
Separate (N) button plus Separate This Part / Separate All Parts in the
entity menu. Each part keeps its entity IDs, so roles, exclusions,
breakoffs, tabbed cutouts and dimensions follow it; separation is refused
when a breakoff or tabbed cutout spans parts.

SVG import keeps element titles as labeled regions, which name the
separated parts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 20:53:08 -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 5beaf526f8 test(corpus): save an Auto Nest problem nest's layout as its baseline
An Auto Nest problem nest recorded only a sheet count and where its last
sheet ends, so seeing the layout behind those numbers, or telling
whether a change still made it, meant nesting the old code again.

With OPENNEST_PROBLEM_NESTS_RECORD=1 the auto-nest area now saves each
nest whose layout is valid, complete and no worse than its baseline back
to the corpus server as a new revision: its plates become the layout
Auto Nest just made, on the sheets the job nested on, and its line ends
in "layout saved". A nest without a baseline gets its first one that
way. What was on the plates before stays in the earlier revisions.

- A layout inside the tolerance past the recorded end keeps that end,
  so repeated recording cannot let the baseline creep.
- A nest that also guards planning or fill is not saved (those tests
  read its plates), nor a layout leaving one of the nest's sheet sizes
  unused (the job takes its sizes from the plates).
- A nest whose saved layout and line already match adds no revision.

Without the variable nothing is written; a run reports for each saved
layout whether Auto Nest still makes exactly it.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-20 17:50:28 -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 Opus 5.5 ccf7c61b99 feat(nesting): open the layouts window at 80% of screen height
The layout cards were too small to read while the search ran.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 17:01:19 -05:00
ajandClaude Opus 5.5 0cf9f9d0bd feat(nesting): turn the status bar green when the search ends
A finished search waiting for a layout pick looked the same as one still
running, so it sat unnoticed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 17:01:13 -05:00
ajandClaude Opus 5.5 8638843437 docs(updates): describe the Updates choice and its schedule
auto-update.md and the development build's release text named the old
Include development builds box. They now name Tools > Options > Updates,
list the four choices with when each checks, and say how the once-a-day
and once-a-week clock starts and that Check for Updates never waits.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 16:42:45 -05:00
ajandClaude Opus 5.5 654ec859df feat(updates): take development builds once a day or once a week
Every green master push becomes a development build, six to thirty a
day, so a copy taking them showed "Update ready" several times a day.
Tools > Options replaces the Include development builds box with an
Updates choice: Stable releases only, Development builds at most once a
day, at most once a week, or Every development build.

The choice is stored as the existing UpdateIncludeDevBuilds plus a new
UpdateDevBuildInterval, so a copy with only the old box checked reads as
Every development build and nothing changes until someone picks, and an
older build still reads the channel. Saving Stable keeps the stored
interval. Both Options dialogs (WinForms and Avalonia) carry the choice,
so saving either never resets it.

On the daily and weekly choices the 30-minute background check waits
until the calendar day after (or seven days after) this copy first ran
its current version, recorded at startup in UpdateRunningVersion and
UpdateRunningSince however that version arrived. Local calendar days,
so a copy started a little earlier each morning still updates daily.
Help > Check for Updates... never waits. The rule lives in
OpenNest.Desktop (DevBuildSchedule) with tests on Linux; UpdaterService
only applies it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 16:42:45 -05:00
ajandClaude Opus 5.5 ce5d37316f test(reports): skip the tabbed PDF tests when poppler is missing
The two tabbed-part tests from e4043a4d end with a pdftotext check, which
throws SkipException on hosts without poppler (the Linux CI runner). As
plain [Fact]s that skip was reported as a failure; [SkippableFact] matches
the other text-checking tests and still runs the PdfSharp path assertions
before the text check.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 14:24:58 -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 Opus 5.5 e4043a4d48 feat(reports): fill tabbed parts and mark their IDs with an asterisk
Tabbed parts (outline open at each tab) were drawn as bare outlines, so
the new drawing colors could not identify them. They are now filled in
their color, the fill bridging each tab gap while the stroked outline
keeps its gaps. A hatch would vanish on thin tabbed parts, so the mark
is a "*" on the diagram label and the parts-table ID, with a legend line
under the diagram sharing the removed-clamp note's line.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 13:37:48 -05:00
ajandClaude Opus 5.5 f7aa7f82dd fix(reports): label packed thin strips and color parts by drawing
N26-2CN's 13 x 1 in bars are 9.6 pt tall at overview scale, just under
the 10 pt ID, so none passed the in-part test. Two drawings share rows,
so each drawing's group rectangle took in the other's bars and was
refused, and leaders reached only the edge bars: most of the sheet had no
ID. A strip that thin now takes its ID at its pole, overhanging its own
outline by at most the clearance and touching nothing else.

As a last resort for parts no ID can reach, each drawing is filled in a
light palette color on the plate diagram and its card thumbnail, and its
ID cell in the parts table carries the same color as the key.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 13:27:56 -05:00
ajandClaude Opus 5.5 7d9113f94c fix(reports): fit ten drawings in a plate page's parts table
A 10-drawing plate (N26-2CJ, sent out for quote) spilled its last three
parts-table rows onto a second page. The generic legend lines (hatched
clamps, ruler units) explained what the page already shows, so they are
gone; only the removed-clamp line stays, since it is an action before
cutting. The diagram drops from 320 to 265 pt so ten rows still fit with
an estimated cut time and that clamp note, the worst case.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 13:14:34 -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 Opus 5.5 0fd912cceb docs(readme): add a current plate-view screenshot
The simulator shot alone shows the nest half-grayed under a dialog; a
plain plate view of the same nest shows what a finished layout looks
like, so the pair covers both nesting and cutting.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 11:00:28 -05:00
ajandClaude Opus 5.5 9f9c271e64 docs(readme): drop the outdated nest screenshots
They showed a UI several releases old; the cut simulator shot already
shows a current plate view, so the old pair only misrepresented the app.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 10:59:39 -05:00
ajandClaude Opus 5.5 920ee34329 docs(readme): lead with the cut simulator and list SVG/DWG export
The old gallery showed only static nests; the simulator shot shows the
cut order, cut-state colors and live feeds in one image. The format list
still said DWG was import-only and missed SVG entirely, though plates and
drawings now export to SVG and the CAD Converter writes DWG.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 10:58:30 -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 97fc5be021 test(corpus): guard where an Auto Nest problem nest's last sheet ends
An auto-nest baseline was a sheet count. A job that does not fill its
last sheet can get much worse without taking another one: N26-2CJ went
from ending at 75.2" to 62.1" on one sheet either way, so the corpus
would have passed a layout back at 75.2".

The baseline line may now also say where the last sheet ends,
"auto-nest: 1 sheets, ends 62.2": how far along the sheet's length its
material reaches, measured from the end the layout starts at, the same
figure in every quadrant. At the baseline's sheet count a layout ending
more than 0.05 past it fails; one ending sooner is reported with the
line to record. A line without "ends" checks the sheet count alone, and
older code reads the new line as its sheet count.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-20 09:17: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 3544e924c1 fix(compactor): a tabbed part pushes away from a neighbor at the spacing
A part whose planned outside carries a perimeter tab could not be pushed
away from a neighbor it rested against at the part spacing, and the
neighbor could not be pushed away from it: the push returned 0 with open
sheet ahead. It showed whenever the neighbor's bounds wrapped the part
(an eared or C-shaped neighbor), since otherwise the broad phase skips an
obstacle that is wholly behind.

The tab stops the cut short of its entry, so with the leads dropped the
outside is an open chain. Its spacing-offset contour does not close, the
slide kernel cannot tell which side of it is material, and it blocks
every contact against a boundary it cannot resolve. The parts were never
closer than the spacing.

PartGeometry now closes a tabbed contour across its tab before any
offset: the trimmed last cut is restored along its own line or arc
(exact), a round outside cut as one arc becomes its circle, and a tab
that swallowed whole entities is bridged by its chord, as flattening to
a polygon already closes it. Only a single gap is closed; closed
material is returned untouched, so untabbed parts and the fills see the
same geometry as before. No kernel code or tolerance changed, so a push
into a neighbor still returns 0 and a contour cut in several pieces
still blocks.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-20 08:30:56 -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 6cf6a78306 fix(plateview): keep the selection when Ctrl is held
Ctrl+click on empty space no longer clears the selected parts, so a
window drag with Ctrl adds to the selection; Ctrl+Shift+click on a part
now adds it too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-19 20:36:11 -05:00
ajandClaude Opus 5.5 4be141b038 feat(release): pick a top layout while Make Nests nests
Each released nest's progress window offers the top-layout cards and
Use This Layout, as Auto Nest does: using one stops that nest's search
and goes on with it. A search that finishes with several layouts counts
down 5 seconds before going on with the engine's result; picking a card
stops the countdown and waits for Use This Layout or Discard.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-19 19:31:07 -05:00
ajandClaude Opus 5.5 c9230af39e feat(release): nest after release on the machine's plate sizes
Make Nests with Nest after release ticked now nests what the MaterialLedger
stock cannot hold on the plate sizes the nest's machine lists for its
material, grade and thickness (Machine Configuration's Plate Sizes tab),
instead of the Nest Defaults sheet or a draft's saved options. The sizes
become the nest's plate-size options, converted to its units (standard
sizes are inches, custom ones the machine's units); a thickness listing
none keeps the previous behavior.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-19 19:31:07 -05:00
ajandClaude Opus 5.5 a171b6a0de feat(mcp): nest server tools for sets, Make Nests and re-nesting
Releasing element-rack jobs from an agent meant hand-writing a console
runner around SetReleaseSession, posting set JSON by hand (opaque
"Invalid set JSON." and 428 without If-Match) and re-nesting by hand when
the 60x120 default wasted sheets. The MCP server now does it through the
desktop's own clients and release session:

- search_drawings, get_drawing, search_sets, get_set
- create_set, update_set, archive_set, restore_set (revision guard handled)
- plan_release: material groups, refusals and mergeable drafts, read-only
- make_nests: SetReleaseSession with headless ReleaseRenest, File > New
  nests from NewNestSource (server-allocated names), MaterialLedger when
  set up, optional merges into drafts
- renest_nest: re-nest a Draft/Quote nest, saved with the expected-revision
  guard only when every part is placed
- nest_summary, get_release, undo_release

make_nests and renest_nest take candidate sheet sizes: each alone and all
together as plate options are tried on copies, keeping the fewest
unplaced, then fewest sheets, then least sheet area, because the engine's
own stock choice minimizes area, not sheet count.

Tests run the tools against the in-process server; docs in
docs/mcp-nest-server-tools.md.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-19 13:38:21 -05:00
ajandClaude Opus 5.5 68cd070399 feat(report): leader labels for parts too thin to hold their ID
A thin strip on N26-2CJ had no ID in the plate diagram, and a half ring's
ID landed in the open side of its C shape, away from the material. The
in-part fallback searched the whole bounding box, so concave openings
counted as the part's own space.

That fallback now uses only enclosed holes. A part still unlabeled after
grouping gets its ID in the nearest clear space outside it, with a thin
leader to a dot at its pole; the leader crosses no other part, cutoff,
clamp, label or leader. Tiny parts whose ID other unlabeled parts share
get no leaders, so an ungroupable cluster does not bury the sheet in them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-19 10:26:16 -05:00
ajandClaude Opus 5.5 adb5400b97 feat(drawings): sort the Drawings tab by name, area, box size or remaining
A sort drop-down on the Drawings toolbar orders the list by Name,
Area, Bounding Box Size or Remaining Qty (largest first, ties by
name). The choice is saved as the DrawingSortOrder user setting.
Placing parts re-sorts a Remaining Qty list, rebuilding only when the
order or the hidden drawings change, which also keeps re-shown
drawings in sorted place under Hide Fully Nested.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-18 22:55:30 -05:00
ajandClaude Opus 5.5 3b63afafd6 feat(view): draw the grain button as a brushed-metal swatch
The grain button is now a rounded card with a drop shadow, a small
metal swatch whose brushed streaks run with the grain, a halo-outlined
double arrow and the GRAIN caption inside the card. Hover tints it
orange; disabled fades it to gray. Size, placement and hit area are
unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-18 18:08:19 -05:00
ajandClaude Opus 5.5 71b4c46dbe feat(view): grain arrow off the plate corner that turns the grain
With View > Show Bend Lines on, the plate shows its grain as a
double-headed arrow diagonally off its lower-left corner, at a fixed
screen size. Clicking it turns the grain a quarter turn (side to side or
front to back) as one undoable "Turn Grain" edit, for when the sheet's
grain runs the other way from the plate as entered. When Zoom to Fit
leaves too little margin the arrow stays inside the view's corner.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-18 11:02:17 -05:00
ajandClaude Opus 5.5 2be966187c fix(plate): turn the grain when the plate is rotated 90 degrees
Grain belongs to the physical sheet, so Rotate Plate CW/CCW must turn it
too: a 60x120 sheet with side-to-side grain becomes a 120x60 sheet whose
grain runs front to back. Rotate90 swapped the size and turned the parts
but left GrainAngle alone, so bend-vs-grain warnings were wrong after a
rotation. A 180-degree turn leaves the grain's line unchanged.

Grain angles are lines, so they are kept in [0, pi).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-18 11:01:57 -05:00
ajandClaude Opus 5.5 9ec3163495 fix(view): outline the part, not its bounding box, for grain warnings
The orange grain warning was a rectangle around the part's bounds, which
ran across neighboring parts in a tight nest and made it hard to tell
which part was flagged. It now traces the part's own cut contours.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-18 10:28:21 -05:00
ajandClaude Opus 5.5 bf412707f8 fix(view): flag bends that run with the grain, not across it
Bend lines should run perpendicular to the sheet's grain to avoid
cracking on the outside of the bend. The grain warning had it backwards:
it outlined parts whose bends were not parallel to the grain, so on a
60x120 sheet (grain side to side along X) it flagged the correctly
oriented parts and passed the ones bent with the grain.

It now outlines a part when any of its bends is more than 5 degrees off
perpendicular to the plate's grain, and the check is a tested helper.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-18 10:25:18 -05:00
ajandClaude Opus 5.5 250b52321e feat(view): add Show Bend Lines to the View menu
PlateView already drew bend lines, up-bend etch marks and a grain warning
box when ShowBendLines was on, but nothing in the UI could turn it on.
The new View > Show Bend Lines toggle makes bent parts easy to spot while
deciding whether extra rotations are worth it or every bent part should
keep the same grain angle for consistent forming.

The grain warning box used the drawing's unrotated bounds at the part's
location, so it sat in the wrong place on rotated parts; it now outlines
the placed part's world bounds.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-18 09:52:07 -05:00
ajandClaude Opus 5.5 101f5e16df test(windows): fix the two windows-desktop CI failures
The cut-off clearance change (cacfdcf5) drops a grid line within the cut
clearance of the tail separator. The dialog test's fixture used spacing 40
with parts occupying exactly 80, so the second line (80, beside the 80.5
separator) was dropped and the lone remaining line could not shift, which
is what the test asserts. Spacing 38 keeps two lines, so the shift and the
"less than the fixed grid" report are still exercised.

The overlap-menu test was renamed when Check Active Plate and Cancel Check
left the menu (c10abfe9), but the acceptance manifest still required the
old name, so the coverage check found zero cases.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-18 09:34:29 -05:00
ajandClaude Opus 5.5 fdb45d045c build(help): ship opennest-help v0.8.1
The help now says Overlap Check runs by itself, with only the display
choices under View > Overlap Check, and follows the CAD Converter's
Export... button that saves DXF, DWG or SVG. Both changes are on master.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-18 08:46:57 -05:00
ajandClaude Opus 5.5 c49b703be8 test(problem-nests): shape fill result lines like the planning test's
A nightly corpus runner keys every area's results by the subject before the
colon, so the fill line now reads "<nest> plate 1: 33 parts (baseline 33),
61.2 s" (strategy other than Lattice in the subject) instead of putting the
plate number in the outcome.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-18 08:37:09 -05:00
ajandClaude Opus 5.5 48af12c544 test(problem-nests): guard the plate fill engine with a fill area
Fills had no corpus coverage, so a fill-engine change could lose parts on
a real nest without any check noticing. Nests whose checks: line names
fill are now filled plate by plate the way Fill Plate does (parts cleared,
cut-offs kept, the plate's own size, spacing, edges, quadrant and clamps)
and held to a "fill: 1=33" part-count baseline, with an optional strategy
("fill (Strip): 1=33", Lattice by default). Fewer parts, a layout that
fails the layout check, or a timeout fails; more parts are only reported.
A missing or mismatched baseline prints the observed line to paste.

AGENTS.md now sends fill-engine changes to the fill area only, instead of
never running the corpus for fills.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-18 08:37:09 -05:00
ajandClaude Opus 5.5 cacfdcf5dc fix(cutoffs): keep automatic lines clear of nearby cut-offs
Automatic cut-offs matched existing cut-offs only on the exact same line,
so a grid line could land a hair beside a manual cut-off (or the planner's
own tail separator) and cut a sliver strip next to it. The planner now
keeps a cut clearance - the separator's part margin, the larger of part
spacing and cut-off part clearance - from every parallel cut-off:

- a full-span cut-off within it stands in for the proposed line (or the
  tail separator) and is certified at its own X;
- a shortened or gapped manual cut within it is a blocking conflict, as an
  exact same-line conflict already was, and the shift search avoids it;
- a strip line within it of a kept separator or full-span boundary is not
  cut, letting that strip run past the spacing by less than the clearance;
  the open sheet end keeps the bare tolerance, since oversize stock leaves
  its far edge unknown;
- a new horizontal separator beside an unhonored horizontal cut-off is not
  proposed.

With zero clearance and part spacing the guard falls back to the old
same-line tolerance.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-18 08:34:46 -05:00
ajandClaude Opus 5.5 45e7d6f1c8 feat(cad-converter): export DXF, DWG or SVG with bend lines that import reads back
The CAD Converter's Export button only wrote DXF (or SVG) with every entity on
layer 0 and no bends, so a re-imported export lost its bends and turned the
bend etch marks into cut geometry. Exporting now goes through a new
OpenNest.IO CadExporter:

- DXF R14-2018, DWG 2004-2018 or SVG. ACadSharp cannot write DWG 2007, and
  its DWG 2000/R14 output loses entities and layers, so those are not offered.
- Entities keep their layers; etch marks land on ETCH, which import drops and
  regenerates from the bends. A line picked as a bend is written only as it.
- DXF/DWG bends are BEND-layer CENTER lines with an "UP 90° R 0.06" MText note,
  the form SolidWorksBendDetector reads. Pre-2007 files escape non-ASCII note
  text as \U+XXXX, since ACadSharp reads raw non-ASCII back mangled.
- SVG bends are lines in a BEND group with data-bend-* attributes; the SVG
  reader now returns them as bends (scaled with the drawing units) instead of
  dropping the layer.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-18 08:23:13 -05:00
ajandClaude Opus 5.5 c10abfe996 refactor(overlap): drop Check Active Plate and Cancel Check from the menu
The nest window rechecks the active plate automatically half a second after
each edit, so a manual run/cancel pair in View > Overlap Check is redundant.
With only Display left, its Off/Areas/Markers/Both items move up to sit
directly under Overlap Check. Auto Nest still runs its explicit check, and
undo/redo still cancel a running check internally.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-18 08:17:58 -05:00