修复:V型刀对未封闭的轮廓处理错误

pull/1302/MERGE
ChenX 4 years ago
parent 33c59b0162
commit db8a283239

@ -23,6 +23,8 @@ export function VKnifToolPath(polyline: Polyline, feedingDepth: number, knifAngl
let ptsbul: { pt: Vec3, bul: number; }[] = [];
let isClose = polyline.IsClose;
for (let i = 0; i < cus.length; i++)
{
let nextIndex = FixIndex(i + 1, cus.length);
@ -46,6 +48,12 @@ export function VKnifToolPath(polyline: Polyline, feedingDepth: number, knifAngl
//圆弧与直线相切,此时不要提刀
if (isParallelTo(c1.GetFistDeriv(0), c2.GetFistDeriv(0))) continue;
if (!isClose && i === cus.length - 1)//最后一条
{
ptsbul.push({ pt: c1.EndPoint, bul: 0 });
break;
}
//提刀
for (let x of offsetx)
{
@ -66,14 +74,10 @@ export function VKnifToolPath(polyline: Polyline, feedingDepth: number, knifAngl
}
}
if (polyline.IsClose)
if (isClose)
{
//第一刀
ptsbul.unshift(ptsbul[ptsbul.length - 1]);//, ptsbul[ptsbul.length - 2]
}
else
{
ptsbul.pop();
}
return ptsbul;
}

Loading…
Cancel
Save