Commit Graph

187 Commits

Author SHA1 Message Date
0c98b240c3 feat(engine): integrate NFP phase into Fill(groupParts) single-drawing path
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 10:23:39 -04:00
56c9b17ff6 feat(engine): integrate NFP phase into FindBestFill (async overload)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 10:23:05 -04:00
c4d09f2466 feat(engine): integrate NFP phase into FindBestFill (sync overload)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 10:22:39 -04:00
bbc3466bc8 feat(engine): add FillNfpBestFit method for NFP-based single-drawing fill
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 10:22:07 -04:00
c18259a348 feat(engine): add Nfp to NestPhase enum
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 10:21:26 -04:00
bc3f1543ee refactor: extract FindCrossing and SplitAtCrossing from RemoveSelfIntersections
Break deeply nested loop structure into focused helper methods,
reducing max nesting from 5 levels to 2. Uses GetRange/AddRange
for cleaner loop building.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 10:20:11 -04:00
90b26babc6 docs: update NFP best-fit spec with review feedback
Address spec review issues: add third call site (Fill groupParts),
reuse ComputeCandidateRotations, fix step ordering for ToNestParts
before scoring, cap N to 500 and item.Quantity, clarify BoundingBox
is a property.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 10:09:42 -04:00
faa36d7539 docs: add NFP best-fit integration design spec
Spec for adding NFP-based placement as a competing strategy
in NestEngine.FindBestFill() for non-rectangular parts.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 10:06:27 -04:00
6b0bafc9de merge: integrate NFP-based autonesting from feature/nfp-autonest
Brings in the full NFP implementation: ConvexDecomposition, NoFitPolygon,
InnerFitPolygon, NfpCache, BottomLeftFill, SimulatedAnnealing optimizer,
and INestOptimizer interface. Resolves conflicts by keeping master's
progress reporting infrastructure alongside the new AutoNest methods,
and adapting RunAutoNest_Click to use NFP AutoNest with async/cancellation.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 09:40:38 -04:00
776e9d218c fix(ui): cache offset paths and scale temp parts on zoom
Cache offset polygon geometry on LayoutPart so DrawOffset no longer
recomputes the expensive offset pipeline every paint cycle. The costly
OffsetEntity/ToPolygonWithTolerance/RemoveSelfIntersections chain now
runs only when rotation, spacing, or tolerance actually changes.

Also update temporary parts in UpdateMatrix() so preview parts during
nesting scale correctly with zoom.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 09:29:27 -04:00
501b2553ad refactor(ui): move NestProgressForm UI to Designer file
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 08:50:33 -04:00
986d298786 feat(ui): replace random part colors with curated palette
Avoids visual confusion with reserved UI colors (orange preview parts,
green/blue selection windows) by using a fixed 12-color palette that
skips those hue zones. Removes unused HSLColor and RandomColorGenerator.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 08:45:28 -04:00
9773449563 feat(ui): add FillWithProgress to PlateView, use from ActionClone
Moves async fill+progress orchestration into PlateView so ActionClone's
Ctrl+F fill shows the NestProgressForm dialog.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 08:39:30 -04:00
fde285484a fix(ui): cancel nesting when MDI child form is closed
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 08:33:43 -04:00
98c4c88fc3 feat(ui): add progress support to ActionFillArea and FillArea_Click
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 08:33:09 -04:00
09fef203df feat(ui): make FillPlate_Click async with progress and cancellation
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 08:32:17 -04:00
0bf128b3e7 feat(ui): make RunAutoNest_Click async with progress and cancellation
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 08:31:31 -04:00
af0748fb1b feat(ui): add NestProgressForm modeless dialog
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 08:30:22 -04:00
c545f91d28 feat(ui): add temporary parts list to PlateView with preview drawing
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 08:29:30 -04:00
bd2b5ec1db feat(ui): add PreviewPart color to ColorScheme
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 08:28:18 -04:00
ca685ac8ba feat(engine): add public Fill overloads returning List<Part> with progress/cancellation
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 08:27:31 -04:00
93fbe1a9f8 feat(engine): add FindBestFill and FillWithPairs overloads with progress and cancellation
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 08:26:32 -04:00
a97477fcdf feat(engine): add NestPhase enum and NestProgress data model
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 08:24:55 -04:00
4da5e3fc89 docs: add nesting progress window implementation plan
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 08:20:52 -04:00
5f72f5712e docs: address spec review feedback for nesting progress window
Clarify engine return type ownership, cancellation propagation into
parallel loops, quantity decrement sequencing, conditional phase
behavior, plate navigation lockout, and MDI child close handling.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 08:08:14 -04:00
5f64130b9d docs: add nesting progress window design spec
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 08:05:11 -04:00
09fc8b889e fix: close polygon offset shape and handle nest template load failure
Shape.OffsetEntity computed joins between consecutive offset segments
but never joined the last segment back to the first, leaving the
closing corner with a straight line instead of a proper miter/arc.
Track the first entity and apply the same join logic after the loop.

Also wrap nest template loading in try-catch so a corrupt template
file doesn't crash the app on startup — falls back to default nest.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 07:37:39 -04:00
2216b8553f docs: add implementation plans for best-fit viewer, pair finding, and .NET 8 migration
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 07:24:45 -04:00
6ed20a6a48 refactor: switch auto-nest from Pack to per-item Fill with explicit quantity tracking
Replace engine.Pack(items) with individual engine.Fill(item) calls so each
drawing is filled independently. Quantity decrements now count parts actually
placed per plate (grouped by drawing) instead of relying on the drawing's
internal remaining counter.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 07:24:42 -04:00
c68139e15e merge: resolve .gitignore conflict, keep both entries
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 07:22:45 -04:00
66b3aeafc1 fix: correct inverted quadrant-to-exit-point mapping in GetExitPoint
The exit point should be the corner farthest from the origin so the
perimeter (cut last) ends near the machine home. The mapping was
backwards — Q1 (origin bottom-left) was returning (0,0) instead of
(w,l).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 23:59:04 -04:00
616575e0ee feat: wire contour re-indexing into ContourCuttingStrategy.Apply()
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-12 23:57:17 -04:00
2b4cb849ba feat: add Shape.ReindexAt(Vector, Entity) for contour reordering
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-12 23:54:54 -04:00
3de44a7293 feat: add Arc.SplitAt(Vector) splitting primitive 2026-03-12 23:53:25 -04:00
b2ff704b73 feat: add Line.SplitAt(Vector) splitting primitive 2026-03-12 23:53:23 -04:00
f7940efe93 docs: fix contour re-indexing spec from review feedback
- Drop Circle.ToArcFrom (zero-sweep problem), keep Circle in shape
  and handle in ConvertShapeToMoves with full-circle ArcMove
- Use point-distance tolerance for Arc.SplitAt instead of angle
  comparison to avoid wrap-around issues at 0/2pi
- Simplify SplitAt return types to non-nullable tuple
- Add ArgumentException guard in ReindexAt
- Add throw for unexpected entity types in ConvertShapeToMoves
- Document absolute coordinate convention and shared references
- Clarify variable names for both replacement sites
2026-03-12 23:45:21 -04:00
6a2f39530f docs: add contour re-indexing design spec 2026-03-12 23:41:30 -04:00
18023cb1cf docs: clarify cutting strategy runs at nest-time, not post-processing
The strategy output (lead-ins, start points, contour ordering) must be
saved in the nest file, so Apply() runs when parts are placed — not
during post-processing.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 23:24:23 -04:00
b4a740a515 Merge branch 'feature/cutting-strategy' into master 2026-03-12 23:20:02 -04:00
441628eff2 feat: add ContourCuttingStrategy orchestrator
Exit point from plate quadrant, nearest-neighbor cutout
sequencing via ShapeProfile + ClosestPointTo, contour type
detection, and normal angle computation.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 23:15:38 -04:00
ac7d90ae17 feat: add CuttingParameters and configuration classes
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 23:13:36 -04:00
459738e373 feat: add Tab hierarchy (4 classes)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 23:13:31 -04:00
b112f70f6a feat: add LeadOut hierarchy (5 classes)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 23:12:09 -04:00
f17db1d2f9 feat: add LeadIn hierarchy (7 classes)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-12 23:07:31 -04:00
9b3cf10222 docs: add cutting strategy implementation plan
20 tasks across 5 chunks: LeadIn hierarchy, LeadOut hierarchy,
Tab hierarchy, configuration classes, and ContourCuttingStrategy
orchestrator.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 22:56:52 -04:00
e14382f2f3 docs: update cutting strategy spec with review fixes
- Rename Angle properties to ApproachAngle (avoid shadowing Math.Angle)
- Arc rotation from contour winding, not hardcoded CW
- Add winding parameter to LeadIn/LeadOut Generate methods
- Add exit point derivation from Plate quadrant
- Add contour re-indexing section (split/reorder at closest point)
- Add ContourType.cs and AssignmentParameters.cs to file structure
- Clarify normal direction convention
- Note SequenceMethod value 6 intentionally skipped (PEP numbering)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 22:48:17 -04:00
cb30c20eb9 docs: add cutting strategy design spec
Lead-in, lead-out, and tab class hierarchy for CNC cutting
approach/exit geometry, using ShapeProfile + ClosestPointTo
for contour sequencing.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 22:43:05 -04:00
e4e1d9b5a3 refactor: rename DefinedShape to ShapeProfile
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 22:19:49 -04:00
0c395421cd chore: add .claude/ to .gitignore
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 22:02:54 -04:00
612b540d9d refactor: rename Size.Height to Size.Length across codebase
"Length" is more natural than "height" for flat plate materials.
Renames the field on OpenNest.Geometry.Size, Box.Height property,
and all references across 38 files.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 22:01:40 -04:00