Add per-entity IsVisible flag and wire up the Colors and Line Types
checkedlistboxes to filter entities by exclusion — checking an item
hides matching entities from the preview and from drawing export.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
GPU factory logic belongs with the GPU implementation, not the UI.
Changed from internal to public and updated namespace to OpenNest.Gpu.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Move BuildPairParts to BestFitResult.BuildParts() instance method
- Extract BinConverter (RectanglePacking) for Part/NestItem/Bin conversions
- Extract RotationAnalysis for FindBestRotation and FindHullEdgeAngles
NestEngine reduced from 484 to 287 lines — now purely orchestration,
strategy selection, and comparison logic.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Fill(NestItem) and Fill(List<Part>) now delegate to their Box overloads
- Add Part.CreateAtOrigin() to replace repeated 4-line build-at-origin pattern
used in NestEngine, RotationSlideStrategy, and PairEvaluator
- Remove dead code: FillArea overloads, Fill(NestItem, int), FillWithPairs(NestItem),
ConvertTileResultToParts, PackBottomLeft.FindPointHorizontal, Pattern.GetLines/GetOffsetLines,
unused count variable in FillNoRotation
- Simplify IsBetterValidFill to delegate to IsBetterFill after overlap check
NestEngine reduced from 717 to 484 lines.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Consolidates two nearly-identical grid generation methods into a single
FillGrid method with a columnMajor parameter. Fixes bug in HPattern
where inner loop used rows instead of columns, and fixes FillNoRotation
silently discarding results by not adding them to Bin.Items.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace grid-cell-based dimensions with geometry-aware computation using
convex hull and rotating calipers to determine minimum bounding rectangle
for valid pair candidates. Overlap results now short-circuit with zeroed
metrics instead of using stale grid dimensions.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
FindPatternCopyDistance now checks every pair of parts across adjacent
patterns so that multi-part patterns (e.g. interlocking pairs) maintain
correct spacing between ALL parts, not just the bounding boxes. The
original single-part logic is preserved as a fast path.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Remove IsBetterValidFill overlap gate for FillLinear results; the
geometry-aware spacing in FillLinear is sufficient and the overlap
check produced false positives on parts with arcs/curves, causing
valid grid layouts to be rejected in favor of inferior pair fills.
- Add FillRectangleBestFit strategy that uses BestCombination to mix
normal and rotated orientations, filling remnant strips for higher
part counts on rectangular parts.
- All Fill overloads now compare linear, rectangle best-fit, and
pair-based strategies, picking whichever yields the most parts.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The perpendicular sweep started at perpMin (e.g. -8.75) which with
coarse step sizes never landed on offset=0, missing the perfect
side-by-side and stacked same-orientation patterns for rectangular parts.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Part.Intersects included rapid move geometry (G00 traversals) when
checking for overlaps, causing false positives. The overlap validation
added in 5bebfcb rejected all FillLinear configs, producing 0 parts.
Every other GetShapes caller already filters SpecialLayers.Rapid.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- GpuEvaluatorFactory probes for CUDA/OpenCL devices at startup
- Status bar shows "GPU : <device name>" (green) or "GPU : None (CPU)" (gray)
- Factory skips GPU evaluator creation entirely when no device found
- Logs actual exception message on failure for debugging
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Introduces the OpenNest.Gpu class library with ILGPU dependencies and a
PartBitmap class that rasterizes Drawing closed shapes into integer grids
for GPU-based overlap testing. Supports rotation and spacing dilation.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Offset the moving shape's geometry by PartSpacing instead of adding
spacing linearly to the copy distance. This guarantees minimum clearance
in all directions for curved/complex shapes, not just along the slide axis.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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>
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>
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>
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>
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>
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>