Multi-profile sweeps and more robust edit flows in point-and-click (#6437)

This commit is contained in:
Pierre Jacquier
2025-05-06 17:57:27 -04:00
committed by GitHub
parent 8fb1563f2d
commit 996517f5c4
15 changed files with 1353 additions and 928 deletions

View File

@ -64,27 +64,20 @@ export type ModelingCommandSchema = {
Extrude: {
// Enables editing workflow
nodeToEdit?: PathToNode
selection: Selections // & { type: 'face' } would be cool to lock that down
// result: (typeof EXTRUSION_RESULTS)[number]
distance: KclCommandValue
// KCL stdlib arguments
sketches: Selections
length: KclCommandValue
}
Sweep: {
// Enables editing workflow
nodeToEdit?: PathToNode
// Arguments
target: Selections
trajectory: Selections
sectional: boolean
// KCL stdlib arguments
sketches: Selections
path: Selections
sectional?: boolean
}
Loft: {
selection: Selections
}
Shell: {
// Enables editing workflow
nodeToEdit?: PathToNode
// KCL stdlib arguments
selection: Selections
thickness: KclCommandValue
sketches: Selections
}
Revolve: {
// Enables editing workflow
@ -92,11 +85,18 @@ export type ModelingCommandSchema = {
// Flow arg
axisOrEdge: 'Axis' | 'Edge'
// KCL stdlib arguments
selection: Selections
sketches: Selections
angle: KclCommandValue
axis: string | undefined
edge: Selections | undefined
}
Shell: {
// Enables editing workflow
nodeToEdit?: PathToNode
// KCL stdlib arguments
selection: Selections
thickness: KclCommandValue
}
Fillet: {
// Enables editing workflow
nodeToEdit?: PathToNode
@ -388,26 +388,14 @@ export const modelingMachineCommandConfig: StateMachineCommandSetConfig<
required: false,
hidden: true,
},
selection: {
sketches: {
inputType: 'selection',
selectionTypes: ['solid2d', 'segment'],
multiple: false, // TODO: multiple selection
multiple: true,
required: true,
skip: true,
hidden: (context) => Boolean(context.argumentsToSubmit.nodeToEdit),
},
// result: {
// inputType: 'options',
// defaultValue: 'add',
// skip: true,
// required: true,
// options: EXTRUSION_RESULTS.map((r) => ({
// name: r,
// isCurrent: r === 'add',
// value: r,
// })),
// },
distance: {
length: {
inputType: 'kcl',
defaultValue: KCL_DEFAULT_LENGTH,
required: true,
@ -426,26 +414,28 @@ export const modelingMachineCommandConfig: StateMachineCommandSetConfig<
skip: true,
inputType: 'text',
required: false,
hidden: true,
},
target: {
sketches: {
inputType: 'selection',
selectionTypes: ['solid2d'],
selectionTypes: ['solid2d', 'segment'],
multiple: true,
required: true,
skip: true,
multiple: false,
hidden: (context) => Boolean(context.argumentsToSubmit.nodeToEdit),
},
trajectory: {
path: {
inputType: 'selection',
selectionTypes: ['segment'],
required: true,
skip: true,
multiple: false,
validation: sweepValidator,
hidden: (context) => Boolean(context.argumentsToSubmit.nodeToEdit),
},
sectional: {
inputType: 'options',
skip: true,
defaultValue: false,
hidden: false,
required: true,
options: [
{ name: 'False', value: false },
@ -458,45 +448,17 @@ export const modelingMachineCommandConfig: StateMachineCommandSetConfig<
Loft: {
description: 'Create a 3D body by blending between two or more sketches',
icon: 'loft',
needsReview: false,
needsReview: true,
args: {
selection: {
sketches: {
inputType: 'selection',
selectionTypes: ['solid2d'],
multiple: true,
required: true,
skip: false,
validation: loftValidator,
},
},
},
Shell: {
description: 'Hollow out a 3D solid.',
icon: 'shell',
needsReview: true,
args: {
nodeToEdit: {
description:
'Path to the node in the AST to edit. Never shown to the user.',
skip: true,
inputType: 'text',
required: false,
},
selection: {
inputType: 'selection',
selectionTypes: ['cap', 'wall'],
multiple: true,
required: true,
validation: shellValidator,
hidden: (context) => Boolean(context.argumentsToSubmit.nodeToEdit),
},
thickness: {
inputType: 'kcl',
defaultValue: KCL_DEFAULT_LENGTH,
required: true,
},
},
},
Revolve: {
description: 'Create a 3D body by rotating a sketch region about an axis.',
icon: 'revolve',
@ -509,12 +471,11 @@ export const modelingMachineCommandConfig: StateMachineCommandSetConfig<
inputType: 'text',
required: false,
},
selection: {
sketches: {
inputType: 'selection',
selectionTypes: ['solid2d', 'segment'],
multiple: false, // TODO: multiple selection
multiple: true,
required: true,
skip: true,
hidden: (context) => Boolean(context.argumentsToSubmit.nodeToEdit),
},
axisOrEdge: {
@ -557,6 +518,33 @@ export const modelingMachineCommandConfig: StateMachineCommandSetConfig<
},
},
},
Shell: {
description: 'Hollow out a 3D solid.',
icon: 'shell',
needsReview: true,
args: {
nodeToEdit: {
description:
'Path to the node in the AST to edit. Never shown to the user.',
skip: true,
inputType: 'text',
required: false,
},
selection: {
inputType: 'selection',
selectionTypes: ['cap', 'wall'],
multiple: true,
required: true,
validation: shellValidator,
hidden: (context) => Boolean(context.argumentsToSubmit.nodeToEdit),
},
thickness: {
inputType: 'kcl',
defaultValue: KCL_DEFAULT_LENGTH,
required: true,
},
},
},
'Boolean Subtract': {
description: 'Subtract one solid from another.',
icon: 'booleanSubtract',