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:
@ -16,6 +16,7 @@ import {
|
||||
VariableDeclaration,
|
||||
VariableDeclarator,
|
||||
sketchGroupFromKclValue,
|
||||
ObjectExpression,
|
||||
} from './wasm'
|
||||
import { createIdentifier, splitPathAtLastIndex } from './modifyAst'
|
||||
import { getSketchSegmentFromSourceRange } from './std/sketchConstraints'
|
||||
@ -934,3 +935,12 @@ export function hasExtrudableGeometry(ast: Program) {
|
||||
})
|
||||
return Object.keys(theMap).length > 0
|
||||
}
|
||||
|
||||
export function getObjExprProperty(
|
||||
node: ObjectExpression,
|
||||
propName: string
|
||||
): { expr: Expr; index: number } | null {
|
||||
const index = node.properties.findIndex(({ key }) => key.name === propName)
|
||||
if (index === -1) return null
|
||||
return { expr: node.properties[index].value, index }
|
||||
}
|
||||
|
Reference in New Issue
Block a user