Files
OpenNest/OpenNest.Tests/CuttingPlanning/ClampZonePreviewTests.cs
T
aj fe7083f4c4 fix(cutting): keep clamp zones on cutting-plan previews
Plan Cutting previews were built without the plate's clamp zones, so
machine clamps disappeared from the canvas while inspecting a proposal.
Copy the plate's immutable zones onto the detached preview; it does not
follow the rail, so it never re-resolves.

Review finding 8, Project Memory 4e5f566d.
2026-10-13 18:15:49 -04:00

23 lines
891 B
C#

using OpenNest.Engine.CuttingPlanning;
namespace OpenNest.Tests.CuttingPlanning;
/// <summary>Machine clamps stay visible on a cutting-plan preview of a clamped plate.</summary>
public class ClampZonePreviewTests
{
[Fact]
public void PreviewCarriesThePlatesClampZones()
{
var plate = BestEffortCuttingPlanTests.Plate(BestEffortCuttingPlanTests.TouchingContours());
plate.SetClampRail(new ClampRail(1.5, 0.625, new[] { 6.0, 21 }));
var proposal = CuttingPlanBatch.Capture([plate], ExplicitContourTests.Parameters(), false).Plan();
var preview = proposal.BuildPreview(0);
Assert.NotNull(preview);
Assert.Equal(plate.ClampZones, preview.ClampZones); // same immutable zones, same order
Assert.Equal(2, preview.ClampZones.Count);
Assert.Null(preview.ClampRail); // a detached display copy never re-resolves
}
}