!3028 优化:排钻碰撞检测不跳过通孔,配置栏增加碰撞面长度短的优先排钻选项

pull/3044/head
林三 1 month ago committed by ChenX
parent 3a43cd763d
commit b2dcd6b882

@ -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; //如果有排钻锁就不用更新

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

@ -97,6 +97,11 @@ export class DrawConfigPanel extends React.Component<IConfigProps, {}>
checked={userConfig.autoDeviation}
onChange={() => userConfig.autoDeviation = !userConfig.autoDeviation}
/>
<Checkbox
label="排钻面长度短的优先排钻"
checked={userConfig.drillShortPrior}
onChange={() => userConfig.drillShortPrior = !userConfig.drillShortPrior}
/>
{/* <H5></H5>
<Checkbox
label="自动切割"

Loading…
Cancel
Save