Files
OpenNest/OpenNest.Core/CNC/RapidMove.cs
AJ Isaacs f903cbe18a feat: add Motion.Suppressed property to mark tab-gap codes
Adds Suppressed bool to the Motion base class so LinearMove, ArcMove,
and RapidMove can be flagged for skip during rendering and post-processing
when they fall within a tab gap. Clone() updated on all three subclasses
to preserve the flag. Covered by new MotionSuppressedTests.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-30 13:13:00 -04:00

47 lines
1012 B
C#

using OpenNest.Geometry;
namespace OpenNest.CNC
{
public class RapidMove : Motion
{
public RapidMove()
{
Feedrate = CNC.Feedrate.UseMax;
}
public RapidMove(Vector endPoint)
{
EndPoint = endPoint;
}
public RapidMove(double x, double y)
{
EndPoint = new Vector(x, y);
}
public override CodeType Type
{
get { return CodeType.RapidMove; }
}
public override ICode Clone()
{
return new RapidMove(EndPoint)
{
Suppressed = Suppressed
};
}
public override string ToString()
{
return ToString(DefaultDecimalPlaces);
}
public override string ToString(int decimalPlaces)
{
var dp = "N" + decimalPlaces;
return string.Format("G00 X{0} Y{1}", EndPoint.X.ToString(dp), EndPoint.Y.ToString(dp));
}
}
}