Commit Graph
2 Commits
Author SHA1 Message Date
ajandClaude Opus 5.5 e011fe8290 refactor: fold duplicated helpers into one shared copy each
Roslyn Bridge's duplicate scan found helpers copied verbatim between
projects, so a fix to one copy could silently miss the other. Each copy
now calls a single implementation with the same body:

- boundary nearest point: ClipperBridge.NearestBoundaryPoint (ErodedPierce,
  ScrapPierceSearch)
- nesting profile of a part: NestLayoutCheck.Profile (CommonLinePair)
- part label points: PartLabels in OpenNest.Desktop (WinForms LayoutPart)
- copied common-line groups: CommonLineGroup.AmongParts (ActionClone,
  PlaceTool)
- shared saved cutting parameters: CuttingParametersSerializer.SharedBy
  (MCP, Console)
- bounding box of boxes: generic BoundingBox.GetBoundingBox<T> (rectangle
  packing items)
- box proximity: Clearance.BoxesWithin (Expander)

Behavior is unchanged: every moved body is identical to the copies it
replaces, so the fill change in Expander and rectangle packing skips the
problem-nest corpus. Core, IO, Desktop and Engine suites and the label,
clone and common-line WinForms tests pass.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-21 17:50:53 -05:00
aj c00ae58ac0 feat(desktop): share the place tool for cut and copied parts
Port the WinForms Clone Parts action as the toolkit-neutral PlaceTool:
copies of the sources follow the pointer by their lower-left corner (a
move to the same screen point is ignored, keeping arrow-key nudges), and
each left click places another copy as one Add Part/Add Parts step.
Shift settles toward the quadrant corner on geometry, Ctrl alone on
bounding boxes, reading the placement order at each click. Copied
common-line groups are joined again among the copies and cut-offs are
rebuilt. Delete removes the sources plus selected plate parts in one
Delete step, recorded (and cut-offs rebuilt) only when any were on the
plate. Settling runs before the step opens, so a failure there leaves
nothing to roll back; the copy does not follow the pointer while edits
are locked, as WinForms raises no mouse move then.

PlateClipboard.Copy/Cut start the tool with the selected parts; Cut then
removes the sources as one Cut step without rebuilding cut-offs, as
WinForms does.

While placing, PlateEdits nudges, steps, pushes and rotates the previews
instead of the selection. Unlike WinForms, which records an empty undo
step there, these edits open no undo step, and they never rebuild
cut-offs since the previews are not on the plate.
2026-11-17 16:11:14 -05:00