From a118ccbe1861ca81df5968fca27240b032d0e74e Mon Sep 17 00:00:00 2001 From: ChenX Date: Sat, 6 May 2023 17:28:47 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=98=E6=9B=B4:=E9=80=A0=E5=9E=8B=E8=B5=B0?= =?UTF-8?q?=E5=88=80=E7=AC=AC=E4=B8=80=E5=88=80=E6=B0=B8=E8=BF=9C=E4=B8=BA?= =?UTF-8?q?=E9=A1=BA=E6=97=B6=E9=92=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/GraphicsSystem/ToolPath/OptimizeToolPath.ts | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/src/GraphicsSystem/ToolPath/OptimizeToolPath.ts b/src/GraphicsSystem/ToolPath/OptimizeToolPath.ts index 6abf6523d..328f89bf2 100644 --- a/src/GraphicsSystem/ToolPath/OptimizeToolPath.ts +++ b/src/GraphicsSystem/ToolPath/OptimizeToolPath.ts @@ -33,17 +33,11 @@ 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(); + if ((cu.Normal.z * cu.Area2 < 0) === (cu !== offsetCus[0])) + cu.Reverse(); } plList.push(cu); }