|
|
|
@ -424,6 +424,10 @@ export async function InitTempateBoardThicknessActions(template: TemplateRecord,
|
|
|
|
|
|
|
|
|
|
for (let br of brs)
|
|
|
|
|
{
|
|
|
|
|
//板件中心
|
|
|
|
|
let boardCenter = new Vector3(br.Width, br.Height, br.Thickness).multiplyScalar(.5);
|
|
|
|
|
boardCenter.applyMatrix4(br.OCS);
|
|
|
|
|
|
|
|
|
|
let p: Vector3;
|
|
|
|
|
if (!autoCalculate)
|
|
|
|
|
{
|
|
|
|
@ -431,10 +435,6 @@ export async function InitTempateBoardThicknessActions(template: TemplateRecord,
|
|
|
|
|
app.Viewer.OutlinePass.selectedObjects = [br.DrawObject];
|
|
|
|
|
app.Editor.UpdateScreen();
|
|
|
|
|
|
|
|
|
|
//板件中心
|
|
|
|
|
let boardCenter = new Vector3(br.Width, br.Height, br.Thickness).multiplyScalar(.5);
|
|
|
|
|
boardCenter.applyMatrix4(br.OCS);
|
|
|
|
|
|
|
|
|
|
//设置UCS
|
|
|
|
|
app.Editor.UCSMatrix = br.OCS;
|
|
|
|
|
|
|
|
|
@ -453,8 +453,9 @@ export async function InitTempateBoardThicknessActions(template: TemplateRecord,
|
|
|
|
|
else
|
|
|
|
|
p = center.clone();
|
|
|
|
|
|
|
|
|
|
let v = p.sub(boardCenter).applyMatrix4(br.OCSInv.setPosition(ZeroVec));
|
|
|
|
|
//构建板厚动作
|
|
|
|
|
GeneralBoardThicknessAction(br, p, scsInv, brs, directionMap);
|
|
|
|
|
GeneralBoardThicknessAction(br, v, scsInv, brs, directionMap);
|
|
|
|
|
}
|
|
|
|
|
let action = new TempateThicknessAction();
|
|
|
|
|
action.EntityDirectionMap = directionMap;
|
|
|
|
@ -469,15 +470,13 @@ export async function InitTempateBoardThicknessActions(template: TemplateRecord,
|
|
|
|
|
/**
|
|
|
|
|
* 构建板厚动作
|
|
|
|
|
* @param br 需要构建的板件
|
|
|
|
|
* @param p wcs点,确定板厚变厚方向
|
|
|
|
|
* @param v wcs点,确定板厚变厚方向
|
|
|
|
|
* @param scsInv 模块坐标系逆矩阵
|
|
|
|
|
* @param brs 模块所有的板件列表
|
|
|
|
|
* @param directionMap 板厚动作数据
|
|
|
|
|
*/
|
|
|
|
|
function GeneralBoardThicknessAction(br: Board, p: Vector3, scsInv: Matrix4, brs: Board[], directionMap: Map<ObjectId, ThicknessActionData>)
|
|
|
|
|
function GeneralBoardThicknessAction(br: Board, v: Vector3, scsInv: Matrix4, brs: Board[], directionMap: Map<ObjectId, ThicknessActionData>)
|
|
|
|
|
{
|
|
|
|
|
p.applyMatrix4(br.OCSInv);
|
|
|
|
|
|
|
|
|
|
let direction: ThicknessDirection;
|
|
|
|
|
let actions: TemplateAction[] = [];
|
|
|
|
|
|
|
|
|
@ -524,7 +523,7 @@ function GeneralBoardThicknessAction(br: Board, p: Vector3, scsInv: Matrix4, brs
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//判断拉伸方向
|
|
|
|
|
if (equaln(p.z, 0))//居中
|
|
|
|
|
if (equaln(v.z, 0))//居中
|
|
|
|
|
{
|
|
|
|
|
direction = ThicknessDirection.Center;
|
|
|
|
|
|
|
|
|
@ -540,7 +539,7 @@ function GeneralBoardThicknessAction(br: Board, p: Vector3, scsInv: Matrix4, brs
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
if (p.z > 0)
|
|
|
|
|
if (v.z > 0)
|
|
|
|
|
{
|
|
|
|
|
direction = ThicknessDirection.Front;
|
|
|
|
|
let frontAction = new TemplateStretchGripAction(frontVec);
|
|
|
|
@ -626,9 +625,9 @@ export async function UpdateTempateBoardThicknessAction(template: TemplateRecord
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
let p = ptRes.Point;
|
|
|
|
|
let v = ptRes.Point.sub(boardCenter).applyMatrix4(br.OCSInv.setPosition(ZeroVec));
|
|
|
|
|
//构建板厚动作
|
|
|
|
|
GeneralBoardThicknessAction(br, p, scsInv, brs, thicknessAction.EntityDirectionMap);
|
|
|
|
|
GeneralBoardThicknessAction(br, v, scsInv, brs, thicknessAction.EntityDirectionMap);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//还原
|
|
|
|
|