mirror of
https://github.com/ajisaacs/OpenNest.git
synced 2026-11-22 04:17:40 -05:00
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>
30 lines
628 B
C#
30 lines
628 B
C#
using OpenNest.Geometry;
|
|
using OpenNest.Math;
|
|
|
|
namespace OpenNest.Engine.RectanglePacking
|
|
{
|
|
internal class Item : Box
|
|
{
|
|
public int Id { get; set; }
|
|
|
|
public bool IsRotated { get; private set; }
|
|
|
|
public void Rotate()
|
|
{
|
|
Generic.Swap(ref Size.Width, ref Size.Length);
|
|
IsRotated = !IsRotated;
|
|
}
|
|
|
|
public object Clone()
|
|
{
|
|
return new Item
|
|
{
|
|
IsRotated = this.IsRotated,
|
|
Location = this.Location,
|
|
Size = this.Size,
|
|
Id = this.Id,
|
|
};
|
|
}
|
|
}
|
|
}
|