diff --git a/src/Add-on/DrawDrilling/DrawDrillingTool.ts b/src/Add-on/DrawDrilling/DrawDrillingTool.ts index 975dc2b8c..e003a38f4 100644 --- a/src/Add-on/DrawDrilling/DrawDrillingTool.ts +++ b/src/Add-on/DrawDrilling/DrawDrillingTool.ts @@ -782,6 +782,8 @@ export class DrawDrillingTool extends Singleton let drillBox = drill.BoundingBox; if (this.m_Face.InterBoard.Grooves.some(groove => groove.BoundingBox.intersect(drillBox).Volume > 0)) return true; + if (this.m_Face.LocalBoard.Grooves.some(groove => groove.BoundingBox.intersect(drillBox).Volume > 0)) + return true; } return false; }; @@ -796,9 +798,9 @@ export class DrawDrillingTool extends Singleton Log(`${this.m_Face.LocalBoard.Name}-${this.m_Face.InterBoard.Name}有${isWoodPinss ? "木梢" : "通孔排钻"}偏移后与造型碰撞,跳过绘制`); needRemoveDrillList.add(hole); } - //偏移后判断是否在两个板件外面 #I7NPAV - else if (!CyHoleInBoard(moveAfterDrills, this.m_Face.InterBoard, this.m_Face.InterBoard.OCSInv) && - !CyHoleInBoard(moveAfterDrills, this.m_Face.LocalBoard, this.m_Face.LocalBoard.OCSInv)) + //偏移后判断是否在两个排钻板件的外面 #I7NPAV + else if (!CyHoleInBoard(moveAfterDrills, this.m_Face.InterBoard, this.m_Face.InterBoard.OCSInv, true) && + !CyHoleInBoard(moveAfterDrills, this.m_Face.LocalBoard, this.m_Face.LocalBoard.OCSInv, true)) { Log(`${this.m_Face.LocalBoard.Name}-${this.m_Face.InterBoard.Name}有${isWoodPinss ? "木梢" : "通孔排钻"}偏移后在板件外,跳过绘制`); needRemoveDrillList.add(hole); diff --git a/src/Add-on/DrawDrilling/HoleUtils.ts b/src/Add-on/DrawDrilling/HoleUtils.ts index 1570b011c..7135f4f14 100644 --- a/src/Add-on/DrawDrilling/HoleUtils.ts +++ b/src/Add-on/DrawDrilling/HoleUtils.ts @@ -14,9 +14,9 @@ import { DrillType } from "./DrillType"; export const SCALAR = 0.1; -export function CyHoleInBoard(cys: CylinderHole[], br: Board, ocs: Matrix4) +export function CyHoleInBoard(cys: CylinderHole[], br: Board, ocs: Matrix4, checkAll = false) { - if (cys.length === 1 && cys[0].Type === GangDrillType.Ymj) + if (!checkAll && cys.length === 1 && cys[0].Type === GangDrillType.Ymj) return true; const outline = br.ContourCurve;