diff --git a/web/app/cad/craft/boolean/BooleanWizard.jsx b/web/app/cad/craft/boolean/BooleanWizard.jsx index 982bbd88..198c05da 100644 --- a/web/app/cad/craft/boolean/BooleanWizard.jsx +++ b/web/app/cad/craft/boolean/BooleanWizard.jsx @@ -7,6 +7,5 @@ export default function BooleanWizard() { return - ; } \ No newline at end of file diff --git a/web/app/cad/craft/boolean/booleanOpSchema.js b/web/app/cad/craft/boolean/booleanOpSchema.js index f59ef23c..5984adf5 100644 --- a/web/app/cad/craft/boolean/booleanOpSchema.js +++ b/web/app/cad/craft/boolean/booleanOpSchema.js @@ -1,4 +1,4 @@ -export default defaultValue => ({ +export default { operandA: { type: 'shell', defaultValue: {type: 'selection'} @@ -6,10 +6,5 @@ export default defaultValue => ({ operandB: { type: 'shell', defaultValue: {type: 'selection'} - }, - type: { - type: 'enum', - values: ['INTERSECT', 'SUBTRACT', 'UNION'], - defaultValue } -}) +}; diff --git a/web/app/cad/craft/boolean/booleanOperation.js b/web/app/cad/craft/boolean/booleanOperation.js index 69bbe26b..d8d96ddf 100644 --- a/web/app/cad/craft/boolean/booleanOperation.js +++ b/web/app/cad/craft/boolean/booleanOperation.js @@ -1,13 +1,13 @@ import schema from './booleanOpSchema'; import BooleanWizard from './BooleanWizard'; -function run(params, services) { +const run = type => (params, services) => { return services.craftEngine.boolean({ - type: params.type, + type, operandsA: [services.cadRegistry.findShell(params.operandA)], operandsB: [services.cadRegistry.findShell(params.operandB)] }); -} +}; const paramsInfo = ({operandA, operandB}) => `(${operandA}, ${operandB})`; @@ -17,36 +17,36 @@ const selectionMode = { export const intersectionOperation = { id: 'INTERSECTION', - label: 'boolean', + label: 'intersection', icon: 'img/cad/intersection', info: 'intersection operation on two shells', paramsInfo, form: BooleanWizard, - schema: schema('INTERSECTION'), - run, + schema, + run: run('INTERSECTION'), selectionMode }; export const subtractOperation = { id: 'SUBTRACT', - label: 'boolean', + label: 'subtract', icon: 'img/cad/subtract', info: 'subtract operation on two shells', paramsInfo, form: BooleanWizard, - schema: schema('SUBTRACT'), - run, + schema, + run: run('SUBTRACT'), selectionMode }; export const unionOperation = { id: 'UNION', - label: 'boolean', + label: 'union', icon: 'img/cad/union', info: 'union operation on two shells', paramsInfo, form: BooleanWizard, - schema: schema('UNION'), - run, + schema, + run: run('UNION'), selectionMode };