mirror of
https://github.com/ajisaacs/OpenNest.git
synced 2026-11-25 15:47:40 -05:00
Slug slices ran along the grid's rows and columns of points, so every slice cut over the support points and into the grid. They now run midway between the rows and between the columns, half a pitch from every point. Slat beds still slice along slat center lines. A part's slices were all cut before any of its contours, leaving a slug sliced while the head cut other cutouts. Each cutout's slices are now emitted directly before that cutout. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
26 lines
1.2 KiB
C#
26 lines
1.2 KiB
C#
using System.Collections.Generic;
|
|
using System.Threading;
|
|
using OpenNest.CNC.CuttingPlanning;
|
|
using OpenNest.Geometry;
|
|
|
|
namespace OpenNest.Engine.CuttingPlanning;
|
|
|
|
/// <summary>
|
|
/// Capture-time slug slices for one regenerated part (docs/support-tabs.md#slug-slices): with
|
|
/// <see cref="CNC.CuttingStrategy.CuttingParameters.SliceTippingSlugs"/> on and a support bed,
|
|
/// the slug of each cutout the bed cannot hold level is sliced along the bed's slice lines
|
|
/// before the cutout is cut (<see cref="PreparedContours.WithSlugSlices"/>).
|
|
/// </summary>
|
|
internal static class SlugSliceCapture
|
|
{
|
|
internal static PreparedContours Prepare(PreparedContours prepared, Vector location, CuttingPlanRequest request,
|
|
IReadOnlyList<Box> partBoxes, CancellationToken token)
|
|
{
|
|
if (prepared == null || request.ConfirmedParameters?.SliceTippingSlugs != true || request.SupportBed == null)
|
|
return prepared;
|
|
token.ThrowIfCancellationRequested();
|
|
// A cutout's box can never hold its own part's box, so every part's box may be passed.
|
|
return prepared.WithSlugSlices(request.SupportBed, request.SupportQuadrant, location, partBoxes, token);
|
|
}
|
|
}
|