refactor: clean up NestEngine — collapse overloads, extract helper, remove dead code
- 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>
This commit is contained in:
@@ -19,26 +19,6 @@ namespace OpenNest
|
||||
BoundingBox = Parts.GetBoundingBox();
|
||||
}
|
||||
|
||||
public List<Line> GetLines(PushDirection facingDirection)
|
||||
{
|
||||
var lines = new List<Line>();
|
||||
|
||||
foreach (var part in Parts)
|
||||
lines.AddRange(Helper.GetPartLines(part, facingDirection));
|
||||
|
||||
return lines;
|
||||
}
|
||||
|
||||
public List<Line> GetOffsetLines(double spacing, PushDirection facingDirection)
|
||||
{
|
||||
var lines = new List<Line>();
|
||||
|
||||
foreach (var part in Parts)
|
||||
lines.AddRange(Helper.GetOffsetPartLines(part, spacing, facingDirection));
|
||||
|
||||
return lines;
|
||||
}
|
||||
|
||||
public Pattern Clone(Vector offset)
|
||||
{
|
||||
var pattern = new Pattern();
|
||||
|
||||
Reference in New Issue
Block a user