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} /> + + +