mirror of
https://github.com/ajisaacs/OpenNest.git
synced 2026-11-22 02:07:40 -05:00
Breakoffs are now picked by their joining line, default to the smaller side as scrap (flippable), and cut that line between tabs on a new Break layer instead of slots. Plan Cutting and Assign Lead-ins enter each cut from the scrap with the nest's internal lead-in, or pierce on the line without one; checks treat break cuts as intentional open cuts that are not material. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
23 lines
842 B
C#
23 lines
842 B
C#
using System.Collections.Generic;
|
|
|
|
namespace OpenNest.CNC.CuttingPlanning;
|
|
|
|
/// <summary>Which motions of an execution cut a break line: its lead-in and its break moves.</summary>
|
|
internal static class BreakCutMotions
|
|
{
|
|
/// <summary>True for every <see cref="LayerType.Break"/> motion and the lead-in run directly before one.</summary>
|
|
internal static bool[] Mask(IReadOnlyList<ExecutionMotion> motions)
|
|
{
|
|
var mask = new bool[motions.Count];
|
|
for (var i = 0; i < motions.Count; i++)
|
|
{
|
|
if (motions[i].Rapid || motions[i].Layer != LayerType.Break)
|
|
continue;
|
|
mask[i] = true;
|
|
for (var lead = i - 1; lead >= 0 && !motions[lead].Rapid && motions[lead].Layer == LayerType.Leadin; lead--)
|
|
mask[lead] = true;
|
|
}
|
|
return mask;
|
|
}
|
|
}
|