mirror of
https://github.com/xibyte/jsketcher
synced 2025-12-06 16:33:15 +01:00
Patern qty working for linear patern.
This commit is contained in:
parent
de8268abb5
commit
54741d5712
2 changed files with 16 additions and 16 deletions
|
|
@ -33,24 +33,24 @@ export const PatternLinearOperation: OperationDescriptor<patternLinearParams> =
|
|||
|
||||
let created = [];
|
||||
|
||||
const newDatum = new MDatum({});
|
||||
console.log(newDatum);
|
||||
|
||||
params.inputBodies.forEach((shellToPatern, index) => {
|
||||
for (let i = 2; i <= params.qty; i++) {
|
||||
let distanceForInstance = 0;
|
||||
if(params.patternMethod == 'Step Distance') distanceForInstance =params.distance*(i-1);
|
||||
if(params.patternMethod == 'Span Distance') distanceForInstance =(params.distance / (params.qty-1))*(i-1);
|
||||
|
||||
shellToPatern.csys;
|
||||
console.log(i,distanceForInstance);
|
||||
const trVec = params.direction.multiply(distanceForInstance);
|
||||
|
||||
const trVec = params.direction.multiply(params.distance);
|
||||
const tr = new Matrix3x4().setTranslation(trVec.x, trVec.y, trVec.z);
|
||||
|
||||
const tr = new Matrix3x4().setTranslation(trVec.x, trVec.y, trVec.z);
|
||||
const newShellName = shellToPatern.id + ":patern/" + index + "/" +i;
|
||||
oci.copy(shellToPatern, newShellName);
|
||||
SetLocation(newShellName, tr.toFlatArray());
|
||||
|
||||
const newShellName = shellToPatern.id + ":patern/" + index;
|
||||
oci.copy(shellToPatern, newShellName);
|
||||
SetLocation(newShellName, tr.toFlatArray());
|
||||
created.push(occ.io.getShell(newShellName));
|
||||
}
|
||||
|
||||
//oci.step();
|
||||
//oci.tmirror(newShellName, ...params.face.csys.origin.data(), ...params.face.csys.z.normalize().data());
|
||||
created.push(occ.io.getShell(newShellName));
|
||||
});
|
||||
|
||||
return {
|
||||
|
|
|
|||
|
|
@ -61,8 +61,8 @@ export const PatternRadialOperation: OperationDescriptor<patternRadialParams> =
|
|||
label: 'Pattern Method',
|
||||
name: "patternMethod",
|
||||
style: "dropdown",
|
||||
defaultValue: "Step Distance",
|
||||
values: ['Step Distance', 'Span Distance',],
|
||||
defaultValue: "Step Angle",
|
||||
values: ['Step Angle', 'Span Angle',],
|
||||
},
|
||||
{
|
||||
type: 'number',
|
||||
|
|
|
|||
Loading…
Reference in a new issue