Files
OpenNest/OpenNest.Engine/Fill/Pattern.cs
AJ Isaacs 0e1e619f0a refactor(engine): move fill and strategy code to dedicated namespaces
Move fill algorithms to OpenNest.Engine.Fill namespace:
FillLinear, FillExtents, PairFiller, ShrinkFiller, Compactor,
RemnantFiller, RemnantFinder, FillScore, Pattern, PatternTiler,
PartBoundary, RotationAnalysis, AngleCandidateBuilder, and
AccumulatingProgress.

Move strategy layer to OpenNest.Engine.Strategies namespace:
IFillStrategy, FillContext, FillStrategyRegistry, FillHelpers,
and all built-in strategy implementations.

Add using directives to all consuming files across Engine, UI,
MCP, and Tests projects.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-18 16:46:11 -04:00

34 lines
692 B
C#

using OpenNest.Geometry;
using System.Collections.Generic;
namespace OpenNest.Engine.Fill
{
public class Pattern
{
public Pattern()
{
Parts = new List<Part>();
}
public List<Part> Parts { get; }
public Box BoundingBox { get; private set; }
public void UpdateBounds()
{
BoundingBox = Parts.GetBoundingBox();
}
public Pattern Clone(Vector offset)
{
var pattern = new Pattern();
foreach (var part in Parts)
pattern.Parts.Add(part.CloneAtOffset(offset));
pattern.UpdateBounds();
return pattern;
}
}
}