修复:V型刀走刀算法对于不封闭线段可能造成最后一段丢失的问题

This commit is contained in:
ChenX 2020-11-19 15:14:57 +08:00
parent cc42238333
commit fb98d51604

View File

@ -19225,14 +19225,17 @@ function VKnifToolPath(polyline, feedingDepth, knifAngle) {
if (c2 instanceof Arc)
c2 = new Line(c2.StartPoint, c2.StartPoint.add(c2.GetFistDeriv(0).multiplyScalar(100)));
ptsbul.push(d);
//圆弧与直线相切,此时不要提刀
if (isParallelTo(c1.GetFistDeriv(0), c2.GetFistDeriv(0)))
continue;
if (!isClose && i === cus.length - 1) //最后一条
{
ptsbul.push({ pt: c1.EndPoint, bul: 0 });
break;
}
//圆弧与直线相切,此时不要提刀
if (isParallelTo(c1.GetFistDeriv(0), c2.GetFistDeriv(0)))
continue;
//提刀
for (let x of offsetx) {
let co1 = c1.GetOffsetCurves(x)[0];