diff --git a/src/lang/std/artifactMapGraphs/exampleCode1.png b/src/lang/std/artifactMapGraphs/exampleCode1.png index c56d2030f..3e2c972e0 100644 Binary files a/src/lang/std/artifactMapGraphs/exampleCode1.png and b/src/lang/std/artifactMapGraphs/exampleCode1.png differ diff --git a/src/lang/std/artifactMapGraphs/sketchOnFaceOnFaceEtc.png b/src/lang/std/artifactMapGraphs/sketchOnFaceOnFaceEtc.png index 4a18696a8..5259f88af 100644 Binary files a/src/lang/std/artifactMapGraphs/sketchOnFaceOnFaceEtc.png and b/src/lang/std/artifactMapGraphs/sketchOnFaceOnFaceEtc.png differ diff --git a/src/lang/std/sketchConstraints.test.ts b/src/lang/std/sketchConstraints.test.ts index d5694d1f4..507796c8c 100644 --- a/src/lang/std/sketchConstraints.test.ts +++ b/src/lang/std/sketchConstraints.test.ts @@ -69,7 +69,7 @@ async function testingSwapSketchFnCall({ describe('testing swapping out sketch calls with xLine/xLineTo', () => { const bigExampleArr = [ - `const part001 = startSketchOn('XY')`, + `let part001 = startSketchOn('XY')`, ` |> startProfileAt([0, 0], %)`, ` |> lineTo([1, 1], %, $abc1)`, ` |> line([-2.04, -0.7], %, $abc2)`, @@ -258,14 +258,14 @@ describe('testing swapping out sketch calls with xLine/xLineTo', () => { describe('testing swapping out sketch calls with xLine/xLineTo while keeping variable/identifiers intact', () => { // Enable rotations #152 const variablesExampleArr = [ - `const lineX = -1`, - `const lineToX = -1.3`, - `const angledLineAngle = 207`, - `const angledLineOfXLengthX = 0.8`, - `const angledLineOfYLengthY = 0.89`, - `const angledLineToXx = -1.86`, - `const angledLineToYy = -0.76`, - `const part001 = startSketchOn('XY')`, + `let lineX = -1`, + `let lineToX = -1.3`, + `let angledLineAngle = 207`, + `let angledLineOfXLengthX = 0.8`, + `let angledLineOfYLengthY = 0.89`, + `let angledLineToXx = -1.86`, + `let angledLineToYy = -0.76`, + `let part001 = startSketchOn('XY')`, ` |> startProfileAt([0, 0], %)`, // ` |> rx(90, %)`, ` |> lineTo([1, 1], %)`, @@ -359,7 +359,7 @@ describe('testing swapping out sketch calls with xLine/xLineTo while keeping var describe('testing getSketchSegmentIndexFromSourceRange', () => { const code = ` -const part001 = startSketchOn('XY') +let part001 = startSketchOn('XY') |> startProfileAt([0, 0.04], %) // segment-in-start |> line([0, 0.4], %) |> xLine(3.48, %) diff --git a/src/lang/std/sketchcombos.test.ts b/src/lang/std/sketchcombos.test.ts index f4700c216..c70f466eb 100644 --- a/src/lang/std/sketchcombos.test.ts +++ b/src/lang/std/sketchcombos.test.ts @@ -96,12 +96,12 @@ function makeSelections( } describe('testing transformAstForSketchLines for equal length constraint', () => { - const inputScript = `const myVar = 3 -const myVar2 = 5 -const myVar3 = 6 -const myAng = 40 -const myAng2 = 134 -const part001 = startSketchOn('XY') + const inputScript = `let myVar = 3 +let myVar2 = 5 +let myVar3 = 6 +let myAng = 40 +let myAng2 = 134 +let part001 = startSketchOn('XY') |> startProfileAt([0, 0], %) |> line([1, 3.82], %) // ln-should-get-tag |> lineTo([myVar, 1], %) // ln-lineTo-xAbsolute should use angleToMatchLengthX helper @@ -132,12 +132,12 @@ const part001 = startSketchOn('XY') |> xLineTo(30, %) // ln-xLineTo-free should convert to xLine |> yLineTo(20, %) // ln-yLineTo-free should convert to yLine ` - const expectModifiedScript = `const myVar = 3 -const myVar2 = 5 -const myVar3 = 6 -const myAng = 40 -const myAng2 = 134 -const part001 = startSketchOn('XY') + const expectModifiedScript = `let myVar = 3 +let myVar2 = 5 +let myVar3 = 6 +let myAng = 40 +let myAng2 = 134 +let part001 = startSketchOn('XY') |> startProfileAt([0, 0], %) |> line([1, 3.82], %, $seg01) // ln-should-get-tag |> angledLineToX([ @@ -241,10 +241,10 @@ const part001 = startSketchOn('XY') }) describe('testing transformAstForSketchLines for vertical and horizontal constraint', () => { - const inputScript = `const myVar = 2 -const myVar2 = 12 -const myVar3 = -10 -const part001 = startSketchOn('XY') + const inputScript = `let myVar = 2 +let myVar2 = 12 +let myVar3 = -10 +let part001 = startSketchOn('XY') |> startProfileAt([0, 0], %) |> lineTo([1, 1], %) |> line([-6.28, 1.4], %) // select for horizontal constraint 1 @@ -269,10 +269,10 @@ const part001 = startSketchOn('XY') |> angledLineToY([301, myVar], %) // select for vertical constraint 10 ` it('should transform horizontal lines the ast', async () => { - const expectModifiedScript = `const myVar = 2 -const myVar2 = 12 -const myVar3 = -10 -const part001 = startSketchOn('XY') + const expectModifiedScript = `let myVar = 2 +let myVar2 = 12 +let myVar3 = -10 +let part001 = startSketchOn('XY') |> startProfileAt([0, 0], %) |> lineTo([1, 1], %) |> xLine(-6.28, %) // select for horizontal constraint 1 @@ -331,10 +331,10 @@ const part001 = startSketchOn('XY') expect(newCode).toBe(expectModifiedScript) }) it('should transform vertical lines the ast', async () => { - const expectModifiedScript = `const myVar = 2 -const myVar2 = 12 -const myVar3 = -10 -const part001 = startSketchOn('XY') + const expectModifiedScript = `let myVar = 2 +let myVar2 = 12 +let myVar3 = -10 +let part001 = startSketchOn('XY') |> startProfileAt([0, 0], %) |> lineTo([1, 1], %) |> line([-6.28, 1.4], %) // select for horizontal constraint 1 @@ -396,8 +396,8 @@ const part001 = startSketchOn('XY') describe('testing transformAstForSketchLines for vertical and horizontal distance constraints', () => { describe('testing setHorzDistance for line', () => { - const inputScript = `const myVar = 1 -const part001 = startSketchOn('XY') + const inputScript = `let myVar = 1 +let part001 = startSketchOn('XY') |> startProfileAt([0, 0], %) |> line([0.31, 1.67], %) // base selection |> line([0.45, 1.46], %) @@ -505,7 +505,7 @@ const baseThickHalf = baseThick / 2 const halfHeight = totalHeight / 2 const halfArmAngle = armAngle / 2 -const part001 = startSketchOn('XY') +let part001 = startSketchOn('XY') |> startProfileAt([-0.01, -0.05], %) |> line([0.01, 0.94 + 0], %) // partial |> xLine(3.03, %) // partial