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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
- 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
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>
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>
- 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>
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>
"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>
Rename SizeDto.Height to SizeDto.Length so the serialized JSON
uses "width"/"length" which is more natural for plate materials.
The core Size struct still uses Height internally.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>