@ -1020,24 +1020,11 @@ export const modelingMachine = createMachine(
|
|||||||
'AST delete selection': async ({ sketchDetails, selectionRanges }) => {
|
'AST delete selection': async ({ sketchDetails, selectionRanges }) => {
|
||||||
let ast = kclManager.ast
|
let ast = kclManager.ast
|
||||||
|
|
||||||
const getScaledFaceDetails = async (entityId: string) => {
|
|
||||||
const faceDetails = await getFaceDetails(entityId)
|
|
||||||
if (err(faceDetails)) return {}
|
|
||||||
return {
|
|
||||||
...faceDetails,
|
|
||||||
origin: {
|
|
||||||
x: faceDetails.origin.x / sceneInfra._baseUnitMultiplier,
|
|
||||||
y: faceDetails.origin.y / sceneInfra._baseUnitMultiplier,
|
|
||||||
z: faceDetails.origin.z / sceneInfra._baseUnitMultiplier,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const modifiedAst = await deleteFromSelection(
|
const modifiedAst = await deleteFromSelection(
|
||||||
ast,
|
ast,
|
||||||
selectionRanges.codeBasedSelections[0],
|
selectionRanges.codeBasedSelections[0],
|
||||||
kclManager.programMemory,
|
kclManager.programMemory,
|
||||||
getScaledFaceDetails
|
getFaceDetails
|
||||||
)
|
)
|
||||||
if (err(modifiedAst)) return
|
if (err(modifiedAst)) return
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user