Restructure the cutting parameters dialog with separate Lead-In and Lead-Out GroupBoxes per tab, exposing editable length/angle/radius fields for lead-outs (previously hardcoded). Add Tabs section with enable checkbox and width control. Also fix lead-in/lead-out angle calculations and convert cutting strategy output to incremental mode. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
27 lines
872 B
C#
27 lines
872 B
C#
using OpenNest.Geometry;
|
|
using OpenNest.Math;
|
|
using System.Collections.Generic;
|
|
|
|
namespace OpenNest.CNC.CuttingStrategy
|
|
{
|
|
public class LineLeadOut : LeadOut
|
|
{
|
|
public double Length { get; set; }
|
|
public double ApproachAngle { get; set; } = 90.0;
|
|
|
|
public override List<ICode> Generate(Vector contourEndPoint, double contourNormalAngle,
|
|
RotationType winding = RotationType.CW)
|
|
{
|
|
var overcutAngle = contourNormalAngle + Angle.HalfPI - Angle.ToRadians(ApproachAngle);
|
|
var endPoint = new Vector(
|
|
contourEndPoint.X + Length * System.Math.Cos(overcutAngle),
|
|
contourEndPoint.Y + Length * System.Math.Sin(overcutAngle));
|
|
|
|
return new List<ICode>
|
|
{
|
|
new LinearMove(endPoint) { Layer = LayerType.Leadout }
|
|
};
|
|
}
|
|
}
|
|
}
|