优化:AutoDimBrs在某些柜体坐标系错误的情况下标注位置在柜子最前方

pull/2079/MERGE
ChenX 2 years ago
parent e0e289f1d3
commit b86f112ca6

@ -134,6 +134,9 @@ export class DimBoards
let backReg = new Region;//背板面域 let backReg = new Region;//背板面域
let lcReg = new Region;//立板层板面域 let lcReg = new Region;//立板层板面域
let minY = Infinity;//把标注移动到柜子的最前面(而不是柜子的某个板的模块坐标系)
//板件轮廓 //板件轮廓
for (let br of brs) for (let br of brs)
{ {
@ -150,8 +153,15 @@ export class DimBoards
let pl = new Polyline().RectangleFrom2Pt(new Vector3(brBox.min.x, brBox.min.z), new Vector3(brBox.max.x, brBox.max.z)); let pl = new Polyline().RectangleFrom2Pt(new Vector3(brBox.min.x, brBox.min.z), new Vector3(brBox.max.x, brBox.max.z));
lcReg.BooleanOper(Region.CreateFromCurves([pl]), BoolOpeartionType.Union); lcReg.BooleanOper(Region.CreateFromCurves([pl]), BoolOpeartionType.Union);
} }
minY = Math.min(brBox.min.y, minY);
} }
//修正坐标系基点 保证在柜子的最前面
spaceFrontCS.elements[12] -= minY * y.x;
spaceFrontCS.elements[13] -= minY * y.y;
spaceFrontCS.elements[14] -= minY * y.z;
//并集 //并集
let reg = backReg.Clone(); let reg = backReg.Clone();
reg.BooleanOper(lcReg.Clone(), BoolOpeartionType.Union); reg.BooleanOper(lcReg.Clone(), BoolOpeartionType.Union);

Loading…
Cancel
Save