mirror of
https://github.com/ajisaacs/OpenNest.git
synced 2026-10-23 15:11:50 -04:00
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.
23 lines
891 B
C#
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
|
|
}
|
|
}
|