Commit Graph

411 Commits

Author SHA1 Message Date
e6a7d9b047 docs: add pluggable fill strategies implementation plan
11 tasks covering: IFillStrategy interface, FillContext, FillStrategyRegistry,
FillHelpers extraction, 4 strategy adapters, RunPipeline wiring, and tests.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-18 12:54:14 -04:00
ddf1686ea5 docs: address spec review feedback for pluggable fill strategies
Clarifies: strategy statefulness, cancellation handling, progress
reporting, NestPhase.Custom for plugins, BinConverter visibility,
LinearFillStrategy internal iteration, registry caching.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-18 12:46:30 -04:00
501fbda762 docs: add pluggable fill strategies design spec
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-18 12:39:30 -04:00
a83efd0b01 feat(ui): show both horizontal and vertical fill previews side by side
Replace single preview PlateView with two stacked previews showing
horizontal and vertical FillLinear results. Each has a label showing
the part count. Apply uses the direction with more parts.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-18 11:12:24 -04:00
a1139efecb feat(ui): wire Pattern Tile menu item and apply logic in MainForm 2026-03-18 09:58:24 -04:00
d8373ab135 refactor(ui): extract compaction helper, fix auto-arrange UX in PatternTileForm
- Extract CompactTowardCentroid static helper to DRY compaction logic
- Disable Auto-Arrange button when fewer than 2 drawings selected
- Widen mouse-up compaction guard from == 2 to >= 2

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-18 09:56:21 -04:00
f0b9b51229 feat(ui): add PatternTileForm dialog with unit cell editor and tile preview 2026-03-18 09:52:36 -04:00
76a338f3d0 refactor(engine): remove dead import and add spacing comment in PatternTiler
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-18 09:48:14 -04:00
0ac7b9babd fix(test): rename misleading test method name
Tile_CellLargerThanPlate_ReturnsSingleCell -> ReturnsEmpty

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-18 09:46:26 -04:00
f336af5d65 feat(engine): add PatternTiler for unit cell tiling across plates 2026-03-18 09:43:45 -04:00
3d6be3900e feat(engine): generalize Compactor.Push to support arbitrary angles and BB-only mode
Add Vector-based overloads to SpatialQuery (ray casting, edge distance,
directional gap, perpendicular overlap) and PartGeometry (directional
line filtering) to support pushing parts along any angle, not just
cardinal directions.

Add Compactor.PushBoundingBox for fast coarse positioning using only
bounding box gaps. ActionClone shift+click now uses a two-phase strategy:
BB push first to skip past irregular geometry snags, then geometry push
to settle against actual contours.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-18 09:41:09 -04:00
285e7082fb docs: add pattern tile layout implementation plan
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-18 09:31:27 -04:00
207cef5423 docs: update pattern tile layout spec after review
Address 12 review findings: remove redundant Compactor.Push refactor
(already exists), add Plate.Quantity=0 isolation, specify synthetic
work area for compaction, clarify edge cases and tiling spacing.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-18 09:20:47 -04:00
c3b3f24704 docs: add pattern tile layout window design spec
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-18 09:15:44 -04:00
6229e5e49d fix(engine): fix FillExtents competition and vertical gap bugs
- FillExtents.Fill reported progress internally which overwrote the UI's
  temporary parts even when a better result (e.g. Pairs with 70 parts)
  won the competition. Added final ReportProgress call in FindBestFill
  and Fill(groupParts) to ensure the UI always shows the actual winner.

- FillExtents vertical copy distance clamp (Math.Max with pairHeight +
  spacing) prevented geometry-aware compaction from ever occurring,
  causing visible gaps between rows. Boundaries are already inflated by
  halfSpacing so the calculated distance is correct; only fall back to
  bounding-box distance on non-positive results.

- PairFiller now sets RemainderPatterns on FillLinear so remainder strips
  get pair-based filling instead of only individual parts (+1 part in
  tight layouts).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-18 07:59:28 -04:00
07465d6f0c Merge branch 'master' of https://git.thecozycat.net/aj/OpenNest 2026-03-18 07:26:09 -04:00
d2eeb23107 refactor(io): migrate nest file extension from .zip to .opnest
Add FileExtension and FileFilter constants to NestFormat and update all
references across Console, MCP, Training, and WinForms projects.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-18 07:26:04 -04:00
ccd230568e feat(engine): integrate FillExtents phase into DefaultNestEngine
Adds FillExtents as a fourth nesting phase in both FindBestFill and
Fill(groupParts, Box), running at bestRotation and bestRotation+90°.
Updates Description to reflect the new phase.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-18 00:51:51 -04:00
7a19b78d31 feat(engine): implement FillExtents horizontal column repetition
Replace RepeatColumns stub with real implementation: compacts a test column
left against column 1 to derive the copy distance, tiles further columns at
that interval, and clips partial columns to the work area bounds. Adds 4 new
FillExtentsTests covering multi-column fill, rect shapes, non-zero-origin
work areas, and cancellation.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-18 00:50:16 -04:00
31b293324d feat(engine): implement FillExtents iterative height adjustment
Replace AdjustColumn stub with a convergence loop that distributes the
remaining gap between the topmost part and the work area top edge across
all pairs. TryAdjustPair/TryShiftDirection try shifting part2 up (or down
as fallback) and compact left, rejecting moves that widen the pair.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-18 00:48:41 -04:00
7bc9f134f6 feat(engine): add FillExtents scaffold with pair construction and column tiling
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-18 00:45:55 -04:00
6e30e24957 feat(engine): add NestPhase.Extents enum value 2026-03-18 00:42:48 -04:00
42f2475f3c fix: correct Size width/length axis mapping throughout codebase
The Size fix (d4222db) changed Size.Width to Y axis and Size.Length to
X axis but only updated DrawPlate/LayoutViewGL. BoundingBox, WorkArea,
rotations, DXF export, and engine code still used the old Width=X
convention, causing the fill engine to get a swapped work area (60x120
instead of 120x60) and parts to fill in the wrong direction.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-17 16:20:24 -04:00
a487d33f52 merge: integrate remote master
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-17 12:15:09 -04:00
bfd740c81e feat(core): add FlangeShape with JSON preset loading
FlangeShape generates an outer circle with evenly-spaced bolt holes
on a bolt circle pattern. ShapeDefinition.LoadFromJson<T>() provides
generic JSON loading for any shape — no separate preset classes needed.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-17 11:36:26 -04:00
aj
03efeff85a Update README.md 2026-03-17 10:33:45 -04:00
d4222db0e8 fix: correct Size width/length ordering and add CLI docs to README
Size.Parse and ToString now use WxL format (width first) matching the
natural convention. Fixed the Plate(w,l) constructor which was swapping
args when creating Size. Fixed PlateView.DrawPlate and DrawControl
ZoomToArea which had width/length mapped to the wrong screen axes.

Simplified Console --size parsing to use Size.TryParse instead of manual
split with confusing PlateHeight/PlateWidth fields. Added Command-Line
Interface section to README documenting all console options.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-17 10:29:13 -04:00
21a16e5b7c feat(ui): move add/remove plate buttons to header bar
Relocated add and remove plate buttons from the Plates tab toolstrip
to the right side of the plate header, keeping plate actions together.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-17 09:46:08 -04:00
4616f077d5 feat(ui): move plate navigation from toolbar to header above PlateView
Plate nav buttons (first/prev/next/last) now sit in a centered header
bar above the PlateView with a plate info label on the left, making
navigation more accessible without reaching up to the main toolbar.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-17 09:35:18 -04:00
d210d29554 docs: add keyboard shortcuts to README
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-17 09:17:10 -04:00
dde07fc256 merge: resolve polylabel conflicts, keep remote version with hole support
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-17 09:02:30 -04:00
788996abcf docs: add screenshots to README
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-17 08:58:50 -04:00
224fbde19a feat: add polylabel algorithm for part label positioning and README
Use pole-of-inaccessibility (polylabel) to place part labels at the
visual center of shapes instead of the first path vertex. Labels now
stay correctly positioned regardless of part rotation or shape.

Also adds project README and MIT license.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-17 08:52:48 -04:00
a0865405e2 refactor(mcp): use shape library in InputTools
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-17 08:10:13 -04:00
6e5471271d feat(core): add RoundedRectangleShape
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-17 08:07:22 -04:00
0651f185e3 feat(core): add OctagonShape
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-17 08:06:21 -04:00
33377291a6 feat(core): add TShape
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-17 08:06:08 -04:00
dfd5a15274 feat(core): add TrapezoidShape
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-17 08:04:15 -04:00
09a7608bcb feat(core): add IsoscelesTriangleShape
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-17 08:03:14 -04:00
92d2d6d2bc feat(core): add RightTriangleShape
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-17 08:02:18 -04:00
641734ba70 feat(core): add RingShape
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-17 08:00:11 -04:00
5d0de4a1b1 feat(core): add CircleShape
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-17 07:59:26 -04:00
f92d09a863 feat(core): add RectangleShape
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-17 07:58:37 -04:00
5670ae79bf feat(core): add ShapeDefinition base class
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-17 07:57:54 -04:00
aedbbbe0a6 docs: add shape library implementation plan
13-task TDD plan covering ShapeDefinition base class, 10 shape classes
(Rectangle, Circle, Ring, RightTriangle, IsoscelesTriangle, Trapezoid,
Octagon, L, T, RoundedRectangle), and MCP InputTools refactoring.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-17 07:55:54 -04:00
5d9d48ebfc docs: address spec review feedback for shape library
Add null safety in CreateDrawing helper, default Name from class name,
clarify diameter-vs-radius conventions, octagon width definition,
arc direction for rounded rectangles, and MCP parameter mapping.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-17 07:49:34 -04:00
eb6cb94893 docs: add shape library design spec
Defines a parametric shape library with abstract ShapeDefinition base
class and concrete subclasses for common CNC shapes (Tier 1+2).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-17 07:46:44 -04:00
9d40d78562 feat(ui): add remnant viewer tool window
Adds a toolbar button that opens a dockable remnant viewer showing
tiered remnants (priority, size, area, location) with color-coded
overlay rendering on the plate view.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-16 22:49:51 -04:00
896cb536dd feat(console): add --engine CLI flag to select nest engine
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-16 22:49:43 -04:00
493f7f837a fix(engine): sort hull edge angles by longest edge first
Longest edges produce the flattest tiling rows and should be tried
first. Also deduplicates angles before sorting.

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