Compare commits

...

2 Commits

Author SHA1 Message Date
4251dfdbf7 Update snapshots 2025-06-27 21:01:52 +00:00
5a9c3f0d6f pierremtb/issue7626-initial-hole-cmd-config
Relates to #7626
2025-06-27 16:46:56 -04:00
17 changed files with 129 additions and 0 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 51 KiB

After

Width:  |  Height:  |  Size: 51 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 51 KiB

After

Width:  |  Height:  |  Size: 51 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 48 KiB

After

Width:  |  Height:  |  Size: 49 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 61 KiB

After

Width:  |  Height:  |  Size: 61 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 135 KiB

After

Width:  |  Height:  |  Size: 135 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 118 KiB

After

Width:  |  Height:  |  Size: 118 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 135 KiB

After

Width:  |  Height:  |  Size: 135 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 68 KiB

After

Width:  |  Height:  |  Size: 68 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 71 KiB

After

Width:  |  Height:  |  Size: 71 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 67 KiB

After

Width:  |  Height:  |  Size: 67 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 69 KiB

After

Width:  |  Height:  |  Size: 70 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 69 KiB

After

Width:  |  Height:  |  Size: 70 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 65 KiB

After

Width:  |  Height:  |  Size: 66 KiB

View File

@ -1405,6 +1405,7 @@ export const ModelingMachineProvider = ({
commandName: 'Shell',
groupId: 'modeling',
},
// TODO: add hole here
{
menuLabel: 'Design.Modify with Zoo Text-To-CAD',
commandName: 'Prompt-to-edit',

View File

@ -115,6 +115,21 @@ export type ModelingCommandSchema = {
selection: Selections
thickness: KclCommandValue
}
Hole: {
// Enables editing workflow
nodeToEdit?: PathToNode
// KCL stdlib arguments
face: Selections
pointX: KclCommandValue
pointY: KclCommandValue
length: KclCommandValue
diameter: KclCommandValue
countersinkDiameter?: KclCommandValue
countersinkAngle?: KclCommandValue
counterboreDiameter?: KclCommandValue
counterboreDepth?: KclCommandValue
bottomDrillAngle?: KclCommandValue
}
Fillet: {
// Enables editing workflow
nodeToEdit?: PathToNode
@ -590,6 +605,63 @@ export const modelingMachineCommandConfig: StateMachineCommandSetConfig<
},
},
},
Hole: {
description: 'Create standard holes in a solid through a wizard.',
icon: 'hole',
needsReview: true,
args: {
nodeToEdit: {
...nodeToEditProps,
},
face: {
inputType: 'selection',
selectionTypes: ['cap', 'wall'],
multiple: true,
required: true,
hidden: (context) => Boolean(context.argumentsToSubmit.nodeToEdit),
},
pointX: {
inputType: 'kcl',
defaultValue: KCL_DEFAULT_LENGTH,
required: true,
},
pointY: {
inputType: 'kcl',
defaultValue: KCL_DEFAULT_LENGTH,
required: true,
},
length: {
inputType: 'kcl',
defaultValue: KCL_DEFAULT_LENGTH,
required: true,
},
diameter: {
inputType: 'kcl',
defaultValue: KCL_DEFAULT_LENGTH,
required: true,
},
countersinkDiameter: {
inputType: 'kcl',
required: false,
},
countersinkAngle: {
inputType: 'kcl',
required: false,
},
counterboreDiameter: {
inputType: 'kcl',
required: false,
},
counterboreDepth: {
inputType: 'kcl',
required: false,
},
bottomDrillAngle: {
inputType: 'kcl',
required: false,
},
},
},
'Boolean Subtract': {
description: 'Subtract one solid from another.',
icon: 'booleanSubtract',

View File

@ -257,6 +257,26 @@ export const toolbarConfig: Record<ToolbarModeName, ToolbarMode> = {
},
],
},
{
id: 'hole',
onClick: () => {
commandBarActor.send({
type: 'Find and select command',
data: { name: 'Hole', groupId: 'modeling' },
})
},
icon: 'hole',
status: 'available',
title: 'Hole',
description: 'Create standard holes in a solid through a wizard.',
links: [
{
label: 'KCL docs',
// TODO: update this link to the new KCL docs
url: 'https://zoo.dev/docs/kcl-std/functions/std-solid-hole',
},
],
},
'break',
{
id: 'booleans',

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',