Files
OpenNest/OpenNest.Engine/Jobs/PlateNesterFactory.cs
T
aj 0a1d021bf7 refactor(engine): rename the Default engine and fill strategy to Fill
The multi-phase lattice fill (linear, pairs, rectangle best-fit, remainder) is
no longer meant to be the engine used by default, so it gets a name for what
it does. The registry lists it as Fill and maps the old name Default to it;
PlateFillService, PlateNesterFactory and NestJobOptions use Fill, and every
fill-strategy caller still accepts Default. Console --autonest now validates
engine names through NestingEngineRegistry.ResolveName so renamed names work.

Layouts are unchanged: Default and Fill resolve to the same fillers and the
golden layouts pass under the new name.
2026-10-06 12:11:03 -04:00

27 lines
995 B
C#

using System;
using OpenNest.Engine.Jobs.Placement;
namespace OpenNest.Engine.Jobs;
/// <summary>
/// Instance-scoped strategy resolution for the whole-job runner. All four built-in strategies
/// resolve directly to filler-backed plate nesters. Selection is explicit per job; no shared
/// mutable strategy setting is read or modified. Unknown keys reject.
/// </summary>
public static class PlateNesterFactory
{
public static IPlateNester Create(string strategy)
{
ArgumentNullException.ThrowIfNull(strategy);
return strategy switch
{
// "Default" is the strategy's name in earlier releases.
"Fill" or "Default" => new DefaultPlateNester(),
"Strip" => new StripPlateNester(),
"Vertical Remnant" => RemnantPlateNester.Vertical(),
"Horizontal Remnant" => RemnantPlateNester.Horizontal(),
_ => throw new NotSupportedException($"Unknown placement strategy: {strategy}."),
};
}
}