Refactor Edge Treatment Module to Break Cyclic Dependency (#5243)
* break cycle * yarn fmt
This commit is contained in:
@ -1681,6 +1681,12 @@ export const modelingMachine = setup({
|
||||
// Extract inputs
|
||||
const ast = kclManager.ast
|
||||
const { selection, thickness } = input
|
||||
const dependencies = {
|
||||
kclManager,
|
||||
engineCommandManager,
|
||||
editorManager,
|
||||
codeManager,
|
||||
}
|
||||
|
||||
// Insert the thickness variable if it exists
|
||||
if (
|
||||
@ -1706,6 +1712,7 @@ export const modelingMachine = setup({
|
||||
'variableName' in thickness
|
||||
? thickness.variableIdentifierAst
|
||||
: thickness.valueAst,
|
||||
dependencies,
|
||||
})
|
||||
if (err(shellResult)) {
|
||||
return err(shellResult)
|
||||
@ -1745,12 +1752,19 @@ export const modelingMachine = setup({
|
||||
type: EdgeTreatmentType.Fillet,
|
||||
radius,
|
||||
}
|
||||
const dependencies = {
|
||||
kclManager,
|
||||
engineCommandManager,
|
||||
editorManager,
|
||||
codeManager,
|
||||
}
|
||||
|
||||
// Apply fillet to selection
|
||||
const filletResult = await applyEdgeTreatmentToSelection(
|
||||
ast,
|
||||
selection,
|
||||
parameters
|
||||
parameters,
|
||||
dependencies
|
||||
)
|
||||
if (err(filletResult)) return filletResult
|
||||
}
|
||||
@ -1772,12 +1786,19 @@ export const modelingMachine = setup({
|
||||
type: EdgeTreatmentType.Chamfer,
|
||||
length,
|
||||
}
|
||||
const dependencies = {
|
||||
kclManager,
|
||||
engineCommandManager,
|
||||
editorManager,
|
||||
codeManager,
|
||||
}
|
||||
|
||||
// Apply chamfer to selection
|
||||
const chamferResult = await applyEdgeTreatmentToSelection(
|
||||
ast,
|
||||
selection,
|
||||
parameters
|
||||
parameters,
|
||||
dependencies
|
||||
)
|
||||
if (err(chamferResult)) return chamferResult
|
||||
}
|
||||
|
Reference in New Issue
Block a user