Commit Graph

32 Commits

Author SHA1 Message Date
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
aj
f2595d7cba First commit. 2016-05-16 22:09:19 -04:00