From 3f716f6f0add259f2623ec71b2004498d55962d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=84=E8=AF=97=E6=B4=A5?= <2723065175@qq.com> Date: Fri, 12 Jan 2024 08:41:52 +0000 Subject: [PATCH] =?UTF-8?q?!2558=20=E4=BC=98=E5=8C=96:=E8=B5=B0=E5=88=80?= =?UTF-8?q?=E9=80=A0=E5=9E=8B=E6=A7=BD=E5=92=8C=E5=B1=82=E6=9D=BF=E9=92=89?= =?UTF-8?q?=E7=9B=B8=E4=BA=A4=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Production/Product.ts | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/Production/Product.ts b/src/Production/Product.ts index 1bbba09b2..7eb932e26 100644 --- a/src/Production/Product.ts +++ b/src/Production/Product.ts @@ -508,14 +508,23 @@ export namespace Production let ep = nail.Position.add(nor).applyMatrix4(br.OCSInv); let [z0, z1] = sp.z < ep.z ? [sp.z, ep.z] : [ep.z, sp.z]; + let face = !equalv3(nail.Normal, brNormal, CanDrawHoleFuzz) ? FaceDirection.Front : FaceDirection.Back; + let depth = Math.min(z1, br.Thickness) - Math.max(z0, 0); + if ( Math.max(z0, 0) < Math.min(z1, br.Thickness) - 1e-6 && br.ContourCurve.PtInCurve(sp.setZ(0)) - && modelings.every(m => !m.shape.Outline.Curve.PtInCurve(sp)) + //层板钉中心点不在造型槽内 + && modelings.every(m => + { + if (m.dir !== face && (depth + m.thickness) < br.Thickness)//不相交 + return true; + + // if (m.shape.Holes.some(h => h.Curve.PtInCurve(sp))) return true; //层板钉在孤岛内 现实中应该不会有 + return !m.shape.Outline.Curve.PtInCurve(sp); + }) ) { - let face = !equalv3(nail.Normal, brNormal, CanDrawHoleFuzz) ? FaceDirection.Front : FaceDirection.Back; - let depth = Math.min(z1, br.Thickness) - Math.max(z0, 0); data.frontBackHoles.push({ type: nail.Type,