From f58dd8018c6f92ad467468928cd6c29fc12dfcc8 Mon Sep 17 00:00:00 2001 From: Val Erastov Date: Tue, 19 Jul 2022 18:37:44 -0500 Subject: [PATCH] linear pattern work --- .../patternLinear/patternLinear.operation.ts | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/modules/workbenches/modeler/features/patternLinear/patternLinear.operation.ts b/modules/workbenches/modeler/features/patternLinear/patternLinear.operation.ts index d36f8679..dfb1821e 100644 --- a/modules/workbenches/modeler/features/patternLinear/patternLinear.operation.ts +++ b/modules/workbenches/modeler/features/patternLinear/patternLinear.operation.ts @@ -7,6 +7,8 @@ import { UnitVector } from "math/vector"; import { OperationDescriptor } from "cad/craft/operationPlugin"; import { MShell } from 'cad/model/mshell'; import { MDatum } from "cad/model/mdatum"; +import {Matrix3x4} from "math/matrix"; +import {SetLocation} from "cad/craft/e0/interact"; interface patternLinearParams { inputBodies: MShell[]; @@ -35,8 +37,17 @@ export const PatternLinearOperation: OperationDescriptor = console.log(newDatum); params.inputBodies.forEach((shellToPatern, index) => { - const newShellName = shellToPatern.id + ":patern" + index; + + shellToPatern.csys; + + const trVec = params.direction.multiply(params.distance); + + const tr = new Matrix3x4().setTranslation(trVec.x, trVec.y, trVec.z); + + const newShellName = shellToPatern.id + ":patern/" + index; oci.copy(shellToPatern, newShellName); + SetLocation(newShellName, tr.toFlatArray()); + //oci.step(); //oci.tmirror(newShellName, ...params.face.csys.origin.data(), ...params.face.csys.z.normalize().data()); created.push(occ.io.getShell(newShellName));