@ -871,15 +871,3 @@ export function codeRefFromRange(range: SourceRange, ast: Program): CodeRef {
|
|||||||
pathToNode: getNodePathFromSourceRange(ast, range),
|
pathToNode: getNodePathFromSourceRange(ast, range),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export function isSolid2D(artifact: Artifact): artifact is solid2D {
|
|
||||||
return (artifact as solid2D).pathId !== undefined
|
|
||||||
}
|
|
||||||
|
|
||||||
export function isSegment(artifact: Artifact): artifact is SegmentArtifact {
|
|
||||||
return (artifact as SegmentArtifact).pathId !== undefined
|
|
||||||
}
|
|
||||||
|
|
||||||
export function isSweep(artifact: Artifact): artifact is SweepArtifact {
|
|
||||||
return (artifact as SweepArtifact).pathId !== undefined
|
|
||||||
}
|
|
||||||
|
@ -3,7 +3,6 @@ import { engineCommandManager } from 'lib/singletons'
|
|||||||
import { uuidv4 } from 'lib/utils'
|
import { uuidv4 } from 'lib/utils'
|
||||||
import { CommandBarContext } from 'machines/commandBarMachine'
|
import { CommandBarContext } from 'machines/commandBarMachine'
|
||||||
import { Selections } from 'lib/selections'
|
import { Selections } from 'lib/selections'
|
||||||
import { isSolid2D, isSegment, isSweep } from 'lang/std/artifactGraph'
|
|
||||||
|
|
||||||
export const disableDryRunWithRetry = async (numberOfRetries = 3) => {
|
export const disableDryRunWithRetry = async (numberOfRetries = 3) => {
|
||||||
for (let tries = 0; tries < numberOfRetries; tries++) {
|
for (let tries = 0; tries < numberOfRetries; tries++) {
|
||||||
@ -64,7 +63,7 @@ export const revolveAxisValidator = async ({
|
|||||||
return 'Unable to revolve, sketch not found'
|
return 'Unable to revolve, sketch not found'
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(isSolid2D(artifact) || isSegment(artifact) || isSweep(artifact))) {
|
if (!('pathId' in artifact)) {
|
||||||
return 'Unable to revolve, sketch has no path'
|
return 'Unable to revolve, sketch has no path'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user