perpendicular distance & remove constraint - constraint fixes (#2579)

* perpendicular distance constraint

* remove constraints fix
This commit is contained in:
Kurt Hutten
2024-06-03 22:40:59 +10:00
committed by GitHub
parent cf03021366
commit b02529cae0
5 changed files with 215 additions and 28 deletions

View File

@ -638,13 +638,26 @@ export const ModelingMachineProvider = ({
},
'Get perpendicular distance info': async ({
selectionRanges,
sketchDetails,
}): Promise<SetSelections> => {
const { modifiedAst, pathToNodeMap } = await applyConstraintIntersect(
{
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(
@ -652,6 +665,7 @@ export const ModelingMachineProvider = ({
selectionRanges,
pathToNodeMap
),
updatedPathToNode,
}
},
'Get ABS X info': async ({