From b2dcd6b882d23336d7b605e5dc69413335893fe3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9E=97=E4=B8=89?= <940119273@qq.com> Date: Fri, 30 Aug 2024 01:52:46 +0000 Subject: [PATCH] =?UTF-8?q?!3028=20=E4=BC=98=E5=8C=96:=E6=8E=92=E9=92=BB?= =?UTF-8?q?=E7=A2=B0=E6=92=9E=E6=A3=80=E6=B5=8B=E4=B8=8D=E8=B7=B3=E8=BF=87?= =?UTF-8?q?=E9=80=9A=E5=AD=94=EF=BC=8C=E9=85=8D=E7=BD=AE=E6=A0=8F=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E7=A2=B0=E6=92=9E=E9=9D=A2=E9=95=BF=E5=BA=A6=E7=9F=AD?= =?UTF-8?q?=E7=9A=84=E4=BC=98=E5=85=88=E6=8E=92=E9=92=BB=E9=80=89=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Add-on/DrawDrilling/DrawDrillingTool.ts | 13 +++++++++++-- src/Editor/UserConfig.ts | 12 ++++++++++-- .../Modal/OptionModal/DrawConfigPanel.tsx | 5 +++++ 3 files changed, 26 insertions(+), 4 deletions(-) diff --git a/src/Add-on/DrawDrilling/DrawDrillingTool.ts b/src/Add-on/DrawDrilling/DrawDrillingTool.ts index 77f936bf4..ca7af57ee 100644 --- a/src/Add-on/DrawDrilling/DrawDrillingTool.ts +++ b/src/Add-on/DrawDrilling/DrawDrillingTool.ts @@ -968,9 +968,11 @@ export class DrawDrillingTool extends Singleton return; } + //refDrillList是除了当前生成的排钻外 InterBoard和LocalBoard上所有排钻 let refDrillList: ObjectId[][] = []; - let localDrills = locaBoard.__OriginalEnt__ ? locaBoard.__OriginalEnt__.DrillList : locaBoard.DrillList; + //加入本地的板件排钻测试通孔 + let localDrills = locaBoard.__OriginalEnt__ ? locaBoard.__OriginalEnt__.DrillList : locaBoard.DrillList; for (let [id, v] of localDrills) { if (id && id.Object) @@ -1354,6 +1356,7 @@ export class DrawDrillingTool extends Singleton } } + //refDrillList是除了当前生成的排钻外 InterBoard和LocalBoard上所有排钻 for (let refDr of refDrillList) { if (this._AutoDeviation) @@ -1371,7 +1374,8 @@ export class DrawDrillingTool extends Singleton } else { - if (this.IsTk(refDr)) continue; + // 需要检查所有的排钻 + // if (this.IsTk(refDr)) continue; let bs2 = this.GetDrillsBox(refDr, faceOcsInv); //#I1FFNB @@ -1455,6 +1459,11 @@ export class DrawDrillingTool extends Singleton this._isDrillTouch = false; this._HasAutoDeviation = false; + //碰撞面短的优先排钻 + if (userConfig.drillShortPrior) + checkRes.CollisonFaces.sort((f1, f2) => f1.Length - f2.Length); + + for (let f of checkRes.CollisonFaces) { if (f.InterBoard.DrillLock || f.InterBoard.DrillAssociationLock.has(f.LocalBoard.Id)) continue; //如果有排钻锁就不用更新 diff --git a/src/Editor/UserConfig.ts b/src/Editor/UserConfig.ts index 9888848e2..0daa9b79a 100644 --- a/src/Editor/UserConfig.ts +++ b/src/Editor/UserConfig.ts @@ -53,7 +53,7 @@ export interface IChat export class UserConfig implements IConfigStore { - private readonly _version = 44; //🌟🌟每次更新必须向上添加一次版本号🌟🌟 + private readonly _version = 45; //🌟🌟每次更新必须向上添加一次版本号🌟🌟 @observable designer = ""; //一键布局的设计师 _renderType: RenderType = RenderType.Wireframe; @observable maxSize: IMaxSizeProps = { @@ -197,7 +197,9 @@ export class UserConfig implements IConfigStore @observable throughModelSegmentedDrill: boolean = false;//挖穿造型分段排钻 @observable brRelativePosChangeCount: boolean = true; //绘制层板时等分切换靠上靠下时数量变成1,立板背板同理 - @observable autoDeviation: boolean = false; + @observable autoDeviation: boolean = false;//排钻自动偏移 + @observable drillShortPrior: boolean = false;//排钻的碰撞面短的优先排钻 + constructor() { this.Init(); @@ -315,6 +317,7 @@ export class UserConfig implements IConfigStore ARC_DRAW_CONFIG.ARC_RADIUS_MIN = this.splitParams.ARC_RADIUS_MIN; ARC_DRAW_CONFIG.Arc_MinSplitCount = this.splitParams.Arc_MinSplitCount; ARC_DRAW_CONFIG.ARC_MaxSplitCount = this.splitParams.ARC_MaxSplitCount; + this.drillShortPrior = false; } SaveConfig() { @@ -377,6 +380,7 @@ export class UserConfig implements IConfigStore brRelativePosChangeCount: this.brRelativePosChangeCount, autoDeviation: this.autoDeviation, splitParams: toJS(this.splitParams), + drillShortPrior: this.drillShortPrior, } }; } @@ -581,6 +585,10 @@ export class UserConfig implements IConfigStore ARC_DRAW_CONFIG.Arc_MinSplitCount = this.splitParams.Arc_MinSplitCount; ARC_DRAW_CONFIG.ARC_MaxSplitCount = this.splitParams.ARC_MaxSplitCount; } + if (config.option.version > 44) + { + this.drillShortPrior = config.option.drillShortPrior; + } } } diff --git a/src/UI/Components/Modal/OptionModal/DrawConfigPanel.tsx b/src/UI/Components/Modal/OptionModal/DrawConfigPanel.tsx index c10546a27..e16186606 100644 --- a/src/UI/Components/Modal/OptionModal/DrawConfigPanel.tsx +++ b/src/UI/Components/Modal/OptionModal/DrawConfigPanel.tsx @@ -97,6 +97,11 @@ export class DrawConfigPanel extends React.Component checked={userConfig.autoDeviation} onChange={() => userConfig.autoDeviation = !userConfig.autoDeviation} /> + userConfig.drillShortPrior = !userConfig.drillShortPrior} + /> {/*
板件绘图配置