@ -241,7 +241,6 @@ export function extrudeSketch(
|
|||||||
pathToExtrudeArg: PathToNode
|
pathToExtrudeArg: PathToNode
|
||||||
} {
|
} {
|
||||||
const _node = { ...node }
|
const _node = { ...node }
|
||||||
const dumbyStartend = { start: 0, end: 0 }
|
|
||||||
const { node: sketchExpression } = getNodeFromPath(
|
const { node: sketchExpression } = getNodeFromPath(
|
||||||
_node,
|
_node,
|
||||||
pathToNode,
|
pathToNode,
|
||||||
@ -256,18 +255,14 @@ export function extrudeSketch(
|
|||||||
)
|
)
|
||||||
const isInPipeExpression = pipeExpression.type === 'PipeExpression'
|
const isInPipeExpression = pipeExpression.type === 'PipeExpression'
|
||||||
|
|
||||||
const { node: variableDeclorator, shallowPath: pathToDecleration } =
|
const { node: variableDeclarator, shallowPath: pathToDecleration } =
|
||||||
getNodeFromPath<VariableDeclarator>(_node, pathToNode, 'VariableDeclarator')
|
getNodeFromPath<VariableDeclarator>(_node, pathToNode, 'VariableDeclarator')
|
||||||
|
|
||||||
const extrudeCall = createCallExpressionStdLib('extrude', [
|
const extrudeCall = createCallExpressionStdLib('extrude', [
|
||||||
distance,
|
distance,
|
||||||
shouldPipe
|
shouldPipe
|
||||||
? createPipeSubstitution()
|
? createPipeSubstitution()
|
||||||
: {
|
: createIdentifier(variableDeclarator.id.name),
|
||||||
type: 'Identifier',
|
|
||||||
...dumbyStartend,
|
|
||||||
name: variableDeclorator.id.name,
|
|
||||||
},
|
|
||||||
])
|
])
|
||||||
|
|
||||||
if (shouldPipe) {
|
if (shouldPipe) {
|
||||||
@ -277,7 +272,7 @@ export function extrudeSketch(
|
|||||||
: [sketchExpression as any, extrudeCall]
|
: [sketchExpression as any, extrudeCall]
|
||||||
)
|
)
|
||||||
|
|
||||||
variableDeclorator.init = pipeChain
|
variableDeclarator.init = pipeChain
|
||||||
const pathToExtrudeArg: PathToNode = [
|
const pathToExtrudeArg: PathToNode = [
|
||||||
...pathToDecleration,
|
...pathToDecleration,
|
||||||
['init', 'VariableDeclarator'],
|
['init', 'VariableDeclarator'],
|
||||||
|
Reference in New Issue
Block a user