moved color enum field to within schema object

This commit is contained in:
Mike Molinari 2021-09-26 01:12:37 +00:00 committed by Val Erastov
parent af385c2bb8
commit 1fdb2906b4

View file

@ -3,7 +3,7 @@ import { MBrepShell } from 'cad/model/mshell';
import { roundValueForPresentation as r } from 'cad/craft/operationHelper';
import { createOCCBottle } from './bottle.occ';
import { occ2brep } from 'cad/occ/occ2models';
import icon from './icon.svg';
import icon from './icon.svg';
export default {
id: 'OCC_BOTTLE',
@ -14,7 +14,7 @@ export default {
},
info: 'create occ bottle',
mutualExclusiveFields: [],
paramsInfo: ({ width, height, thickness }) => `(${r(width)} ${r(height)} ${r(thickness)})`,
paramsInfo: ({ width, height, thickness, color }) => `(${r(width)} ${r(height)} ${r(thickness)} ${r(color)})`,
schema: {
width: {
type: 'number',
@ -31,24 +31,27 @@ export default {
min: 0,
label: 'thickness',
defaultValue: 150
}
},
color: {
type: 'enum',
defaultValue: "red",
label: 'Color',
options: [
{
label: 'Red',
value: 'red'
},
{
label: 'Green',
value: 'green'
},
],
},
},
color: {
type: 'enum',
options: [
{
label: 'Red',
value: 'red'
},
{
label: 'Green',
value: 'green'
}
]
},
run: ({ width, height, thickness }, ctx: ApplicationContext) => {
run: ({ width, height, thickness, color }, ctx: ApplicationContext) => {
const occObj = createOCCBottle(width, height, thickness, ctx.occService.occContext);
const mobject = new MBrepShell(occ2brep(occObj, ctx.occService.occContext));
console.log(color);
return {
consumed: [],
created: [mobject]