!3043 优化:排钻智能偏移长度增加到配置栏

pull/3050/MERGE
林三 1 month ago committed by ChenX
parent 134a1748b7
commit e509423413

@ -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)

@ -127,6 +127,7 @@ export class IHostApplicationServices
@ProxyValue fractionDigitsType: FractionDigitsType = FractionDigitsType.two;
@ProxyValue throughModelSegmentedDrill = false; //挖穿造型分段排钻
@ProxyValue autoDeviation = false; //排钻碰撞智能偏移
@ProxyValue autoDeviationMinDist = 200; //排钻碰撞智能偏移最小排钻面长度
private constructor() { };

@ -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;
}
}
}

@ -37,4 +37,8 @@
}
}
}
.autoDeviationMinDist{
width: 50px;
}
}

@ -29,6 +29,7 @@ export class DrawConfigPanel extends React.Component<IConfigProps, {}>
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<IConfigProps, {}>
/>
<Checkbox
label="排钻碰撞智能偏移"
style={{ marginBottom: 3 }}
checked={userConfig.autoDeviation}
onChange={() => userConfig.autoDeviation = !userConfig.autoDeviation}
/>
<Tooltip content={"排钻面距离小于该值时,不会智能偏移"} position='top'>
<Label className={Classes.INLINE}>
<span style={{ width: "7rem" }}></span>
<ToasterInput
type={CheckObjectType.GT0Num}
inputClassName="autoDeviationMinDist"
option={userConfig}
optKey={"autoDeviationMinDist"}
isDisabled={!userConfig.autoDeviation}
onChange={(e) => { userConfig.autoDeviationMinDist = Number(e.target.value); }}
onBlur={(e, hasErr) =>
{
if (hasErr)
userConfig.autoDeviationMinDist = this.autoDeviationMinDist;
else
this.autoDeviationMinDist = userConfig.autoDeviationMinDist;
}}
/>
</Label>
</Tooltip>
<Checkbox
label="排钻面长度短的优先排钻"
checked={userConfig.drillShortPrior}

Loading…
Cancel
Save