mirror of
https://github.com/xibyte/jsketcher
synced 2025-12-06 08:25:19 +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> = {
|
||||
id: 'DELETE_BODY',
|
||||
label: 'DeleteBody',
|
||||
icon: 'img/cad/intersection',
|
||||
icon: 'img/cad/deleteBody',
|
||||
info: 'Delete Bodies',
|
||||
paramsInfo: ({ tools, DeleteBody }) => `(${r(tools)} ${r(DeleteBody)})`,
|
||||
run: (params: DeleteBodyParams, ctx: ApplicationContext) => {
|
||||
|
|
|
|||
|
|
@ -7,8 +7,6 @@ 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[];
|
||||
|
|
@ -33,23 +31,15 @@ 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);
|
||||
|
||||
const trVec = params.direction.multiply(distanceForInstance);
|
||||
|
||||
const tr = new Matrix3x4().setTranslation(trVec.x, trVec.y, trVec.z);
|
||||
|
||||
const newShellName = shellToPatern.id + ":patern/" + index + "/" +i;
|
||||
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));
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
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