From e509423413b1334eec36de72f6ade354356e08cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9E=97=E4=B8=89?= <940119273@qq.com> Date: Mon, 2 Sep 2024 01:04:13 +0000 Subject: [PATCH] =?UTF-8?q?!3043=20=E4=BC=98=E5=8C=96:=E6=8E=92=E9=92=BB?= =?UTF-8?q?=E6=99=BA=E8=83=BD=E5=81=8F=E7=A7=BB=E9=95=BF=E5=BA=A6=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E5=88=B0=E9=85=8D=E7=BD=AE=E6=A0=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Add-on/DrawDrilling/DrawDrillingTool.ts | 3 ++- .../HostApplicationServices.ts | 1 + src/Editor/UserConfig.ts | 9 +++++++- .../Components/Modal/ModalStyle/Config.less | 4 ++++ .../Modal/OptionModal/DrawConfigPanel.tsx | 22 +++++++++++++++++++ 5 files changed, 37 insertions(+), 2 deletions(-) diff --git a/src/Add-on/DrawDrilling/DrawDrillingTool.ts b/src/Add-on/DrawDrilling/DrawDrillingTool.ts index aa0540c5c..c70dd2ade 100644 --- a/src/Add-on/DrawDrilling/DrawDrillingTool.ts +++ b/src/Add-on/DrawDrilling/DrawDrillingTool.ts @@ -1603,7 +1603,8 @@ export class DrawDrillingTool extends Singleton } //适用于距离大于200 - this._AutoDeviation = !this.m_Option.haveDist && !this.m_Option.useTemp && HostApplicationServices.autoDeviation && this.m_Face.Length > 200; + this._AutoDeviation = !this.m_Option.haveDist && !this.m_Option.useTemp && + HostApplicationServices.autoDeviation && this.m_Face.Length >= HostApplicationServices.autoDeviationMinDist; //智能偏移获取可以放置排钻的区间 if (this._AutoDeviation) diff --git a/src/ApplicationServices/HostApplicationServices.ts b/src/ApplicationServices/HostApplicationServices.ts index a841eb817..14a9e4268 100644 --- a/src/ApplicationServices/HostApplicationServices.ts +++ b/src/ApplicationServices/HostApplicationServices.ts @@ -127,6 +127,7 @@ export class IHostApplicationServices @ProxyValue fractionDigitsType: FractionDigitsType = FractionDigitsType.two; @ProxyValue throughModelSegmentedDrill = false; //挖穿造型分段排钻 @ProxyValue autoDeviation = false; //排钻碰撞智能偏移 + @ProxyValue autoDeviationMinDist = 200; //排钻碰撞智能偏移最小排钻面长度 private constructor() { }; diff --git a/src/Editor/UserConfig.ts b/src/Editor/UserConfig.ts index 0daa9b79a..8b3f8087b 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 = 45; //🌟🌟每次更新必须向上添加一次版本号🌟🌟 + private readonly _version = 46; //🌟🌟每次更新必须向上添加一次版本号🌟🌟 @observable designer = ""; //一键布局的设计师 _renderType: RenderType = RenderType.Wireframe; @observable maxSize: IMaxSizeProps = { @@ -198,6 +198,7 @@ export class UserConfig implements IConfigStore @observable brRelativePosChangeCount: boolean = true; //绘制层板时等分切换靠上靠下时数量变成1,立板背板同理 @observable autoDeviation: boolean = false;//排钻自动偏移 + @observable autoDeviationMinDist: number = 200; //排钻自动偏移的最小排钻面 @observable drillShortPrior: boolean = false;//排钻的碰撞面短的优先排钻 constructor() @@ -318,6 +319,7 @@ export class UserConfig implements IConfigStore ARC_DRAW_CONFIG.Arc_MinSplitCount = this.splitParams.Arc_MinSplitCount; ARC_DRAW_CONFIG.ARC_MaxSplitCount = this.splitParams.ARC_MaxSplitCount; this.drillShortPrior = false; + this.autoDeviationMinDist = 200; } SaveConfig() { @@ -381,6 +383,7 @@ export class UserConfig implements IConfigStore autoDeviation: this.autoDeviation, splitParams: toJS(this.splitParams), drillShortPrior: this.drillShortPrior, + autoDeviationMinDist: this.autoDeviationMinDist, } }; } @@ -589,6 +592,10 @@ export class UserConfig implements IConfigStore { this.drillShortPrior = config.option.drillShortPrior; } + if (config.option.version > 45) + { + this.autoDeviationMinDist = config.option.autoDeviationMinDist; + } } } diff --git a/src/UI/Components/Modal/ModalStyle/Config.less b/src/UI/Components/Modal/ModalStyle/Config.less index 50fae2753..c7e4df9ab 100644 --- a/src/UI/Components/Modal/ModalStyle/Config.less +++ b/src/UI/Components/Modal/ModalStyle/Config.less @@ -37,4 +37,8 @@ } } } + + .autoDeviationMinDist{ + width: 50px; + } } diff --git a/src/UI/Components/Modal/OptionModal/DrawConfigPanel.tsx b/src/UI/Components/Modal/OptionModal/DrawConfigPanel.tsx index e16186606..0a017bf4d 100644 --- a/src/UI/Components/Modal/OptionModal/DrawConfigPanel.tsx +++ b/src/UI/Components/Modal/OptionModal/DrawConfigPanel.tsx @@ -29,6 +29,7 @@ export class DrawConfigPanel extends React.Component private printResolution = userConfig.printOption.printResolution; private noLid = userConfig.hingeLidRule.noLid; private allLid = userConfig.hingeLidRule.allLid; + private autoDeviationMinDist = userConfig.autoDeviationMinDist; _oldShowLine: boolean; _oldShowOpenDirLine: boolean; @@ -94,9 +95,30 @@ export class DrawConfigPanel extends React.Component /> userConfig.autoDeviation = !userConfig.autoDeviation} /> + + +