diff --git a/docs/kcl/appearance.md b/docs/kcl/appearance.md index ad6c5f1103..4822f62447 100644 --- a/docs/kcl/appearance.md +++ b/docs/kcl/appearance.md @@ -53,7 +53,7 @@ example = extrude(exampleSketch, length = 5) ```js // Add color to a revolved solid. sketch001 = startSketchOn('XY') - |> circle({ center = [15, 0], radius = 5 }, %) + |> circle(center = [15, 0], radius = 5) |> revolve({ angle = 360, axis = 'y' }, %) |> appearance(color = '#ff0000', metalness = 90, roughness = 90) ``` @@ -195,10 +195,10 @@ sweepPath = startSketchOn('XZ') |> line(end = [0, 7]) pipeHole = startSketchOn('XY') - |> circle({ center = [0, 0], radius = 1.5 }, %) + |> circle(center = [0, 0], radius = 1.5) sweepSketch = startSketchOn('XY') - |> circle({ center = [0, 0], radius = 2 }, %) + |> circle(center = [0, 0], radius = 2) |> hole(pipeHole, %) |> sweep(path = sweepPath) |> appearance(color = "#ff0000", metalness = 50, roughness = 50) diff --git a/docs/kcl/circle.md b/docs/kcl/circle.md index 24c76ce503..34d52c49e1 100644 --- a/docs/kcl/circle.md +++ b/docs/kcl/circle.md @@ -10,8 +10,9 @@ the provided (x, y) origin point. ```js circle( - data: CircleData, - sketchSurfaceOrGroup: SketchOrSurface, + sketchOrSurface: SketchOrSurface, + center: [number], + radius: number, tag?: TagDeclarator, ) -> Sketch ``` @@ -21,9 +22,10 @@ circle( | Name | Type | Description | Required | |----------|------|-------------|----------| -| `data` | [`CircleData`](/docs/kcl/types/CircleData) | Data for drawing an circle | Yes | -| `sketchSurfaceOrGroup` | [`SketchOrSurface`](/docs/kcl/types/SketchOrSurface) | A sketch surface or a sketch. | Yes | -| `tag` | [`TagDeclarator`](/docs/kcl/types#tag-declaration) | | No | +| `sketchOrSurface` | [`SketchOrSurface`](/docs/kcl/types/SketchOrSurface) | Plane or surface to sketch on. | Yes | +| `center` | `[number]` | The center of the circle. | Yes | +| `radius` | `number` | The radius of the circle. | Yes | +| `tag` | [`TagDeclarator`](/docs/kcl/types#tag-declaration) | Create a new tag which refers to this circle | No | ### Returns @@ -34,7 +36,7 @@ circle( ```js exampleSketch = startSketchOn("-XZ") - |> circle({ center = [0, 0], radius = 10 }, %) + |> circle(center = [0, 0], radius = 10) example = extrude(exampleSketch, length = 5) ``` @@ -48,7 +50,7 @@ exampleSketch = startSketchOn("XZ") |> line(end = [0, 30]) |> line(end = [-30, 0]) |> close() - |> hole(circle({ center = [0, 15], radius = 5 }, %), %) + |> hole(circle(center = [0, 15], radius = 5), %) example = extrude(exampleSketch, length = 5) ``` diff --git a/docs/kcl/const_std-math-PI.md b/docs/kcl/const_std-math-PI.md index c92a9192a4..c0bd40e144 100644 --- a/docs/kcl/const_std-math-PI.md +++ b/docs/kcl/const_std-math-PI.md @@ -18,7 +18,7 @@ std::math::PI: number = 3.14159265358979323846264338327950288_ circumference = 70 exampleSketch = startSketchOn("XZ") - |> circle({ center = [0, 0], radius = circumference/ (2 * PI) }, %) + |> circle(center = [0, 0], radius = circumference/ (2 * PI)) example = extrude(exampleSketch, length = 5) ``` diff --git a/docs/kcl/helix.md b/docs/kcl/helix.md index f03e0c0580..512259e388 100644 --- a/docs/kcl/helix.md +++ b/docs/kcl/helix.md @@ -51,7 +51,7 @@ helixPath = helix( // Create a spring by sweeping around the helix path. springSketch = startSketchOn('YZ') - |> circle({ center = [0, 0], radius = 0.5 }, %) + |> circle(center = [0, 0], radius = 0.5) |> sweep(path = helixPath) ``` @@ -74,7 +74,7 @@ helixPath = helix( // Create a spring by sweeping around the helix path. springSketch = startSketchOn('XY') - |> circle({ center = [0, 0], radius = 0.5 }, %) + |> circle(center = [0, 0], radius = 0.5) |> sweep(path = helixPath) ``` @@ -98,7 +98,7 @@ helixPath = helix( // Create a spring by sweeping around the helix path. springSketch = startSketchOn('XY') - |> circle({ center = [0, 0], radius = 1 }, %) + |> circle(center = [0, 0], radius = 1) |> sweep(path = helixPath) ``` diff --git a/docs/kcl/helixRevolutions.md b/docs/kcl/helixRevolutions.md index fb08a5b41c..30c37d5897 100644 --- a/docs/kcl/helixRevolutions.md +++ b/docs/kcl/helixRevolutions.md @@ -32,7 +32,7 @@ helixRevolutions( ```js part001 = startSketchOn('XY') - |> circle({ center = [5, 5], radius = 10 }, %) + |> circle(center = [5, 5], radius = 10) |> extrude(length = 10) |> helixRevolutions({ angleStart = 0, diff --git a/docs/kcl/hole.md b/docs/kcl/hole.md index 4b4433360c..cedffd189a 100644 --- a/docs/kcl/hole.md +++ b/docs/kcl/hole.md @@ -37,8 +37,8 @@ exampleSketch = startSketchOn(XY) |> line(end = [5, 0]) |> line(end = [0, -5]) |> close() - |> hole(circle({ center = [1, 1], radius = .25 }, %), %) - |> hole(circle({ center = [1, 4], radius = .25 }, %), %) + |> hole(circle(center = [1, 1], radius = .25), %) + |> hole(circle(center = [1, 4], radius = .25), %) example = extrude(exampleSketch, length = 1) ``` @@ -57,7 +57,7 @@ fn squareHoleSketch() { } exampleSketch = startSketchOn(-XZ) - |> circle({ center = [0, 0], radius = 3 }, %) + |> circle(center = [0, 0], radius = 3) |> hole(squareHoleSketch(), %) example = extrude(exampleSketch, length = 1) ``` diff --git a/docs/kcl/hollow.md b/docs/kcl/hollow.md index bd80540809..6420efba2c 100644 --- a/docs/kcl/hollow.md +++ b/docs/kcl/hollow.md @@ -70,17 +70,11 @@ case = startSketchOn('-XZ') |> extrude(length = 65) thing1 = startSketchOn(case, 'end') - |> circle({ - center = [-size / 2, -size / 2], - radius = 25 - }, %) + |> circle(center = [-size / 2, -size / 2], radius = 25) |> extrude(length = 50) thing2 = startSketchOn(case, 'end') - |> circle({ - center = [size / 2, -size / 2], - radius = 25 - }, %) + |> circle(center = [size / 2, -size / 2], radius = 25) |> extrude(length = 50) hollow(0.5, case) diff --git a/docs/kcl/int.md b/docs/kcl/int.md index da4cb337dc..d5097fcefd 100644 --- a/docs/kcl/int.md +++ b/docs/kcl/int.md @@ -37,7 +37,7 @@ n = int(ceil(5 / 2)) assertEqual(n, 3, 0.0001, "5/2 = 2.5, rounded up makes 3") // Draw n cylinders. startSketchOn('XZ') - |> circle({ center = [0, 0], radius = 2 }, %) + |> circle(center = [0, 0], radius = 2) |> extrude(length = 5) |> patternTransform( instances = n, diff --git a/docs/kcl/loft.md b/docs/kcl/loft.md index d62e3c9ca8..99e8619508 100644 --- a/docs/kcl/loft.md +++ b/docs/kcl/loft.md @@ -69,10 +69,10 @@ squareSketch = startSketchOn('XY') |> close() circleSketch0 = startSketchOn(offsetPlane('XY', offset = 75)) - |> circle({ center = [0, 100], radius = 50 }, %) + |> circle(center = [0, 100], radius = 50) circleSketch1 = startSketchOn(offsetPlane('XY', offset = 150)) - |> circle({ center = [0, 100], radius = 20 }, %) + |> circle(center = [0, 100], radius = 20) loft([ squareSketch, @@ -94,10 +94,10 @@ squareSketch = startSketchOn('XY') |> close() circleSketch0 = startSketchOn(offsetPlane('XY', offset = 75)) - |> circle({ center = [0, 100], radius = 50 }, %) + |> circle(center = [0, 100], radius = 50) circleSketch1 = startSketchOn(offsetPlane('XY', offset = 150)) - |> circle({ center = [0, 100], radius = 20 }, %) + |> circle(center = [0, 100], radius = 20) loft( [ diff --git a/docs/kcl/map.md b/docs/kcl/map.md index f68d552949..d248ef2258 100644 --- a/docs/kcl/map.md +++ b/docs/kcl/map.md @@ -34,7 +34,7 @@ map( r = 10 // radius fn drawCircle(id) { return startSketchOn("XY") - |> circle({ center = [id * 2 * r, 0], radius = r }, %) + |> circle(center = [id * 2 * r, 0], radius = r) } // Call `drawCircle`, passing in each element of the array. @@ -50,7 +50,7 @@ r = 10 // radius // Call `map`, using an anonymous function instead of a named one. circles = map([1..3], fn(id) { return startSketchOn("XY") - |> circle({ center = [id * 2 * r, 0], radius = r }, %) + |> circle(center = [id * 2 * r, 0], radius = r) }) ``` diff --git a/docs/kcl/offsetPlane.md b/docs/kcl/offsetPlane.md index e19ff13f4b..7ae6d8f2f4 100644 --- a/docs/kcl/offsetPlane.md +++ b/docs/kcl/offsetPlane.md @@ -41,7 +41,7 @@ squareSketch = startSketchOn('XY') |> close() circleSketch = startSketchOn(offsetPlane('XY', offset = 150)) - |> circle({ center = [0, 100], radius = 50 }, %) + |> circle(center = [0, 100], radius = 50) loft([squareSketch, circleSketch]) ``` @@ -59,7 +59,7 @@ squareSketch = startSketchOn('XZ') |> close() circleSketch = startSketchOn(offsetPlane('XZ', offset = 150)) - |> circle({ center = [0, 100], radius = 50 }, %) + |> circle(center = [0, 100], radius = 50) loft([squareSketch, circleSketch]) ``` @@ -77,7 +77,7 @@ squareSketch = startSketchOn('YZ') |> close() circleSketch = startSketchOn(offsetPlane('YZ', offset = 150)) - |> circle({ center = [0, 100], radius = 50 }, %) + |> circle(center = [0, 100], radius = 50) loft([squareSketch, circleSketch]) ``` @@ -95,7 +95,7 @@ squareSketch = startSketchOn('-XZ') |> close() circleSketch = startSketchOn(offsetPlane('-XZ', offset = -150)) - |> circle({ center = [0, 100], radius = 50 }, %) + |> circle(center = [0, 100], radius = 50) loft([squareSketch, circleSketch]) ``` @@ -106,7 +106,7 @@ loft([squareSketch, circleSketch]) // A circle on the XY plane startSketchOn("XY") |> startProfileAt([0, 0], %) - |> circle({ radius = 10, center = [0, 0] }, %) + |> circle(radius = 10, center = [0, 0]) // Triangle on the plane 4 units above startSketchOn(offsetPlane("XY", offset = 4)) diff --git a/docs/kcl/patternCircular3d.md b/docs/kcl/patternCircular3d.md index 0680cefa53..d8fb03251d 100644 --- a/docs/kcl/patternCircular3d.md +++ b/docs/kcl/patternCircular3d.md @@ -42,7 +42,7 @@ patternCircular3d( ```js exampleSketch = startSketchOn('XZ') - |> circle({ center = [0, 0], radius = 1 }, %) + |> circle(center = [0, 0], radius = 1) example = extrude(exampleSketch, length = -5) |> patternCircular3d( diff --git a/docs/kcl/patternLinear2d.md b/docs/kcl/patternLinear2d.md index 657e7c7cb6..71c10df092 100644 --- a/docs/kcl/patternLinear2d.md +++ b/docs/kcl/patternLinear2d.md @@ -38,7 +38,7 @@ patternLinear2d( ```js exampleSketch = startSketchOn('XZ') - |> circle({ center = [0, 0], radius = 1 }, %) + |> circle(center = [0, 0], radius = 1) |> patternLinear2d(axis = [1, 0], instances = 7, distance = 4) example = extrude(exampleSketch, length = 1) diff --git a/docs/kcl/patternLinear3d.md b/docs/kcl/patternLinear3d.md index b41dc1b615..adb7a0cf9a 100644 --- a/docs/kcl/patternLinear3d.md +++ b/docs/kcl/patternLinear3d.md @@ -64,17 +64,11 @@ case = startSketchOn('XY') |> extrude(length = 65) thing1 = startSketchOn(case, 'end') - |> circle({ - center = [-size / 2, -size / 2], - radius = 25 - }, %) + |> circle(center = [-size / 2, -size / 2], radius = 25) |> extrude(length = 50) thing2 = startSketchOn(case, 'end') - |> circle({ - center = [size / 2, -size / 2], - radius = 25 - }, %) + |> circle(center = [size / 2, -size / 2], radius = 25) |> extrude(length = 50) // We pass in the "case" here since we want to pattern the whole sketch. @@ -101,10 +95,7 @@ case = startSketchOn('XY') |> extrude(length = 65) thing1 = startSketchOn(case, 'end') - |> circle({ - center = [-size / 2, -size / 2], - radius = 25 - }, %) + |> circle(center = [-size / 2, -size / 2], radius = 25) |> extrude(length = 50) // We pass in `thing1` here with `useOriginal` since we want to pattern just this object on the face. diff --git a/docs/kcl/patternTransform.md b/docs/kcl/patternTransform.md index 6647e09830..3c43e029d2 100644 --- a/docs/kcl/patternTransform.md +++ b/docs/kcl/patternTransform.md @@ -68,7 +68,7 @@ fn transform(id) { // Sketch 4 cylinders. sketch001 = startSketchOn('XZ') - |> circle({ center = [0, 0], radius = 2 }, %) + |> circle(center = [0, 0], radius = 2) |> extrude(length = 5) |> patternTransform(instances = 4, transform = transform) ``` @@ -84,7 +84,7 @@ fn transform(id) { } sketch001 = startSketchOn('XZ') - |> circle({ center = [0, 0], radius = 2 }, %) + |> circle(center = [0, 0], radius = 2) |> extrude(length = 5) |> patternTransform(instances = 4, transform = transform) ``` @@ -184,7 +184,7 @@ fn transform(replicaId) { fn layer() { return startSketchOn("XY") // or some other plane idk - |> circle({ center = [0, 0], radius = 1 }, %, $tag1) + |> circle(center = [0, 0], radius = 1, tag = $tag1) |> extrude(length = h) } // The vase is 100 layers tall. diff --git a/docs/kcl/patternTransform2d.md b/docs/kcl/patternTransform2d.md index 273bb83b49..6dbff0ced0 100644 --- a/docs/kcl/patternTransform2d.md +++ b/docs/kcl/patternTransform2d.md @@ -42,7 +42,7 @@ fn transform(id) { // Sketch 4 circles. sketch001 = startSketchOn('XZ') - |> circle({ center = [0, 0], radius = 2 }, %) + |> circle(center = [0, 0], radius = 2) |> patternTransform2d(instances = 4, transform = transform) ``` diff --git a/docs/kcl/pi.md b/docs/kcl/pi.md index 2c6e9ea647..0a24075f50 100644 --- a/docs/kcl/pi.md +++ b/docs/kcl/pi.md @@ -31,10 +31,7 @@ pi() -> number circumference = 70 exampleSketch = startSketchOn("XZ") - |> circle({ - center = [0, 0], - radius = circumference / (2 * pi()) - }, %) + |> circle(center = [0, 0], radius = circumference / (2 * pi())) example = extrude(exampleSketch, length = 5) ``` diff --git a/docs/kcl/revolve.md b/docs/kcl/revolve.md index 5c5ff59ffd..f0b407ce84 100644 --- a/docs/kcl/revolve.md +++ b/docs/kcl/revolve.md @@ -51,7 +51,7 @@ part001 = startSketchOn('XY') ```js // A donut shape. sketch001 = startSketchOn('XY') - |> circle({ center = [15, 0], radius = 5 }, %) + |> circle(center = [15, 0], radius = 5) |> revolve({ angle = 360, axis = 'y' }, %) ``` @@ -106,7 +106,7 @@ box = startSketchOn('XY') |> extrude(length = 20) sketch001 = startSketchOn(box, "END") - |> circle({ center = [10, 10], radius = 4 }, %) + |> circle(center = [10, 10], radius = 4) |> revolve({ angle = -90, axis = 'y' }, %) ``` @@ -122,7 +122,7 @@ box = startSketchOn('XY') |> extrude(length = 20) sketch001 = startSketchOn(box, "END") - |> circle({ center = [10, 10], radius = 4 }, %) + |> circle(center = [10, 10], radius = 4) |> revolve({ angle = 90, axis = getOppositeEdge(revolveAxis) @@ -141,7 +141,7 @@ box = startSketchOn('XY') |> extrude(length = 20) sketch001 = startSketchOn(box, "END") - |> circle({ center = [10, 10], radius = 4 }, %) + |> circle(center = [10, 10], radius = 4) |> revolve({ angle = 90, axis = getOppositeEdge(revolveAxis), diff --git a/docs/kcl/rotate.md b/docs/kcl/rotate.md index a75783be0a..cd53e77262 100644 --- a/docs/kcl/rotate.md +++ b/docs/kcl/rotate.md @@ -69,10 +69,10 @@ sweepPath = startSketchOn('XZ') // Create a hole for the pipe. pipeHole = startSketchOn('XY') - |> circle({ center = [0, 0], radius = 1.5 }, %) + |> circle(center = [0, 0], radius = 1.5) sweepSketch = startSketchOn('XY') - |> circle({ center = [0, 0], radius = 2 }, %) + |> circle(center = [0, 0], radius = 2) |> hole(pipeHole, %) |> sweep(path = sweepPath) |> rotate(roll = 10, pitch = 10, yaw = 90) @@ -95,10 +95,10 @@ sweepPath = startSketchOn('XZ') // Create a hole for the pipe. pipeHole = startSketchOn('XY') - |> circle({ center = [0, 0], radius = 1.5 }, %) + |> circle(center = [0, 0], radius = 1.5) sweepSketch = startSketchOn('XY') - |> circle({ center = [0, 0], radius = 2 }, %) + |> circle(center = [0, 0], radius = 2) |> hole(pipeHole, %) |> sweep(path = sweepPath) |> rotate(axis = [0, 0, 1.0], angle = 90) diff --git a/docs/kcl/scale.md b/docs/kcl/scale.md index 8ff1d0b045..c9aa91d55e 100644 --- a/docs/kcl/scale.md +++ b/docs/kcl/scale.md @@ -49,10 +49,10 @@ sweepPath = startSketchOn('XZ') // Create a hole for the pipe. pipeHole = startSketchOn('XY') - |> circle({ center = [0, 0], radius = 1.5 }, %) + |> circle(center = [0, 0], radius = 1.5) sweepSketch = startSketchOn('XY') - |> circle({ center = [0, 0], radius = 2 }, %) + |> circle(center = [0, 0], radius = 2) |> hole(pipeHole, %) |> sweep(path = sweepPath) |> scale(scale = [1.0, 1.0, 2.5]) diff --git a/docs/kcl/segEnd.md b/docs/kcl/segEnd.md index d88ba7df56..2d765aa251 100644 --- a/docs/kcl/segEnd.md +++ b/docs/kcl/segEnd.md @@ -40,10 +40,7 @@ cube = startSketchOn('XY') fn cylinder(radius, tag) { return startSketchOn('XY') |> startProfileAt([0, 0], %) - |> circle({ - radius = radius, - center = segEnd(tag) - }, %) + |> circle(radius = radius, center = segEnd(tag)) |> extrude(length = radius) } diff --git a/docs/kcl/segStart.md b/docs/kcl/segStart.md index 3a279b3841..21004abcd9 100644 --- a/docs/kcl/segStart.md +++ b/docs/kcl/segStart.md @@ -40,10 +40,7 @@ cube = startSketchOn('XY') fn cylinder(radius, tag) { return startSketchOn('XY') |> startProfileAt([0, 0], %) - |> circle({ - radius = radius, - center = segStart(tag) - }, %) + |> circle(radius = radius, center = segStart(tag)) |> extrude(length = radius) } diff --git a/docs/kcl/shell.md b/docs/kcl/shell.md index 9aa7ee2feb..863a0e645c 100644 --- a/docs/kcl/shell.md +++ b/docs/kcl/shell.md @@ -108,17 +108,11 @@ case = startSketchOn('-XZ') |> extrude(length = 65) thing1 = startSketchOn(case, 'end') - |> circle({ - center = [-size / 2, -size / 2], - radius = 25 - }, %) + |> circle(center = [-size / 2, -size / 2], radius = 25) |> extrude(length = 50) thing2 = startSketchOn(case, 'end') - |> circle({ - center = [size / 2, -size / 2], - radius = 25 - }, %) + |> circle(center = [size / 2, -size / 2], radius = 25) |> extrude(length = 50) // We put "case" in the shell function to shell the entire object. @@ -139,17 +133,11 @@ case = startSketchOn('XY') |> extrude(length = 65) thing1 = startSketchOn(case, 'end') - |> circle({ - center = [-size / 2, -size / 2], - radius = 25 - }, %) + |> circle(center = [-size / 2, -size / 2], radius = 25) |> extrude(length = 50) thing2 = startSketchOn(case, 'end') - |> circle({ - center = [size / 2, -size / 2], - radius = 25 - }, %) + |> circle(center = [size / 2, -size / 2], radius = 25) |> extrude(length = 50) // We put "thing1" in the shell function to shell the end face of the object. @@ -173,17 +161,11 @@ case = startSketchOn('XY') |> extrude(length = 65) thing1 = startSketchOn(case, 'end') - |> circle({ - center = [-size / 2, -size / 2], - radius = 25 - }, %) + |> circle(center = [-size / 2, -size / 2], radius = 25) |> extrude(length = 50) thing2 = startSketchOn(case, 'end') - |> circle({ - center = [size / 2, -size / 2], - radius = 25 - }, %) + |> circle(center = [size / 2, -size / 2], radius = 25) |> extrude(length = 50) // We put "thing1" and "thing2" in the shell function to shell the end face of the object. diff --git a/docs/kcl/std.json b/docs/kcl/std.json index 59afcb5600..27e956bdcc 100644 --- a/docs/kcl/std.json +++ b/docs/kcl/std.json @@ -47255,14 +47255,14 @@ "deprecated": false, "examples": [ "// Add color to an extruded solid.\nexampleSketch = startSketchOn(\"XZ\")\n |> startProfileAt([0, 0], %)\n |> line(endAbsolute = [10, 0])\n |> line(endAbsolute = [0, 10])\n |> line(endAbsolute = [-10, 0])\n |> close()\n\nexample = extrude(exampleSketch, length = 5)\n // There are other options besides 'color', but they're optional.\n |> appearance(color = '#ff0000')", - "// Add color to a revolved solid.\nsketch001 = startSketchOn('XY')\n |> circle({ center = [15, 0], radius = 5 }, %)\n |> revolve({ angle = 360, axis = 'y' }, %)\n |> appearance(color = '#ff0000', metalness = 90, roughness = 90)", + "// Add color to a revolved solid.\nsketch001 = startSketchOn('XY')\n |> circle(center = [15, 0], radius = 5)\n |> revolve({ angle = 360, axis = 'y' }, %)\n |> appearance(color = '#ff0000', metalness = 90, roughness = 90)", "// Add color to different solids.\nfn cube(center) {\n return startSketchOn('XY')\n |> startProfileAt([center[0] - 10, center[1] - 10], %)\n |> line(endAbsolute = [center[0] + 10, center[1] - 10])\n |> line(endAbsolute = [center[0] + 10, center[1] + 10])\n |> line(endAbsolute = [center[0] - 10, center[1] + 10])\n |> close()\n |> extrude(length = 10)\n}\n\nexample0 = cube([0, 0])\nexample1 = cube([20, 0])\nexample2 = cube([40, 0])\n\nappearance(\n [example0, example1],\n color = '#ff0000',\n metalness = 50,\n roughness = 50,\n)\nappearance(\n example2,\n color = '#00ff00',\n metalness = 50,\n roughness = 50,\n)", "// You can set the appearance before or after you shell it will yield the same result.\n// This example shows setting the appearance _after_ the shell.\nfirstSketch = startSketchOn('XY')\n |> startProfileAt([-12, 12], %)\n |> line(end = [24, 0])\n |> line(end = [0, -24])\n |> line(end = [-24, 0])\n |> close()\n |> extrude(length = 6)\n\nshell(firstSketch, faces = ['end'], thickness = 0.25)\n |> appearance(color = '#ff0000', metalness = 90, roughness = 90)", "// You can set the appearance before or after you shell it will yield the same result.\n// This example shows setting the appearance _before_ the shell.\nfirstSketch = startSketchOn('XY')\n |> startProfileAt([-12, 12], %)\n |> line(end = [24, 0])\n |> line(end = [0, -24])\n |> line(end = [-24, 0])\n |> close()\n |> extrude(length = 6)\n |> appearance(color = '#ff0000', metalness = 90, roughness = 90)\n\nshell(firstSketch, faces = ['end'], thickness = 0.25)", "// Setting the appearance of a 3D pattern can be done _before_ or _after_ the pattern.\n// This example shows _before_ the pattern.\nexampleSketch = startSketchOn('XZ')\n |> startProfileAt([0, 0], %)\n |> line(end = [0, 2])\n |> line(end = [3, 1])\n |> line(end = [0, -4])\n |> close()\n\nexample = extrude(exampleSketch, length = 1)\n |> appearance(color = '#ff0000', metalness = 90, roughness = 90)\n |> patternLinear3d(axis = [1, 0, 1], instances = 7, distance = 6)", "// Setting the appearance of a 3D pattern can be done _before_ or _after_ the pattern.\n// This example shows _after_ the pattern.\nexampleSketch = startSketchOn('XZ')\n |> startProfileAt([0, 0], %)\n |> line(end = [0, 2])\n |> line(end = [3, 1])\n |> line(end = [0, -4])\n |> close()\n\nexample = extrude(exampleSketch, length = 1)\n |> patternLinear3d(axis = [1, 0, 1], instances = 7, distance = 6)\n |> appearance(color = '#ff0000', metalness = 90, roughness = 90)", "// Color the result of a 2D pattern that was extruded.\nexampleSketch = startSketchOn('XZ')\n |> startProfileAt([.5, 25], %)\n |> line(end = [0, 5])\n |> line(end = [-1, 0])\n |> line(end = [0, -5])\n |> close()\n |> patternCircular2d(\n center = [0, 0],\n instances = 13,\n arcDegrees = 360,\n rotateDuplicates = true,\n )\n\nexample = extrude(exampleSketch, length = 1)\n |> appearance(color = '#ff0000', metalness = 90, roughness = 90)", - "// Color the result of a sweep.\n\n\n// Create a path for the sweep.\nsweepPath = startSketchOn('XZ')\n |> startProfileAt([0.05, 0.05], %)\n |> line(end = [0, 7])\n |> tangentialArc({ offset = 90, radius = 5 }, %)\n |> line(end = [-3, 0])\n |> tangentialArc({ offset = -90, radius = 5 }, %)\n |> line(end = [0, 7])\n\npipeHole = startSketchOn('XY')\n |> circle({ center = [0, 0], radius = 1.5 }, %)\n\nsweepSketch = startSketchOn('XY')\n |> circle({ center = [0, 0], radius = 2 }, %)\n |> hole(pipeHole, %)\n |> sweep(path = sweepPath)\n |> appearance(color = \"#ff0000\", metalness = 50, roughness = 50)" + "// Color the result of a sweep.\n\n\n// Create a path for the sweep.\nsweepPath = startSketchOn('XZ')\n |> startProfileAt([0.05, 0.05], %)\n |> line(end = [0, 7])\n |> tangentialArc({ offset = 90, radius = 5 }, %)\n |> line(end = [-3, 0])\n |> tangentialArc({ offset = -90, radius = 5 }, %)\n |> line(end = [0, 7])\n\npipeHole = startSketchOn('XY')\n |> circle(center = [0, 0], radius = 1.5)\n\nsweepSketch = startSketchOn('XY')\n |> circle(center = [0, 0], radius = 2)\n |> hole(pipeHole, %)\n |> sweep(path = sweepPath)\n |> appearance(color = \"#ff0000\", metalness = 50, roughness = 50)" ] }, { @@ -71172,44 +71172,10 @@ "summary": "Construct a 2-dimensional circle, of the specified radius, centered at", "description": "the provided (x, y) origin point.", "tags": [], - "keywordArguments": false, + "keywordArguments": true, "args": [ { - "name": "data", - "type": "CircleData", - "schema": { - "$schema": "https://spec.openapis.org/oas/3.0/schema/2019-04-02#/definitions/Schema", - "title": "CircleData", - "description": "Data for drawing an circle", - "type": "object", - "required": [ - "center", - "radius" - ], - "properties": { - "center": { - "description": "The center of the circle.", - "type": "array", - "items": { - "type": "number", - "format": "double" - }, - "maxItems": 2, - "minItems": 2 - }, - "radius": { - "description": "The circle radius", - "type": "number", - "format": "double" - } - } - }, - "required": true, - "includeInSnippet": true, - "labelRequired": true - }, - { - "name": "sketchSurfaceOrGroup", + "name": "sketchOrSurface", "type": "SketchOrSurface", "schema": { "$schema": "https://spec.openapis.org/oas/3.0/schema/2019-04-02#/definitions/Schema", @@ -72820,6 +72786,3228 @@ }, "required": true, "includeInSnippet": true, + "description": "Plane or surface to sketch on.", + "labelRequired": false + }, + { + "name": "center", + "type": "[number]", + "schema": { + "$schema": "https://spec.openapis.org/oas/3.0/schema/2019-04-02#/definitions/Schema", + "title": "Array_size_2_of_double", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2, + "definitions": { + "SketchSurface": { + "description": "A sketch type.", + "oneOf": [ + { + "description": "A plane.", + "type": "object", + "required": [ + "__meta", + "artifactId", + "id", + "origin", + "type", + "units", + "value", + "xAxis", + "yAxis", + "zAxis" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "plane" + ] + }, + "id": { + "description": "The id of the plane.", + "type": "string", + "format": "uuid" + }, + "artifactId": { + "description": "The artifact ID.", + "allOf": [ + { + "$ref": "#/components/schemas/ArtifactId" + } + ] + }, + "value": { + "$ref": "#/components/schemas/PlaneType" + }, + "origin": { + "description": "Origin of the plane.", + "allOf": [ + { + "$ref": "#/components/schemas/Point3d" + } + ] + }, + "xAxis": { + "description": "What should the plane's X axis be?", + "allOf": [ + { + "$ref": "#/components/schemas/Point3d" + } + ] + }, + "yAxis": { + "description": "What should the plane's Y axis be?", + "allOf": [ + { + "$ref": "#/components/schemas/Point3d" + } + ] + }, + "zAxis": { + "description": "The z-axis (normal).", + "allOf": [ + { + "$ref": "#/components/schemas/Point3d" + } + ] + }, + "units": { + "$ref": "#/components/schemas/UnitLen" + }, + "__meta": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Metadata" + } + } + } + }, + { + "description": "A face.", + "type": "object", + "required": [ + "__meta", + "artifactId", + "id", + "solid", + "type", + "units", + "value", + "xAxis", + "yAxis", + "zAxis" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "face" + ] + }, + "id": { + "description": "The id of the face.", + "type": "string", + "format": "uuid" + }, + "artifactId": { + "description": "The artifact ID.", + "allOf": [ + { + "$ref": "#/components/schemas/ArtifactId" + } + ] + }, + "value": { + "description": "The tag of the face.", + "type": "string" + }, + "xAxis": { + "description": "What should the face's X axis be?", + "allOf": [ + { + "$ref": "#/components/schemas/Point3d" + } + ] + }, + "yAxis": { + "description": "What should the face's Y axis be?", + "allOf": [ + { + "$ref": "#/components/schemas/Point3d" + } + ] + }, + "zAxis": { + "description": "The z-axis (normal).", + "allOf": [ + { + "$ref": "#/components/schemas/Point3d" + } + ] + }, + "solid": { + "description": "The solid the face is on.", + "allOf": [ + { + "$ref": "#/components/schemas/Solid" + } + ] + }, + "units": { + "$ref": "#/components/schemas/UnitLen" + }, + "__meta": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Metadata" + } + } + } + } + ] + }, + "ArtifactId": { + "type": "string", + "format": "uuid" + }, + "PlaneType": { + "description": "Type for a plane.", + "oneOf": [ + { + "type": "string", + "enum": [ + "XY", + "XZ", + "YZ" + ] + }, + { + "description": "A custom plane.", + "type": "string", + "enum": [ + "Custom" + ] + }, + { + "description": "A custom plane which has not been sent to the engine. It must be sent before it is used.", + "type": "string", + "enum": [ + "Uninit" + ] + } + ] + }, + "Point3d": { + "type": "object", + "required": [ + "x", + "y", + "z" + ], + "properties": { + "x": { + "type": "number", + "format": "double" + }, + "y": { + "type": "number", + "format": "double" + }, + "z": { + "type": "number", + "format": "double" + } + } + }, + "UnitLen": { + "description": "A unit of length.", + "oneOf": [ + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "Mm" + ] + } + } + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "Cm" + ] + } + } + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "M" + ] + } + } + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "Inches" + ] + } + } + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "Feet" + ] + } + } + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "Yards" + ] + } + } + } + ] + }, + "Metadata": { + "description": "Metadata.", + "type": "object", + "required": [ + "sourceRange" + ], + "properties": { + "sourceRange": { + "description": "The source range.", + "allOf": [ + { + "$ref": "#/components/schemas/SourceRange" + } + ] + } + } + }, + "SourceRange": { + "description": "The first two items are the start and end points (byte offsets from the start of the file). The third item is whether the source range belongs to the 'main' file, i.e., the file currently being rendered/displayed in the editor.", + "type": "array", + "items": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "maxItems": 3, + "minItems": 3 + }, + "Solid": { + "description": "A solid is a collection of extrude surfaces.\n\nWhen you define a solid to a variable like:\n\n```kcl myPart = startSketchOn('XY') |> startProfileAt([-12, 12], %) |> line(end = [24, 0]) |> line(end = [0, -24]) |> line(end = [-24, 0]) |> close() |> extrude(length = 6) ```\n\nThe `myPart` variable will be an executed `Solid` object. Executed being past tense, because the engine has already executed the commands to create the solid.\n\nThe previous solid commands will never be executed again, in this case.\n\nIf you would like to encapsulate the commands to create the solid any time you call it, you can use a function.\n\n```kcl fn createPart() { return startSketchOn('XY') |> startProfileAt([-12, 12], %) |> line(end = [24, 0]) |> line(end = [0, -24]) |> line(end = [-24, 0]) |> close() |> extrude(length = 6) } ```\n\nNow, every time you call `createPart()`, the commands will be executed and a new solid will be created.\n\nWhen you assign the result of `createPart()` to a variable (`myPart = createPart()`), you are assigning the executed solid to that variable. Meaning that the solid `myPart` will not be executed again.\n\nYou can still execute _new_ commands on the solid like `shell`, `fillet`, `chamfer`, etc. and the solid will be updated.", + "type": "object", + "required": [ + "__meta", + "artifactId", + "height", + "id", + "sketch", + "units", + "value" + ], + "properties": { + "id": { + "description": "The id of the solid.", + "type": "string", + "format": "uuid" + }, + "artifactId": { + "description": "The artifact ID of the solid. Unlike `id`, this doesn't change.", + "allOf": [ + { + "$ref": "#/components/schemas/ArtifactId" + } + ] + }, + "value": { + "description": "The extrude surfaces.", + "type": "array", + "items": { + "$ref": "#/components/schemas/ExtrudeSurface" + } + }, + "sketch": { + "description": "The sketch.", + "allOf": [ + { + "$ref": "#/components/schemas/Sketch" + } + ] + }, + "height": { + "description": "The height of the solid.", + "type": "number", + "format": "double" + }, + "startCapId": { + "description": "The id of the extrusion start cap", + "type": "string", + "format": "uuid", + "nullable": true + }, + "endCapId": { + "description": "The id of the extrusion end cap", + "type": "string", + "format": "uuid", + "nullable": true + }, + "edgeCuts": { + "description": "Chamfers or fillets on this solid.", + "type": "array", + "items": { + "$ref": "#/components/schemas/EdgeCut" + } + }, + "units": { + "$ref": "#/components/schemas/UnitLen" + }, + "__meta": { + "description": "Metadata.", + "type": "array", + "items": { + "$ref": "#/components/schemas/Metadata" + } + } + } + }, + "ExtrudeSurface": { + "description": "An extrude surface.", + "oneOf": [ + { + "description": "An extrude plane.", + "type": "object", + "required": [ + "faceId", + "id", + "sourceRange", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "extrudePlane" + ] + }, + "faceId": { + "description": "The face id for the extrude plane.", + "type": "string", + "format": "uuid" + }, + "tag": { + "description": "The tag.", + "allOf": [ + { + "$ref": "#/components/schemas/TagDeclarator" + } + ], + "nullable": true + }, + "id": { + "description": "The id of the geometry.", + "type": "string", + "format": "uuid" + }, + "sourceRange": { + "description": "The source range.", + "allOf": [ + { + "$ref": "#/components/schemas/SourceRange" + } + ] + } + } + }, + { + "description": "An extruded arc.", + "type": "object", + "required": [ + "faceId", + "id", + "sourceRange", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "extrudeArc" + ] + }, + "faceId": { + "description": "The face id for the extrude plane.", + "type": "string", + "format": "uuid" + }, + "tag": { + "description": "The tag.", + "allOf": [ + { + "$ref": "#/components/schemas/TagDeclarator" + } + ], + "nullable": true + }, + "id": { + "description": "The id of the geometry.", + "type": "string", + "format": "uuid" + }, + "sourceRange": { + "description": "The source range.", + "allOf": [ + { + "$ref": "#/components/schemas/SourceRange" + } + ] + } + } + }, + { + "description": "Geometry metadata.", + "type": "object", + "required": [ + "faceId", + "id", + "sourceRange", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "chamfer" + ] + }, + "faceId": { + "description": "The id for the chamfer surface.", + "type": "string", + "format": "uuid" + }, + "tag": { + "description": "The tag.", + "allOf": [ + { + "$ref": "#/components/schemas/TagDeclarator" + } + ], + "nullable": true + }, + "id": { + "description": "The id of the geometry.", + "type": "string", + "format": "uuid" + }, + "sourceRange": { + "description": "The source range.", + "allOf": [ + { + "$ref": "#/components/schemas/SourceRange" + } + ] + } + } + }, + { + "description": "Geometry metadata.", + "type": "object", + "required": [ + "faceId", + "id", + "sourceRange", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "fillet" + ] + }, + "faceId": { + "description": "The id for the fillet surface.", + "type": "string", + "format": "uuid" + }, + "tag": { + "description": "The tag.", + "allOf": [ + { + "$ref": "#/components/schemas/TagDeclarator" + } + ], + "nullable": true + }, + "id": { + "description": "The id of the geometry.", + "type": "string", + "format": "uuid" + }, + "sourceRange": { + "description": "The source range.", + "allOf": [ + { + "$ref": "#/components/schemas/SourceRange" + } + ] + } + } + } + ] + }, + "TagDeclarator": { + "type": "object", + "required": [ + "value" + ], + "properties": { + "value": { + "type": "string" + }, + "digest": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + }, + "maxItems": 32, + "minItems": 32, + "nullable": true + }, + "start": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "end": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + } + } + }, + "Sketch": { + "description": "A sketch is a collection of paths.\n\nWhen you define a sketch to a variable like:\n\n```kcl mySketch = startSketchOn('XY') |> startProfileAt([-12, 12], %) |> line(end = [24, 0]) |> line(end = [0, -24]) |> line(end = [-24, 0]) |> close() ```\n\nThe `mySketch` variable will be an executed `Sketch` object. Executed being past tense, because the engine has already executed the commands to create the sketch.\n\nThe previous sketch commands will never be executed again, in this case.\n\nIf you would like to encapsulate the commands to create the sketch any time you call it, you can use a function.\n\n```kcl fn createSketch() { return startSketchOn('XY') |> startProfileAt([-12, 12], %) |> line(end = [24, 0]) |> line(end = [0, -24]) |> line(end = [-24, 0]) |> close() } ```\n\nNow, every time you call `createSketch()`, the commands will be executed and a new sketch will be created.\n\nWhen you assign the result of `createSketch()` to a variable (`mySketch = createSketch()`), you are assigning the executed sketch to that variable. Meaning that the sketch `mySketch` will not be executed again.\n\nYou can still execute _new_ commands on the sketch like `extrude`, `revolve`, `loft`, etc. and the sketch will be updated.", + "type": "object", + "required": [ + "__meta", + "artifactId", + "id", + "on", + "originalId", + "paths", + "start", + "units" + ], + "properties": { + "id": { + "description": "The id of the sketch (this will change when the engine's reference to it changes).", + "type": "string", + "format": "uuid" + }, + "paths": { + "description": "The paths in the sketch.", + "type": "array", + "items": { + "$ref": "#/components/schemas/Path" + } + }, + "on": { + "description": "What the sketch is on (can be a plane or a face).", + "allOf": [ + { + "$ref": "#/components/schemas/SketchSurface" + } + ] + }, + "start": { + "description": "The starting path.", + "allOf": [ + { + "$ref": "#/components/schemas/BasePath" + } + ] + }, + "tags": { + "description": "Tag identifiers that have been declared in this sketch.", + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/TagIdentifier" + } + }, + "artifactId": { + "description": "The original id of the sketch. This stays the same even if the sketch is is sketched on face etc.", + "allOf": [ + { + "$ref": "#/components/schemas/ArtifactId" + } + ] + }, + "originalId": { + "type": "string", + "format": "uuid" + }, + "units": { + "$ref": "#/components/schemas/UnitLen" + }, + "__meta": { + "description": "Metadata.", + "type": "array", + "items": { + "$ref": "#/components/schemas/Metadata" + } + } + } + }, + "Path": { + "description": "A path.", + "oneOf": [ + { + "description": "A path that goes to a point.", + "type": "object", + "required": [ + "__geoMeta", + "from", + "to", + "type", + "units" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "ToPoint" + ] + }, + "from": { + "description": "The from point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "to": { + "description": "The to point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "units": { + "$ref": "#/components/schemas/UnitLen" + }, + "tag": { + "description": "The tag of the path.", + "allOf": [ + { + "$ref": "#/components/schemas/TagDeclarator" + } + ], + "nullable": true + }, + "__geoMeta": { + "description": "Metadata.", + "allOf": [ + { + "$ref": "#/components/schemas/GeoMeta" + } + ] + } + } + }, + { + "description": "A arc that is tangential to the last path segment that goes to a point", + "type": "object", + "required": [ + "__geoMeta", + "ccw", + "center", + "from", + "to", + "type", + "units" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "TangentialArcTo" + ] + }, + "center": { + "description": "the arc's center", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "ccw": { + "description": "arc's direction", + "type": "boolean" + }, + "from": { + "description": "The from point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "to": { + "description": "The to point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "units": { + "$ref": "#/components/schemas/UnitLen" + }, + "tag": { + "description": "The tag of the path.", + "allOf": [ + { + "$ref": "#/components/schemas/TagDeclarator" + } + ], + "nullable": true + }, + "__geoMeta": { + "description": "Metadata.", + "allOf": [ + { + "$ref": "#/components/schemas/GeoMeta" + } + ] + } + } + }, + { + "description": "A arc that is tangential to the last path segment", + "type": "object", + "required": [ + "__geoMeta", + "ccw", + "center", + "from", + "to", + "type", + "units" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "TangentialArc" + ] + }, + "center": { + "description": "the arc's center", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "ccw": { + "description": "arc's direction", + "type": "boolean" + }, + "from": { + "description": "The from point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "to": { + "description": "The to point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "units": { + "$ref": "#/components/schemas/UnitLen" + }, + "tag": { + "description": "The tag of the path.", + "allOf": [ + { + "$ref": "#/components/schemas/TagDeclarator" + } + ], + "nullable": true + }, + "__geoMeta": { + "description": "Metadata.", + "allOf": [ + { + "$ref": "#/components/schemas/GeoMeta" + } + ] + } + } + }, + { + "description": "a complete arc", + "type": "object", + "required": [ + "__geoMeta", + "ccw", + "center", + "from", + "radius", + "to", + "type", + "units" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "Circle" + ] + }, + "center": { + "description": "the arc's center", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "radius": { + "description": "the arc's radius", + "type": "number", + "format": "double" + }, + "ccw": { + "description": "arc's direction This is used to compute the tangential angle.", + "type": "boolean" + }, + "from": { + "description": "The from point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "to": { + "description": "The to point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "units": { + "$ref": "#/components/schemas/UnitLen" + }, + "tag": { + "description": "The tag of the path.", + "allOf": [ + { + "$ref": "#/components/schemas/TagDeclarator" + } + ], + "nullable": true + }, + "__geoMeta": { + "description": "Metadata.", + "allOf": [ + { + "$ref": "#/components/schemas/GeoMeta" + } + ] + } + } + }, + { + "description": "A base path.", + "type": "object", + "required": [ + "__geoMeta", + "from", + "p1", + "p2", + "p3", + "to", + "type", + "units" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "CircleThreePoint" + ] + }, + "p1": { + "description": "Point 1 of the circle", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "p2": { + "description": "Point 2 of the circle", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "p3": { + "description": "Point 3 of the circle", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "from": { + "description": "The from point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "to": { + "description": "The to point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "units": { + "$ref": "#/components/schemas/UnitLen" + }, + "tag": { + "description": "The tag of the path.", + "allOf": [ + { + "$ref": "#/components/schemas/TagDeclarator" + } + ], + "nullable": true + }, + "__geoMeta": { + "description": "Metadata.", + "allOf": [ + { + "$ref": "#/components/schemas/GeoMeta" + } + ] + } + } + }, + { + "description": "A path that is horizontal.", + "type": "object", + "required": [ + "__geoMeta", + "from", + "to", + "type", + "units", + "x" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "Horizontal" + ] + }, + "x": { + "description": "The x coordinate.", + "type": "number", + "format": "double" + }, + "from": { + "description": "The from point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "to": { + "description": "The to point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "units": { + "$ref": "#/components/schemas/UnitLen" + }, + "tag": { + "description": "The tag of the path.", + "allOf": [ + { + "$ref": "#/components/schemas/TagDeclarator" + } + ], + "nullable": true + }, + "__geoMeta": { + "description": "Metadata.", + "allOf": [ + { + "$ref": "#/components/schemas/GeoMeta" + } + ] + } + } + }, + { + "description": "An angled line to.", + "type": "object", + "required": [ + "__geoMeta", + "from", + "to", + "type", + "units" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "AngledLineTo" + ] + }, + "x": { + "description": "The x coordinate.", + "type": "number", + "format": "double", + "nullable": true + }, + "y": { + "description": "The y coordinate.", + "type": "number", + "format": "double", + "nullable": true + }, + "from": { + "description": "The from point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "to": { + "description": "The to point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "units": { + "$ref": "#/components/schemas/UnitLen" + }, + "tag": { + "description": "The tag of the path.", + "allOf": [ + { + "$ref": "#/components/schemas/TagDeclarator" + } + ], + "nullable": true + }, + "__geoMeta": { + "description": "Metadata.", + "allOf": [ + { + "$ref": "#/components/schemas/GeoMeta" + } + ] + } + } + }, + { + "description": "A base path.", + "type": "object", + "required": [ + "__geoMeta", + "from", + "to", + "type", + "units" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "Base" + ] + }, + "from": { + "description": "The from point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "to": { + "description": "The to point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "units": { + "$ref": "#/components/schemas/UnitLen" + }, + "tag": { + "description": "The tag of the path.", + "allOf": [ + { + "$ref": "#/components/schemas/TagDeclarator" + } + ], + "nullable": true + }, + "__geoMeta": { + "description": "Metadata.", + "allOf": [ + { + "$ref": "#/components/schemas/GeoMeta" + } + ] + } + } + }, + { + "description": "A circular arc, not necessarily tangential to the current point.", + "type": "object", + "required": [ + "__geoMeta", + "ccw", + "center", + "from", + "radius", + "to", + "type", + "units" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "Arc" + ] + }, + "center": { + "description": "Center of the circle that this arc is drawn on.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "radius": { + "description": "Radius of the circle that this arc is drawn on.", + "type": "number", + "format": "double" + }, + "ccw": { + "description": "True if the arc is counterclockwise.", + "type": "boolean" + }, + "from": { + "description": "The from point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "to": { + "description": "The to point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "units": { + "$ref": "#/components/schemas/UnitLen" + }, + "tag": { + "description": "The tag of the path.", + "allOf": [ + { + "$ref": "#/components/schemas/TagDeclarator" + } + ], + "nullable": true + }, + "__geoMeta": { + "description": "Metadata.", + "allOf": [ + { + "$ref": "#/components/schemas/GeoMeta" + } + ] + } + } + } + ] + }, + "GeoMeta": { + "description": "Geometry metadata.", + "type": "object", + "required": [ + "id", + "sourceRange" + ], + "properties": { + "id": { + "description": "The id of the geometry.", + "type": "string", + "format": "uuid" + }, + "sourceRange": { + "description": "The source range.", + "allOf": [ + { + "$ref": "#/components/schemas/SourceRange" + } + ] + } + } + }, + "BasePath": { + "description": "A base path.", + "type": "object", + "required": [ + "__geoMeta", + "from", + "to", + "units" + ], + "properties": { + "from": { + "description": "The from point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "to": { + "description": "The to point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "units": { + "$ref": "#/components/schemas/UnitLen" + }, + "tag": { + "description": "The tag of the path.", + "allOf": [ + { + "$ref": "#/components/schemas/TagDeclarator" + } + ], + "nullable": true + }, + "__geoMeta": { + "description": "Metadata.", + "allOf": [ + { + "$ref": "#/components/schemas/GeoMeta" + } + ] + } + } + }, + "TagIdentifier": { + "type": "object", + "required": [ + "__meta", + "value" + ], + "properties": { + "value": { + "type": "string" + }, + "info": { + "allOf": [ + { + "$ref": "#/components/schemas/TagEngineInfo" + } + ], + "nullable": true + }, + "__meta": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Metadata" + } + } + } + }, + "TagEngineInfo": { + "description": "Engine information for a tag.", + "type": "object", + "required": [ + "id", + "sketch" + ], + "properties": { + "id": { + "description": "The id of the tagged object.", + "type": "string", + "format": "uuid" + }, + "sketch": { + "description": "The sketch the tag is on.", + "type": "string", + "format": "uuid" + }, + "path": { + "description": "The path the tag is on.", + "allOf": [ + { + "$ref": "#/components/schemas/Path" + } + ], + "nullable": true + }, + "surface": { + "description": "The surface information for the tag.", + "allOf": [ + { + "$ref": "#/components/schemas/ExtrudeSurface" + } + ], + "nullable": true + } + } + }, + "EdgeCut": { + "description": "A fillet or a chamfer.", + "oneOf": [ + { + "description": "A fillet.", + "type": "object", + "required": [ + "edgeId", + "id", + "radius", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "fillet" + ] + }, + "id": { + "description": "The id of the engine command that called this fillet.", + "type": "string", + "format": "uuid" + }, + "radius": { + "type": "number", + "format": "double" + }, + "edgeId": { + "description": "The engine id of the edge to fillet.", + "type": "string", + "format": "uuid" + }, + "tag": { + "allOf": [ + { + "$ref": "#/components/schemas/TagDeclarator" + } + ], + "nullable": true + } + } + }, + { + "description": "A chamfer.", + "type": "object", + "required": [ + "edgeId", + "id", + "length", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "chamfer" + ] + }, + "id": { + "description": "The id of the engine command that called this chamfer.", + "type": "string", + "format": "uuid" + }, + "length": { + "type": "number", + "format": "double" + }, + "edgeId": { + "description": "The engine id of the edge to chamfer.", + "type": "string", + "format": "uuid" + }, + "tag": { + "allOf": [ + { + "$ref": "#/components/schemas/TagDeclarator" + } + ], + "nullable": true + } + } + } + ] + } + } + }, + "required": true, + "includeInSnippet": true, + "description": "The center of the circle.", + "labelRequired": true + }, + { + "name": "radius", + "type": "number", + "schema": { + "$schema": "https://spec.openapis.org/oas/3.0/schema/2019-04-02#/definitions/Schema", + "title": "double", + "type": "number", + "format": "double", + "definitions": { + "SketchSurface": { + "description": "A sketch type.", + "oneOf": [ + { + "description": "A plane.", + "type": "object", + "required": [ + "__meta", + "artifactId", + "id", + "origin", + "type", + "units", + "value", + "xAxis", + "yAxis", + "zAxis" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "plane" + ] + }, + "id": { + "description": "The id of the plane.", + "type": "string", + "format": "uuid" + }, + "artifactId": { + "description": "The artifact ID.", + "allOf": [ + { + "$ref": "#/components/schemas/ArtifactId" + } + ] + }, + "value": { + "$ref": "#/components/schemas/PlaneType" + }, + "origin": { + "description": "Origin of the plane.", + "allOf": [ + { + "$ref": "#/components/schemas/Point3d" + } + ] + }, + "xAxis": { + "description": "What should the plane's X axis be?", + "allOf": [ + { + "$ref": "#/components/schemas/Point3d" + } + ] + }, + "yAxis": { + "description": "What should the plane's Y axis be?", + "allOf": [ + { + "$ref": "#/components/schemas/Point3d" + } + ] + }, + "zAxis": { + "description": "The z-axis (normal).", + "allOf": [ + { + "$ref": "#/components/schemas/Point3d" + } + ] + }, + "units": { + "$ref": "#/components/schemas/UnitLen" + }, + "__meta": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Metadata" + } + } + } + }, + { + "description": "A face.", + "type": "object", + "required": [ + "__meta", + "artifactId", + "id", + "solid", + "type", + "units", + "value", + "xAxis", + "yAxis", + "zAxis" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "face" + ] + }, + "id": { + "description": "The id of the face.", + "type": "string", + "format": "uuid" + }, + "artifactId": { + "description": "The artifact ID.", + "allOf": [ + { + "$ref": "#/components/schemas/ArtifactId" + } + ] + }, + "value": { + "description": "The tag of the face.", + "type": "string" + }, + "xAxis": { + "description": "What should the face's X axis be?", + "allOf": [ + { + "$ref": "#/components/schemas/Point3d" + } + ] + }, + "yAxis": { + "description": "What should the face's Y axis be?", + "allOf": [ + { + "$ref": "#/components/schemas/Point3d" + } + ] + }, + "zAxis": { + "description": "The z-axis (normal).", + "allOf": [ + { + "$ref": "#/components/schemas/Point3d" + } + ] + }, + "solid": { + "description": "The solid the face is on.", + "allOf": [ + { + "$ref": "#/components/schemas/Solid" + } + ] + }, + "units": { + "$ref": "#/components/schemas/UnitLen" + }, + "__meta": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Metadata" + } + } + } + } + ] + }, + "ArtifactId": { + "type": "string", + "format": "uuid" + }, + "PlaneType": { + "description": "Type for a plane.", + "oneOf": [ + { + "type": "string", + "enum": [ + "XY", + "XZ", + "YZ" + ] + }, + { + "description": "A custom plane.", + "type": "string", + "enum": [ + "Custom" + ] + }, + { + "description": "A custom plane which has not been sent to the engine. It must be sent before it is used.", + "type": "string", + "enum": [ + "Uninit" + ] + } + ] + }, + "Point3d": { + "type": "object", + "required": [ + "x", + "y", + "z" + ], + "properties": { + "x": { + "type": "number", + "format": "double" + }, + "y": { + "type": "number", + "format": "double" + }, + "z": { + "type": "number", + "format": "double" + } + } + }, + "UnitLen": { + "description": "A unit of length.", + "oneOf": [ + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "Mm" + ] + } + } + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "Cm" + ] + } + } + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "M" + ] + } + } + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "Inches" + ] + } + } + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "Feet" + ] + } + } + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "Yards" + ] + } + } + } + ] + }, + "Metadata": { + "description": "Metadata.", + "type": "object", + "required": [ + "sourceRange" + ], + "properties": { + "sourceRange": { + "description": "The source range.", + "allOf": [ + { + "$ref": "#/components/schemas/SourceRange" + } + ] + } + } + }, + "SourceRange": { + "description": "The first two items are the start and end points (byte offsets from the start of the file). The third item is whether the source range belongs to the 'main' file, i.e., the file currently being rendered/displayed in the editor.", + "type": "array", + "items": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "maxItems": 3, + "minItems": 3 + }, + "Solid": { + "description": "A solid is a collection of extrude surfaces.\n\nWhen you define a solid to a variable like:\n\n```kcl myPart = startSketchOn('XY') |> startProfileAt([-12, 12], %) |> line(end = [24, 0]) |> line(end = [0, -24]) |> line(end = [-24, 0]) |> close() |> extrude(length = 6) ```\n\nThe `myPart` variable will be an executed `Solid` object. Executed being past tense, because the engine has already executed the commands to create the solid.\n\nThe previous solid commands will never be executed again, in this case.\n\nIf you would like to encapsulate the commands to create the solid any time you call it, you can use a function.\n\n```kcl fn createPart() { return startSketchOn('XY') |> startProfileAt([-12, 12], %) |> line(end = [24, 0]) |> line(end = [0, -24]) |> line(end = [-24, 0]) |> close() |> extrude(length = 6) } ```\n\nNow, every time you call `createPart()`, the commands will be executed and a new solid will be created.\n\nWhen you assign the result of `createPart()` to a variable (`myPart = createPart()`), you are assigning the executed solid to that variable. Meaning that the solid `myPart` will not be executed again.\n\nYou can still execute _new_ commands on the solid like `shell`, `fillet`, `chamfer`, etc. and the solid will be updated.", + "type": "object", + "required": [ + "__meta", + "artifactId", + "height", + "id", + "sketch", + "units", + "value" + ], + "properties": { + "id": { + "description": "The id of the solid.", + "type": "string", + "format": "uuid" + }, + "artifactId": { + "description": "The artifact ID of the solid. Unlike `id`, this doesn't change.", + "allOf": [ + { + "$ref": "#/components/schemas/ArtifactId" + } + ] + }, + "value": { + "description": "The extrude surfaces.", + "type": "array", + "items": { + "$ref": "#/components/schemas/ExtrudeSurface" + } + }, + "sketch": { + "description": "The sketch.", + "allOf": [ + { + "$ref": "#/components/schemas/Sketch" + } + ] + }, + "height": { + "description": "The height of the solid.", + "type": "number", + "format": "double" + }, + "startCapId": { + "description": "The id of the extrusion start cap", + "type": "string", + "format": "uuid", + "nullable": true + }, + "endCapId": { + "description": "The id of the extrusion end cap", + "type": "string", + "format": "uuid", + "nullable": true + }, + "edgeCuts": { + "description": "Chamfers or fillets on this solid.", + "type": "array", + "items": { + "$ref": "#/components/schemas/EdgeCut" + } + }, + "units": { + "$ref": "#/components/schemas/UnitLen" + }, + "__meta": { + "description": "Metadata.", + "type": "array", + "items": { + "$ref": "#/components/schemas/Metadata" + } + } + } + }, + "ExtrudeSurface": { + "description": "An extrude surface.", + "oneOf": [ + { + "description": "An extrude plane.", + "type": "object", + "required": [ + "faceId", + "id", + "sourceRange", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "extrudePlane" + ] + }, + "faceId": { + "description": "The face id for the extrude plane.", + "type": "string", + "format": "uuid" + }, + "tag": { + "description": "The tag.", + "allOf": [ + { + "$ref": "#/components/schemas/TagDeclarator" + } + ], + "nullable": true + }, + "id": { + "description": "The id of the geometry.", + "type": "string", + "format": "uuid" + }, + "sourceRange": { + "description": "The source range.", + "allOf": [ + { + "$ref": "#/components/schemas/SourceRange" + } + ] + } + } + }, + { + "description": "An extruded arc.", + "type": "object", + "required": [ + "faceId", + "id", + "sourceRange", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "extrudeArc" + ] + }, + "faceId": { + "description": "The face id for the extrude plane.", + "type": "string", + "format": "uuid" + }, + "tag": { + "description": "The tag.", + "allOf": [ + { + "$ref": "#/components/schemas/TagDeclarator" + } + ], + "nullable": true + }, + "id": { + "description": "The id of the geometry.", + "type": "string", + "format": "uuid" + }, + "sourceRange": { + "description": "The source range.", + "allOf": [ + { + "$ref": "#/components/schemas/SourceRange" + } + ] + } + } + }, + { + "description": "Geometry metadata.", + "type": "object", + "required": [ + "faceId", + "id", + "sourceRange", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "chamfer" + ] + }, + "faceId": { + "description": "The id for the chamfer surface.", + "type": "string", + "format": "uuid" + }, + "tag": { + "description": "The tag.", + "allOf": [ + { + "$ref": "#/components/schemas/TagDeclarator" + } + ], + "nullable": true + }, + "id": { + "description": "The id of the geometry.", + "type": "string", + "format": "uuid" + }, + "sourceRange": { + "description": "The source range.", + "allOf": [ + { + "$ref": "#/components/schemas/SourceRange" + } + ] + } + } + }, + { + "description": "Geometry metadata.", + "type": "object", + "required": [ + "faceId", + "id", + "sourceRange", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "fillet" + ] + }, + "faceId": { + "description": "The id for the fillet surface.", + "type": "string", + "format": "uuid" + }, + "tag": { + "description": "The tag.", + "allOf": [ + { + "$ref": "#/components/schemas/TagDeclarator" + } + ], + "nullable": true + }, + "id": { + "description": "The id of the geometry.", + "type": "string", + "format": "uuid" + }, + "sourceRange": { + "description": "The source range.", + "allOf": [ + { + "$ref": "#/components/schemas/SourceRange" + } + ] + } + } + } + ] + }, + "TagDeclarator": { + "type": "object", + "required": [ + "value" + ], + "properties": { + "value": { + "type": "string" + }, + "digest": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + }, + "maxItems": 32, + "minItems": 32, + "nullable": true + }, + "start": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "end": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + } + } + }, + "Sketch": { + "description": "A sketch is a collection of paths.\n\nWhen you define a sketch to a variable like:\n\n```kcl mySketch = startSketchOn('XY') |> startProfileAt([-12, 12], %) |> line(end = [24, 0]) |> line(end = [0, -24]) |> line(end = [-24, 0]) |> close() ```\n\nThe `mySketch` variable will be an executed `Sketch` object. Executed being past tense, because the engine has already executed the commands to create the sketch.\n\nThe previous sketch commands will never be executed again, in this case.\n\nIf you would like to encapsulate the commands to create the sketch any time you call it, you can use a function.\n\n```kcl fn createSketch() { return startSketchOn('XY') |> startProfileAt([-12, 12], %) |> line(end = [24, 0]) |> line(end = [0, -24]) |> line(end = [-24, 0]) |> close() } ```\n\nNow, every time you call `createSketch()`, the commands will be executed and a new sketch will be created.\n\nWhen you assign the result of `createSketch()` to a variable (`mySketch = createSketch()`), you are assigning the executed sketch to that variable. Meaning that the sketch `mySketch` will not be executed again.\n\nYou can still execute _new_ commands on the sketch like `extrude`, `revolve`, `loft`, etc. and the sketch will be updated.", + "type": "object", + "required": [ + "__meta", + "artifactId", + "id", + "on", + "originalId", + "paths", + "start", + "units" + ], + "properties": { + "id": { + "description": "The id of the sketch (this will change when the engine's reference to it changes).", + "type": "string", + "format": "uuid" + }, + "paths": { + "description": "The paths in the sketch.", + "type": "array", + "items": { + "$ref": "#/components/schemas/Path" + } + }, + "on": { + "description": "What the sketch is on (can be a plane or a face).", + "allOf": [ + { + "$ref": "#/components/schemas/SketchSurface" + } + ] + }, + "start": { + "description": "The starting path.", + "allOf": [ + { + "$ref": "#/components/schemas/BasePath" + } + ] + }, + "tags": { + "description": "Tag identifiers that have been declared in this sketch.", + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/TagIdentifier" + } + }, + "artifactId": { + "description": "The original id of the sketch. This stays the same even if the sketch is is sketched on face etc.", + "allOf": [ + { + "$ref": "#/components/schemas/ArtifactId" + } + ] + }, + "originalId": { + "type": "string", + "format": "uuid" + }, + "units": { + "$ref": "#/components/schemas/UnitLen" + }, + "__meta": { + "description": "Metadata.", + "type": "array", + "items": { + "$ref": "#/components/schemas/Metadata" + } + } + } + }, + "Path": { + "description": "A path.", + "oneOf": [ + { + "description": "A path that goes to a point.", + "type": "object", + "required": [ + "__geoMeta", + "from", + "to", + "type", + "units" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "ToPoint" + ] + }, + "from": { + "description": "The from point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "to": { + "description": "The to point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "units": { + "$ref": "#/components/schemas/UnitLen" + }, + "tag": { + "description": "The tag of the path.", + "allOf": [ + { + "$ref": "#/components/schemas/TagDeclarator" + } + ], + "nullable": true + }, + "__geoMeta": { + "description": "Metadata.", + "allOf": [ + { + "$ref": "#/components/schemas/GeoMeta" + } + ] + } + } + }, + { + "description": "A arc that is tangential to the last path segment that goes to a point", + "type": "object", + "required": [ + "__geoMeta", + "ccw", + "center", + "from", + "to", + "type", + "units" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "TangentialArcTo" + ] + }, + "center": { + "description": "the arc's center", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "ccw": { + "description": "arc's direction", + "type": "boolean" + }, + "from": { + "description": "The from point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "to": { + "description": "The to point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "units": { + "$ref": "#/components/schemas/UnitLen" + }, + "tag": { + "description": "The tag of the path.", + "allOf": [ + { + "$ref": "#/components/schemas/TagDeclarator" + } + ], + "nullable": true + }, + "__geoMeta": { + "description": "Metadata.", + "allOf": [ + { + "$ref": "#/components/schemas/GeoMeta" + } + ] + } + } + }, + { + "description": "A arc that is tangential to the last path segment", + "type": "object", + "required": [ + "__geoMeta", + "ccw", + "center", + "from", + "to", + "type", + "units" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "TangentialArc" + ] + }, + "center": { + "description": "the arc's center", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "ccw": { + "description": "arc's direction", + "type": "boolean" + }, + "from": { + "description": "The from point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "to": { + "description": "The to point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "units": { + "$ref": "#/components/schemas/UnitLen" + }, + "tag": { + "description": "The tag of the path.", + "allOf": [ + { + "$ref": "#/components/schemas/TagDeclarator" + } + ], + "nullable": true + }, + "__geoMeta": { + "description": "Metadata.", + "allOf": [ + { + "$ref": "#/components/schemas/GeoMeta" + } + ] + } + } + }, + { + "description": "a complete arc", + "type": "object", + "required": [ + "__geoMeta", + "ccw", + "center", + "from", + "radius", + "to", + "type", + "units" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "Circle" + ] + }, + "center": { + "description": "the arc's center", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "radius": { + "description": "the arc's radius", + "type": "number", + "format": "double" + }, + "ccw": { + "description": "arc's direction This is used to compute the tangential angle.", + "type": "boolean" + }, + "from": { + "description": "The from point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "to": { + "description": "The to point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "units": { + "$ref": "#/components/schemas/UnitLen" + }, + "tag": { + "description": "The tag of the path.", + "allOf": [ + { + "$ref": "#/components/schemas/TagDeclarator" + } + ], + "nullable": true + }, + "__geoMeta": { + "description": "Metadata.", + "allOf": [ + { + "$ref": "#/components/schemas/GeoMeta" + } + ] + } + } + }, + { + "description": "A base path.", + "type": "object", + "required": [ + "__geoMeta", + "from", + "p1", + "p2", + "p3", + "to", + "type", + "units" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "CircleThreePoint" + ] + }, + "p1": { + "description": "Point 1 of the circle", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "p2": { + "description": "Point 2 of the circle", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "p3": { + "description": "Point 3 of the circle", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "from": { + "description": "The from point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "to": { + "description": "The to point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "units": { + "$ref": "#/components/schemas/UnitLen" + }, + "tag": { + "description": "The tag of the path.", + "allOf": [ + { + "$ref": "#/components/schemas/TagDeclarator" + } + ], + "nullable": true + }, + "__geoMeta": { + "description": "Metadata.", + "allOf": [ + { + "$ref": "#/components/schemas/GeoMeta" + } + ] + } + } + }, + { + "description": "A path that is horizontal.", + "type": "object", + "required": [ + "__geoMeta", + "from", + "to", + "type", + "units", + "x" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "Horizontal" + ] + }, + "x": { + "description": "The x coordinate.", + "type": "number", + "format": "double" + }, + "from": { + "description": "The from point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "to": { + "description": "The to point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "units": { + "$ref": "#/components/schemas/UnitLen" + }, + "tag": { + "description": "The tag of the path.", + "allOf": [ + { + "$ref": "#/components/schemas/TagDeclarator" + } + ], + "nullable": true + }, + "__geoMeta": { + "description": "Metadata.", + "allOf": [ + { + "$ref": "#/components/schemas/GeoMeta" + } + ] + } + } + }, + { + "description": "An angled line to.", + "type": "object", + "required": [ + "__geoMeta", + "from", + "to", + "type", + "units" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "AngledLineTo" + ] + }, + "x": { + "description": "The x coordinate.", + "type": "number", + "format": "double", + "nullable": true + }, + "y": { + "description": "The y coordinate.", + "type": "number", + "format": "double", + "nullable": true + }, + "from": { + "description": "The from point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "to": { + "description": "The to point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "units": { + "$ref": "#/components/schemas/UnitLen" + }, + "tag": { + "description": "The tag of the path.", + "allOf": [ + { + "$ref": "#/components/schemas/TagDeclarator" + } + ], + "nullable": true + }, + "__geoMeta": { + "description": "Metadata.", + "allOf": [ + { + "$ref": "#/components/schemas/GeoMeta" + } + ] + } + } + }, + { + "description": "A base path.", + "type": "object", + "required": [ + "__geoMeta", + "from", + "to", + "type", + "units" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "Base" + ] + }, + "from": { + "description": "The from point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "to": { + "description": "The to point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "units": { + "$ref": "#/components/schemas/UnitLen" + }, + "tag": { + "description": "The tag of the path.", + "allOf": [ + { + "$ref": "#/components/schemas/TagDeclarator" + } + ], + "nullable": true + }, + "__geoMeta": { + "description": "Metadata.", + "allOf": [ + { + "$ref": "#/components/schemas/GeoMeta" + } + ] + } + } + }, + { + "description": "A circular arc, not necessarily tangential to the current point.", + "type": "object", + "required": [ + "__geoMeta", + "ccw", + "center", + "from", + "radius", + "to", + "type", + "units" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "Arc" + ] + }, + "center": { + "description": "Center of the circle that this arc is drawn on.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "radius": { + "description": "Radius of the circle that this arc is drawn on.", + "type": "number", + "format": "double" + }, + "ccw": { + "description": "True if the arc is counterclockwise.", + "type": "boolean" + }, + "from": { + "description": "The from point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "to": { + "description": "The to point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "units": { + "$ref": "#/components/schemas/UnitLen" + }, + "tag": { + "description": "The tag of the path.", + "allOf": [ + { + "$ref": "#/components/schemas/TagDeclarator" + } + ], + "nullable": true + }, + "__geoMeta": { + "description": "Metadata.", + "allOf": [ + { + "$ref": "#/components/schemas/GeoMeta" + } + ] + } + } + } + ] + }, + "GeoMeta": { + "description": "Geometry metadata.", + "type": "object", + "required": [ + "id", + "sourceRange" + ], + "properties": { + "id": { + "description": "The id of the geometry.", + "type": "string", + "format": "uuid" + }, + "sourceRange": { + "description": "The source range.", + "allOf": [ + { + "$ref": "#/components/schemas/SourceRange" + } + ] + } + } + }, + "BasePath": { + "description": "A base path.", + "type": "object", + "required": [ + "__geoMeta", + "from", + "to", + "units" + ], + "properties": { + "from": { + "description": "The from point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "to": { + "description": "The to point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "units": { + "$ref": "#/components/schemas/UnitLen" + }, + "tag": { + "description": "The tag of the path.", + "allOf": [ + { + "$ref": "#/components/schemas/TagDeclarator" + } + ], + "nullable": true + }, + "__geoMeta": { + "description": "Metadata.", + "allOf": [ + { + "$ref": "#/components/schemas/GeoMeta" + } + ] + } + } + }, + "TagIdentifier": { + "type": "object", + "required": [ + "__meta", + "value" + ], + "properties": { + "value": { + "type": "string" + }, + "info": { + "allOf": [ + { + "$ref": "#/components/schemas/TagEngineInfo" + } + ], + "nullable": true + }, + "__meta": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Metadata" + } + } + } + }, + "TagEngineInfo": { + "description": "Engine information for a tag.", + "type": "object", + "required": [ + "id", + "sketch" + ], + "properties": { + "id": { + "description": "The id of the tagged object.", + "type": "string", + "format": "uuid" + }, + "sketch": { + "description": "The sketch the tag is on.", + "type": "string", + "format": "uuid" + }, + "path": { + "description": "The path the tag is on.", + "allOf": [ + { + "$ref": "#/components/schemas/Path" + } + ], + "nullable": true + }, + "surface": { + "description": "The surface information for the tag.", + "allOf": [ + { + "$ref": "#/components/schemas/ExtrudeSurface" + } + ], + "nullable": true + } + } + }, + "EdgeCut": { + "description": "A fillet or a chamfer.", + "oneOf": [ + { + "description": "A fillet.", + "type": "object", + "required": [ + "edgeId", + "id", + "radius", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "fillet" + ] + }, + "id": { + "description": "The id of the engine command that called this fillet.", + "type": "string", + "format": "uuid" + }, + "radius": { + "type": "number", + "format": "double" + }, + "edgeId": { + "description": "The engine id of the edge to fillet.", + "type": "string", + "format": "uuid" + }, + "tag": { + "allOf": [ + { + "$ref": "#/components/schemas/TagDeclarator" + } + ], + "nullable": true + } + } + }, + { + "description": "A chamfer.", + "type": "object", + "required": [ + "edgeId", + "id", + "length", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "chamfer" + ] + }, + "id": { + "description": "The id of the engine command that called this chamfer.", + "type": "string", + "format": "uuid" + }, + "length": { + "type": "number", + "format": "double" + }, + "edgeId": { + "description": "The engine id of the edge to chamfer.", + "type": "string", + "format": "uuid" + }, + "tag": { + "allOf": [ + { + "$ref": "#/components/schemas/TagDeclarator" + } + ], + "nullable": true + } + } + } + ] + } + } + }, + "required": true, + "includeInSnippet": true, + "description": "The radius of the circle.", "labelRequired": true }, { @@ -74430,6 +77618,7 @@ } }, "required": false, + "description": "Create a new tag which refers to this circle", "labelRequired": true } ], @@ -76112,8 +79301,8 @@ "unpublished": false, "deprecated": false, "examples": [ - "exampleSketch = startSketchOn(\"-XZ\")\n |> circle({ center = [0, 0], radius = 10 }, %)\n\nexample = extrude(exampleSketch, length = 5)", - "exampleSketch = startSketchOn(\"XZ\")\n |> startProfileAt([-15, 0], %)\n |> line(end = [30, 0])\n |> line(end = [0, 30])\n |> line(end = [-30, 0])\n |> close()\n |> hole(circle({ center = [0, 15], radius = 5 }, %), %)\n\nexample = extrude(exampleSketch, length = 5)" + "exampleSketch = startSketchOn(\"-XZ\")\n |> circle(center = [0, 0], radius = 10)\n\nexample = extrude(exampleSketch, length = 5)", + "exampleSketch = startSketchOn(\"XZ\")\n |> startProfileAt([-15, 0], %)\n |> line(end = [30, 0])\n |> line(end = [0, 30])\n |> line(end = [-30, 0])\n |> close()\n |> hole(circle(center = [0, 15], radius = 5), %)\n\nexample = extrude(exampleSketch, length = 5)" ] }, { @@ -107144,9 +110333,9 @@ "unpublished": false, "deprecated": false, "examples": [ - "// Create a helix around the Z axis.\nhelixPath = helix(\n angleStart = 0,\n ccw = true,\n revolutions = 5,\n length = 10,\n radius = 5,\n axis = 'Z',\n)\n\n// Create a spring by sweeping around the helix path.\nspringSketch = startSketchOn('YZ')\n |> circle({ center = [0, 0], radius = 0.5 }, %)\n |> sweep(path = helixPath)", - "// Create a helix around an edge.\nhelper001 = startSketchOn('XZ')\n |> startProfileAt([0, 0], %)\n |> line(end = [0, 10], tag = $edge001)\n\nhelixPath = helix(\n angleStart = 0,\n ccw = true,\n revolutions = 5,\n length = 10,\n radius = 5,\n axis = edge001,\n)\n\n// Create a spring by sweeping around the helix path.\nspringSketch = startSketchOn('XY')\n |> circle({ center = [0, 0], radius = 0.5 }, %)\n |> sweep(path = helixPath)", - "// Create a helix around a custom axis.\nhelixPath = helix(\n angleStart = 0,\n ccw = true,\n revolutions = 5,\n length = 10,\n radius = 5,\n axis = {\n custom = {\n axis = [0, 0, 1.0],\n origin = [0, 0.25, 0]\n }\n },\n)\n\n// Create a spring by sweeping around the helix path.\nspringSketch = startSketchOn('XY')\n |> circle({ center = [0, 0], radius = 1 }, %)\n |> sweep(path = helixPath)" + "// Create a helix around the Z axis.\nhelixPath = helix(\n angleStart = 0,\n ccw = true,\n revolutions = 5,\n length = 10,\n radius = 5,\n axis = 'Z',\n)\n\n// Create a spring by sweeping around the helix path.\nspringSketch = startSketchOn('YZ')\n |> circle(center = [0, 0], radius = 0.5)\n |> sweep(path = helixPath)", + "// Create a helix around an edge.\nhelper001 = startSketchOn('XZ')\n |> startProfileAt([0, 0], %)\n |> line(end = [0, 10], tag = $edge001)\n\nhelixPath = helix(\n angleStart = 0,\n ccw = true,\n revolutions = 5,\n length = 10,\n radius = 5,\n axis = edge001,\n)\n\n// Create a spring by sweeping around the helix path.\nspringSketch = startSketchOn('XY')\n |> circle(center = [0, 0], radius = 0.5)\n |> sweep(path = helixPath)", + "// Create a helix around a custom axis.\nhelixPath = helix(\n angleStart = 0,\n ccw = true,\n revolutions = 5,\n length = 10,\n radius = 5,\n axis = {\n custom = {\n axis = [0, 0, 1.0],\n origin = [0, 0.25, 0]\n }\n },\n)\n\n// Create a spring by sweeping around the helix path.\nspringSketch = startSketchOn('XY')\n |> circle(center = [0, 0], radius = 1)\n |> sweep(path = helixPath)" ] }, { @@ -110560,7 +113749,7 @@ "unpublished": false, "deprecated": false, "examples": [ - "part001 = startSketchOn('XY')\n |> circle({ center = [5, 5], radius = 10 }, %)\n |> extrude(length = 10)\n |> helixRevolutions({\n angleStart = 0,\n ccw = true,\n revolutions = 16\n }, %)" + "part001 = startSketchOn('XY')\n |> circle(center = [5, 5], radius = 10)\n |> extrude(length = 10)\n |> helixRevolutions({\n angleStart = 0,\n ccw = true,\n revolutions = 16\n }, %)" ] }, { @@ -115634,8 +118823,8 @@ "unpublished": false, "deprecated": false, "examples": [ - "exampleSketch = startSketchOn(XY)\n |> startProfileAt([0, 0], %)\n |> line(end = [0, 5])\n |> line(end = [5, 0])\n |> line(end = [0, -5])\n |> close()\n |> hole(circle({ center = [1, 1], radius = .25 }, %), %)\n |> hole(circle({ center = [1, 4], radius = .25 }, %), %)\n\nexample = extrude(exampleSketch, length = 1)", - "fn squareHoleSketch() {\n squareSketch = startSketchOn(-XZ)\n |> startProfileAt([-1, -1], %)\n |> line(end = [2, 0])\n |> line(end = [0, 2])\n |> line(end = [-2, 0])\n |> close()\n return squareSketch\n}\n\nexampleSketch = startSketchOn(-XZ)\n |> circle({ center = [0, 0], radius = 3 }, %)\n |> hole(squareHoleSketch(), %)\nexample = extrude(exampleSketch, length = 1)" + "exampleSketch = startSketchOn(XY)\n |> startProfileAt([0, 0], %)\n |> line(end = [0, 5])\n |> line(end = [5, 0])\n |> line(end = [0, -5])\n |> close()\n |> hole(circle(center = [1, 1], radius = .25), %)\n |> hole(circle(center = [1, 4], radius = .25), %)\n\nexample = extrude(exampleSketch, length = 1)", + "fn squareHoleSketch() {\n squareSketch = startSketchOn(-XZ)\n |> startProfileAt([-1, -1], %)\n |> line(end = [2, 0])\n |> line(end = [0, 2])\n |> line(end = [-2, 0])\n |> close()\n return squareSketch\n}\n\nexampleSketch = startSketchOn(-XZ)\n |> circle(center = [0, 0], radius = 3)\n |> hole(squareHoleSketch(), %)\nexample = extrude(exampleSketch, length = 1)" ] }, { @@ -119024,7 +122213,7 @@ "examples": [ "// Hollow a basic sketch.\nfirstSketch = startSketchOn('XY')\n |> startProfileAt([-12, 12], %)\n |> line(end = [24, 0])\n |> line(end = [0, -24])\n |> line(end = [-24, 0])\n |> close()\n |> extrude(length = 6)\n |> hollow(0.25, %)", "// Hollow a basic sketch.\nfirstSketch = startSketchOn('-XZ')\n |> startProfileAt([-12, 12], %)\n |> line(end = [24, 0])\n |> line(end = [0, -24])\n |> line(end = [-24, 0])\n |> close()\n |> extrude(length = 6)\n |> hollow(0.5, %)", - "// Hollow a sketch on face object.\nsize = 100\ncase = startSketchOn('-XZ')\n |> startProfileAt([-size, -size], %)\n |> line(end = [2 * size, 0])\n |> line(end = [0, 2 * size])\n |> tangentialArcTo([-size, size], %)\n |> close()\n |> extrude(length = 65)\n\nthing1 = startSketchOn(case, 'end')\n |> circle({\n center = [-size / 2, -size / 2],\n radius = 25\n }, %)\n |> extrude(length = 50)\n\nthing2 = startSketchOn(case, 'end')\n |> circle({\n center = [size / 2, -size / 2],\n radius = 25\n }, %)\n |> extrude(length = 50)\n\nhollow(0.5, case)" + "// Hollow a sketch on face object.\nsize = 100\ncase = startSketchOn('-XZ')\n |> startProfileAt([-size, -size], %)\n |> line(end = [2 * size, 0])\n |> line(end = [0, 2 * size])\n |> tangentialArcTo([-size, size], %)\n |> close()\n |> extrude(length = 65)\n\nthing1 = startSketchOn(case, 'end')\n |> circle(center = [-size / 2, -size / 2], radius = 25)\n |> extrude(length = 50)\n\nthing2 = startSketchOn(case, 'end')\n |> circle(center = [size / 2, -size / 2], radius = 25)\n |> extrude(length = 50)\n\nhollow(0.5, case)" ] }, { @@ -119512,7 +122701,7 @@ "unpublished": false, "deprecated": true, "examples": [ - "n = int(ceil(5 / 2))\nassertEqual(n, 3, 0.0001, \"5/2 = 2.5, rounded up makes 3\")\n// Draw n cylinders.\nstartSketchOn('XZ')\n |> circle({ center = [0, 0], radius = 2 }, %)\n |> extrude(length = 5)\n |> patternTransform(\n instances = n,\n transform = fn(id) {\n return { translate = [4 * id, 0, 0] }\n },\n )" + "n = int(ceil(5 / 2))\nassertEqual(n, 3, 0.0001, \"5/2 = 2.5, rounded up makes 3\")\n// Draw n cylinders.\nstartSketchOn('XZ')\n |> circle(center = [0, 0], radius = 2)\n |> extrude(length = 5)\n |> patternTransform(\n instances = n,\n transform = fn(id) {\n return { translate = [4 * id, 0, 0] }\n },\n )" ] }, { @@ -141070,8 +144259,8 @@ "deprecated": false, "examples": [ "// Loft a square and a triangle.\nsquareSketch = startSketchOn('XY')\n |> startProfileAt([-100, 200], %)\n |> line(end = [200, 0])\n |> line(end = [0, -200])\n |> line(end = [-200, 0])\n |> line(endAbsolute = [profileStartX(%), profileStartY(%)])\n |> close()\n\ntriangleSketch = startSketchOn(offsetPlane('XY', offset = 75))\n |> startProfileAt([0, 125], %)\n |> line(end = [-15, -30])\n |> line(end = [30, 0])\n |> line(endAbsolute = [profileStartX(%), profileStartY(%)])\n |> close()\n\nloft([squareSketch, triangleSketch])", - "// Loft a square, a circle, and another circle.\nsquareSketch = startSketchOn('XY')\n |> startProfileAt([-100, 200], %)\n |> line(end = [200, 0])\n |> line(end = [0, -200])\n |> line(end = [-200, 0])\n |> line(endAbsolute = [profileStartX(%), profileStartY(%)])\n |> close()\n\ncircleSketch0 = startSketchOn(offsetPlane('XY', offset = 75))\n |> circle({ center = [0, 100], radius = 50 }, %)\n\ncircleSketch1 = startSketchOn(offsetPlane('XY', offset = 150))\n |> circle({ center = [0, 100], radius = 20 }, %)\n\nloft([\n squareSketch,\n circleSketch0,\n circleSketch1\n])", - "// Loft a square, a circle, and another circle with options.\nsquareSketch = startSketchOn('XY')\n |> startProfileAt([-100, 200], %)\n |> line(end = [200, 0])\n |> line(end = [0, -200])\n |> line(end = [-200, 0])\n |> line(endAbsolute = [profileStartX(%), profileStartY(%)])\n |> close()\n\ncircleSketch0 = startSketchOn(offsetPlane('XY', offset = 75))\n |> circle({ center = [0, 100], radius = 50 }, %)\n\ncircleSketch1 = startSketchOn(offsetPlane('XY', offset = 150))\n |> circle({ center = [0, 100], radius = 20 }, %)\n\nloft(\n [\n squareSketch,\n circleSketch0,\n circleSketch1\n ],\n baseCurveIndex = 0,\n bezApproximateRational = false,\n tolerance = 0.000001,\n vDegree = 2,\n)" + "// Loft a square, a circle, and another circle.\nsquareSketch = startSketchOn('XY')\n |> startProfileAt([-100, 200], %)\n |> line(end = [200, 0])\n |> line(end = [0, -200])\n |> line(end = [-200, 0])\n |> line(endAbsolute = [profileStartX(%), profileStartY(%)])\n |> close()\n\ncircleSketch0 = startSketchOn(offsetPlane('XY', offset = 75))\n |> circle(center = [0, 100], radius = 50)\n\ncircleSketch1 = startSketchOn(offsetPlane('XY', offset = 150))\n |> circle(center = [0, 100], radius = 20)\n\nloft([\n squareSketch,\n circleSketch0,\n circleSketch1\n])", + "// Loft a square, a circle, and another circle with options.\nsquareSketch = startSketchOn('XY')\n |> startProfileAt([-100, 200], %)\n |> line(end = [200, 0])\n |> line(end = [0, -200])\n |> line(end = [-200, 0])\n |> line(endAbsolute = [profileStartX(%), profileStartY(%)])\n |> close()\n\ncircleSketch0 = startSketchOn(offsetPlane('XY', offset = 75))\n |> circle(center = [0, 100], radius = 50)\n\ncircleSketch1 = startSketchOn(offsetPlane('XY', offset = 150))\n |> circle(center = [0, 100], radius = 20)\n\nloft(\n [\n squareSketch,\n circleSketch0,\n circleSketch1\n ],\n baseCurveIndex = 0,\n bezApproximateRational = false,\n tolerance = 0.000001,\n vDegree = 2,\n)" ] }, { @@ -149043,8 +152232,8 @@ "unpublished": false, "deprecated": false, "examples": [ - "r = 10 // radius\nfn drawCircle(id) {\n return startSketchOn(\"XY\")\n |> circle({ center = [id * 2 * r, 0], radius = r }, %)\n}\n\n// Call `drawCircle`, passing in each element of the array.\n// The outputs from each `drawCircle` form a new array,\n// which is the return value from `map`.\ncircles = map([1..3], drawCircle)", - "r = 10 // radius\n// Call `map`, using an anonymous function instead of a named one.\ncircles = map([1..3], fn(id) {\n return startSketchOn(\"XY\")\n |> circle({ center = [id * 2 * r, 0], radius = r }, %)\n})" + "r = 10 // radius\nfn drawCircle(id) {\n return startSketchOn(\"XY\")\n |> circle(center = [id * 2 * r, 0], radius = r)\n}\n\n// Call `drawCircle`, passing in each element of the array.\n// The outputs from each `drawCircle` form a new array,\n// which is the return value from `map`.\ncircles = map([1..3], drawCircle)", + "r = 10 // radius\n// Call `map`, using an anonymous function instead of a named one.\ncircles = map([1..3], fn(id) {\n return startSketchOn(\"XY\")\n |> circle(center = [id * 2 * r, 0], radius = r)\n})" ] }, { @@ -154269,11 +157458,11 @@ "unpublished": false, "deprecated": false, "examples": [ - "// Loft a square and a circle on the `XY` plane using offset.\nsquareSketch = startSketchOn('XY')\n |> startProfileAt([-100, 200], %)\n |> line(end = [200, 0])\n |> line(end = [0, -200])\n |> line(end = [-200, 0])\n |> line(endAbsolute = [profileStartX(%), profileStartY(%)])\n |> close()\n\ncircleSketch = startSketchOn(offsetPlane('XY', offset = 150))\n |> circle({ center = [0, 100], radius = 50 }, %)\n\nloft([squareSketch, circleSketch])", - "// Loft a square and a circle on the `XZ` plane using offset.\nsquareSketch = startSketchOn('XZ')\n |> startProfileAt([-100, 200], %)\n |> line(end = [200, 0])\n |> line(end = [0, -200])\n |> line(end = [-200, 0])\n |> line(endAbsolute = [profileStartX(%), profileStartY(%)])\n |> close()\n\ncircleSketch = startSketchOn(offsetPlane('XZ', offset = 150))\n |> circle({ center = [0, 100], radius = 50 }, %)\n\nloft([squareSketch, circleSketch])", - "// Loft a square and a circle on the `YZ` plane using offset.\nsquareSketch = startSketchOn('YZ')\n |> startProfileAt([-100, 200], %)\n |> line(end = [200, 0])\n |> line(end = [0, -200])\n |> line(end = [-200, 0])\n |> line(endAbsolute = [profileStartX(%), profileStartY(%)])\n |> close()\n\ncircleSketch = startSketchOn(offsetPlane('YZ', offset = 150))\n |> circle({ center = [0, 100], radius = 50 }, %)\n\nloft([squareSketch, circleSketch])", - "// Loft a square and a circle on the `-XZ` plane using offset.\nsquareSketch = startSketchOn('-XZ')\n |> startProfileAt([-100, 200], %)\n |> line(end = [200, 0])\n |> line(end = [0, -200])\n |> line(end = [-200, 0])\n |> line(endAbsolute = [profileStartX(%), profileStartY(%)])\n |> close()\n\ncircleSketch = startSketchOn(offsetPlane('-XZ', offset = -150))\n |> circle({ center = [0, 100], radius = 50 }, %)\n\nloft([squareSketch, circleSketch])", - "// A circle on the XY plane\nstartSketchOn(\"XY\")\n |> startProfileAt([0, 0], %)\n |> circle({ radius = 10, center = [0, 0] }, %)\n\n// Triangle on the plane 4 units above\nstartSketchOn(offsetPlane(\"XY\", offset = 4))\n |> startProfileAt([0, 0], %)\n |> line(end = [10, 0])\n |> line(end = [0, 10])\n |> close()" + "// Loft a square and a circle on the `XY` plane using offset.\nsquareSketch = startSketchOn('XY')\n |> startProfileAt([-100, 200], %)\n |> line(end = [200, 0])\n |> line(end = [0, -200])\n |> line(end = [-200, 0])\n |> line(endAbsolute = [profileStartX(%), profileStartY(%)])\n |> close()\n\ncircleSketch = startSketchOn(offsetPlane('XY', offset = 150))\n |> circle(center = [0, 100], radius = 50)\n\nloft([squareSketch, circleSketch])", + "// Loft a square and a circle on the `XZ` plane using offset.\nsquareSketch = startSketchOn('XZ')\n |> startProfileAt([-100, 200], %)\n |> line(end = [200, 0])\n |> line(end = [0, -200])\n |> line(end = [-200, 0])\n |> line(endAbsolute = [profileStartX(%), profileStartY(%)])\n |> close()\n\ncircleSketch = startSketchOn(offsetPlane('XZ', offset = 150))\n |> circle(center = [0, 100], radius = 50)\n\nloft([squareSketch, circleSketch])", + "// Loft a square and a circle on the `YZ` plane using offset.\nsquareSketch = startSketchOn('YZ')\n |> startProfileAt([-100, 200], %)\n |> line(end = [200, 0])\n |> line(end = [0, -200])\n |> line(end = [-200, 0])\n |> line(endAbsolute = [profileStartX(%), profileStartY(%)])\n |> close()\n\ncircleSketch = startSketchOn(offsetPlane('YZ', offset = 150))\n |> circle(center = [0, 100], radius = 50)\n\nloft([squareSketch, circleSketch])", + "// Loft a square and a circle on the `-XZ` plane using offset.\nsquareSketch = startSketchOn('-XZ')\n |> startProfileAt([-100, 200], %)\n |> line(end = [200, 0])\n |> line(end = [0, -200])\n |> line(end = [-200, 0])\n |> line(endAbsolute = [profileStartX(%), profileStartY(%)])\n |> close()\n\ncircleSketch = startSketchOn(offsetPlane('-XZ', offset = -150))\n |> circle(center = [0, 100], radius = 50)\n\nloft([squareSketch, circleSketch])", + "// A circle on the XY plane\nstartSketchOn(\"XY\")\n |> startProfileAt([0, 0], %)\n |> circle(radius = 10, center = [0, 0])\n\n// Triangle on the plane 4 units above\nstartSketchOn(offsetPlane(\"XY\", offset = 4))\n |> startProfileAt([0, 0], %)\n |> line(end = [10, 0])\n |> line(end = [0, 10])\n |> close()" ] }, { @@ -178642,7 +181831,7 @@ "unpublished": false, "deprecated": false, "examples": [ - "exampleSketch = startSketchOn('XZ')\n |> circle({ center = [0, 0], radius = 1 }, %)\n\nexample = extrude(exampleSketch, length = -5)\n |> patternCircular3d(\n axis = [1, -1, 0],\n center = [10, -20, 0],\n instances = 11,\n arcDegrees = 360,\n rotateDuplicates = true,\n )" + "exampleSketch = startSketchOn('XZ')\n |> circle(center = [0, 0], radius = 1)\n\nexample = extrude(exampleSketch, length = -5)\n |> patternCircular3d(\n axis = [1, -1, 0],\n center = [10, -20, 0],\n instances = 11,\n arcDegrees = 360,\n rotateDuplicates = true,\n )" ] }, { @@ -188411,7 +191600,7 @@ "unpublished": false, "deprecated": false, "examples": [ - "exampleSketch = startSketchOn('XZ')\n |> circle({ center = [0, 0], radius = 1 }, %)\n |> patternLinear2d(axis = [1, 0], instances = 7, distance = 4)\n\nexample = extrude(exampleSketch, length = 1)" + "exampleSketch = startSketchOn('XZ')\n |> circle(center = [0, 0], radius = 1)\n |> patternLinear2d(axis = [1, 0], instances = 7, distance = 4)\n\nexample = extrude(exampleSketch, length = 1)" ] }, { @@ -198185,8 +201374,8 @@ "deprecated": false, "examples": [ "exampleSketch = startSketchOn('XZ')\n |> startProfileAt([0, 0], %)\n |> line(end = [0, 2])\n |> line(end = [3, 1])\n |> line(end = [0, -4])\n |> close()\n\nexample = extrude(exampleSketch, length = 1)\n |> patternLinear3d(axis = [1, 0, 1], instances = 7, distance = 6)", - "// Pattern a whole sketch on face.\nsize = 100\ncase = startSketchOn('XY')\n |> startProfileAt([-size, -size], %)\n |> line(end = [2 * size, 0])\n |> line(end = [0, 2 * size])\n |> tangentialArcTo([-size, size], %)\n |> close(%)\n |> extrude(length = 65)\n\nthing1 = startSketchOn(case, 'end')\n |> circle({\n center = [-size / 2, -size / 2],\n radius = 25\n }, %)\n |> extrude(length = 50)\n\nthing2 = startSketchOn(case, 'end')\n |> circle({\n center = [size / 2, -size / 2],\n radius = 25\n }, %)\n |> extrude(length = 50)\n\n // We pass in the \"case\" here since we want to pattern the whole sketch.\n// And the case was the base of the sketch.\npatternLinear3d(\n case,\n axis = [1, 0, 0],\n distance = 250,\n instances = 2,\n)", - "// Pattern an object on a face.\nsize = 100\ncase = startSketchOn('XY')\n |> startProfileAt([-size, -size], %)\n |> line(end = [2 * size, 0])\n |> line(end = [0, 2 * size])\n |> tangentialArcTo([-size, size], %)\n |> close(%)\n |> extrude(length = 65)\n\nthing1 = startSketchOn(case, 'end')\n |> circle({\n center = [-size / 2, -size / 2],\n radius = 25\n }, %)\n |> extrude(length = 50)\n\n// We pass in `thing1` here with `useOriginal` since we want to pattern just this object on the face.\npatternLinear3d(\n thing1,\n axis = [1, 0, 0],\n distance = size,\n instances = 2,\n useOriginal = true,\n)" + "// Pattern a whole sketch on face.\nsize = 100\ncase = startSketchOn('XY')\n |> startProfileAt([-size, -size], %)\n |> line(end = [2 * size, 0])\n |> line(end = [0, 2 * size])\n |> tangentialArcTo([-size, size], %)\n |> close(%)\n |> extrude(length = 65)\n\nthing1 = startSketchOn(case, 'end')\n |> circle(center = [-size / 2, -size / 2], radius = 25)\n |> extrude(length = 50)\n\nthing2 = startSketchOn(case, 'end')\n |> circle(center = [size / 2, -size / 2], radius = 25)\n |> extrude(length = 50)\n\n // We pass in the \"case\" here since we want to pattern the whole sketch.\n// And the case was the base of the sketch.\npatternLinear3d(\n case,\n axis = [1, 0, 0],\n distance = 250,\n instances = 2,\n)", + "// Pattern an object on a face.\nsize = 100\ncase = startSketchOn('XY')\n |> startProfileAt([-size, -size], %)\n |> line(end = [2 * size, 0])\n |> line(end = [0, 2 * size])\n |> tangentialArcTo([-size, size], %)\n |> close(%)\n |> extrude(length = 65)\n\nthing1 = startSketchOn(case, 'end')\n |> circle(center = [-size / 2, -size / 2], radius = 25)\n |> extrude(length = 50)\n\n// We pass in `thing1` here with `useOriginal` since we want to pattern just this object on the face.\npatternLinear3d(\n thing1,\n axis = [1, 0, 0],\n distance = size,\n instances = 2,\n useOriginal = true,\n)" ] }, { @@ -206345,11 +209534,11 @@ "unpublished": false, "deprecated": false, "examples": [ - "// Each instance will be shifted along the X axis.\nfn transform(id) {\n return { translate = [4 * id, 0, 0] }\n}\n\n// Sketch 4 cylinders.\nsketch001 = startSketchOn('XZ')\n |> circle({ center = [0, 0], radius = 2 }, %)\n |> extrude(length = 5)\n |> patternTransform(instances = 4, transform = transform)", - "// Each instance will be shifted along the X axis,\n// with a gap between the original (at x = 0) and the first replica\n// (at x = 8). This is because `id` starts at 1.\nfn transform(id) {\n return { translate = [4 * (1 + id), 0, 0] }\n}\n\nsketch001 = startSketchOn('XZ')\n |> circle({ center = [0, 0], radius = 2 }, %)\n |> extrude(length = 5)\n |> patternTransform(instances = 4, transform = transform)", + "// Each instance will be shifted along the X axis.\nfn transform(id) {\n return { translate = [4 * id, 0, 0] }\n}\n\n// Sketch 4 cylinders.\nsketch001 = startSketchOn('XZ')\n |> circle(center = [0, 0], radius = 2)\n |> extrude(length = 5)\n |> patternTransform(instances = 4, transform = transform)", + "// Each instance will be shifted along the X axis,\n// with a gap between the original (at x = 0) and the first replica\n// (at x = 8). This is because `id` starts at 1.\nfn transform(id) {\n return { translate = [4 * (1 + id), 0, 0] }\n}\n\nsketch001 = startSketchOn('XZ')\n |> circle(center = [0, 0], radius = 2)\n |> extrude(length = 5)\n |> patternTransform(instances = 4, transform = transform)", "fn cube(length, center) {\n l = length / 2\n x = center[0]\n y = center[1]\n p0 = [-l + x, -l + y]\n p1 = [-l + x, l + y]\n p2 = [l + x, l + y]\n p3 = [l + x, -l + y]\n\n return startSketchOn('XY')\n |> startProfileAt(p0, %)\n |> line(endAbsolute = p1)\n |> line(endAbsolute = p2)\n |> line(endAbsolute = p3)\n |> line(endAbsolute = p0)\n |> close()\n |> extrude(length = length)\n}\n\nwidth = 20\nfn transform(i) {\n return {\n // Move down each time.\n translate = [0, 0, -i * width],\n // Make the cube longer, wider and flatter each time.\n scale = [pow(1.1, i), pow(1.1, i), pow(0.9, i)],\n // Turn by 15 degrees each time.\n rotation = { angle = 15 * i, origin = \"local\" }\n }\n}\n\nmyCubes = cube(width, [100, 0])\n |> patternTransform(instances = 25, transform = transform)", "fn cube(length, center) {\n l = length / 2\n x = center[0]\n y = center[1]\n p0 = [-l + x, -l + y]\n p1 = [-l + x, l + y]\n p2 = [l + x, l + y]\n p3 = [l + x, -l + y]\n\n return startSketchOn('XY')\n |> startProfileAt(p0, %)\n |> line(endAbsolute = p1)\n |> line(endAbsolute = p2)\n |> line(endAbsolute = p3)\n |> line(endAbsolute = p0)\n |> close()\n |> extrude(length = length)\n}\n\nwidth = 20\nfn transform(i) {\n return {\n translate = [0, 0, -i * width],\n rotation = {\n angle = 90 * i,\n // Rotate around the overall scene's origin.\n origin = \"global\"\n }\n }\n}\nmyCubes = cube(width, [100, 100])\n |> patternTransform(instances = 4, transform = transform)", - "// Parameters\nr = 50 // base radius\nh = 10 // layer height\nt = 0.005 // taper factor [0-1)\n// Defines how to modify each layer of the vase.\n// Each replica is shifted up the Z axis, and has a smoothly-varying radius\nfn transform(replicaId) {\n scale = r * abs(1 - (t * replicaId)) * (5 + cos(replicaId / 8))\n return {\n translate = [0, 0, replicaId * 10],\n scale = [scale, scale, 0]\n }\n}\n// Each layer is just a pretty thin cylinder.\nfn layer() {\n return startSketchOn(\"XY\")\n // or some other plane idk\n |> circle({ center = [0, 0], radius = 1 }, %, $tag1)\n |> extrude(length = h)\n}\n// The vase is 100 layers tall.\n// The 100 layers are replica of each other, with a slight transformation applied to each.\nvase = layer()\n |> patternTransform(instances = 100, transform = transform)", + "// Parameters\nr = 50 // base radius\nh = 10 // layer height\nt = 0.005 // taper factor [0-1)\n// Defines how to modify each layer of the vase.\n// Each replica is shifted up the Z axis, and has a smoothly-varying radius\nfn transform(replicaId) {\n scale = r * abs(1 - (t * replicaId)) * (5 + cos(replicaId / 8))\n return {\n translate = [0, 0, replicaId * 10],\n scale = [scale, scale, 0]\n }\n}\n// Each layer is just a pretty thin cylinder.\nfn layer() {\n return startSketchOn(\"XY\")\n // or some other plane idk\n |> circle(center = [0, 0], radius = 1, tag = $tag1)\n |> extrude(length = h)\n}\n// The vase is 100 layers tall.\n// The 100 layers are replica of each other, with a slight transformation applied to each.\nvase = layer()\n |> patternTransform(instances = 100, transform = transform)", "fn transform(i) {\n // Transform functions can return multiple transforms. They'll be applied in order.\n return [\n { translate = [30 * i, 0, 0] },\n { rotation = { angle = 45 * i } }\n ]\n}\nstartSketchOn('XY')\n |> startProfileAt([0, 0], %)\n |> polygon({\n radius = 10,\n numSides = 4,\n center = [0, 0],\n inscribed = false\n }, %)\n |> extrude(length = 4)\n |> patternTransform(instances = 3, transform = transform)" ] }, @@ -214505,7 +217694,7 @@ "unpublished": false, "deprecated": false, "examples": [ - "// Each instance will be shifted along the X axis.\nfn transform(id) {\n return { translate = [4 * id, 0] }\n}\n\n// Sketch 4 circles.\nsketch001 = startSketchOn('XZ')\n |> circle({ center = [0, 0], radius = 2 }, %)\n |> patternTransform2d(instances = 4, transform = transform)" + "// Each instance will be shifted along the X axis.\nfn transform(id) {\n return { translate = [4 * id, 0] }\n}\n\n// Sketch 4 circles.\nsketch001 = startSketchOn('XZ')\n |> circle(center = [0, 0], radius = 2)\n |> patternTransform2d(instances = 4, transform = transform)" ] }, { @@ -214533,7 +217722,7 @@ "unpublished": false, "deprecated": true, "examples": [ - "circumference = 70\n\nexampleSketch = startSketchOn(\"XZ\")\n |> circle({\n center = [0, 0],\n radius = circumference / (2 * pi())\n }, %)\n\nexample = extrude(exampleSketch, length = 5)" + "circumference = 70\n\nexampleSketch = startSketchOn(\"XZ\")\n |> circle(center = [0, 0], radius = circumference / (2 * pi()))\n\nexample = extrude(exampleSketch, length = 5)" ] }, { @@ -255782,12 +258971,12 @@ "deprecated": false, "examples": [ "part001 = startSketchOn('XY')\n |> startProfileAt([4, 12], %)\n |> line(end = [2, 0])\n |> line(end = [0, -6])\n |> line(end = [4, -6])\n |> line(end = [0, -6])\n |> line(end = [-3.75, -4.5])\n |> line(end = [0, -5.5])\n |> line(end = [-2, 0])\n |> close()\n |> revolve({ axis = 'y' }, %) // default angle is 360", - "// A donut shape.\nsketch001 = startSketchOn('XY')\n |> circle({ center = [15, 0], radius = 5 }, %)\n |> revolve({ angle = 360, axis = 'y' }, %)", + "// A donut shape.\nsketch001 = startSketchOn('XY')\n |> circle(center = [15, 0], radius = 5)\n |> revolve({ angle = 360, axis = 'y' }, %)", "part001 = startSketchOn('XY')\n |> startProfileAt([4, 12], %)\n |> line(end = [2, 0])\n |> line(end = [0, -6])\n |> line(end = [4, -6])\n |> line(end = [0, -6])\n |> line(end = [-3.75, -4.5])\n |> line(end = [0, -5.5])\n |> line(end = [-2, 0])\n |> close()\n |> revolve({ axis = 'y', angle = 180 }, %)", "part001 = startSketchOn('XY')\n |> startProfileAt([4, 12], %)\n |> line(end = [2, 0])\n |> line(end = [0, -6])\n |> line(end = [4, -6])\n |> line(end = [0, -6])\n |> line(end = [-3.75, -4.5])\n |> line(end = [0, -5.5])\n |> line(end = [-2, 0])\n |> close()\n |> revolve({ axis = 'y', angle = 180 }, %)\npart002 = startSketchOn(part001, 'end')\n |> startProfileAt([4.5, -5], %)\n |> line(end = [0, 5])\n |> line(end = [5, 0])\n |> line(end = [0, -5])\n |> close()\n |> extrude(length = 5)", - "box = startSketchOn('XY')\n |> startProfileAt([0, 0], %)\n |> line(end = [0, 20])\n |> line(end = [20, 0])\n |> line(end = [0, -20])\n |> close()\n |> extrude(length = 20)\n\nsketch001 = startSketchOn(box, \"END\")\n |> circle({ center = [10, 10], radius = 4 }, %)\n |> revolve({ angle = -90, axis = 'y' }, %)", - "box = startSketchOn('XY')\n |> startProfileAt([0, 0], %)\n |> line(end = [0, 20])\n |> line(end = [20, 0])\n |> line(end = [0, -20], tag = $revolveAxis)\n |> close()\n |> extrude(length = 20)\n\nsketch001 = startSketchOn(box, \"END\")\n |> circle({ center = [10, 10], radius = 4 }, %)\n |> revolve({\n angle = 90,\n axis = getOppositeEdge(revolveAxis)\n }, %)", - "box = startSketchOn('XY')\n |> startProfileAt([0, 0], %)\n |> line(end = [0, 20])\n |> line(end = [20, 0])\n |> line(end = [0, -20], tag = $revolveAxis)\n |> close()\n |> extrude(length = 20)\n\nsketch001 = startSketchOn(box, \"END\")\n |> circle({ center = [10, 10], radius = 4 }, %)\n |> revolve({\n angle = 90,\n axis = getOppositeEdge(revolveAxis),\n tolerance = 0.0001\n }, %)", + "box = startSketchOn('XY')\n |> startProfileAt([0, 0], %)\n |> line(end = [0, 20])\n |> line(end = [20, 0])\n |> line(end = [0, -20])\n |> close()\n |> extrude(length = 20)\n\nsketch001 = startSketchOn(box, \"END\")\n |> circle(center = [10, 10], radius = 4)\n |> revolve({ angle = -90, axis = 'y' }, %)", + "box = startSketchOn('XY')\n |> startProfileAt([0, 0], %)\n |> line(end = [0, 20])\n |> line(end = [20, 0])\n |> line(end = [0, -20], tag = $revolveAxis)\n |> close()\n |> extrude(length = 20)\n\nsketch001 = startSketchOn(box, \"END\")\n |> circle(center = [10, 10], radius = 4)\n |> revolve({\n angle = 90,\n axis = getOppositeEdge(revolveAxis)\n }, %)", + "box = startSketchOn('XY')\n |> startProfileAt([0, 0], %)\n |> line(end = [0, 20])\n |> line(end = [20, 0])\n |> line(end = [0, -20], tag = $revolveAxis)\n |> close()\n |> extrude(length = 20)\n\nsketch001 = startSketchOn(box, \"END\")\n |> circle(center = [10, 10], radius = 4)\n |> revolve({\n angle = 90,\n axis = getOppositeEdge(revolveAxis),\n tolerance = 0.0001\n }, %)", "sketch001 = startSketchOn('XY')\n |> startProfileAt([10, 0], %)\n |> line(end = [5, -5])\n |> line(end = [5, 5])\n |> line(endAbsolute = [profileStartX(%), profileStartY(%)])\n |> close()\n\npart001 = revolve({\n axis = {\n custom = {\n axis = [0.0, 1.0],\n origin = [0.0, 0.0]\n }\n }\n}, sketch001)" ] }, @@ -268818,8 +272007,8 @@ "unpublished": false, "deprecated": false, "examples": [ - "// Rotate a pipe with roll, pitch, and yaw.\n\n\n// Create a path for the sweep.\nsweepPath = startSketchOn('XZ')\n |> startProfileAt([0.05, 0.05], %)\n |> line(end = [0, 7])\n |> tangentialArc({ offset = 90, radius = 5 }, %)\n |> line(end = [-3, 0])\n |> tangentialArc({ offset = -90, radius = 5 }, %)\n |> line(end = [0, 7])\n\n// Create a hole for the pipe.\npipeHole = startSketchOn('XY')\n |> circle({ center = [0, 0], radius = 1.5 }, %)\n\nsweepSketch = startSketchOn('XY')\n |> circle({ center = [0, 0], radius = 2 }, %)\n |> hole(pipeHole, %)\n |> sweep(path = sweepPath)\n |> rotate(roll = 10, pitch = 10, yaw = 90)", - "// Rotate a pipe about an axis with an angle.\n\n\n// Create a path for the sweep.\nsweepPath = startSketchOn('XZ')\n |> startProfileAt([0.05, 0.05], %)\n |> line(end = [0, 7])\n |> tangentialArc({ offset = 90, radius = 5 }, %)\n |> line(end = [-3, 0])\n |> tangentialArc({ offset = -90, radius = 5 }, %)\n |> line(end = [0, 7])\n\n// Create a hole for the pipe.\npipeHole = startSketchOn('XY')\n |> circle({ center = [0, 0], radius = 1.5 }, %)\n\nsweepSketch = startSketchOn('XY')\n |> circle({ center = [0, 0], radius = 2 }, %)\n |> hole(pipeHole, %)\n |> sweep(path = sweepPath)\n |> rotate(axis = [0, 0, 1.0], angle = 90)" + "// Rotate a pipe with roll, pitch, and yaw.\n\n\n// Create a path for the sweep.\nsweepPath = startSketchOn('XZ')\n |> startProfileAt([0.05, 0.05], %)\n |> line(end = [0, 7])\n |> tangentialArc({ offset = 90, radius = 5 }, %)\n |> line(end = [-3, 0])\n |> tangentialArc({ offset = -90, radius = 5 }, %)\n |> line(end = [0, 7])\n\n// Create a hole for the pipe.\npipeHole = startSketchOn('XY')\n |> circle(center = [0, 0], radius = 1.5)\n\nsweepSketch = startSketchOn('XY')\n |> circle(center = [0, 0], radius = 2)\n |> hole(pipeHole, %)\n |> sweep(path = sweepPath)\n |> rotate(roll = 10, pitch = 10, yaw = 90)", + "// Rotate a pipe about an axis with an angle.\n\n\n// Create a path for the sweep.\nsweepPath = startSketchOn('XZ')\n |> startProfileAt([0.05, 0.05], %)\n |> line(end = [0, 7])\n |> tangentialArc({ offset = 90, radius = 5 }, %)\n |> line(end = [-3, 0])\n |> tangentialArc({ offset = -90, radius = 5 }, %)\n |> line(end = [0, 7])\n\n// Create a hole for the pipe.\npipeHole = startSketchOn('XY')\n |> circle(center = [0, 0], radius = 1.5)\n\nsweepSketch = startSketchOn('XY')\n |> circle(center = [0, 0], radius = 2)\n |> hole(pipeHole, %)\n |> sweep(path = sweepPath)\n |> rotate(axis = [0, 0, 1.0], angle = 90)" ] }, { @@ -275456,7 +278645,7 @@ "unpublished": false, "deprecated": false, "examples": [ - "// Scale a pipe.\n\n\n// Create a path for the sweep.\nsweepPath = startSketchOn('XZ')\n |> startProfileAt([0.05, 0.05], %)\n |> line(end = [0, 7])\n |> tangentialArc({ offset = 90, radius = 5 }, %)\n |> line(end = [-3, 0])\n |> tangentialArc({ offset = -90, radius = 5 }, %)\n |> line(end = [0, 7])\n\n// Create a hole for the pipe.\npipeHole = startSketchOn('XY')\n |> circle({ center = [0, 0], radius = 1.5 }, %)\n\nsweepSketch = startSketchOn('XY')\n |> circle({ center = [0, 0], radius = 2 }, %)\n |> hole(pipeHole, %)\n |> sweep(path = sweepPath)\n |> scale(scale = [1.0, 1.0, 2.5])" + "// Scale a pipe.\n\n\n// Create a path for the sweep.\nsweepPath = startSketchOn('XZ')\n |> startProfileAt([0.05, 0.05], %)\n |> line(end = [0, 7])\n |> tangentialArc({ offset = 90, radius = 5 }, %)\n |> line(end = [-3, 0])\n |> tangentialArc({ offset = -90, radius = 5 }, %)\n |> line(end = [0, 7])\n\n// Create a hole for the pipe.\npipeHole = startSketchOn('XY')\n |> circle(center = [0, 0], radius = 1.5)\n\nsweepSketch = startSketchOn('XY')\n |> circle(center = [0, 0], radius = 2)\n |> hole(pipeHole, %)\n |> sweep(path = sweepPath)\n |> scale(scale = [1.0, 1.0, 2.5])" ] }, { @@ -277707,7 +280896,7 @@ "unpublished": false, "deprecated": false, "examples": [ - "w = 15\ncube = startSketchOn('XY')\n |> startProfileAt([0, 0], %)\n |> line(end = [w, 0], tag = $line1)\n |> line(end = [0, w], tag = $line2)\n |> line(end = [-w, 0], tag = $line3)\n |> line(end = [0, -w], tag = $line4)\n |> close()\n |> extrude(length = 5)\n\nfn cylinder(radius, tag) {\n return startSketchOn('XY')\n |> startProfileAt([0, 0], %)\n |> circle({\n radius = radius,\n center = segEnd(tag)\n }, %)\n |> extrude(length = radius)\n}\n\ncylinder(1, line1)\ncylinder(2, line2)\ncylinder(3, line3)\ncylinder(4, line4)" + "w = 15\ncube = startSketchOn('XY')\n |> startProfileAt([0, 0], %)\n |> line(end = [w, 0], tag = $line1)\n |> line(end = [0, w], tag = $line2)\n |> line(end = [-w, 0], tag = $line3)\n |> line(end = [0, -w], tag = $line4)\n |> close()\n |> extrude(length = 5)\n\nfn cylinder(radius, tag) {\n return startSketchOn('XY')\n |> startProfileAt([0, 0], %)\n |> circle(radius = radius, center = segEnd(tag))\n |> extrude(length = radius)\n}\n\ncylinder(1, line1)\ncylinder(2, line2)\ncylinder(3, line3)\ncylinder(4, line4)" ] }, { @@ -282204,7 +285393,7 @@ "unpublished": false, "deprecated": false, "examples": [ - "w = 15\ncube = startSketchOn('XY')\n |> startProfileAt([0, 0], %)\n |> line(end = [w, 0], tag = $line1)\n |> line(end = [0, w], tag = $line2)\n |> line(end = [-w, 0], tag = $line3)\n |> line(end = [0, -w], tag = $line4)\n |> close()\n |> extrude(length = 5)\n\nfn cylinder(radius, tag) {\n return startSketchOn('XY')\n |> startProfileAt([0, 0], %)\n |> circle({\n radius = radius,\n center = segStart(tag)\n }, %)\n |> extrude(length = radius)\n}\n\ncylinder(1, line1)\ncylinder(2, line2)\ncylinder(3, line3)\ncylinder(4, line4)" + "w = 15\ncube = startSketchOn('XY')\n |> startProfileAt([0, 0], %)\n |> line(end = [w, 0], tag = $line1)\n |> line(end = [0, w], tag = $line2)\n |> line(end = [-w, 0], tag = $line3)\n |> line(end = [0, -w], tag = $line4)\n |> close()\n |> extrude(length = 5)\n\nfn cylinder(radius, tag) {\n return startSketchOn('XY')\n |> startProfileAt([0, 0], %)\n |> circle(radius = radius, center = segStart(tag))\n |> extrude(length = radius)\n}\n\ncylinder(1, line1)\ncylinder(2, line2)\ncylinder(3, line3)\ncylinder(4, line4)" ] }, { @@ -291145,9 +294334,9 @@ "// Remove the start face for the extrusion.\nfirstSketch = startSketchOn('-XZ')\n |> startProfileAt([-12, 12], %)\n |> line(end = [24, 0])\n |> line(end = [0, -24])\n |> line(end = [-24, 0])\n |> close()\n |> extrude(length = 6)\n\n// Remove the start face for the extrusion.\nshell(firstSketch, faces = ['start'], thickness = 0.25)", "// Remove a tagged face and the end face for the extrusion.\nfirstSketch = startSketchOn('XY')\n |> startProfileAt([-12, 12], %)\n |> line(end = [24, 0])\n |> line(end = [0, -24])\n |> line(end = [-24, 0], tag = $myTag)\n |> close()\n |> extrude(length = 6)\n\n// Remove a tagged face for the extrusion.\nshell(firstSketch, faces = [myTag], thickness = 0.25)", "// Remove multiple faces at once.\nfirstSketch = startSketchOn('XY')\n |> startProfileAt([-12, 12], %)\n |> line(end = [24, 0])\n |> line(end = [0, -24])\n |> line(end = [-24, 0], tag = $myTag)\n |> close()\n |> extrude(length = 6)\n\n// Remove a tagged face and the end face for the extrusion.\nshell(firstSketch, faces = [myTag, 'end'], thickness = 0.25)", - "// Shell a sketch on face.\nsize = 100\ncase = startSketchOn('-XZ')\n |> startProfileAt([-size, -size], %)\n |> line(end = [2 * size, 0])\n |> line(end = [0, 2 * size])\n |> tangentialArcTo([-size, size], %)\n |> close()\n |> extrude(length = 65)\n\nthing1 = startSketchOn(case, 'end')\n |> circle({\n center = [-size / 2, -size / 2],\n radius = 25\n }, %)\n |> extrude(length = 50)\n\nthing2 = startSketchOn(case, 'end')\n |> circle({\n center = [size / 2, -size / 2],\n radius = 25\n }, %)\n |> extrude(length = 50)\n\n// We put \"case\" in the shell function to shell the entire object.\nshell(case, faces = ['start'], thickness = 5)", - "// Shell a sketch on face object on the end face.\nsize = 100\ncase = startSketchOn('XY')\n |> startProfileAt([-size, -size], %)\n |> line(end = [2 * size, 0])\n |> line(end = [0, 2 * size])\n |> tangentialArcTo([-size, size], %)\n |> close()\n |> extrude(length = 65)\n\nthing1 = startSketchOn(case, 'end')\n |> circle({\n center = [-size / 2, -size / 2],\n radius = 25\n }, %)\n |> extrude(length = 50)\n\nthing2 = startSketchOn(case, 'end')\n |> circle({\n center = [size / 2, -size / 2],\n radius = 25\n }, %)\n |> extrude(length = 50)\n\n// We put \"thing1\" in the shell function to shell the end face of the object.\nshell(thing1, faces = ['end'], thickness = 5)", - "// Shell sketched on face objects on the end face, include all sketches to shell\n// the entire object.\n\n\nsize = 100\ncase = startSketchOn('XY')\n |> startProfileAt([-size, -size], %)\n |> line(end = [2 * size, 0])\n |> line(end = [0, 2 * size])\n |> tangentialArcTo([-size, size], %)\n |> close()\n |> extrude(length = 65)\n\nthing1 = startSketchOn(case, 'end')\n |> circle({\n center = [-size / 2, -size / 2],\n radius = 25\n }, %)\n |> extrude(length = 50)\n\nthing2 = startSketchOn(case, 'end')\n |> circle({\n center = [size / 2, -size / 2],\n radius = 25\n }, %)\n |> extrude(length = 50)\n\n// We put \"thing1\" and \"thing2\" in the shell function to shell the end face of the object.\nshell([thing1, thing2], faces = ['end'], thickness = 5)" + "// Shell a sketch on face.\nsize = 100\ncase = startSketchOn('-XZ')\n |> startProfileAt([-size, -size], %)\n |> line(end = [2 * size, 0])\n |> line(end = [0, 2 * size])\n |> tangentialArcTo([-size, size], %)\n |> close()\n |> extrude(length = 65)\n\nthing1 = startSketchOn(case, 'end')\n |> circle(center = [-size / 2, -size / 2], radius = 25)\n |> extrude(length = 50)\n\nthing2 = startSketchOn(case, 'end')\n |> circle(center = [size / 2, -size / 2], radius = 25)\n |> extrude(length = 50)\n\n// We put \"case\" in the shell function to shell the entire object.\nshell(case, faces = ['start'], thickness = 5)", + "// Shell a sketch on face object on the end face.\nsize = 100\ncase = startSketchOn('XY')\n |> startProfileAt([-size, -size], %)\n |> line(end = [2 * size, 0])\n |> line(end = [0, 2 * size])\n |> tangentialArcTo([-size, size], %)\n |> close()\n |> extrude(length = 65)\n\nthing1 = startSketchOn(case, 'end')\n |> circle(center = [-size / 2, -size / 2], radius = 25)\n |> extrude(length = 50)\n\nthing2 = startSketchOn(case, 'end')\n |> circle(center = [size / 2, -size / 2], radius = 25)\n |> extrude(length = 50)\n\n// We put \"thing1\" in the shell function to shell the end face of the object.\nshell(thing1, faces = ['end'], thickness = 5)", + "// Shell sketched on face objects on the end face, include all sketches to shell\n// the entire object.\n\n\nsize = 100\ncase = startSketchOn('XY')\n |> startProfileAt([-size, -size], %)\n |> line(end = [2 * size, 0])\n |> line(end = [0, 2 * size])\n |> tangentialArcTo([-size, size], %)\n |> close()\n |> extrude(length = 65)\n\nthing1 = startSketchOn(case, 'end')\n |> circle(center = [-size / 2, -size / 2], radius = 25)\n |> extrude(length = 50)\n\nthing2 = startSketchOn(case, 'end')\n |> circle(center = [size / 2, -size / 2], radius = 25)\n |> extrude(length = 50)\n\n// We put \"thing1\" and \"thing2\" in the shell function to shell the end face of the object.\nshell([thing1, thing2], faces = ['end'], thickness = 5)" ] }, { @@ -311741,8 +314930,8 @@ "unpublished": false, "deprecated": false, "examples": [ - "// Create a pipe using a sweep.\n\n\n// Create a path for the sweep.\nsweepPath = startSketchOn('XZ')\n |> startProfileAt([0.05, 0.05], %)\n |> line(end = [0, 7])\n |> tangentialArc({ offset = 90, radius = 5 }, %)\n |> line(end = [-3, 0])\n |> tangentialArc({ offset = -90, radius = 5 }, %)\n |> line(end = [0, 7])\n\n// Create a hole for the pipe.\npipeHole = startSketchOn('XY')\n |> circle({ center = [0, 0], radius = 1.5 }, %)\n\nsweepSketch = startSketchOn('XY')\n |> circle({ center = [0, 0], radius = 2 }, %)\n |> hole(pipeHole, %)\n |> sweep(path = sweepPath)", - "// Create a spring by sweeping around a helix path.\n\n\n// Create a helix around the Z axis.\nhelixPath = helix(\n angleStart = 0,\n ccw = true,\n revolutions = 4,\n length = 10,\n radius = 5,\n axis = 'Z',\n)\n\n// Create a spring by sweeping around the helix path.\nspringSketch = startSketchOn('YZ')\n |> circle({ center = [0, 0], radius = 1 }, %)\n |> sweep(path = helixPath)" + "// Create a pipe using a sweep.\n\n\n// Create a path for the sweep.\nsweepPath = startSketchOn('XZ')\n |> startProfileAt([0.05, 0.05], %)\n |> line(end = [0, 7])\n |> tangentialArc({ offset = 90, radius = 5 }, %)\n |> line(end = [-3, 0])\n |> tangentialArc({ offset = -90, radius = 5 }, %)\n |> line(end = [0, 7])\n\n// Create a hole for the pipe.\npipeHole = startSketchOn('XY')\n |> circle(center = [0, 0], radius = 1.5)\n\nsweepSketch = startSketchOn('XY')\n |> circle(center = [0, 0], radius = 2)\n |> hole(pipeHole, %)\n |> sweep(path = sweepPath)", + "// Create a spring by sweeping around a helix path.\n\n\n// Create a helix around the Z axis.\nhelixPath = helix(\n angleStart = 0,\n ccw = true,\n revolutions = 4,\n length = 10,\n radius = 5,\n axis = 'Z',\n)\n\n// Create a spring by sweeping around the helix path.\nspringSketch = startSketchOn('YZ')\n |> circle(center = [0, 0], radius = 1)\n |> sweep(path = helixPath)" ] }, { @@ -312869,7 +316058,7 @@ "// Vertical pill. Use absolute coordinate for arc.\npillSketch = startSketchOn('XZ')\n |> startProfileAt([0, 0], %)\n |> line(end = [0, 20])\n |> tangentialArcTo([10, 20], %, $arc1)\n |> angledLine({\n angle = tangentToEnd(arc1),\n length = 20\n }, %)\n |> tangentialArcToRelative([-10, 0], %)\n |> close()\n\npillExtrude = extrude(pillSketch, length = 10)", "rectangleSketch = startSketchOn('XZ')\n |> startProfileAt([0, 0], %)\n |> line(end = [10, 0], tag = $seg1)\n |> angledLine({\n angle = tangentToEnd(seg1),\n length = 10\n }, %)\n |> line(end = [0, 10])\n |> line(end = [-20, 0])\n |> close()\n\nrectangleExtrude = extrude(rectangleSketch, length = 10)", "bottom = startSketchOn(\"XY\")\n |> startProfileAt([0, 0], %)\n |> arcTo({ end = [10, 10], interior = [5, 1] }, %, $arc1)\n |> angledLine([tangentToEnd(arc1), 20], %)\n |> close()", - "circSketch = startSketchOn(\"XY\")\n |> circle({ center = [0, 0], radius = 3 }, %, $circ)\n\ntriangleSketch = startSketchOn(\"XY\")\n |> startProfileAt([-5, 0], %)\n |> angledLine([tangentToEnd(circ), 10], %)\n |> line(end = [-15, 0])\n |> close()" + "circSketch = startSketchOn(\"XY\")\n |> circle(center = [0, 0], radius = 3, tag = $circ)\n\ntriangleSketch = startSketchOn(\"XY\")\n |> startProfileAt([-5, 0], %)\n |> angledLine([tangentToEnd(circ), 10], %)\n |> line(end = [-15, 0])\n |> close()" ] }, { @@ -334573,7 +337762,7 @@ "unpublished": false, "deprecated": false, "examples": [ - "// Move a pipe.\n\n\n// Create a path for the sweep.\nsweepPath = startSketchOn('XZ')\n |> startProfileAt([0.05, 0.05], %)\n |> line(end = [0, 7])\n |> tangentialArc({ offset = 90, radius = 5 }, %)\n |> line(end = [-3, 0])\n |> tangentialArc({ offset = -90, radius = 5 }, %)\n |> line(end = [0, 7])\n\n// Create a hole for the pipe.\npipeHole = startSketchOn('XY')\n |> circle({ center = [0, 0], radius = 1.5 }, %)\n\nsweepSketch = startSketchOn('XY')\n |> circle({ center = [0, 0], radius = 2 }, %)\n |> hole(pipeHole, %)\n |> sweep(path = sweepPath)\n |> translate(translate = [1.0, 1.0, 2.5])" + "// Move a pipe.\n\n\n// Create a path for the sweep.\nsweepPath = startSketchOn('XZ')\n |> startProfileAt([0.05, 0.05], %)\n |> line(end = [0, 7])\n |> tangentialArc({ offset = 90, radius = 5 }, %)\n |> line(end = [-3, 0])\n |> tangentialArc({ offset = -90, radius = 5 }, %)\n |> line(end = [0, 7])\n\n// Create a hole for the pipe.\npipeHole = startSketchOn('XY')\n |> circle(center = [0, 0], radius = 1.5)\n\nsweepSketch = startSketchOn('XY')\n |> circle(center = [0, 0], radius = 2)\n |> hole(pipeHole, %)\n |> sweep(path = sweepPath)\n |> translate(translate = [1.0, 1.0, 2.5])" ] }, { diff --git a/docs/kcl/sweep.md b/docs/kcl/sweep.md index 8c3a0a7c67..9657613af9 100644 --- a/docs/kcl/sweep.md +++ b/docs/kcl/sweep.md @@ -49,10 +49,10 @@ sweepPath = startSketchOn('XZ') // Create a hole for the pipe. pipeHole = startSketchOn('XY') - |> circle({ center = [0, 0], radius = 1.5 }, %) + |> circle(center = [0, 0], radius = 1.5) sweepSketch = startSketchOn('XY') - |> circle({ center = [0, 0], radius = 2 }, %) + |> circle(center = [0, 0], radius = 2) |> hole(pipeHole, %) |> sweep(path = sweepPath) ``` @@ -75,7 +75,7 @@ helixPath = helix( // Create a spring by sweeping around the helix path. springSketch = startSketchOn('YZ') - |> circle({ center = [0, 0], radius = 1 }, %) + |> circle(center = [0, 0], radius = 1) |> sweep(path = helixPath) ``` diff --git a/docs/kcl/tangentToEnd.md b/docs/kcl/tangentToEnd.md index f32c8944eb..cc3f9adc23 100644 --- a/docs/kcl/tangentToEnd.md +++ b/docs/kcl/tangentToEnd.md @@ -91,7 +91,7 @@ bottom = startSketchOn("XY") ```js circSketch = startSketchOn("XY") - |> circle({ center = [0, 0], radius = 3 }, %, $circ) + |> circle(center = [0, 0], radius = 3, tag = $circ) triangleSketch = startSketchOn("XY") |> startProfileAt([-5, 0], %) diff --git a/docs/kcl/translate.md b/docs/kcl/translate.md index ddccec6f6e..9f0d05a9d9 100644 --- a/docs/kcl/translate.md +++ b/docs/kcl/translate.md @@ -47,10 +47,10 @@ sweepPath = startSketchOn('XZ') // Create a hole for the pipe. pipeHole = startSketchOn('XY') - |> circle({ center = [0, 0], radius = 1.5 }, %) + |> circle(center = [0, 0], radius = 1.5) sweepSketch = startSketchOn('XY') - |> circle({ center = [0, 0], radius = 2 }, %) + |> circle(center = [0, 0], radius = 2) |> hole(pipeHole, %) |> sweep(path = sweepPath) |> translate(translate = [1.0, 1.0, 2.5]) diff --git a/e2e/playwright/editor-tests.spec.ts b/e2e/playwright/editor-tests.spec.ts index 351a2218bf..1eab130d2c 100644 --- a/e2e/playwright/editor-tests.spec.ts +++ b/e2e/playwright/editor-tests.spec.ts @@ -689,7 +689,7 @@ test.describe('Editor tests', { tag: ['@skipWin'] }, () => { await page.keyboard.press('ArrowDown') await page.keyboard.press('Enter') await page.keyboard.type(`extrusion = startSketchOn('XY') - |> circle({ center: [0, 0], radius: dia/2 }, %) + |> circle(center: [0, 0], radius: dia/2) |> hole(squareHole(length, width, height), %) |> extrude(length = height)`) diff --git a/e2e/playwright/feature-tree-pane.spec.ts b/e2e/playwright/feature-tree-pane.spec.ts index 9efdb4c844..27ee73cf57 100644 --- a/e2e/playwright/feature-tree-pane.spec.ts +++ b/e2e/playwright/feature-tree-pane.spec.ts @@ -50,13 +50,13 @@ const FEATURE_TREE_SKETCH_CODE = `sketch001 = startSketchOn('XZ') |> close(%) extrude001 = extrude(sketch001, length = 10) sketch002 = startSketchOn(extrude001, rectangleSegmentB001) - |> circle({ + |> circle( center = [-1, 2], radius = .5 - }, %) + ) plane001 = offsetPlane('XZ', offset = -5) sketch003 = startSketchOn(plane001) - |> circle({ center = [0, 0], radius = 5 }, %) + |> circle(center = [0, 0], radius = 5) ` test.describe('Feature Tree pane', () => { @@ -234,11 +234,11 @@ test.describe('Feature Tree pane', () => { }) => { const initialInput = '23' const initialCode = `sketch001 = startSketchOn('XZ') - |> circle({ center = [0, 0], radius = 5 }, %) + |> circle(center = [0, 0], radius = 5) renamedExtrude = extrude(sketch001, length = ${initialInput})` const newConstantName = 'distance001' const expectedCode = `sketch001 = startSketchOn('XZ') - |> circle({ center = [0, 0], radius = 5 }, %) + |> circle(center = [0, 0], radius = 5) ${newConstantName} = 23 renamedExtrude = extrude(sketch001, length = ${newConstantName})` diff --git a/e2e/playwright/point-click.spec.ts b/e2e/playwright/point-click.spec.ts index 4fe637ad54..6832482fb4 100644 --- a/e2e/playwright/point-click.spec.ts +++ b/e2e/playwright/point-click.spec.ts @@ -42,27 +42,25 @@ test.describe('Point-and-click tests', () => { await test.step('check code model connection works and that button is still enable once circle is selected ', async () => { await moveToCircle() - const circleSnippet = - 'circle({ center = [318.33, 168.1], radius = 182.8 }, %)' + const circleSnippet = 'circle(center = [318.33, 168.1], radius = 182.8)' await editor.expectState({ - activeLines: ["constsketch002=startSketchOn('XZ')"], + activeLines: ["sketch002=startSketchOn('XZ')"], highlightedCode: circleSnippet, diagnostics: [], }) await test.step('check code model connection works and that button is still enable once circle is selected ', async () => { await moveToCircle() - const circleSnippet = - 'circle({ center = [318.33, 168.1], radius = 182.8 }, %)' + const circleSnippet = 'circle(center = [318.33, 168.1], radius = 182.8)' await editor.expectState({ - activeLines: ["constsketch002=startSketchOn('XZ')"], + activeLines: ["sketch002=startSketchOn('XZ')"], highlightedCode: circleSnippet, diagnostics: [], }) await clickCircle() await editor.expectState({ - activeLines: [circleSnippet.slice(-5)], + activeLines: ['|>' + circleSnippet], highlightedCode: circleSnippet, diagnostics: [], }) @@ -581,7 +579,7 @@ profile001 = startProfileAt([205.96, 254.59], sketch002) const u = await getUtils(page) const initialCode = `closedSketch = startSketchOn('XZ') - |> circle({ center = [8, 5], radius = 2 }, %) + |> circle(center = [8, 5], radius = 2) openSketch = startSketchOn('XY') |> startProfileAt([-5, 0], %) |> line(endAbsolute = [0, 5]) @@ -633,8 +631,8 @@ openSketch = startSketchOn('XY') await expect(toolbar.startSketchBtn).not.toBeVisible() await expect(toolbar.exitSketchBtn).toBeVisible() await editor.expectState({ - activeLines: [`|>circle({center=[8,5],radius=2},%)`], - highlightedCode: 'circle({center=[8,5],radius=2},%)', + activeLines: [`|>circle(center=[8,5],radius=2)`], + highlightedCode: 'circle(center=[8,5],radius=2)', diagnostics: [], }) }) @@ -1192,10 +1190,10 @@ openSketch = startSketchOn('XY') cmdBar, }) => { const initialCode = `sketch001 = startSketchOn('XZ') - |> circle({ center = [0, 0], radius = 30 }, %) + |> circle(center = [0, 0], radius = 30) plane001 = offsetPlane('XZ', offset = 50) sketch002 = startSketchOn(plane001) - |> circle({ center = [0, 0], radius = 20 }, %) + |> circle(center = [0, 0], radius = 20) ` await context.addInitScript((initialCode) => { localStorage.setItem('persistCode', initialCode) @@ -1278,10 +1276,10 @@ openSketch = startSketchOn('XY') scene, }) => { const initialCode = `sketch001 = startSketchOn('XZ') - |> circle({ center = [0, 0], radius = 30 }, %) + |> circle(center = [0, 0], radius = 30) plane001 = offsetPlane('XZ', offset = 50) sketch002 = startSketchOn(plane001) - |> circle({ center = [0, 0], radius = 20 }, %) + |> circle(center = [0, 0], radius = 20) loft001 = loft([sketch001, sketch002]) ` await context.addInitScript((initialCode) => { @@ -1304,7 +1302,7 @@ loft001 = loft([sketch001, sketch002]) await scene.expectPixelColor([89, 89, 89], testPoint, 15) await clickOnSketch1() await expect(page.locator('.cm-activeLine')).toHaveText(` - |> circle({ center = [0, 0], radius = 30 }, %) + |> circle(center = [0, 0], radius = 30) `) await page.keyboard.press('Delete') // Check for sketch 1 @@ -1315,7 +1313,7 @@ loft001 = loft([sketch001, sketch002]) await page.waitForTimeout(1000) await clickOnSketch2() await expect(page.locator('.cm-activeLine')).toHaveText(` - |> circle({ center = [0, 0], radius = 20 }, %) + |> circle(center = [0, 0], radius = 20) `) await page.keyboard.press('Delete') // Check for plane001 @@ -1344,10 +1342,10 @@ loft001 = loft([sketch001, sketch002]) cmdBar, }) => { const initialCode = `sketch001 = startSketchOn('YZ') - |> circle({ + |> circle( center = [0, 0], radius = 500 - }, %) + ) sketch002 = startSketchOn('XZ') |> startProfileAt([0, 0], %) |> xLine(-500, %) @@ -1438,10 +1436,10 @@ sketch002 = startSketchOn('XZ') cmdBar, }) => { const initialCode = `sketch001 = startSketchOn('YZ') - |> circle({ + |> circle( center = [0, 0], radius = 500 - }, %) + ) sketch002 = startSketchOn('XZ') |> startProfileAt([0, 0], %) |> xLine(-500, %) @@ -2270,7 +2268,7 @@ chamfer04 = chamfer(extrude001, length = 5, tags = [getOppositeEdge(seg02)]) cmdBar, }) => { const initialCode = `sketch001 = startSketchOn('XZ') - |> circle({ center = [0, 0], radius = 30 }, %) + |> circle(center = [0, 0], radius = 30) extrude001 = extrude(sketch001, length = 30) ` await context.addInitScript((initialCode) => { @@ -2445,19 +2443,19 @@ extrude001 = extrude(sketch001, length = 40) const shellSketchOnFacesCases = [ `sketch001 = startSketchOn('XZ') - |> circle({ center = [0, 0], radius = 100 }, %) + |> circle(center = [0, 0], radius = 100) |> extrude(length = 100) sketch002 = startSketchOn(sketch001, 'END') - |> circle({ center = [0, 0], radius = 50 }, %) + |> circle(center = [0, 0], radius = 50) |> extrude(length = 50) `, `sketch001 = startSketchOn('XZ') - |> circle({ center = [0, 0], radius = 100 }, %) + |> circle(center = [0, 0], radius = 100) extrude001 = extrude(sketch001, length = 100) sketch002 = startSketchOn(extrude001, 'END') - |> circle({ center = [0, 0], radius = 50 }, %) + |> circle(center = [0, 0], radius = 50) extrude002 = extrude(sketch002, length = 50) `, ] @@ -2631,10 +2629,10 @@ profile001 = startProfileAt([-20, 20], sketch001) cmdBar, }) => { const initialCode = `sketch001 = startSketchOn('YZ') - |> circle({ + |> circle( center = [0, 0], radius = 500 - }, %) + ) sketch002 = startSketchOn('XZ') |> startProfileAt([0, 0], %) |> xLine(-2000, %) @@ -2761,10 +2759,10 @@ segAng(rectangleSegmentA001), |> close() extrude001 = extrude(sketch001, length = 50) sketch002 = startSketchOn(extrude001, rectangleSegmentA001) -|> circle({ +|> circle( center = [-11.34, 10.0], radius = 8.69 -}, %) +) ` await context.addInitScript((initialCode) => { localStorage.setItem('persistCode', initialCode) @@ -2811,10 +2809,10 @@ radius = 8.69 |> close() extrude001 = extrude(sketch001, length = 5) sketch003 = startSketchOn(extrude001, 'START') - |> circle({ + |> circle( center = [-0.69, 0.56], radius = 0.28 - }, %) + ) ` await context.addInitScript((initialCode) => { @@ -2849,10 +2847,11 @@ radius = 8.69 cmdBar, }) => { const initialCode = `sketch001 = startSketchOn('XZ') -profile001 = circle({ +profile001 = circle( + sketch001, center = [0, 0], radius = 100 -}, sketch001) +) extrude001 = extrude(profile001, length = 100) ` await context.addInitScript((initialCode) => { diff --git a/e2e/playwright/sketch-tests.spec.ts b/e2e/playwright/sketch-tests.spec.ts index 49639080a6..99da1f69a4 100644 --- a/e2e/playwright/sketch-tests.spec.ts +++ b/e2e/playwright/sketch-tests.spec.ts @@ -367,7 +367,7 @@ sketch001 = startProfileAt([12.34, -12.34], sketch002) localStorage.setItem( 'persistCode', `sketch001 = startSketchOn('XZ') - |> circle({ center = [4.61, -5.01], radius = 8 }, %)` + |> circle(center = [4.61, -5.01], radius = 8 )` ) }) @@ -403,9 +403,7 @@ sketch001 = startProfileAt([12.34, -12.34], sketch002) const dragPX = 40 - await page - .getByText('circle({ center = [4.61, -5.01], radius = 8 }, %)') - .click() + await page.getByText('circle(center = [4.61, -5.01], radius = 8)').click() await expect( page.getByRole('button', { name: 'Edit Sketch' }) ).toBeVisible() @@ -444,7 +442,7 @@ sketch001 = startProfileAt([12.34, -12.34], sketch002) // expect the code to have changed await editor.expectEditor.toContain( `sketch001 = startSketchOn('XZ') - |> circle({ center = [7.26, -2.37], radius = 11.44 }, %)`, + |> circle(center = [7.26, -2.37], radius = 11.44)`, { shouldNormalise: true } ) }) @@ -1390,12 +1388,12 @@ profile002 = startProfileAt([117.2, 56.08], sketch001) await toolbar.circleBtn.click() await page.waitForTimeout(100) await circlePoint1() - await editor.expectEditor.toContain('profile003 = circle({ center = [') + await editor.expectEditor.toContain('profile003 = circle(center = [') }) await test.step('equip line tool and verify circle code is removed', async () => { await toolbar.lineBtn.click() - await editor.expectEditor.not.toContain('profile003 = circle({') + await editor.expectEditor.not.toContain('profile003 = circle(') }) const [circle3Point1] = scene.makeMouseHelpers(650, 200) @@ -1649,7 +1647,7 @@ profile003 = startProfileAt([206.63, -56.73], sketch001) await circle1Radius({ delay: 500 }) await page.waitForTimeout(300) await editor.expectEditor.toContain( - `profile003 = circle({ center = [23.19, 6.98], radius = 2.5 }, sketch001)` + `profile003 = circle(sketch001, center = [23.19, 6.98], radius = 2.5)` ) await test.step('hover in empty space to wait for overlays to get out of the way', async () => { @@ -1661,7 +1659,7 @@ profile003 = startProfileAt([206.63, -56.73], sketch001) await page.waitForTimeout(300) await circle2Radius() await editor.expectEditor.toContain( - `profile004 = circle({ center = [23.74, 1.9], radius = 0.72 }, sketch001)` + `profile004 = circle(sketch001, center = [23.74, 1.9], radius = 0.72)` ) }) await test.step('create two corner rectangles in a row without unequip', async () => { @@ -1855,7 +1853,7 @@ profile002 = startProfileAt([11.19, 5.02], sketch001) ], %) |> line(endAbsolute = [profileStartX(%), profileStartY(%)]) |> close() -profile003 = circle({ center = [6.92, -4.2], radius = 3.16 }, sketch001) +profile003 = circle(sketch001, center = [6.92, -4.2], radius = 3.16) profile004 = circleThreePoint(sketch001, p1 = [13.44, -6.8], p2 = [13.39, -2.07], p3 = [18.75, -4.41]) ` ) @@ -1931,7 +1929,7 @@ profile004 = circleThreePoint(sketch001, p1 = [13.44, -6.8], p2 = [13.39, -2.07] await dragCircleTo() await page.mouse.up() await editor.expectEditor.toContain( - `profile003 = circle({ center = [6.92, -4.2], radius = 4.81 }, sketch001)` + `profile003 = circle(sketch001, center = [6.92, -4.2], radius = 4.81)` ) }) @@ -2000,7 +1998,7 @@ profile002 = startProfileAt([11.19, 5.02], sketch001) ], %) |> line(endAbsolute = [profileStartX(%), profileStartY(%)]) |> close() -profile003 = circle({ center = [6.92, -4.2], radius = 3.16 }, sketch001) +profile003 = circle(sketch001, center = [6.92, -4.2], radius = 3.16) ` ) }) @@ -2108,10 +2106,11 @@ profile003 = startProfileAt([16.79, 38.24], sketch001) ], %) |> line(endAbsolute = [profileStartX(%), profileStartY(%)]) |> close() -profile004 = circle({ +profile004 = circle( + sketch001, center = [280.45, 47.57], radius = 55.26 -}, sketch001) +) extrude002 = extrude(profile001, length = 50) extrude001 = extrude(profile003, length = 5) ` @@ -2173,10 +2172,11 @@ extrude001 = extrude(profile003, length = 5) 'myVar = 5', `myVar = 5 sketch001 = startSketchOn('XZ') - profile001 = circle({ + profile001 = circle( + sketch001, center = [12.41, 3.87], radius = myVar - }, sketch001)` + )` ) await scene.expectPixelColor([255, 255, 255], { x: 633, y: 211 }, 15) @@ -2320,7 +2320,7 @@ profile004 = startProfileAt([3.15, 9.39], sketch002) |> line(end = [-7.41, -2.85]) |> line(endAbsolute = [profileStartX(%), profileStartY(%)]) |> close() -profile005 = circle({ center = [5.15, 4.34], radius = 1.66 }, sketch002) +profile005 = circle(sketch002, center = [5.15, 4.34], radius = 1.66) profile006 = startProfileAt([9.65, 3.82], sketch002) |> line(end = [2.38, 5.62]) |> line(end = [2.13, -5.57]) @@ -2345,10 +2345,11 @@ profile009 = startProfileAt([5.23, 1.95], sketch003) |> line(end = [7.34, -2.75]) |> line(endAbsolute = [profileStartX(%), profileStartY(%)]) |> close() -profile010 = circle({ +profile010 = circle( + sketch003, center = [7.18, -2.11], radius = 2.67 -}, sketch003) +) profile011 = startProfileAt([5.07, -6.39], sketch003) |> angledLine([0, 4.54], %, $rectangleSegmentA002) |> angledLine([ diff --git a/e2e/playwright/snapshot-tests.spec.ts b/e2e/playwright/snapshot-tests.spec.ts index aed88c3963..afcaff9de5 100644 --- a/e2e/playwright/snapshot-tests.spec.ts +++ b/e2e/playwright/snapshot-tests.spec.ts @@ -599,7 +599,7 @@ test( mask: [page.getByTestId('model-state-indicator')], }) await expect(page.locator('.cm-content')).toHaveText( - `sketch001 = startSketchOn('XZ')profile001 = circle({ center = [14.44, -2.44], radius = 1 }, sketch001)` + `sketch001 = startSketchOn('XZ')profile001 = circle(sketch001, center = [14.44, -2.44], radius = 1)` ) } ) diff --git a/e2e/playwright/snapshot-tests.spec.ts-snapshots/Draft-circle-should-look-right-1-Google-Chrome-linux.png b/e2e/playwright/snapshot-tests.spec.ts-snapshots/Draft-circle-should-look-right-1-Google-Chrome-linux.png index dbe9a64f71..db0d55a704 100644 Binary files a/e2e/playwright/snapshot-tests.spec.ts-snapshots/Draft-circle-should-look-right-1-Google-Chrome-linux.png and b/e2e/playwright/snapshot-tests.spec.ts-snapshots/Draft-circle-should-look-right-1-Google-Chrome-linux.png differ diff --git a/e2e/playwright/testing-gizmo.spec.ts b/e2e/playwright/testing-gizmo.spec.ts index 49f06a84b9..6db8405d58 100644 --- a/e2e/playwright/testing-gizmo.spec.ts +++ b/e2e/playwright/testing-gizmo.spec.ts @@ -269,10 +269,10 @@ test.describe(`Testing gizmo, fixture-based`, () => { ], %) |> close() const sketch001 = startSketchOn('XZ') - |> circle({ + |> circle( center: [818.33, 168.1], radius: 182.8 - }, %) + ) |> extrude(length = 50) ` ) @@ -295,8 +295,7 @@ test.describe(`Testing gizmo, fixture-based`, () => { const [clickCircle, moveToCircle] = scene.makeMouseHelpers(582, 217) await test.step(`Select an edge of this circle`, async () => { - const circleSnippet = - 'circle({ center: [818.33, 168.1], radius: 182.8 }, %)' + const circleSnippet = 'circle(center: [818.33, 168.1], radius: 182.8)' await moveToCircle() await clickCircle() await editor.expectState({ diff --git a/e2e/playwright/testing-segment-overlays.spec.ts b/e2e/playwright/testing-segment-overlays.spec.ts index 1662e801dc..7cc5e05f5b 100644 --- a/e2e/playwright/testing-segment-overlays.spec.ts +++ b/e2e/playwright/testing-segment-overlays.spec.ts @@ -825,7 +825,7 @@ test.describe('Testing segment overlays', { tag: ['@skipWin'] }, () => { localStorage.setItem( 'persistCode', `part001 = startSketchOn('XZ') - |> circle({ center = [1 + 0, 0], radius = 8 }, %) + |> circle(center = [1 + 0, 0], radius = 8) ` ) localStorage.setItem('disableAxis', 'true') @@ -840,9 +840,7 @@ test.describe('Testing segment overlays', { tag: ['@skipWin'] }, () => { await u.expectCmdLog('[data-message-type="execution-done"]') await u.closeDebugPanel() - await page - .getByText('circle({ center = [1 + 0, 0], radius = 8 }, %)') - .click() + await page.getByText('circle(center = [1 + 0, 0], radius = 8)').click() await page.waitForTimeout(100) await page.getByRole('button', { name: 'Edit Sketch' }).click() await page.waitForTimeout(500) @@ -859,11 +857,9 @@ test.describe('Testing segment overlays', { tag: ['@skipWin'] }, () => { await clickConstrained({ hoverPos, constraintType: 'xAbsolute', - expectBeforeUnconstrained: - 'circle({ center = [1 + 0, 0], radius = 8 }, %)', - expectAfterUnconstrained: - 'circle({ center = [1, 0], radius = 8 }, %)', - expectFinal: 'circle({ center = [xAbs001, 0], radius = 8 }, %)', + expectBeforeUnconstrained: 'circle(center = [1 + 0, 0], radius = 8)', + expectAfterUnconstrained: 'circle(center = [1, 0], radius = 8)', + expectFinal: 'circle(center = [xAbs001, 0], radius = 8)', ang: ang + 105, steps: 6, locator: '[data-overlay-toolbar-index="0"]', @@ -873,10 +869,10 @@ test.describe('Testing segment overlays', { tag: ['@skipWin'] }, () => { hoverPos, constraintType: 'yAbsolute', expectBeforeUnconstrained: - 'circle({ center = [xAbs001, 0], radius = 8 }, %)', + 'circle(center = [xAbs001, 0], radius = 8)', expectAfterUnconstrained: - 'circle({ center = [xAbs001, yAbs001], radius = 8 }, %)', - expectFinal: 'circle({ center = [xAbs001, 0], radius = 8 }, %)', + 'circle(center = [xAbs001, yAbs001], radius = 8)', + expectFinal: 'circle(center = [xAbs001, 0], radius = 8)', ang: ang + 180, steps: 30, locator: '[data-overlay-toolbar-index="0"]', @@ -886,10 +882,10 @@ test.describe('Testing segment overlays', { tag: ['@skipWin'] }, () => { hoverPos, constraintType: 'radius', expectBeforeUnconstrained: - 'circle({ center = [xAbs001, 0], radius = 8 }, %)', + 'circle(center = [xAbs001, 0], radius = 8)', expectAfterUnconstrained: - 'circle({ center = [xAbs001, 0], radius = radius001 }, %)', - expectFinal: 'circle({ center = [xAbs001, 0], radius = 8 }, %)', + 'circle(center = [xAbs001, 0], radius = radius001)', + expectFinal: 'circle(center = [xAbs001, 0], radius = 8)', ang: ang + 105, steps: 10, locator: '[data-overlay-toolbar-index="0"]', diff --git a/e2e/playwright/testing-selections.spec.ts b/e2e/playwright/testing-selections.spec.ts index fe68c264e5..4e69c23ace 100644 --- a/e2e/playwright/testing-selections.spec.ts +++ b/e2e/playwright/testing-selections.spec.ts @@ -320,10 +320,11 @@ part009 = startSketchOn('XY') |> close() rev = revolve({ axis = 'y' }, part009) sketch006 = startSketchOn('XY') -profile001 = circle({ +profile001 = circle( + sketch006, center = [42.91, -70.42], radius = 17.96 -}, sketch006) +) profile002 = startProfileAt([86.92, -63.81], sketch006) |> angledLine([0, 63.81], %, $rectangleSegmentA001) |> angledLine([ diff --git a/package.json b/package.json index bd16916c66..f0b338d172 100644 --- a/package.json +++ b/package.json @@ -91,7 +91,7 @@ "fmt-check": "prettier --check ./src *.ts *.json *.js ./e2e ./packages", "fetch:wasm": "./scripts/get-latest-wasm-bundle.sh", "fetch:wasm:windows": "./scripts/get-latest-wasm-bundle.ps1", - "fetch:samples": "echo \"Fetching latest KCL samples...\" && curl -o public/kcl-samples-manifest-fallback.json https://raw.githubusercontent.com/KittyCAD/kcl-samples/next/manifest.json", + "fetch:samples": "echo \"Fetching latest KCL samples...\" && curl -o public/kcl-samples-manifest-fallback.json https://raw.githubusercontent.com/KittyCAD/kcl-samples/circle-kw-args/manifest.json", "build:wasm-dev": "yarn wasm-prep && (cd src/wasm-lib && wasm-pack build --dev --target web --out-dir pkg && cargo test -p kcl-lib export_bindings) && yarn isomorphic-copy-wasm && yarn fmt", "build:wasm:nocopy": "yarn wasm-prep && cd src/wasm-lib && wasm-pack build --release --target web --out-dir pkg && cargo test -p kcl-lib export_bindings", "build:wasm": "yarn build:wasm:nocopy && cp src/wasm-lib/pkg/wasm_lib_bg.wasm public && yarn fmt", diff --git a/src/clientSideScene/sceneEntities.ts b/src/clientSideScene/sceneEntities.ts index 94bd0b966e..d60d9cbb82 100644 --- a/src/clientSideScene/sceneEntities.ts +++ b/src/clientSideScene/sceneEntities.ts @@ -1606,15 +1606,15 @@ export class SceneEntities { const varName = findUniqueName(_ast, 'profile') const newExpression = createVariableDeclaration( varName, - createCallExpressionStdLib('circle', [ - createObjectExpression({ - center: createArrayExpression([ + createCallExpressionStdLibKw('circle', varDec.node.id, [ + createLabeledArg( + 'center', + createArrayExpression([ createLiteral(roundOff(circleCenter[0])), createLiteral(roundOff(circleCenter[1])), - ]), - radius: createLiteral(1), - }), - createIdentifier(varDec.node.id.name), + ]) + ), + createLabeledArg('radius', createLiteral(1)), ]) ) @@ -1665,7 +1665,7 @@ export class SceneEntities { const x = (args.intersectionPoint.twoD.x || 0) - circleCenter[0] const y = (args.intersectionPoint.twoD.y || 0) - circleCenter[1] - if (sketchInit.type === 'CallExpression') { + if (sketchInit.type === 'CallExpressionKw') { const moddedResult = changeSketchArguments( modded, kclManager.variables, @@ -1730,7 +1730,7 @@ export class SceneEntities { const sketchInit = _node.node?.declaration.init let modded = structuredClone(_ast) - if (sketchInit.type === 'CallExpression') { + if (sketchInit.type === 'CallExpressionKw') { const moddedResult = changeSketchArguments( modded, kclManager.variables, diff --git a/src/lang/kclSamples.test.ts b/src/lang/kclSamples.test.ts index 1e9d21d65f..3e20f9f5ab 100644 --- a/src/lang/kclSamples.test.ts +++ b/src/lang/kclSamples.test.ts @@ -32,7 +32,7 @@ child_process.spawnSync('git', [ 'clone', '--single-branch', '--branch', - 'next', + 'circle-kw-args', URL_GIT_KCL_SAMPLES, DIR_KCL_SAMPLES, ]) diff --git a/src/lang/queryAst.test.ts b/src/lang/queryAst.test.ts index 6ff2ac21e9..ad11423171 100644 --- a/src/lang/queryAst.test.ts +++ b/src/lang/queryAst.test.ts @@ -581,10 +581,10 @@ sketch002 = startSketchOn(extrude001, $seg01) }) it('finds sketch001 and sketch002 pipes to be lofted', async () => { const exampleCode = `sketch001 = startSketchOn('XZ') - |> circle({ center = [0, 0], radius = 1 }, %) + |> circle(center = [0, 0], radius = 1) plane001 = offsetPlane('XZ', offset = 2) sketch002 = startSketchOn(plane001) - |> circle({ center = [0, 0], radius = 3 }, %) + |> circle(center = [0, 0], radius = 3) ` const ast = assertParse(exampleCode) const extrudable = doesSceneHaveSweepableSketch(ast, 2) @@ -608,7 +608,7 @@ extrude001 = extrude(sketch001, length = 10) describe('Testing doesSceneHaveExtrudedSketch', () => { it('finds extruded sketch as variable', async () => { const exampleCode = `sketch001 = startSketchOn('XZ') - |> circle({ center = [0, 0], radius = 1 }, %) + |> circle(center = [0, 0], radius = 1) extrude001 = extrude(sketch001, length = 1) ` const ast = assertParse(exampleCode) @@ -618,7 +618,7 @@ extrude001 = extrude(sketch001, length = 1) }) it('finds extruded sketch in pipe', async () => { const exampleCode = `extrude001 = startSketchOn('XZ') - |> circle({ center = [0, 0], radius = 1 }, %) + |> circle(center = [0, 0], radius = 1) |> extrude(length = 1) ` const ast = assertParse(exampleCode) @@ -628,7 +628,7 @@ extrude001 = extrude(sketch001, length = 1) }) it('finds no extrusion with sketch only', async () => { const exampleCode = `extrude001 = startSketchOn('XZ') - |> circle({ center = [0, 0], radius = 1 }, %) + |> circle(center = [0, 0], radius = 1) ` const ast = assertParse(exampleCode) if (err(ast)) throw ast diff --git a/src/lang/std/sketch.ts b/src/lang/std/sketch.ts index 84fb41a397..bcd2d85d21 100644 --- a/src/lang/std/sketch.ts +++ b/src/lang/std/sketch.ts @@ -77,6 +77,8 @@ import { export const ARG_TAG = 'tag' export const ARG_END = 'end' export const ARG_END_ABSOLUTE = 'endAbsolute' +export const ARG_CIRCLE_CENTER = 'center' +export const ARG_CIRCLE_RADIUS = 'radius' const STRAIGHT_SEGMENT_ERR = new Error( 'Invalid input, expected "straight-segment"' @@ -1077,7 +1079,7 @@ export const tangentialArcTo: SketchLineHelper = { ] }, } -export const circle: SketchLineHelper = { +export const circle: SketchLineHelperKw = { add: ({ node, pathToNode, segmentInput, replaceExistingCallback }) => { if (segmentInput.type !== 'arc-segment') return ARC_SEGMENT_ERR @@ -1138,51 +1140,67 @@ export const circle: SketchLineHelper = { if (input.type !== 'arc-segment') return ARC_SEGMENT_ERR const { center, radius } = input const _node = { ...node } - const nodeMeta = getNodeFromPath(_node, pathToNode) + const nodeMeta = getNodeFromPath(_node, pathToNode) if (err(nodeMeta)) return nodeMeta - const { node: callExpression, shallowPath } = nodeMeta + const { node: callExpression } = nodeMeta - const firstArg = callExpression.arguments?.[0] const newCenter = createArrayExpression([ createLiteral(roundOff(center[0])), createLiteral(roundOff(center[1])), ]) - mutateObjExpProp(firstArg, newCenter, 'center') + mutateKwArg(ARG_CIRCLE_CENTER, callExpression, newCenter) const newRadius = createLiteral(roundOff(radius)) - mutateObjExpProp(firstArg, newRadius, 'radius') + mutateKwArg(ARG_CIRCLE_RADIUS, callExpression, newRadius) return { modifiedAst: _node, - pathToNode: shallowPath, + pathToNode, } }, - getTag: getTag(), - addTag: addTag(), - getConstraintInfo: (callExp: CallExpression, code, pathToNode) => { - if (callExp.type !== 'CallExpression') return [] + getTag: getTagKwArg(), + addTag: addTagKw(), + getConstraintInfo: (callExp: CallExpressionKw, code, pathToNode) => { + if (callExp.type !== 'CallExpressionKw') return [] const firstArg = callExp.arguments?.[0] - if (firstArg.type !== 'ObjectExpression') return [] - const centerDetails = getObjExprProperty(firstArg, 'center') - const radiusDetails = getObjExprProperty(firstArg, 'radius') - if (!centerDetails || !radiusDetails) return [] - if (centerDetails.expr.type !== 'ArrayExpression') return [] + if (firstArg.type !== 'LabeledArg') return [] + let centerDetails = null + let radiusDetails = null + let centerIndex = 0 + let radiusIndex = 0 + let index = 0 + for (const prop of callExp.arguments) { + if ( + prop.label?.name === 'center' && + 'arg' in prop && + prop.type === 'LabeledArg' + ) { + centerIndex = index + centerDetails = prop.arg + } + if ( + prop.label?.name === 'radius' && + 'arg' in prop && + prop.type === 'LabeledArg' + ) { + radiusIndex = index + radiusDetails = prop.arg + } + index++ + } + if (centerDetails === null || radiusDetails === null) return [] + if (centerDetails.type !== 'ArrayExpression') return [] const pathToCenterArrayExpression: PathToNode = [ ...pathToNode, - ['arguments', 'CallExpression'], - [0, 'index'], - ['properties', 'ObjectExpression'], - [centerDetails.index, 'index'], - ['value', 'Property'], - ['elements', 'ArrayExpression'], + ['arguments', 'CallExpressionKw'], + [centerIndex, 'index'], + ['arg', 'ArrayExpression'], ] const pathToRadiusLiteral: PathToNode = [ ...pathToNode, - ['arguments', 'CallExpression'], - [0, 'index'], - ['properties', 'ObjectExpression'], - [radiusDetails.index, 'index'], - ['value', 'Property'], + ['arguments', 'CallExpressionKw'], + [radiusIndex, 'index'], + ['arg', 'Literal'], ] const pathToXArg: PathToNode = [ ...pathToCenterArrayExpression, @@ -1196,27 +1214,25 @@ export const circle: SketchLineHelper = { return [ constrainInfo( 'radius', - isNotLiteralArrayOrStatic(radiusDetails.expr), - code.slice(radiusDetails.expr.start, radiusDetails.expr.end), + isNotLiteralArrayOrStatic(radiusDetails), + code.slice(radiusDetails.start, radiusDetails.end), 'circle', 'radius', - topLevelRange(radiusDetails.expr.start, radiusDetails.expr.end), + topLevelRange(radiusDetails.start, radiusDetails.end), pathToRadiusLiteral ), { stdLibFnName: 'circle', type: 'xAbsolute', - isConstrained: isNotLiteralArrayOrStatic( - centerDetails.expr.elements[0] - ), + isConstrained: isNotLiteralArrayOrStatic(centerDetails.elements[0]), sourceRange: topLevelRange( - centerDetails.expr.elements[0].start, - centerDetails.expr.elements[0].end + centerDetails.elements[0].start, + centerDetails.elements[0].end ), pathToNode: pathToXArg, value: code.slice( - centerDetails.expr.elements[0].start, - centerDetails.expr.elements[0].end + centerDetails.elements[0].start, + centerDetails.elements[0].end ), argPosition: { type: 'arrayInObject', @@ -1227,17 +1243,15 @@ export const circle: SketchLineHelper = { { stdLibFnName: 'circle', type: 'yAbsolute', - isConstrained: isNotLiteralArrayOrStatic( - centerDetails.expr.elements[1] - ), + isConstrained: isNotLiteralArrayOrStatic(centerDetails.elements[1]), sourceRange: topLevelRange( - centerDetails.expr.elements[1].start, - centerDetails.expr.elements[1].end + centerDetails.elements[1].start, + centerDetails.elements[1].end ), pathToNode: pathToYArg, value: code.slice( - centerDetails.expr.elements[1].start, - centerDetails.expr.elements[1].end + centerDetails.elements[1].start, + centerDetails.elements[1].end ), argPosition: { type: 'arrayInObject', @@ -2295,13 +2309,13 @@ export const sketchLineHelperMap: { [key: string]: SketchLineHelper } = { angledLineToY, angledLineThatIntersects, tangentialArcTo, - circle, } as const export const sketchLineHelperMapKw: { [key: string]: SketchLineHelperKw } = { line, lineTo, circleThreePoint, + circle, } as const export function changeSketchArguments( diff --git a/src/lib/exampleKcl.ts b/src/lib/exampleKcl.ts index db7cbb4234..5e2248805d 100644 --- a/src/lib/exampleKcl.ts +++ b/src/lib/exampleKcl.ts @@ -47,10 +47,10 @@ sketch001 = startSketchOn('XZ') ) sketch002 = startSketchOn(sketch001, seg03) - |> circle({ + |> circle( center = [-1.25, 1], radius = mountingHoleDiameter / 2, - }, %) + ) |> patternLinear2d( instances = 2, distance = 2.5, @@ -64,10 +64,10 @@ sketch002 = startSketchOn(sketch001, seg03) |> extrude(%, length = -thickness-.01) sketch003 = startSketchOn(sketch001, seg04) - |> circle({ + |> circle( center = [1, -1], radius = mountingHoleDiameter / 2, - }, %) + ) |> patternLinear2d( instances = 2, distance = 4, diff --git a/src/lib/selections.test.ts b/src/lib/selections.test.ts index 391e05a28a..c83ff00621 100644 --- a/src/lib/selections.test.ts +++ b/src/lib/selections.test.ts @@ -31,10 +31,10 @@ profile002 = startProfileAt([-321.34, 361.76], sketch002) |> close() extrude002 = extrude(profile002, length = 500) sketch005 = startSketchOn(extrude002, 'END') -profile006 = circle({ +profile006 = circle(sketch005, center = [-292.57, 302.55], radius = 25.89 -}, sketch005) +) sketch004 = startSketchOn(extrude001, seg02) profile005 = startProfileAt([36.1, 174.49], sketch004) |> angledLine([0, 22.33], %, $rectangleSegmentA003) @@ -61,10 +61,10 @@ profile003 = startProfileAt([-115.59, 439.4], sketch003) ], %) |> line(endAbsolute = [profileStartX(%), profileStartY(%)]) |> close() -profile004 = circle({ +profile004 = circle(sketch003, center = [-88.54, 209.41], radius = 42.72 -}, sketch003) +) ` const ___artifactGraph = new Map([ [ diff --git a/src/wasm-lib/kcl/src/docs/mod.rs b/src/wasm-lib/kcl/src/docs/mod.rs index 6cf06b0f2a..1d47daa255 100644 --- a/src/wasm-lib/kcl/src/docs/mod.rs +++ b/src/wasm-lib/kcl/src/docs/mod.rs @@ -1014,10 +1014,7 @@ mod tests { let snippet = circle_fn.to_autocomplete_snippet().unwrap(); assert_eq!( snippet, - r#"circle({ - center = [${0:3.14}, ${1:3.14}], - radius = ${2:3.14}, -}, ${3:%})${}"# + r#"circle(${0:%}, center = [${1:3.14}, ${2:3.14}], radius = ${3:3.14})${}"# ); } diff --git a/src/wasm-lib/kcl/src/execution/mod.rs b/src/wasm-lib/kcl/src/execution/mod.rs index 2769562ce3..e025aeb8b7 100644 --- a/src/wasm-lib/kcl/src/execution/mod.rs +++ b/src/wasm-lib/kcl/src/execution/mod.rs @@ -881,11 +881,20 @@ impl ExecutorContext { } #[cfg(test)] -pub(crate) async fn parse_execute(code: &str) -> Result<(crate::Program, EnvironmentRef, ExecutorContext, ExecState)> { +pub(crate) async fn parse_execute( + code: &str, +) -> Result<(crate::Program, EnvironmentRef, ExecutorContext, ExecState), KclError> { let program = crate::Program::parse_no_errs(code)?; let ctx = ExecutorContext { - engine: Arc::new(Box::new(crate::engine::conn_mock::EngineConnection::new().await?)), + engine: Arc::new(Box::new( + crate::engine::conn_mock::EngineConnection::new().await.map_err(|err| { + KclError::Internal(crate::errors::KclErrorDetails { + message: format!("Failed to create mock engine connection: {}", err), + source_ranges: vec![SourceRange::default()], + }) + })?, + )), fs: Arc::new(crate::fs::FileManager::new()), stdlib: Arc::new(crate::std::StdLib::new()), settings: Default::default(), @@ -1288,7 +1297,7 @@ const x = 5 const answer = returnX()"#; let result = parse_execute(ast).await; - let err = result.unwrap_err().downcast::().unwrap(); + let err = result.unwrap_err(); assert_eq!( err, KclError::UndefinedValue(KclErrorDetails { @@ -1321,7 +1330,7 @@ foo "#; let result = parse_execute(ast).await; - let err = result.unwrap_err().downcast::().unwrap(); + let err = result.unwrap_err(); assert_eq!( err, KclError::Syntax(KclErrorDetails { @@ -1345,7 +1354,7 @@ fn transform = (replicaId) => { fn layer = () => { return startSketchOn(XY) - |> circle({ center: [0, 0], radius: 1 }, %, $tag1) + |> circle( center= [0, 0], radius= 1 , tag =$tag1) |> extrude(length = 10) } @@ -1356,7 +1365,7 @@ let shape = layer() |> patternTransform(instances = 10, transform = transform) "#; let result = parse_execute(ast).await; - let err = result.unwrap_err().downcast::().unwrap(); + let err = result.unwrap_err(); assert_eq!( err, KclError::UndefinedValue(KclErrorDetails { @@ -1507,7 +1516,7 @@ let myNull = 0 / 0 let notNull = !myNull "#; assert_eq!( - parse_execute(code1).await.unwrap_err().downcast::().unwrap(), + parse_execute(code1).await.unwrap_err(), KclError::Semantic(KclErrorDetails { message: "Cannot apply unary operator ! to non-boolean value: number".to_owned(), source_ranges: vec![SourceRange::new(56, 63, ModuleId::default())], @@ -1516,7 +1525,7 @@ let notNull = !myNull let code2 = "let notZero = !0"; assert_eq!( - parse_execute(code2).await.unwrap_err().downcast::().unwrap(), + parse_execute(code2).await.unwrap_err(), KclError::Semantic(KclErrorDetails { message: "Cannot apply unary operator ! to non-boolean value: number".to_owned(), source_ranges: vec![SourceRange::new(14, 16, ModuleId::default())], @@ -1527,7 +1536,7 @@ let notNull = !myNull let notEmptyString = !"" "#; assert_eq!( - parse_execute(code3).await.unwrap_err().downcast::().unwrap(), + parse_execute(code3).await.unwrap_err(), KclError::Semantic(KclErrorDetails { message: "Cannot apply unary operator ! to non-boolean value: string (text)".to_owned(), source_ranges: vec![SourceRange::new(22, 25, ModuleId::default())], @@ -1539,7 +1548,7 @@ let obj = { a: 1 } let notMember = !obj.a "#; assert_eq!( - parse_execute(code4).await.unwrap_err().downcast::().unwrap(), + parse_execute(code4).await.unwrap_err(), KclError::Semantic(KclErrorDetails { message: "Cannot apply unary operator ! to non-boolean value: number".to_owned(), source_ranges: vec![SourceRange::new(36, 42, ModuleId::default())], @@ -1550,7 +1559,7 @@ let notMember = !obj.a let a = [] let notArray = !a"; assert_eq!( - parse_execute(code5).await.unwrap_err().downcast::().unwrap(), + parse_execute(code5).await.unwrap_err(), KclError::Semantic(KclErrorDetails { message: "Cannot apply unary operator ! to non-boolean value: array (list)".to_owned(), source_ranges: vec![SourceRange::new(27, 29, ModuleId::default())], @@ -1561,7 +1570,7 @@ let notArray = !a"; let x = {} let notObject = !x"; assert_eq!( - parse_execute(code6).await.unwrap_err().downcast::().unwrap(), + parse_execute(code6).await.unwrap_err(), KclError::Semantic(KclErrorDetails { message: "Cannot apply unary operator ! to non-boolean value: object".to_owned(), source_ranges: vec![SourceRange::new(28, 30, ModuleId::default())], @@ -1571,7 +1580,7 @@ let notObject = !x"; let code7 = " fn x = () => { return 1 } let notFunction = !x"; - let fn_err = parse_execute(code7).await.unwrap_err().downcast::().unwrap(); + let fn_err = parse_execute(code7).await.unwrap_err(); // These are currently printed out as JSON objects, so we don't want to // check the full error. assert!( @@ -1585,7 +1594,7 @@ let notFunction = !x"; let code8 = " let myTagDeclarator = $myTag let notTagDeclarator = !myTagDeclarator"; - let tag_declarator_err = parse_execute(code8).await.unwrap_err().downcast::().unwrap(); + let tag_declarator_err = parse_execute(code8).await.unwrap_err(); // These are currently printed out as JSON objects, so we don't want to // check the full error. assert!( @@ -1599,7 +1608,7 @@ let notTagDeclarator = !myTagDeclarator"; let code9 = " let myTagDeclarator = $myTag let notTagIdentifier = !myTag"; - let tag_identifier_err = parse_execute(code9).await.unwrap_err().downcast::().unwrap(); + let tag_identifier_err = parse_execute(code9).await.unwrap_err(); // These are currently printed out as JSON objects, so we don't want to // check the full error. assert!( @@ -1614,7 +1623,7 @@ let notTagIdentifier = !myTag"; assert_eq!( // TODO: We don't currently parse this, but we should. It should be // a runtime error instead. - parse_execute(code10).await.unwrap_err().downcast::().unwrap(), + parse_execute(code10).await.unwrap_err(), KclError::Syntax(KclErrorDetails { message: "Unexpected token: !".to_owned(), source_ranges: vec![SourceRange::new(14, 15, ModuleId::default())], @@ -1627,7 +1636,7 @@ let notPipeSub = 1 |> identity(!%))"; assert_eq!( // TODO: We don't currently parse this, but we should. It should be // a runtime error instead. - parse_execute(code11).await.unwrap_err().downcast::().unwrap(), + parse_execute(code11).await.unwrap_err(), KclError::Syntax(KclErrorDetails { message: "Unexpected token: |>".to_owned(), source_ranges: vec![SourceRange::new(54, 56, ModuleId::default())], diff --git a/src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_tests__au.snap b/src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_tests__au.snap index b164328d8e..507b5e9c95 100644 --- a/src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_tests__au.snap +++ b/src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_tests__au.snap @@ -6,7 +6,7 @@ expression: actual "body": [ { "declaration": { - "end": 113, + "end": 106, "id": { "end": 14, "name": "cylinder", @@ -40,81 +40,59 @@ expression: actual { "arguments": [ { - "end": 81, - "properties": [ - { - "end": 67, - "key": { - "end": 59, - "name": "center", - "start": 53, - "type": "Identifier" - }, - "start": 53, - "type": "ObjectProperty", - "value": { - "elements": [ - { - "end": 63, - "raw": "0", - "start": 62, - "type": "Literal", - "type": "Literal", - "value": { - "value": 0.0, - "suffix": "None" - } - }, - { - "end": 66, - "raw": "0", - "start": 65, - "type": "Literal", - "type": "Literal", - "value": { - "value": 0.0, - "suffix": "None" - } - } - ], - "end": 67, - "start": 61, - "type": "ArrayExpression", - "type": "ArrayExpression" - } - }, - { - "end": 79, - "key": { - "end": 75, - "name": "radius", - "start": 69, - "type": "Identifier" + "type": "LabeledArg", + "label": { + "type": "Identifier", + "name": "center" + }, + "arg": { + "elements": [ + { + "end": 61, + "raw": "0", + "start": 60, + "type": "Literal", + "type": "Literal", + "value": { + "value": 0.0, + "suffix": "None" + } }, - "start": 69, - "type": "ObjectProperty", - "value": { - "end": 79, - "raw": "22", - "start": 77, + { + "end": 64, + "raw": "0", + "start": 63, "type": "Literal", "type": "Literal", "value": { - "value": 22.0, + "value": 0.0, "suffix": "None" } } - } - ], - "start": 51, - "type": "ObjectExpression", - "type": "ObjectExpression" + ], + "end": 65, + "start": 59, + "type": "ArrayExpression", + "type": "ArrayExpression" + } }, { - "end": 84, - "start": 83, - "type": "PipeSubstitution", - "type": "PipeSubstitution" + "type": "LabeledArg", + "label": { + "type": "Identifier", + "name": "radius" + }, + "arg": { + "end": 77, + "raw": "22", + "start": 75, + "type": "Literal", + "type": "Literal", + "value": { + "value": 22.0, + "suffix": "None" + } + } } ], "callee": { @@ -123,10 +101,11 @@ expression: actual "start": 44, "type": "Identifier" }, - "end": 85, + "end": 78, "start": 44, - "type": "CallExpression", - "type": "CallExpression" + "type": "CallExpressionKw", + "type": "CallExpressionKw", + "unlabeled": null }, { "arguments": [ @@ -137,9 +116,9 @@ expression: actual "name": "length" }, "arg": { - "end": 112, + "end": 105, "raw": "14", - "start": 110, + "start": 103, "type": "Literal", "type": "Literal", "value": { @@ -150,19 +129,19 @@ expression: actual } ], "callee": { - "end": 100, + "end": 93, "name": "extrude", - "start": 93, + "start": 86, "type": "Identifier" }, - "end": 113, - "start": 93, + "end": 106, + "start": 86, "type": "CallExpressionKw", "type": "CallExpressionKw", "unlabeled": null } ], - "end": 113, + "end": 106, "start": 17, "type": "PipeExpression", "type": "PipeExpression" @@ -170,13 +149,13 @@ expression: actual "start": 6, "type": "VariableDeclarator" }, - "end": 113, + "end": 106, "kind": "const", "start": 0, "type": "VariableDeclaration", "type": "VariableDeclaration" } ], - "end": 114, + "end": 107, "start": 0 } diff --git a/src/wasm-lib/kcl/src/std/appearance.rs b/src/wasm-lib/kcl/src/std/appearance.rs index 971305aa36..7f37e6b6cd 100644 --- a/src/wasm-lib/kcl/src/std/appearance.rs +++ b/src/wasm-lib/kcl/src/std/appearance.rs @@ -90,7 +90,7 @@ pub async fn appearance(_exec_state: &mut ExecState, args: Args) -> Result circle({ center = [15, 0], radius = 5 }, %) +/// |> circle( center = [15, 0], radius = 5 ) /// |> revolve({ angle = 360, axis = 'y' }, %) /// |> appearance( /// color = '#ff0000', @@ -253,16 +253,16 @@ pub async fn appearance(_exec_state: &mut ExecState, args: Args) -> Result line(end = [0, 7]) /// /// pipeHole = startSketchOn('XY') -/// |> circle({ +/// |> circle( /// center = [0, 0], /// radius = 1.5, -/// }, %) +/// ) /// /// sweepSketch = startSketchOn('XY') -/// |> circle({ +/// |> circle( /// center = [0, 0], /// radius = 2, -/// }, %) +/// ) /// |> hole(pipeHole, %) /// |> sweep(path = sweepPath) /// |> appearance( diff --git a/src/wasm-lib/kcl/src/std/args.rs b/src/wasm-lib/kcl/src/std/args.rs index bacac2f24b..e5088d6046 100644 --- a/src/wasm-lib/kcl/src/std/args.rs +++ b/src/wasm-lib/kcl/src/std/args.rs @@ -444,19 +444,6 @@ impl Args { Ok((a.n, b.n, ty)) } - pub(crate) fn get_circle_args( - &self, - ) -> Result< - ( - crate::std::shapes::CircleData, - crate::std::shapes::SketchOrSurface, - Option, - ), - KclError, - > { - FromArgs::from_args(self, 0) - } - pub(crate) fn get_sketches(&self) -> Result<(SketchSet, Sketch), KclError> { FromArgs::from_args(self, 0) } @@ -1080,15 +1067,6 @@ impl<'a> FromKclValue<'a> for super::revolve::RevolveData { } } -impl<'a> FromKclValue<'a> for super::shapes::CircleData { - fn from_kcl_val(arg: &'a KclValue) -> Option { - let obj = arg.as_object()?; - let_field_of!(obj, center); - let_field_of!(obj, radius); - Some(Self { center, radius }) - } -} - impl<'a> FromKclValue<'a> for super::sketch::TangentialArcData { fn from_kcl_val(arg: &'a KclValue) -> Option { let obj = arg.as_object()?; diff --git a/src/wasm-lib/kcl/src/std/array.rs b/src/wasm-lib/kcl/src/std/array.rs index e35f22b67b..ecc5c772fe 100644 --- a/src/wasm-lib/kcl/src/std/array.rs +++ b/src/wasm-lib/kcl/src/std/array.rs @@ -30,7 +30,7 @@ pub async fn map(exec_state: &mut ExecState, args: Args) -> Result circle({ center: [id * 2 * r, 0], radius: r}, %) +/// |> circle( center= [id * 2 * r, 0], radius= r) /// } /// /// // Call `drawCircle`, passing in each element of the array. @@ -48,7 +48,7 @@ pub async fn map(exec_state: &mut ExecState, args: Args) -> Result circle({ center: [id * 2 * r, 0], radius: r}, %) +/// |> circle( center= [id * 2 * r, 0], radius= r) /// } /// ) /// ``` diff --git a/src/wasm-lib/kcl/src/std/convert.rs b/src/wasm-lib/kcl/src/std/convert.rs index b9917fb385..061e28fd41 100644 --- a/src/wasm-lib/kcl/src/std/convert.rs +++ b/src/wasm-lib/kcl/src/std/convert.rs @@ -25,7 +25,7 @@ pub async fn int(_exec_state: &mut ExecState, args: Args) -> Result circle({ center = [0, 0], radius = 2 }, %) +/// |> circle(center = [0, 0], radius = 2 ) /// |> extrude(length = 5) /// |> patternTransform(instances = n, transform = fn(id) { /// return { translate = [4 * id, 0, 0] } diff --git a/src/wasm-lib/kcl/src/std/helix.rs b/src/wasm-lib/kcl/src/std/helix.rs index 6a0bc72e01..485f8fe5db 100644 --- a/src/wasm-lib/kcl/src/std/helix.rs +++ b/src/wasm-lib/kcl/src/std/helix.rs @@ -42,7 +42,7 @@ pub async fn helix(exec_state: &mut ExecState, args: Args) -> Result circle({ center = [0, 0], radius = 0.5 }, %) +/// |> circle( center = [0, 0], radius = 0.5) /// |> sweep(path = helixPath) /// ``` /// @@ -63,7 +63,7 @@ pub async fn helix(exec_state: &mut ExecState, args: Args) -> Result circle({ center = [0, 0], radius = 0.5 }, %) +/// |> circle( center = [0, 0], radius = 0.5 ) /// |> sweep(path = helixPath) /// ``` /// @@ -85,7 +85,7 @@ pub async fn helix(exec_state: &mut ExecState, args: Args) -> Result circle({ center = [0, 0], radius = 1 }, %) +/// |> circle( center = [0, 0], radius = 1 ) /// |> sweep(path = helixPath) /// ``` #[stdlib { @@ -206,7 +206,7 @@ pub async fn helix_revolutions(exec_state: &mut ExecState, args: Args) -> Result /// /// ```no_run /// part001 = startSketchOn('XY') -/// |> circle({ center: [5, 5], radius: 10 }, %) +/// |> circle( center= [5, 5], radius= 10 ) /// |> extrude(length = 10) /// |> helixRevolutions({ /// angleStart = 0, diff --git a/src/wasm-lib/kcl/src/std/loft.rs b/src/wasm-lib/kcl/src/std/loft.rs index 187cc51b20..15e98eedc7 100644 --- a/src/wasm-lib/kcl/src/std/loft.rs +++ b/src/wasm-lib/kcl/src/std/loft.rs @@ -78,10 +78,10 @@ pub async fn loft(exec_state: &mut ExecState, args: Args) -> Result close() /// /// circleSketch0 = startSketchOn(offsetPlane('XY', offset = 75)) -/// |> circle({ center = [0, 100], radius = 50 }, %) +/// |> circle( center = [0, 100], radius = 50 ) /// /// circleSketch1 = startSketchOn(offsetPlane('XY', offset = 150)) -/// |> circle({ center = [0, 100], radius = 20 }, %) +/// |> circle( center = [0, 100], radius = 20 ) /// /// loft([squareSketch, circleSketch0, circleSketch1]) /// ``` @@ -97,10 +97,10 @@ pub async fn loft(exec_state: &mut ExecState, args: Args) -> Result close() /// /// circleSketch0 = startSketchOn(offsetPlane('XY', offset = 75)) -/// |> circle({ center = [0, 100], radius = 50 }, %) +/// |> circle( center = [0, 100], radius = 50 ) /// /// circleSketch1 = startSketchOn(offsetPlane('XY', offset = 150)) -/// |> circle({ center = [0, 100], radius = 20 }, %) +/// |> circle( center = [0, 100], radius = 20 ) /// /// loft([squareSketch, circleSketch0, circleSketch1], /// baseCurveIndex = 0, diff --git a/src/wasm-lib/kcl/src/std/math.rs b/src/wasm-lib/kcl/src/std/math.rs index b25c19f91c..8328642684 100644 --- a/src/wasm-lib/kcl/src/std/math.rs +++ b/src/wasm-lib/kcl/src/std/math.rs @@ -78,7 +78,7 @@ pub async fn pi(_exec_state: &mut ExecState, args: Args) -> Result circle({ center = [0, 0], radius = circumference/ (2 * pi()) }, %) +/// |> circle( center = [0, 0], radius = circumference/ (2 * pi()) ) /// /// example = extrude(exampleSketch, length = 5) /// ``` diff --git a/src/wasm-lib/kcl/src/std/patterns.rs b/src/wasm-lib/kcl/src/std/patterns.rs index 89f8092be3..0fb195937b 100644 --- a/src/wasm-lib/kcl/src/std/patterns.rs +++ b/src/wasm-lib/kcl/src/std/patterns.rs @@ -117,7 +117,7 @@ pub async fn pattern_transform_2d(exec_state: &mut ExecState, args: Args) -> Res /// /// // Sketch 4 cylinders. /// sketch001 = startSketchOn('XZ') -/// |> circle({ center = [0, 0], radius = 2 }, %) +/// |> circle(center = [0, 0], radius = 2) /// |> extrude(length = 5) /// |> patternTransform(instances = 4, transform = transform) /// ``` @@ -130,7 +130,7 @@ pub async fn pattern_transform_2d(exec_state: &mut ExecState, args: Args) -> Res /// } /// /// sketch001 = startSketchOn('XZ') -/// |> circle({ center = [0, 0], radius = 2 }, %) +/// |> circle(center = [0, 0], radius = 2) /// |> extrude(length = 5) /// |> patternTransform(instances = 4, transform = transform) /// ``` @@ -226,7 +226,7 @@ pub async fn pattern_transform_2d(exec_state: &mut ExecState, args: Args) -> Res /// // Each layer is just a pretty thin cylinder. /// fn layer() { /// return startSketchOn("XY") // or some other plane idk -/// |> circle({ center = [0, 0], radius = 1 }, %, $tag1) +/// |> circle(center = [0, 0], radius = 1, tag = $tag1) /// |> extrude(length = h) /// } /// // The vase is 100 layers tall. @@ -303,7 +303,7 @@ async fn inner_pattern_transform<'a>( /// /// // Sketch 4 circles. /// sketch001 = startSketchOn('XZ') -/// |> circle({ center: [0, 0], radius: 2 }, %) +/// |> circle(center= [0, 0], radius= 2) /// |> patternTransform2d(instances = 4, transform = transform) /// ``` #[stdlib { @@ -715,7 +715,7 @@ pub async fn pattern_linear_2d(exec_state: &mut ExecState, args: Args) -> Result /// /// ```no_run /// exampleSketch = startSketchOn('XZ') -/// |> circle({ center = [0, 0], radius = 1 }, %) +/// |> circle(center = [0, 0], radius = 1) /// |> patternLinear2d( /// axis = [1, 0], /// instances = 7, @@ -821,11 +821,11 @@ pub async fn pattern_linear_3d(exec_state: &mut ExecState, args: Args) -> Result /// |> extrude(length = 65) /// /// const thing1 = startSketchOn(case, 'end') -/// |> circle({center = [-size / 2, -size / 2], radius = 25}, %) +/// |> circle(center = [-size / 2, -size / 2], radius = 25) /// |> extrude(length = 50) /// /// const thing2 = startSketchOn(case, 'end') -/// |> circle({center = [size / 2, -size / 2], radius = 25}, %) +/// |> circle(center = [size / 2, -size / 2], radius = 25) /// |> extrude(length = 50) /// /// // We pass in the "case" here since we want to pattern the whole sketch. @@ -849,7 +849,7 @@ pub async fn pattern_linear_3d(exec_state: &mut ExecState, args: Args) -> Result /// |> extrude(length = 65) /// /// const thing1 = startSketchOn(case, 'end') -/// |> circle({ center =[-size / 2, -size / 2], radius = 25}, %) +/// |> circle(center =[-size / 2, -size / 2], radius = 25) /// |> extrude(length = 50) /// /// // We pass in `thing1` here with `useOriginal` since we want to pattern just this object on the face. @@ -1166,7 +1166,7 @@ pub async fn pattern_circular_3d(exec_state: &mut ExecState, args: Args) -> Resu /// /// ```no_run /// exampleSketch = startSketchOn('XZ') -/// |> circle({ center = [0, 0], radius = 1 }, %) +/// |> circle(center = [0, 0], radius = 1) /// /// example = extrude(exampleSketch, length = -5) /// |> patternCircular3d( diff --git a/src/wasm-lib/kcl/src/std/planes.rs b/src/wasm-lib/kcl/src/std/planes.rs index a4c3573862..915130d0a3 100644 --- a/src/wasm-lib/kcl/src/std/planes.rs +++ b/src/wasm-lib/kcl/src/std/planes.rs @@ -36,7 +36,7 @@ pub async fn offset_plane(exec_state: &mut ExecState, args: Args) -> Result close() /// /// circleSketch = startSketchOn(offsetPlane('XY', offset = 150)) -/// |> circle({ center = [0, 100], radius = 50 }, %) +/// |> circle( center = [0, 100], radius = 50 ) /// /// loft([squareSketch, circleSketch]) /// ``` @@ -52,7 +52,7 @@ pub async fn offset_plane(exec_state: &mut ExecState, args: Args) -> Result close() /// /// circleSketch = startSketchOn(offsetPlane('XZ', offset = 150)) -/// |> circle({ center = [0, 100], radius = 50 }, %) +/// |> circle( center = [0, 100], radius = 50 ) /// /// loft([squareSketch, circleSketch]) /// ``` @@ -68,7 +68,7 @@ pub async fn offset_plane(exec_state: &mut ExecState, args: Args) -> Result close() /// /// circleSketch = startSketchOn(offsetPlane('YZ', offset = 150)) -/// |> circle({ center = [0, 100], radius = 50 }, %) +/// |> circle( center = [0, 100], radius = 50 ) /// /// loft([squareSketch, circleSketch]) /// ``` @@ -84,7 +84,7 @@ pub async fn offset_plane(exec_state: &mut ExecState, args: Args) -> Result close() /// /// circleSketch = startSketchOn(offsetPlane('-XZ', offset = -150)) -/// |> circle({ center = [0, 100], radius = 50 }, %) +/// |> circle( center = [0, 100], radius = 50 ) /// /// loft([squareSketch, circleSketch]) /// ``` @@ -92,7 +92,7 @@ pub async fn offset_plane(exec_state: &mut ExecState, args: Args) -> Result startProfileAt([0, 0], %) -/// |> circle({ radius = 10, center = [0, 0] }, %) +/// |> circle( radius = 10, center = [0, 0] ) /// /// // Triangle on the plane 4 units above /// startSketchOn(offsetPlane("XY", offset = 4)) diff --git a/src/wasm-lib/kcl/src/std/revolve.rs b/src/wasm-lib/kcl/src/std/revolve.rs index 43d22b9665..09a017a8b1 100644 --- a/src/wasm-lib/kcl/src/std/revolve.rs +++ b/src/wasm-lib/kcl/src/std/revolve.rs @@ -63,7 +63,7 @@ pub async fn revolve(exec_state: &mut ExecState, args: Args) -> Result circle({ center = [15, 0], radius = 5 }, %) +/// |> circle( center = [15, 0], radius = 5 ) /// |> revolve({ /// angle = 360, /// axis = 'y' @@ -115,7 +115,7 @@ pub async fn revolve(exec_state: &mut ExecState, args: Args) -> Result extrude(length = 20) /// /// sketch001 = startSketchOn(box, "END") -/// |> circle({ center = [10,10], radius = 4 }, %) +/// |> circle( center = [10,10], radius = 4 ) /// |> revolve({ /// angle = -90, /// axis = 'y' @@ -132,7 +132,7 @@ pub async fn revolve(exec_state: &mut ExecState, args: Args) -> Result extrude(length = 20) /// /// sketch001 = startSketchOn(box, "END") -/// |> circle({ center = [10,10], radius = 4 }, %) +/// |> circle( center = [10,10], radius = 4 ) /// |> revolve({ /// angle = 90, /// axis = getOppositeEdge(revolveAxis) @@ -149,7 +149,7 @@ pub async fn revolve(exec_state: &mut ExecState, args: Args) -> Result extrude(length = 20) /// /// sketch001 = startSketchOn(box, "END") -/// |> circle({ center = [10,10], radius = 4 }, %) +/// |> circle( center = [10,10], radius = 4 ) /// |> revolve({ /// angle = 90, /// axis = getOppositeEdge(revolveAxis), diff --git a/src/wasm-lib/kcl/src/std/segment.rs b/src/wasm-lib/kcl/src/std/segment.rs index 40d0418c4f..f0c4134e24 100644 --- a/src/wasm-lib/kcl/src/std/segment.rs +++ b/src/wasm-lib/kcl/src/std/segment.rs @@ -34,7 +34,7 @@ pub async fn segment_end(exec_state: &mut ExecState, args: Args) -> Result startProfileAt([0, 0], %) -/// |> circle({ radius = radius, center = segEnd(tag) }, %) +/// |> circle(radius = radius, center = segEnd(tag) ) /// |> extrude(length = radius) /// } /// @@ -170,7 +170,7 @@ pub async fn segment_start(exec_state: &mut ExecState, args: Args) -> Result startProfileAt([0, 0], %) -/// |> circle({ radius = radius, center = segStart(tag) }, %) +/// |> circle( radius = radius, center = segStart(tag) ) /// |> extrude(length = radius) /// } /// @@ -536,7 +536,7 @@ pub async fn tangent_to_end(exec_state: &mut ExecState, args: Args) -> Result circle({ center: [0, 0], radius: 3 }, %, $circ) +/// |> circle( center= [0, 0], radius= 3 , tag= $circ) /// /// triangleSketch = startSketchOn("XY") /// |> startProfileAt([-5, 0], %) diff --git a/src/wasm-lib/kcl/src/std/shapes.rs b/src/wasm-lib/kcl/src/std/shapes.rs index eeec31e4ac..083d0b5b17 100644 --- a/src/wasm-lib/kcl/src/std/shapes.rs +++ b/src/wasm-lib/kcl/src/std/shapes.rs @@ -18,6 +18,7 @@ use crate::{ execution::{BasePath, ExecState, GeoMeta, KclValue, Path, Sketch, SketchSurface}, parsing::ast::types::TagNode, std::{ + sketch::NEW_TAG_KW, utils::{calculate_circle_center, distance}, Args, }, @@ -32,24 +33,14 @@ pub enum SketchOrSurface { Sketch(Box), } -/// Data for drawing an circle -#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, ts_rs::TS, JsonSchema)] -#[ts(export)] -#[serde(rename_all = "camelCase")] -// TODO: make sure the docs on the args below are correct. -pub struct CircleData { - /// The center of the circle. - pub center: [f64; 2], - /// The circle radius - pub radius: f64, -} - /// Sketch a circle. pub async fn circle(exec_state: &mut ExecState, args: Args) -> Result { - let (data, sketch_surface_or_group, tag): (CircleData, SketchOrSurface, Option) = - args.get_circle_args()?; + let sketch_or_surface = args.get_unlabeled_kw_arg("sketchOrSurface")?; + let center = args.get_kw_arg("center")?; + let radius = args.get_kw_arg("radius")?; + let tag = args.get_kw_arg_opt(NEW_TAG_KW)?; - let sketch = inner_circle(data, sketch_surface_or_group, tag, exec_state, args).await?; + let sketch = inner_circle(sketch_or_surface, center, radius, tag, exec_state, args).await?; Ok(KclValue::Sketch { value: Box::new(sketch), }) @@ -60,7 +51,7 @@ pub async fn circle(exec_state: &mut ExecState, args: Args) -> Result circle({ center = [0, 0], radius = 10 }, %) +/// |> circle( center = [0, 0], radius = 10 ) /// /// example = extrude(exampleSketch, length = 5) /// ``` @@ -72,27 +63,36 @@ pub async fn circle(exec_state: &mut ExecState, args: Args) -> Result line(end = [0, 30]) /// |> line(end = [-30, 0]) /// |> close() -/// |> hole(circle({ center = [0, 15], radius = 5 }, %), %) +/// |> hole(circle( center = [0, 15], radius = 5), %) /// /// example = extrude(exampleSketch, length = 5) /// ``` #[stdlib { name = "circle", + keywords = true, + unlabeled_first = true, + args = { + sketch_or_surface = {docs = "Plane or surface to sketch on."}, + center = {docs = "The center of the circle."}, + radius = {docs = "The radius of the circle."}, + tag = { docs = "Create a new tag which refers to this circle"}, + } }] async fn inner_circle( - data: CircleData, - sketch_surface_or_group: SketchOrSurface, + sketch_or_surface: SketchOrSurface, + center: [f64; 2], + radius: f64, tag: Option, exec_state: &mut ExecState, args: Args, ) -> Result { - let sketch_surface = match sketch_surface_or_group { + let sketch_surface = match sketch_or_surface { SketchOrSurface::SketchSurface(surface) => surface, - SketchOrSurface::Sketch(group) => group.on, + SketchOrSurface::Sketch(s) => s.on, }; let units = sketch_surface.units(); let sketch = crate::std::sketch::inner_start_profile_at( - [data.center[0] + data.radius, data.center[1]], + [center[0] + radius, center[1]], sketch_surface, None, exec_state, @@ -100,7 +100,7 @@ async fn inner_circle( ) .await?; - let from = [data.center[0] + data.radius, data.center[1]]; + let from = [center[0] + radius, center[1]]; let angle_start = Angle::zero(); let angle_end = Angle::turn(); @@ -113,8 +113,8 @@ async fn inner_circle( segment: PathSegment::Arc { start: angle_start, end: angle_end, - center: KPoint2d::from(data.center).map(LengthUnit), - radius: data.radius.into(), + center: KPoint2d::from(center).map(LengthUnit), + radius: radius.into(), relative: false, }, }), @@ -132,8 +132,8 @@ async fn inner_circle( metadata: args.source_range.into(), }, }, - radius: data.radius, - center: data.center, + radius, + center, ccw: angle_start < angle_end, }; diff --git a/src/wasm-lib/kcl/src/std/shell.rs b/src/wasm-lib/kcl/src/std/shell.rs index bc771af154..d6de44b282 100644 --- a/src/wasm-lib/kcl/src/std/shell.rs +++ b/src/wasm-lib/kcl/src/std/shell.rs @@ -109,11 +109,11 @@ pub async fn shell(exec_state: &mut ExecState, args: Args) -> Result extrude(length = 65) /// /// thing1 = startSketchOn(case, 'end') -/// |> circle({ center = [-size / 2, -size / 2], radius = 25 }, %) +/// |> circle( center = [-size / 2, -size / 2], radius = 25 ) /// |> extrude(length = 50) /// /// thing2 = startSketchOn(case, 'end') -/// |> circle({ center = [size / 2, -size / 2], radius = 25 }, %) +/// |> circle( center = [size / 2, -size / 2], radius = 25 ) /// |> extrude(length = 50) /// /// // We put "case" in the shell function to shell the entire object. @@ -132,11 +132,11 @@ pub async fn shell(exec_state: &mut ExecState, args: Args) -> Result extrude(length = 65) /// /// thing1 = startSketchOn(case, 'end') -/// |> circle({ center = [-size / 2, -size / 2], radius = 25 }, %) +/// |> circle( center = [-size / 2, -size / 2], radius = 25 ) /// |> extrude(length = 50) /// /// thing2 = startSketchOn(case, 'end') -/// |> circle({ center = [size / 2, -size / 2], radius = 25 }, %) +/// |> circle( center = [size / 2, -size / 2], radius = 25 ) /// |> extrude(length = 50) /// /// // We put "thing1" in the shell function to shell the end face of the object. @@ -157,11 +157,11 @@ pub async fn shell(exec_state: &mut ExecState, args: Args) -> Result extrude(length = 65) /// /// thing1 = startSketchOn(case, 'end') -/// |> circle({ center = [-size / 2, -size / 2], radius = 25 }, %) +/// |> circle( center = [-size / 2, -size / 2], radius = 25 ) /// |> extrude(length = 50) /// /// thing2 = startSketchOn(case, 'end') -/// |> circle({ center = [size / 2, -size / 2], radius = 25 }, %) +/// |> circle( center = [size / 2, -size / 2], radius = 25) /// |> extrude(length = 50) /// /// // We put "thing1" and "thing2" in the shell function to shell the end face of the object. @@ -293,11 +293,11 @@ pub async fn hollow(exec_state: &mut ExecState, args: Args) -> Result extrude(length = 65) /// /// thing1 = startSketchOn(case, 'end') -/// |> circle({ center = [-size / 2, -size / 2], radius = 25 }, %) +/// |> circle( center = [-size / 2, -size / 2], radius = 25 ) /// |> extrude(length = 50) /// /// thing2 = startSketchOn(case, 'end') -/// |> circle({ center = [size / 2, -size / 2], radius = 25 }, %) +/// |> circle( center = [size / 2, -size / 2], radius = 25 ) /// |> extrude(length = 50) /// /// hollow(0.5, case) diff --git a/src/wasm-lib/kcl/src/std/sketch.rs b/src/wasm-lib/kcl/src/std/sketch.rs index f12b0b49f2..d07a5f9fd7 100644 --- a/src/wasm-lib/kcl/src/std/sketch.rs +++ b/src/wasm-lib/kcl/src/std/sketch.rs @@ -2272,8 +2272,8 @@ pub async fn hole(exec_state: &mut ExecState, args: Args) -> Result line(end = [5, 0]) /// |> line(end = [0, -5]) /// |> close() -/// |> hole(circle({ center = [1, 1], radius = .25 }, %), %) -/// |> hole(circle({ center = [1, 4], radius = .25 }, %), %) +/// |> hole(circle( center = [1, 1], radius = .25 ), %) +/// |> hole(circle( center = [1, 4], radius = .25 ), %) /// /// example = extrude(exampleSketch, length = 1) /// ``` @@ -2290,7 +2290,7 @@ pub async fn hole(exec_state: &mut ExecState, args: Args) -> Result circle({ center = [0, 0], radius = 3 }, %) +/// |> circle( center = [0, 0], radius = 3 ) /// |> hole(squareHoleSketch(), %) /// example = extrude(exampleSketch, length = 1) /// ``` diff --git a/src/wasm-lib/kcl/src/std/sweep.rs b/src/wasm-lib/kcl/src/std/sweep.rs index 8ef0f976c5..c3b4a463cd 100644 --- a/src/wasm-lib/kcl/src/std/sweep.rs +++ b/src/wasm-lib/kcl/src/std/sweep.rs @@ -61,16 +61,16 @@ pub async fn sweep(exec_state: &mut ExecState, args: Args) -> Result circle({ +/// |> circle( /// center = [0, 0], /// radius = 1.5, -/// }, %) +/// ) /// /// sweepSketch = startSketchOn('XY') -/// |> circle({ +/// |> circle( /// center = [0, 0], /// radius = 2, -/// }, %) +/// ) /// |> hole(pipeHole, %) /// |> sweep(path = sweepPath) /// ``` @@ -91,7 +91,7 @@ pub async fn sweep(exec_state: &mut ExecState, args: Args) -> Result circle({ center = [0, 0], radius = 1 }, %) +/// |> circle( center = [0, 0], radius = 1) /// |> sweep(path = helixPath) /// ``` #[stdlib { diff --git a/src/wasm-lib/kcl/src/std/transform.rs b/src/wasm-lib/kcl/src/std/transform.rs index 96ee9f4506..d255e23185 100644 --- a/src/wasm-lib/kcl/src/std/transform.rs +++ b/src/wasm-lib/kcl/src/std/transform.rs @@ -57,16 +57,16 @@ pub async fn scale(exec_state: &mut ExecState, args: Args) -> Result circle({ +/// |> circle( /// center = [0, 0], /// radius = 1.5, -/// }, %) +/// ) /// /// sweepSketch = startSketchOn('XY') -/// |> circle({ +/// |> circle( /// center = [0, 0], /// radius = 2, -/// }, %) +/// ) /// |> hole(pipeHole, %) /// |> sweep(path = sweepPath) /// |> scale( @@ -150,16 +150,16 @@ pub async fn translate(exec_state: &mut ExecState, args: Args) -> Result circle({ +/// |> circle( /// center = [0, 0], /// radius = 1.5, -/// }, %) +/// ) /// /// sweepSketch = startSketchOn('XY') -/// |> circle({ +/// |> circle( /// center = [0, 0], /// radius = 2, -/// }, %) +/// ) /// |> hole(pipeHole, %) /// |> sweep(path = sweepPath) /// |> translate( @@ -369,16 +369,16 @@ pub async fn rotate(exec_state: &mut ExecState, args: Args) -> Result circle({ +/// |> circle( /// center = [0, 0], /// radius = 1.5, -/// }, %) +/// ) /// /// sweepSketch = startSketchOn('XY') -/// |> circle({ +/// |> circle( /// center = [0, 0], /// radius = 2, -/// }, %) +/// ) /// |> hole(pipeHole, %) /// |> sweep(path = sweepPath) /// |> rotate( @@ -408,16 +408,16 @@ pub async fn rotate(exec_state: &mut ExecState, args: Args) -> Result circle({ +/// |> circle( /// center = [0, 0], /// radius = 1.5, -/// }, %) +/// ) /// /// sweepSketch = startSketchOn('XY') -/// |> circle({ +/// |> circle( /// center = [0, 0], /// radius = 2, -/// }, %) +/// ) /// |> hole(pipeHole, %) /// |> sweep(path = sweepPath) /// |> rotate( @@ -527,15 +527,15 @@ mod tests { // Create a hole for the pipe. pipeHole = startSketchOn('XY') - |> circle({ + |> circle( center = [0, 0], radius = 1.5, - }, %) + ) sweepSketch = startSketchOn('XY') - |> circle({ + |> circle( center = [0, 0], radius = 2, - }, %) + ) |> hole(pipeHole, %) |> sweep( path = sweepPath, @@ -550,8 +550,8 @@ sweepSketch = startSketchOn('XY') let result = parse_execute(&ast).await; assert!(result.is_err()); assert_eq!( - result.unwrap_err().to_string(), - r#"semantic: KclErrorDetails { source_ranges: [SourceRange([630, 638, 0])], message: "Expected `roll`, `pitch`, and `yaw` or `axis` and `angle` to be provided." }"#.to_string() + result.unwrap_err().message(), + r#"Expected `roll`, `pitch`, and `yaw` or `axis` and `angle` to be provided."#.to_string() ); } @@ -566,8 +566,8 @@ sweepSketch = startSketchOn('XY') let result = parse_execute(&ast).await; assert!(result.is_err()); assert_eq!( - result.unwrap_err().to_string(), - r#"semantic: KclErrorDetails { source_ranges: [SourceRange([630, 668, 0])], message: "Expected `angle` to be provided when `axis` is provided." }"#.to_string() + result.unwrap_err().message(), + r#"Expected `angle` to be provided when `axis` is provided."#.to_string() ); } @@ -582,8 +582,8 @@ sweepSketch = startSketchOn('XY') let result = parse_execute(&ast).await; assert!(result.is_err()); assert_eq!( - result.unwrap_err().to_string(), - r#"semantic: KclErrorDetails { source_ranges: [SourceRange([630, 659, 0])], message: "Expected `axis` to be provided when `angle` is provided." }"#.to_string() + result.unwrap_err().message(), + r#"Expected `axis` to be provided when `angle` is provided."#.to_string() ); } @@ -599,8 +599,8 @@ sweepSketch = startSketchOn('XY') let result = parse_execute(&ast).await; assert!(result.is_err()); assert_eq!( - result.unwrap_err().to_string(), - r#"semantic: KclErrorDetails { source_ranges: [SourceRange([630, 685, 0])], message: "Expected angle to be between -360 and 360, found `900`" }"#.to_string() + result.unwrap_err().message(), + r#"Expected angle to be between -360 and 360, found `900`"#.to_string() ); } @@ -617,8 +617,8 @@ sweepSketch = startSketchOn('XY') let result = parse_execute(&ast).await; assert!(result.is_err()); assert_eq!( - result.unwrap_err().to_string(), - r#"semantic: KclErrorDetails { source_ranges: [SourceRange([630, 697, 0])], message: "Expected `roll` to be provided when `pitch` or `yaw` is provided." }"#.to_string() + result.unwrap_err().message(), + r#"Expected `roll` to be provided when `pitch` or `yaw` is provided."#.to_string() ); } @@ -633,8 +633,8 @@ sweepSketch = startSketchOn('XY') let result = parse_execute(&ast).await; assert!(result.is_err()); assert_eq!( - result.unwrap_err().to_string(), - r#"semantic: KclErrorDetails { source_ranges: [SourceRange([630, 657, 0])], message: "Expected `roll` to be provided when `pitch` or `yaw` is provided." }"#.to_string() + result.unwrap_err().message(), + r#"Expected `roll` to be provided when `pitch` or `yaw` is provided."#.to_string() ); } @@ -651,8 +651,8 @@ sweepSketch = startSketchOn('XY') let result = parse_execute(&ast).await; assert!(result.is_err()); assert_eq!( - result.unwrap_err().to_string(), - r#"semantic: KclErrorDetails { source_ranges: [SourceRange([630, 689, 0])], message: "Expected yaw to be between -360 and 360, found `900`" }"#.to_string() + result.unwrap_err().message(), + r#"Expected yaw to be between -360 and 360, found `900`"#.to_string() ); } @@ -669,8 +669,8 @@ sweepSketch = startSketchOn('XY') let result = parse_execute(&ast).await; assert!(result.is_err()); assert_eq!( - result.unwrap_err().to_string(), - r#"semantic: KclErrorDetails { source_ranges: [SourceRange([630, 689, 0])], message: "Expected roll to be between -360 and 360, found `900`" }"#.to_string() + result.unwrap_err().message(), + r#"Expected roll to be between -360 and 360, found `900`"#.to_string() ); } @@ -687,8 +687,8 @@ sweepSketch = startSketchOn('XY') let result = parse_execute(&ast).await; assert!(result.is_err()); assert_eq!( - result.unwrap_err().to_string(), - r#"semantic: KclErrorDetails { source_ranges: [SourceRange([630, 689, 0])], message: "Expected pitch to be between -360 and 360, found `900`" }"#.to_string() + result.unwrap_err().message(), + r#"Expected pitch to be between -360 and 360, found `900`"#.to_string() ); } @@ -706,8 +706,9 @@ sweepSketch = startSketchOn('XY') let result = parse_execute(&ast).await; assert!(result.is_err()); assert_eq!( - result.unwrap_err().to_string(), - r#"semantic: KclErrorDetails { source_ranges: [SourceRange([630, 704, 0])], message: "Expected `axis` and `angle` to not be provided when `roll`, `pitch`, and `yaw` are provided." }"#.to_string() + result.unwrap_err().message(), + r#"Expected `axis` and `angle` to not be provided when `roll`, `pitch`, and `yaw` are provided."# + .to_string() ); } } diff --git a/src/wasm-lib/kcl/src/unparser.rs b/src/wasm-lib/kcl/src/unparser.rs index 2fccff9a65..170816e83e 100644 --- a/src/wasm-lib/kcl/src/unparser.rs +++ b/src/wasm-lib/kcl/src/unparser.rs @@ -1481,13 +1481,13 @@ tabs_r = startSketchOn({ |> line([0, -10], %) |> line([-10, -5], %) |> close() - |> hole(circle({ + |> hole(circle( center = [ width / 2 + thk + hole_diam, length / 2 - hole_diam ], radius = hole_diam / 2 - }, %), %) + ), %) |> extrude(-thk, %) |> patternLinear3d( axis = [0, -1, 0], @@ -1508,13 +1508,13 @@ tabs_l = startSketchOn({ |> line([0, -10], %) |> line([10, -5], %) |> close() - |> hole(circle({ + |> hole(circle( center = [ -width / 2 - thk - hole_diam, length / 2 - hole_diam ], radius = hole_diam / 2 - }, %), %) + ), %) |> extrude(-thk, %) |> patternLinear3d(axis = [0, -1, 0], repetitions = 1, distance = length - 10) "#; @@ -1602,13 +1602,13 @@ tabs_r = startSketchOn({ |> line([0, -10], %) |> line([-10, -5], %) |> close() - |> hole(circle({ + |> hole(circle( center = [ width / 2 + thk + hole_diam, length / 2 - hole_diam ], - radius = hole_diam / 2 - }, %), %) + radius = hole_diam / 2, + ), %) |> extrude(-thk, %) |> patternLinear3d(axis = [0, -1, 0], repetitions = 1, distance = length - 10) // build the tabs of the mounting bracket (left side) @@ -1625,13 +1625,13 @@ tabs_l = startSketchOn({ |> line([0, -10], %) |> line([10, -5], %) |> close() - |> hole(circle({ + |> hole(circle( center = [ -width / 2 - thk - hole_diam, length / 2 - hole_diam ], - radius = hole_diam / 2 - }, %), %) + radius = hole_diam / 2, + ), %) |> extrude(-thk, %) |> patternLinear3d(axis = [0, -1, 0], repetitions = 1, distance = length - 10) "# diff --git a/src/wasm-lib/kcl/std/math.kcl b/src/wasm-lib/kcl/std/math.kcl index b53b28fb55..f2d4d17144 100644 --- a/src/wasm-lib/kcl/std/math.kcl +++ b/src/wasm-lib/kcl/std/math.kcl @@ -6,7 +6,7 @@ /// circumference = 70 /// /// exampleSketch = startSketchOn("XZ") -/// |> circle({ center = [0, 0], radius = circumference/ (2 * PI) }, %) +/// |> circle(center = [0, 0], radius = circumference/ (2 * PI)) /// /// example = extrude(exampleSketch, length = 5) /// ``` diff --git a/src/wasm-lib/kcl/tests/assembly_non_default_units/artifact_commands.snap b/src/wasm-lib/kcl/tests/assembly_non_default_units/artifact_commands.snap index 27c40336dd..6264127805 100644 --- a/src/wasm-lib/kcl/tests/assembly_non_default_units/artifact_commands.snap +++ b/src/wasm-lib/kcl/tests/assembly_non_default_units/artifact_commands.snap @@ -338,7 +338,7 @@ description: Artifact commands assembly_non_default_units.kcl "cmdId": "[uuid]", "range": [ 197, - 239, + 232, 3 ], "command": { @@ -358,7 +358,7 @@ description: Artifact commands assembly_non_default_units.kcl "cmdId": "[uuid]", "range": [ 197, - 239, + 232, 3 ], "command": { @@ -369,7 +369,7 @@ description: Artifact commands assembly_non_default_units.kcl "cmdId": "[uuid]", "range": [ 197, - 239, + 232, 3 ], "command": { @@ -386,7 +386,7 @@ description: Artifact commands assembly_non_default_units.kcl "cmdId": "[uuid]", "range": [ 197, - 239, + 232, 3 ], "command": { @@ -415,7 +415,7 @@ description: Artifact commands assembly_non_default_units.kcl "cmdId": "[uuid]", "range": [ 197, - 239, + 232, 3 ], "command": { @@ -468,7 +468,7 @@ description: Artifact commands assembly_non_default_units.kcl "cmdId": "[uuid]", "range": [ 114, - 156, + 149, 4 ], "command": { @@ -488,7 +488,7 @@ description: Artifact commands assembly_non_default_units.kcl "cmdId": "[uuid]", "range": [ 114, - 156, + 149, 4 ], "command": { @@ -499,7 +499,7 @@ description: Artifact commands assembly_non_default_units.kcl "cmdId": "[uuid]", "range": [ 114, - 156, + 149, 4 ], "command": { @@ -516,7 +516,7 @@ description: Artifact commands assembly_non_default_units.kcl "cmdId": "[uuid]", "range": [ 114, - 156, + 149, 4 ], "command": { @@ -545,7 +545,7 @@ description: Artifact commands assembly_non_default_units.kcl "cmdId": "[uuid]", "range": [ 114, - 156, + 149, 4 ], "command": { diff --git a/src/wasm-lib/kcl/tests/assembly_non_default_units/artifact_graph_flowchart.snap.md b/src/wasm-lib/kcl/tests/assembly_non_default_units/artifact_graph_flowchart.snap.md index 845dd5221f..dd526491aa 100644 --- a/src/wasm-lib/kcl/tests/assembly_non_default_units/artifact_graph_flowchart.snap.md +++ b/src/wasm-lib/kcl/tests/assembly_non_default_units/artifact_graph_flowchart.snap.md @@ -1,13 +1,13 @@ ```mermaid flowchart LR subgraph path2 [Path] - 2["Path
[197, 239, 3]"] - 3["Segment
[197, 239, 3]"] + 2["Path
[197, 232, 3]"] + 3["Segment
[197, 232, 3]"] 4[Solid2d] end subgraph path6 [Path] - 6["Path
[114, 156, 4]"] - 7["Segment
[114, 156, 4]"] + 6["Path
[114, 149, 4]"] + 7["Segment
[114, 149, 4]"] 8[Solid2d] end 1["Plane
[172, 191, 3]"] diff --git a/src/wasm-lib/kcl/tests/assembly_non_default_units/other1.kcl b/src/wasm-lib/kcl/tests/assembly_non_default_units/other1.kcl index d05a549654..f7949842e5 100644 --- a/src/wasm-lib/kcl/tests/assembly_non_default_units/other1.kcl +++ b/src/wasm-lib/kcl/tests/assembly_non_default_units/other1.kcl @@ -5,4 +5,4 @@ import radius from "globals.kcl" // Use the same units as in the main importing file. startSketchOn('XZ') - |> circle({ center = [0, 0], radius = 1 }, %) + |> circle(center = [0, 0], radius = 1) diff --git a/src/wasm-lib/kcl/tests/assembly_non_default_units/other2.kcl b/src/wasm-lib/kcl/tests/assembly_non_default_units/other2.kcl index 139063e028..2c2f6365be 100644 --- a/src/wasm-lib/kcl/tests/assembly_non_default_units/other2.kcl +++ b/src/wasm-lib/kcl/tests/assembly_non_default_units/other2.kcl @@ -3,4 +3,4 @@ // Use the same units as in the main importing file. startSketchOn('XZ') - |> circle({ center = [0, 2], radius = 1 }, %) + |> circle(center = [0, 2], radius = 1) diff --git a/src/wasm-lib/kcl/tests/fillet-and-shell/artifact_commands.snap b/src/wasm-lib/kcl/tests/fillet-and-shell/artifact_commands.snap index 47d9b3f91f..b482ecf5a2 100644 --- a/src/wasm-lib/kcl/tests/fillet-and-shell/artifact_commands.snap +++ b/src/wasm-lib/kcl/tests/fillet-and-shell/artifact_commands.snap @@ -1,7 +1,6 @@ --- source: kcl/src/simulation_tests.rs description: Artifact commands fillet-and-shell.kcl -snapshot_kind: text --- [ { @@ -927,7 +926,7 @@ snapshot_kind: text "cmdId": "[uuid]", "range": [ 1370, - 1414, + 1407, 0 ], "command": { @@ -947,7 +946,7 @@ snapshot_kind: text "cmdId": "[uuid]", "range": [ 1370, - 1414, + 1407, 0 ], "command": { @@ -958,7 +957,7 @@ snapshot_kind: text "cmdId": "[uuid]", "range": [ 1370, - 1414, + 1407, 0 ], "command": { @@ -975,7 +974,7 @@ snapshot_kind: text "cmdId": "[uuid]", "range": [ 1370, - 1414, + 1407, 0 ], "command": { @@ -1004,7 +1003,7 @@ snapshot_kind: text "cmdId": "[uuid]", "range": [ 1370, - 1414, + 1407, 0 ], "command": { @@ -1015,8 +1014,8 @@ snapshot_kind: text { "cmdId": "[uuid]", "range": [ - 1427, - 1472, + 1420, + 1458, 0 ], "command": { @@ -1035,8 +1034,8 @@ snapshot_kind: text { "cmdId": "[uuid]", "range": [ - 1427, - 1472, + 1420, + 1458, 0 ], "command": { @@ -1046,8 +1045,8 @@ snapshot_kind: text { "cmdId": "[uuid]", "range": [ - 1427, - 1472, + 1420, + 1458, 0 ], "command": { @@ -1063,8 +1062,8 @@ snapshot_kind: text { "cmdId": "[uuid]", "range": [ - 1427, - 1472, + 1420, + 1458, 0 ], "command": { @@ -1092,8 +1091,8 @@ snapshot_kind: text { "cmdId": "[uuid]", "range": [ - 1427, - 1472, + 1420, + 1458, 0 ], "command": { @@ -1104,8 +1103,8 @@ snapshot_kind: text { "cmdId": "[uuid]", "range": [ - 1422, - 1476, + 1415, + 1462, 0 ], "command": { @@ -1117,8 +1116,8 @@ snapshot_kind: text { "cmdId": "[uuid]", "range": [ - 1422, - 1476, + 1415, + 1462, 0 ], "command": { @@ -1130,8 +1129,8 @@ snapshot_kind: text { "cmdId": "[uuid]", "range": [ - 1484, - 1508, + 1470, + 1494, 0 ], "command": { @@ -1150,8 +1149,8 @@ snapshot_kind: text { "cmdId": "[uuid]", "range": [ - 1484, - 1508, + 1470, + 1494, 0 ], "command": { @@ -1164,8 +1163,8 @@ snapshot_kind: text { "cmdId": "[uuid]", "range": [ - 1484, - 1508, + 1470, + 1494, 0 ], "command": { @@ -1175,8 +1174,8 @@ snapshot_kind: text { "cmdId": "[uuid]", "range": [ - 1484, - 1508, + 1470, + 1494, 0 ], "command": { @@ -1187,8 +1186,8 @@ snapshot_kind: text { "cmdId": "[uuid]", "range": [ - 1484, - 1508, + 1470, + 1494, 0 ], "command": { @@ -1200,8 +1199,8 @@ snapshot_kind: text { "cmdId": "[uuid]", "range": [ - 1484, - 1508, + 1470, + 1494, 0 ], "command": { @@ -1214,8 +1213,8 @@ snapshot_kind: text { "cmdId": "[uuid]", "range": [ - 1484, - 1508, + 1470, + 1494, 0 ], "command": { @@ -1228,8 +1227,8 @@ snapshot_kind: text { "cmdId": "[uuid]", "range": [ - 1484, - 1508, + 1470, + 1494, 0 ], "command": { @@ -1242,8 +1241,8 @@ snapshot_kind: text { "cmdId": "[uuid]", "range": [ - 1484, - 1508, + 1470, + 1494, 0 ], "command": { @@ -1334,7 +1333,7 @@ snapshot_kind: text "cmdId": "[uuid]", "range": [ 1370, - 1414, + 1407, 0 ], "command": { @@ -1354,7 +1353,7 @@ snapshot_kind: text "cmdId": "[uuid]", "range": [ 1370, - 1414, + 1407, 0 ], "command": { @@ -1365,7 +1364,7 @@ snapshot_kind: text "cmdId": "[uuid]", "range": [ 1370, - 1414, + 1407, 0 ], "command": { @@ -1382,7 +1381,7 @@ snapshot_kind: text "cmdId": "[uuid]", "range": [ 1370, - 1414, + 1407, 0 ], "command": { @@ -1411,7 +1410,7 @@ snapshot_kind: text "cmdId": "[uuid]", "range": [ 1370, - 1414, + 1407, 0 ], "command": { @@ -1422,8 +1421,8 @@ snapshot_kind: text { "cmdId": "[uuid]", "range": [ - 1427, - 1472, + 1420, + 1458, 0 ], "command": { @@ -1442,8 +1441,8 @@ snapshot_kind: text { "cmdId": "[uuid]", "range": [ - 1427, - 1472, + 1420, + 1458, 0 ], "command": { @@ -1453,8 +1452,8 @@ snapshot_kind: text { "cmdId": "[uuid]", "range": [ - 1427, - 1472, + 1420, + 1458, 0 ], "command": { @@ -1470,8 +1469,8 @@ snapshot_kind: text { "cmdId": "[uuid]", "range": [ - 1427, - 1472, + 1420, + 1458, 0 ], "command": { @@ -1499,8 +1498,8 @@ snapshot_kind: text { "cmdId": "[uuid]", "range": [ - 1427, - 1472, + 1420, + 1458, 0 ], "command": { @@ -1511,8 +1510,8 @@ snapshot_kind: text { "cmdId": "[uuid]", "range": [ - 1422, - 1476, + 1415, + 1462, 0 ], "command": { @@ -1524,8 +1523,8 @@ snapshot_kind: text { "cmdId": "[uuid]", "range": [ - 1422, - 1476, + 1415, + 1462, 0 ], "command": { @@ -1537,8 +1536,8 @@ snapshot_kind: text { "cmdId": "[uuid]", "range": [ - 1484, - 1508, + 1470, + 1494, 0 ], "command": { @@ -1557,8 +1556,8 @@ snapshot_kind: text { "cmdId": "[uuid]", "range": [ - 1484, - 1508, + 1470, + 1494, 0 ], "command": { @@ -1571,8 +1570,8 @@ snapshot_kind: text { "cmdId": "[uuid]", "range": [ - 1484, - 1508, + 1470, + 1494, 0 ], "command": { @@ -1582,8 +1581,8 @@ snapshot_kind: text { "cmdId": "[uuid]", "range": [ - 1484, - 1508, + 1470, + 1494, 0 ], "command": { @@ -1594,8 +1593,8 @@ snapshot_kind: text { "cmdId": "[uuid]", "range": [ - 1484, - 1508, + 1470, + 1494, 0 ], "command": { @@ -1607,8 +1606,8 @@ snapshot_kind: text { "cmdId": "[uuid]", "range": [ - 1484, - 1508, + 1470, + 1494, 0 ], "command": { @@ -1621,8 +1620,8 @@ snapshot_kind: text { "cmdId": "[uuid]", "range": [ - 1484, - 1508, + 1470, + 1494, 0 ], "command": { @@ -1635,8 +1634,8 @@ snapshot_kind: text { "cmdId": "[uuid]", "range": [ - 1484, - 1508, + 1470, + 1494, 0 ], "command": { @@ -1649,8 +1648,8 @@ snapshot_kind: text { "cmdId": "[uuid]", "range": [ - 1484, - 1508, + 1470, + 1494, 0 ], "command": { @@ -1741,7 +1740,7 @@ snapshot_kind: text "cmdId": "[uuid]", "range": [ 1370, - 1414, + 1407, 0 ], "command": { @@ -1761,7 +1760,7 @@ snapshot_kind: text "cmdId": "[uuid]", "range": [ 1370, - 1414, + 1407, 0 ], "command": { @@ -1772,7 +1771,7 @@ snapshot_kind: text "cmdId": "[uuid]", "range": [ 1370, - 1414, + 1407, 0 ], "command": { @@ -1789,7 +1788,7 @@ snapshot_kind: text "cmdId": "[uuid]", "range": [ 1370, - 1414, + 1407, 0 ], "command": { @@ -1818,7 +1817,7 @@ snapshot_kind: text "cmdId": "[uuid]", "range": [ 1370, - 1414, + 1407, 0 ], "command": { @@ -1829,8 +1828,8 @@ snapshot_kind: text { "cmdId": "[uuid]", "range": [ - 1427, - 1472, + 1420, + 1458, 0 ], "command": { @@ -1849,8 +1848,8 @@ snapshot_kind: text { "cmdId": "[uuid]", "range": [ - 1427, - 1472, + 1420, + 1458, 0 ], "command": { @@ -1860,8 +1859,8 @@ snapshot_kind: text { "cmdId": "[uuid]", "range": [ - 1427, - 1472, + 1420, + 1458, 0 ], "command": { @@ -1877,8 +1876,8 @@ snapshot_kind: text { "cmdId": "[uuid]", "range": [ - 1427, - 1472, + 1420, + 1458, 0 ], "command": { @@ -1906,8 +1905,8 @@ snapshot_kind: text { "cmdId": "[uuid]", "range": [ - 1427, - 1472, + 1420, + 1458, 0 ], "command": { @@ -1918,8 +1917,8 @@ snapshot_kind: text { "cmdId": "[uuid]", "range": [ - 1422, - 1476, + 1415, + 1462, 0 ], "command": { @@ -1931,8 +1930,8 @@ snapshot_kind: text { "cmdId": "[uuid]", "range": [ - 1422, - 1476, + 1415, + 1462, 0 ], "command": { @@ -1944,8 +1943,8 @@ snapshot_kind: text { "cmdId": "[uuid]", "range": [ - 1484, - 1508, + 1470, + 1494, 0 ], "command": { @@ -1964,8 +1963,8 @@ snapshot_kind: text { "cmdId": "[uuid]", "range": [ - 1484, - 1508, + 1470, + 1494, 0 ], "command": { @@ -1978,8 +1977,8 @@ snapshot_kind: text { "cmdId": "[uuid]", "range": [ - 1484, - 1508, + 1470, + 1494, 0 ], "command": { @@ -1989,8 +1988,8 @@ snapshot_kind: text { "cmdId": "[uuid]", "range": [ - 1484, - 1508, + 1470, + 1494, 0 ], "command": { @@ -2001,8 +2000,8 @@ snapshot_kind: text { "cmdId": "[uuid]", "range": [ - 1484, - 1508, + 1470, + 1494, 0 ], "command": { @@ -2014,8 +2013,8 @@ snapshot_kind: text { "cmdId": "[uuid]", "range": [ - 1484, - 1508, + 1470, + 1494, 0 ], "command": { @@ -2028,8 +2027,8 @@ snapshot_kind: text { "cmdId": "[uuid]", "range": [ - 1484, - 1508, + 1470, + 1494, 0 ], "command": { @@ -2042,8 +2041,8 @@ snapshot_kind: text { "cmdId": "[uuid]", "range": [ - 1484, - 1508, + 1470, + 1494, 0 ], "command": { @@ -2056,8 +2055,8 @@ snapshot_kind: text { "cmdId": "[uuid]", "range": [ - 1484, - 1508, + 1470, + 1494, 0 ], "command": { @@ -2148,7 +2147,7 @@ snapshot_kind: text "cmdId": "[uuid]", "range": [ 1370, - 1414, + 1407, 0 ], "command": { @@ -2168,7 +2167,7 @@ snapshot_kind: text "cmdId": "[uuid]", "range": [ 1370, - 1414, + 1407, 0 ], "command": { @@ -2179,7 +2178,7 @@ snapshot_kind: text "cmdId": "[uuid]", "range": [ 1370, - 1414, + 1407, 0 ], "command": { @@ -2196,7 +2195,7 @@ snapshot_kind: text "cmdId": "[uuid]", "range": [ 1370, - 1414, + 1407, 0 ], "command": { @@ -2225,7 +2224,7 @@ snapshot_kind: text "cmdId": "[uuid]", "range": [ 1370, - 1414, + 1407, 0 ], "command": { @@ -2236,8 +2235,8 @@ snapshot_kind: text { "cmdId": "[uuid]", "range": [ - 1427, - 1472, + 1420, + 1458, 0 ], "command": { @@ -2256,8 +2255,8 @@ snapshot_kind: text { "cmdId": "[uuid]", "range": [ - 1427, - 1472, + 1420, + 1458, 0 ], "command": { @@ -2267,8 +2266,8 @@ snapshot_kind: text { "cmdId": "[uuid]", "range": [ - 1427, - 1472, + 1420, + 1458, 0 ], "command": { @@ -2284,8 +2283,8 @@ snapshot_kind: text { "cmdId": "[uuid]", "range": [ - 1427, - 1472, + 1420, + 1458, 0 ], "command": { @@ -2313,8 +2312,8 @@ snapshot_kind: text { "cmdId": "[uuid]", "range": [ - 1427, - 1472, + 1420, + 1458, 0 ], "command": { @@ -2325,8 +2324,8 @@ snapshot_kind: text { "cmdId": "[uuid]", "range": [ - 1422, - 1476, + 1415, + 1462, 0 ], "command": { @@ -2338,8 +2337,8 @@ snapshot_kind: text { "cmdId": "[uuid]", "range": [ - 1422, - 1476, + 1415, + 1462, 0 ], "command": { @@ -2351,8 +2350,8 @@ snapshot_kind: text { "cmdId": "[uuid]", "range": [ - 1484, - 1508, + 1470, + 1494, 0 ], "command": { @@ -2371,8 +2370,8 @@ snapshot_kind: text { "cmdId": "[uuid]", "range": [ - 1484, - 1508, + 1470, + 1494, 0 ], "command": { @@ -2385,8 +2384,8 @@ snapshot_kind: text { "cmdId": "[uuid]", "range": [ - 1484, - 1508, + 1470, + 1494, 0 ], "command": { @@ -2396,8 +2395,8 @@ snapshot_kind: text { "cmdId": "[uuid]", "range": [ - 1484, - 1508, + 1470, + 1494, 0 ], "command": { @@ -2408,8 +2407,8 @@ snapshot_kind: text { "cmdId": "[uuid]", "range": [ - 1484, - 1508, + 1470, + 1494, 0 ], "command": { @@ -2421,8 +2420,8 @@ snapshot_kind: text { "cmdId": "[uuid]", "range": [ - 1484, - 1508, + 1470, + 1494, 0 ], "command": { @@ -2435,8 +2434,8 @@ snapshot_kind: text { "cmdId": "[uuid]", "range": [ - 1484, - 1508, + 1470, + 1494, 0 ], "command": { @@ -2449,8 +2448,8 @@ snapshot_kind: text { "cmdId": "[uuid]", "range": [ - 1484, - 1508, + 1470, + 1494, 0 ], "command": { @@ -2463,8 +2462,8 @@ snapshot_kind: text { "cmdId": "[uuid]", "range": [ - 1484, - 1508, + 1470, + 1494, 0 ], "command": { @@ -2541,8 +2540,8 @@ snapshot_kind: text { "cmdId": "[uuid]", "range": [ - 2043, - 2098, + 2029, + 2084, 0 ], "command": { diff --git a/src/wasm-lib/kcl/tests/fillet-and-shell/artifact_graph_flowchart.snap.md b/src/wasm-lib/kcl/tests/fillet-and-shell/artifact_graph_flowchart.snap.md index 0d1f810da7..55afb84a77 100644 --- a/src/wasm-lib/kcl/tests/fillet-and-shell/artifact_graph_flowchart.snap.md +++ b/src/wasm-lib/kcl/tests/fillet-and-shell/artifact_graph_flowchart.snap.md @@ -20,52 +20,52 @@ flowchart LR 31["Path
[1337, 1362, 0]"] end subgraph path32 [Path] - 32["Path
[1370, 1414, 0]"] - 33["Segment
[1370, 1414, 0]"] + 32["Path
[1370, 1407, 0]"] + 33["Segment
[1370, 1407, 0]"] 34[Solid2d] end subgraph path35 [Path] - 35["Path
[1427, 1472, 0]"] - 36["Segment
[1427, 1472, 0]"] + 35["Path
[1420, 1458, 0]"] + 36["Segment
[1420, 1458, 0]"] 37[Solid2d] end subgraph path45 [Path] 45["Path
[1337, 1362, 0]"] end subgraph path46 [Path] - 46["Path
[1370, 1414, 0]"] - 47["Segment
[1370, 1414, 0]"] + 46["Path
[1370, 1407, 0]"] + 47["Segment
[1370, 1407, 0]"] 48[Solid2d] end subgraph path49 [Path] - 49["Path
[1427, 1472, 0]"] - 50["Segment
[1427, 1472, 0]"] + 49["Path
[1420, 1458, 0]"] + 50["Segment
[1420, 1458, 0]"] 51[Solid2d] end subgraph path59 [Path] 59["Path
[1337, 1362, 0]"] end subgraph path60 [Path] - 60["Path
[1370, 1414, 0]"] - 61["Segment
[1370, 1414, 0]"] + 60["Path
[1370, 1407, 0]"] + 61["Segment
[1370, 1407, 0]"] 62[Solid2d] end subgraph path63 [Path] - 63["Path
[1427, 1472, 0]"] - 64["Segment
[1427, 1472, 0]"] + 63["Path
[1420, 1458, 0]"] + 64["Segment
[1420, 1458, 0]"] 65[Solid2d] end subgraph path73 [Path] 73["Path
[1337, 1362, 0]"] end subgraph path74 [Path] - 74["Path
[1370, 1414, 0]"] - 75["Segment
[1370, 1414, 0]"] + 74["Path
[1370, 1407, 0]"] + 75["Segment
[1370, 1407, 0]"] 76[Solid2d] end subgraph path77 [Path] - 77["Path
[1427, 1472, 0]"] - 78["Segment
[1427, 1472, 0]"] + 77["Path
[1420, 1458, 0]"] + 78["Segment
[1420, 1458, 0]"] 79[Solid2d] end 1["Plane
[373, 461, 0]"] @@ -86,28 +86,28 @@ flowchart LR 28["SweepEdge Opposite"] 29["SweepEdge Adjacent"] 30["Plane
[1310, 1329, 0]"] - 38["Sweep Extrusion
[1484, 1508, 0]"] + 38["Sweep Extrusion
[1470, 1494, 0]"] 39[Wall] 40["Cap Start"] 41["Cap End"] 42["SweepEdge Opposite"] 43["SweepEdge Adjacent"] 44["Plane
[1310, 1329, 0]"] - 52["Sweep Extrusion
[1484, 1508, 0]"] + 52["Sweep Extrusion
[1470, 1494, 0]"] 53[Wall] 54["Cap Start"] 55["Cap End"] 56["SweepEdge Opposite"] 57["SweepEdge Adjacent"] 58["Plane
[1310, 1329, 0]"] - 66["Sweep Extrusion
[1484, 1508, 0]"] + 66["Sweep Extrusion
[1470, 1494, 0]"] 67[Wall] 68["Cap Start"] 69["Cap End"] 70["SweepEdge Opposite"] 71["SweepEdge Adjacent"] 72["Plane
[1310, 1329, 0]"] - 80["Sweep Extrusion
[1484, 1508, 0]"] + 80["Sweep Extrusion
[1470, 1494, 0]"] 81[Wall] 82["Cap Start"] 83["Cap End"] diff --git a/src/wasm-lib/kcl/tests/fillet-and-shell/ast.snap b/src/wasm-lib/kcl/tests/fillet-and-shell/ast.snap index a5c6352bad..4b401d0653 100644 --- a/src/wasm-lib/kcl/tests/fillet-and-shell/ast.snap +++ b/src/wasm-lib/kcl/tests/fillet-and-shell/ast.snap @@ -1,7 +1,6 @@ --- source: kcl/src/simulation_tests.rs description: Result of parsing fillet-and-shell.kcl -snapshot_kind: text --- { "Ok": { @@ -1430,7 +1429,7 @@ snapshot_kind: text }, { "declaration": { - "end": 1525, + "end": 1511, "id": { "end": 1283, "name": "m25Screw", @@ -1442,7 +1441,7 @@ snapshot_kind: text "body": [ { "declaration": { - "end": 1508, + "end": 1494, "id": { "end": 1307, "name": "screw", @@ -1526,73 +1525,51 @@ snapshot_kind: text { "arguments": [ { - "end": 1410, - "properties": [ - { - "end": 1394, - "key": { - "end": 1385, - "name": "center", - "start": 1379, + "type": "LabeledArg", + "label": { + "type": "Identifier", + "name": "center" + }, + "arg": { + "elements": [ + { + "end": 1388, + "name": "x", + "start": 1387, + "type": "Identifier", "type": "Identifier" }, - "start": 1379, - "type": "ObjectProperty", - "value": { - "elements": [ - { - "end": 1390, - "name": "x", - "start": 1389, - "type": "Identifier", - "type": "Identifier" - }, - { - "end": 1393, - "name": "y", - "start": 1392, - "type": "Identifier", - "type": "Identifier" - } - ], - "end": 1394, - "start": 1388, - "type": "ArrayExpression", - "type": "ArrayExpression" - } - }, - { - "end": 1408, - "key": { - "end": 1402, - "name": "radius", - "start": 1396, + { + "end": 1391, + "name": "y", + "start": 1390, + "type": "Identifier", "type": "Identifier" - }, - "start": 1396, - "type": "ObjectProperty", - "value": { - "end": 1408, - "raw": "2.5", - "start": 1405, - "type": "Literal", - "type": "Literal", - "value": { - "value": 2.5, - "suffix": "None" - } } - } - ], - "start": 1377, - "type": "ObjectExpression", - "type": "ObjectExpression" + ], + "end": 1392, + "start": 1386, + "type": "ArrayExpression", + "type": "ArrayExpression" + } }, { - "end": 1413, - "start": 1412, - "type": "PipeSubstitution", - "type": "PipeSubstitution" + "type": "LabeledArg", + "label": { + "type": "Identifier", + "name": "radius" + }, + "arg": { + "end": 1406, + "raw": "2.5", + "start": 1403, + "type": "Literal", + "type": "Literal", + "value": { + "value": 2.5, + "suffix": "None" + } + } } ], "callee": { @@ -1601,111 +1578,91 @@ snapshot_kind: text "start": 1370, "type": "Identifier" }, - "end": 1414, + "end": 1407, "start": 1370, - "type": "CallExpression", - "type": "CallExpression" + "type": "CallExpressionKw", + "type": "CallExpressionKw", + "unlabeled": null }, { "arguments": [ { "arguments": [ { - "end": 1468, - "properties": [ - { - "end": 1451, - "key": { - "end": 1442, - "name": "center", - "start": 1436, + "type": "LabeledArg", + "label": { + "type": "Identifier", + "name": "center" + }, + "arg": { + "elements": [ + { + "end": 1438, + "name": "x", + "start": 1437, + "type": "Identifier", "type": "Identifier" }, - "start": 1436, - "type": "ObjectProperty", - "value": { - "elements": [ - { - "end": 1447, - "name": "x", - "start": 1446, - "type": "Identifier", - "type": "Identifier" - }, - { - "end": 1450, - "name": "y", - "start": 1449, - "type": "Identifier", - "type": "Identifier" - } - ], - "end": 1451, - "start": 1445, - "type": "ArrayExpression", - "type": "ArrayExpression" - } - }, - { - "end": 1466, - "key": { - "end": 1459, - "name": "radius", - "start": 1453, + { + "end": 1441, + "name": "y", + "start": 1440, + "type": "Identifier", "type": "Identifier" - }, - "start": 1453, - "type": "ObjectProperty", - "value": { - "end": 1466, - "raw": "1.25", - "start": 1462, - "type": "Literal", - "type": "Literal", - "value": { - "value": 1.25, - "suffix": "None" - } } - } - ], - "start": 1434, - "type": "ObjectExpression", - "type": "ObjectExpression" + ], + "end": 1442, + "start": 1436, + "type": "ArrayExpression", + "type": "ArrayExpression" + } }, { - "end": 1471, - "start": 1470, - "type": "PipeSubstitution", - "type": "PipeSubstitution" + "type": "LabeledArg", + "label": { + "type": "Identifier", + "name": "radius" + }, + "arg": { + "end": 1457, + "raw": "1.25", + "start": 1453, + "type": "Literal", + "type": "Literal", + "value": { + "value": 1.25, + "suffix": "None" + } + } } ], "callee": { - "end": 1433, + "end": 1426, "name": "circle", - "start": 1427, + "start": 1420, "type": "Identifier" }, - "end": 1472, - "start": 1427, - "type": "CallExpression", - "type": "CallExpression" + "end": 1458, + "start": 1420, + "type": "CallExpressionKw", + "type": "CallExpressionKw", + "unlabeled": null }, { - "end": 1475, - "start": 1474, + "end": 1461, + "start": 1460, "type": "PipeSubstitution", "type": "PipeSubstitution" } ], "callee": { - "end": 1426, + "end": 1419, "name": "hole", - "start": 1422, + "start": 1415, "type": "Identifier" }, - "end": 1476, - "start": 1422, + "end": 1462, + "start": 1415, "type": "CallExpression", "type": "CallExpression" }, @@ -1718,28 +1675,28 @@ snapshot_kind: text "name": "length" }, "arg": { - "end": 1507, + "end": 1493, "name": "height", - "start": 1501, + "start": 1487, "type": "Identifier", "type": "Identifier" } } ], "callee": { - "end": 1491, + "end": 1477, "name": "extrude", - "start": 1484, + "start": 1470, "type": "Identifier" }, - "end": 1508, - "start": 1484, + "end": 1494, + "start": 1470, "type": "CallExpressionKw", "type": "CallExpressionKw", "unlabeled": null } ], - "end": 1508, + "end": 1494, "start": 1310, "type": "PipeExpression", "type": "PipeExpression" @@ -1747,7 +1704,7 @@ snapshot_kind: text "start": 1302, "type": "VariableDeclarator" }, - "end": 1508, + "end": 1494, "kind": "const", "start": 1302, "type": "VariableDeclaration", @@ -1755,22 +1712,22 @@ snapshot_kind: text }, { "argument": { - "end": 1523, + "end": 1509, "name": "screw", - "start": 1518, + "start": 1504, "type": "Identifier", "type": "Identifier" }, - "end": 1523, - "start": 1511, + "end": 1509, + "start": 1497, "type": "ReturnStatement", "type": "ReturnStatement" } ], - "end": 1525, + "end": 1511, "start": 1298 }, - "end": 1525, + "end": 1511, "params": [ { "type": "Parameter", @@ -1807,42 +1764,42 @@ snapshot_kind: text "start": 1275, "type": "VariableDeclarator" }, - "end": 1525, + "end": 1511, "kind": "fn", "start": 1272, "type": "VariableDeclaration", "type": "VariableDeclaration" }, { - "end": 1656, + "end": 1642, "expression": { "arguments": [ { - "end": 1584, + "end": 1570, "left": { - "end": 1558, + "end": 1544, "left": { - "end": 1542, + "end": 1528, "name": "border", - "start": 1536, + "start": 1522, "type": "Identifier", "type": "Identifier" }, "operator": "+", "right": { - "end": 1558, + "end": 1544, "left": { - "end": 1554, + "end": 1540, "name": "rpizWidth", - "start": 1545, + "start": 1531, "type": "Identifier", "type": "Identifier" }, "operator": "/", "right": { - "end": 1558, + "end": 1544, "raw": "2", - "start": 1557, + "start": 1543, "type": "Literal", "type": "Literal", "value": { @@ -1850,29 +1807,29 @@ snapshot_kind: text "suffix": "None" } }, - "start": 1545, + "start": 1531, "type": "BinaryExpression", "type": "BinaryExpression" }, - "start": 1536, + "start": 1522, "type": "BinaryExpression", "type": "BinaryExpression" }, "operator": "-", "right": { - "end": 1584, + "end": 1570, "left": { - "end": 1580, + "end": 1566, "name": "widthBetweenScrews", - "start": 1562, + "start": 1548, "type": "Identifier", "type": "Identifier" }, "operator": "/", "right": { - "end": 1584, + "end": 1570, "raw": "2", - "start": 1583, + "start": 1569, "type": "Literal", "type": "Literal", "value": { @@ -1880,24 +1837,24 @@ snapshot_kind: text "suffix": "None" } }, - "start": 1562, + "start": 1548, "type": "BinaryExpression", "type": "BinaryExpression" }, - "start": 1536, + "start": 1522, "type": "BinaryExpression", "type": "BinaryExpression" }, { - "end": 1641, + "end": 1627, "left": { - "end": 1614, + "end": 1600, "left": { - "end": 1597, + "end": 1583, "left": { - "end": 1588, + "end": 1574, "raw": "0", - "start": 1587, + "start": 1573, "type": "Literal", "type": "Literal", "value": { @@ -1907,31 +1864,31 @@ snapshot_kind: text }, "operator": "+", "right": { - "end": 1597, + "end": 1583, "name": "border", - "start": 1591, + "start": 1577, "type": "Identifier", "type": "Identifier" }, - "start": 1587, + "start": 1573, "type": "BinaryExpression", "type": "BinaryExpression" }, "operator": "+", "right": { - "end": 1614, + "end": 1600, "left": { - "end": 1610, + "end": 1596, "name": "rpizLength", - "start": 1600, + "start": 1586, "type": "Identifier", "type": "Identifier" }, "operator": "/", "right": { - "end": 1614, + "end": 1600, "raw": "2", - "start": 1613, + "start": 1599, "type": "Literal", "type": "Literal", "value": { @@ -1939,29 +1896,29 @@ snapshot_kind: text "suffix": "None" } }, - "start": 1600, + "start": 1586, "type": "BinaryExpression", "type": "BinaryExpression" }, - "start": 1587, + "start": 1573, "type": "BinaryExpression", "type": "BinaryExpression" }, "operator": "-", "right": { - "end": 1641, + "end": 1627, "left": { - "end": 1637, + "end": 1623, "name": "lengthBetweenScrews", - "start": 1618, + "start": 1604, "type": "Identifier", "type": "Identifier" }, "operator": "/", "right": { - "end": 1641, + "end": 1627, "raw": "2", - "start": 1640, + "start": 1626, "type": "Literal", "type": "Literal", "value": { @@ -1969,67 +1926,67 @@ snapshot_kind: text "suffix": "None" } }, - "start": 1618, + "start": 1604, "type": "BinaryExpression", "type": "BinaryExpression" }, - "start": 1587, + "start": 1573, "type": "BinaryExpression", "type": "BinaryExpression" }, { - "end": 1655, + "end": 1641, "name": "screwHeight", - "start": 1644, + "start": 1630, "type": "Identifier", "type": "Identifier" } ], "callee": { - "end": 1535, + "end": 1521, "name": "m25Screw", - "start": 1527, + "start": 1513, "type": "Identifier" }, - "end": 1656, - "start": 1527, + "end": 1642, + "start": 1513, "type": "CallExpression", "type": "CallExpression" }, - "start": 1527, + "start": 1513, "type": "ExpressionStatement", "type": "ExpressionStatement" }, { - "end": 1785, + "end": 1771, "expression": { "arguments": [ { - "end": 1715, + "end": 1701, "left": { - "end": 1689, + "end": 1675, "left": { - "end": 1673, + "end": 1659, "name": "border", - "start": 1667, + "start": 1653, "type": "Identifier", "type": "Identifier" }, "operator": "+", "right": { - "end": 1689, + "end": 1675, "left": { - "end": 1685, + "end": 1671, "name": "rpizWidth", - "start": 1676, + "start": 1662, "type": "Identifier", "type": "Identifier" }, "operator": "/", "right": { - "end": 1689, + "end": 1675, "raw": "2", - "start": 1688, + "start": 1674, "type": "Literal", "type": "Literal", "value": { @@ -2037,29 +1994,29 @@ snapshot_kind: text "suffix": "None" } }, - "start": 1676, + "start": 1662, "type": "BinaryExpression", "type": "BinaryExpression" }, - "start": 1667, + "start": 1653, "type": "BinaryExpression", "type": "BinaryExpression" }, "operator": "-", "right": { - "end": 1715, + "end": 1701, "left": { - "end": 1711, + "end": 1697, "name": "widthBetweenScrews", - "start": 1693, + "start": 1679, "type": "Identifier", "type": "Identifier" }, "operator": "/", "right": { - "end": 1715, + "end": 1701, "raw": "2", - "start": 1714, + "start": 1700, "type": "Literal", "type": "Literal", "value": { @@ -2067,24 +2024,24 @@ snapshot_kind: text "suffix": "None" } }, - "start": 1693, + "start": 1679, "type": "BinaryExpression", "type": "BinaryExpression" }, - "start": 1667, + "start": 1653, "type": "BinaryExpression", "type": "BinaryExpression" }, { - "end": 1771, + "end": 1757, "left": { - "end": 1745, + "end": 1731, "left": { - "end": 1728, + "end": 1714, "left": { - "end": 1719, + "end": 1705, "raw": "0", - "start": 1718, + "start": 1704, "type": "Literal", "type": "Literal", "value": { @@ -2094,31 +2051,31 @@ snapshot_kind: text }, "operator": "+", "right": { - "end": 1728, + "end": 1714, "name": "border", - "start": 1722, + "start": 1708, "type": "Identifier", "type": "Identifier" }, - "start": 1718, + "start": 1704, "type": "BinaryExpression", "type": "BinaryExpression" }, "operator": "+", "right": { - "end": 1745, + "end": 1731, "left": { - "end": 1741, + "end": 1727, "name": "rpizLength", - "start": 1731, + "start": 1717, "type": "Identifier", "type": "Identifier" }, "operator": "/", "right": { - "end": 1745, + "end": 1731, "raw": "2", - "start": 1744, + "start": 1730, "type": "Literal", "type": "Literal", "value": { @@ -2126,29 +2083,29 @@ snapshot_kind: text "suffix": "None" } }, - "start": 1731, + "start": 1717, "type": "BinaryExpression", "type": "BinaryExpression" }, - "start": 1718, + "start": 1704, "type": "BinaryExpression", "type": "BinaryExpression" }, "operator": "+", "right": { - "end": 1771, + "end": 1757, "left": { - "end": 1767, + "end": 1753, "name": "lengthBetweenScrews", - "start": 1748, + "start": 1734, "type": "Identifier", "type": "Identifier" }, "operator": "/", "right": { - "end": 1771, + "end": 1757, "raw": "2", - "start": 1770, + "start": 1756, "type": "Literal", "type": "Literal", "value": { @@ -2156,67 +2113,67 @@ snapshot_kind: text "suffix": "None" } }, - "start": 1748, + "start": 1734, "type": "BinaryExpression", "type": "BinaryExpression" }, - "start": 1718, + "start": 1704, "type": "BinaryExpression", "type": "BinaryExpression" }, { - "end": 1784, + "end": 1770, "name": "screwHeight", - "start": 1773, + "start": 1759, "type": "Identifier", "type": "Identifier" } ], "callee": { - "end": 1666, + "end": 1652, "name": "m25Screw", - "start": 1658, + "start": 1644, "type": "Identifier" }, - "end": 1785, - "start": 1658, + "end": 1771, + "start": 1644, "type": "CallExpression", "type": "CallExpression" }, - "start": 1658, + "start": 1644, "type": "ExpressionStatement", "type": "ExpressionStatement" }, { - "end": 1912, + "end": 1898, "expression": { "arguments": [ { - "end": 1843, + "end": 1829, "left": { - "end": 1818, + "end": 1804, "left": { - "end": 1802, + "end": 1788, "name": "border", - "start": 1796, + "start": 1782, "type": "Identifier", "type": "Identifier" }, "operator": "+", "right": { - "end": 1818, + "end": 1804, "left": { - "end": 1814, + "end": 1800, "name": "rpizWidth", - "start": 1805, + "start": 1791, "type": "Identifier", "type": "Identifier" }, "operator": "/", "right": { - "end": 1818, + "end": 1804, "raw": "2", - "start": 1817, + "start": 1803, "type": "Literal", "type": "Literal", "value": { @@ -2224,29 +2181,29 @@ snapshot_kind: text "suffix": "None" } }, - "start": 1805, + "start": 1791, "type": "BinaryExpression", "type": "BinaryExpression" }, - "start": 1796, + "start": 1782, "type": "BinaryExpression", "type": "BinaryExpression" }, "operator": "+", "right": { - "end": 1843, + "end": 1829, "left": { - "end": 1839, + "end": 1825, "name": "widthBetweenScrews", - "start": 1821, + "start": 1807, "type": "Identifier", "type": "Identifier" }, "operator": "/", "right": { - "end": 1843, + "end": 1829, "raw": "2", - "start": 1842, + "start": 1828, "type": "Literal", "type": "Literal", "value": { @@ -2254,24 +2211,24 @@ snapshot_kind: text "suffix": "None" } }, - "start": 1821, + "start": 1807, "type": "BinaryExpression", "type": "BinaryExpression" }, - "start": 1796, + "start": 1782, "type": "BinaryExpression", "type": "BinaryExpression" }, { - "end": 1898, + "end": 1884, "left": { - "end": 1872, + "end": 1858, "left": { - "end": 1855, + "end": 1841, "left": { - "end": 1846, + "end": 1832, "raw": "0", - "start": 1845, + "start": 1831, "type": "Literal", "type": "Literal", "value": { @@ -2281,31 +2238,31 @@ snapshot_kind: text }, "operator": "+", "right": { - "end": 1855, + "end": 1841, "name": "border", - "start": 1849, + "start": 1835, "type": "Identifier", "type": "Identifier" }, - "start": 1845, + "start": 1831, "type": "BinaryExpression", "type": "BinaryExpression" }, "operator": "+", "right": { - "end": 1872, + "end": 1858, "left": { - "end": 1868, + "end": 1854, "name": "rpizLength", - "start": 1858, + "start": 1844, "type": "Identifier", "type": "Identifier" }, "operator": "/", "right": { - "end": 1872, + "end": 1858, "raw": "2", - "start": 1871, + "start": 1857, "type": "Literal", "type": "Literal", "value": { @@ -2313,29 +2270,29 @@ snapshot_kind: text "suffix": "None" } }, - "start": 1858, + "start": 1844, "type": "BinaryExpression", "type": "BinaryExpression" }, - "start": 1845, + "start": 1831, "type": "BinaryExpression", "type": "BinaryExpression" }, "operator": "+", "right": { - "end": 1898, + "end": 1884, "left": { - "end": 1894, + "end": 1880, "name": "lengthBetweenScrews", - "start": 1875, + "start": 1861, "type": "Identifier", "type": "Identifier" }, "operator": "/", "right": { - "end": 1898, + "end": 1884, "raw": "2", - "start": 1897, + "start": 1883, "type": "Literal", "type": "Literal", "value": { @@ -2343,67 +2300,67 @@ snapshot_kind: text "suffix": "None" } }, - "start": 1875, + "start": 1861, "type": "BinaryExpression", "type": "BinaryExpression" }, - "start": 1845, + "start": 1831, "type": "BinaryExpression", "type": "BinaryExpression" }, { - "end": 1911, + "end": 1897, "name": "screwHeight", - "start": 1900, + "start": 1886, "type": "Identifier", "type": "Identifier" } ], "callee": { - "end": 1795, + "end": 1781, "name": "m25Screw", - "start": 1787, + "start": 1773, "type": "Identifier" }, - "end": 1912, - "start": 1787, + "end": 1898, + "start": 1773, "type": "CallExpression", "type": "CallExpression" }, - "start": 1787, + "start": 1773, "type": "ExpressionStatement", "type": "ExpressionStatement" }, { - "end": 2041, + "end": 2027, "expression": { "arguments": [ { - "end": 1970, + "end": 1956, "left": { - "end": 1945, + "end": 1931, "left": { - "end": 1929, + "end": 1915, "name": "border", - "start": 1923, + "start": 1909, "type": "Identifier", "type": "Identifier" }, "operator": "+", "right": { - "end": 1945, + "end": 1931, "left": { - "end": 1941, + "end": 1927, "name": "rpizWidth", - "start": 1932, + "start": 1918, "type": "Identifier", "type": "Identifier" }, "operator": "/", "right": { - "end": 1945, + "end": 1931, "raw": "2", - "start": 1944, + "start": 1930, "type": "Literal", "type": "Literal", "value": { @@ -2411,29 +2368,29 @@ snapshot_kind: text "suffix": "None" } }, - "start": 1932, + "start": 1918, "type": "BinaryExpression", "type": "BinaryExpression" }, - "start": 1923, + "start": 1909, "type": "BinaryExpression", "type": "BinaryExpression" }, "operator": "+", "right": { - "end": 1970, + "end": 1956, "left": { - "end": 1966, + "end": 1952, "name": "widthBetweenScrews", - "start": 1948, + "start": 1934, "type": "Identifier", "type": "Identifier" }, "operator": "/", "right": { - "end": 1970, + "end": 1956, "raw": "2", - "start": 1969, + "start": 1955, "type": "Literal", "type": "Literal", "value": { @@ -2441,24 +2398,24 @@ snapshot_kind: text "suffix": "None" } }, - "start": 1948, + "start": 1934, "type": "BinaryExpression", "type": "BinaryExpression" }, - "start": 1923, + "start": 1909, "type": "BinaryExpression", "type": "BinaryExpression" }, { - "end": 2026, + "end": 2012, "left": { - "end": 1999, + "end": 1985, "left": { - "end": 1982, + "end": 1968, "left": { - "end": 1973, + "end": 1959, "raw": "0", - "start": 1972, + "start": 1958, "type": "Literal", "type": "Literal", "value": { @@ -2468,31 +2425,31 @@ snapshot_kind: text }, "operator": "+", "right": { - "end": 1982, + "end": 1968, "name": "border", - "start": 1976, + "start": 1962, "type": "Identifier", "type": "Identifier" }, - "start": 1972, + "start": 1958, "type": "BinaryExpression", "type": "BinaryExpression" }, "operator": "+", "right": { - "end": 1999, + "end": 1985, "left": { - "end": 1995, + "end": 1981, "name": "rpizLength", - "start": 1985, + "start": 1971, "type": "Identifier", "type": "Identifier" }, "operator": "/", "right": { - "end": 1999, + "end": 1985, "raw": "2", - "start": 1998, + "start": 1984, "type": "Literal", "type": "Literal", "value": { @@ -2500,29 +2457,29 @@ snapshot_kind: text "suffix": "None" } }, - "start": 1985, + "start": 1971, "type": "BinaryExpression", "type": "BinaryExpression" }, - "start": 1972, + "start": 1958, "type": "BinaryExpression", "type": "BinaryExpression" }, "operator": "-", "right": { - "end": 2026, + "end": 2012, "left": { - "end": 2022, + "end": 2008, "name": "lengthBetweenScrews", - "start": 2003, + "start": 1989, "type": "Identifier", "type": "Identifier" }, "operator": "/", "right": { - "end": 2026, + "end": 2012, "raw": "2", - "start": 2025, + "start": 2011, "type": "Literal", "type": "Literal", "value": { @@ -2530,39 +2487,39 @@ snapshot_kind: text "suffix": "None" } }, - "start": 2003, + "start": 1989, "type": "BinaryExpression", "type": "BinaryExpression" }, - "start": 1972, + "start": 1958, "type": "BinaryExpression", "type": "BinaryExpression" }, { - "end": 2040, + "end": 2026, "name": "screwHeight", - "start": 2029, + "start": 2015, "type": "Identifier", "type": "Identifier" } ], "callee": { - "end": 1922, + "end": 1908, "name": "m25Screw", - "start": 1914, + "start": 1900, "type": "Identifier" }, - "end": 2041, - "start": 1914, + "end": 2027, + "start": 1900, "type": "CallExpression", "type": "CallExpression" }, - "start": 1914, + "start": 1900, "type": "ExpressionStatement", "type": "ExpressionStatement" }, { - "end": 2098, + "end": 2084, "expression": { "arguments": [ { @@ -2574,16 +2531,16 @@ snapshot_kind: text "arg": { "elements": [ { - "end": 2069, + "end": 2055, "raw": "'end'", - "start": 2064, + "start": 2050, "type": "Literal", "type": "Literal", "value": "end" } ], - "end": 2070, - "start": 2063, + "end": 2056, + "start": 2049, "type": "ArrayExpression", "type": "ArrayExpression" } @@ -2595,38 +2552,38 @@ snapshot_kind: text "name": "thickness" }, "arg": { - "end": 2097, + "end": 2083, "name": "caseThickness", - "start": 2084, + "start": 2070, "type": "Identifier", "type": "Identifier" } } ], "callee": { - "end": 2048, + "end": 2034, "name": "shell", - "start": 2043, + "start": 2029, "type": "Identifier" }, - "end": 2098, - "start": 2043, + "end": 2084, + "start": 2029, "type": "CallExpressionKw", "type": "CallExpressionKw", "unlabeled": { - "end": 2053, + "end": 2039, "name": "case", - "start": 2049, + "start": 2035, "type": "Identifier", "type": "Identifier" } }, - "start": 2043, + "start": 2029, "type": "ExpressionStatement", "type": "ExpressionStatement" } ], - "end": 2099, + "end": 2085, "nonCodeMeta": { "nonCodeNodes": { "1": [ @@ -2731,8 +2688,8 @@ snapshot_kind: text ], "18": [ { - "end": 1527, - "start": 1525, + "end": 1513, + "start": 1511, "type": "NonCodeNode", "value": { "type": "newLine" @@ -2741,8 +2698,8 @@ snapshot_kind: text ], "19": [ { - "end": 1658, - "start": 1656, + "end": 1644, + "start": 1642, "type": "NonCodeNode", "value": { "type": "newLine" @@ -2751,8 +2708,8 @@ snapshot_kind: text ], "20": [ { - "end": 1787, - "start": 1785, + "end": 1773, + "start": 1771, "type": "NonCodeNode", "value": { "type": "newLine" @@ -2761,8 +2718,8 @@ snapshot_kind: text ], "21": [ { - "end": 1914, - "start": 1912, + "end": 1900, + "start": 1898, "type": "NonCodeNode", "value": { "type": "newLine" @@ -2771,8 +2728,8 @@ snapshot_kind: text ], "22": [ { - "end": 2043, - "start": 2041, + "end": 2029, + "start": 2027, "type": "NonCodeNode", "value": { "type": "newLine" diff --git a/src/wasm-lib/kcl/tests/fillet-and-shell/input.kcl b/src/wasm-lib/kcl/tests/fillet-and-shell/input.kcl index 375502cd31..d5b66fe833 100644 --- a/src/wasm-lib/kcl/tests/fillet-and-shell/input.kcl +++ b/src/wasm-lib/kcl/tests/fillet-and-shell/input.kcl @@ -60,8 +60,8 @@ case = startSketchOn('XY') fn m25Screw(x, y, height) { screw = startSketchOn("XY") |> startProfileAt([0, 0], %) - |> circle({ center = [x, y], radius = 2.5 }, %) - |> hole(circle({ center = [x, y], radius = 1.25 }, %), %) + |> circle(center = [x, y], radius = 2.5) + |> hole(circle(center = [x, y], radius = 1.25), %) |> extrude(length = height) return screw } diff --git a/src/wasm-lib/kcl/tests/fillet-and-shell/ops.snap b/src/wasm-lib/kcl/tests/fillet-and-shell/ops.snap index 35b745330e..83392a1902 100644 --- a/src/wasm-lib/kcl/tests/fillet-and-shell/ops.snap +++ b/src/wasm-lib/kcl/tests/fillet-and-shell/ops.snap @@ -147,14 +147,14 @@ description: Operations executed fillet-and-shell.kcl "name": "m25Screw", "functionSourceRange": [ 1283, - 1525, + 1511, 0 ], "unlabeledArg": null, "labeledArgs": {}, "sourceRange": [ - 1527, - 1656, + 1513, + 1642, 0 ] }, @@ -191,8 +191,8 @@ description: Operations executed fillet-and-shell.kcl } }, "sourceRange": [ - 1427, - 1472, + 1420, + 1458, 0 ] }, @@ -204,16 +204,16 @@ description: Operations executed fillet-and-shell.kcl } }, "sourceRange": [ - 1474, - 1475, + 1460, + 1461, 0 ] } }, "name": "hole", "sourceRange": [ - 1422, - 1476, + 1415, + 1462, 0 ], "type": "StdLibCall", @@ -236,16 +236,16 @@ description: Operations executed fillet-and-shell.kcl } }, "sourceRange": [ - 1501, - 1507, + 1487, + 1493, 0 ] } }, "name": "extrude", "sourceRange": [ - 1484, - 1508, + 1470, + 1494, 0 ], "type": "StdLibCall", @@ -271,14 +271,14 @@ description: Operations executed fillet-and-shell.kcl "name": "m25Screw", "functionSourceRange": [ 1283, - 1525, + 1511, 0 ], "unlabeledArg": null, "labeledArgs": {}, "sourceRange": [ - 1658, - 1785, + 1644, + 1771, 0 ] }, @@ -315,8 +315,8 @@ description: Operations executed fillet-and-shell.kcl } }, "sourceRange": [ - 1427, - 1472, + 1420, + 1458, 0 ] }, @@ -328,16 +328,16 @@ description: Operations executed fillet-and-shell.kcl } }, "sourceRange": [ - 1474, - 1475, + 1460, + 1461, 0 ] } }, "name": "hole", "sourceRange": [ - 1422, - 1476, + 1415, + 1462, 0 ], "type": "StdLibCall", @@ -360,16 +360,16 @@ description: Operations executed fillet-and-shell.kcl } }, "sourceRange": [ - 1501, - 1507, + 1487, + 1493, 0 ] } }, "name": "extrude", "sourceRange": [ - 1484, - 1508, + 1470, + 1494, 0 ], "type": "StdLibCall", @@ -395,14 +395,14 @@ description: Operations executed fillet-and-shell.kcl "name": "m25Screw", "functionSourceRange": [ 1283, - 1525, + 1511, 0 ], "unlabeledArg": null, "labeledArgs": {}, "sourceRange": [ - 1787, - 1912, + 1773, + 1898, 0 ] }, @@ -439,8 +439,8 @@ description: Operations executed fillet-and-shell.kcl } }, "sourceRange": [ - 1427, - 1472, + 1420, + 1458, 0 ] }, @@ -452,16 +452,16 @@ description: Operations executed fillet-and-shell.kcl } }, "sourceRange": [ - 1474, - 1475, + 1460, + 1461, 0 ] } }, "name": "hole", "sourceRange": [ - 1422, - 1476, + 1415, + 1462, 0 ], "type": "StdLibCall", @@ -484,16 +484,16 @@ description: Operations executed fillet-and-shell.kcl } }, "sourceRange": [ - 1501, - 1507, + 1487, + 1493, 0 ] } }, "name": "extrude", "sourceRange": [ - 1484, - 1508, + 1470, + 1494, 0 ], "type": "StdLibCall", @@ -519,14 +519,14 @@ description: Operations executed fillet-and-shell.kcl "name": "m25Screw", "functionSourceRange": [ 1283, - 1525, + 1511, 0 ], "unlabeledArg": null, "labeledArgs": {}, "sourceRange": [ - 1914, - 2041, + 1900, + 2027, 0 ] }, @@ -563,8 +563,8 @@ description: Operations executed fillet-and-shell.kcl } }, "sourceRange": [ - 1427, - 1472, + 1420, + 1458, 0 ] }, @@ -576,16 +576,16 @@ description: Operations executed fillet-and-shell.kcl } }, "sourceRange": [ - 1474, - 1475, + 1460, + 1461, 0 ] } }, "name": "hole", "sourceRange": [ - 1422, - 1476, + 1415, + 1462, 0 ], "type": "StdLibCall", @@ -608,16 +608,16 @@ description: Operations executed fillet-and-shell.kcl } }, "sourceRange": [ - 1501, - 1507, + 1487, + 1493, 0 ] } }, "name": "extrude", "sourceRange": [ - 1484, - 1508, + 1470, + 1494, 0 ], "type": "StdLibCall", @@ -651,8 +651,8 @@ description: Operations executed fillet-and-shell.kcl ] }, "sourceRange": [ - 2063, - 2070, + 2049, + 2056, 0 ] }, @@ -671,16 +671,16 @@ description: Operations executed fillet-and-shell.kcl } }, "sourceRange": [ - 2084, - 2097, + 2070, + 2083, 0 ] } }, "name": "shell", "sourceRange": [ - 2043, - 2098, + 2029, + 2084, 0 ], "type": "StdLibCall", @@ -692,8 +692,8 @@ description: Operations executed fillet-and-shell.kcl } }, "sourceRange": [ - 2049, - 2053, + 2035, + 2039, 0 ] } diff --git a/src/wasm-lib/kcl/tests/fillet-and-shell/program_memory.snap b/src/wasm-lib/kcl/tests/fillet-and-shell/program_memory.snap index 11960d80f3..c907ae671e 100644 --- a/src/wasm-lib/kcl/tests/fillet-and-shell/program_memory.snap +++ b/src/wasm-lib/kcl/tests/fillet-and-shell/program_memory.snap @@ -985,7 +985,7 @@ description: Variables in memory after executing fillet-and-shell.kcl { "sourceRange": [ 1283, - 1525, + 1511, 0 ] } diff --git a/src/wasm-lib/kcl/tests/helix_ccw/artifact_commands.snap b/src/wasm-lib/kcl/tests/helix_ccw/artifact_commands.snap index ba870c5e53..005e6199ac 100644 --- a/src/wasm-lib/kcl/tests/helix_ccw/artifact_commands.snap +++ b/src/wasm-lib/kcl/tests/helix_ccw/artifact_commands.snap @@ -1,7 +1,6 @@ --- source: kcl/src/simulation_tests.rs description: Artifact commands helix_ccw.kcl -snapshot_kind: text --- [ { @@ -315,7 +314,7 @@ snapshot_kind: text "cmdId": "[uuid]", "range": [ 35, - 78, + 71, 0 ], "command": { @@ -335,7 +334,7 @@ snapshot_kind: text "cmdId": "[uuid]", "range": [ 35, - 78, + 71, 0 ], "command": { @@ -346,7 +345,7 @@ snapshot_kind: text "cmdId": "[uuid]", "range": [ 35, - 78, + 71, 0 ], "command": { @@ -363,7 +362,7 @@ snapshot_kind: text "cmdId": "[uuid]", "range": [ 35, - 78, + 71, 0 ], "command": { @@ -392,7 +391,7 @@ snapshot_kind: text "cmdId": "[uuid]", "range": [ 35, - 78, + 71, 0 ], "command": { @@ -403,8 +402,8 @@ snapshot_kind: text { "cmdId": "[uuid]", "range": [ - 84, - 104, + 77, + 97, 0 ], "command": { @@ -423,8 +422,8 @@ snapshot_kind: text { "cmdId": "[uuid]", "range": [ - 84, - 104, + 77, + 97, 0 ], "command": { @@ -437,8 +436,8 @@ snapshot_kind: text { "cmdId": "[uuid]", "range": [ - 84, - 104, + 77, + 97, 0 ], "command": { @@ -448,8 +447,8 @@ snapshot_kind: text { "cmdId": "[uuid]", "range": [ - 84, - 104, + 77, + 97, 0 ], "command": { @@ -460,8 +459,8 @@ snapshot_kind: text { "cmdId": "[uuid]", "range": [ - 84, - 104, + 77, + 97, 0 ], "command": { @@ -473,8 +472,8 @@ snapshot_kind: text { "cmdId": "[uuid]", "range": [ - 84, - 104, + 77, + 97, 0 ], "command": { @@ -487,8 +486,8 @@ snapshot_kind: text { "cmdId": "[uuid]", "range": [ - 84, - 104, + 77, + 97, 0 ], "command": { @@ -501,8 +500,8 @@ snapshot_kind: text { "cmdId": "[uuid]", "range": [ - 110, - 205, + 103, + 198, 0 ], "command": { diff --git a/src/wasm-lib/kcl/tests/helix_ccw/artifact_graph_flowchart.snap.md b/src/wasm-lib/kcl/tests/helix_ccw/artifact_graph_flowchart.snap.md index 20daff85d8..d75b605de9 100644 --- a/src/wasm-lib/kcl/tests/helix_ccw/artifact_graph_flowchart.snap.md +++ b/src/wasm-lib/kcl/tests/helix_ccw/artifact_graph_flowchart.snap.md @@ -1,12 +1,12 @@ ```mermaid flowchart LR subgraph path2 [Path] - 2["Path
[35, 78, 0]"] - 3["Segment
[35, 78, 0]"] + 2["Path
[35, 71, 0]"] + 3["Segment
[35, 71, 0]"] 4[Solid2d] end 1["Plane
[10, 29, 0]"] - 5["Sweep Extrusion
[84, 104, 0]"] + 5["Sweep Extrusion
[77, 97, 0]"] 6[Wall] 7["Cap Start"] 8["Cap End"] diff --git a/src/wasm-lib/kcl/tests/helix_ccw/ast.snap b/src/wasm-lib/kcl/tests/helix_ccw/ast.snap index da07e71340..1569d7ed48 100644 --- a/src/wasm-lib/kcl/tests/helix_ccw/ast.snap +++ b/src/wasm-lib/kcl/tests/helix_ccw/ast.snap @@ -7,7 +7,7 @@ description: Result of parsing helix_ccw.kcl "body": [ { "declaration": { - "end": 205, + "end": 198, "id": { "end": 7, "name": "part001", @@ -41,81 +41,59 @@ description: Result of parsing helix_ccw.kcl { "arguments": [ { - "end": 74, - "properties": [ - { - "end": 59, - "key": { - "end": 50, - "name": "center", - "start": 44, - "type": "Identifier" - }, - "start": 44, - "type": "ObjectProperty", - "value": { - "elements": [ - { - "end": 55, - "raw": "5", - "start": 54, - "type": "Literal", - "type": "Literal", - "value": { - "value": 5.0, - "suffix": "None" - } - }, - { - "end": 58, - "raw": "5", - "start": 57, - "type": "Literal", - "type": "Literal", - "value": { - "value": 5.0, - "suffix": "None" - } - } - ], - "end": 59, - "start": 53, - "type": "ArrayExpression", - "type": "ArrayExpression" - } - }, - { - "end": 72, - "key": { - "end": 67, - "name": "radius", - "start": 61, - "type": "Identifier" + "type": "LabeledArg", + "label": { + "type": "Identifier", + "name": "center" + }, + "arg": { + "elements": [ + { + "end": 53, + "raw": "5", + "start": 52, + "type": "Literal", + "type": "Literal", + "value": { + "value": 5.0, + "suffix": "None" + } }, - "start": 61, - "type": "ObjectProperty", - "value": { - "end": 72, - "raw": "10", - "start": 70, + { + "end": 56, + "raw": "5", + "start": 55, "type": "Literal", "type": "Literal", "value": { - "value": 10.0, + "value": 5.0, "suffix": "None" } } - } - ], - "start": 42, - "type": "ObjectExpression", - "type": "ObjectExpression" + ], + "end": 57, + "start": 51, + "type": "ArrayExpression", + "type": "ArrayExpression" + } }, { - "end": 77, - "start": 76, - "type": "PipeSubstitution", - "type": "PipeSubstitution" + "type": "LabeledArg", + "label": { + "type": "Identifier", + "name": "radius" + }, + "arg": { + "end": 70, + "raw": "10", + "start": 68, + "type": "Literal", + "type": "Literal", + "value": { + "value": 10.0, + "suffix": "None" + } + } } ], "callee": { @@ -124,10 +102,11 @@ description: Result of parsing helix_ccw.kcl "start": 35, "type": "Identifier" }, - "end": 78, + "end": 71, "start": 35, - "type": "CallExpression", - "type": "CallExpression" + "type": "CallExpressionKw", + "type": "CallExpressionKw", + "unlabeled": null }, { "arguments": [ @@ -138,9 +117,9 @@ description: Result of parsing helix_ccw.kcl "name": "length" }, "arg": { - "end": 103, + "end": 96, "raw": "10", - "start": 101, + "start": 94, "type": "Literal", "type": "Literal", "value": { @@ -151,13 +130,13 @@ description: Result of parsing helix_ccw.kcl } ], "callee": { - "end": 91, + "end": 84, "name": "extrude", - "start": 84, + "start": 77, "type": "Identifier" }, - "end": 104, - "start": 84, + "end": 97, + "start": 77, "type": "CallExpressionKw", "type": "CallExpressionKw", "unlabeled": null @@ -165,22 +144,22 @@ description: Result of parsing helix_ccw.kcl { "arguments": [ { - "end": 201, + "end": 194, "properties": [ { - "end": 152, + "end": 145, "key": { - "end": 147, + "end": 140, "name": "revolutions", - "start": 136, + "start": 129, "type": "Identifier" }, - "start": 136, + "start": 129, "type": "ObjectProperty", "value": { - "end": 152, + "end": 145, "raw": "16", - "start": 150, + "start": 143, "type": "Literal", "type": "Literal", "value": { @@ -190,19 +169,19 @@ description: Result of parsing helix_ccw.kcl } }, { - "end": 175, + "end": 168, "key": { - "end": 171, + "end": 164, "name": "angleStart", - "start": 161, + "start": 154, "type": "Identifier" }, - "start": 161, + "start": 154, "type": "ObjectProperty", "value": { - "end": 175, + "end": 168, "raw": "0", - "start": 174, + "start": 167, "type": "Literal", "type": "Literal", "value": { @@ -212,49 +191,49 @@ description: Result of parsing helix_ccw.kcl } }, { - "end": 194, + "end": 187, "key": { - "end": 187, + "end": 180, "name": "ccw", - "start": 184, + "start": 177, "type": "Identifier" }, - "start": 184, + "start": 177, "type": "ObjectProperty", "value": { - "end": 194, + "end": 187, "raw": "true", - "start": 190, + "start": 183, "type": "Literal", "type": "Literal", "value": true } } ], - "start": 127, + "start": 120, "type": "ObjectExpression", "type": "ObjectExpression" }, { - "end": 204, - "start": 203, + "end": 197, + "start": 196, "type": "PipeSubstitution", "type": "PipeSubstitution" } ], "callee": { - "end": 126, + "end": 119, "name": "helixRevolutions", - "start": 110, + "start": 103, "type": "Identifier" }, - "end": 205, - "start": 110, + "end": 198, + "start": 103, "type": "CallExpression", "type": "CallExpression" } ], - "end": 205, + "end": 198, "start": 10, "type": "PipeExpression", "type": "PipeExpression" @@ -262,14 +241,14 @@ description: Result of parsing helix_ccw.kcl "start": 0, "type": "VariableDeclarator" }, - "end": 205, + "end": 198, "kind": "const", "start": 0, "type": "VariableDeclaration", "type": "VariableDeclaration" } ], - "end": 206, + "end": 199, "start": 0 } } diff --git a/src/wasm-lib/kcl/tests/helix_ccw/input.kcl b/src/wasm-lib/kcl/tests/helix_ccw/input.kcl index bd19490297..240df6ef1b 100644 --- a/src/wasm-lib/kcl/tests/helix_ccw/input.kcl +++ b/src/wasm-lib/kcl/tests/helix_ccw/input.kcl @@ -1,5 +1,5 @@ part001 = startSketchOn('XY') - |> circle({ center = [5, 5], radius = 10 }, %) + |> circle(center = [5, 5], radius = 10) |> extrude(length = 10) |> helixRevolutions({ revolutions = 16, diff --git a/src/wasm-lib/kcl/tests/helix_ccw/ops.snap b/src/wasm-lib/kcl/tests/helix_ccw/ops.snap index 1b94eb615b..9d1885031b 100644 --- a/src/wasm-lib/kcl/tests/helix_ccw/ops.snap +++ b/src/wasm-lib/kcl/tests/helix_ccw/ops.snap @@ -43,16 +43,16 @@ description: Operations executed helix_ccw.kcl } }, "sourceRange": [ - 101, - 103, + 94, + 96, 0 ] } }, "name": "extrude", "sourceRange": [ - 84, - 104, + 77, + 97, 0 ], "type": "StdLibCall", @@ -109,8 +109,8 @@ description: Operations executed helix_ccw.kcl } }, "sourceRange": [ - 127, - 201, + 120, + 194, 0 ] }, @@ -122,16 +122,16 @@ description: Operations executed helix_ccw.kcl } }, "sourceRange": [ - 203, - 204, + 196, + 197, 0 ] } }, "name": "helixRevolutions", "sourceRange": [ - 110, - 205, + 103, + 198, 0 ], "type": "StdLibCall", diff --git a/src/wasm-lib/kcl/tests/helix_ccw/program_memory.snap b/src/wasm-lib/kcl/tests/helix_ccw/program_memory.snap index e3f28fae81..912b898492 100644 --- a/src/wasm-lib/kcl/tests/helix_ccw/program_memory.snap +++ b/src/wasm-lib/kcl/tests/helix_ccw/program_memory.snap @@ -15,7 +15,7 @@ description: Variables in memory after executing helix_ccw.kcl "id": "[uuid]", "sourceRange": [ 35, - 78, + 71, 0 ], "tag": null, @@ -31,7 +31,7 @@ description: Variables in memory after executing helix_ccw.kcl "id": "[uuid]", "sourceRange": [ 35, - 78, + 71, 0 ] }, @@ -103,7 +103,7 @@ description: Variables in memory after executing helix_ccw.kcl "id": "[uuid]", "sourceRange": [ 35, - 78, + 71, 0 ] } @@ -117,7 +117,7 @@ description: Variables in memory after executing helix_ccw.kcl { "sourceRange": [ 35, - 78, + 71, 0 ] } @@ -133,7 +133,7 @@ description: Variables in memory after executing helix_ccw.kcl { "sourceRange": [ 35, - 78, + 71, 0 ] } diff --git a/src/wasm-lib/kcl/tests/import_side_effect/export_side_effect.kcl b/src/wasm-lib/kcl/tests/import_side_effect/export_side_effect.kcl index 1b3319e261..890fc7b63b 100644 --- a/src/wasm-lib/kcl/tests/import_side_effect/export_side_effect.kcl +++ b/src/wasm-lib/kcl/tests/import_side_effect/export_side_effect.kcl @@ -2,4 +2,4 @@ export fn foo = () => { return 0 } // This interacts with the engine. part001 = startSketchOn('XY') - |> circle({ center = [0, 0], radius = 10 }, %) + |> circle(center = [0, 0], radius = 10) diff --git a/src/wasm-lib/kcl/tests/import_whole/artifact_commands.snap b/src/wasm-lib/kcl/tests/import_whole/artifact_commands.snap index 91c588fc65..46bbbd8c97 100644 --- a/src/wasm-lib/kcl/tests/import_whole/artifact_commands.snap +++ b/src/wasm-lib/kcl/tests/import_whole/artifact_commands.snap @@ -1,7 +1,6 @@ --- source: kcl/src/simulation_tests.rs description: Artifact commands import_whole.kcl -snapshot_kind: text --- [ { @@ -327,7 +326,7 @@ snapshot_kind: text "cmdId": "[uuid]", "range": [ 61, - 104, + 97, 3 ], "command": { @@ -347,7 +346,7 @@ snapshot_kind: text "cmdId": "[uuid]", "range": [ 61, - 104, + 97, 3 ], "command": { @@ -358,7 +357,7 @@ snapshot_kind: text "cmdId": "[uuid]", "range": [ 61, - 104, + 97, 3 ], "command": { @@ -375,7 +374,7 @@ snapshot_kind: text "cmdId": "[uuid]", "range": [ 61, - 104, + 97, 3 ], "command": { @@ -404,7 +403,7 @@ snapshot_kind: text "cmdId": "[uuid]", "range": [ 61, - 104, + 97, 3 ], "command": { @@ -415,8 +414,8 @@ snapshot_kind: text { "cmdId": "[uuid]", "range": [ - 110, - 130, + 103, + 123, 3 ], "command": { @@ -435,8 +434,8 @@ snapshot_kind: text { "cmdId": "[uuid]", "range": [ - 110, - 130, + 103, + 123, 3 ], "command": { @@ -449,8 +448,8 @@ snapshot_kind: text { "cmdId": "[uuid]", "range": [ - 110, - 130, + 103, + 123, 3 ], "command": { @@ -460,8 +459,8 @@ snapshot_kind: text { "cmdId": "[uuid]", "range": [ - 110, - 130, + 103, + 123, 3 ], "command": { @@ -472,8 +471,8 @@ snapshot_kind: text { "cmdId": "[uuid]", "range": [ - 110, - 130, + 103, + 123, 3 ], "command": { @@ -485,8 +484,8 @@ snapshot_kind: text { "cmdId": "[uuid]", "range": [ - 110, - 130, + 103, + 123, 3 ], "command": { @@ -499,8 +498,8 @@ snapshot_kind: text { "cmdId": "[uuid]", "range": [ - 110, - 130, + 103, + 123, 3 ], "command": { diff --git a/src/wasm-lib/kcl/tests/import_whole/artifact_graph_flowchart.snap b/src/wasm-lib/kcl/tests/import_whole/artifact_graph_flowchart.snap index 2773b9f690..8822fcd31d 100644 --- a/src/wasm-lib/kcl/tests/import_whole/artifact_graph_flowchart.snap +++ b/src/wasm-lib/kcl/tests/import_whole/artifact_graph_flowchart.snap @@ -1,6 +1,5 @@ --- source: kcl/src/simulation_tests.rs -assertion_line: 188 description: Artifact graph flowchart import_whole.kcl extension: md snapshot_kind: binary diff --git a/src/wasm-lib/kcl/tests/import_whole/artifact_graph_flowchart.snap.md b/src/wasm-lib/kcl/tests/import_whole/artifact_graph_flowchart.snap.md index dbc7ca13c1..822c27b166 100644 --- a/src/wasm-lib/kcl/tests/import_whole/artifact_graph_flowchart.snap.md +++ b/src/wasm-lib/kcl/tests/import_whole/artifact_graph_flowchart.snap.md @@ -1,12 +1,12 @@ ```mermaid flowchart LR subgraph path2 [Path] - 2["Path
[61, 104, 3]"] - 3["Segment
[61, 104, 3]"] + 2["Path
[61, 97, 3]"] + 3["Segment
[61, 97, 3]"] 4[Solid2d] end 1["Plane
[36, 55, 3]"] - 5["Sweep Extrusion
[110, 130, 3]"] + 5["Sweep Extrusion
[103, 123, 3]"] 6[Wall] 7["Cap Start"] 8["Cap End"] diff --git a/src/wasm-lib/kcl/tests/import_whole/exported_mod.kcl b/src/wasm-lib/kcl/tests/import_whole/exported_mod.kcl index 30f5d782b6..765515480e 100644 --- a/src/wasm-lib/kcl/tests/import_whole/exported_mod.kcl +++ b/src/wasm-lib/kcl/tests/import_whole/exported_mod.kcl @@ -1,4 +1,4 @@ @settings(defaultLengthUnit = inch) startSketchOn('XY') - |> circle({ center = [5, 5], radius = 10 }, %) + |> circle(center = [5, 5], radius = 10) |> extrude(length = 10) diff --git a/src/wasm-lib/kcl/tests/import_whole/ops.snap b/src/wasm-lib/kcl/tests/import_whole/ops.snap index 85053a7707..9488a96d24 100644 --- a/src/wasm-lib/kcl/tests/import_whole/ops.snap +++ b/src/wasm-lib/kcl/tests/import_whole/ops.snap @@ -43,16 +43,16 @@ description: Operations executed import_whole.kcl } }, "sourceRange": [ - 127, - 129, + 120, + 122, 3 ] } }, "name": "extrude", "sourceRange": [ - 110, - 130, + 103, + 123, 3 ], "type": "StdLibCall", diff --git a/src/wasm-lib/kcl/tests/import_whole/program_memory.snap b/src/wasm-lib/kcl/tests/import_whole/program_memory.snap index 4e538762ed..f5cad70e2f 100644 --- a/src/wasm-lib/kcl/tests/import_whole/program_memory.snap +++ b/src/wasm-lib/kcl/tests/import_whole/program_memory.snap @@ -15,7 +15,7 @@ description: Variables in memory after executing import_whole.kcl "id": "[uuid]", "sourceRange": [ 61, - 104, + 97, 3 ], "tag": null, @@ -31,7 +31,7 @@ description: Variables in memory after executing import_whole.kcl "id": "[uuid]", "sourceRange": [ 61, - 104, + 97, 3 ] }, @@ -103,7 +103,7 @@ description: Variables in memory after executing import_whole.kcl "id": "[uuid]", "sourceRange": [ 61, - 104, + 97, 3 ] } @@ -117,7 +117,7 @@ description: Variables in memory after executing import_whole.kcl { "sourceRange": [ 61, - 104, + 97, 3 ] } @@ -133,7 +133,7 @@ description: Variables in memory after executing import_whole.kcl { "sourceRange": [ 61, - 104, + 97, 3 ] } diff --git a/src/wasm-lib/kcl/tests/revolve_about_edge/artifact_commands.snap b/src/wasm-lib/kcl/tests/revolve_about_edge/artifact_commands.snap index 89e5552163..bc2d69e7a4 100644 --- a/src/wasm-lib/kcl/tests/revolve_about_edge/artifact_commands.snap +++ b/src/wasm-lib/kcl/tests/revolve_about_edge/artifact_commands.snap @@ -412,7 +412,7 @@ description: Artifact commands revolve_about_edge.kcl "cmdId": "[uuid]", "range": [ 145, - 190, + 183, 0 ], "command": { @@ -432,7 +432,7 @@ description: Artifact commands revolve_about_edge.kcl "cmdId": "[uuid]", "range": [ 145, - 190, + 183, 0 ], "command": { @@ -443,7 +443,7 @@ description: Artifact commands revolve_about_edge.kcl "cmdId": "[uuid]", "range": [ 145, - 190, + 183, 0 ], "command": { @@ -460,7 +460,7 @@ description: Artifact commands revolve_about_edge.kcl "cmdId": "[uuid]", "range": [ 145, - 190, + 183, 0 ], "command": { @@ -489,7 +489,7 @@ description: Artifact commands revolve_about_edge.kcl "cmdId": "[uuid]", "range": [ 145, - 190, + 183, 0 ], "command": { @@ -500,8 +500,8 @@ description: Artifact commands revolve_about_edge.kcl { "cmdId": "[uuid]", "range": [ - 196, - 270, + 189, + 263, 0 ], "command": { @@ -518,8 +518,8 @@ description: Artifact commands revolve_about_edge.kcl { "cmdId": "[uuid]", "range": [ - 196, - 270, + 189, + 263, 0 ], "command": { @@ -530,8 +530,8 @@ description: Artifact commands revolve_about_edge.kcl { "cmdId": "[uuid]", "range": [ - 196, - 270, + 189, + 263, 0 ], "command": { @@ -543,8 +543,8 @@ description: Artifact commands revolve_about_edge.kcl { "cmdId": "[uuid]", "range": [ - 196, - 270, + 189, + 263, 0 ], "command": { @@ -557,8 +557,8 @@ description: Artifact commands revolve_about_edge.kcl { "cmdId": "[uuid]", "range": [ - 196, - 270, + 189, + 263, 0 ], "command": { diff --git a/src/wasm-lib/kcl/tests/revolve_about_edge/artifact_graph_flowchart.snap.md b/src/wasm-lib/kcl/tests/revolve_about_edge/artifact_graph_flowchart.snap.md index f4a58e3729..7197150d56 100644 --- a/src/wasm-lib/kcl/tests/revolve_about_edge/artifact_graph_flowchart.snap.md +++ b/src/wasm-lib/kcl/tests/revolve_about_edge/artifact_graph_flowchart.snap.md @@ -5,13 +5,13 @@ flowchart LR 3["Segment
[71, 107, 0]"] end subgraph path5 [Path] - 5["Path
[145, 190, 0]"] - 6["Segment
[145, 190, 0]"] + 5["Path
[145, 183, 0]"] + 6["Segment
[145, 183, 0]"] 7[Solid2d] end 1["Plane
[12, 31, 0]"] 4["Plane
[120, 139, 0]"] - 8["Sweep RevolveAboutEdge
[196, 270, 0]"] + 8["Sweep RevolveAboutEdge
[189, 263, 0]"] 9[Wall] 10["Cap Start"] 11["Cap End"] diff --git a/src/wasm-lib/kcl/tests/revolve_about_edge/ast.snap b/src/wasm-lib/kcl/tests/revolve_about_edge/ast.snap index 2a8c7ceca7..fde75281ad 100644 --- a/src/wasm-lib/kcl/tests/revolve_about_edge/ast.snap +++ b/src/wasm-lib/kcl/tests/revolve_about_edge/ast.snap @@ -157,7 +157,7 @@ description: Result of parsing revolve_about_edge.kcl }, { "declaration": { - "end": 270, + "end": 263, "id": { "end": 117, "name": "sketch002", @@ -191,88 +191,66 @@ description: Result of parsing revolve_about_edge.kcl { "arguments": [ { - "end": 186, - "properties": [ - { - "end": 171, - "key": { - "end": 160, - "name": "center", - "start": 154, - "type": "Identifier" - }, - "start": 154, - "type": "ObjectProperty", - "value": { - "elements": [ - { - "argument": { - "end": 167, - "raw": "50", - "start": 165, - "type": "Literal", - "type": "Literal", - "value": { - "value": 50.0, - "suffix": "None" - } - }, - "end": 167, - "operator": "-", - "start": 164, - "type": "UnaryExpression", - "type": "UnaryExpression" - }, - { - "end": 170, - "raw": "0", - "start": 169, - "type": "Literal", - "type": "Literal", - "value": { - "value": 0.0, - "suffix": "None" - } + "type": "LabeledArg", + "label": { + "type": "Identifier", + "name": "center" + }, + "arg": { + "elements": [ + { + "argument": { + "end": 165, + "raw": "50", + "start": 163, + "type": "Literal", + "type": "Literal", + "value": { + "value": 50.0, + "suffix": "None" } - ], - "end": 171, - "start": 163, - "type": "ArrayExpression", - "type": "ArrayExpression" - } - }, - { - "end": 184, - "key": { - "end": 179, - "name": "radius", - "start": 173, - "type": "Identifier" + }, + "end": 165, + "operator": "-", + "start": 162, + "type": "UnaryExpression", + "type": "UnaryExpression" }, - "start": 173, - "type": "ObjectProperty", - "value": { - "end": 184, - "raw": "10", - "start": 182, + { + "end": 168, + "raw": "0", + "start": 167, "type": "Literal", "type": "Literal", "value": { - "value": 10.0, + "value": 0.0, "suffix": "None" } } - } - ], - "start": 152, - "type": "ObjectExpression", - "type": "ObjectExpression" + ], + "end": 169, + "start": 161, + "type": "ArrayExpression", + "type": "ArrayExpression" + } }, { - "end": 189, - "start": 188, - "type": "PipeSubstitution", - "type": "PipeSubstitution" + "type": "LabeledArg", + "label": { + "type": "Identifier", + "name": "radius" + }, + "arg": { + "end": 182, + "raw": "10", + "start": 180, + "type": "Literal", + "type": "Literal", + "value": { + "value": 10.0, + "suffix": "None" + } + } } ], "callee": { @@ -281,30 +259,31 @@ description: Result of parsing revolve_about_edge.kcl "start": 145, "type": "Identifier" }, - "end": 190, + "end": 183, "start": 145, - "type": "CallExpression", - "type": "CallExpression" + "type": "CallExpressionKw", + "type": "CallExpressionKw", + "unlabeled": null }, { "arguments": [ { - "end": 266, + "end": 259, "properties": [ { - "end": 223, + "end": 216, "key": { - "end": 218, + "end": 211, "name": "angle", - "start": 213, + "start": 206, "type": "Identifier" }, - "start": 213, + "start": 206, "type": "ObjectProperty", "value": { - "end": 223, + "end": 216, "raw": "90", - "start": 221, + "start": 214, "type": "Literal", "type": "Literal", "value": { @@ -314,48 +293,48 @@ description: Result of parsing revolve_about_edge.kcl } }, { - "end": 259, + "end": 252, "key": { - "end": 236, + "end": 229, "name": "axis", - "start": 232, + "start": 225, "type": "Identifier" }, - "start": 232, + "start": 225, "type": "ObjectProperty", "value": { - "end": 259, + "end": 252, "name": "rectangleSegmentB001", - "start": 239, + "start": 232, "type": "Identifier", "type": "Identifier" } } ], - "start": 204, + "start": 197, "type": "ObjectExpression", "type": "ObjectExpression" }, { - "end": 269, - "start": 268, + "end": 262, + "start": 261, "type": "PipeSubstitution", "type": "PipeSubstitution" } ], "callee": { - "end": 203, + "end": 196, "name": "revolve", - "start": 196, + "start": 189, "type": "Identifier" }, - "end": 270, - "start": 196, + "end": 263, + "start": 189, "type": "CallExpression", "type": "CallExpression" } ], - "end": 270, + "end": 263, "start": 120, "type": "PipeExpression", "type": "PipeExpression" @@ -363,14 +342,14 @@ description: Result of parsing revolve_about_edge.kcl "start": 108, "type": "VariableDeclarator" }, - "end": 270, + "end": 263, "kind": "const", "start": 108, "type": "VariableDeclaration", "type": "VariableDeclaration" } ], - "end": 271, + "end": 264, "start": 0 } } diff --git a/src/wasm-lib/kcl/tests/revolve_about_edge/input.kcl b/src/wasm-lib/kcl/tests/revolve_about_edge/input.kcl index e2123e4a49..e7d6d654a3 100644 --- a/src/wasm-lib/kcl/tests/revolve_about_edge/input.kcl +++ b/src/wasm-lib/kcl/tests/revolve_about_edge/input.kcl @@ -2,7 +2,7 @@ sketch001 = startSketchOn('XY') |> startProfileAt([-25, 25], %) |> yLine(-50, %, $rectangleSegmentB001) sketch002 = startSketchOn('XY') - |> circle({ center = [-50, 0], radius = 10 }, %) + |> circle(center = [-50, 0], radius = 10) |> revolve({ angle = 90, axis = rectangleSegmentB001 diff --git a/src/wasm-lib/kcl/tests/revolve_about_edge/ops.snap b/src/wasm-lib/kcl/tests/revolve_about_edge/ops.snap index b84e3be23e..4ae7da3072 100644 --- a/src/wasm-lib/kcl/tests/revolve_about_edge/ops.snap +++ b/src/wasm-lib/kcl/tests/revolve_about_edge/ops.snap @@ -76,8 +76,8 @@ description: Operations executed revolve_about_edge.kcl } }, "sourceRange": [ - 204, - 266, + 197, + 259, 0 ] }, @@ -89,16 +89,16 @@ description: Operations executed revolve_about_edge.kcl } }, "sourceRange": [ - 268, - 269, + 261, + 262, 0 ] } }, "name": "revolve", "sourceRange": [ - 196, - 270, + 189, + 263, 0 ], "type": "StdLibCall", diff --git a/src/wasm-lib/kcl/tests/revolve_about_edge/program_memory.snap b/src/wasm-lib/kcl/tests/revolve_about_edge/program_memory.snap index ce01c834a1..73894dfe09 100644 --- a/src/wasm-lib/kcl/tests/revolve_about_edge/program_memory.snap +++ b/src/wasm-lib/kcl/tests/revolve_about_edge/program_memory.snap @@ -215,7 +215,7 @@ description: Variables in memory after executing revolve_about_edge.kcl "id": "[uuid]", "sourceRange": [ 145, - 190, + 183, 0 ], "tag": null, @@ -231,7 +231,7 @@ description: Variables in memory after executing revolve_about_edge.kcl "id": "[uuid]", "sourceRange": [ 145, - 190, + 183, 0 ] }, @@ -303,7 +303,7 @@ description: Variables in memory after executing revolve_about_edge.kcl "id": "[uuid]", "sourceRange": [ 145, - 190, + 183, 0 ] } @@ -317,7 +317,7 @@ description: Variables in memory after executing revolve_about_edge.kcl { "sourceRange": [ 145, - 190, + 183, 0 ] } @@ -333,7 +333,7 @@ description: Variables in memory after executing revolve_about_edge.kcl { "sourceRange": [ 145, - 190, + 183, 0 ] } diff --git a/src/wasm-lib/kcl/tests/sketch_on_face_circle_tagged/artifact_commands.snap b/src/wasm-lib/kcl/tests/sketch_on_face_circle_tagged/artifact_commands.snap index 9a75ebe719..2f515ae8b6 100644 --- a/src/wasm-lib/kcl/tests/sketch_on_face_circle_tagged/artifact_commands.snap +++ b/src/wasm-lib/kcl/tests/sketch_on_face_circle_tagged/artifact_commands.snap @@ -1,7 +1,6 @@ --- source: kcl/src/simulation_tests.rs description: Artifact commands sketch_on_face_circle_tagged.kcl -snapshot_kind: text --- [ { @@ -631,7 +630,7 @@ snapshot_kind: text "cmdId": "[uuid]", "range": [ 298, - 351, + 350, 0 ], "command": { @@ -647,7 +646,7 @@ snapshot_kind: text "cmdId": "[uuid]", "range": [ 298, - 351, + 350, 0 ], "command": { @@ -658,7 +657,7 @@ snapshot_kind: text "cmdId": "[uuid]", "range": [ 298, - 351, + 350, 0 ], "command": { @@ -675,7 +674,7 @@ snapshot_kind: text "cmdId": "[uuid]", "range": [ 298, - 351, + 350, 0 ], "command": { @@ -704,7 +703,7 @@ snapshot_kind: text "cmdId": "[uuid]", "range": [ 298, - 351, + 350, 0 ], "command": { @@ -715,8 +714,8 @@ snapshot_kind: text { "cmdId": "[uuid]", "range": [ - 357, - 376, + 356, + 375, 0 ], "command": { @@ -731,8 +730,8 @@ snapshot_kind: text { "cmdId": "[uuid]", "range": [ - 357, - 376, + 356, + 375, 0 ], "command": { @@ -745,8 +744,8 @@ snapshot_kind: text { "cmdId": "[uuid]", "range": [ - 357, - 376, + 356, + 375, 0 ], "command": { @@ -756,8 +755,8 @@ snapshot_kind: text { "cmdId": "[uuid]", "range": [ - 357, - 376, + 356, + 375, 0 ], "command": { @@ -768,8 +767,8 @@ snapshot_kind: text { "cmdId": "[uuid]", "range": [ - 357, - 376, + 356, + 375, 0 ], "command": { @@ -781,8 +780,8 @@ snapshot_kind: text { "cmdId": "[uuid]", "range": [ - 357, - 376, + 356, + 375, 0 ], "command": { @@ -795,8 +794,8 @@ snapshot_kind: text { "cmdId": "[uuid]", "range": [ - 357, - 376, + 356, + 375, 0 ], "command": { diff --git a/src/wasm-lib/kcl/tests/sketch_on_face_circle_tagged/artifact_graph_flowchart.snap.md b/src/wasm-lib/kcl/tests/sketch_on_face_circle_tagged/artifact_graph_flowchart.snap.md index 18d8c32a6c..bc365575ab 100644 --- a/src/wasm-lib/kcl/tests/sketch_on_face_circle_tagged/artifact_graph_flowchart.snap.md +++ b/src/wasm-lib/kcl/tests/sketch_on_face_circle_tagged/artifact_graph_flowchart.snap.md @@ -9,8 +9,8 @@ flowchart LR 7[Solid2d] end subgraph path23 [Path] - 23["Path
[298, 351, 0]"] - 24["Segment
[298, 351, 0]"] + 23["Path
[298, 350, 0]"] + 24["Segment
[298, 350, 0]"] 25[Solid2d] end 1["Plane
[29, 48, 0]"] @@ -29,7 +29,7 @@ flowchart LR 20["SweepEdge Adjacent"] 21["SweepEdge Opposite"] 22["SweepEdge Adjacent"] - 26["Sweep Extrusion
[357, 376, 0]"] + 26["Sweep Extrusion
[356, 375, 0]"] 27[Wall] 28["Cap Start"] 29["Cap End"] diff --git a/src/wasm-lib/kcl/tests/sketch_on_face_circle_tagged/ast.snap b/src/wasm-lib/kcl/tests/sketch_on_face_circle_tagged/ast.snap index 0039091573..ed5e1e4381 100644 --- a/src/wasm-lib/kcl/tests/sketch_on_face_circle_tagged/ast.snap +++ b/src/wasm-lib/kcl/tests/sketch_on_face_circle_tagged/ast.snap @@ -445,7 +445,7 @@ description: Result of parsing sketch_on_face_circle_tagged.kcl }, { "declaration": { - "end": 376, + "end": 375, "id": { "end": 260, "name": "part002", @@ -486,88 +486,73 @@ description: Result of parsing sketch_on_face_circle_tagged.kcl { "arguments": [ { - "end": 336, - "properties": [ - { - "end": 322, - "key": { - "end": 313, - "name": "center", - "start": 307, - "type": "Identifier" - }, - "start": 307, - "type": "ObjectProperty", - "value": { - "elements": [ - { - "end": 318, - "raw": "0", - "start": 317, - "type": "Literal", - "type": "Literal", - "value": { - "value": 0.0, - "suffix": "None" - } - }, - { - "end": 321, - "raw": "0", - "start": 320, - "type": "Literal", - "type": "Literal", - "value": { - "value": 0.0, - "suffix": "None" - } - } - ], - "end": 322, - "start": 316, - "type": "ArrayExpression", - "type": "ArrayExpression" - } - }, - { - "end": 334, - "key": { - "end": 330, - "name": "radius", - "start": 324, - "type": "Identifier" + "type": "LabeledArg", + "label": { + "type": "Identifier", + "name": "center" + }, + "arg": { + "elements": [ + { + "end": 316, + "raw": "0", + "start": 315, + "type": "Literal", + "type": "Literal", + "value": { + "value": 0.0, + "suffix": "None" + } }, - "start": 324, - "type": "ObjectProperty", - "value": { - "end": 334, - "raw": "5", - "start": 333, + { + "end": 319, + "raw": "0", + "start": 318, "type": "Literal", "type": "Literal", "value": { - "value": 5.0, + "value": 0.0, "suffix": "None" } } - } - ], - "start": 305, - "type": "ObjectExpression", - "type": "ObjectExpression" + ], + "end": 320, + "start": 314, + "type": "ArrayExpression", + "type": "ArrayExpression" + } }, { - "end": 339, - "start": 338, - "type": "PipeSubstitution", - "type": "PipeSubstitution" + "type": "LabeledArg", + "label": { + "type": "Identifier", + "name": "radius" + }, + "arg": { + "end": 332, + "raw": "5", + "start": 331, + "type": "Literal", + "type": "Literal", + "value": { + "value": 5.0, + "suffix": "None" + } + } }, { - "end": 350, - "start": 341, - "type": "TagDeclarator", - "type": "TagDeclarator", - "value": "myCircle" + "type": "LabeledArg", + "label": { + "type": "Identifier", + "name": "tag" + }, + "arg": { + "end": 349, + "start": 340, + "type": "TagDeclarator", + "type": "TagDeclarator", + "value": "myCircle" + } } ], "callee": { @@ -576,10 +561,11 @@ description: Result of parsing sketch_on_face_circle_tagged.kcl "start": 298, "type": "Identifier" }, - "end": 351, + "end": 350, "start": 298, - "type": "CallExpression", - "type": "CallExpression" + "type": "CallExpressionKw", + "type": "CallExpressionKw", + "unlabeled": null }, { "arguments": [ @@ -590,9 +576,9 @@ description: Result of parsing sketch_on_face_circle_tagged.kcl "name": "length" }, "arg": { - "end": 375, + "end": 374, "raw": "5", - "start": 374, + "start": 373, "type": "Literal", "type": "Literal", "value": { @@ -603,19 +589,19 @@ description: Result of parsing sketch_on_face_circle_tagged.kcl } ], "callee": { - "end": 364, + "end": 363, "name": "extrude", - "start": 357, + "start": 356, "type": "Identifier" }, - "end": 376, - "start": 357, + "end": 375, + "start": 356, "type": "CallExpressionKw", "type": "CallExpressionKw", "unlabeled": null } ], - "end": 376, + "end": 375, "start": 263, "type": "PipeExpression", "type": "PipeExpression" @@ -623,14 +609,14 @@ description: Result of parsing sketch_on_face_circle_tagged.kcl "start": 253, "type": "VariableDeclarator" }, - "end": 376, + "end": 375, "kind": "const", "start": 253, "type": "VariableDeclaration", "type": "VariableDeclaration" } ], - "end": 377, + "end": 376, "nonCodeMeta": { "nonCodeNodes": { "1": [ diff --git a/src/wasm-lib/kcl/tests/sketch_on_face_circle_tagged/input.kcl b/src/wasm-lib/kcl/tests/sketch_on_face_circle_tagged/input.kcl index aad0913d97..dd7e1427db 100644 --- a/src/wasm-lib/kcl/tests/sketch_on_face_circle_tagged/input.kcl +++ b/src/wasm-lib/kcl/tests/sketch_on_face_circle_tagged/input.kcl @@ -12,5 +12,5 @@ part001 = cube([0, 0], 20) |> extrude(length = 20) part002 = startSketchOn(part001, "end") - |> circle({ center = [0, 0], radius = 5 }, %, $myCircle) + |> circle(center = [0, 0], radius = 5, tag = $myCircle) |> extrude(length = 5) diff --git a/src/wasm-lib/kcl/tests/sketch_on_face_circle_tagged/ops.snap b/src/wasm-lib/kcl/tests/sketch_on_face_circle_tagged/ops.snap index 04ea741a05..d6cf33271b 100644 --- a/src/wasm-lib/kcl/tests/sketch_on_face_circle_tagged/ops.snap +++ b/src/wasm-lib/kcl/tests/sketch_on_face_circle_tagged/ops.snap @@ -142,16 +142,16 @@ description: Operations executed sketch_on_face_circle_tagged.kcl } }, "sourceRange": [ + 373, 374, - 375, 0 ] } }, "name": "extrude", "sourceRange": [ - 357, - 376, + 356, + 375, 0 ], "type": "StdLibCall", diff --git a/src/wasm-lib/kcl/tests/sketch_on_face_circle_tagged/program_memory.snap b/src/wasm-lib/kcl/tests/sketch_on_face_circle_tagged/program_memory.snap index 5a1c755a1f..c877513abc 100644 --- a/src/wasm-lib/kcl/tests/sketch_on_face_circle_tagged/program_memory.snap +++ b/src/wasm-lib/kcl/tests/sketch_on_face_circle_tagged/program_memory.snap @@ -28,7 +28,7 @@ description: Variables in memory after executing sketch_on_face_circle_tagged.kc "id": "[uuid]", "sourceRange": [ 298, - 351, + 350, 0 ] }, @@ -43,8 +43,8 @@ description: Variables in memory after executing sketch_on_face_circle_tagged.kc ], "radius": 5.0, "tag": { - "end": 350, - "start": 341, + "end": 349, + "start": 340, "type": "TagDeclarator", "value": "myCircle" }, @@ -62,12 +62,12 @@ description: Variables in memory after executing sketch_on_face_circle_tagged.kc "id": "[uuid]", "sourceRange": [ 298, - 351, + 350, 0 ], "tag": { - "end": 350, - "start": 341, + "end": 349, + "start": 340, "type": "TagDeclarator", "value": "myCircle" }, @@ -77,8 +77,8 @@ description: Variables in memory after executing sketch_on_face_circle_tagged.kc "__meta": [ { "sourceRange": [ - 341, - 350, + 340, + 349, 0 ] } @@ -329,12 +329,12 @@ description: Variables in memory after executing sketch_on_face_circle_tagged.kc "id": "[uuid]", "sourceRange": [ 298, - 351, + 350, 0 ], "tag": { - "end": 350, - "start": 341, + "end": 349, + "start": 340, "type": "TagDeclarator", "value": "myCircle" }, @@ -350,7 +350,7 @@ description: Variables in memory after executing sketch_on_face_circle_tagged.kc "id": "[uuid]", "sourceRange": [ 298, - 351, + 350, 0 ] }, @@ -365,8 +365,8 @@ description: Variables in memory after executing sketch_on_face_circle_tagged.kc ], "radius": 5.0, "tag": { - "end": 350, - "start": 341, + "end": 349, + "start": 340, "type": "TagDeclarator", "value": "myCircle" }, @@ -660,7 +660,7 @@ description: Variables in memory after executing sketch_on_face_circle_tagged.kc "id": "[uuid]", "sourceRange": [ 298, - 351, + 350, 0 ] } @@ -678,7 +678,7 @@ description: Variables in memory after executing sketch_on_face_circle_tagged.kc "id": "[uuid]", "sourceRange": [ 298, - 351, + 350, 0 ] }, @@ -693,8 +693,8 @@ description: Variables in memory after executing sketch_on_face_circle_tagged.kc ], "radius": 5.0, "tag": { - "end": 350, - "start": 341, + "end": 349, + "start": 340, "type": "TagDeclarator", "value": "myCircle" }, @@ -712,12 +712,12 @@ description: Variables in memory after executing sketch_on_face_circle_tagged.kc "id": "[uuid]", "sourceRange": [ 298, - 351, + 350, 0 ], "tag": { - "end": 350, - "start": 341, + "end": 349, + "start": 340, "type": "TagDeclarator", "value": "myCircle" }, @@ -727,8 +727,8 @@ description: Variables in memory after executing sketch_on_face_circle_tagged.kc "__meta": [ { "sourceRange": [ - 341, - 350, + 340, + 349, 0 ] } @@ -744,7 +744,7 @@ description: Variables in memory after executing sketch_on_face_circle_tagged.kc { "sourceRange": [ 298, - 351, + 350, 0 ] } @@ -760,7 +760,7 @@ description: Variables in memory after executing sketch_on_face_circle_tagged.kc { "sourceRange": [ 298, - 351, + 350, 0 ] } diff --git a/src/wasm-lib/kcl/tests/ssi_pattern/artifact_commands.snap b/src/wasm-lib/kcl/tests/ssi_pattern/artifact_commands.snap index 143e2d2f98..8d9325931c 100644 --- a/src/wasm-lib/kcl/tests/ssi_pattern/artifact_commands.snap +++ b/src/wasm-lib/kcl/tests/ssi_pattern/artifact_commands.snap @@ -700,7 +700,7 @@ description: Artifact commands ssi_pattern.kcl "cmdId": "[uuid]", "range": [ 370, - 421, + 414, 0 ], "command": { @@ -716,7 +716,7 @@ description: Artifact commands ssi_pattern.kcl "cmdId": "[uuid]", "range": [ 370, - 421, + 414, 0 ], "command": { @@ -727,7 +727,7 @@ description: Artifact commands ssi_pattern.kcl "cmdId": "[uuid]", "range": [ 370, - 421, + 414, 0 ], "command": { @@ -744,7 +744,7 @@ description: Artifact commands ssi_pattern.kcl "cmdId": "[uuid]", "range": [ 370, - 421, + 414, 0 ], "command": { @@ -773,7 +773,7 @@ description: Artifact commands ssi_pattern.kcl "cmdId": "[uuid]", "range": [ 370, - 421, + 414, 0 ], "command": { @@ -784,8 +784,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 427, - 486, + 420, + 479, 0 ], "command": { @@ -915,8 +915,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 545, - 605, + 538, + 598, 0 ], "command": { @@ -1075,8 +1075,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 545, - 605, + 538, + 598, 0 ], "command": { @@ -1235,8 +1235,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 545, - 605, + 538, + 598, 0 ], "command": { @@ -1395,8 +1395,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 545, - 605, + 538, + 598, 0 ], "command": { @@ -1555,8 +1555,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 545, - 605, + 538, + 598, 0 ], "command": { @@ -1715,8 +1715,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -1731,8 +1731,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -1745,8 +1745,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -1756,8 +1756,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -1768,8 +1768,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -1781,8 +1781,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -1795,8 +1795,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -1809,8 +1809,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -1825,8 +1825,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -1839,8 +1839,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -1850,8 +1850,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -1862,8 +1862,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -1875,8 +1875,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -1889,8 +1889,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -1903,8 +1903,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -1919,8 +1919,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -1933,8 +1933,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -1944,8 +1944,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -1956,8 +1956,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -1969,8 +1969,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -1983,8 +1983,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -1997,8 +1997,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -2013,8 +2013,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -2027,8 +2027,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -2038,8 +2038,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -2050,8 +2050,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -2063,8 +2063,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -2077,8 +2077,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -2091,8 +2091,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -2107,8 +2107,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -2121,8 +2121,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -2132,8 +2132,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -2144,8 +2144,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -2157,8 +2157,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -2171,8 +2171,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -2185,8 +2185,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -2201,8 +2201,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -2215,8 +2215,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -2226,8 +2226,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -2238,8 +2238,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -2251,8 +2251,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -2265,8 +2265,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -2279,8 +2279,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -2295,8 +2295,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -2309,8 +2309,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -2320,8 +2320,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -2332,8 +2332,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -2345,8 +2345,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -2359,8 +2359,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -2373,8 +2373,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -2389,8 +2389,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -2403,8 +2403,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -2414,8 +2414,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -2426,8 +2426,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -2439,8 +2439,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -2453,8 +2453,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -2467,8 +2467,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -2483,8 +2483,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -2497,8 +2497,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -2508,8 +2508,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -2520,8 +2520,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -2533,8 +2533,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -2547,8 +2547,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -2561,8 +2561,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -2577,8 +2577,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -2591,8 +2591,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -2602,8 +2602,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -2614,8 +2614,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -2627,8 +2627,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -2641,8 +2641,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -2655,8 +2655,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -2671,8 +2671,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -2685,8 +2685,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -2696,8 +2696,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -2708,8 +2708,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -2721,8 +2721,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -2735,8 +2735,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -2749,8 +2749,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -2765,8 +2765,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -2779,8 +2779,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -2790,8 +2790,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -2802,8 +2802,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -2815,8 +2815,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -2829,8 +2829,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -2843,8 +2843,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -2859,8 +2859,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -2873,8 +2873,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -2884,8 +2884,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -2896,8 +2896,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -2909,8 +2909,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -2923,8 +2923,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -2937,8 +2937,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -2953,8 +2953,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -2967,8 +2967,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -2978,8 +2978,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -2990,8 +2990,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -3003,8 +3003,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -3017,8 +3017,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -3031,8 +3031,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -3047,8 +3047,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -3061,8 +3061,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -3072,8 +3072,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -3084,8 +3084,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -3097,8 +3097,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -3111,8 +3111,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -3125,8 +3125,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -3141,8 +3141,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -3155,8 +3155,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -3166,8 +3166,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -3178,8 +3178,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -3191,8 +3191,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -3205,8 +3205,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -3219,8 +3219,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -3235,8 +3235,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -3249,8 +3249,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -3260,8 +3260,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -3272,8 +3272,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -3285,8 +3285,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -3299,8 +3299,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -3313,8 +3313,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -3329,8 +3329,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -3343,8 +3343,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -3354,8 +3354,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -3366,8 +3366,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -3379,8 +3379,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -3393,8 +3393,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -3407,8 +3407,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -3423,8 +3423,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -3437,8 +3437,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -3448,8 +3448,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -3460,8 +3460,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -3473,8 +3473,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -3487,8 +3487,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -3501,8 +3501,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -3517,8 +3517,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -3531,8 +3531,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -3542,8 +3542,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -3554,8 +3554,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -3567,8 +3567,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -3581,8 +3581,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -3595,8 +3595,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -3611,8 +3611,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -3625,8 +3625,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -3636,8 +3636,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -3648,8 +3648,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -3661,8 +3661,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -3675,8 +3675,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -3689,8 +3689,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -3705,8 +3705,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -3719,8 +3719,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -3730,8 +3730,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -3742,8 +3742,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -3755,8 +3755,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -3769,8 +3769,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -3783,8 +3783,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -3799,8 +3799,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -3813,8 +3813,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -3824,8 +3824,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -3836,8 +3836,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -3849,8 +3849,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -3863,8 +3863,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -3877,8 +3877,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -3893,8 +3893,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -3907,8 +3907,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -3918,8 +3918,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -3930,8 +3930,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -3943,8 +3943,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -3957,8 +3957,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -3971,8 +3971,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -3987,8 +3987,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -4001,8 +4001,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -4012,8 +4012,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -4024,8 +4024,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -4037,8 +4037,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -4051,8 +4051,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -4065,8 +4065,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -4081,8 +4081,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -4095,8 +4095,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -4106,8 +4106,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -4118,8 +4118,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -4131,8 +4131,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -4145,8 +4145,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -4159,8 +4159,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -4175,8 +4175,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -4189,8 +4189,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -4200,8 +4200,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -4212,8 +4212,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -4225,8 +4225,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -4239,8 +4239,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -4253,8 +4253,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -4269,8 +4269,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -4283,8 +4283,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -4294,8 +4294,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -4306,8 +4306,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -4319,8 +4319,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -4333,8 +4333,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -4347,8 +4347,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -4363,8 +4363,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -4377,8 +4377,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -4388,8 +4388,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -4400,8 +4400,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -4413,8 +4413,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -4427,8 +4427,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -4441,8 +4441,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -4457,8 +4457,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -4471,8 +4471,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -4482,8 +4482,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -4494,8 +4494,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -4507,8 +4507,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { @@ -4521,8 +4521,8 @@ description: Artifact commands ssi_pattern.kcl { "cmdId": "[uuid]", "range": [ - 611, - 632, + 604, + 625, 0 ], "command": { diff --git a/src/wasm-lib/kcl/tests/ssi_pattern/artifact_graph_flowchart.snap.md b/src/wasm-lib/kcl/tests/ssi_pattern/artifact_graph_flowchart.snap.md index 88c048b744..a919af2d65 100644 --- a/src/wasm-lib/kcl/tests/ssi_pattern/artifact_graph_flowchart.snap.md +++ b/src/wasm-lib/kcl/tests/ssi_pattern/artifact_graph_flowchart.snap.md @@ -11,8 +11,8 @@ flowchart LR 9[Solid2d] end subgraph path28 [Path] - 28["Path
[370, 421, 0]"] - 29["Segment
[370, 421, 0]"] + 28["Path
[370, 414, 0]"] + 29["Segment
[370, 414, 0]"] 30[Solid2d] end 1["Plane
[12, 31, 0]"] @@ -34,7 +34,7 @@ flowchart LR 25["SweepEdge Adjacent"] 26["SweepEdge Opposite"] 27["SweepEdge Adjacent"] - 31["Sweep Extrusion
[611, 632, 0]"] + 31["Sweep Extrusion
[604, 625, 0]"] 32[Wall] 33["SweepEdge Opposite"] 34["SweepEdge Adjacent"] diff --git a/src/wasm-lib/kcl/tests/ssi_pattern/ast.snap b/src/wasm-lib/kcl/tests/ssi_pattern/ast.snap index 73147c779f..43e2e8b74a 100644 --- a/src/wasm-lib/kcl/tests/ssi_pattern/ast.snap +++ b/src/wasm-lib/kcl/tests/ssi_pattern/ast.snap @@ -451,7 +451,7 @@ description: Result of parsing ssi_pattern.kcl }, { "declaration": { - "end": 632, + "end": 625, "id": { "end": 329, "name": "sketch002", @@ -491,88 +491,66 @@ description: Result of parsing ssi_pattern.kcl { "arguments": [ { - "end": 417, - "properties": [ - { - "end": 401, - "key": { - "end": 385, - "name": "center", - "start": 379, - "type": "Identifier" - }, - "start": 379, - "type": "ObjectProperty", - "value": { - "elements": [ - { - "argument": { - "end": 394, - "raw": "2.08", - "start": 390, - "type": "Literal", - "type": "Literal", - "value": { - "value": 2.08, - "suffix": "None" - } - }, - "end": 394, - "operator": "-", - "start": 389, - "type": "UnaryExpression", - "type": "UnaryExpression" - }, - { - "end": 400, - "raw": "47.7", - "start": 396, - "type": "Literal", - "type": "Literal", - "value": { - "value": 47.7, - "suffix": "None" - } + "type": "LabeledArg", + "label": { + "type": "Identifier", + "name": "center" + }, + "arg": { + "elements": [ + { + "argument": { + "end": 392, + "raw": "2.08", + "start": 388, + "type": "Literal", + "type": "Literal", + "value": { + "value": 2.08, + "suffix": "None" } - ], - "end": 401, - "start": 388, - "type": "ArrayExpression", - "type": "ArrayExpression" - } - }, - { - "end": 415, - "key": { - "end": 409, - "name": "radius", - "start": 403, - "type": "Identifier" + }, + "end": 392, + "operator": "-", + "start": 387, + "type": "UnaryExpression", + "type": "UnaryExpression" }, - "start": 403, - "type": "ObjectProperty", - "value": { - "end": 415, - "raw": "1.4", - "start": 412, + { + "end": 398, + "raw": "47.7", + "start": 394, "type": "Literal", "type": "Literal", "value": { - "value": 1.4, + "value": 47.7, "suffix": "None" } } - } - ], - "start": 377, - "type": "ObjectExpression", - "type": "ObjectExpression" + ], + "end": 399, + "start": 386, + "type": "ArrayExpression", + "type": "ArrayExpression" + } }, { - "end": 420, - "start": 419, - "type": "PipeSubstitution", - "type": "PipeSubstitution" + "type": "LabeledArg", + "label": { + "type": "Identifier", + "name": "radius" + }, + "arg": { + "end": 413, + "raw": "1.4", + "start": 410, + "type": "Literal", + "type": "Literal", + "value": { + "value": 1.4, + "suffix": "None" + } + } } ], "callee": { @@ -581,10 +559,11 @@ description: Result of parsing ssi_pattern.kcl "start": 370, "type": "Identifier" }, - "end": 421, + "end": 414, "start": 370, - "type": "CallExpression", - "type": "CallExpression" + "type": "CallExpressionKw", + "type": "CallExpressionKw", + "unlabeled": null }, { "arguments": [ @@ -595,9 +574,9 @@ description: Result of parsing ssi_pattern.kcl "name": "instances" }, "arg": { - "end": 456, + "end": 449, "raw": "5", - "start": 455, + "start": 448, "type": "Literal", "type": "Literal", "value": { @@ -613,9 +592,9 @@ description: Result of parsing ssi_pattern.kcl "name": "distance" }, "arg": { - "end": 470, + "end": 463, "raw": "5", - "start": 469, + "start": 462, "type": "Literal", "type": "Literal", "value": { @@ -633,9 +612,9 @@ description: Result of parsing ssi_pattern.kcl "arg": { "elements": [ { - "end": 481, + "end": 474, "raw": "1", - "start": 480, + "start": 473, "type": "Literal", "type": "Literal", "value": { @@ -644,9 +623,9 @@ description: Result of parsing ssi_pattern.kcl } }, { - "end": 484, + "end": 477, "raw": "0", - "start": 483, + "start": 476, "type": "Literal", "type": "Literal", "value": { @@ -655,21 +634,21 @@ description: Result of parsing ssi_pattern.kcl } } ], - "end": 485, - "start": 479, + "end": 478, + "start": 472, "type": "ArrayExpression", "type": "ArrayExpression" } } ], "callee": { - "end": 442, + "end": 435, "name": "patternLinear2d", - "start": 427, + "start": 420, "type": "Identifier" }, - "end": 486, - "start": 427, + "end": 479, + "start": 420, "type": "CallExpressionKw", "type": "CallExpressionKw", "unlabeled": null @@ -683,9 +662,9 @@ description: Result of parsing ssi_pattern.kcl "name": "instances" }, "arg": { - "end": 574, + "end": 567, "raw": "6", - "start": 573, + "start": 566, "type": "Literal", "type": "Literal", "value": { @@ -701,9 +680,9 @@ description: Result of parsing ssi_pattern.kcl "name": "distance" }, "arg": { - "end": 588, + "end": 581, "raw": "4", - "start": 587, + "start": 580, "type": "Literal", "type": "Literal", "value": { @@ -721,9 +700,9 @@ description: Result of parsing ssi_pattern.kcl "arg": { "elements": [ { - "end": 599, + "end": 592, "raw": "0", - "start": 598, + "start": 591, "type": "Literal", "type": "Literal", "value": { @@ -733,9 +712,9 @@ description: Result of parsing ssi_pattern.kcl }, { "argument": { - "end": 603, + "end": 596, "raw": "1", - "start": 602, + "start": 595, "type": "Literal", "type": "Literal", "value": { @@ -743,28 +722,28 @@ description: Result of parsing ssi_pattern.kcl "suffix": "None" } }, - "end": 603, + "end": 596, "operator": "-", - "start": 601, + "start": 594, "type": "UnaryExpression", "type": "UnaryExpression" } ], - "end": 604, - "start": 597, + "end": 597, + "start": 590, "type": "ArrayExpression", "type": "ArrayExpression" } } ], "callee": { - "end": 560, + "end": 553, "name": "patternLinear2d", - "start": 545, + "start": 538, "type": "Identifier" }, - "end": 605, - "start": 545, + "end": 598, + "start": 538, "type": "CallExpressionKw", "type": "CallExpressionKw", "unlabeled": null @@ -779,9 +758,9 @@ description: Result of parsing ssi_pattern.kcl }, "arg": { "argument": { - "end": 631, + "end": 624, "raw": "40", - "start": 629, + "start": 622, "type": "Literal", "type": "Literal", "value": { @@ -789,34 +768,34 @@ description: Result of parsing ssi_pattern.kcl "suffix": "None" } }, - "end": 631, + "end": 624, "operator": "-", - "start": 628, + "start": 621, "type": "UnaryExpression", "type": "UnaryExpression" } } ], "callee": { - "end": 618, + "end": 611, "name": "extrude", - "start": 611, + "start": 604, "type": "Identifier" }, - "end": 632, - "start": 611, + "end": 625, + "start": 604, "type": "CallExpressionKw", "type": "CallExpressionKw", "unlabeled": null } ], - "end": 632, + "end": 625, "nonCodeMeta": { "nonCodeNodes": { "2": [ { - "end": 539, - "start": 488, + "end": 532, + "start": 481, "type": "NonCodeNode", "value": { "type": "blockComment", @@ -835,14 +814,14 @@ description: Result of parsing ssi_pattern.kcl "start": 320, "type": "VariableDeclarator" }, - "end": 632, + "end": 625, "kind": "const", "start": 320, "type": "VariableDeclaration", "type": "VariableDeclaration" } ], - "end": 633, + "end": 626, "nonCodeMeta": { "nonCodeNodes": { "0": [ diff --git a/src/wasm-lib/kcl/tests/ssi_pattern/input.kcl b/src/wasm-lib/kcl/tests/ssi_pattern/input.kcl index fd7b10e98d..d980bacdba 100644 --- a/src/wasm-lib/kcl/tests/ssi_pattern/input.kcl +++ b/src/wasm-lib/kcl/tests/ssi_pattern/input.kcl @@ -10,7 +10,7 @@ sketch001 = startSketchOn('XZ') extrude001 = extrude(sketch001, length = 50) sketch002 = startSketchOn(extrude001, seg01) - |> circle({ center = [-2.08, 47.7], radius = 1.4 }, %) + |> circle(center = [-2.08, 47.7], radius = 1.4) |> patternLinear2d(instances = 5, distance = 5, axis = [1, 0]) // Instances was reduced from 12 to speed this up. |> patternLinear2d(instances = 6, distance = 4, axis = [0, -1]) diff --git a/src/wasm-lib/kcl/tests/ssi_pattern/ops.snap b/src/wasm-lib/kcl/tests/ssi_pattern/ops.snap index 02c29fe2a0..b4590c97f8 100644 --- a/src/wasm-lib/kcl/tests/ssi_pattern/ops.snap +++ b/src/wasm-lib/kcl/tests/ssi_pattern/ops.snap @@ -124,16 +124,16 @@ description: Operations executed ssi_pattern.kcl } }, "sourceRange": [ - 628, - 631, + 621, + 624, 0 ] } }, "name": "extrude", "sourceRange": [ - 611, - 632, + 604, + 625, 0 ], "type": "StdLibCall", diff --git a/src/wasm-lib/kcl/tests/ssi_pattern/program_memory.snap b/src/wasm-lib/kcl/tests/ssi_pattern/program_memory.snap index c8b35f51f0..39ec9958ae 100644 --- a/src/wasm-lib/kcl/tests/ssi_pattern/program_memory.snap +++ b/src/wasm-lib/kcl/tests/ssi_pattern/program_memory.snap @@ -735,7 +735,7 @@ description: Variables in memory after executing ssi_pattern.kcl "id": "[uuid]", "sourceRange": [ 370, - 421, + 414, 0 ], "tag": null, @@ -751,7 +751,7 @@ description: Variables in memory after executing ssi_pattern.kcl "id": "[uuid]", "sourceRange": [ 370, - 421, + 414, 0 ] }, @@ -1192,7 +1192,7 @@ description: Variables in memory after executing ssi_pattern.kcl "id": "[uuid]", "sourceRange": [ 370, - 421, + 414, 0 ] } @@ -1206,7 +1206,7 @@ description: Variables in memory after executing ssi_pattern.kcl { "sourceRange": [ 370, - 421, + 414, 0 ] } @@ -1222,7 +1222,7 @@ description: Variables in memory after executing ssi_pattern.kcl { "sourceRange": [ 370, - 421, + 414, 0 ] } @@ -1238,7 +1238,7 @@ description: Variables in memory after executing ssi_pattern.kcl "id": "[uuid]", "sourceRange": [ 370, - 421, + 414, 0 ], "tag": null, @@ -1254,7 +1254,7 @@ description: Variables in memory after executing ssi_pattern.kcl "id": "[uuid]", "sourceRange": [ 370, - 421, + 414, 0 ] }, @@ -1695,7 +1695,7 @@ description: Variables in memory after executing ssi_pattern.kcl "id": "[uuid]", "sourceRange": [ 370, - 421, + 414, 0 ] } @@ -1709,7 +1709,7 @@ description: Variables in memory after executing ssi_pattern.kcl { "sourceRange": [ 370, - 421, + 414, 0 ] } @@ -1725,7 +1725,7 @@ description: Variables in memory after executing ssi_pattern.kcl { "sourceRange": [ 370, - 421, + 414, 0 ] } @@ -1741,7 +1741,7 @@ description: Variables in memory after executing ssi_pattern.kcl "id": "[uuid]", "sourceRange": [ 370, - 421, + 414, 0 ], "tag": null, @@ -1757,7 +1757,7 @@ description: Variables in memory after executing ssi_pattern.kcl "id": "[uuid]", "sourceRange": [ 370, - 421, + 414, 0 ] }, @@ -2198,7 +2198,7 @@ description: Variables in memory after executing ssi_pattern.kcl "id": "[uuid]", "sourceRange": [ 370, - 421, + 414, 0 ] } @@ -2212,7 +2212,7 @@ description: Variables in memory after executing ssi_pattern.kcl { "sourceRange": [ 370, - 421, + 414, 0 ] } @@ -2228,7 +2228,7 @@ description: Variables in memory after executing ssi_pattern.kcl { "sourceRange": [ 370, - 421, + 414, 0 ] } @@ -2244,7 +2244,7 @@ description: Variables in memory after executing ssi_pattern.kcl "id": "[uuid]", "sourceRange": [ 370, - 421, + 414, 0 ], "tag": null, @@ -2260,7 +2260,7 @@ description: Variables in memory after executing ssi_pattern.kcl "id": "[uuid]", "sourceRange": [ 370, - 421, + 414, 0 ] }, @@ -2701,7 +2701,7 @@ description: Variables in memory after executing ssi_pattern.kcl "id": "[uuid]", "sourceRange": [ 370, - 421, + 414, 0 ] } @@ -2715,7 +2715,7 @@ description: Variables in memory after executing ssi_pattern.kcl { "sourceRange": [ 370, - 421, + 414, 0 ] } @@ -2731,7 +2731,7 @@ description: Variables in memory after executing ssi_pattern.kcl { "sourceRange": [ 370, - 421, + 414, 0 ] } @@ -2747,7 +2747,7 @@ description: Variables in memory after executing ssi_pattern.kcl "id": "[uuid]", "sourceRange": [ 370, - 421, + 414, 0 ], "tag": null, @@ -2763,7 +2763,7 @@ description: Variables in memory after executing ssi_pattern.kcl "id": "[uuid]", "sourceRange": [ 370, - 421, + 414, 0 ] }, @@ -3204,7 +3204,7 @@ description: Variables in memory after executing ssi_pattern.kcl "id": "[uuid]", "sourceRange": [ 370, - 421, + 414, 0 ] } @@ -3218,7 +3218,7 @@ description: Variables in memory after executing ssi_pattern.kcl { "sourceRange": [ 370, - 421, + 414, 0 ] } @@ -3234,7 +3234,7 @@ description: Variables in memory after executing ssi_pattern.kcl { "sourceRange": [ 370, - 421, + 414, 0 ] } @@ -3250,7 +3250,7 @@ description: Variables in memory after executing ssi_pattern.kcl "id": "[uuid]", "sourceRange": [ 370, - 421, + 414, 0 ], "tag": null, @@ -3266,7 +3266,7 @@ description: Variables in memory after executing ssi_pattern.kcl "id": "[uuid]", "sourceRange": [ 370, - 421, + 414, 0 ] }, @@ -3707,7 +3707,7 @@ description: Variables in memory after executing ssi_pattern.kcl "id": "[uuid]", "sourceRange": [ 370, - 421, + 414, 0 ] } @@ -3721,7 +3721,7 @@ description: Variables in memory after executing ssi_pattern.kcl { "sourceRange": [ 370, - 421, + 414, 0 ] } @@ -3737,7 +3737,7 @@ description: Variables in memory after executing ssi_pattern.kcl { "sourceRange": [ 370, - 421, + 414, 0 ] } @@ -3753,7 +3753,7 @@ description: Variables in memory after executing ssi_pattern.kcl "id": "[uuid]", "sourceRange": [ 370, - 421, + 414, 0 ], "tag": null, @@ -3769,7 +3769,7 @@ description: Variables in memory after executing ssi_pattern.kcl "id": "[uuid]", "sourceRange": [ 370, - 421, + 414, 0 ] }, @@ -4210,7 +4210,7 @@ description: Variables in memory after executing ssi_pattern.kcl "id": "[uuid]", "sourceRange": [ 370, - 421, + 414, 0 ] } @@ -4224,7 +4224,7 @@ description: Variables in memory after executing ssi_pattern.kcl { "sourceRange": [ 370, - 421, + 414, 0 ] } @@ -4240,7 +4240,7 @@ description: Variables in memory after executing ssi_pattern.kcl { "sourceRange": [ 370, - 421, + 414, 0 ] } @@ -4256,7 +4256,7 @@ description: Variables in memory after executing ssi_pattern.kcl "id": "[uuid]", "sourceRange": [ 370, - 421, + 414, 0 ], "tag": null, @@ -4272,7 +4272,7 @@ description: Variables in memory after executing ssi_pattern.kcl "id": "[uuid]", "sourceRange": [ 370, - 421, + 414, 0 ] }, @@ -4713,7 +4713,7 @@ description: Variables in memory after executing ssi_pattern.kcl "id": "[uuid]", "sourceRange": [ 370, - 421, + 414, 0 ] } @@ -4727,7 +4727,7 @@ description: Variables in memory after executing ssi_pattern.kcl { "sourceRange": [ 370, - 421, + 414, 0 ] } @@ -4743,7 +4743,7 @@ description: Variables in memory after executing ssi_pattern.kcl { "sourceRange": [ 370, - 421, + 414, 0 ] } @@ -4759,7 +4759,7 @@ description: Variables in memory after executing ssi_pattern.kcl "id": "[uuid]", "sourceRange": [ 370, - 421, + 414, 0 ], "tag": null, @@ -4775,7 +4775,7 @@ description: Variables in memory after executing ssi_pattern.kcl "id": "[uuid]", "sourceRange": [ 370, - 421, + 414, 0 ] }, @@ -5216,7 +5216,7 @@ description: Variables in memory after executing ssi_pattern.kcl "id": "[uuid]", "sourceRange": [ 370, - 421, + 414, 0 ] } @@ -5230,7 +5230,7 @@ description: Variables in memory after executing ssi_pattern.kcl { "sourceRange": [ 370, - 421, + 414, 0 ] } @@ -5246,7 +5246,7 @@ description: Variables in memory after executing ssi_pattern.kcl { "sourceRange": [ 370, - 421, + 414, 0 ] } @@ -5262,7 +5262,7 @@ description: Variables in memory after executing ssi_pattern.kcl "id": "[uuid]", "sourceRange": [ 370, - 421, + 414, 0 ], "tag": null, @@ -5278,7 +5278,7 @@ description: Variables in memory after executing ssi_pattern.kcl "id": "[uuid]", "sourceRange": [ 370, - 421, + 414, 0 ] }, @@ -5719,7 +5719,7 @@ description: Variables in memory after executing ssi_pattern.kcl "id": "[uuid]", "sourceRange": [ 370, - 421, + 414, 0 ] } @@ -5733,7 +5733,7 @@ description: Variables in memory after executing ssi_pattern.kcl { "sourceRange": [ 370, - 421, + 414, 0 ] } @@ -5749,7 +5749,7 @@ description: Variables in memory after executing ssi_pattern.kcl { "sourceRange": [ 370, - 421, + 414, 0 ] } @@ -5765,7 +5765,7 @@ description: Variables in memory after executing ssi_pattern.kcl "id": "[uuid]", "sourceRange": [ 370, - 421, + 414, 0 ], "tag": null, @@ -5781,7 +5781,7 @@ description: Variables in memory after executing ssi_pattern.kcl "id": "[uuid]", "sourceRange": [ 370, - 421, + 414, 0 ] }, @@ -6222,7 +6222,7 @@ description: Variables in memory after executing ssi_pattern.kcl "id": "[uuid]", "sourceRange": [ 370, - 421, + 414, 0 ] } @@ -6236,7 +6236,7 @@ description: Variables in memory after executing ssi_pattern.kcl { "sourceRange": [ 370, - 421, + 414, 0 ] } @@ -6252,7 +6252,7 @@ description: Variables in memory after executing ssi_pattern.kcl { "sourceRange": [ 370, - 421, + 414, 0 ] } @@ -6268,7 +6268,7 @@ description: Variables in memory after executing ssi_pattern.kcl "id": "[uuid]", "sourceRange": [ 370, - 421, + 414, 0 ], "tag": null, @@ -6284,7 +6284,7 @@ description: Variables in memory after executing ssi_pattern.kcl "id": "[uuid]", "sourceRange": [ 370, - 421, + 414, 0 ] }, @@ -6725,7 +6725,7 @@ description: Variables in memory after executing ssi_pattern.kcl "id": "[uuid]", "sourceRange": [ 370, - 421, + 414, 0 ] } @@ -6739,7 +6739,7 @@ description: Variables in memory after executing ssi_pattern.kcl { "sourceRange": [ 370, - 421, + 414, 0 ] } @@ -6755,7 +6755,7 @@ description: Variables in memory after executing ssi_pattern.kcl { "sourceRange": [ 370, - 421, + 414, 0 ] } @@ -6771,7 +6771,7 @@ description: Variables in memory after executing ssi_pattern.kcl "id": "[uuid]", "sourceRange": [ 370, - 421, + 414, 0 ], "tag": null, @@ -6787,7 +6787,7 @@ description: Variables in memory after executing ssi_pattern.kcl "id": "[uuid]", "sourceRange": [ 370, - 421, + 414, 0 ] }, @@ -7228,7 +7228,7 @@ description: Variables in memory after executing ssi_pattern.kcl "id": "[uuid]", "sourceRange": [ 370, - 421, + 414, 0 ] } @@ -7242,7 +7242,7 @@ description: Variables in memory after executing ssi_pattern.kcl { "sourceRange": [ 370, - 421, + 414, 0 ] } @@ -7258,7 +7258,7 @@ description: Variables in memory after executing ssi_pattern.kcl { "sourceRange": [ 370, - 421, + 414, 0 ] } @@ -7274,7 +7274,7 @@ description: Variables in memory after executing ssi_pattern.kcl "id": "[uuid]", "sourceRange": [ 370, - 421, + 414, 0 ], "tag": null, @@ -7290,7 +7290,7 @@ description: Variables in memory after executing ssi_pattern.kcl "id": "[uuid]", "sourceRange": [ 370, - 421, + 414, 0 ] }, @@ -7731,7 +7731,7 @@ description: Variables in memory after executing ssi_pattern.kcl "id": "[uuid]", "sourceRange": [ 370, - 421, + 414, 0 ] } @@ -7745,7 +7745,7 @@ description: Variables in memory after executing ssi_pattern.kcl { "sourceRange": [ 370, - 421, + 414, 0 ] } @@ -7761,7 +7761,7 @@ description: Variables in memory after executing ssi_pattern.kcl { "sourceRange": [ 370, - 421, + 414, 0 ] } @@ -7777,7 +7777,7 @@ description: Variables in memory after executing ssi_pattern.kcl "id": "[uuid]", "sourceRange": [ 370, - 421, + 414, 0 ], "tag": null, @@ -7793,7 +7793,7 @@ description: Variables in memory after executing ssi_pattern.kcl "id": "[uuid]", "sourceRange": [ 370, - 421, + 414, 0 ] }, @@ -8234,7 +8234,7 @@ description: Variables in memory after executing ssi_pattern.kcl "id": "[uuid]", "sourceRange": [ 370, - 421, + 414, 0 ] } @@ -8248,7 +8248,7 @@ description: Variables in memory after executing ssi_pattern.kcl { "sourceRange": [ 370, - 421, + 414, 0 ] } @@ -8264,7 +8264,7 @@ description: Variables in memory after executing ssi_pattern.kcl { "sourceRange": [ 370, - 421, + 414, 0 ] } @@ -8280,7 +8280,7 @@ description: Variables in memory after executing ssi_pattern.kcl "id": "[uuid]", "sourceRange": [ 370, - 421, + 414, 0 ], "tag": null, @@ -8296,7 +8296,7 @@ description: Variables in memory after executing ssi_pattern.kcl "id": "[uuid]", "sourceRange": [ 370, - 421, + 414, 0 ] }, @@ -8737,7 +8737,7 @@ description: Variables in memory after executing ssi_pattern.kcl "id": "[uuid]", "sourceRange": [ 370, - 421, + 414, 0 ] } @@ -8751,7 +8751,7 @@ description: Variables in memory after executing ssi_pattern.kcl { "sourceRange": [ 370, - 421, + 414, 0 ] } @@ -8767,7 +8767,7 @@ description: Variables in memory after executing ssi_pattern.kcl { "sourceRange": [ 370, - 421, + 414, 0 ] } @@ -8783,7 +8783,7 @@ description: Variables in memory after executing ssi_pattern.kcl "id": "[uuid]", "sourceRange": [ 370, - 421, + 414, 0 ], "tag": null, @@ -8799,7 +8799,7 @@ description: Variables in memory after executing ssi_pattern.kcl "id": "[uuid]", "sourceRange": [ 370, - 421, + 414, 0 ] }, @@ -9240,7 +9240,7 @@ description: Variables in memory after executing ssi_pattern.kcl "id": "[uuid]", "sourceRange": [ 370, - 421, + 414, 0 ] } @@ -9254,7 +9254,7 @@ description: Variables in memory after executing ssi_pattern.kcl { "sourceRange": [ 370, - 421, + 414, 0 ] } @@ -9270,7 +9270,7 @@ description: Variables in memory after executing ssi_pattern.kcl { "sourceRange": [ 370, - 421, + 414, 0 ] } @@ -9286,7 +9286,7 @@ description: Variables in memory after executing ssi_pattern.kcl "id": "[uuid]", "sourceRange": [ 370, - 421, + 414, 0 ], "tag": null, @@ -9302,7 +9302,7 @@ description: Variables in memory after executing ssi_pattern.kcl "id": "[uuid]", "sourceRange": [ 370, - 421, + 414, 0 ] }, @@ -9743,7 +9743,7 @@ description: Variables in memory after executing ssi_pattern.kcl "id": "[uuid]", "sourceRange": [ 370, - 421, + 414, 0 ] } @@ -9757,7 +9757,7 @@ description: Variables in memory after executing ssi_pattern.kcl { "sourceRange": [ 370, - 421, + 414, 0 ] } @@ -9773,7 +9773,7 @@ description: Variables in memory after executing ssi_pattern.kcl { "sourceRange": [ 370, - 421, + 414, 0 ] } @@ -9789,7 +9789,7 @@ description: Variables in memory after executing ssi_pattern.kcl "id": "[uuid]", "sourceRange": [ 370, - 421, + 414, 0 ], "tag": null, @@ -9805,7 +9805,7 @@ description: Variables in memory after executing ssi_pattern.kcl "id": "[uuid]", "sourceRange": [ 370, - 421, + 414, 0 ] }, @@ -10246,7 +10246,7 @@ description: Variables in memory after executing ssi_pattern.kcl "id": "[uuid]", "sourceRange": [ 370, - 421, + 414, 0 ] } @@ -10260,7 +10260,7 @@ description: Variables in memory after executing ssi_pattern.kcl { "sourceRange": [ 370, - 421, + 414, 0 ] } @@ -10276,7 +10276,7 @@ description: Variables in memory after executing ssi_pattern.kcl { "sourceRange": [ 370, - 421, + 414, 0 ] } @@ -10292,7 +10292,7 @@ description: Variables in memory after executing ssi_pattern.kcl "id": "[uuid]", "sourceRange": [ 370, - 421, + 414, 0 ], "tag": null, @@ -10308,7 +10308,7 @@ description: Variables in memory after executing ssi_pattern.kcl "id": "[uuid]", "sourceRange": [ 370, - 421, + 414, 0 ] }, @@ -10749,7 +10749,7 @@ description: Variables in memory after executing ssi_pattern.kcl "id": "[uuid]", "sourceRange": [ 370, - 421, + 414, 0 ] } @@ -10763,7 +10763,7 @@ description: Variables in memory after executing ssi_pattern.kcl { "sourceRange": [ 370, - 421, + 414, 0 ] } @@ -10779,7 +10779,7 @@ description: Variables in memory after executing ssi_pattern.kcl { "sourceRange": [ 370, - 421, + 414, 0 ] } @@ -10795,7 +10795,7 @@ description: Variables in memory after executing ssi_pattern.kcl "id": "[uuid]", "sourceRange": [ 370, - 421, + 414, 0 ], "tag": null, @@ -10811,7 +10811,7 @@ description: Variables in memory after executing ssi_pattern.kcl "id": "[uuid]", "sourceRange": [ 370, - 421, + 414, 0 ] }, @@ -11252,7 +11252,7 @@ description: Variables in memory after executing ssi_pattern.kcl "id": "[uuid]", "sourceRange": [ 370, - 421, + 414, 0 ] } @@ -11266,7 +11266,7 @@ description: Variables in memory after executing ssi_pattern.kcl { "sourceRange": [ 370, - 421, + 414, 0 ] } @@ -11282,7 +11282,7 @@ description: Variables in memory after executing ssi_pattern.kcl { "sourceRange": [ 370, - 421, + 414, 0 ] } @@ -11298,7 +11298,7 @@ description: Variables in memory after executing ssi_pattern.kcl "id": "[uuid]", "sourceRange": [ 370, - 421, + 414, 0 ], "tag": null, @@ -11314,7 +11314,7 @@ description: Variables in memory after executing ssi_pattern.kcl "id": "[uuid]", "sourceRange": [ 370, - 421, + 414, 0 ] }, @@ -11755,7 +11755,7 @@ description: Variables in memory after executing ssi_pattern.kcl "id": "[uuid]", "sourceRange": [ 370, - 421, + 414, 0 ] } @@ -11769,7 +11769,7 @@ description: Variables in memory after executing ssi_pattern.kcl { "sourceRange": [ 370, - 421, + 414, 0 ] } @@ -11785,7 +11785,7 @@ description: Variables in memory after executing ssi_pattern.kcl { "sourceRange": [ 370, - 421, + 414, 0 ] } @@ -11801,7 +11801,7 @@ description: Variables in memory after executing ssi_pattern.kcl "id": "[uuid]", "sourceRange": [ 370, - 421, + 414, 0 ], "tag": null, @@ -11817,7 +11817,7 @@ description: Variables in memory after executing ssi_pattern.kcl "id": "[uuid]", "sourceRange": [ 370, - 421, + 414, 0 ] }, @@ -12258,7 +12258,7 @@ description: Variables in memory after executing ssi_pattern.kcl "id": "[uuid]", "sourceRange": [ 370, - 421, + 414, 0 ] } @@ -12272,7 +12272,7 @@ description: Variables in memory after executing ssi_pattern.kcl { "sourceRange": [ 370, - 421, + 414, 0 ] } @@ -12288,7 +12288,7 @@ description: Variables in memory after executing ssi_pattern.kcl { "sourceRange": [ 370, - 421, + 414, 0 ] } @@ -12304,7 +12304,7 @@ description: Variables in memory after executing ssi_pattern.kcl "id": "[uuid]", "sourceRange": [ 370, - 421, + 414, 0 ], "tag": null, @@ -12320,7 +12320,7 @@ description: Variables in memory after executing ssi_pattern.kcl "id": "[uuid]", "sourceRange": [ 370, - 421, + 414, 0 ] }, @@ -12761,7 +12761,7 @@ description: Variables in memory after executing ssi_pattern.kcl "id": "[uuid]", "sourceRange": [ 370, - 421, + 414, 0 ] } @@ -12775,7 +12775,7 @@ description: Variables in memory after executing ssi_pattern.kcl { "sourceRange": [ 370, - 421, + 414, 0 ] } @@ -12791,7 +12791,7 @@ description: Variables in memory after executing ssi_pattern.kcl { "sourceRange": [ 370, - 421, + 414, 0 ] } @@ -12807,7 +12807,7 @@ description: Variables in memory after executing ssi_pattern.kcl "id": "[uuid]", "sourceRange": [ 370, - 421, + 414, 0 ], "tag": null, @@ -12823,7 +12823,7 @@ description: Variables in memory after executing ssi_pattern.kcl "id": "[uuid]", "sourceRange": [ 370, - 421, + 414, 0 ] }, @@ -13264,7 +13264,7 @@ description: Variables in memory after executing ssi_pattern.kcl "id": "[uuid]", "sourceRange": [ 370, - 421, + 414, 0 ] } @@ -13278,7 +13278,7 @@ description: Variables in memory after executing ssi_pattern.kcl { "sourceRange": [ 370, - 421, + 414, 0 ] } @@ -13294,7 +13294,7 @@ description: Variables in memory after executing ssi_pattern.kcl { "sourceRange": [ 370, - 421, + 414, 0 ] } @@ -13310,7 +13310,7 @@ description: Variables in memory after executing ssi_pattern.kcl "id": "[uuid]", "sourceRange": [ 370, - 421, + 414, 0 ], "tag": null, @@ -13326,7 +13326,7 @@ description: Variables in memory after executing ssi_pattern.kcl "id": "[uuid]", "sourceRange": [ 370, - 421, + 414, 0 ] }, @@ -13767,7 +13767,7 @@ description: Variables in memory after executing ssi_pattern.kcl "id": "[uuid]", "sourceRange": [ 370, - 421, + 414, 0 ] } @@ -13781,7 +13781,7 @@ description: Variables in memory after executing ssi_pattern.kcl { "sourceRange": [ 370, - 421, + 414, 0 ] } @@ -13797,7 +13797,7 @@ description: Variables in memory after executing ssi_pattern.kcl { "sourceRange": [ 370, - 421, + 414, 0 ] } @@ -13813,7 +13813,7 @@ description: Variables in memory after executing ssi_pattern.kcl "id": "[uuid]", "sourceRange": [ 370, - 421, + 414, 0 ], "tag": null, @@ -13829,7 +13829,7 @@ description: Variables in memory after executing ssi_pattern.kcl "id": "[uuid]", "sourceRange": [ 370, - 421, + 414, 0 ] }, @@ -14270,7 +14270,7 @@ description: Variables in memory after executing ssi_pattern.kcl "id": "[uuid]", "sourceRange": [ 370, - 421, + 414, 0 ] } @@ -14284,7 +14284,7 @@ description: Variables in memory after executing ssi_pattern.kcl { "sourceRange": [ 370, - 421, + 414, 0 ] } @@ -14300,7 +14300,7 @@ description: Variables in memory after executing ssi_pattern.kcl { "sourceRange": [ 370, - 421, + 414, 0 ] } @@ -14316,7 +14316,7 @@ description: Variables in memory after executing ssi_pattern.kcl "id": "[uuid]", "sourceRange": [ 370, - 421, + 414, 0 ], "tag": null, @@ -14332,7 +14332,7 @@ description: Variables in memory after executing ssi_pattern.kcl "id": "[uuid]", "sourceRange": [ 370, - 421, + 414, 0 ] }, @@ -14773,7 +14773,7 @@ description: Variables in memory after executing ssi_pattern.kcl "id": "[uuid]", "sourceRange": [ 370, - 421, + 414, 0 ] } @@ -14787,7 +14787,7 @@ description: Variables in memory after executing ssi_pattern.kcl { "sourceRange": [ 370, - 421, + 414, 0 ] } @@ -14803,7 +14803,7 @@ description: Variables in memory after executing ssi_pattern.kcl { "sourceRange": [ 370, - 421, + 414, 0 ] } @@ -14819,7 +14819,7 @@ description: Variables in memory after executing ssi_pattern.kcl "id": "[uuid]", "sourceRange": [ 370, - 421, + 414, 0 ], "tag": null, @@ -14835,7 +14835,7 @@ description: Variables in memory after executing ssi_pattern.kcl "id": "[uuid]", "sourceRange": [ 370, - 421, + 414, 0 ] }, @@ -15276,7 +15276,7 @@ description: Variables in memory after executing ssi_pattern.kcl "id": "[uuid]", "sourceRange": [ 370, - 421, + 414, 0 ] } @@ -15290,7 +15290,7 @@ description: Variables in memory after executing ssi_pattern.kcl { "sourceRange": [ 370, - 421, + 414, 0 ] } @@ -15306,7 +15306,7 @@ description: Variables in memory after executing ssi_pattern.kcl { "sourceRange": [ 370, - 421, + 414, 0 ] } @@ -15322,7 +15322,7 @@ description: Variables in memory after executing ssi_pattern.kcl "id": "[uuid]", "sourceRange": [ 370, - 421, + 414, 0 ], "tag": null, @@ -15338,7 +15338,7 @@ description: Variables in memory after executing ssi_pattern.kcl "id": "[uuid]", "sourceRange": [ 370, - 421, + 414, 0 ] }, @@ -15779,7 +15779,7 @@ description: Variables in memory after executing ssi_pattern.kcl "id": "[uuid]", "sourceRange": [ 370, - 421, + 414, 0 ] } @@ -15793,7 +15793,7 @@ description: Variables in memory after executing ssi_pattern.kcl { "sourceRange": [ 370, - 421, + 414, 0 ] } @@ -15809,7 +15809,7 @@ description: Variables in memory after executing ssi_pattern.kcl { "sourceRange": [ 370, - 421, + 414, 0 ] } diff --git a/src/wasm-lib/tests/executor/inputs/cylinder.kcl b/src/wasm-lib/tests/executor/inputs/cylinder.kcl index c299946198..94a7b4372b 100644 --- a/src/wasm-lib/tests/executor/inputs/cylinder.kcl +++ b/src/wasm-lib/tests/executor/inputs/cylinder.kcl @@ -1,3 +1,3 @@ const cylinder = startSketchOn('XY') - |> circle({ center: [0, 0], radius: 22 }, %) + |> circle(center= [0, 0], radius= 22) |> extrude(length = 14) diff --git a/src/wasm-lib/tests/executor/inputs/fillet-and-shell.kcl b/src/wasm-lib/tests/executor/inputs/fillet-and-shell.kcl index b2fe8bb468..3520889feb 100644 --- a/src/wasm-lib/tests/executor/inputs/fillet-and-shell.kcl +++ b/src/wasm-lib/tests/executor/inputs/fillet-and-shell.kcl @@ -61,8 +61,8 @@ const case = startSketchOn('XY') fn m25Screw = (x, y, height) => { const screw = startSketchOn("XY") |> startProfileAt([0, 0], %) - |> circle({ center: [x, y], radius: 2.5 }, %) - |> hole(circle({ center: [x, y], radius: 1.25 }, %), %) + |> circle(center= [x, y], radius=2.5) + |> hole(circle(center= [x, y], radius = 1.25), %) |> extrude(length = height) return screw } diff --git a/src/wasm-lib/tests/executor/inputs/focusrite_scarlett_mounting_braket.kcl b/src/wasm-lib/tests/executor/inputs/focusrite_scarlett_mounting_braket.kcl index f09be072d9..feffe98843 100644 --- a/src/wasm-lib/tests/executor/inputs/focusrite_scarlett_mounting_braket.kcl +++ b/src/wasm-lib/tests/executor/inputs/focusrite_scarlett_mounting_braket.kcl @@ -80,13 +80,13 @@ const tabsR = startSketchOn(tabPlane) |> line(end = [0, -tabLength / 3 * 2], tag = $edge12) |> line(end = [-tabWidth, -tabLength / 3], tag = $edge13) |> close(tag = $edge14) - |> hole(circle({ - center: [ + |> hole(circle( + center = [ width / 2 + thk + tabWidth / 2, length / 2 + thk - (tabLength / (3 / 2)) ], - radius: holeDiam / 2 - }, %), %) + radius = holeDiam / 2 + ), %) |> extrude(length = -tabThk) |> fillet( radius = holeDiam / 2, @@ -108,13 +108,13 @@ const tabsL = startSketchOn(tabPlane) |> line(end = [0, -tabLength / 3 * 2], tag = $edge22) |> line(end = [tabWidth, -tabLength / 3], tag = $edge23) |> close(tag = $edge24) - |> hole(circle({ - center: [ + |> hole(circle( + center= [ -width / 2 - thk - (tabWidth / 2), length / 2 + thk - (tabLength / (3 / 2)) ], - radius: holeDiam / 2 - }, %), %) + radius= holeDiam / 2 + ), %) |> extrude(length = -tabThk) |> fillet( radius = holeDiam / 2, diff --git a/src/wasm-lib/tests/executor/inputs/global-tags.kcl b/src/wasm-lib/tests/executor/inputs/global-tags.kcl index cdb491d776..01930cb1c2 100644 --- a/src/wasm-lib/tests/executor/inputs/global-tags.kcl +++ b/src/wasm-lib/tests/executor/inputs/global-tags.kcl @@ -80,13 +80,13 @@ const tabsR = startSketchOn(tabPlane) |> line(end = [0, -tabLength / 3 * 2], tag = $edge12) |> line(end = [-tabWidth, -tabLength / 3], tag = $edge13) |> close(tag = $edge14) - |> hole(circle({ - center: [ + |> hole(circle( + center= [ width / 2 + thk + tabWidth / 2, length / 2 + thk - (tabLength / (3 / 2)) ], - radius: holeDiam / 2 - }, %), %) + radius= holeDiam / 2 + ), %) |> extrude(length = -tabThk) |> fillet( radius = holeDiam / 2, @@ -108,13 +108,13 @@ const tabsL = startSketchOn(tabPlane) |> line(end = [0, -tabLength / 3 * 2], tag = $edge22) |> line(end = [tabWidth, -tabLength / 3], tag = $edge23) |> close(tag = $edge24) - |> hole(circle({ - center: [ + |> hole(circle( + center= [ -width / 2 - thk - (tabWidth / 2), length / 2 + thk - (tabLength / (3 / 2)) ], - radius: holeDiam / 2 - }, %), %) + radius= holeDiam / 2 + ), %) |> extrude(length = -tabThk) |> fillet( radius = holeDiam / 2, diff --git a/src/wasm-lib/tests/executor/inputs/helix_defaults.kcl b/src/wasm-lib/tests/executor/inputs/helix_defaults.kcl index b948307dcb..68ddef5c88 100644 --- a/src/wasm-lib/tests/executor/inputs/helix_defaults.kcl +++ b/src/wasm-lib/tests/executor/inputs/helix_defaults.kcl @@ -1,4 +1,4 @@ const part001 = startSketchOn('XY') - |> circle({ center: [5, 5], radius: 10 }, %) + |> circle(center= [5, 5], radius= 10) |> extrude(length = 10) |> helixRevolutions({revolutions = 16, angleStart = 0}, %) diff --git a/src/wasm-lib/tests/executor/inputs/helix_defaults_negative_extrude.kcl b/src/wasm-lib/tests/executor/inputs/helix_defaults_negative_extrude.kcl index 8086e5c72a..23a8170e07 100644 --- a/src/wasm-lib/tests/executor/inputs/helix_defaults_negative_extrude.kcl +++ b/src/wasm-lib/tests/executor/inputs/helix_defaults_negative_extrude.kcl @@ -1,4 +1,4 @@ const part001 = startSketchOn('XY') - |> circle({ center: [5, 5], radius: 10 }, %) + |> circle(center = [5, 5], radius = 10) |> extrude(length = -10) |> helixRevolutions({revolutions = 16, angleStart = 0}, %) diff --git a/src/wasm-lib/tests/executor/inputs/helix_with_length.kcl b/src/wasm-lib/tests/executor/inputs/helix_with_length.kcl index 00bc773220..9cca910d26 100644 --- a/src/wasm-lib/tests/executor/inputs/helix_with_length.kcl +++ b/src/wasm-lib/tests/executor/inputs/helix_with_length.kcl @@ -1,4 +1,4 @@ const part001 = startSketchOn('XY') - |> circle({ center: [5, 5], radius: 10 }, %) + |> circle(center= [5, 5], radius= 10) |> extrude(length = 10) |> helixRevolutions({revolutions = 16, angleStart = 0, length = 3}, %) diff --git a/src/wasm-lib/tests/executor/inputs/lego.kcl b/src/wasm-lib/tests/executor/inputs/lego.kcl index 684e6bcbbe..b131b07b09 100644 --- a/src/wasm-lib/tests/executor/inputs/lego.kcl +++ b/src/wasm-lib/tests/executor/inputs/lego.kcl @@ -39,10 +39,10 @@ const shellExtrude = startSketchOn(s, "start") |> extrude(length = -(height - t)) const peg = startSketchOn(s, "end") - |> circle({ center: [ + |> circle( center= [ -(total_width / 2 - wSegments), -(total_length / 2 - lSegments) - ], radius: bumpDiam / 2 }, %) + ], radius= bumpDiam / 2) |> patternLinear2d( axis = [1, 0], instances = 6, diff --git a/src/wasm-lib/tests/executor/inputs/pattern_vase.kcl b/src/wasm-lib/tests/executor/inputs/pattern_vase.kcl index 6e3bdaa706..1549a98eef 100644 --- a/src/wasm-lib/tests/executor/inputs/pattern_vase.kcl +++ b/src/wasm-lib/tests/executor/inputs/pattern_vase.kcl @@ -14,7 +14,7 @@ fn transform = (replicaId) => { // Each layer is just a pretty thin cylinder with a fillet. fn layer = () => { return startSketchOn("XY") // or some other plane idk - |> circle({ center: [0, 0], radius: 1 }, %, $tag1) + |> circle(center = [0, 0], radius = 1, tag = $tag1) |> extrude(length = h) // |> fillet( // radius = h / 2.01, diff --git a/src/wasm-lib/tests/executor/inputs/server-rack-heavy.kcl b/src/wasm-lib/tests/executor/inputs/server-rack-heavy.kcl index 1633986314..ca751b6736 100644 --- a/src/wasm-lib/tests/executor/inputs/server-rack-heavy.kcl +++ b/src/wasm-lib/tests/executor/inputs/server-rack-heavy.kcl @@ -30,22 +30,22 @@ fn caster = (originStart) => { |> xLine(-3.543, %) |> line(endAbsolute = [profileStartX(%), profileStartY(%)]) |> close() - |> hole(circle({ center: [ + |> hole(circle(center = [ (3.543 - 2.756) / 2, (3.543 - 2.756) / 2 - ], radius: 8.8 / 2 / 25.4}, %), %) - |> hole(circle({ center: [ + ], radius = 8.8 / 2 / 25.4), %) + |> hole(circle(center = [ (3.543 - 2.756) / 2 + 2.756, (3.543 - 2.756) / 2 - ], radius: 8.8 / 2 / 25.4 }, %), %) - |> hole(circle({ center: [ + ], radius = 8.8 / 2 / 25.4 ), %) + |> hole(circle(center = [ (3.543 - 2.756) / 2, (3.543 - 2.756) / 2 + 2.756 - ], radius: 8.8 / 2 / 25.4 }, %), %) - |> hole(circle({ center: [ + ], radius = 8.8 / 2 / 25.4 ), %) + |> hole(circle(center = [ (3.543 - 2.756) / 2 + 2.756, (3.543 - 2.756) / 2 + 2.756 - ], radius: 8.8 / 2 / 25.4 }, %), %) + ], radius = 8.8 / 2 / 25.4 ), %) |> extrude(length = -.25) const sketch002c = startSketchOn(sketch001c, 'START') @@ -71,7 +71,7 @@ fn caster = (originStart) => { } } const sketch003c = startSketchOn(plane002c) - |> circle({ center: [0, 1.2], radius 2.48 / 2 }, %) + |> circle(center = [0, 1.2], radius = 2.48 / 2) const examplec = extrude(sketch003c, length = -1 - (3 / 16)) return examplec } diff --git a/src/wasm-lib/tests/executor/inputs/server-rack-lite.kcl b/src/wasm-lib/tests/executor/inputs/server-rack-lite.kcl index 10fb913631..213bbf636d 100644 --- a/src/wasm-lib/tests/executor/inputs/server-rack-lite.kcl +++ b/src/wasm-lib/tests/executor/inputs/server-rack-lite.kcl @@ -28,22 +28,22 @@ fn caster = (originStart) => { |> xLine(-3.543, %) |> line(endAbsolute = [profileStartX(%), profileStartY(%)]) |> close() - |> hole(circle({ center: [ + |> hole(circle(center = [ (3.543 - 2.756) / 2, (3.543 - 2.756) / 2 - ], radius: 8.8 / 2 / 25.4 }, %), %) - |> hole(circle({ center: [ + ], radius= 8.8 / 2 / 25.4), %) + |> hole(circle(center = [ (3.543 - 2.756) / 2 + 2.756, (3.543 - 2.756) / 2 - ], radius: 8.8 / 2 / 25.4 }, %), %) - |> hole(circle({ center: [ + ], radius= 8.8 / 2 / 25.4), %) + |> hole(circle(center = [ (3.543 - 2.756) / 2, (3.543 - 2.756) / 2 + 2.756 - ], radius: 8.8 / 2 / 25.4 }, %), %) - |> hole(circle({ center: [ + ], radius= 8.8 / 2 / 25.4), %) + |> hole(circle(center = [ (3.543 - 2.756) / 2 + 2.756, (3.543 - 2.756) / 2 + 2.756 - ], radius: 8.8 / 2 / 25.4 }, %), %) + ], radius= 8.8 / 2 / 25.4), %) |> extrude(length = -.25) const sketch002c = startSketchOn(sketch001c, 'START') @@ -69,7 +69,7 @@ fn caster = (originStart) => { } } const sketch003c = startSketchOn(plane002c) - |> circle({ center: [0, 1.2], radisu: 2.48 / 2 }, %) + |> circle(center = [0, 1.2], radius = 2.48 / 2) const examplec = extrude(sketch003c, length = -1 - (3 / 16)) return examplec } diff --git a/src/wasm-lib/tests/executor/inputs/sketch_on_face_circle_tagged.kcl b/src/wasm-lib/tests/executor/inputs/sketch_on_face_circle_tagged.kcl index 8d756a9a6f..e11b6405ff 100644 --- a/src/wasm-lib/tests/executor/inputs/sketch_on_face_circle_tagged.kcl +++ b/src/wasm-lib/tests/executor/inputs/sketch_on_face_circle_tagged.kcl @@ -12,5 +12,5 @@ const part001 = cube([0,0], 20) |> extrude(length = 20) const part002 = startSketchOn(part001, "end") - |> circle({ center: [0, 0], radius: 5 }, %, $myCircle) + |> circle(center: [0, 0], radius: 5, tag =$myCircle) |> extrude(length = 5) diff --git a/src/wasm-lib/tests/executor/inputs/slow_lego.kcl.tmpl b/src/wasm-lib/tests/executor/inputs/slow_lego.kcl.tmpl index 52d3c47003..41f5f22eec 100644 --- a/src/wasm-lib/tests/executor/inputs/slow_lego.kcl.tmpl +++ b/src/wasm-lib/tests/executor/inputs/slow_lego.kcl.tmpl @@ -62,10 +62,10 @@ fn tr = (i) => { // Create the pegs on the top of the base const totalBumps = (wbumps * lbumps)-1 const peg = startSketchOn(s, 'end') - |> circle({ center: [ + |> circle( center = [ -(pitch*(wbumps-1)/2), -(pitch*(lbumps-1)/2) - ], radius: bumpDiam / 2 }, %) + ], radius = bumpDiam / 2) |> patternLinear2d( axis = [1, 0], instances = wbumps, diff --git a/src/wasm-lib/tests/executor/inputs/test-circle-extrude.kcl b/src/wasm-lib/tests/executor/inputs/test-circle-extrude.kcl index dad7fa1df1..cd31727bae 100644 --- a/src/wasm-lib/tests/executor/inputs/test-circle-extrude.kcl +++ b/src/wasm-lib/tests/executor/inputs/test-circle-extrude.kcl @@ -1,4 +1,4 @@ -const sketch002 = startSketchOn('XZ') +sketch002 = startSketchOn('XZ') |> startProfileAt([-108.83, -57.48], %) |> angledLine([0, 105.13], %, $rectangleSegmentA001) |> angledLine([ @@ -10,8 +10,5 @@ const sketch002 = startSketchOn('XZ') -segLen(rectangleSegmentA001) ], %) |> close() -const sketch001 = startSketchOn('XZ') - |> circle({ - center = [318.33, 168.1], - radius = 182.8 - }, %) +sketch001 = startSketchOn('XZ') + |> circle(center = [318.33, 168.1], radius = 182.8) diff --git a/src/wasm-lib/tests/executor/main.rs b/src/wasm-lib/tests/executor/main.rs index 54b2acbf2f..a87dab8e68 100644 --- a/src/wasm-lib/tests/executor/main.rs +++ b/src/wasm-lib/tests/executor/main.rs @@ -219,12 +219,12 @@ wallMountL = 8 bracket = startSketchOn('XY') |> startProfileAt([0, 0], %) |> line(end = [0, wallMountL]) - |> tangentialArc({ radius: filletR, offset: 90 }, %) + |> tangentialArc({ radius= filletR, offset: 90 }, %) |> line(end = [-shelfMountL, 0]) |> line(end = [0, -thickness]) |> line(end = [shelfMountL, 0]) |> tangentialArc({ - radius: filletR - thickness, + radius= filletR - thickness, offset: -90 }, %) |> line(end = [0, -wallMountL]) @@ -270,8 +270,8 @@ async fn kcl_test_holes() { |> line(end = [10, 0]) |> line(end = [0, -10]) |> close() - |> hole(circle({ center: [2, 2], radius: .5 }, %), %) - |> hole(circle({ center: [2, 8], radius: .5 }, %), %) + |> hole(circle(center = [2, 2], radius= .5), %) + |> hole(circle(center = [2, 8], radius= .5), %) |> extrude(length = 2) "#; @@ -323,10 +323,10 @@ holeRadius = 1 holeIndex = 6 part = roundedRectangle([0, 0], 20, 20, 4) - |> hole(circle({ center: [-holeIndex, holeIndex], radius: holeRadius }, %), %) - |> hole(circle({ center: [holeIndex, holeIndex], radius: holeRadius }, %), %) - |> hole(circle({ center: [-holeIndex, -holeIndex], radius: holeRadius }, %), %) - |> hole(circle({ center: [holeIndex, -holeIndex], radius: holeRadius }, %), %) + |> hole(circle(center = [-holeIndex, holeIndex], radius= holeRadius), %) + |> hole(circle(center = [holeIndex, holeIndex], radius= holeRadius), %) + |> hole(circle(center = [-holeIndex, -holeIndex], radius= holeRadius), %) + |> hole(circle(center = [holeIndex, -holeIndex], radius= holeRadius), %) |> extrude(length = 2) "#; @@ -336,7 +336,7 @@ part = roundedRectangle([0, 0], 20, 20, 4) #[tokio::test(flavor = "multi_thread")] async fn kcl_test_top_level_expression() { - let code = r#"startSketchOn('XY') |> circle({ center: [0,0], radius: 22 }, %) |> extrude(length = 14)"#; + let code = r#"startSketchOn('XY') |> circle(center = [0,0], radius= 22) |> extrude(length = 14)"#; let result = execute_and_snapshot(code, UnitLength::Mm, None).await.unwrap(); assert_out("top_level_expression", &result); @@ -347,7 +347,7 @@ async fn kcl_test_patterns_linear_basic_with_math() { let code = r#"num = 12 distance = 5 part = startSketchOn('XY') - |> circle({ center: [0,0], radius: 2 }, %) + |> circle(center = [0,0], radius= 2) |> patternLinear2d(axis = [0,1], instances = num, distance = distance - 1) |> extrude(length = 1) "#; @@ -359,7 +359,7 @@ part = startSketchOn('XY') #[tokio::test(flavor = "multi_thread")] async fn kcl_test_patterns_linear_basic() { let code = r#"part = startSketchOn('XY') - |> circle({ center: [0,0], radius: 2 }, %) + |> circle(center = [0,0], radius= 2) |> patternLinear2d(axis = [0,1], instances = 13, distance = 4) |> extrude(length = 1) "#; @@ -387,7 +387,7 @@ async fn kcl_test_patterns_linear_basic_3d() { #[tokio::test(flavor = "multi_thread")] async fn kcl_test_patterns_linear_basic_negative_distance() { let code = r#"part = startSketchOn('XY') - |> circle({ center: [0,0], radius: 2 }, %) + |> circle(center = [0,0], radius= 2) |> patternLinear2d(axis = [0,1], instances = 13, distance = -2) |> extrude(length = 1) "#; @@ -399,7 +399,7 @@ async fn kcl_test_patterns_linear_basic_negative_distance() { #[tokio::test(flavor = "multi_thread")] async fn kcl_test_patterns_linear_basic_negative_axis() { let code = r#"part = startSketchOn('XY') - |> circle({ center: [0,0], radius: 2 }, %) + |> circle(center = [0,0], radius= 2) |> patternLinear2d(axis = [0,-1], instances = 13, distance = 2) |> extrude(length = 1) "#; @@ -411,7 +411,7 @@ async fn kcl_test_patterns_linear_basic_negative_axis() { #[tokio::test(flavor = "multi_thread")] async fn kcl_test_patterns_linear_basic_holes() { let code = r#"circles = startSketchOn('XY') - |> circle({ center: [5, 5], radius: 1 }, %) + |> circle(center = [5, 5], radius= 1) |> patternLinear2d(axis = [1,1], instances = 13, distance = 3) rectangle = startSketchOn('XY') @@ -432,7 +432,7 @@ rectangle = startSketchOn('XY') #[tokio::test(flavor = "multi_thread")] async fn kcl_test_patterns_circular_basic_2d() { let code = r#"part = startSketchOn('XY') - |> circle({ center: [0,0], radius: 2 }, %) + |> circle(center = [0,0], radius= 2) |> patternCircular2d(center = [20, 20], instances = 13, arcDegrees = 210, rotateDuplicates = true) |> extrude(length = 1) "#; @@ -770,8 +770,8 @@ async fn kcl_test_stdlib_kcl_error_right_code_path() { |> line(end = [10, 0]) |> line(end = [0, -10]) |> close() - |> hole(circle({ center: [2, 2], radius: .5 }), %) - |> hole(circle({ center: [2, 8], radius: .5 }, %), %) + |> hole(circle(), %) + |> hole(circle(center = [2, 8], radius= .5), %) |> extrude(length = 2) "#; @@ -780,7 +780,10 @@ async fn kcl_test_stdlib_kcl_error_right_code_path() { let ExecError::Kcl(err) = err else { panic!("Expected KCL error, found {err}"); }; - assert_eq!(err.error.message(), "Expected an argument at index 1"); + assert_eq!( + err.error.message(), + "This function requires a keyword argument 'center'" + ); } #[tokio::test(flavor = "multi_thread")] @@ -799,7 +802,7 @@ part001 = cube([0,0], 20) |> extrude(length = 20) part002 = startSketchOn(part001, "end") - |> circle({ center: [0, 0], radius: 5 }, %) + |> circle(center = [0, 0], radius= 5) |> extrude(length = 5) "#; @@ -852,7 +855,7 @@ part = rectShape([0, 0], 20, 20) }; assert_eq!( err.error.message(), - "Argument at index 0 was supposed to be type kcl_lib::std::shapes::CircleData but found string (text)" + "Expected a kcl_lib::std::shapes::SketchOrSurface but found string (text)" ); } @@ -1073,7 +1076,7 @@ async fn kcl_test_revolve_on_face_circle_edge() { |> extrude(length = 20) sketch001 = startSketchOn(box, "END") - |> circle({ center: [10,10], radius: 4 }, %) + |> circle(center = [10,10], radius= 4) |> revolve({ angle: 90, axis: getOppositeEdge(revolveAxis) @@ -1095,7 +1098,7 @@ async fn kcl_test_revolve_on_face_circle() { |> extrude(length = 20) sketch001 = startSketchOn(box, "END") - |> circle({ center: [10,10], radius: 4 }, %) + |> circle(center = [10,10], radius= 4 ) |> revolve({ angle: -90, axis: 'y' @@ -1135,7 +1138,7 @@ sketch001 = startSketchOn(box, "end") #[tokio::test(flavor = "multi_thread")] async fn kcl_test_basic_revolve_circle() { let code = r#"sketch001 = startSketchOn('XY') - |> circle({ center: [15, 0], radius: 5 }, %) + |> circle(center = [15, 0], radius= 5) |> revolve({ angle: 360, axis: 'y' @@ -1181,7 +1184,7 @@ async fn kcl_test_plumbus_fillets() { |> arc({ angleEnd: 360, angleStart: 0, - radius: radius + radius= radius }, %, $arc1) |> close() @@ -1259,10 +1262,10 @@ async fn kcl_test_member_expression_in_params() { zAxis: { x: 0, y: 1, z: 0 } } }) - |> circle({ center: [0, 0], radius: capDia / 2 }, %) + |> circle(center = [0, 0], radius= capDia / 2) |> extrude(length = capHeadLength) screw = startSketchOn(screwHead, "start") - |> circle({ center: [0, 0], radius: dia / 2 }, %) + |> circle(center = [0, 0], radius= dia / 2) |> extrude(length = length) return screw } @@ -1331,7 +1334,7 @@ async fn kcl_test_error_empty_start_sketch_on_string() { |> extrude(length = 100) secondSketch = startSketchOn(part001, '') - |> circle({ center: [-20, 50], radius: 40 }, %) + |> circle(center = [-20, 50], radius= 40) |> extrude(length = 20) "#; @@ -1361,7 +1364,7 @@ fn squareHole = (l, w) => { } extrusion = startSketchOn('XY') - |> circle({ center: [0, 0], radius: dia/2 }, %) + |> circle(center = [0, 0], radius= dia/2 ) |> hole(squareHole(length, width, height), %) |> extrude(length = height) "#; @@ -1370,7 +1373,7 @@ extrusion = startSketchOn('XY') assert!(result.is_err()); assert_eq!( result.err().unwrap().to_string(), - r#"semantic: KclErrorDetails { source_ranges: [SourceRange([68, 360, 0]), SourceRange([454, 487, 0])], message: "Expected 2 arguments, got 3" }"# + r#"semantic: KclErrorDetails { source_ranges: [SourceRange([68, 360, 0]), SourceRange([449, 482, 0])], message: "Expected 2 arguments, got 3" }"# ); } @@ -1757,7 +1760,7 @@ async fn kcl_test_arc_error_same_start_end() { |> arc({ angleStart: 180, angleEnd: 180, - radius: 1.5 + radius= 1.5 }, %) |> close() |> patternCircular2d(