mirror of
https://github.com/ajisaacs/OpenNest.git
synced 2026-10-11 14:24:13 -04:00
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.
27 lines
995 B
C#
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}."),
|
|
};
|
|
}
|
|
}
|