Files
OpenNest/OpenNest.Core/CNC/Motion.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

49 lines
1.1 KiB
C#

using OpenNest.Geometry;
namespace OpenNest.CNC
{
public abstract class Motion : ICode
{
protected const int DefaultDecimalPlaces = 4;
public Vector EndPoint { get; set; }
public bool UseExactStop { get; set; }
public int Feedrate { get; set; }
public bool Suppressed { get; set; }
protected Motion()
{
Feedrate = CNC.Feedrate.UseDefault;
}
public virtual void Rotate(double angle)
{
EndPoint = EndPoint.Rotate(angle);
}
public virtual void Rotate(double angle, Vector origin)
{
EndPoint = EndPoint.Rotate(angle, origin);
}
public virtual void Offset(double x, double y)
{
EndPoint = new Vector(EndPoint.X + x, EndPoint.Y + y);
}
public virtual void Offset(Vector voffset)
{
EndPoint += voffset;
}
public abstract CodeType Type { get; }
public abstract ICode Clone();
public abstract string ToString(int decimalPlaces);
}
}