fix(cutting): keep configured tab lead-outs and warn; count every tabbed part as steady

5776fa80 dropped a tabbed outside's lead-out when it would reach the lead-in,
which silently changed the user's cutting settings. The emitter now keeps the
lead-out as configured again. Plan Cutting plans strictly first, as before;
only when that is refused because such a lead-out may cut its tab free does it
plan again keeping the lead-outs. Each affected part gets a "Tab lead-out"
issue (new PostVerificationKind.TabLeadOut), is treated as cut free for later
rapids, and the plan is UNVERIFIED, so applying it needs explicit acceptance.
The short reorder pass never settles for such a plan, so a clean route still
wins. Locked, fixed and posted programs keep the incomplete-check finding.

The "no single tab can steady it" support warnings caused more trouble than
they solved, so a tabbed part now counts as steady wherever its tab is: Plan
Cutting and the pre-post review warn only about a part cut with no tab at
all, and a tabbed part stays crossable once cut instead of being avoided as
one that may tip. Entry choice still prefers the steadiest tab point.

The problem-nest corpus is unchanged except N26-2AM, whose baseline is now
BestEffort with 15 tab lead-out warnings.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
ajandClaude Opus 5.5 committed 2026-11-16 12:34:34 -05:00
1 parent 7894b74cb7
commit e1ccd69291
25 files changed
+349 -327

No files matched your search

@@ -24,6 +24,11 @@ public sealed class ReleasedContourState
private int partContours; private int partContours;
private bool partClosed; private bool partClosed;
/// <summary>Why a lead-out after an open cut is refused when the open-cut proof cannot clear it.</summary>
internal const string LeadOutRetentionMessage =
"A lead-out follows an open cutting contour and may cut through its retention gap. "
+ "Rapid safety for that contour requires manual review.";
public ReleasedContourState() : this(true) { } public ReleasedContourState() : this(true) { }
/// <param name="reportMissingLeadIns">Keep pre-post warnings by default. Planning /// <param name="reportMissingLeadIns">Keep pre-post warnings by default. Planning
@@ -69,8 +74,17 @@ public sealed class ReleasedContourState
/// being open, never become obstacles. /// being open, never become obstacles.
/// </summary> /// </summary>
public IReadOnlyList<PostVerificationFinding> Check(OwnedExecution execution, Vector? arrival, public IReadOnlyList<PostVerificationFinding> Check(OwnedExecution execution, Vector? arrival,
int partNumber, bool cutoff, CancellationToken token = default) => int partNumber, bool cutoff, CancellationToken token = default)
Check(execution, arrival, partNumber, cutoff, null, token).Strict; {
ArgumentNullException.ThrowIfNull(execution);
if (arrival is { } point)
PostVerificationGeometry.Validate(point);
var moves = execution.Motions.ToArray();
moves[0] = moves[0].WithStart(arrival);
var findings = new List<PostVerificationFinding>();
AnalyzeMoves(moves, cutoff, findings, 1, partNumber, token, fixedFindings: new(), raisedFindings: new());
return findings.AsReadOnly();
}
/// <summary> /// <summary>
/// As <see cref="Check(OwnedExecution, Vector?, int, bool, CancellationToken)"/>, but a /// As <see cref="Check(OwnedExecution, Vector?, int, bool, CancellationToken)"/>, but a
@@ -78,11 +92,15 @@ public sealed class ReleasedContourState
/// returned apart: a fixed emission is accepted as given and only reported. The checker /// returned apart: a fixed emission is accepted as given and only reported. The checker
/// state advances exactly as it would without ownership. Crossings made by a rapid with the /// state advances exactly as it would without ownership. Crossings made by a rapid with the
/// head raised are returned apart as well, as Raised: they are the raise's reason, not a fault. /// head raised are returned apart as well, as Raised: they are the raise's reason, not a fault.
/// With <paramref name="settingsLeadOuts"/>, the program was emitted from the cutting settings:
/// a lead-out no fixed emission owns that may cut its tabbed outside free is returned apart as
/// Warnings (<see cref="PostVerificationKind.TabLeadOut"/>), kept as configured and reported,
/// and the part then counts as cut free. Otherwise such a lead-out stays an incomplete check.
/// </summary> /// </summary>
internal (IReadOnlyList<PostVerificationFinding> Strict, IReadOnlyList<PostVerificationFinding> Fixed, internal (IReadOnlyList<PostVerificationFinding> Strict, IReadOnlyList<PostVerificationFinding> Fixed,
IReadOnlyList<PostVerificationFinding> Raised) Check( IReadOnlyList<PostVerificationFinding> Raised, IReadOnlyList<PostVerificationFinding> Warnings) Check(
OwnedExecution execution, Vector? arrival, int partNumber, bool cutoff, Func<int, bool> isFixed, OwnedExecution execution, Vector? arrival, int partNumber, bool cutoff, Func<int, bool> isFixed,
CancellationToken token) CancellationToken token, bool settingsLeadOuts = false)
{ {
ArgumentNullException.ThrowIfNull(execution); ArgumentNullException.ThrowIfNull(execution);
if (arrival is { } point) if (arrival is { } point)
@@ -92,9 +110,10 @@ public sealed class ReleasedContourState
var findings = new List<PostVerificationFinding>(); var findings = new List<PostVerificationFinding>();
var fixedFindings = new List<PostVerificationFinding>(); var fixedFindings = new List<PostVerificationFinding>();
var raisedFindings = new List<PostVerificationFinding>(); var raisedFindings = new List<PostVerificationFinding>();
var warnings = new List<PostVerificationFinding>();
AnalyzeMoves(moves, cutoff, findings, 1, partNumber, token, isFixed, fixedFindings, AnalyzeMoves(moves, cutoff, findings, 1, partNumber, token, isFixed, fixedFindings,
raisedFindings: raisedFindings); raisedFindings: raisedFindings, warnings: settingsLeadOuts ? warnings : null);
return (findings.AsReadOnly(), fixedFindings.AsReadOnly(), raisedFindings.AsReadOnly()); return (findings.AsReadOnly(), fixedFindings.AsReadOnly(), raisedFindings.AsReadOnly(), warnings.AsReadOnly());
} }
/// <summary> /// <summary>
@@ -120,10 +139,13 @@ public sealed class ReleasedContourState
return partClosed ? findings.AsReadOnly() : null; return partClosed ? findings.AsReadOnly() : null;
} }
// warnings: where a configured lead-out that may cut its tabbed outside free is reported (see
// Check); without it, as for programs judged as they are, it stays an incomplete check.
internal void AnalyzeMoves(IReadOnlyList<ExecutionMotion> moves, bool cutoff, internal void AnalyzeMoves(IReadOnlyList<ExecutionMotion> moves, bool cutoff,
List<PostVerificationFinding> findings, int plate, int part, CancellationToken token, List<PostVerificationFinding> findings, int plate, int part, CancellationToken token,
Func<int, bool> isFixed = null, List<PostVerificationFinding> fixedFindings = null, Func<int, bool> isFixed = null, List<PostVerificationFinding> fixedFindings = null,
int contoursBefore = 0, List<PostVerificationFinding> raisedFindings = null) int contoursBefore = 0, List<PostVerificationFinding> raisedFindings = null,
List<PostVerificationFinding> warnings = null)
{ {
var current = new CutGroup(); var current = new CutGroup();
var unfinished = new List<CutGroup>(); var unfinished = new List<CutGroup>();
@@ -135,6 +157,8 @@ public sealed class ReleasedContourState
var leadIns = new List<PostVerificationGeometry.Curve>(); var leadIns = new List<PostVerificationGeometry.Curve>();
CutGroup previous = null; CutGroup previous = null;
var deferred = new List<(List<PostVerificationFinding> Target, int Index, PostVerificationFinding Finding)>(); var deferred = new List<(List<PostVerificationFinding> Target, int Index, PostVerificationFinding Finding)>();
// The lead-outs those findings withheld, with the cut each was added to.
var deferredLeadOuts = new List<(CutGroup Group, PostVerificationGeometry.Curve Curve, bool Fixed)>();
var hasLead = false; var hasLead = false;
var contourNumber = contoursBefore; var contourNumber = contoursBefore;
var inBreakCut = false; var inBreakCut = false;
@@ -218,6 +242,8 @@ public sealed class ReleasedContourState
obstacle.Part, (move.HeadRaised ? "Head-raised" : "Direct") + " XY rapid crosses or touches " obstacle.Part, (move.HeadRaised ? "Head-raised" : "Direct") + " XY rapid crosses or touches "
+ (obstacle.TabMayNotHold + (obstacle.TabMayNotHold
? $"the tabbed outside of part {obstacle.Part}, which its tab may not hold level." ? $"the tabbed outside of part {obstacle.Part}, which its tab may not hold level."
: obstacle.TabCutFree
? $"the tabbed outside of part {obstacle.Part}, whose lead-out may cut its tab free."
: $"completed untabbed contour {obstacle.Contour} of part {obstacle.Part}.")) : $"completed untabbed contour {obstacle.Contour} of part {obstacle.Part}."))
{ {
Location = (start + move.End) * 0.5, Location = (start + move.End) * 0.5,
@@ -246,9 +272,10 @@ public sealed class ReleasedContourState
{ {
// Withheld until the part ends, where the open-cut proof may show it cuts no gap. // Withheld until the part ends, where the open-cut proof may show it cuts no gap.
if (current.Curves.Count > 0 && !PostVerificationGeometry.Closed(current.Curves)) if (current.Curves.Count > 0 && !PostVerificationGeometry.Closed(current.Curves))
Defer(new(PostVerificationKind.Incomplete, plate, part, null, {
"A lead-out follows an open cutting contour and may cut through its retention gap. " + Defer(new(PostVerificationKind.Incomplete, plate, part, null, LeadOutRetentionMessage), owned);
"Rapid safety for that contour requires manual review."), owned); deferredLeadOuts.Add((previous ?? loose, move.Curve, owned));
}
(previous ?? loose).Leads.Add(move.Curve); (previous ?? loose).Leads.Add(move.Curve);
if (previous != null && ReferenceEquals(previous, lastClosed)) if (previous != null && ReferenceEquals(previous, lastClosed))
{ {
@@ -323,6 +350,21 @@ public sealed class ReleasedContourState
&& OpenCutsEncloseNothing(closed, unfinished && OpenCutsEncloseNothing(closed, unfinished
.Concat(otherOpen.Where(group => !CutsOnlySlug(group, closed, unfinished, token))) .Concat(otherOpen.Where(group => !CutsOnlySlug(group, closed, unfinished, token)))
.Append(loose).ToList(), token)); .Append(loose).ToList(), token));
// A tabbed outside whose configured lead-out the proof cannot clear: the lead-out may run
// over the tab gap into the lead-in and cut the part free. The lead-out is kept as
// configured and reported, and the part counts as cut free from here on.
var cutFree = warnings != null && !retained && !cutoff && !member && unfinished.Count == 1
&& deferredLeadOuts.Count > 0 && !deferredLeadOuts.Any(lead => lead.Fixed) && !unfinished[0].Fixed
&& IsOutside(unfinished[0], closed);
if (cutFree)
{
deferred.Clear();
warnings.Add(new(PostVerificationKind.TabLeadOut, plate, part, null,
"The lead-out of this tabbed outside runs past its tab gap toward the lead-in and may cut the "
+ "tab free, so the part is treated as cut free. Shorten or turn the lead-out, or enlarge the tab, "
+ "to keep the part in the sheet.")
{ Location = deferredLeadOuts[0].Curve.Start });
}
for (var i = deferred.Count - 1; i >= 0 && !retained; i--) for (var i = deferred.Count - 1; i >= 0 && !retained; i--)
deferred[i].Target.Insert(deferred[i].Index, deferred[i].Finding); deferred[i].Target.Insert(deferred[i].Index, deferred[i].Finding);
// Only one open fragment per part can be the planner's own certified tab, so a // Only one open fragment per part can be the planner's own certified tab, so a
@@ -349,13 +391,13 @@ public sealed class ReleasedContourState
curves.Add(PostVerificationGeometry.Curve.Create(curves[^1].End, curves[0].Start, null, false)); curves.Add(PostVerificationGeometry.Curve.Create(curves[^1].End, curves[0].Start, null, false));
obstacles.Add(new(part, contourNumber, curves, null)); obstacles.Add(new(part, contourNumber, curves, null));
} }
else if (!cutoff && unfinished.Count > 0 && tabMayNotHold?.Invoke(part) == true) else if (!cutoff && unfinished.Count > 0 && (cutFree || tabMayNotHold?.Invoke(part) == true))
{ {
var perimeter = unfinished.MaxBy(chain => chain.Curves.Sum(curve => curve.Length)); var perimeter = unfinished.MaxBy(chain => chain.Curves.Sum(curve => curve.Length));
var curves = perimeter.Curves.ToList(); var curves = perimeter.Curves.ToList();
if (curves[^1].End.DistanceTo(curves[0].Start) > PostVerificationGeometry.Epsilon) if (curves[^1].End.DistanceTo(curves[0].Start) > PostVerificationGeometry.Epsilon)
curves.Add(PostVerificationGeometry.Curve.Create(curves[^1].End, curves[0].Start, null, false)); curves.Add(PostVerificationGeometry.Curve.Create(curves[^1].End, curves[0].Start, null, false));
obstacles.Add(new(part, contourNumber, curves, null) { TabMayNotHold = true }); obstacles.Add(new(part, contourNumber, curves, null) { TabMayNotHold = !cutFree, TabCutFree = cutFree });
} }
partContours = contourNumber; partContours = contourNumber;
partClosed = !cutoff && isFixed == null && unfinished.Count == 0 && deferred.Count == 0 && !reportedTab partClosed = !cutoff && isFixed == null && unfinished.Count == 0 && deferred.Count == 0 && !reportedTab
@@ -445,6 +487,16 @@ public sealed class ReleasedContourState
/// behind the start it enters. A lead that curls into the gap can cut the tab with its kerf /// behind the start it enters. A lead that curls into the gap can cut the tab with its kerf
/// even where its centerline does not touch the next cut. /// even where its centerline does not touch the next cut.
/// </summary> /// </summary>
// Whether the open cut is the part's outside: no closed cut's extent reaches beyond its own.
private static bool IsOutside(CutGroup open, IReadOnlyList<CutGroup> closed)
{
static PostVerificationGeometry.Extent Extent(CutGroup cut) =>
cut.Curves.Aggregate(PostVerificationGeometry.Extent.None, (sum, curve) => sum.Union(curve.Extent));
var outside = Extent(open);
return closed.All(cut => Extent(cut) is var inner && inner.MinX >= outside.MinX && inner.MinY >= outside.MinY
&& inner.MaxX <= outside.MaxX && inner.MaxY <= outside.MaxY);
}
private static bool LeadsClearOpenEnds(CutGroup group) private static bool LeadsClearOpenEnds(CutGroup group)
{ {
var start = group.Curves[0].Start; var start = group.Curves[0].Start;
@@ -627,5 +679,8 @@ public sealed class ReleasedContourState
/// <summary>A tabbed perimeter closed across its tab gap, for a part its tab may not hold level.</summary> /// <summary>A tabbed perimeter closed across its tab gap, for a part its tab may not hold level.</summary>
internal bool TabMayNotHold { get; init; } internal bool TabMayNotHold { get; init; }
/// <summary>A tabbed perimeter closed across its tab gap, whose lead-out may cut the tab free.</summary>
internal bool TabCutFree { get; init; }
} }
} }
@@ -1,7 +1,6 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using OpenNest.Converters;
using OpenNest.Geometry; using OpenNest.Geometry;
using OpenNest.Math; using OpenNest.Math;
@@ -631,15 +630,9 @@ namespace OpenNest.CNC.CuttingStrategy
Parameters.GetEffectivePierceClearance(), out leadOutNormal); Parameters.GetEffectivePierceClearance(), out leadOutNormal);
} }
var leadInCodes = leadIn.Generate(point, leadInNormal, turn); program.Codes.AddRange(leadIn.Generate(point, leadInNormal, turn));
program.Codes.AddRange(leadInCodes);
program.Codes.AddRange(ConvertShapeToMoves(reindexedShape, point)); program.Codes.AddRange(ConvertShapeToMoves(reindexedShape, point));
var leadOutCodes = leadOut.Generate(leadOutPoint, leadOutNormal, turn); var leadOutCodes = leadOut.Generate(leadOutPoint, leadOutNormal, turn);
// A run-out angled toward the tab can reach the lead-in on the tab's far side, and the
// two cuts then sever the tab: the cut stops at its tab instead.
if (tabbed && Parameters.TabConfig.Size > Tolerance.Epsilon
&& LeadsMeet(leadInCodes, point, leadOutCodes, leadOutPoint, Parameters.Kerf))
leadOutCodes = [];
program.Codes.AddRange(leadOutCodes); program.Codes.AddRange(leadOutCodes);
return contourType != ContourType.External && leadOutCodes.Count > 0; return contourType != ContourType.External && leadOutCodes.Count > 0;
} }
@@ -1057,60 +1050,6 @@ namespace OpenNest.CNC.CuttingStrategy
return true; return true;
} }
/// <summary>
/// Whether a tabbed outside's lead-out, leaving from <paramref name="leadOutStart"/>,
/// touches its lead-in, which enters at <paramref name="entry"/>, or passes within
/// <paramref name="kerf"/> of it. Either way the two cuts close across the tab gap
/// and cut the part free.
/// </summary>
private static bool LeadsMeet(List<ICode> leadInCodes, Vector entry, List<ICode> leadOutCodes,
Vector leadOutStart, double kerf)
{
var leadIn = LeadEntities(leadInCodes, entry);
var leadOut = LeadEntities(leadOutCodes, leadOutStart);
if (leadIn.Count == 0 || leadOut.Count == 0)
return false;
var reach = double.IsFinite(kerf) && kerf > 0 ? kerf : 0;
foreach (var cut in leadOut)
{
foreach (var lead in leadIn)
{
if (Crosses(cut, lead) || reach > 0 && (Near(cut, lead) || Near(lead, cut)))
return true;
}
}
return false;
static bool Crosses(Entity a, Entity b) => b switch
{
Line line => a.Intersects(line),
Arc arc => a.Intersects(arc),
_ => false,
};
bool Near(Entity a, Entity b) =>
Ends(a).Any(end => b.ClosestPointTo(end).DistanceTo(end) < reach - Tolerance.Epsilon);
}
// A lead's cutting motions as entities; a lead-in starts at its own rapid to the pierce.
private static List<Entity> LeadEntities(List<ICode> codes, Vector start)
{
var program = new Program(Mode.Absolute);
if (codes.Count == 0 || codes[0] is not RapidMove)
program.Codes.Add(new RapidMove(start));
program.Codes.AddRange(codes);
return ConvertProgram.ToGeometry(program)
.Where(e => e.Layer != SpecialLayers.Rapid && e is Line or Arc)
.ToList();
}
private static IEnumerable<Vector> Ends(Entity entity) => entity switch
{
Line line => [line.StartPoint, line.EndPoint],
Arc arc => [arc.StartPoint(), arc.EndPoint()],
_ => [],
};
private static Vector EntityEndPoint(Entity entity) private static Vector EntityEndPoint(Entity entity)
{ {
if (entity is Line line) if (entity is Line line)
+15 -25
View File
@@ -44,11 +44,11 @@ internal static class PartSupportReview
} }
if (support.IsSupported) if (support.IsSupported)
continue; continue;
var tab = OutsideTab(ExecutionMotionReader.Read(part.Program, part.Location, null, token)); // A tabbed part counts as steady wherever its tab is.
if (tab is { } point && support.IsSteadiedByTabAt(point)) if (OutsideTab(ExecutionMotionReader.Read(part.Program, part.Location, null, token)) != null)
continue; continue;
findings.Add(new(PostVerificationKind.PartSupport, plateNumber, partNumber, null, findings.Add(new(PostVerificationKind.PartSupport, plateNumber, partNumber, null,
Message(support, tab)) Message(support))
{ Location = support.CenterOfGravity }); { Location = support.CenterOfGravity });
} }
catch (Exception exception) when (exception is ArgumentException or InvalidOperationException catch (Exception exception) when (exception is ArgumentException or InvalidOperationException
@@ -100,32 +100,22 @@ internal static class PartSupportReview
return (first + last) * 0.5; return (first + last) * 0.5;
} }
private static string Message(PartSupport support, Vector? tab) private static string Message(PartSupport support)
{ {
// Without a bed, or for a part its tab alone holds, any tab steadies the part, so the only var held = !support.HasBed
// failure is no tab at all. ? FormattableString.Invariant($"is {support.Width:0.####} wide, in the width range tabbed by size,")
if (!support.HasBed || support.IsHeldByTab) : support.IsHeldByTab
return (support.HasBed ? FormattableString.Invariant($"is {support.Length:0.####} long, short enough for its tab alone to hold,")
? FormattableString.Invariant( : support.Margin == double.NegativeInfinity
$"The part is {support.Length:0.####} long, short enough for its tab alone to hold, ")
: FormattableString.Invariant(
$"The part is {support.Width:0.####} wide, in the width range tabbed by size, "))
+ "and it has no tab; it may tip once cut free."
+ (support.BestTabPoint is { } suggested
? FormattableString.Invariant($" Tab it near ({suggested.X:0.####}, {suggested.Y:0.####}).")
: "");
var held = support.Margin == double.NegativeInfinity
? "rests on no support contact" ? "rests on no support contact"
: support.Margin < 0 : support.Margin < 0
? FormattableString.Invariant($"has its center of gravity {-support.Margin:0.####} outside its support contacts") ? FormattableString.Invariant($"has its center of gravity {-support.Margin:0.####} outside its support contacts")
: FormattableString.Invariant($"has its center of gravity only {support.Margin:0.####} inside its support contacts"); : FormattableString.Invariant($"has its center of gravity only {support.Margin:0.####} inside its support contacts");
var tabText = tab is { } point var needs = support.HasBed && !support.IsHeldByTab
? FormattableString.Invariant($"its tab at ({point.X:0.####}, {point.Y:0.####}) does not steady it") ? FormattableString.Invariant($" (needs {support.RequiredMargin:0.####})") : "";
: "it has no tab"; return $"The part {held}{needs} and it has no tab; it may tip once cut free."
var best = support.BestTabPoint is { } bestPoint && support.TabCanSupport + (support.BestTabPoint is { } suggested
? FormattableString.Invariant($" A tab near ({bestPoint.X:0.####}, {bestPoint.Y:0.####}) would.") ? FormattableString.Invariant($" Tab it near ({suggested.X:0.####}, {suggested.Y:0.####}).")
: " No single tab can steady it."; : "");
return FormattableString.Invariant($"The part {held} (needs {support.RequiredMargin:0.####}) and {tabText}; ")
+ "it may tip once cut free." + best;
} }
} }
@@ -58,7 +58,13 @@ public enum PostVerificationKind
/// A common-line group (see docs/common-line-cutting.md) no longer shares its spans one kerf /// A common-line group (see docs/common-line-cutting.md) no longer shares its spans one kerf
/// apart, was placed for another kerf, or a member's lead runs into its partner. /// apart, was placed for another kerf, or a member's lead runs into its partner.
/// </summary> /// </summary>
CommonLine CommonLine,
/// <summary>
/// A tabbed outside's configured lead-out crosses its lead-in, or meets it past the tab gap, so
/// it may cut the tab free (see docs/support-tabs.md). The lead-out is kept as configured.
/// </summary>
TabLeadOut
} }
/// <summary>Plate and part numbers are one-based; plate zero denotes a whole-post limitation.</summary> /// <summary>Plate and part numbers are one-based; plate zero denotes a whole-post limitation.</summary>
@@ -116,6 +122,8 @@ public sealed class PostVerificationReport
Summary(PostVerificationKind.EdgeSpacing, "Outside work area"); Summary(PostVerificationKind.EdgeSpacing, "Outside work area");
if (Findings.Any(finding => finding.Kind == PostVerificationKind.CommonLine)) if (Findings.Any(finding => finding.Kind == PostVerificationKind.CommonLine))
Summary(PostVerificationKind.CommonLine, "Common lines"); Summary(PostVerificationKind.CommonLine, "Common lines");
if (Findings.Any(finding => finding.Kind == PostVerificationKind.TabLeadOut))
Summary(PostVerificationKind.TabLeadOut, "Tab lead-outs");
foreach (var finding in Findings) foreach (var finding in Findings)
{ {
text.Append(finding.PlateNumber == 0 ? "Post processor" : $"Plate {finding.PlateNumber}"); text.Append(finding.PlateNumber == 0 ? "Post processor" : $"Plate {finding.PlateNumber}");
@@ -58,7 +58,7 @@ internal static class CutOffInsertion
var placement = planned[gap]; var placement = planned[gap];
states[gap + 1] = states[gap].Copy(); states[gap + 1] = states[gap].Copy();
states[gap + 1].Check(placement.Execution, arrivals[gap], placement.SourceOrdinal + 1, states[gap + 1].Check(placement.Execution, arrivals[gap], placement.SourceOrdinal + 1,
placement.IsCutOff, placement.FixedMotions(placement.Execution), token); placement.IsCutOff, placement.FixedMotions(placement.Execution), token, snapshot.WarnsTabLeadOuts(placement));
arrivals[gap + 1] = placement.Execution.DeparturePoint; arrivals[gap + 1] = placement.Execution.DeparturePoint;
} }
var position = new Dictionary<int, int>(); var position = new Dictionary<int, int>();
@@ -91,7 +91,8 @@ internal static class CutOffInsertion
{ {
var next = planned[gap]; var next = planned[gap];
var findings = states[gap].Copy().Check(next.Execution, cut.Execution.DeparturePoint, var findings = states[gap].Copy().Check(next.Execution, cut.Execution.DeparturePoint,
next.SourceOrdinal + 1, next.IsCutOff, next.FixedMotions(next.Execution), token).Strict; next.SourceOrdinal + 1, next.IsCutOff, next.FixedMotions(next.Execution), token,
snapshot.WarnsTabLeadOuts(next)).Strict;
if (findings.Count != 0) if (findings.Count != 0)
continue; continue;
} }
@@ -264,7 +264,10 @@ public sealed class CuttingPlanBatch
var first = CuttingPlanService.Plan(snapshot.WithSearchLimits(firstPassBudget, FirstPassEntries), token); var first = CuttingPlanService.Plan(snapshot.WithSearchLimits(firstPassBudget, FirstPassEntries), token);
// A replayed proposal whose only warnings are fixed emissions passed every strict // A replayed proposal whose only warnings are fixed emissions passed every strict
// check; fixed emissions never steer the search, so the full pass cannot improve it. // check; fixed emissions never steer the search, so the full pass cannot improve it.
// A plan keeping tab lead-outs is not taken from the short pass: the full pass may
// still find a clean route.
if (first.IndependentlyReplayed && first.Status is CuttingPlanStatus.Ready or CuttingPlanStatus.BestEffort if (first.IndependentlyReplayed && first.Status is CuttingPlanStatus.Ready or CuttingPlanStatus.BestEffort
&& !first.Findings.Any(f => f.Kind == PostVerificationKind.TabLeadOut)
|| first.Status == CuttingPlanStatus.Canceled) || first.Status == CuttingPlanStatus.Canceled)
return first; return first;
} }
@@ -510,16 +513,25 @@ public sealed class CuttingPlanProposal
} }
// What an unverified plan whose motions all passed asks the operator to review: its fixed // What an unverified plan whose motions all passed asks the operator to review: its fixed
// lead-ins, parts its support bed cannot hold level, or both. // lead-ins, lead-outs that may cut their tabs free, parts its support bed cannot hold level.
private static (string Headline, string Plate) Unverified(IEnumerable<CuttingPlanPlateResult> plates) private static (string Headline, string Plate) Unverified(IEnumerable<CuttingPlanPlateResult> plates)
{ {
var kinds = plates.SelectMany(p => p.Result.Findings).Select(f => f.Kind).Where(k => k != null).ToHashSet(); var kinds = plates.SelectMany(p => p.Result.Findings).Select(f => f.Kind).Where(k => k != null).ToHashSet();
return kinds.Count == 1 && kinds.Contains(PostVerificationKind.PartSupport) var named = new[] { PostVerificationKind.TabLeadOut, PostVerificationKind.PartSupport };
? ("a part may tip once cut free.", "a part may tip once cut free.") var reasons = new List<(string Headline, string Plate)>();
: kinds.Contains(PostVerificationKind.PartSupport) if (kinds.Any(k => !named.Contains(k.Value)) || !kinds.Overlaps(named.Cast<PostVerificationKind?>()))
? ("fixed lead-ins could not be certified, and a part may tip once cut free.", reasons.Add(("fixed lead-ins could not be certified", "fixed lead-ins need review"));
"fixed lead-ins need review, and a part may tip once cut free.") if (kinds.Contains(PostVerificationKind.TabLeadOut))
: ("fixed lead-ins could not be certified.", "fixed lead-ins need review."); reasons.Add(("a lead-out may cut its tab free", "a lead-out may cut its tab free"));
if (kinds.Contains(PostVerificationKind.PartSupport))
reasons.Add(("a part may tip once cut free", "a part may tip once cut free"));
return (Join(reasons.Select(r => r.Headline)), Join(reasons.Select(r => r.Plate)));
static string Join(IEnumerable<string> parts)
{
var list = parts.ToList();
return (list.Count == 1 ? list[0] : string.Join(", ", list.Take(list.Count - 1)) + ", and " + list[^1]) + ".";
}
} }
private static IEnumerable<string> DescribePlate(CuttingPlanPlateResult plate, string unit, string changeSettings) private static IEnumerable<string> DescribePlate(CuttingPlanPlateResult plate, string unit, string changeSettings)
@@ -87,23 +87,14 @@ public sealed class CuttingPlanSnapshot
PreservePartOrder = preservePartOrder; PreservePartOrder = preservePartOrder;
MaxEntries = maxEntries; MaxEntries = maxEntries;
ExpansionObserver = expansionObserver; ExpansionObserver = expansionObserver;
tabMayNotHold = Placements
.Where(p => p.Prepared is { Support.TabCanSupport: false, PerimeterTabbed: true })
.Select(p => p.SourceOrdinal + 1).ToHashSet();
} }
// Part numbers (source ordinal + 1, as every checker is keyed) of support-tabbed parts that no
// single tab can steady.
private readonly HashSet<int> tabMayNotHold;
/// <summary> /// <summary>
/// An empty rapid checker for this capture. A support-tabbed part no single tab can steady may /// An empty rapid checker for this capture. A tabbed part counts as steady once cut, so
/// tip once cut, so its tabbed outside is an obstacle from then on, as an untabbed one is; /// rapids may cross it as its retained material allows.
/// rapids may still cross parts their tab holds level.
/// </summary> /// </summary>
internal ReleasedContourState NewReleasedState() => internal ReleasedContourState NewReleasedState() =>
new(reportMissingLeadIns: false, tabMayNotHold.Count == 0 ? null : tabMayNotHold.Contains, new(reportMissingLeadIns: false, null, CommonLineMembers.Count == 0 ? null : CommonLineMembers.Contains);
CommonLineMembers.Count == 0 ? null : CommonLineMembers.Contains);
/// <summary> /// <summary>
/// Part numbers (source ordinal + 1) of the members of common-line groups cut once /// Part numbers (source ordinal + 1) of the members of common-line groups cut once
@@ -154,8 +145,31 @@ public sealed class CuttingPlanSnapshot
SupportTabsSkipped = SupportTabsSkipped, SupportTabsSkipped = SupportTabsSkipped,
CommonLineMembers = CommonLineMembers, CommonLineMembers = CommonLineMembers,
CommonLineOrder = CommonLineOrder, CommonLineOrder = CommonLineOrder,
AcceptsTabLeadOuts = AcceptsTabLeadOuts,
}; };
/// <summary>
/// The same capture planned again accepting tab lead-outs: a regenerated tabbed outside whose
/// configured lead-out may cut its tab free is kept, warned about
/// (<see cref="PostVerificationKind.TabLeadOut"/>) and counted as cut free, instead of refused.
/// </summary>
internal CuttingPlanSnapshot WithTabLeadOuts() =>
new(Placements, StartPoint, ExpansionBudget, Failure, Findings, Regeneration,
PreservePartOrder, MaxEntries, ExpansionObserver, PlateState, OwnedParameters,
Dependencies, BestEffort)
{
SupportTabsSkipped = SupportTabsSkipped,
CommonLineMembers = CommonLineMembers,
CommonLineOrder = CommonLineOrder,
AcceptsTabLeadOuts = true,
};
/// <summary>Whether this capture accepts tab lead-outs (see <see cref="WithTabLeadOuts"/>).</summary>
internal bool AcceptsTabLeadOuts { get; init; }
/// <summary>Whether the checker may report <paramref name="placement"/>'s tab lead-outs as warnings.</summary>
internal bool WarnsTabLeadOuts(FixedProgramPlacement placement) => AcceptsTabLeadOuts && placement.Prepared != null;
/// <summary>The same capture planned along its current part order.</summary> /// <summary>The same capture planned along its current part order.</summary>
internal CuttingPlanSnapshot WithPreservedOrder() => internal CuttingPlanSnapshot WithPreservedOrder() =>
new(Placements, StartPoint, ExpansionBudget, Failure, Findings, Regeneration, new(Placements, StartPoint, ExpansionBudget, Failure, Findings, Regeneration,
@@ -165,6 +179,7 @@ public sealed class CuttingPlanSnapshot
SupportTabsSkipped = SupportTabsSkipped, SupportTabsSkipped = SupportTabsSkipped,
CommonLineMembers = CommonLineMembers, CommonLineMembers = CommonLineMembers,
CommonLineOrder = CommonLineOrder, CommonLineOrder = CommonLineOrder,
AcceptsTabLeadOuts = AcceptsTabLeadOuts,
}; };
} }
@@ -292,6 +292,22 @@ public static class CuttingPlanService
{ {
var result = PlanCaptured(snapshot, token); var result = PlanCaptured(snapshot, token);
result.Snapshot = snapshot; result.Snapshot = snapshot;
// Refused only for configured lead-outs that may cut their tabs free: plan again keeping
// them as warnings, since the settings give no other lead-out. A clean plan always wins.
if (snapshot is { AcceptsTabLeadOuts: false, Regeneration: true }
&& result.Status is CuttingPlanStatus.NoSolutionWithinBudget or CuttingPlanStatus.ConstraintConflict
or CuttingPlanStatus.UnsupportedGeometry
&& result.Findings.Any(f => f.Kind == PostVerificationKind.Incomplete
&& f.Message == ReleasedContourState.LeadOutRetentionMessage))
{
var relaxed = snapshot.WithTabLeadOuts();
var retry = PlanCaptured(relaxed, token);
if (retry.Status is CuttingPlanStatus.Ready or CuttingPlanStatus.BestEffort or CuttingPlanStatus.Canceled)
{
retry.Snapshot = relaxed;
return retry;
}
}
return result; return result;
} }
@@ -528,12 +544,14 @@ public static class CuttingPlanService
findings: [JointCuttingPlanSearch.Finding(source, PostVerificationKind.Incomplete, ex.Message)], expansions: expansions); findings: [JointCuttingPlanSearch.Finding(source, PostVerificationKind.Incomplete, ex.Message)], expansions: expansions);
} }
var isFixed = proposal.FixedMotions(execution); var isFixed = proposal.FixedMotions(execution);
var (strict, fixedFindings, raised) = checker.Check(execution, position, source.SourceOrdinal + 1, var (strict, fixedFindings, raised, tabLeadOuts) = checker.Check(execution, position,
source.IsCutOff, isFixed, token); source.SourceOrdinal + 1, source.IsCutOff, isFixed, token, snapshot.WarnsTabLeadOuts(source));
raises.AddRange(RaisedRapids.Notes(snapshot, source, raised)); raises.AddRange(RaisedRapids.Notes(snapshot, source, raised));
raisedRapids += RaisedRapids.Count(raised); raisedRapids += RaisedRapids.Count(raised);
findings.AddRange(JointCuttingPlanSearch.Map(snapshot, strict)); findings.AddRange(JointCuttingPlanSearch.Map(snapshot, strict));
warnings.AddRange(fixedFindings.Select(f => FixedLeadWarnings.FromChecker(snapshot, source, f))); warnings.AddRange(fixedFindings.Select(f => FixedLeadWarnings.FromChecker(snapshot, source, f)));
// A configured lead-out that cuts its tab free is kept and reported, never refused.
warnings.AddRange(JointCuttingPlanSearch.Map(snapshot, tabLeadOuts));
var fixedLeads = new List<FixedLeadFailure>(); var fixedLeads = new List<FixedLeadFailure>();
var lead = source.IsCutOff ? new LeadPathValidationResult(true, true, null) var lead = source.IsCutOff ? new LeadPathValidationResult(true, true, null)
: LeadPathValidator.Check(execution, source.Material, materials, isFixed, fixedLeads, token, : LeadPathValidator.Check(execution, source.Material, materials, isFixed, fixedLeads, token,
@@ -1733,7 +1733,8 @@ internal static class JointCuttingPlanSearch
ReleasedContourState checker, IReadOnlyList<ContourChoice> choices = null) ReleasedContourState checker, IReadOnlyList<ContourChoice> choices = null)
{ {
var isFixed = source.FixedMotions(execution, choices); var isFixed = source.FixedMotions(execution, choices);
var findings = checker.Check(execution, arrival, source.SourceOrdinal + 1, source.IsCutOff, isFixed, token).Strict; var findings = checker.Check(execution, arrival, source.SourceOrdinal + 1, source.IsCutOff, isFixed, token,
snapshot.WarnsTabLeadOuts(source)).Strict;
var lead = source.IsCutOff ? new LeadPathValidationResult(true, true, null) var lead = source.IsCutOff ? new LeadPathValidationResult(true, true, null)
: LeadPathValidator.Check(execution, source.Material, materials, isFixed, [], token, leadContacts, : LeadPathValidator.Check(execution, source.Material, materials, isFixed, [], token, leadContacts,
snapshot.PierceZoneRadius); snapshot.PierceZoneRadius);
@@ -1753,7 +1754,8 @@ internal static class JointCuttingPlanSearch
// violations neither reject this candidate nor teach an order rule. Final replay // violations neither reject this candidate nor teach an order rule. Final replay
// reports them as warnings. Every planner-chosen motion stays strict. // reports them as warnings. Every planner-chosen motion stays strict.
var isFixed = source.FixedMotions(execution, choices); var isFixed = source.FixedMotions(execution, choices);
var findings = checker.Check(execution, arrival, source.SourceOrdinal + 1, source.IsCutOff, isFixed, token).Strict; var findings = checker.Check(execution, arrival, source.SourceOrdinal + 1, source.IsCutOff, isFixed, token,
snapshot.WarnsTabLeadOuts(source)).Strict;
rejected.AddRange(Map(snapshot, findings)); rejected.AddRange(Map(snapshot, findings));
attempt.NoteCrossings(source.SourceOrdinal, findings); attempt.NoteCrossings(source.SourceOrdinal, findings);
// A fixed cutoff has no material or leads to certify; its rapids are still checked. // A fixed cutoff has no material or leads to certify; its rapids are still checked.
@@ -36,7 +36,7 @@ internal static class RaisedRapids
var execution = ExecutionMotionReader.Read(program, proposal.Location, position, token); var execution = ExecutionMotionReader.Read(program, proposal.Location, position, token);
var placement = proposal; var placement = proposal;
var rapids = proposal.Prepared == null || proposal.IsCutOff ? [] var rapids = proposal.Prepared == null || proposal.IsCutOff ? []
: Crossing(checker.Copy(), proposal, execution, position, token); : Crossing(checker.Copy(), proposal, execution, position, snapshot.WarnsTabLeadOuts(proposal), token);
if (rapids.Count != 0) if (rapids.Count != 0)
{ {
var raised = HeadRaise.Mark(program, rapids); var raised = HeadRaise.Mark(program, rapids);
@@ -44,7 +44,7 @@ internal static class RaisedRapids
placement = proposal.Propose(raised, execution, proposal.ContourChoices, token); placement = proposal.Propose(raised, execution, proposal.ContourChoices, token);
} }
checker.Check(execution, position, proposal.SourceOrdinal + 1, proposal.IsCutOff, checker.Check(execution, position, proposal.SourceOrdinal + 1, proposal.IsCutOff,
proposal.FixedMotions(execution), token); proposal.FixedMotions(execution), token, snapshot.WarnsTabLeadOuts(proposal));
marked.Add(placement); marked.Add(placement);
position = execution.DeparturePoint; position = execution.DeparturePoint;
} }
@@ -54,10 +54,11 @@ internal static class RaisedRapids
// The own-code indices of the planner's rapids that cross parts already cut: the rapid itself, // The own-code indices of the planner's rapids that cross parts already cut: the rapid itself,
// or the call of the sub-program the rapid arrives at. // or the call of the sub-program the rapid arrives at.
private static HashSet<int> Crossing(ReleasedContourState checker, FixedProgramPlacement proposal, private static HashSet<int> Crossing(ReleasedContourState checker, FixedProgramPlacement proposal,
OwnedExecution execution, Vector arrival, CancellationToken token) OwnedExecution execution, Vector arrival, bool tabLeadOuts, CancellationToken token)
{ {
var isFixed = proposal.FixedMotions(execution); var isFixed = proposal.FixedMotions(execution);
var strict = checker.Check(execution, arrival, proposal.SourceOrdinal + 1, false, isFixed, token).Strict; var strict = checker.Check(execution, arrival, proposal.SourceOrdinal + 1, false, isFixed, token,
tabLeadOuts).Strict;
var codes = new HashSet<int>(); var codes = new HashSet<int>();
foreach (var finding in strict) foreach (var finding in strict)
{ {
@@ -46,7 +46,7 @@ internal static class SupportTabCapture
/// <summary> /// <summary>
/// A note for a planned support-tabbed part whose tab, at its perimeter entry, sits in an /// A note for a planned support-tabbed part whose tab, at its perimeter entry, sits in an
/// inside corner because no lead-in fits clear of one. Advisory: it never refuses or /// inside corner because no lead-in fits clear of one. Advisory: it never refuses or
/// downgrades a plan. A tab that cannot steady its part is <see cref="Review"/>'s warning. /// downgrades a plan. A part cut with no tab at all is <see cref="Review"/>'s warning.
/// </summary> /// </summary>
internal static IEnumerable<CuttingPlanFinding> Notes(FixedProgramPlacement planned) internal static IEnumerable<CuttingPlanFinding> Notes(FixedProgramPlacement planned)
{ {
@@ -64,9 +64,9 @@ internal static class SupportTabCapture
/// <summary> /// <summary>
/// A <see cref="PostVerificationKind.PartSupport"/> warning when a regenerated part its bed /// A <see cref="PostVerificationKind.PartSupport"/> warning when a regenerated part its bed
/// cannot hold level is cut without a tab that keeps it level: its pin has no tab or a tab /// cannot hold level is cut with no tab at all: its drawing pin cuts its outside untabbed.
/// elsewhere, no steadying entry had a lead-in that fits, or no single tab can steady it. /// A tabbed part counts as steady wherever its tab is. Null otherwise. Like other warnings it
/// Null otherwise. Like other warnings it makes the proposal UNVERIFIED. /// makes the proposal UNVERIFIED.
/// </summary> /// </summary>
internal static CuttingPlanFinding Review(FixedProgramPlacement source, IReadOnlyList<ContourChoice> choices) internal static CuttingPlanFinding Review(FixedProgramPlacement source, IReadOnlyList<ContourChoice> choices)
{ {
@@ -76,8 +76,7 @@ internal static class SupportTabCapture
var perimeter = choices.FirstOrDefault(c => c.ContourOrdinal == prepared.PerimeterOrdinal); var perimeter = choices.FirstOrDefault(c => c.ContourOrdinal == prepared.PerimeterOrdinal);
if (perimeter == null) if (perimeter == null)
return null; return null;
var tab = perimeter.Point + prepared.SupportOrigin; if (prepared.PerimeterTabbed)
if (prepared.PerimeterTabbed && support.IsSteadiedByTabAt(tab))
return null; return null;
var part = source.SourceOrdinal + 1; var part = source.SourceOrdinal + 1;
var held = !support.HasBed var held = !support.HasBed
@@ -89,13 +88,7 @@ internal static class SupportTabCapture
: support.Margin < 0 : support.Margin < 0
? FormattableString.Invariant($"has its center of gravity {-support.Margin:0.####} outside its support contacts") ? FormattableString.Invariant($"has its center of gravity {-support.Margin:0.####} outside its support contacts")
: FormattableString.Invariant($"has its center of gravity only {support.Margin:0.####} inside its support contacts"); : FormattableString.Invariant($"has its center of gravity only {support.Margin:0.####} inside its support contacts");
var why = !prepared.PerimeterTabbed var why = $"drawing pin {prepared.PinNumberOf(prepared.PerimeterOrdinal)} cuts its outside without a tab";
? $"drawing pin {prepared.PinNumberOf(prepared.PerimeterOrdinal)} cuts its outside without a tab"
: prepared.IsPinned(prepared.PerimeterOrdinal)
? $"drawing pin {prepared.PinNumberOf(prepared.PerimeterOrdinal)} puts its tab where it does not steady the part"
: support.TabCanSupport
? "no lead-in fits at a point where its tab would steady the part"
: "no single tab can steady it";
var needs = support.HasBed && !support.IsHeldByTab ? FormattableString.Invariant($" (needs {support.RequiredMargin:0.####})") : ""; var needs = support.HasBed && !support.IsHeldByTab ? FormattableString.Invariant($" (needs {support.RequiredMargin:0.####})") : "";
return new CuttingPlanFinding(source.SourceOrdinal, source.SourcePart, null, null, return new CuttingPlanFinding(source.SourceOrdinal, source.SourcePart, null, null,
PostVerificationKind.PartSupport, $"Part {part} {held}{needs} and {why}; it may tip once cut free."); PostVerificationKind.PartSupport, $"Part {part} {held}{needs} and {why}; it may tip once cut free.");
@@ -99,7 +99,7 @@ public class CutoutLeadOutTests
[Fact] [Fact]
public void ARaisedRapidOutOfASlugIsTheDesignedWayOut() public void ARaisedRapidOutOfASlugIsTheDesignedWayOut()
{ {
var (strict, _, raised) = new ReleasedContourState() var (strict, _, raised, _) = new ReleasedContourState()
.Check(SlugExit(raised: true), Vector.Zero, 1, false, null, default); .Check(SlugExit(raised: true), Vector.Zero, 1, false, null, default);
Assert.Empty(strict); Assert.Empty(strict);
@@ -124,7 +124,7 @@ public class CutoutLeadOutTests
program.Codes.Add(new RapidMove(4.2, 2)); program.Codes.Add(new RapidMove(4.2, 2));
var execution = ExecutionMotionReader.Read(program, Vector.Zero, Vector.Zero, default); var execution = ExecutionMotionReader.Read(program, Vector.Zero, Vector.Zero, default);
var (_, _, raised) = new ReleasedContourState().Check(execution, Vector.Zero, 1, false, null, default); var (_, _, raised, _) = new ReleasedContourState().Check(execution, Vector.Zero, 1, false, null, default);
Assert.Contains(raised, f => f.Kind == PostVerificationKind.RapidCrossing); Assert.Contains(raised, f => f.Kind == PostVerificationKind.RapidCrossing);
} }
@@ -94,21 +94,26 @@ public class CuttingPlanMessageTests
Assert.Same(program, part.Program); Assert.Same(program, part.Program);
} }
[Fact] [Fact]
public void Describe_OnlyAnUnsteadyPart_SaysItMayTipNotThatLeadsNeedReview() public void Describe_OnlyTabLeadOuts_SaysALeadOutMayCutItsTabNotThatLeadsNeedReview()
{ {
// Nothing of the grid runs under the strip, so no single tab can hold it level. // Wound counterclockwise and support-tabbed, the strip's 60 degree lead-out runs past its
var plate = new Plate(20, 20) { SupportBed = new OpenNest.Support.SupportGrid(1, 1, 0, 0.9, stabilityMargin: 0.1) }; // 0.03 tab into the lead-in, at every entry.
plate.Parts.Add(new Part(new Drawing("strip", LeadPathValidationTests.Rectangle(0, 0, 10, 0.8)), new Vector(2, 2))); var plate = new Plate(20, 20) { SupportBed = new OpenNest.Support.SupportGrid(2, 4, 0, 2.25, stabilityMargin: 0.1) };
var clean = new OpenNest.CNC.Program(OpenNest.CNC.Mode.Absolute);
clean.MoveTo(0, 0); clean.LineTo(10, 0); clean.LineTo(10, 1); clean.LineTo(0, 1); clean.LineTo(0, 0);
plate.Parts.Add(new Part(new Drawing("strip", clean), new Vector(2, 2)));
var settings = ExplicitContourTests.Parameters(); var settings = ExplicitContourTests.Parameters();
settings.SupportTabs = true; settings.SupportTabs = true;
settings.TabConfig = new NormalTab { Size = 0.2 }; settings.TabConfig = new NormalTab { Size = 0.03 };
settings.ExternalLeadIn = new LineLeadIn { Length = 0.15, ApproachAngle = 60 };
settings.ExternalLeadOut = new LineLeadOut { Length = 0.1, ApproachAngle = 60 };
var proposal = CuttingPlanBatch.Capture([plate], settings, false).Plan(); var proposal = CuttingPlanBatch.Capture([plate], settings, false).Plan();
var text = string.Join("\n", proposal.Describe("in")); var text = string.Join("\n", proposal.Describe("in"));
Assert.True(proposal.RequiresWarningAcceptance, text); Assert.True(proposal.RequiresWarningAcceptance, text);
Assert.StartsWith("Unverified plan available: a part may tip once cut free.", text); Assert.StartsWith("Unverified plan available: a lead-out may cut its tab free.", text);
Assert.Contains("Plate 1: unverified: a part may tip once cut free.", text); Assert.Contains("Plate 1: unverified: a lead-out may cut its tab free.", text);
Assert.DoesNotContain("fixed lead-ins", text); Assert.DoesNotContain("fixed lead-ins", text);
} }
@@ -72,7 +72,7 @@ public class HeadRaisePlanningTests
checker.Check(ExecutionMotionReader.Read(wall, Vector.Zero, null, default), null, 1); checker.Check(ExecutionMotionReader.Read(wall, Vector.Zero, null, default), null, 1);
var execution = ExecutionMotionReader.Read(program, Vector.Zero, new Vector(0, 11), default); var execution = ExecutionMotionReader.Read(program, Vector.Zero, new Vector(0, 11), default);
var (strict, _, raised) = checker.Check(execution, new Vector(0, 11), 2, false, null, default); var (strict, _, raised, _) = checker.Check(execution, new Vector(0, 11), 2, false, null, default);
Assert.True(execution.Motions[0].HeadRaised); Assert.True(execution.Motions[0].HeadRaised);
Assert.Null(execution.Motions[0].Code); Assert.Null(execution.Motions[0].Code);
@@ -133,7 +133,7 @@ public class HeadRaisePlanningTests
checker.Check(ExecutionMotionReader.Read(wall, Vector.Zero, null, default), null, 1); checker.Check(ExecutionMotionReader.Read(wall, Vector.Zero, null, default), null, 1);
var execution = ExecutionMotionReader.Read(rapid, Vector.Zero, new Vector(0, 11), default); var execution = ExecutionMotionReader.Read(rapid, Vector.Zero, new Vector(0, 11), default);
var (strict, _, raised) = checker.Check(execution, new Vector(0, 11), 2, false, null, default); var (strict, _, raised, _) = checker.Check(execution, new Vector(0, 11), 2, false, null, default);
Assert.True(execution.Motions[0].HeadRaised); Assert.True(execution.Motions[0].HeadRaised);
Assert.Equal(1, execution.Motions[0].Code); Assert.Equal(1, execution.Motions[0].Code);
@@ -169,14 +169,15 @@ public class HoleLookAheadTests
var fingerprint = ExplicitContourTests.Fingerprint(part.Program); var fingerprint = ExplicitContourTests.Fingerprint(part.Program);
var result = CuttingPlanService.Plan(new CuttingPlanRequest([part], Start, var result = CuttingPlanService.Plan(new CuttingPlanRequest([part], Start,
confirmedParameters: parameters, preservePartOrder: true)); confirmedParameters: parameters, preservePartOrder: true));
Assert.True(result.Status == CuttingPlanStatus.Ready, Describe(result)); // Tabbed, the arc lead-out may cut through the tab into the lead-in: it is kept as set and warned.
Assert.True(result.Status == (tabs ? CuttingPlanStatus.BestEffort : CuttingPlanStatus.Ready), Describe(result));
Assert.True(result.IndependentlyReplayed); Assert.True(result.IndependentlyReplayed);
Assert.Equal(tabs, result.Findings.Any(f => f.Kind == PostVerificationKind.TabLeadOut));
var actual = result.ProposedOrder[0]; var actual = result.ProposedOrder[0];
Assert.Equal(2, actual.ContourChoices[^1].ContourOrdinal); Assert.Equal(2, actual.ContourChoices[^1].ContourOrdinal);
Assert.Equal(3, actual.ContourChoices.Select(c => c.ContourOrdinal).Distinct().Count()); Assert.Equal(3, actual.ContourChoices.Select(c => c.ContourOrdinal).Distinct().Count());
Assert.Single(actual.Execution.Motions.Where(m => !m.Rapid && m.Layer == LayerType.Scribe)); Assert.Single(actual.Execution.Motions.Where(m => !m.Rapid && m.Layer == LayerType.Scribe));
// The arc lead-out would cut through the tab into the lead-in, so a tabbed outside has none. Assert.Contains(actual.Execution.Motions, m => m.Layer == LayerType.Leadout);
Assert.Equal(!tabs, actual.Execution.Motions.Any(m => m.Layer == LayerType.Leadout));
Assert.Equal(fingerprint, ExplicitContourTests.Fingerprint(part.Program)); Assert.Equal(fingerprint, ExplicitContourTests.Fingerprint(part.Program));
} }
@@ -315,21 +315,29 @@ public class JointCuttingPlanTests
} }
[Fact] [Fact]
public void TabbedArcCandidate_LeadOutThatWouldCutTheTab_IsLeftOutAndPlanned() public void TabbedArcCandidate_LeadOutThatMayCutTheTab_IsRefusedStrictlyThenKeptAndWarned()
{ {
// The arc lead-out would run over the tab gap into the lead-in, so the cut stops at its tab. // The arc lead-out runs over the tab gap into the lead-in. The strict search refuses it;
// planning then keeps the settings' lead-out and warns instead of changing it.
var parameters = ExplicitContourTests.Parameters(); var parameters = ExplicitContourTests.Parameters();
parameters.TabsEnabled = true; parameters.TabConfig = new NormalTab { Size = 0.2 }; parameters.TabsEnabled = true; parameters.TabConfig = new NormalTab { Size = 0.2 };
parameters.ExternalLeadOut = new ArcLeadOut { Radius = 0.2 }; parameters.ExternalLeadOut = new ArcLeadOut { Radius = 0.2 };
var part = new Part(new Drawing("tabbed", LeadPathValidationTests.Rectangle(0, 0, 10, 10))); var part = new Part(new Drawing("tabbed", LeadPathValidationTests.Rectangle(0, 0, 10, 10)));
var result = CuttingPlanService.Plan(new CuttingPlanRequest([part], new Vector(-2, 5), confirmedParameters: parameters)); var request = new CuttingPlanRequest([part], new Vector(-2, 5), confirmedParameters: parameters);
Assert.Equal(CuttingPlanStatus.Ready, result.Status); var strict = JointCuttingPlanSearch.Run(CuttingPlanService.Capture(request), default);
Assert.Equal(CuttingPlanStatus.NoSolutionWithinBudget, strict.Status);
Assert.Contains(strict.Findings, f => f.Kind == PostVerificationKind.Incomplete && f.Message.Contains("retention gap"));
var result = CuttingPlanService.Plan(request);
Assert.Equal(CuttingPlanStatus.BestEffort, result.Status);
Assert.True(result.IndependentlyReplayed); Assert.True(result.IndependentlyReplayed);
Assert.DoesNotContain(Assert.Single(result.ProposedOrder).Execution.Motions, m => m.Layer == LayerType.Leadout); Assert.Equal(PostVerificationKind.TabLeadOut, Assert.Single(result.Findings).Kind);
Assert.Contains(Assert.Single(result.ProposedOrder).Execution.Motions, m => m.Layer == LayerType.Leadout);
} }
[Fact] [Fact]
public void TabbedPerimeter_LeadOutCrossingItsLeadIn_IsRefusedAsCuttingTheRetentionGap() public void TabbedPerimeter_LeadOutCrossingItsLeadIn_IsIncompleteUnlessEmittedFromSettings()
{ {
// Wound counterclockwise, entered at (0, 5) and stopped 0.2 short of it: the lead-out runs // Wound counterclockwise, entered at (0, 5) and stopped 0.2 short of it: the lead-out runs
// forward over the tab gap and crosses the lead-in, cutting the tab free. // forward over the tab gap and crosses the lead-in, cutting the tab free.
@@ -338,8 +346,20 @@ public class JointCuttingPlanTests
program.Codes.Add(new LinearMove(0, 5) { Layer = LayerType.Leadin }); program.Codes.Add(new LinearMove(0, 5) { Layer = LayerType.Leadin });
program.LineTo(0, 0); program.LineTo(10, 0); program.LineTo(10, 10); program.LineTo(0, 10); program.LineTo(0, 5.2); program.LineTo(0, 0); program.LineTo(10, 0); program.LineTo(10, 10); program.LineTo(0, 10); program.LineTo(0, 5.2);
program.Codes.Add(new LinearMove(-0.3, 4.9) { Layer = LayerType.Leadout }); program.Codes.Add(new LinearMove(-0.3, 4.9) { Layer = LayerType.Leadout });
var findings = new ReleasedContourState().Check(Read(program, Vector.Zero), Vector.Zero, 1); var execution = Read(program, Vector.Zero);
var findings = new ReleasedContourState().Check(execution, Vector.Zero, 1);
Assert.Contains(findings, f => f.Kind == PostVerificationKind.Incomplete && f.Message.Contains("retention gap")); Assert.Contains(findings, f => f.Kind == PostVerificationKind.Incomplete && f.Message.Contains("retention gap"));
// Emitted from the settings, the lead-out is a warning and the part counts as cut free.
var checker = new ReleasedContourState(false);
var (strict, _, _, warnings) = checker.Check(execution, Vector.Zero, 1, false, null, default, settingsLeadOuts: true);
Assert.Empty(strict);
Assert.Equal(PostVerificationKind.TabLeadOut, Assert.Single(warnings).Kind);
var across = new Program(Mode.Absolute);
across.Codes.Add(new RapidMove(5, -1));
across.Codes.Add(new RapidMove(5, 11));
Assert.Contains(checker.Check(Read(across, Vector.Zero), new Vector(-0.3, 4.9), 2),
f => f.Kind == PostVerificationKind.RapidCrossing && f.Message.Contains("may cut its tab free"));
} }
[Fact] [Fact]
@@ -92,7 +92,7 @@ public class SupportTabPlanningTests
} }
[Fact] [Fact]
public void BlockedSteadyingSide_TabsTheSteadiestEntryThatFitsAndReportsIt() public void BlockedSteadyingSide_TabsTheSteadiestEntryThatFits()
{ {
// Only the middle of the top edge steadies the strip by 0.2. Parts 0.1 above it and beside // Only the middle of the top edge steadies the strip by 0.2. Parts 0.1 above it and beside
// its upper half leave no room for a lead-in there or at its top corners. // its upper half leave no room for a lead-in there or at its top corners.
@@ -105,7 +105,8 @@ public class SupportTabPlanningTests
var result = CuttingPlanService.Plan(CuttingPlanRequest.ForPlate(plate, new Vector(7, 0), var result = CuttingPlanService.Plan(CuttingPlanRequest.ForPlate(plate, new Vector(7, 0),
confirmedParameters: Parameters())); confirmedParameters: Parameters()));
Assert.True(result.Status == CuttingPlanStatus.BestEffort, string.Join("\n", result.Findings.Select(f => f.Message))); // Tabbed, the strip counts as steady even where its tab cannot hold it level.
Assert.True(result.Status == CuttingPlanStatus.Ready, string.Join("\n", result.Findings.Select(f => f.Message)));
var proposal = result.ProposedOrder.Single(p => ReferenceEquals(p.SourcePart, strip)); var proposal = result.ProposedOrder.Single(p => ReferenceEquals(p.SourcePart, strip));
var (entry, cutEnd) = EntryAndCutEnd(proposal); var (entry, cutEnd) = EntryAndCutEnd(proposal);
Assert.Equal(TabSize, entry.DistanceTo(cutEnd), 6); Assert.Equal(TabSize, entry.DistanceTo(cutEnd), 6);
@@ -115,13 +116,11 @@ public class SupportTabPlanningTests
Assert.True(entry.Y > 2.5 - 1e-9, $"entry {entry}"); Assert.True(entry.Y > 2.5 - 1e-9, $"entry {entry}");
Assert.True(support.MarginWith(entry) > support.MarginWith(new Vector(12, 2)), $"entry {entry}"); Assert.True(support.MarginWith(entry) > support.MarginWith(new Vector(12, 2)), $"entry {entry}");
Assert.False(support.HoldsLevelWithTabAt(entry)); Assert.False(support.HoldsLevelWithTabAt(entry));
Assert.Contains(result.Findings, f => ReferenceEquals(f.SourcePart, strip) Assert.DoesNotContain(result.Findings, f => f.Kind == PostVerificationKind.PartSupport);
&& f.Kind == PostVerificationKind.PartSupport
&& f.Message.Contains("no lead-in fits at a point where its tab would steady the part"));
} }
[Fact] [Fact]
public void PartNoSingleTabCanHold_IsTabbedAndReported() public void PartNoSingleTabCanHold_IsTabbedWithoutAWarning()
{ {
// The grid's rows run either side of the strip: nothing under it, so one tab can only balance it. // The grid's rows run either side of the strip: nothing under it, so one tab can only balance it.
var bed = new SupportGrid(1, 1, 0, 0.9, stabilityMargin: 0.1); var bed = new SupportGrid(1, 1, 0, 0.9, stabilityMargin: 0.1);
@@ -132,13 +131,10 @@ public class SupportTabPlanningTests
var result = CuttingPlanService.Plan(CuttingPlanRequest.ForPlate(plate, new Vector(0, 0), var result = CuttingPlanService.Plan(CuttingPlanRequest.ForPlate(plate, new Vector(0, 0),
confirmedParameters: Parameters())); confirmedParameters: Parameters()));
Assert.Equal(CuttingPlanStatus.BestEffort, result.Status); Assert.True(result.Status == CuttingPlanStatus.Ready, string.Join("\n", result.Findings.Select(f => f.Message)));
var (entry, cutEnd) = EntryAndCutEnd(Assert.Single(result.ProposedOrder)); var (entry, cutEnd) = EntryAndCutEnd(Assert.Single(result.ProposedOrder));
Assert.Equal(TabSize, entry.DistanceTo(cutEnd), 6); Assert.Equal(TabSize, entry.DistanceTo(cutEnd), 6);
var warning = Assert.Single(result.Findings); Assert.DoesNotContain(result.Findings, f => f.Kind == PostVerificationKind.PartSupport);
Assert.Same(strip, warning.SourcePart);
Assert.Equal(PostVerificationKind.PartSupport, warning.Kind);
Assert.Contains("no single tab can steady it", warning.Message);
} }
[Fact] [Fact]
@@ -162,6 +158,39 @@ public class SupportTabPlanningTests
Assert.Equal(LayerType.Leadout, motions[^1].Layer); Assert.Equal(LayerType.Leadout, motions[^1].Layer);
} }
[Fact]
public void StripWhoseLeadOutMayCutItsTab_KeepsTheLeadOutAndWarns()
{
// Wound counterclockwise, every entry's 60 degree lead-out runs 0.05 along the edge, past
// the 0.03 tab, into the lead-in. The settings' lead-out is kept as configured and the
// plan is unverified, with a warning on the part.
var bed = new SupportGrid(2, 4, 0, 2.25, stabilityMargin: 0.1);
var plate = new Plate(20, 20) { SupportBed = bed };
var clean = new Program(Mode.Absolute);
clean.MoveTo(0, 0); clean.LineTo(10, 0); clean.LineTo(10, 1); clean.LineTo(0, 1); clean.LineTo(0, 0);
plate.Parts.Add(new Part(new Drawing("strip", clean), new Vector(2, 2)));
var parameters = Parameters();
parameters.Kerf = 0.014;
parameters.TabConfig = new NormalTab { Size = 0.03 };
parameters.ExternalLeadIn = new LineLeadIn { Length = 0.15, ApproachAngle = 60 };
parameters.ExternalLeadOut = new LineLeadOut { Length = 0.1, ApproachAngle = 60 };
var result = CuttingPlanService.Plan(CuttingPlanRequest.ForPlate(plate, new Vector(0, 0),
confirmedParameters: parameters));
Assert.Equal(CuttingPlanStatus.BestEffort, result.Status);
Assert.True(result.IndependentlyReplayed);
var warning = Assert.Single(result.Findings);
Assert.Equal(PostVerificationKind.TabLeadOut, warning.Kind);
var proposal = Assert.Single(result.ProposedOrder);
var (entry, cutEnd) = EntryAndCutEnd(proposal);
Assert.Equal(0.03, entry.DistanceTo(cutEnd), 6);
var motions = ExecutionMotionReader.Read(proposal.CopyProgram(), proposal.Location, null, default).Motions;
var leadOut = motions[^1];
Assert.Equal(LayerType.Leadout, leadOut.Layer);
Assert.Equal(0.1, leadOut.Start!.Value.DistanceTo(leadOut.End), 6);
}
// A 10 x 0.8 strip with a 9 x 0.4 slot near its bottom edge: no rapid from its top edge // A 10 x 0.8 strip with a 9 x 0.4 slot near its bottom edge: no rapid from its top edge
// reaches the plate below it without crossing the slot once that is cut. // reaches the plate below it without crossing the slot once that is cut.
private static Program SlottedStrip() private static Program SlottedStrip()
@@ -189,12 +218,11 @@ public class SupportTabPlanningTests
var result = CuttingPlanService.Plan(CuttingPlanRequest.ForPlate(plate, new Vector(0, 0), var result = CuttingPlanService.Plan(CuttingPlanRequest.ForPlate(plate, new Vector(0, 0),
confirmedParameters: Parameters(), preservePartOrder: true)); confirmedParameters: Parameters(), preservePartOrder: true));
Assert.True(result.Status == CuttingPlanStatus.BestEffort, string.Join("\n", result.Findings.Select(f => f.Message))); Assert.True(result.Status == CuttingPlanStatus.Ready, string.Join("\n", result.Findings.Select(f => f.Message)));
var (entry, cutEnd) = EntryAndCutEnd(result.ProposedOrder.Single(p => ReferenceEquals(p.SourcePart, slotted))); var (entry, cutEnd) = EntryAndCutEnd(result.ProposedOrder.Single(p => ReferenceEquals(p.SourcePart, slotted)));
Assert.Equal(TabSize, entry.DistanceTo(cutEnd), 6); Assert.Equal(TabSize, entry.DistanceTo(cutEnd), 6);
Assert.True(entry.Y < 2.4, $"entry {entry}"); Assert.True(entry.Y < 2.4, $"entry {entry}");
Assert.Contains(result.Findings, f => ReferenceEquals(f.SourcePart, slotted) Assert.DoesNotContain(result.Findings, f => f.Kind == PostVerificationKind.PartSupport);
&& f.Kind == PostVerificationKind.PartSupport && f.Message.Contains("no single tab can steady it"));
} }
// A 0.8 x 10 upright strip at x 4..4.8 between squares cut before and after it on either side. // A 0.8 x 10 upright strip at x 4..4.8 between squares cut before and after it on either side.
@@ -212,32 +240,26 @@ public class SupportTabPlanningTests
} }
[Theory] [Theory]
// No grid column runs under the strip: no single tab can hold it, so once cut it may tip. // No grid column runs under the strip: no single tab can hold it level, yet tabbed it counts as steady.
[InlineData(0.9, false)] [InlineData(0.9, false)]
// A column runs under it, off its center line: its tab holds it level, so it stays crossable. // A column runs under it, off its center line: its tab holds it level.
[InlineData(0.25, true)] [InlineData(0.25, true)]
public void PartNoSingleTabCanHold_IsNotCrossedOnceCut(double columnOffset, bool crossable) public void TabbedPart_StaysCrossableOnceCut_WhetherOrNotItsTabHoldsItLevel(double columnOffset, bool holdsLevel)
{ {
var bed = new SupportGrid(1, 1, columnOffset, 0, stabilityMargin: 0.1); var bed = new SupportGrid(1, 1, columnOffset, 0, stabilityMargin: 0.1);
var (plate, strip) = StripBetweenSquares(bed); var (plate, strip) = StripBetweenSquares(bed);
var support = SupportAnalyzer.Analyze(bed, plate.Quadrant, strip); var support = SupportAnalyzer.Analyze(bed, plate.Quadrant, strip);
Assert.False(support.IsSupported); Assert.False(support.IsSupported);
Assert.Equal(crossable, support.TabCanSupport); Assert.Equal(holdsLevel, support.TabCanSupport);
var kept = CuttingPlanService.Plan(CuttingPlanRequest.ForPlate(plate, new Vector(0, 0), var kept = CuttingPlanService.Plan(CuttingPlanRequest.ForPlate(plate, new Vector(0, 0),
confirmedParameters: Parameters(), preservePartOrder: true)); confirmedParameters: Parameters(), preservePartOrder: true));
var free = CuttingPlanService.Plan(CuttingPlanRequest.ForPlate(plate, new Vector(0, 0), var free = CuttingPlanService.Plan(CuttingPlanRequest.ForPlate(plate, new Vector(0, 0),
confirmedParameters: Parameters())); confirmedParameters: Parameters()));
Assert.Equal(crossable, kept.ProposedOrder.Count != 0); Assert.True(kept.Status == CuttingPlanStatus.Ready, string.Join("\n", kept.Findings.Select(f => f.Message)));
Assert.True(free.ProposedOrder.Count == plate.Parts.Count, Assert.True(free.Status == CuttingPlanStatus.Ready, string.Join("\n", free.Findings.Select(f => f.Message)));
string.Join("\n", free.Findings.Select(f => f.Message)));
Assert.True(free.IndependentlyReplayed); Assert.True(free.IndependentlyReplayed);
if (crossable)
return;
// Free to reorder, the squares on the strip's left side are both cut before it.
var stripAt = free.ProposedOrder.ToList().FindIndex(p => ReferenceEquals(p.SourcePart, strip));
Assert.All(free.ProposedOrder.Skip(stripAt + 1), p => Assert.True(p.Location.X > 5, $"{p.Location} after the strip"));
} }
[Fact] [Fact]
@@ -9,18 +9,19 @@ namespace OpenNest.Tests.CuttingStrategy;
/// <summary> /// <summary>
/// A tab trims the perimeter short of its entry, so the lead-out leaves from where the /// A tab trims the perimeter short of its entry, so the lead-out leaves from where the
/// trimmed cut actually ends. Generating it from the nominal entry emitted an arc whose /// trimmed cut actually ends. Generating it from the nominal entry emitted an arc whose
/// start was off its own radius. A lead-out that would reach the lead-in across the tab gap /// start was off its own radius.
/// would cut the tab free, so the cut then stops at its tab with no lead-out.
/// </summary> /// </summary>
public class TabbedLeadOutTests public class TabbedLeadOutTests
{ {
private const double TabSize = 0.2; private const double TabSize = 0.2;
private const double LeadRadius = 0.2; private const double LeadRadius = 0.2;
[Fact] [Theory]
public void ArcLeadOut_LeavesTangentlyFromTheTrimmedCutEnd() [InlineData(false)]
[InlineData(true)]
public void ArcLeadOut_LeavesTangentlyFromTheTrimmedCutEnd(bool reversed)
{ {
var execution = Emit(ExplicitContourTests.Square(false), new Vector(-2, 5), var execution = Emit(ExplicitContourTests.Square(reversed), new Vector(-2, 5),
new ArcLeadOut { Radius = LeadRadius }, tabs: true); new ArcLeadOut { Radius = LeadRadius }, tabs: true);
var (cuts, leadout) = Split(execution); var (cuts, leadout) = Split(execution);
@@ -30,65 +31,11 @@ public class TabbedLeadOutTests
Assert.Equal(end, leadout.Start!.Value); Assert.Equal(end, leadout.Start!.Value);
var arc = Assert.IsType<Arc>(leadout.Curve.ToEntity()); var arc = Assert.IsType<Arc>(leadout.Curve.ToEntity());
Assert.Equal(LeadRadius, arc.Radius, 9); Assert.Equal(LeadRadius, arc.Radius, 9);
// Centered on the actual end's outward normal, so it touches the edge only where it starts. // Centerd on the actual end's outward normal, so it touches the edge only where it starts.
Assert.Equal(-LeadRadius, arc.Center.X, 9); Assert.Equal(-LeadRadius, arc.Center.X, 9);
Assert.Equal(end.Y, arc.Center.Y, 9); Assert.Equal(end.Y, arc.Center.Y, 9);
} }
[Fact]
public void ArcLeadOut_ThatWouldCrossTheLeadIn_IsLeftOut()
{
// Wound the other way, the arc runs forward over the tab gap and through the lead-in.
var execution = Emit(ExplicitContourTests.Square(true), new Vector(-2, 5),
new ArcLeadOut { Radius = LeadRadius }, tabs: true);
var cuts = execution.Motions.Where(m => m.Layer == LayerType.Display && !m.Rapid).ToArray();
Assert.Equal(TabSize, System.Math.Abs(cuts[^1].End.Y - 5), 9);
Assert.DoesNotContain(execution.Motions, m => m.Layer == LayerType.Leadout);
}
[Theory]
[InlineData(false)]
[InlineData(true)]
public void LineLeadOut_AngledIntoASmallTab_IsLeftOutOnlyWhenItWouldCrossTheLeadIn(bool reversed)
{
// A strip tabbed for support with 60 degree leads and a tab shorter than the lead-out's
// forward run: wound one way the lead-out angles away from the tab, the other way it
// crosses the lead-in and would cut the tab free.
var clean = new Program(Mode.Absolute);
if (reversed)
{
clean.MoveTo(0, 0); clean.LineTo(11.8, 0); clean.LineTo(11.8, 3.8); clean.LineTo(0, 3.8); clean.LineTo(0, 0);
}
else
{
clean.MoveTo(0, 0); clean.LineTo(0, 3.8); clean.LineTo(11.8, 3.8); clean.LineTo(11.8, 0); clean.LineTo(0, 0);
}
var parameters = new CuttingParameters
{
Kerf = 0.014,
ExternalLeadIn = new LineLeadIn { Length = 0.15, ApproachAngle = 60 },
ExternalLeadOut = new LineLeadOut { Length = 0.1, ApproachAngle = 60 },
InternalLeadIn = new LineLeadIn { Length = 0.15, ApproachAngle = 60 },
InternalLeadOut = new NoLeadOut(),
TabsEnabled = true,
TabConfig = new NormalTab { Size = 0.03 },
};
var emitted = new ContourCuttingStrategy { Parameters = parameters }.Apply(clean, new Vector(5, -2));
var execution = ExecutionMotionReader.Read(emitted.Program, Vector.Zero, null, default);
var leadIn = Assert.Single(execution.Motions.Where(m => m.Layer == LayerType.Leadin));
var leadOuts = execution.Motions.Where(m => m.Layer == LayerType.Leadout).ToArray();
if (reversed)
Assert.Empty(leadOuts);
else
{
var leadOut = Assert.Single(leadOuts);
Assert.False(new Line(leadIn.Start!.Value, leadIn.End).Intersects(new Line(leadOut.Start!.Value, leadOut.End)));
}
Assert.Empty(new ReleasedContourState().Check(execution, new Vector(5, -2), 1));
}
[Fact] [Fact]
public void ArcLeadOut_OnCurvedPerimeter_IsTangentAtTheTrimmedEnd() public void ArcLeadOut_OnCurvedPerimeter_IsTangentAtTheTrimmedEnd()
{ {
@@ -137,20 +84,30 @@ public class TabbedLeadOutTests
Assert.Equal(5, arc.Center.Y, 9); Assert.Equal(5, arc.Center.Y, 9);
} }
[Fact] [Theory]
public void LineLeads_TabWrappingAFilletedCorner_ShareTheCornerBisector() [InlineData(false)]
[InlineData(true)]
public void LineLeads_TabWrappingAFilletedCorner_ShareTheCornerBisector(bool reversed)
{ {
// Entered at the fillet joint the tab trims back around: on its own edge's normal the // Entered at the fillet joint the tab trims back around: on its own edge's normal the
// lead-in and lead-out would sit 150 degrees apart, not the 60 degree V of a straight edge. // lead-in and lead-out would sit 150 degrees apart, not the 60 degree V of a straight edge.
const double fillet = 0.015; const double fillet = 0.015;
const double tab = 0.03; const double tab = 0.03;
var clean = new Program(Mode.Absolute); var clean = new Program(Mode.Absolute);
clean.MoveTo(0, 0); clean.LineTo(0, 10 - fillet); if (reversed)
clean.ArcTo(fillet, 10, fillet, 10 - fillet, RotationType.CW); {
clean.LineTo(10, 10); clean.LineTo(10, 0); clean.LineTo(0, 0); clean.MoveTo(fillet, 10); clean.ArcTo(0, 10 - fillet, fillet, 10 - fillet, RotationType.CCW);
clean.LineTo(0, 0); clean.LineTo(10, 0); clean.LineTo(10, 10); clean.LineTo(fillet, 10);
}
else
{
clean.MoveTo(0, 0); clean.LineTo(0, 10 - fillet);
clean.ArcTo(fillet, 10, fillet, 10 - fillet, RotationType.CW);
clean.LineTo(10, 10); clean.LineTo(10, 0); clean.LineTo(0, 0);
}
var part = new Part(new Drawing("tabbed-fillet", clean)); var part = new Part(new Drawing("tabbed-fillet", clean));
var perimeter = LeadInTestHelpers.Profile(part).Perimeter; var perimeter = LeadInTestHelpers.Profile(part).Perimeter;
var entry = new Vector(fillet, 10); var entry = reversed ? new Vector(0, 10 - fillet) : new Vector(fillet, 10);
var entity = perimeter.Entities.OfType<Line>().First(l => l.StartPoint.DistanceTo(entry) < 1e-9); var entity = perimeter.Entities.OfType<Line>().First(l => l.StartPoint.DistanceTo(entry) < 1e-9);
var parameters = new CuttingParameters var parameters = new CuttingParameters
{ {
@@ -168,7 +125,7 @@ public class TabbedLeadOutTests
LeadInTestHelpers.AssertPoint(entry, leadIn.EndPoint); LeadInTestHelpers.AssertPoint(entry, leadIn.EndPoint);
Assert.Equal(tab, leadOut.StartPoint.DistanceTo(entry), 9); Assert.Equal(tab, leadOut.StartPoint.DistanceTo(entry), 9);
// The cut stops on the other edge, past the corner. // The cut stops on the other edge, past the corner.
Assert.Equal(0, leadOut.StartPoint.X, 9); Assert.Equal(0, reversed ? 10 - leadOut.StartPoint.Y : leadOut.StartPoint.X, 9);
const double bisector = 3 * System.Math.PI / 4; const double bisector = 3 * System.Math.PI / 4;
var spread = OpenNest.Math.Angle.ToRadians(30); var spread = OpenNest.Math.Angle.ToRadians(30);
@@ -176,36 +133,6 @@ public class TabbedLeadOutTests
LeadInTestHelpers.AssertPoint(leadOut.StartPoint + Polar(0.1, bisector + spread), leadOut.EndPoint); LeadInTestHelpers.AssertPoint(leadOut.StartPoint + Polar(0.1, bisector + spread), leadOut.EndPoint);
} }
[Fact]
public void LineLeads_TabWrappingAFilletedCornerTheOtherWay_LeaveOutTheLeadOutThatCrossesTheLeadIn()
{
// Wound the other way, the shared bisector puts the lead-out across the lead-in.
const double fillet = 0.015;
var clean = new Program(Mode.Absolute);
clean.MoveTo(fillet, 10); clean.ArcTo(0, 10 - fillet, fillet, 10 - fillet, RotationType.CCW);
clean.LineTo(0, 0); clean.LineTo(10, 0); clean.LineTo(10, 10); clean.LineTo(fillet, 10);
var part = new Part(new Drawing("tabbed-fillet", clean));
var perimeter = LeadInTestHelpers.Profile(part).Perimeter;
var entry = new Vector(0, 10 - fillet);
var entity = perimeter.Entities.OfType<Line>().First(l => l.StartPoint.DistanceTo(entry) < 1e-9);
var parameters = new CuttingParameters
{
ExternalLeadIn = new LineLeadIn { Length = 0.15, ApproachAngle = 60 },
ExternalLeadOut = new LineLeadOut { Length = 0.1, ApproachAngle = 60 },
TabsEnabled = true,
TabConfig = new NormalTab { Size = 0.03 },
};
part.ApplySingleLeadIn(parameters, entry, entity, ContourType.External);
var geometry = part.Program.ToGeometry();
var leadIn = Assert.IsType<Line>(Assert.Single(geometry.Where(e => e.Layer == SpecialLayers.Leadin)));
LeadInTestHelpers.AssertPoint(entry, leadIn.EndPoint);
LeadInTestHelpers.AssertPoint(entry + Polar(0.15, 3 * System.Math.PI / 4 - OpenNest.Math.Angle.ToRadians(30)),
leadIn.StartPoint);
Assert.DoesNotContain(geometry, e => e.Layer == SpecialLayers.Leadout);
}
private static Vector Polar(double length, double angle) => private static Vector Polar(double length, double angle) =>
new(length * System.Math.Cos(angle), length * System.Math.Sin(angle)); new(length * System.Math.Cos(angle), length * System.Math.Sin(angle));
+13 -10
View File
@@ -1,4 +1,5 @@
using OpenNest.CNC; using OpenNest.CNC;
using OpenNest.CNC.CuttingPlanning;
using OpenNest.CNC.CuttingStrategy; using OpenNest.CNC.CuttingStrategy;
using OpenNest.Diagnostics; using OpenNest.Diagnostics;
using OpenNest.Engine.CuttingPlanning; using OpenNest.Engine.CuttingPlanning;
@@ -9,8 +10,8 @@ using OpenNest.Tests.CuttingPlanning;
namespace OpenNest.Tests.Support; namespace OpenNest.Tests.Support;
/// <summary> /// <summary>
/// Parts the support grid cannot hold level: hand-placed lead-ins tab them, Plan Cutting warns /// Parts the support grid cannot hold level: hand-placed lead-ins tab them, and a tabbed part
/// when it cannot steady them, and the pre-post review warns about any without a steadying tab. /// counts as steady wherever its tab is, so only one cut with no tab at all is warned about.
/// </summary> /// </summary>
public class SupportReviewTests public class SupportReviewTests
{ {
@@ -79,18 +80,18 @@ public class SupportReviewTests
} }
[Fact] [Fact]
public void PrePost_AcceptsATabThatSteadiesThePart_AndWarnsAboutOneThatDoesNot() public void PrePost_AcceptsATabAnywhere_EvenWhereItDoesNotHoldThePartLevel()
{ {
var (steadied, _, top) = Strip(OneRow); var (steadied, _, top) = Strip(OneRow);
PlaceLeadIn(top, Parameters(tabs: true), new Vector(5, 1), new Line(new Vector(0, 1), new Vector(10, 1))); PlaceLeadIn(top, Parameters(tabs: true), new Vector(5, 1), new Line(new Vector(0, 1), new Vector(10, 1)));
// On the edge beside the row of contacts the tab cannot hold the strip level; tabbed, it still counts as steady.
var (unsteady, _, bottom) = Strip(OneRow); var (unsteady, _, bottom) = Strip(OneRow);
PlaceLeadIn(bottom, Parameters(tabs: true), new Vector(5, 0), new Line(new Vector(10, 0), new Vector(0, 0))); PlaceLeadIn(bottom, Parameters(tabs: true), new Vector(5, 0), new Line(new Vector(10, 0), new Vector(0, 0)));
Assert.DoesNotContain(PostVerificationAnalyzer.Analyze(steadied).Findings, Assert.DoesNotContain(PostVerificationAnalyzer.Analyze(steadied).Findings,
f => f.Kind == PostVerificationKind.PartSupport); f => f.Kind == PostVerificationKind.PartSupport);
var finding = Assert.Single(PostVerificationAnalyzer.Analyze(unsteady).Findings, Assert.DoesNotContain(PostVerificationAnalyzer.Analyze(unsteady).Findings,
f => f.Kind == PostVerificationKind.PartSupport); f => f.Kind == PostVerificationKind.PartSupport);
Assert.Contains("does not steady it", finding.Message);
} }
[Fact] [Fact]
@@ -109,16 +110,18 @@ public class SupportReviewTests
} }
[Fact] [Fact]
public void PlanCutting_WarnsWhenNoSingleTabCanSteadyThePart() public void PlanCutting_TabsAPartNoSingleTabCanSteady_WithoutAWarning()
{ {
// The 10 x 0.8 strip lies between grid rows: it rests on nothing, so a tab only hangs it. // The 10 x 0.8 strip lies between grid rows: it rests on nothing. Tabbed, it counts as steady.
var (_, plate, _) = Strip(new SupportGrid(1, 1, 0, 0.9, stabilityMargin: 0.1), height: 0.8); var (_, plate, _) = Strip(new SupportGrid(1, 1, 0, 0.9, stabilityMargin: 0.1), height: 0.8);
var result = CuttingPlanService.Plan(CuttingPlanRequest.ForPlate(plate, Vector.Zero, var result = CuttingPlanService.Plan(CuttingPlanRequest.ForPlate(plate, Vector.Zero,
confirmedParameters: Parameters())); confirmedParameters: Parameters()));
Assert.Equal(CuttingPlanStatus.BestEffort, result.Status); Assert.True(result.Status == CuttingPlanStatus.Ready, string.Join("\n", result.Findings.Select(f => f.Message)));
var finding = Assert.Single(result.Findings, f => f.Kind == PostVerificationKind.PartSupport); Assert.DoesNotContain(result.Findings, f => f.Kind == PostVerificationKind.PartSupport);
Assert.Contains("no single tab can steady it", finding.Message); var proposal = Assert.Single(result.ProposedOrder);
Assert.NotNull(PartSupportReview.OutsideTab(
ExecutionMotionReader.Read(proposal.CopyProgram(), proposal.Location, null, default)));
} }
} }
@@ -124,15 +124,16 @@ public class TabHeldSupportTabTests
} }
[Fact] [Fact]
public void PlanCutting_WarnsAboutAShortPartNoTabCanSteady_WithoutTheLimit() public void PlanCutting_TabsAShortPartNoTabCanSteady_WithoutTheLimit_AndDoesNotWarn()
{ {
var (_, plate, _) = Square(Parameters(0)); var (_, plate, _) = Square(Parameters(0));
var result = CuttingPlanService.Plan(CuttingPlanRequest.ForPlate(plate, Vector.Zero, var result = CuttingPlanService.Plan(CuttingPlanRequest.ForPlate(plate, Vector.Zero,
confirmedParameters: Parameters(0))); confirmedParameters: Parameters(0)));
Assert.Equal(CuttingPlanStatus.BestEffort, result.Status); // Tabbed, a part counts as steady wherever its tab is.
Assert.Contains("no single tab can steady it", Assert.Single(result.Findings).Message); Assert.True(result.Status == CuttingPlanStatus.Ready, string.Join("\n", result.Findings.Select(f => f.Message)));
Assert.Empty(result.Findings);
} }
[Fact] [Fact]
+2
View File
@@ -646,6 +646,7 @@ internal sealed class CuttingInspectionPanel : UserControl
PostVerificationKind.OffPlate => "Off the plate", PostVerificationKind.OffPlate => "Off the plate",
PostVerificationKind.EdgeSpacing => "Outside work area", PostVerificationKind.EdgeSpacing => "Outside work area",
PostVerificationKind.CommonLine => "Common line", PostVerificationKind.CommonLine => "Common line",
PostVerificationKind.TabLeadOut => "Tab lead-out",
_ => kind.ToString(), _ => kind.ToString(),
}; };
@@ -715,6 +716,7 @@ internal sealed class CuttingInspectionPanel : UserControl
PostVerificationKind.OffPlate => "The ring marks where the part leaves the plate.", PostVerificationKind.OffPlate => "The ring marks where the part leaves the plate.",
PostVerificationKind.EdgeSpacing => "The ring marks where the part leaves the work area, inside the edge spacing.", PostVerificationKind.EdgeSpacing => "The ring marks where the part leaves the work area, inside the edge spacing.",
PostVerificationKind.CommonLine => "The ring marks the common-line part or lead to review.", PostVerificationKind.CommonLine => "The ring marks the common-line part or lead to review.",
PostVerificationKind.TabLeadOut => "The ring marks where the lead-out leaves the tab.",
_ => "The ring marks the affected part; the exact spot is not known." _ => "The ring marks the affected part; the exact spot is not known."
}; };
+1
View File
@@ -32,6 +32,7 @@ public partial class PostVerificationForm : Form
(PostVerificationKind.EdgeSpacing, "Outside work area"), (PostVerificationKind.EdgeSpacing, "Outside work area"),
(PostVerificationKind.PartSupport, "Part support"), (PostVerificationKind.PartSupport, "Part support"),
(PostVerificationKind.CommonLine, "Common lines"), (PostVerificationKind.CommonLine, "Common lines"),
(PostVerificationKind.TabLeadOut, "Tab lead-outs"),
}; };
internal static PostVerificationKind[] ListedKinds => Categories.Select(c => c.Kind).ToArray(); internal static PostVerificationKind[] ListedKinds => Categories.Select(c => c.Kind).ToArray();
+4 -4
View File
@@ -37,10 +37,10 @@ var result = CuttingPlanService.Plan(snapshot, cancellationToken);
- `preservePartOrder` fixes whole-part order, not eligible internal contour choices. - `preservePartOrder` fixes whole-part order, not eligible internal contour choices.
- With `CuttingParameters.SupportTabs` and a support bed (`CuttingPlanRequest.SupportBed`, - With `CuttingParameters.SupportTabs` and a support bed (`CuttingPlanRequest.SupportBed`,
the plate's own under `ForPlate`), each regenerated part the bed cannot hold level gets a the plate's own under `ForPlate`), each regenerated part the bed cannot hold level gets a
tabbed perimeter whose automatic entries keep to points where the tab steadies it. A tab tabbed perimeter whose automatic entries prefer points where the tab steadies it. A tabbed
that still cannot hold its part level, or sits in an inside corner, is noted on the plan part counts as steady wherever its tab is: it is never warned about and stays crossable once
without changing its status. A part no single tab can hold level may tip once cut, so its cut. A tab in an inside corner is noted on the plan without changing its status. A part no
tabbed outside is a rapid obstacle from then on, like an untabbed one. A part no longer than `TabHeldMaxLength` is held by its tab longer than `TabHeldMaxLength` is held by its tab
alone, so any tab clear of inside corners steadies it. Without a bed, or with alone, so any tab clear of inside corners steadies it. Without a bed, or with
`CuttingParameters.TabBySize`, the parts whose width is in `TabSizeMinWidth`..`TabSizeMaxWidth` `CuttingParameters.TabBySize`, the parts whose width is in `TabSizeMinWidth`..`TabSizeMaxWidth`
are tabbed instead, and with no range set the plan notes that nothing was tabbed; see are tabbed instead, and with no range set the plan notes that nothing was tabbed; see
+4 -3
View File
@@ -108,8 +108,8 @@ shows the first three check categories, even when there are no findings:
incomplete for leads near it. This line appears in the summary only when there is such incomplete for leads near it. This line appears in the summary only when there is such
a finding. a finding.
- **Part support:** on a plate with a support bed, a part set for support tabs that the bed - **Part support:** on a plate with a support bed, a part set for support tabs that the bed
cannot hold level and whose outside cut leaves no tab that keeps it level; the marker is its cannot hold level and whose outside cut leaves no tab at all (any tab counts as steadying
center of gravity. See [support tabs](support-tabs.md#pre-post-review). it); the marker is its center of gravity. See [support tabs](support-tabs.md#pre-post-review).
- **Part spacing:** two parts closer than the plate's part spacing without sharing material - **Part spacing:** two parts closer than the plate's part spacing without sharing material
(overlapping pairs are reported only as overlaps). Candidate pairs come from each part's (overlapping pairs are reported only as overlaps). Candidate pairs come from each part's
clean nesting material (leads excluded) tested exactly as Auto Nest's layout check tests clean nesting material (leads excluded) tested exactly as Auto Nest's layout check tests
@@ -190,7 +190,8 @@ rounded (see [cutting dependencies](cutting-planner.md#cutting-dependencies)): t
never mistakes a fillet's joint for a loop. Plan never mistakes a fillet's joint for a loop. Plan
Cutting runs the same proof, so its own [tabbed cutouts](tabbed-cutouts.md) (pieces without Cutting runs the same proof, so its own [tabbed cutouts](tabbed-cutouts.md) (pieces without
lead-outs) pass, and so do its tabbed perimeters followed by a lead-out that stays out of the lead-outs) pass, and so do its tabbed perimeters followed by a lead-out that stays out of the
tab. A program that still has a tabbed cutout's `Tab` motions (never planned) is tab. A configured lead-out that may cut its tab free is a warning in Plan Cutting instead (see
[support tabs](support-tabs.md#support-tabs-in-plan-cutting)), and stays incomplete here. A program that still has a tabbed cutout's `Tab` motions (never planned) is
incomplete: a post may cut through them. incomplete: a post may cut through them.
## Explicit override ## Explicit override
+26 -21
View File
@@ -104,11 +104,17 @@ plate settings, so parts that need no tab are not tabbed.
The emitter tabs a perimeter at its entry: the cut stops short of the entry by the tab size. A The emitter tabs a perimeter at its entry: the cut stops short of the entry by the tab size. A
round perimeter, one circle, is cut as an arc that stops the tab's chord short of its entry. round perimeter, one circle, is cut as an arc that stops the tab's chord short of its entry.
The lead-out leaves from where the cut stops. One that touches the lead-in, or passes within the The lead-out leaves from where the cut stops, as configured; Plan Cutting never shortens or drops
kerf of it, would cut the tab free, so the emitter leaves it out and the cut ends at its tab. A it. A line lead-out angled forward runs toward the lead-in whenever its run along the edge is
line lead-out angled forward does that whenever its run along the edge is longer than the tab, longer than the tab, as a 0.1 lead-out at 60 degrees (0.05 along the edge) beside a 0.03 tab
as a 0.1 lead-out at 60 degrees (0.05 along the edge) beside a 0.03 tab does. This holds for every does on a counterclockwise outside, and can then cut the tab free. The strict search refuses
tabbed outside, support-tabbed or not. such an entry and looks for another. Only when that refusal is all that stops a plan does Plan
Cutting plan again keeping those lead-outs (`CuttingPlanSnapshot.WithTabLeadOuts`): each such
part gets a `PostVerificationKind.TabLeadOut` warning (Plan Cutting's "Tab lead-out" issue), is
treated as cut free for later rapids, and the plan is UNVERIFIED, so applying it needs explicit
acceptance. A lead-out that would cut its tab is fixed in the cutting settings: shorten or turn
it, or enlarge the tab. Programs judged as they are (locked, fixed or posted) keep the
incomplete-check finding.
A support-tabbed perimeter's automatic entries are therefore limited to catalog points the A support-tabbed perimeter's automatic entries are therefore limited to catalog points the
analysis accepts, plus the closest native point to its best tab point (`AutomaticEntryKind.SupportTab`, analysis accepts, plus the closest native point to its best tab point (`AutomaticEntryKind.SupportTab`,
never on a reflex or cusp vertex). Ranking and lead checks are unchanged. never on a reflex or cusp vertex). Ranking and lead checks are unchanged.
@@ -173,22 +179,20 @@ entry is only a preference: its other fitting entries clear of inside corners fo
toward the next cut, in the search and in contour recovery (ranked steadiest first, the shortlist toward the next cut, in the search and in contour recovery (ranked steadiest first, the shortlist
of a long strip resting on one line of contacts would all lie on its far side). A part boxed in of a long strip resting on one line of contacts would all lie on its far side). A part boxed in
by its neighbors, such as the upper of two strips nested in a cutout, can then be left toward the by its neighbors, such as the upper of two strips nested in a cutout, can then be left toward the
next cut instead of blocking the plan. It is still tabbed and still warned about as one that may next cut instead of blocking the plan. It is still tabbed. A part a tab can hold level keeps to
tip. A part a tab can hold level keeps to its steadying entries. its steadying entries.
Once cut, such a part may tip into the head's path, so Plan Cutting treats its tabbed outside as a A tabbed part counts as steady wherever its tab is: the steadiest entries above are preferences,
rapid obstacle, closed across its tab gap, exactly as an untabbed part: no later rapid may cross never a warning. No message says a tab cannot steady its part, and once cut a tabbed part stays
it, and the search reorders around it (a row of long strips is cut after the parts beside them, crossable, as its retained material allows, whether or not its tab holds it level. The pre-post
each strip left toward the next). Parts their tab holds level stay crossable, as the retained review does not read support settings for rapids, so it checks rapid crossings against untabbed
material allows. The pre-post review does not read support settings for rapids, so it still contours only.
checks rapid crossings against untabbed contours only.
A drawing pin on the perimeter wins: its entry, leads and tab are kept as pinned, and the A drawing pin on the perimeter wins: its entry, leads and tab are kept as pinned, and the
analysis is only carried for review. Replay and best-effort plans (`SupportTabCapture.Review`) analysis is only carried for review. Replay and best-effort plans (`SupportTabCapture.Review`)
warn with `PostVerificationKind.PartSupport` whenever an unsupported part's emitted perimeter is warn with `PostVerificationKind.PartSupport` only when an unsupported part's emitted perimeter
untabbed or its entry does not steady the part: its pin has no tab or a tab elsewhere, no is untabbed, which happens when its pin has no tab. Like every planner warning, this makes the
steadying entry had a lead-in that fits, or no single tab can steady it. Like every planner proposal UNVERIFIED, so applying it needs explicit acceptance.
warning, this makes the proposal UNVERIFIED, so applying it needs explicit acceptance.
A planned tab that sits in an inside corner, because no lead-in fits clear of one, gets an A planned tab that sits in an inside corner, because no lead-in fits clear of one, gets an
advisory note instead (`SupportTabCapture.Notes`; never for a pin): a Ready plan keeps its advisory note instead (`SupportTabCapture.Notes`; never for a pin): a Ready plan keeps its
@@ -252,13 +256,14 @@ settings (its own, else the plate's) ask for support tabs and that needs one (th
cannot hold it level or, by size, its width is in the size range) is checked, however its cannot hold it level or, by size, its width is in the size range) is checked, however its
program was made. The tab is the gap between program was made. The tab is the gap between
the end and the start of the program's outside cut (the chain of cutting motions with the the end and the start of the program's outside cut (the chain of cutting motions with the
largest extent). A part with no such gap, or whose gap does not steady it (by size, largest extent). A part with no such gap gets a `PartSupport` warning at its center of gravity
or for a part its tab alone holds, any gap does), gets a `PartSupport` warning at its center of gravity naming the best tab point; posting needs naming the best tab point; posting needs consent as for every warning. Any gap counts as a tab
consent as for every warning. A part whose material cannot be read is reported as not checked. that steadies the part, wherever it is. A part whose material cannot be read is reported as not
checked.
Not covered yet: Not covered yet:
- Locked or ineligible parts keep their programs in Plan Cutting; the pre-post review still - Locked or ineligible parts keep their programs in Plan Cutting; the pre-post review still
checks them. checks them.
- Only one perimeter tab per part. A part that needs more (one tab cannot reach the stability - Only one perimeter tab per part. A part that needs more (one tab cannot reach the stability
margin) gets the best single tab and a warning. margin) gets the best single tab, and no warning.