From da5bda9f4a1108e0f10af93a4647604f2c72f636 Mon Sep 17 00:00:00 2001 From: ZoeLeeFZ Date: Wed, 15 Apr 2020 08:43:14 +0800 Subject: [PATCH] =?UTF-8?q?!924=20=E4=BF=AE=E5=A4=8D:=E8=B5=B0=E5=88=80?= =?UTF-8?q?=E6=96=B9=E5=90=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/GraphicsSystem/ToolPath/OptimizeToolPath.ts | 3 +++ src/Production/Product.ts | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/GraphicsSystem/ToolPath/OptimizeToolPath.ts b/src/GraphicsSystem/ToolPath/OptimizeToolPath.ts index 30d92854a..9366ab38b 100644 --- a/src/GraphicsSystem/ToolPath/OptimizeToolPath.ts +++ b/src/GraphicsSystem/ToolPath/OptimizeToolPath.ts @@ -31,6 +31,9 @@ export function OptimizeToolPath(offsetCus: Curve[], originShape: Shape, rad: nu } if (cu instanceof Polyline) { + //轮廓朝下的逆时针轮廓需要翻转 + if (cu.IsClose && cu.Normal.z * cu.Area2 < 0) + cu.Reverse(); plList.push(cu); } else if (cu instanceof Circle) diff --git a/src/Production/Product.ts b/src/Production/Product.ts index 978ae99ee..263406168 100644 --- a/src/Production/Product.ts +++ b/src/Production/Product.ts @@ -214,7 +214,7 @@ export namespace Production } else { - if (cu.Area2 < 0) + if (cu.IsClose && cu.Normal.z * cu.Area2 < 0) cu.Reverse(); ptsBuls = SplitePolylineAtArc(cu); }