mirror of
https://github.com/xibyte/jsketcher
synced 2025-12-06 16:33:15 +01:00
add icons for delete body and import commands
This commit is contained in:
parent
78c89d16d0
commit
c7b0cf541b
4 changed files with 9 additions and 19 deletions
|
|
@ -11,7 +11,7 @@ interface DeleteBodyParams {
|
||||||
export const DeleteBodyOperation: OperationDescriptor<DeleteBodyParams> = {
|
export const DeleteBodyOperation: OperationDescriptor<DeleteBodyParams> = {
|
||||||
id: 'DELETE_BODY',
|
id: 'DELETE_BODY',
|
||||||
label: 'DeleteBody',
|
label: 'DeleteBody',
|
||||||
icon: 'img/cad/intersection',
|
icon: 'img/cad/deleteBody',
|
||||||
info: 'Delete Bodies',
|
info: 'Delete Bodies',
|
||||||
paramsInfo: ({ tools, DeleteBody }) => `(${r(tools)} ${r(DeleteBody)})`,
|
paramsInfo: ({ tools, DeleteBody }) => `(${r(tools)} ${r(DeleteBody)})`,
|
||||||
run: (params: DeleteBodyParams, ctx: ApplicationContext) => {
|
run: (params: DeleteBodyParams, ctx: ApplicationContext) => {
|
||||||
|
|
|
||||||
|
|
@ -7,8 +7,6 @@ import { UnitVector } from "math/vector";
|
||||||
import { OperationDescriptor } from "cad/craft/operationPlugin";
|
import { OperationDescriptor } from "cad/craft/operationPlugin";
|
||||||
import { MShell } from 'cad/model/mshell';
|
import { MShell } from 'cad/model/mshell';
|
||||||
import { MDatum } from "cad/model/mdatum";
|
import { MDatum } from "cad/model/mdatum";
|
||||||
import {Matrix3x4} from "math/matrix";
|
|
||||||
import {SetLocation} from "cad/craft/e0/interact";
|
|
||||||
|
|
||||||
interface patternLinearParams {
|
interface patternLinearParams {
|
||||||
inputBodies: MShell[];
|
inputBodies: MShell[];
|
||||||
|
|
@ -33,23 +31,15 @@ export const PatternLinearOperation: OperationDescriptor<patternLinearParams> =
|
||||||
|
|
||||||
let created = [];
|
let created = [];
|
||||||
|
|
||||||
|
const newDatum = new MDatum({});
|
||||||
|
console.log(newDatum);
|
||||||
|
|
||||||
params.inputBodies.forEach((shellToPatern, index) => {
|
params.inputBodies.forEach((shellToPatern, index) => {
|
||||||
for (let i = 2; i <= params.qty; i++) {
|
const newShellName = shellToPatern.id + ":patern" + index;
|
||||||
let distanceForInstance = 0;
|
oci.copy(shellToPatern, newShellName);
|
||||||
if(params.patternMethod == 'Step Distance') distanceForInstance =params.distance*(i-1);
|
//oci.step();
|
||||||
if(params.patternMethod == 'Span Distance') distanceForInstance =(params.distance / (params.qty-1))*(i-1);
|
//oci.tmirror(newShellName, ...params.face.csys.origin.data(), ...params.face.csys.z.normalize().data());
|
||||||
|
created.push(occ.io.getShell(newShellName));
|
||||||
const trVec = params.direction.multiply(distanceForInstance);
|
|
||||||
|
|
||||||
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());
|
|
||||||
|
|
||||||
created.push(occ.io.getShell(newShellName));
|
|
||||||
}
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
|
|
||||||
Binary file not shown.
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 4.6 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 4.6 KiB |
Loading…
Reference in a new issue