Refactor clientSide scene (#3859)

* refactor clientSide scene

* start consolidate threejs segment funcitons

* rename stuff

* first pass of integrating threejs segment create and update into one

* reduce create segment complexity

* add color back in

* use input

* fix comment

* feedback changes
This commit is contained in:
Kurt Hutten
2024-09-13 21:14:14 +10:00
committed by GitHub
parent 728e87a627
commit 8610d606f4
23 changed files with 1823 additions and 1634 deletions

View File

@ -1,6 +1,6 @@
import { toolTips } from 'lang/langHelpers'
import { Selections } from 'lib/selections'
import { BinaryPart, Program, Expr } from '../../lang/wasm'
import { Program, Expr } from '../../lang/wasm'
import {
getNodePathFromSourceRange,
getNodeFromPath,
@ -9,8 +9,9 @@ import {
getTransformInfos,
transformAstSketchLines,
PathToNodeMap,
TransformInfo,
isExprBinaryPart,
} from '../../lang/std/sketchcombos'
import { TransformInfo } from 'lang/std/stdTypes'
import {
SetAngleLengthModal,
createSetAngleLengthModal,
@ -121,11 +122,9 @@ export async function applyConstraintAbsDistance({
value: forceVal,
valueName: constraint === 'yAbs' ? 'yDis' : 'xDis',
})
let finalValue = removeDoubleNegatives(
valueNode as BinaryPart,
sign,
variableName
)
if (!isExprBinaryPart(valueNode))
return Promise.reject('Invalid valueNode, is not a BinaryPart')
let finalValue = removeDoubleNegatives(valueNode, sign, variableName)
const transform2 = transformAstSketchLines({
ast: structuredClone(kclManager.ast),