Commit Graph

401 Commits

Author SHA1 Message Date
afca2068cc feat: integrate best-fit pair finding into NestEngine.Fill
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 12:03:03 -05:00
955446a2f4 feat: add BestFitFinder orchestrator with hull edge angle strategies
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 11:54:26 -05:00
7a0aac9f59 feat: add BestFitFilter and TileEvaluator for pair filtering and tiling
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 11:51:44 -05:00
2a8b2dfdee feat: add PairEvaluator with overlap detection and rotating calipers
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 11:49:26 -05:00
21e1c959d3 feat: add RotationSlideStrategy with directional push contact algorithm
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 11:45:28 -05:00
86fee08670 feat: add PairCandidate, BestFitResult, and IBestFitStrategy for best-fit pair finding
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 11:42:43 -05:00
b030de77a8 feat: restore previous action on Escape from ActionSelect
Pressing Escape from ActionSelect now restores the previous action
(e.g. ActionClone) instead of staying in Select mode. Adds
ConnectEvents() to the Action base class for action resume support.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 10:51:28 -05:00
0573cb2f6d feat: fill open area and optimize pattern rotation via convex hull
ActionClone.Fill() now computes the largest open rectangle from the
cursor position (trying both vertical and horizontal) and passes it
to the engine, so fills no longer overlap existing parts.

Pattern fills try all convex hull edge angles to find the rotation
that maximizes part count.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 10:51:21 -05:00
0b2100a661 fix: restore SelectedParts after plate switch in ActionClone
SetPlate clears SelectedParts, which broke bounds drawing and rotation
for surviving actions. Add OnPlateChanged hook so ActionClone can
re-populate SelectedParts after a plate switch.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 10:11:22 -05:00
fd778e2fd2 fix: preserve ActionClone across plate switches
SetPlate unconditionally reset the action to ActionSelect, clearing
the clone pattern when switching plates. Add SurvivesPlateChange
virtual property to Action base class so actions can opt in to
persisting across plate changes.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 10:05:13 -05:00
40b40ca4ba feat: unify ActionAddPart into ActionClone and add group fill support
Merge ActionAddPart into ActionClone by adding a Drawing constructor,
eliminating the redundant class. ActionClone now handles both adding
new parts from a drawing and cloning selected part groups. Added
Ctrl+F fill support for groups using FillLinear pattern tiling, and
adopted quadrant-aware push directions from ActionAddPart. Refactored
FillLinear to extract shared helpers and add a Fill(Pattern) overload
for tiling arbitrary part groups across the work area.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 09:56:48 -05:00
5807255931 feat: replace Fill method with geometry-aware FillLinear algorithm
Fill(NestItem) now uses actual part geometry instead of bounding boxes.
Also fixes Fill(NestItem, maxCount) which previously threw NotImplementedException.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 07:53:02 -05:00
5707bff89b feat: rotate selected parts 90° on middle mouse click
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 01:12:03 -05:00
be8b499880 feat: add NestEngine.FillLinear with 4-config rotation/axis optimization
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 01:01:41 -05:00
98818d32e3 feat: add full plate fill with pattern-level geometry-aware tiling
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 00:58:35 -05:00
1193091338 feat: add FillRow method for single-axis geometry-aware fill
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 00:56:44 -05:00
b8d9155cd0 feat: add FillLinear class with geometry-aware copy distance
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 00:54:06 -05:00
f4779b878c feat: add Pattern class for grouping parts with relative positions
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 00:52:11 -05:00
949a9ffc7d chore: remove rotating calipers design plan
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 22:50:27 -05:00
1c8763a201 feat: update FindBestRotation to use rotating calipers algorithm
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 22:49:09 -05:00
a190ed25b4 feat: add RotatingCalipers class with minimum bounding rectangle algorithm
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 22:46:42 -05:00
13e93c3534 feat: add ConvexHull class with Andrew's monotone chain algorithm
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 22:44:04 -05:00
0424d8db20 docs: add rotating calipers design plan
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 22:39:09 -05:00
4d270ae68e fix: remove self-intersecting loops from polygon offset
Polygon offset at concave corners creates geometry that folds back
through itself. Added RemoveSelfIntersections() to Polygon that
detects non-adjacent edge crossings and removes the smaller loop
at each crossing. Applied to both collision detection and rendering.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 22:23:44 -05:00
08b31d0797 fix: stop push at contact boundary and filter edges by direction
RayEdgeDistance returned double.MaxValue for touching vertices (dist ≈ 0),
causing rays from other vertices to hit the far side of stationary parts
and allow movement through obstacles. Now returns 0 when touching so the
distance > 0 check in PushSelected correctly prevents further movement.

Added directional edge filtering using outward normals to discard
back-facing edges before ray checks, reducing line count by ~2/3.
DirectionalDistance now checks both StartPoint and EndPoint per line
to preserve vertices at filtered edge boundaries.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 21:42:40 -05:00
49cc65903d chore: remove obsolete geometry push design plan
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 20:54:24 -05:00
6561b478a5 fix: prevent scientific notation in G-code output
ProgramReader treats 'E' as a code letter, so values like
"6.66E-08" get split into X:"6.66" and E:"-08", corrupting
the parsed coordinate. Use fixed-point format string instead.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 20:54:20 -05:00
1c4015ac62 fix: CadConverter SetRotation ignored rotation parameter
SetRotation always forced CW regardless of the requested rotation,
so cutouts (which should be CCW for kerf-left) were also set to CW.
Now uses the rotation parameter to set the correct winding direction.

Also reverts the Shape.OffsetEntity cutout side inversion since the
correct fix is proper winding from the converter.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 19:41:42 -05:00
af00fa36eb fix: invert offset side for cutouts in Shape.OffsetEntity
Cutouts wind opposite to the perimeter, so using the same OffsetSide
expands holes instead of shrinking them. Invert the side for cutouts
so the offset buffer correctly contracts holes inward.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 19:40:08 -05:00
30429ab955 fix: compensate for inscribed polygon in offset distance
Polygon chords are always inside the actual arc, making the offset
boundary smaller than intended. Add PushChordTolerance to the offset
distance so the polygon conservatively overestimates, ensuring the
real offset geometry never overlaps stationary parts.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 19:37:58 -05:00
64cacf6d17 feat: add View > Draw Offset menu item
Toggles offset geometry visualization from the View menu, matching
the existing Draw Rapids and Draw Bounds menu pattern.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 19:31:55 -05:00
eb7fb097b9 feat: add DrawOffset toggle to PlateView
Shows the offset geometry (PartSpacing buffer) around each part as a
semi-transparent red outline. Toggle via PlateView.DrawOffset property.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 19:28:05 -05:00
28238cc246 feat: adaptive arc segmentation based on chord tolerance
Add SegmentsForTolerance(double) to Arc and Circle that calculates the
minimum segments needed to keep sagitta within the given tolerance.
Add Shape.ToPolygonWithTolerance() that uses it per arc/circle.

Push distance now uses 0.08" chord tolerance instead of a fixed segment
count, giving appropriate resolution for each arc based on its radius.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 18:59:30 -05:00
ec5eff4884 perf: reduce arc segments for push distance calculation
ToPolygon() defaults to 1000 segments per arc, causing ~33k line
segments and O(n*m) slowdown. Use 36 segments (10° resolution) which
is more than sufficient for push distance accuracy.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 18:56:27 -05:00
3931012079 feat: rewrite PushSelected to use polygon directional-distance
Parts now push based on actual cut geometry instead of bounding boxes,
allowing irregular shapes to nestle together with PartSpacing gap.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 18:29:50 -05:00
6332298912 feat: add Helper.DirectionalDistance for polygon-based push
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 18:27:32 -05:00
269c8677f8 feat: add Helper.GetPartLines and GetOffsetPartLines
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 18:25:11 -05:00
26d020ce3d feat: move PushDirection enum to OpenNest.Core
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 18:23:02 -05:00
cc934f96aa Update design doc with full implementation plan
5 tasks: move PushDirection to Core, add GetPartLines helpers,
add DirectionalDistance algorithm, rewrite PushSelected, clean up.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 18:20:54 -05:00
ba7be854ff Add design doc for geometry-based push
Replace bounding-box push with analytical polygon directional-distance
so parts nestle together based on actual cut geometry.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 18:19:00 -05:00
a576d53a68 Update CLAUDE.md to reflect new namespace structure
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 13:05:32 -05:00
e4df9cacd8 Move converters to OpenNest.Converters namespace
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 13:04:46 -05:00
67a66e10fd Move geometry primitives to OpenNest.Geometry namespace
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 13:02:12 -05:00
8d9aebb83f Move math utilities to OpenNest.Math namespace
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 12:51:16 -05:00
2210f60656 Add CLAUDE.md project documentation
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-05 08:16:52 -05:00
ea71978e0d Rename Quantity to DwgQty
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-05 08:16:48 -05:00
255d3962a6 Rename CircularMove to ArcMove
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-05 08:16:43 -05:00
2d956fd3f7 Restructure project layout to flatten directory structure
Move all projects from Source/ to repository root for simpler navigation.
- Remove External/ dependency DLLs (will use NuGet packages)
- Remove Installer/ NSIS script
- Replace PartCollection/PlateCollection with ObservableList
- Add packages.config for NuGet dependencies

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-27 20:29:12 -05:00
AJ
8367d9f400 Highlight completely nested parts. 2021-05-18 09:21:33 -04:00
AJ
4bb092e0e5 Push parts based on quadrant 2021-05-18 07:56:51 -04:00