fix(cnc): extend first-cut edge for outside corner lead-ins
A straight lead-in at a convex outside-perimeter corner now runs along the extension of the edge cut first, so the torch enters on that line and keeps cutting it. The result no longer depends on which of the corner's two edges auto-assign or the manual cursor picked, which made placement flip between straight and 90 degrees. The approach angle is ignored at such corners. The straight lead falls back to the first-cut edge normal when its pierce would be closer than PierceClearance to the contour (very flat or tessellated corners). Reflex perimeter corners bisect the notch. Line lead-outs run on straight past a convex corner along the last-cut edge, except on tabbed perimeters. Program generation and the Place Lead-in preview share ResolveLeadIn/ResolveLeadOut.
This commit is contained in:
@@ -120,20 +120,20 @@ public class CutoutCornerLeadInTests
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ApplySingleLeadIn_ExternalCorner_KeepsEntityNormal()
|
||||
public void ApplySingleLeadIn_ExternalCorner_ExtendsFirstCutEdgeNotBisector()
|
||||
{
|
||||
// Outside perimeter corners have their own rule (PerimeterCornerLeadInTests).
|
||||
var part = MakePart(Rectangle());
|
||||
var profile = Profile(part);
|
||||
var entity = Assert.IsType<Line>(profile.Perimeter.Entities[0]);
|
||||
var point = entity.StartPoint;
|
||||
var parameters = Parameters();
|
||||
parameters.ExternalLeadIn = parameters.InternalLeadIn;
|
||||
var normal = ContourCuttingStrategy.ComputeNormal(point, entity, ContourType.External,
|
||||
ContourCuttingStrategy.DetermineWinding(profile.Perimeter));
|
||||
var direction = (entity.EndPoint - entity.StartPoint).Normalize();
|
||||
|
||||
part.ApplySingleLeadIn(parameters, point, entity, ContourType.External);
|
||||
|
||||
AssertPoint(parameters.ExternalLeadIn.GetPiercePoint(point, normal), SingleLeadIn(part).StartPoint);
|
||||
AssertPoint(point - direction * LeadLength, SingleLeadIn(part).StartPoint);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
|
||||
Reference in New Issue
Block a user