mirror of
https://github.com/xibyte/jsketcher
synced 2026-02-13 10:54:19 +01:00
moved color enum field to within schema object
This commit is contained in:
parent
af385c2bb8
commit
1fdb2906b4
1 changed files with 20 additions and 17 deletions
|
|
@ -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]
|
||||
|
|
|
|||
Loading…
Reference in a new issue