变更:造型走刀第一刀永远为顺时针

pull/2207/head
ChenX 1 year ago
parent 1c4328c4eb
commit a118ccbe18

@ -33,15 +33,9 @@ export function OptimizeToolPath(offsetCus: Curve[], originShape: Shape, rad: nu
if (cu instanceof Polyline)
{
//轮廓朝下的逆时针轮廓需要翻转
//如果走刀不止一条,第一刀为顺时针,其余为逆时针
//第一刀为顺时针,其余为逆时针
if (cu.IsClose)
{
if (offsetCus.length === 1)
{
if (cu.Normal.z * cu.Area2 < 0)
cu.Reverse();
}
else
if ((cu.Normal.z * cu.Area2 < 0) === (cu !== offsetCus[0]))
cu.Reverse();
}

Loading…
Cancel
Save