mirror of
https://github.com/xibyte/jsketcher
synced 2025-12-15 12:53:52 +01:00
removed old unused workbench code
This commit is contained in:
parent
3dea461392
commit
2e59beef3c
16 changed files with 51 additions and 15823 deletions
15120
package-lock.json
generated
15120
package-lock.json
generated
File diff suppressed because it is too large
Load diff
|
|
@ -1,43 +0,0 @@
|
|||
import { ApplicationContext } from 'context';
|
||||
import { MBrepShell } from 'cad/model/mshell';
|
||||
import { roundValueForPresentation as r } from 'cad/craft/operationHelper';
|
||||
import { occ2brep } from 'cad/occ/occ2models';
|
||||
import {readSketch, readSketchContour} from "cad/craft/e0/common";
|
||||
|
||||
export default {
|
||||
id: 'extrude',
|
||||
label: 'extrude',
|
||||
icon: 'img/cad/extrude',
|
||||
info: 'extrude',
|
||||
mutualExclusiveFields: [],
|
||||
paramsInfo: ({ length }) => `(${r(length)})`,
|
||||
run: (request, ctx: ApplicationContext) => {
|
||||
//const occObj = createCylinder(diameter, height, ctx.occService.occContext);
|
||||
const oc = ctx.occService.occContext;
|
||||
const face = ctx.cadRegistry.findFace(request.face);
|
||||
|
||||
let sketch = ctx.sketchStorageService.readSketch(face.id);
|
||||
if (!sketch) throw 'sketch not found for the face ' + face.id;
|
||||
let contours = sketch.fetchContours();
|
||||
|
||||
console.log(contours);
|
||||
|
||||
// const mobject = new MBrepShell(occ2brep(aRes, ctx.occService.occContext));
|
||||
return {
|
||||
consumed: [],
|
||||
created: []
|
||||
};
|
||||
},
|
||||
schema: {
|
||||
length: {
|
||||
type: 'number',
|
||||
defaultValue: 500,
|
||||
label: 'length'
|
||||
},
|
||||
face: {
|
||||
type: 'face',
|
||||
initializeBySelection: 0
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1,56 +0,0 @@
|
|||
import { ApplicationContext } from 'context';
|
||||
import { MBrepShell } from '../../../../../web/app/cad/model/mshell';
|
||||
import { roundValueForPresentation as r } from '../../../../../web/app/cad/craft/operationHelper';
|
||||
import { occ2brep } from '../../../../../web/app/cad/occ/occ2models';
|
||||
|
||||
export default {
|
||||
id: 'primitive_box',
|
||||
label: 'primitive_box',
|
||||
icon: 'img/cad/extrude',
|
||||
info: 'primitive_box',
|
||||
mutualExclusiveFields: [],
|
||||
paramsInfo: ({ boxX, boxY, boxZ }) => `(${r(boxX)} ${r(boxY)}) ${r(boxZ)})`,
|
||||
run: ({ boxX, boxY, boxZ }, ctx: ApplicationContext) => {
|
||||
//const occObj = createCylinder(diameter, height, ctx.occService.occContext);
|
||||
const oc = ctx.occService.occContext;
|
||||
|
||||
//const myLocation = new oc.gp_Pnt_3(0, 0, 0);
|
||||
//const cylinderCenterline = oc.gp.DZ();
|
||||
//const cylinderOrientationAndLocation = new oc.gp_Ax2_3(myLocation, cylinderCenterline);
|
||||
console.log(boxX, boxY, boxZ, oc.BRepPrimAPI_MakeBox_1(boxX, boxY, boxZ))
|
||||
|
||||
let myBody = new oc.BRepPrimAPI_MakeBox_1(boxX, boxY, boxZ );
|
||||
//let myBody = new oc.BRepPrimAPI_Make
|
||||
|
||||
const aRes = new oc.TopoDS_Compound();
|
||||
const aBuilder = new oc.BRep_Builder();
|
||||
aBuilder.MakeCompound(aRes);
|
||||
aBuilder.Add(aRes, myBody.Shape());
|
||||
|
||||
|
||||
|
||||
const mobject = new MBrepShell(occ2brep(aRes, ctx.occService.occContext));
|
||||
return {
|
||||
consumed: [],
|
||||
created: [mobject]
|
||||
};
|
||||
},
|
||||
schema: {
|
||||
boxX: {
|
||||
type: 'number',
|
||||
defaultValue: 200,
|
||||
label: 'X'
|
||||
},
|
||||
boxY: {
|
||||
type: 'number',
|
||||
defaultValue: 280,
|
||||
label: 'Y'
|
||||
},
|
||||
BoxZ: {
|
||||
type: 'number',
|
||||
defaultValue: 280,
|
||||
label: 'Z'
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1,50 +0,0 @@
|
|||
import { ApplicationContext } from 'context';
|
||||
import { MBrepShell } from '../../../../../web/app/cad/model/mshell';
|
||||
import { roundValueForPresentation as r } from '../../../../../web/app/cad/craft/operationHelper';
|
||||
import { occ2brep } from '../../../../../web/app/cad/occ/occ2models';
|
||||
|
||||
export default {
|
||||
id: 'primitive_cone',
|
||||
label: 'primitive_cone',
|
||||
icon: 'img/cad/extrude',
|
||||
info: 'primitive_cone',
|
||||
mutualExclusiveFields: [],
|
||||
paramsInfo: ({ diameter, height }) => `(${r(diameter)} ${r(height)})`,
|
||||
run: ({ diameter, height, }, ctx: ApplicationContext) => {
|
||||
//const occObj = createcone(diameter, height, ctx.occService.occContext);
|
||||
const oc = ctx.occService.occContext;
|
||||
|
||||
const myLocation = new oc.gp_Pnt_3(0, 0, 0);
|
||||
const coneCenterline = oc.gp.DZ();
|
||||
const coneOrientationAndLocation = new oc.gp_Ax2_3(myLocation, coneCenterline);
|
||||
|
||||
let myBody = new oc.BRepPrimAPI_MakeCone_1(10,20,100);
|
||||
//let myBody = new oc.BRepPrimAPI_Make
|
||||
|
||||
const aRes = new oc.TopoDS_Compound();
|
||||
const aBuilder = new oc.BRep_Builder();
|
||||
aBuilder.MakeCompound(aRes);
|
||||
aBuilder.Add(aRes, myBody.Shape());
|
||||
|
||||
|
||||
|
||||
const mobject = new MBrepShell(occ2brep(aRes, ctx.occService.occContext));
|
||||
return {
|
||||
consumed: [],
|
||||
created: [mobject]
|
||||
};
|
||||
},
|
||||
schema: {
|
||||
diameter: {
|
||||
type: 'number',
|
||||
defaultValue: 200,
|
||||
label: 'diameter'
|
||||
},
|
||||
height: {
|
||||
type: 'number',
|
||||
defaultValue: 280,
|
||||
label: 'height'
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1,51 +0,0 @@
|
|||
import { ApplicationContext } from 'context';
|
||||
import { MBrepShell } from '../../../../../web/app/cad/model/mshell';
|
||||
import { roundValueForPresentation as r } from '../../../../../web/app/cad/craft/operationHelper';
|
||||
import { occ2brep } from '../../../../../web/app/cad/occ/occ2models';
|
||||
|
||||
export default {
|
||||
id: 'primitive_cylinder',
|
||||
label: 'primitive_cylinder',
|
||||
icon: 'img/cad/extrude',
|
||||
info: 'primitive_cylinder',
|
||||
mutualExclusiveFields: [],
|
||||
paramsInfo: ({ diameter, height }) => `(${r(diameter)} ${r(height)})`,
|
||||
run: ({ diameter, height, }, ctx: ApplicationContext) => {
|
||||
//const occObj = createCylinder(diameter, height, ctx.occService.occContext);
|
||||
const oc = ctx.occService.occContext;
|
||||
|
||||
const myLocation = new oc.gp_Pnt_3(0, 0, 0);
|
||||
const cylinderCenterline = oc.gp.DZ();
|
||||
const cylinderOrientationAndLocation = new oc.gp_Ax2_3(myLocation, cylinderCenterline);
|
||||
|
||||
|
||||
let myBody = new oc.BRepPrimAPI_MakeCylinder_3(cylinderOrientationAndLocation, diameter, height,);
|
||||
//let myBody = new oc.BRepPrimAPI_Make
|
||||
|
||||
const aRes = new oc.TopoDS_Compound();
|
||||
const aBuilder = new oc.BRep_Builder();
|
||||
aBuilder.MakeCompound(aRes);
|
||||
aBuilder.Add(aRes, myBody.Shape());
|
||||
|
||||
|
||||
|
||||
const mobject = new MBrepShell(occ2brep(aRes, ctx.occService.occContext));
|
||||
return {
|
||||
consumed: [],
|
||||
created: [mobject]
|
||||
};
|
||||
},
|
||||
schema: {
|
||||
diameter: {
|
||||
type: 'number',
|
||||
defaultValue: 200,
|
||||
label: 'diameter'
|
||||
},
|
||||
height: {
|
||||
type: 'number',
|
||||
defaultValue: 280,
|
||||
label: 'height'
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1,46 +0,0 @@
|
|||
import { ApplicationContext } from 'context';
|
||||
import { MBrepShell } from '../../../../../web/app/cad/model/mshell';
|
||||
import { roundValueForPresentation as r } from '../../../../../web/app/cad/craft/operationHelper';
|
||||
import { occ2brep } from '../../../../../web/app/cad/occ/occ2models';
|
||||
|
||||
export default {
|
||||
id: 'primitive_sphere',
|
||||
label: 'primitive_sphere',
|
||||
icon: 'img/cad/extrude',
|
||||
info: 'primitive_sphere',
|
||||
mutualExclusiveFields: [],
|
||||
paramsInfo: ({ diameter }) => `(${r(diameter)} )`,
|
||||
run: ({ diameter, }, ctx: ApplicationContext) => {
|
||||
|
||||
const oc = ctx.occService.occContext;
|
||||
|
||||
const myLocation = new oc.gp_Pnt_3(0, 0, 0);
|
||||
const sphereCenterline = oc.gp.DZ();
|
||||
const sphereOrientationAndLocation = new oc.gp_Ax2_3(myLocation, sphereCenterline);
|
||||
|
||||
|
||||
let myBody = new oc.BRepPrimAPI_MakeSphere_1(diameter);
|
||||
//let myBody = new oc.BRepPrimAPI_Make
|
||||
|
||||
const aRes = new oc.TopoDS_Compound();
|
||||
const aBuilder = new oc.BRep_Builder();
|
||||
aBuilder.MakeCompound(aRes);
|
||||
aBuilder.Add(aRes, myBody.Shape());
|
||||
|
||||
|
||||
|
||||
const mobject = new MBrepShell(occ2brep(aRes, ctx.occService.occContext));
|
||||
return {
|
||||
consumed: [],
|
||||
created: [mobject]
|
||||
};
|
||||
},
|
||||
schema: {
|
||||
diameter: {
|
||||
type: 'number',
|
||||
defaultValue: 200,
|
||||
label: 'diameter'
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1,56 +0,0 @@
|
|||
import { ApplicationContext } from 'context';
|
||||
import { MBrepShell } from '../../../../../web/app/cad/model/mshell';
|
||||
import { roundValueForPresentation as r } from '../../../../../web/app/cad/craft/operationHelper';
|
||||
import { occ2brep } from '../../../../../web/app/cad/occ/occ2models';
|
||||
|
||||
export default {
|
||||
id: 'primitive_box',
|
||||
label: 'primitive_box',
|
||||
icon: 'img/cad/extrude',
|
||||
info: 'primitive_box',
|
||||
mutualExclusiveFields: [],
|
||||
paramsInfo: ({ boxX, boxY, boxZ }) => `(${r(boxX)} ${r(boxY)}) ${r(boxZ)})`,
|
||||
run: ({ boxX, boxY, boxZ }, ctx: ApplicationContext) => {
|
||||
//const occObj = createCylinder(diameter, height, ctx.occService.occContext);
|
||||
const oc = ctx.occService.occContext;
|
||||
|
||||
//const myLocation = new oc.gp_Pnt_3(0, 0, 0);
|
||||
//const cylinderCenterline = oc.gp.DZ();
|
||||
//const cylinderOrientationAndLocation = new oc.gp_Ax2_3(myLocation, cylinderCenterline);
|
||||
console.log(boxX, boxY, boxZ, oc.BRepPrimAPI_MakeBox_1(boxX, boxY, boxZ))
|
||||
|
||||
let myBody = new oc.BRepPrimAPI_MakeBox_1(boxX, boxY, boxZ );
|
||||
//let myBody = new oc.BRepPrimAPI_Make
|
||||
|
||||
const aRes = new oc.TopoDS_Compound();
|
||||
const aBuilder = new oc.BRep_Builder();
|
||||
aBuilder.MakeCompound(aRes);
|
||||
aBuilder.Add(aRes, myBody.Shape());
|
||||
|
||||
|
||||
|
||||
const mobject = new MBrepShell(occ2brep(aRes, ctx.occService.occContext));
|
||||
return {
|
||||
consumed: [],
|
||||
created: [mobject]
|
||||
};
|
||||
},
|
||||
schema: {
|
||||
boxX: {
|
||||
type: 'number',
|
||||
defaultValue: 200,
|
||||
label: 'X'
|
||||
},
|
||||
boxY: {
|
||||
type: 'number',
|
||||
defaultValue: 280,
|
||||
label: 'Y'
|
||||
},
|
||||
BoxZ: {
|
||||
type: 'number',
|
||||
defaultValue: 280,
|
||||
label: 'Z'
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1,50 +0,0 @@
|
|||
import { ApplicationContext } from 'context';
|
||||
import { MBrepShell } from '../../../../../web/app/cad/model/mshell';
|
||||
import { roundValueForPresentation as r } from '../../../../../web/app/cad/craft/operationHelper';
|
||||
import { occ2brep } from '../../../../../web/app/cad/occ/occ2models';
|
||||
|
||||
export default {
|
||||
id: 'primitive_cone',
|
||||
label: 'primitive_cone',
|
||||
icon: 'img/cad/extrude',
|
||||
info: 'primitive_cone',
|
||||
mutualExclusiveFields: [],
|
||||
paramsInfo: ({ diameter, height }) => `(${r(diameter)} ${r(height)})`,
|
||||
run: ({ diameter, height, }, ctx: ApplicationContext) => {
|
||||
//const occObj = createcone(diameter, height, ctx.occService.occContext);
|
||||
const oc = ctx.occService.occContext;
|
||||
|
||||
const myLocation = new oc.gp_Pnt_3(0, 0, 0);
|
||||
const coneCenterline = oc.gp.DZ();
|
||||
const coneOrientationAndLocation = new oc.gp_Ax2_3(myLocation, coneCenterline);
|
||||
|
||||
let myBody = new oc.BRepPrimAPI_MakeCone_1(10,20,100);
|
||||
//let myBody = new oc.BRepPrimAPI_Make
|
||||
|
||||
const aRes = new oc.TopoDS_Compound();
|
||||
const aBuilder = new oc.BRep_Builder();
|
||||
aBuilder.MakeCompound(aRes);
|
||||
aBuilder.Add(aRes, myBody.Shape());
|
||||
|
||||
|
||||
|
||||
const mobject = new MBrepShell(occ2brep(aRes, ctx.occService.occContext));
|
||||
return {
|
||||
consumed: [],
|
||||
created: [mobject]
|
||||
};
|
||||
},
|
||||
schema: {
|
||||
diameter: {
|
||||
type: 'number',
|
||||
defaultValue: 200,
|
||||
label: 'diameter'
|
||||
},
|
||||
height: {
|
||||
type: 'number',
|
||||
defaultValue: 280,
|
||||
label: 'height'
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1,51 +0,0 @@
|
|||
import { ApplicationContext } from 'context';
|
||||
import { MBrepShell } from '../../../../../web/app/cad/model/mshell';
|
||||
import { roundValueForPresentation as r } from '../../../../../web/app/cad/craft/operationHelper';
|
||||
import { occ2brep } from '../../../../../web/app/cad/occ/occ2models';
|
||||
|
||||
export default {
|
||||
id: 'primitive_cylinder',
|
||||
label: 'primitive_cylinder',
|
||||
icon: 'img/cad/extrude',
|
||||
info: 'primitive_cylinder',
|
||||
mutualExclusiveFields: [],
|
||||
paramsInfo: ({ diameter, height }) => `(${r(diameter)} ${r(height)})`,
|
||||
run: ({ diameter, height, }, ctx: ApplicationContext) => {
|
||||
//const occObj = createCylinder(diameter, height, ctx.occService.occContext);
|
||||
const oc = ctx.occService.occContext;
|
||||
|
||||
const myLocation = new oc.gp_Pnt_3(0, 0, 0);
|
||||
const cylinderCenterline = oc.gp.DZ();
|
||||
const cylinderOrientationAndLocation = new oc.gp_Ax2_3(myLocation, cylinderCenterline);
|
||||
|
||||
|
||||
let myBody = new oc.BRepPrimAPI_MakeCylinder_3(cylinderOrientationAndLocation, diameter, height,);
|
||||
//let myBody = new oc.BRepPrimAPI_Make
|
||||
|
||||
const aRes = new oc.TopoDS_Compound();
|
||||
const aBuilder = new oc.BRep_Builder();
|
||||
aBuilder.MakeCompound(aRes);
|
||||
aBuilder.Add(aRes, myBody.Shape());
|
||||
|
||||
|
||||
|
||||
const mobject = new MBrepShell(occ2brep(aRes, ctx.occService.occContext));
|
||||
return {
|
||||
consumed: [],
|
||||
created: [mobject]
|
||||
};
|
||||
},
|
||||
schema: {
|
||||
diameter: {
|
||||
type: 'number',
|
||||
defaultValue: 200,
|
||||
label: 'diameter'
|
||||
},
|
||||
height: {
|
||||
type: 'number',
|
||||
defaultValue: 280,
|
||||
label: 'height'
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1,46 +0,0 @@
|
|||
import { ApplicationContext } from 'context';
|
||||
import { MBrepShell } from '../../../../../web/app/cad/model/mshell';
|
||||
import { roundValueForPresentation as r } from '../../../../../web/app/cad/craft/operationHelper';
|
||||
import { occ2brep } from '../../../../../web/app/cad/occ/occ2models';
|
||||
|
||||
export default {
|
||||
id: 'primitive_sphere',
|
||||
label: 'primitive_sphere',
|
||||
icon: 'img/cad/extrude',
|
||||
info: 'primitive_sphere',
|
||||
mutualExclusiveFields: [],
|
||||
paramsInfo: ({ diameter }) => `(${r(diameter)} )`,
|
||||
run: ({ diameter, }, ctx: ApplicationContext) => {
|
||||
|
||||
const oc = ctx.occService.occContext;
|
||||
|
||||
const myLocation = new oc.gp_Pnt_3(0, 0, 0);
|
||||
const sphereCenterline = oc.gp.DZ();
|
||||
const sphereOrientationAndLocation = new oc.gp_Ax2_3(myLocation, sphereCenterline);
|
||||
|
||||
|
||||
let myBody = new oc.BRepPrimAPI_MakeSphere_1(diameter);
|
||||
//let myBody = new oc.BRepPrimAPI_Make
|
||||
|
||||
const aRes = new oc.TopoDS_Compound();
|
||||
const aBuilder = new oc.BRep_Builder();
|
||||
aBuilder.MakeCompound(aRes);
|
||||
aBuilder.Add(aRes, myBody.Shape());
|
||||
|
||||
|
||||
|
||||
const mobject = new MBrepShell(occ2brep(aRes, ctx.occService.occContext));
|
||||
return {
|
||||
consumed: [],
|
||||
created: [mobject]
|
||||
};
|
||||
},
|
||||
schema: {
|
||||
diameter: {
|
||||
type: 'number',
|
||||
defaultValue: 200,
|
||||
label: 'diameter'
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1,51 +0,0 @@
|
|||
import { ApplicationContext } from 'context';
|
||||
import { MBrepShell } from '../../../../../web/app/cad/model/mshell';
|
||||
import { roundValueForPresentation as r } from '../../../../../web/app/cad/craft/operationHelper';
|
||||
import { occ2brep } from '../../../../../web/app/cad/occ/occ2models';
|
||||
|
||||
export default {
|
||||
id: 'primitive_torus',
|
||||
label: 'primitive_torus',
|
||||
icon: 'img/cad/extrude',
|
||||
info: 'primitive_torus',
|
||||
mutualExclusiveFields: [],
|
||||
paramsInfo: ({ radius, tubeRadius }) => `(${r(radius)} ${r(tubeRadius)} )`,
|
||||
run: ({ radius, tubeRadius }, ctx: ApplicationContext) => {
|
||||
|
||||
const oc = ctx.occService.occContext;
|
||||
|
||||
const myLocation = new oc.gp_Pnt_3(0, 0, 0);
|
||||
const torusCenterline = oc.gp.DZ();
|
||||
const torusOrientationAndLocation = new oc.gp_Ax2_3(myLocation, torusCenterline);
|
||||
|
||||
|
||||
let myBody = new oc.BRepPrimAPI_MakeTorus_1(radius, tubeRadius);
|
||||
//let myBody = new oc.BRepPrimAPI_Make
|
||||
|
||||
const aRes = new oc.TopoDS_Compound();
|
||||
const aBuilder = new oc.BRep_Builder();
|
||||
aBuilder.MakeCompound(aRes);
|
||||
aBuilder.Add(aRes, myBody.Shape());
|
||||
|
||||
|
||||
|
||||
const mobject = new MBrepShell(occ2brep(aRes, ctx.occService.occContext));
|
||||
return {
|
||||
consumed: [],
|
||||
created: [mobject]
|
||||
};
|
||||
},
|
||||
schema: {
|
||||
radius : {
|
||||
type: 'number',
|
||||
defaultValue: 200,
|
||||
label: 'radius'
|
||||
},
|
||||
tubeRadius: {
|
||||
type: 'number',
|
||||
defaultValue: 50,
|
||||
label: 'tube radius'
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1,56 +0,0 @@
|
|||
import { ApplicationContext } from 'context';
|
||||
import { MBrepShell } from '../../../../../web/app/cad/model/mshell';
|
||||
import { roundValueForPresentation as r } from '../../../../../web/app/cad/craft/operationHelper';
|
||||
import { occ2brep } from '../../../../../web/app/cad/occ/occ2models';
|
||||
|
||||
export default {
|
||||
id: 'primitive_box',
|
||||
label: 'primitive_box',
|
||||
icon: 'img/cad/extrude',
|
||||
info: 'primitive_box',
|
||||
mutualExclusiveFields: [],
|
||||
paramsInfo: ({ boxX, boxY, boxZ }) => `(${r(boxX)} ${r(boxY)}) ${r(boxZ)})`,
|
||||
run: ({ boxX, boxY, boxZ }, ctx: ApplicationContext) => {
|
||||
//const occObj = createCylinder(diameter, height, ctx.occService.occContext);
|
||||
const oc = ctx.occService.occContext;
|
||||
|
||||
//const myLocation = new oc.gp_Pnt_3(0, 0, 0);
|
||||
//const cylinderCenterline = oc.gp.DZ();
|
||||
//const cylinderOrientationAndLocation = new oc.gp_Ax2_3(myLocation, cylinderCenterline);
|
||||
console.log(boxX, boxY, boxZ, oc.BRepPrimAPI_MakeBox_1(boxX, boxY, boxZ))
|
||||
|
||||
let myBody = new oc.BRepPrimAPI_MakeBox_1(boxX, boxY, boxZ );
|
||||
//let myBody = new oc.BRepPrimAPI_Make
|
||||
|
||||
const aRes = new oc.TopoDS_Compound();
|
||||
const aBuilder = new oc.BRep_Builder();
|
||||
aBuilder.MakeCompound(aRes);
|
||||
aBuilder.Add(aRes, myBody.Shape());
|
||||
|
||||
|
||||
|
||||
const mobject = new MBrepShell(occ2brep(aRes, ctx.occService.occContext));
|
||||
return {
|
||||
consumed: [],
|
||||
created: [mobject]
|
||||
};
|
||||
},
|
||||
schema: {
|
||||
boxX: {
|
||||
type: 'number',
|
||||
defaultValue: 200,
|
||||
label: 'X'
|
||||
},
|
||||
boxY: {
|
||||
type: 'number',
|
||||
defaultValue: 280,
|
||||
label: 'Y'
|
||||
},
|
||||
BoxZ: {
|
||||
type: 'number',
|
||||
defaultValue: 280,
|
||||
label: 'Z'
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1,50 +0,0 @@
|
|||
import { ApplicationContext } from 'context';
|
||||
import { MBrepShell } from '../../../../../web/app/cad/model/mshell';
|
||||
import { roundValueForPresentation as r } from '../../../../../web/app/cad/craft/operationHelper';
|
||||
import { occ2brep } from '../../../../../web/app/cad/occ/occ2models';
|
||||
|
||||
export default {
|
||||
id: 'primitive_cone',
|
||||
label: 'primitive_cone',
|
||||
icon: 'img/cad/extrude',
|
||||
info: 'primitive_cone',
|
||||
mutualExclusiveFields: [],
|
||||
paramsInfo: ({ diameter, height }) => `(${r(diameter)} ${r(height)})`,
|
||||
run: ({ diameter, height, }, ctx: ApplicationContext) => {
|
||||
//const occObj = createcone(diameter, height, ctx.occService.occContext);
|
||||
const oc = ctx.occService.occContext;
|
||||
|
||||
const myLocation = new oc.gp_Pnt_3(0, 0, 0);
|
||||
const coneCenterline = oc.gp.DZ();
|
||||
const coneOrientationAndLocation = new oc.gp_Ax2_3(myLocation, coneCenterline);
|
||||
|
||||
let myBody = new oc.BRepPrimAPI_MakeCone_1(10,20,100);
|
||||
//let myBody = new oc.BRepPrimAPI_Make
|
||||
|
||||
const aRes = new oc.TopoDS_Compound();
|
||||
const aBuilder = new oc.BRep_Builder();
|
||||
aBuilder.MakeCompound(aRes);
|
||||
aBuilder.Add(aRes, myBody.Shape());
|
||||
|
||||
|
||||
|
||||
const mobject = new MBrepShell(occ2brep(aRes, ctx.occService.occContext));
|
||||
return {
|
||||
consumed: [],
|
||||
created: [mobject]
|
||||
};
|
||||
},
|
||||
schema: {
|
||||
diameter: {
|
||||
type: 'number',
|
||||
defaultValue: 200,
|
||||
label: 'diameter'
|
||||
},
|
||||
height: {
|
||||
type: 'number',
|
||||
defaultValue: 280,
|
||||
label: 'height'
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1,51 +0,0 @@
|
|||
import { ApplicationContext } from 'context';
|
||||
import { MBrepShell } from '../../../../../web/app/cad/model/mshell';
|
||||
import { roundValueForPresentation as r } from '../../../../../web/app/cad/craft/operationHelper';
|
||||
import { occ2brep } from '../../../../../web/app/cad/occ/occ2models';
|
||||
|
||||
export default {
|
||||
id: 'primitive_cylinder',
|
||||
label: 'primitive_cylinder',
|
||||
icon: 'img/cad/extrude',
|
||||
info: 'primitive_cylinder',
|
||||
mutualExclusiveFields: [],
|
||||
paramsInfo: ({ diameter, height }) => `(${r(diameter)} ${r(height)})`,
|
||||
run: ({ diameter, height, }, ctx: ApplicationContext) => {
|
||||
//const occObj = createCylinder(diameter, height, ctx.occService.occContext);
|
||||
const oc = ctx.occService.occContext;
|
||||
|
||||
const myLocation = new oc.gp_Pnt_3(0, 0, 0);
|
||||
const cylinderCenterline = oc.gp.DZ();
|
||||
const cylinderOrientationAndLocation = new oc.gp_Ax2_3(myLocation, cylinderCenterline);
|
||||
|
||||
|
||||
let myBody = new oc.BRepPrimAPI_MakeCylinder_3(cylinderOrientationAndLocation, diameter, height,);
|
||||
//let myBody = new oc.BRepPrimAPI_Make
|
||||
|
||||
const aRes = new oc.TopoDS_Compound();
|
||||
const aBuilder = new oc.BRep_Builder();
|
||||
aBuilder.MakeCompound(aRes);
|
||||
aBuilder.Add(aRes, myBody.Shape());
|
||||
|
||||
|
||||
|
||||
const mobject = new MBrepShell(occ2brep(aRes, ctx.occService.occContext));
|
||||
return {
|
||||
consumed: [],
|
||||
created: [mobject]
|
||||
};
|
||||
},
|
||||
schema: {
|
||||
diameter: {
|
||||
type: 'number',
|
||||
defaultValue: 200,
|
||||
label: 'diameter'
|
||||
},
|
||||
height: {
|
||||
type: 'number',
|
||||
defaultValue: 280,
|
||||
label: 'height'
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1,46 +0,0 @@
|
|||
import { ApplicationContext } from 'context';
|
||||
import { MBrepShell } from '../../../../../web/app/cad/model/mshell';
|
||||
import { roundValueForPresentation as r } from '../../../../../web/app/cad/craft/operationHelper';
|
||||
import { occ2brep } from '../../../../../web/app/cad/occ/occ2models';
|
||||
|
||||
export default {
|
||||
id: 'primitive_sphere',
|
||||
label: 'primitive_sphere',
|
||||
icon: 'img/cad/extrude',
|
||||
info: 'primitive_sphere',
|
||||
mutualExclusiveFields: [],
|
||||
paramsInfo: ({ diameter }) => `(${r(diameter)} )`,
|
||||
run: ({ diameter, }, ctx: ApplicationContext) => {
|
||||
|
||||
const oc = ctx.occService.occContext;
|
||||
|
||||
const myLocation = new oc.gp_Pnt_3(0, 0, 0);
|
||||
const sphereCenterline = oc.gp.DZ();
|
||||
const sphereOrientationAndLocation = new oc.gp_Ax2_3(myLocation, sphereCenterline);
|
||||
|
||||
|
||||
let myBody = new oc.BRepPrimAPI_MakeSphere_1(diameter);
|
||||
//let myBody = new oc.BRepPrimAPI_Make
|
||||
|
||||
const aRes = new oc.TopoDS_Compound();
|
||||
const aBuilder = new oc.BRep_Builder();
|
||||
aBuilder.MakeCompound(aRes);
|
||||
aBuilder.Add(aRes, myBody.Shape());
|
||||
|
||||
|
||||
|
||||
const mobject = new MBrepShell(occ2brep(aRes, ctx.occService.occContext));
|
||||
return {
|
||||
consumed: [],
|
||||
created: [mobject]
|
||||
};
|
||||
},
|
||||
schema: {
|
||||
diameter: {
|
||||
type: 'number',
|
||||
defaultValue: 200,
|
||||
label: 'diameter'
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1,51 +0,0 @@
|
|||
import { ApplicationContext } from 'context';
|
||||
import { MBrepShell } from '../../../../../web/app/cad/model/mshell';
|
||||
import { roundValueForPresentation as r } from '../../../../../web/app/cad/craft/operationHelper';
|
||||
import { occ2brep } from '../../../../../web/app/cad/occ/occ2models';
|
||||
|
||||
export default {
|
||||
id: 'primitive_torus',
|
||||
label: 'primitive_torus',
|
||||
icon: 'img/cad/extrude',
|
||||
info: 'primitive_torus',
|
||||
mutualExclusiveFields: [],
|
||||
paramsInfo: ({ radius, tubeRadius }) => `(${r(radius)} ${r(tubeRadius)} )`,
|
||||
run: ({ radius, tubeRadius }, ctx: ApplicationContext) => {
|
||||
|
||||
const oc = ctx.occService.occContext;
|
||||
|
||||
const myLocation = new oc.gp_Pnt_3(0, 0, 0);
|
||||
const torusCenterline = oc.gp.DZ();
|
||||
const torusOrientationAndLocation = new oc.gp_Ax2_3(myLocation, torusCenterline);
|
||||
|
||||
|
||||
let myBody = new oc.BRepPrimAPI_MakeTorus_1(radius, tubeRadius);
|
||||
//let myBody = new oc.BRepPrimAPI_Make
|
||||
|
||||
const aRes = new oc.TopoDS_Compound();
|
||||
const aBuilder = new oc.BRep_Builder();
|
||||
aBuilder.MakeCompound(aRes);
|
||||
aBuilder.Add(aRes, myBody.Shape());
|
||||
|
||||
|
||||
|
||||
const mobject = new MBrepShell(occ2brep(aRes, ctx.occService.occContext));
|
||||
return {
|
||||
consumed: [],
|
||||
created: [mobject]
|
||||
};
|
||||
},
|
||||
schema: {
|
||||
radius : {
|
||||
type: 'number',
|
||||
defaultValue: 200,
|
||||
label: 'radius'
|
||||
},
|
||||
tubeRadius: {
|
||||
type: 'number',
|
||||
defaultValue: 50,
|
||||
label: 'tube radius'
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in a new issue