diff --git a/src/Add-on/DrawDrilling/DrawDrillingTool.ts b/src/Add-on/DrawDrilling/DrawDrillingTool.ts index afd37196e..3aabb210b 100644 --- a/src/Add-on/DrawDrilling/DrawDrillingTool.ts +++ b/src/Add-on/DrawDrilling/DrawDrillingTool.ts @@ -52,6 +52,7 @@ export class DrawDrillingTool extends Singleton @observable private _collsionFaces: Face[] = []; private _hasBackupOption = false; private _useBackup = false; + private _isDrillTouch = false;//排钻与造型碰撞 constructor() { super(); @@ -462,7 +463,6 @@ export class DrawDrillingTool extends Singleton const Mid = (this.m_Face.InterBoard.__OriginalEnt__ ?? this.m_Face.InterBoard).Id; const Fid = (this.m_Face.LocalBoard.__OriginalEnt__ ?? this.m_Face.LocalBoard).Id; - let isDrillTouch = false; for (let dist of this.m_MoveDistList) { @@ -473,7 +473,8 @@ export class DrawDrillingTool extends Singleton } if (this.CheckModelingCollision(localBox3, intBox3, dist)) { - isDrillTouch = true; + this._isDrillTouch = true; + Log(`${this.m_Face.LocalBoard.Name}-${this.m_Face.InterBoard.Name}有排钻与造型碰撞,跳过绘制`); continue; } @@ -498,12 +499,6 @@ export class DrawDrillingTool extends Singleton newDrillentList.push(newDrillEnts); } - if (isDrillTouch) - AppToaster.show({ - message: `${this.m_Face.LocalBoard.Name}-${this.m_Face.InterBoard.Name}有排钻与造型碰撞,跳过绘制`, - timeout: 5000, - intent: Intent.DANGER, - }); let startDist = this.m_MoveDistList[0]; let endDist = arrayLast(this.m_MoveDistList); @@ -972,12 +967,23 @@ export class DrawDrillingTool extends Singleton { let checkRes = new CollisionDetection(await this.GetSpliteBoards(brs)); + this._isDrillTouch = false; + for (let f of checkRes.CollisonFaces) { this.Exec(f, false); if (this._useBackup) this.Exec(f, true); } + + if (this._isDrillTouch) + { + AppToaster.show({ + message: `有部分排钻与造型碰撞,跳过绘制,详情查看左下角`, + timeout: 5000, + intent: Intent.DANGER, + }); + } } private Exec(f: Face, isBackup = false)