length constraint fix (#2578)

length constraint
This commit is contained in:
Kurt Hutten
2024-06-03 18:30:30 +10:00
committed by GitHub
parent f52d2d55f1
commit cf03021366
2 changed files with 49 additions and 21 deletions

View File

@ -609,10 +609,23 @@ export const ModelingMachineProvider = ({
},
'Get length info': async ({
selectionRanges,
sketchDetails,
}): Promise<SetSelections> => {
const { modifiedAst, pathToNodeMap } =
await applyConstraintAngleLength({ selectionRanges })
await kclManager.updateAst(modifiedAst, true)
const _modifiedAst = parse(recast(modifiedAst))
if (!sketchDetails) throw new Error('No sketch details')
const updatedPathToNode = updatePathToNodeFromMap(
sketchDetails.sketchPathToNode,
pathToNodeMap
)
await sceneEntitiesManager.updateAstAndRejigSketch(
updatedPathToNode,
_modifiedAst,
sketchDetails.zAxis,
sketchDetails.yAxis,
sketchDetails.origin
)
return {
selectionType: 'completeSelection',
selection: pathMapToSelections(
@ -620,6 +633,7 @@ export const ModelingMachineProvider = ({
selectionRanges,
pathToNodeMap
),
updatedPathToNode,
}
},
'Get perpendicular distance info': async ({