pierremtb/issue7626-initial-hole-cmd-config

Relates to #7626
This commit is contained in:
Pierre Jacquier
2025-06-27 16:46:56 -04:00
parent cb3b45747c
commit 5a9c3f0d6f
4 changed files with 129 additions and 0 deletions

View File

@ -390,6 +390,7 @@ export type ModelingMachineEvent =
| { type: 'Sweep'; data?: ModelingCommandSchema['Sweep'] }
| { type: 'Loft'; data?: ModelingCommandSchema['Loft'] }
| { type: 'Shell'; data?: ModelingCommandSchema['Shell'] }
| { type: 'Hole'; data?: ModelingCommandSchema['Hole'] }
| { type: 'Revolve'; data?: ModelingCommandSchema['Revolve'] }
| { type: 'Fillet'; data?: ModelingCommandSchema['Fillet'] }
| { type: 'Chamfer'; data?: ModelingCommandSchema['Chamfer'] }
@ -2991,6 +2992,19 @@ export const modelingMachine = setup({
)
}
),
holeAstMod: fromPromise(
async ({
input,
}: {
input: ModelingCommandSchema['Shell'] | undefined
}) => {
if (!input) {
return Promise.reject(new Error(NO_INPUT_PROVIDED_MESSAGE))
}
return Promise.reject(new Error(`Hole isn't implemented yet`))
}
),
filletAstMod: fromPromise(
async ({
input,
@ -3799,6 +3813,12 @@ export const modelingMachine = setup({
guard: 'no kcl errors',
},
Hole: {
target: 'Applying hole',
reenter: true,
guard: 'no kcl errors',
},
Fillet: {
target: 'Applying fillet',
reenter: true,
@ -5192,6 +5212,22 @@ export const modelingMachine = setup({
},
},
'Applying hole': {
invoke: {
src: 'holeAstMod',
id: 'holeAstMod',
input: ({ event }) => {
if (event.type !== 'Hole') return undefined
return event.data
},
onDone: ['idle'],
onError: {
target: 'idle',
actions: 'toastError',
},
},
},
'Applying fillet': {
invoke: {
src: 'filletAstMod',