Compare commits
2 Commits
jtran/plus
...
pierremtb/
Author | SHA1 | Date | |
---|---|---|---|
4251dfdbf7 | |||
5a9c3f0d6f |
Before Width: | Height: | Size: 51 KiB After Width: | Height: | Size: 51 KiB |
Before Width: | Height: | Size: 51 KiB After Width: | Height: | Size: 51 KiB |
Before Width: | Height: | Size: 48 KiB After Width: | Height: | Size: 49 KiB |
Before Width: | Height: | Size: 61 KiB After Width: | Height: | Size: 61 KiB |
Before Width: | Height: | Size: 135 KiB After Width: | Height: | Size: 135 KiB |
Before Width: | Height: | Size: 118 KiB After Width: | Height: | Size: 118 KiB |
Before Width: | Height: | Size: 135 KiB After Width: | Height: | Size: 135 KiB |
Before Width: | Height: | Size: 68 KiB After Width: | Height: | Size: 68 KiB |
Before Width: | Height: | Size: 71 KiB After Width: | Height: | Size: 71 KiB |
Before Width: | Height: | Size: 67 KiB After Width: | Height: | Size: 67 KiB |
Before Width: | Height: | Size: 69 KiB After Width: | Height: | Size: 70 KiB |
Before Width: | Height: | Size: 69 KiB After Width: | Height: | Size: 70 KiB |
Before Width: | Height: | Size: 65 KiB After Width: | Height: | Size: 66 KiB |
@ -1405,6 +1405,7 @@ export const ModelingMachineProvider = ({
|
|||||||
commandName: 'Shell',
|
commandName: 'Shell',
|
||||||
groupId: 'modeling',
|
groupId: 'modeling',
|
||||||
},
|
},
|
||||||
|
// TODO: add hole here
|
||||||
{
|
{
|
||||||
menuLabel: 'Design.Modify with Zoo Text-To-CAD',
|
menuLabel: 'Design.Modify with Zoo Text-To-CAD',
|
||||||
commandName: 'Prompt-to-edit',
|
commandName: 'Prompt-to-edit',
|
||||||
|
@ -115,6 +115,21 @@ export type ModelingCommandSchema = {
|
|||||||
selection: Selections
|
selection: Selections
|
||||||
thickness: KclCommandValue
|
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: {
|
Fillet: {
|
||||||
// Enables editing workflow
|
// Enables editing workflow
|
||||||
nodeToEdit?: PathToNode
|
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': {
|
'Boolean Subtract': {
|
||||||
description: 'Subtract one solid from another.',
|
description: 'Subtract one solid from another.',
|
||||||
icon: 'booleanSubtract',
|
icon: 'booleanSubtract',
|
||||||
|
@ -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',
|
'break',
|
||||||
{
|
{
|
||||||
id: 'booleans',
|
id: 'booleans',
|
||||||
|
@ -390,6 +390,7 @@ export type ModelingMachineEvent =
|
|||||||
| { type: 'Sweep'; data?: ModelingCommandSchema['Sweep'] }
|
| { type: 'Sweep'; data?: ModelingCommandSchema['Sweep'] }
|
||||||
| { type: 'Loft'; data?: ModelingCommandSchema['Loft'] }
|
| { type: 'Loft'; data?: ModelingCommandSchema['Loft'] }
|
||||||
| { type: 'Shell'; data?: ModelingCommandSchema['Shell'] }
|
| { type: 'Shell'; data?: ModelingCommandSchema['Shell'] }
|
||||||
|
| { type: 'Hole'; data?: ModelingCommandSchema['Hole'] }
|
||||||
| { type: 'Revolve'; data?: ModelingCommandSchema['Revolve'] }
|
| { type: 'Revolve'; data?: ModelingCommandSchema['Revolve'] }
|
||||||
| { type: 'Fillet'; data?: ModelingCommandSchema['Fillet'] }
|
| { type: 'Fillet'; data?: ModelingCommandSchema['Fillet'] }
|
||||||
| { type: 'Chamfer'; data?: ModelingCommandSchema['Chamfer'] }
|
| { 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(
|
filletAstMod: fromPromise(
|
||||||
async ({
|
async ({
|
||||||
input,
|
input,
|
||||||
@ -3799,6 +3813,12 @@ export const modelingMachine = setup({
|
|||||||
guard: 'no kcl errors',
|
guard: 'no kcl errors',
|
||||||
},
|
},
|
||||||
|
|
||||||
|
Hole: {
|
||||||
|
target: 'Applying hole',
|
||||||
|
reenter: true,
|
||||||
|
guard: 'no kcl errors',
|
||||||
|
},
|
||||||
|
|
||||||
Fillet: {
|
Fillet: {
|
||||||
target: 'Applying fillet',
|
target: 'Applying fillet',
|
||||||
reenter: true,
|
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': {
|
'Applying fillet': {
|
||||||
invoke: {
|
invoke: {
|
||||||
src: 'filletAstMod',
|
src: 'filletAstMod',
|
||||||
|