mirror of
https://github.com/xibyte/jsketcher
synced 2025-12-10 18:36:30 +01:00
Slight refactor box primitive
This commit is contained in:
parent
12ebf17588
commit
79e25c02c9
1 changed files with 21 additions and 22 deletions
|
|
@ -11,16 +11,31 @@ export default {
|
|||
info: 'primitive_box',
|
||||
mutualExclusiveFields: [],
|
||||
paramsInfo: ({ boxX, boxY, boxZ }) => `(${r(boxX)} ${r(boxY)}) ${r(boxZ)})`,
|
||||
schema: {
|
||||
boxX: {
|
||||
type: 'number',
|
||||
defaultValue: 200,
|
||||
label: 'X'
|
||||
},
|
||||
boxY: {
|
||||
type: 'number',
|
||||
defaultValue: 280,
|
||||
label: 'Y'
|
||||
},
|
||||
boxZ: {
|
||||
type: 'number',
|
||||
defaultValue: 280,
|
||||
label: 'Z'
|
||||
},
|
||||
},
|
||||
|
||||
|
||||
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_MakeBox_1(boxX, boxY, boxZ);
|
||||
//let myBody = new oc.BRepPrimAPI_Make
|
||||
|
||||
const aRes = new oc.TopoDS_Compound();
|
||||
|
|
@ -36,22 +51,6 @@ export default {
|
|||
created: [mobject]
|
||||
};
|
||||
},
|
||||
schema: {
|
||||
boxX: {
|
||||
type: 'number',
|
||||
defaultValue: 200,
|
||||
label: 'X'
|
||||
},
|
||||
boxY: {
|
||||
type: 'number',
|
||||
defaultValue: 280,
|
||||
label: 'Y'
|
||||
},
|
||||
BoxZ: {
|
||||
type: 'number',
|
||||
defaultValue: 280,
|
||||
label: 'Z'
|
||||
},
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue