Compare commits

...

11 Commits

2 changed files with 19 additions and 12 deletions

View File

@ -313,7 +313,7 @@ export const modelingMachineCommandConfig: StateMachineCommandSetConfig<
args: { args: {
target: { target: {
inputType: 'selection', inputType: 'selection',
selectionTypes: ['solid2d'], selectionTypes: ['solid2d', 'plane'],
required: true, required: true,
skip: true, skip: true,
multiple: false, multiple: false,
@ -322,7 +322,7 @@ export const modelingMachineCommandConfig: StateMachineCommandSetConfig<
}, },
trajectory: { trajectory: {
inputType: 'selection', inputType: 'selection',
selectionTypes: ['segment', 'path'], selectionTypes: ['segment', 'plane'],
required: true, required: true,
skip: false, skip: false,
multiple: false, multiple: false,

View File

@ -222,24 +222,31 @@ export const sweepValidator = async ({
// Retrieve the parent path from the segment selection directly // Retrieve the parent path from the segment selection directly
const trajectoryArtifact = data.trajectory.graphSelections[0].artifact const trajectoryArtifact = data.trajectory.graphSelections[0].artifact
if (!trajectoryArtifact) { let trajectory: string | undefined = undefined
if (trajectoryArtifact && trajectoryArtifact.type === 'segment') {
trajectory = trajectoryArtifact.pathId
} else if (trajectoryArtifact && trajectoryArtifact.type === 'plane') {
// TODO: check again after multi profile
trajectory = trajectoryArtifact.pathIds[0]
}
if (!trajectory) {
return "Unable to sweep, couldn't find the trajectory artifact" return "Unable to sweep, couldn't find the trajectory artifact"
} }
if (trajectoryArtifact.type !== 'segment') {
return "Unable to sweep, couldn't find the target from a non-segment selection"
}
const trajectory = trajectoryArtifact.pathId
// Get the former arg in the command bar flow, and retrieve the path from the solid2d directly // Get the former arg in the command bar flow, and retrieve the path from the solid2d directly
const targetArg = context.argumentsToSubmit['target'] as Selections const targetArg = context.argumentsToSubmit['target'] as Selections
const targetArtifact = targetArg.graphSelections[0].artifact const targetArtifact = targetArg.graphSelections[0].artifact
if (!targetArtifact) { let target: string | undefined = undefined
if (targetArtifact && targetArtifact.type === 'solid2D') {
target = targetArtifact.pathId
} else if (targetArtifact && targetArtifact.type === 'plane') {
target = targetArtifact.pathIds[0]
}
if (!target) {
return "Unable to sweep, couldn't find the profile artifact" return "Unable to sweep, couldn't find the profile artifact"
} }
if (targetArtifact.type !== 'solid2d') {
return "Unable to sweep, couldn't find the target from a non-solid2d selection"
}
const target = targetArtifact.pathId
const sweepCommand = async () => { const sweepCommand = async () => {
// TODO: second look on defaults here // TODO: second look on defaults here