Merge branch 'main' into wip-multi-profile

This commit is contained in:
Jess Frazelle
2024-06-21 21:49:54 -07:00
committed by GitHub
3 changed files with 11 additions and 1 deletions

View File

@ -1489,6 +1489,7 @@ export class SceneEntities {
kclManager.ast, kclManager.ast,
artifact.range artifact.range
) )
const extrudePathToNode = extrusions?.range const extrudePathToNode = extrusions?.range
? getNodePathFromSourceRange(kclManager.ast, extrusions.range) ? getNodePathFromSourceRange(kclManager.ast, extrusions.range)
: [] : []

View File

@ -508,6 +508,7 @@ export const ModelingMachineProvider = ({
'animate-to-face': async (_, { data }) => { 'animate-to-face': async (_, { data }) => {
console.log('animate-to-face', data) console.log('animate-to-face', data)
if (data.type === 'extrudeFace') { if (data.type === 'extrudeFace') {
console.log('data', data)
const { modifiedAst, pathToNode: pathToNewSketchNode } = const { modifiedAst, pathToNode: pathToNewSketchNode } =
sketchOnExtrudedFace( sketchOnExtrudedFace(
kclManager.ast, kclManager.ast,

View File

@ -1466,6 +1466,9 @@ export class EngineCommandManager extends EventTarget {
if (command && command.type === 'pending') { if (command && command.type === 'pending') {
const resolve = command.resolve const resolve = command.resolve
const oldArtifact = this.artifactMap[id] as ArtifactMapCommand & {
extrusions?: string[]
}
const artifact = { const artifact = {
type: 'result', type: 'result',
range: command.range, range: command.range,
@ -1474,7 +1477,10 @@ export class EngineCommandManager extends EventTarget {
parentId: command.parentId ? command.parentId : undefined, parentId: command.parentId ? command.parentId : undefined,
data: modelingResponse, data: modelingResponse,
raw, raw,
} as const } as ArtifactMapCommand & { extrusions?: string[] }
if (oldArtifact?.extrusions) {
artifact.extrusions = oldArtifact.extrusions
}
this.artifactMap[id] = artifact this.artifactMap[id] = artifact
if ( if (
(command.commandType === 'entity_linear_pattern' && (command.commandType === 'entity_linear_pattern' &&
@ -1903,6 +1909,8 @@ export class EngineCommandManager extends EventTarget {
} else { } else {
typedTarget.extrusions = [id] typedTarget.extrusions = [id]
} }
// Update in the map.
this.artifactMap[command.target] = typedTarget
} }
} }
return promise return promise