mirror of
https://github.com/ajisaacs/OpenNest.git
synced 2026-11-15 22:45:35 -05:00
Curved leads turned with the contour winding, which is backwards on outside perimeters: arc lead-ins arrived against the cut, and Line + Arc / arc lead-outs went the long way round on one winding. LeadTurn now gives the arc's turn direction for emission, the pierce-zone check and the preview, and the arc geometry mirrors with it. At convex outside corners, curved lead-ins use the first-cut edge's normal and arc lead-outs the last-cut edge's, whichever edge was picked. ArcLeadIn gains SweepAngle (degrees, (0, 180], default 180) in the cutting panel, settings, nest files and cut pins; older files read as 180. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
25 lines
871 B
C#
25 lines
871 B
C#
using System.Collections.Generic;
|
|
using OpenNest.Geometry;
|
|
|
|
namespace OpenNest.CNC.CuttingStrategy
|
|
{
|
|
/// <summary>
|
|
/// A lead into a contour point. <c>winding</c> is the direction a lead arc turns to meet the
|
|
/// cut tangentially: the cut's own direction around the arc center, which lies along the
|
|
/// normal (see <see cref="ContourCuttingStrategy.LeadTurn"/>). Straight styles ignore it.
|
|
/// </summary>
|
|
public abstract class LeadIn
|
|
{
|
|
public abstract List<ICode> Generate(
|
|
Vector contourStartPoint,
|
|
double contourNormalAngle,
|
|
RotationType winding = RotationType.CW
|
|
);
|
|
|
|
public abstract Vector GetPiercePoint(Vector contourStartPoint, double contourNormalAngle,
|
|
RotationType winding = RotationType.CW);
|
|
|
|
public virtual LeadIn Scale(double factor) => this;
|
|
}
|
|
}
|