优化:避免0长度的板不能回归成正常板(通过双击修改)

pull/1461/MERGE
ChenX 4 years ago
parent a91098f417
commit 426846e493

@ -471,6 +471,10 @@ export class BoardFindModify implements Command
{
if (isChangeHole)
SetRectHighDrill(br, drillOption);
//避免板件变0长度后,不能还原成正常的板
if (br.ContourCurve.EndParam < 4)
br.ConverToRectSolid();
}
br.AutoUpdate = oldAutoUpdate;
@ -557,7 +561,7 @@ export class BoardFindModify implements Command
}
if (removeType === EFindType.RemoveModelingAndSpecial || removeType === EFindType.RemoveSpecialShape)
{
if (br.IsSpecialShape)
if (br.IsSpecialShape || br.ContourCurve.EndParam < 4)//0长度的板会造成是矩形,但是终点参数小于4的问题
br.ConverToRectSolid();
}
}

@ -1333,6 +1333,8 @@ export class Board extends ExtrudeSolid
this.OffsetPathCache.clear();
this._2D3DPathObject = null;
// if (this.width === 0 || this.height === 0) //板件变成0长度,无法绘制
// this._isErase = true;
}
WriteFile(file: CADFiler)
{

@ -198,7 +198,7 @@ export function AddCommonBoardProps(Com: React.ComponentType<ICommonOptionProps>
let board = this.CurrentBoard;
let oldAutoUpdate = board.AutoUpdate;
board.AutoUpdate = false;
let isRect = !board.IsSpecialShape;
let isRect = !board.IsSpecialShape && board.ContourCurve.EndParam > 3;//避免0长度的板件修改后还原不回去
let oldDrillType = board.BoardProcessOption.drillType;
let remarks: [string, string][] = [];

Loading…
Cancel
Save