updating kcl examples (#2386)

* updating kcl examples

* generate images

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* add new

Signed-off-by: Jess Frazelle <github@jessfraz.com>

---------

Signed-off-by: Jess Frazelle <github@jessfraz.com>
Co-authored-by: Jess Frazelle <jessfraz@users.noreply.github.com>
Co-authored-by: Jess Frazelle <github@jessfraz.com>
This commit is contained in:
Josh Gomez
2024-05-22 09:15:38 -07:00
committed by GitHub
parent 9f815eecc1
commit 718873b3bb
112 changed files with 609 additions and 220 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -15,7 +15,7 @@ arc(data: ArcData, sketch_group: SketchGroup, tag?: String) -> SketchGroup
### Examples
```js
const exampleSketch = startSketchOn('-XZ')
const exampleSketch = startSketchOn('XZ')
|> startProfileAt([0, 0], %)
|> line([10, 0], %)
|> arc({

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -29,7 +29,7 @@
"unpublished": false,
"deprecated": false,
"examples": [
"const myAngle = -120\n\nconst sketch001 = startSketchOn('-XZ')\n |> startProfileAt([0, 0], %)\n |> line([8, 0], %)\n |> angledLine({ angle: abs(myAngle), length: 5 }, %)\n |> line([-5, 0], %)\n |> angledLine({ angle: myAngle, length: 5 }, %)\n |> close(%)\n\nconst baseExtrusion = extrude(5, sketch001)"
"const myAngle = -120\n\nconst sketch001 = startSketchOn('XZ')\n |> startProfileAt([0, 0], %)\n |> line([8, 0], %)\n |> angledLine({ angle: abs(myAngle), length: 5 }, %)\n |> line([-5, 0], %)\n |> angledLine({ angle: myAngle, length: 5 }, %)\n |> close(%)\n\nconst baseExtrusion = extrude(5, sketch001)"
]
},
{
@ -62,7 +62,7 @@
"unpublished": false,
"deprecated": false,
"examples": [
"const myVar = acos(0.5)"
"const sketch001 = startSketchOn('XZ')\n |> startProfileAt([0, 0], %)\n |> angledLine({\n angle: toDegrees(acos(0.5)),\n length: 10\n }, %)\n |> line([5, 0], %)\n |> lineTo([12, 0], %)\n |> close(%)\n\nconst extrude001 = extrude(5, sketch001)"
]
},
{
@ -1068,7 +1068,7 @@
"unpublished": false,
"deprecated": false,
"examples": [
"const sketch001 = startSketchOn('-XZ')\n |> startProfileAt([0, 0], %)\n |> line([2, 5], %, 'seg01')\n |> angledLineToX([\n -angleToMatchLengthX('seg01', 7, %),\n 10\n ], %)\n |> close(%)\n\nconst extrusion = extrude(5, sketch001)"
"const sketch001 = startSketchOn('XZ')\n |> startProfileAt([0, 0], %)\n |> line([2, 5], %, 'seg01')\n |> angledLineToX([\n -angleToMatchLengthX('seg01', 7, %),\n 10\n ], %)\n |> close(%)\n\nconst extrusion = extrude(5, sketch001)"
]
},
{
@ -2074,7 +2074,7 @@
"unpublished": false,
"deprecated": false,
"examples": [
"const sketch001 = startSketchOn('-XZ')\n |> startProfileAt([0, 0], %)\n |> line([1, 2], %, 'seg01')\n |> angledLine({\n angle: angleToMatchLengthY('seg01', 15, %),\n length: 5\n }, %)\n |> yLineTo(0, %)\n |> close(%)\n\nconst extrusion = extrude(5, sketch001)"
"const sketch001 = startSketchOn('XZ')\n |> startProfileAt([0, 0], %)\n |> line([1, 2], %, 'seg01')\n |> angledLine({\n angle: angleToMatchLengthY('seg01', 15, %),\n length: 5\n }, %)\n |> yLineTo(0, %)\n |> close(%)\n\nconst extrusion = extrude(5, sketch001)"
]
},
{
@ -4070,7 +4070,7 @@
"unpublished": false,
"deprecated": false,
"examples": [
"const exampleSketch = startSketchOn('-XZ')\n |> startProfileAt([0, 0], %)\n |> yLineTo(15, %)\n |> angledLine({ angle: 30, length: 15 }, %)\n |> line([8, -10], %)\n |> yLineTo(0, %)\n |> close(%)\n\nconst example = extrude(10, exampleSketch)"
"const exampleSketch = startSketchOn('XZ')\n |> startProfileAt([0, 0], %)\n |> yLineTo(15, %)\n |> angledLine({ angle: 30, length: 15 }, %)\n |> line([8, -10], %)\n |> yLineTo(0, %)\n |> close(%)\n\nconst example = extrude(10, exampleSketch)"
]
},
{
@ -10048,7 +10048,7 @@
"unpublished": false,
"deprecated": false,
"examples": [
"const exampleSketch = startSketchOn('-XZ')\n |> startProfileAt([0, 0], %)\n |> lineTo([5, 10], %)\n |> lineTo([-10, 10], %, \"lineToIntersect\")\n |> lineTo([0, 20], %)\n |> angledLineThatIntersects({\n angle: 80,\n intersectTag: 'lineToIntersect',\n offset: 10\n }, %)\n |> close(%)\n\nconst example = extrude(10, exampleSketch)"
"const exampleSketch = startSketchOn('XZ')\n |> startProfileAt([0, 0], %)\n |> lineTo([5, 10], %)\n |> lineTo([-10, 10], %, \"lineToIntersect\")\n |> lineTo([0, 20], %)\n |> angledLineThatIntersects({\n angle: 80,\n intersectTag: 'lineToIntersect',\n offset: 10\n }, %)\n |> close(%)\n\nconst example = extrude(10, exampleSketch)"
]
},
{
@ -12029,7 +12029,7 @@
"unpublished": false,
"deprecated": false,
"examples": [
"const exampleSketch = startSketchOn('-XZ')\n |> startProfileAt([0, 0], %)\n |> angledLineToX({ angle: 30, to: 10 }, %)\n |> line([0, 10], %)\n |> line([-10, 0], %)\n |> close(%)\n\nconst example = extrude(10, exampleSketch)"
"const exampleSketch = startSketchOn('XZ')\n |> startProfileAt([0, 0], %)\n |> angledLineToX({ angle: 30, to: 10 }, %)\n |> line([0, 10], %)\n |> line([-10, 0], %)\n |> close(%)\n\nconst example = extrude(10, exampleSketch)"
]
},
{
@ -14010,7 +14010,7 @@
"unpublished": false,
"deprecated": false,
"examples": [
"const exampleSketch = startSketchOn('-XZ')\n |> startProfileAt([0, 0], %)\n |> angledLineToY({ angle: 60, to: 20 }, %)\n |> line([-20, 0], %)\n |> angledLineToY({ angle: 70, to: 10 }, %)\n |> close(%)\n\nconst example = extrude(10, exampleSketch)"
"const exampleSketch = startSketchOn('XZ')\n |> startProfileAt([0, 0], %)\n |> angledLineToY({ angle: 60, to: 20 }, %)\n |> line([-20, 0], %)\n |> angledLineToY({ angle: 70, to: 10 }, %)\n |> close(%)\n\nconst example = extrude(10, exampleSketch)"
]
},
{
@ -16038,7 +16038,7 @@
"unpublished": false,
"deprecated": false,
"examples": [
"const exampleSketch = startSketchOn('-XZ')\n |> startProfileAt([0, 0], %)\n |> line([10, 0], %)\n |> arc({\n angle_start: 0,\n angle_end: 280,\n radius: 16\n }, %)\n |> close(%)"
"const exampleSketch = startSketchOn('XZ')\n |> startProfileAt([0, 0], %)\n |> line([10, 0], %)\n |> arc({\n angle_start: 0,\n angle_end: 280,\n radius: 16\n }, %)\n |> close(%)"
]
},
{
@ -16071,7 +16071,7 @@
"unpublished": false,
"deprecated": false,
"examples": [
"const myVar = asin(0.5)"
"const sketch001 = startSketchOn('XZ')\n |> startProfileAt([0, 0], %)\n |> angledLine({\n angle: toDegrees(asin(0.5)),\n length: 20\n }, %)\n |> yLineTo(0, %)\n |> close(%)\n\nconst extrude001 = extrude(5, sketch001)"
]
},
{
@ -16104,7 +16104,7 @@
"unpublished": false,
"deprecated": false,
"examples": [
"const myVar = atan(1.0)"
"const sketch001 = startSketchOn('XZ')\n |> startProfileAt([0, 0], %)\n |> angledLine({\n angle: toDegrees(atan(1.25)),\n length: 20\n }, %)\n |> yLineTo(0, %)\n |> close(%)\n\nconst extrude001 = extrude(5, sketch001)"
]
},
{
@ -18106,7 +18106,7 @@
"unpublished": false,
"deprecated": false,
"examples": [
"const exampleSketch = startSketchOn('-XZ')\n |> startProfileAt([0, 0], %)\n |> line([0, 10], %)\n |> bezierCurve({\n to: [10, 10],\n control1: [5, 0],\n control2: [5, 10]\n }, %)\n |> lineTo([10, 0], %)\n |> close(%)\n\nconst example = extrude(10, exampleSketch)"
"const exampleSketch = startSketchOn('XZ')\n |> startProfileAt([0, 0], %)\n |> line([0, 10], %)\n |> bezierCurve({\n to: [10, 10],\n control1: [5, 0],\n control2: [5, 10]\n }, %)\n |> lineTo([10, 0], %)\n |> close(%)\n\nconst example = extrude(10, exampleSketch)"
]
},
{
@ -18139,7 +18139,7 @@
"unpublished": false,
"deprecated": false,
"examples": [
"const myVar = ceil(4.5)"
"const sketch001 = startSketchOn('XZ')\n |> startProfileAt([0, 0], %)\n |> lineTo([12, 10], %)\n |> line([ceil(7.02986), 0], %)\n |> yLineTo(0, %)\n |> close(%)\n\nconst extrude001 = extrude(5, sketch001)"
]
},
{
@ -20424,7 +20424,8 @@
"unpublished": false,
"deprecated": false,
"examples": [
"const exampleSketch = startSketchOn(\"-XZ\")\n |> circle([0, 0], 10, %)\n\nconst example = extrude(5, exampleSketch)"
"const exampleSketch = startSketchOn(\"-XZ\")\n |> circle([0, 0], 10, %)\n\nconst example = extrude(5, exampleSketch)",
"const exampleSketch = startSketchOn(\"XZ\")\n |> startProfileAt([-15, 0], %)\n |> line([30, 0], %)\n |> line([0, 30], %)\n |> line([-30, 0], %)\n |> close(%)\n |> hole(circle([0, 15], 5, %), %)\n\nconst example = extrude(5, exampleSketch)"
]
},
{
@ -22414,7 +22415,7 @@
"unpublished": false,
"deprecated": false,
"examples": [
"const anotherVar = cos(2 * pi())"
"const exampleSketch = startSketchOn(\"XZ\")\n |> startProfileAt([0, 0], %)\n |> angledLine({\n angle: 30,\n length: 3 / cos(toRadians(30))\n }, %)\n |> yLineTo(0, %)\n |> close(%)\n\nconst example = extrude(5, exampleSketch)"
]
},
{
@ -22437,7 +22438,7 @@
"unpublished": false,
"deprecated": false,
"examples": [
"const myVar = e()"
"const exampleSketch = startSketchOn(\"XZ\")\n |> startProfileAt([0, 0], %)\n |> angledLine({ angle: 30, length: 2 * e() ^ 2 }, %)\n |> yLineTo(0, %)\n |> close(%)\n\nconst example = extrude(10, exampleSketch)"
]
},
{
@ -25953,8 +25954,8 @@
"unpublished": false,
"deprecated": false,
"examples": [
"const example = startSketchOn('-XZ')\n |> startProfileAt([0, 0], %)\n |> line([10, 0], %)\n |> arc({\n angle_end: 0,\n angle_start: 120,\n radius: 5\n }, %)\n |> line([5, 0], %)\n |> line([0, 10], %)\n |> bezierCurve({\n control1: [-10, 0],\n control2: [2, 10],\n to: [-5, 10]\n }, %)\n |> line([-5, -2], %)\n |> close(%)\n |> extrude(10, %)",
"const exampleSketch = startSketchOn('-XZ')\n |> startProfileAt([-10, 0], %)\n |> arc({\n angle_end: -60,\n angle_start: 120,\n radius: 5\n }, %)\n |> line([10, 0], %)\n |> line([5, 0], %)\n |> bezierCurve({\n control1: [-3, 0],\n control2: [2, 10],\n to: [-5, 10]\n }, %)\n |> line([-4, 10], %)\n |> line([-5, -2], %)\n |> close(%)\n\nconst example = extrude(10, exampleSketch)"
"const example = startSketchOn('XZ')\n |> startProfileAt([0, 0], %)\n |> line([10, 0], %)\n |> arc({\n angle_end: 0,\n angle_start: 120,\n radius: 5\n }, %)\n |> line([5, 0], %)\n |> line([0, 10], %)\n |> bezierCurve({\n control1: [-10, 0],\n control2: [2, 10],\n to: [-5, 10]\n }, %)\n |> line([-5, -2], %)\n |> close(%)\n |> extrude(10, %)",
"const exampleSketch = startSketchOn('XZ')\n |> startProfileAt([-10, 0], %)\n |> arc({\n angle_end: -60,\n angle_start: 120,\n radius: 5\n }, %)\n |> line([10, 0], %)\n |> line([5, 0], %)\n |> bezierCurve({\n control1: [-3, 0],\n control2: [2, 10],\n to: [-5, 10]\n }, %)\n |> line([-4, 10], %)\n |> line([-5, -2], %)\n |> close(%)\n\nconst example = extrude(10, exampleSketch)"
]
},
{
@ -27550,7 +27551,7 @@
"unpublished": false,
"deprecated": false,
"examples": [
"const myVar = floor(4.5)"
"const sketch001 = startSketchOn('XZ')\n |> startProfileAt([0, 0], %)\n |> lineTo([12, 10], %)\n |> line([floor(7.02986), 0], %)\n |> yLineTo(0, %)\n |> close(%)\n\nconst extrude001 = extrude(5, sketch001)"
]
},
{
@ -36161,7 +36162,7 @@
"deprecated": false,
"examples": [
"const exampleSketch = startSketchOn('XY')\n |> startProfileAt([0, 0], %)\n |> line([0, 5], %)\n |> line([5, 0], %)\n |> line([0, -5], %)\n |> close(%)\n |> hole(circle([1, 1], .25, %), %)\n |> hole(circle([1, 4], .25, %), %)\n\nconst example = extrude(1, exampleSketch)",
"fn squareHoleSketch = () => {\n const squareSketch = startSketchOn('-XZ')\n |> startProfileAt([-1, -1], %)\n |> line([2, 0], %)\n |> line([0, 2], %)\n |> line([-2, 0], %)\n |> close(%)\n return squareSketch\n}\n\nconst exampleSketch = startSketchOn('-XZ')\n |> circle([0, 0], 3, %)\n |> hole(squareHoleSketch(), %)"
"fn squareHoleSketch = () => {\n const squareSketch = startSketchOn('-XZ')\n |> startProfileAt([-1, -1], %)\n |> line([2, 0], %)\n |> line([0, 2], %)\n |> line([-2, 0], %)\n |> close(%)\n return squareSketch\n}\n\nconst exampleSketch = startSketchOn('-XZ')\n |> circle([0, 0], 3, %)\n |> hole(squareHoleSketch(), %)\nconst example = extrude(1, exampleSketch)"
]
},
{
@ -37807,7 +37808,7 @@
"unpublished": false,
"deprecated": false,
"examples": [
"const exampleSketch = startSketchOn(\"-XZ\")\n |> startProfileAt([0, 0], %)\n |> line([5, 0], %)\n |> line([20, 5], %)\n |> line([0, lastSegX(%)], %)\n |> line([-15, 0], %)\n |> close(%)\n\nconst example = extrude(5, exampleSketch)"
"const exampleSketch = startSketchOn(\"XZ\")\n |> startProfileAt([0, 0], %)\n |> line([5, 0], %)\n |> line([20, 5], %)\n |> line([0, lastSegX(%)], %)\n |> line([-15, 0], %)\n |> close(%)\n\nconst example = extrude(5, exampleSketch)"
]
},
{
@ -38796,7 +38797,7 @@
"unpublished": false,
"deprecated": false,
"examples": [
"const exampleSketch = startSketchOn(\"-XZ\")\n |> startProfileAt([0, 0], %)\n |> line([5, 0], %)\n |> line([20, 5], %)\n |> line([0, lastSegY(%)], %)\n |> line([-15, 0], %)\n |> close(%)\n\nconst example = extrude(5, exampleSketch)"
"const exampleSketch = startSketchOn(\"XZ\")\n |> startProfileAt([0, 0], %)\n |> line([5, 0], %)\n |> line([20, 5], %)\n |> line([0, lastSegY(%)], %)\n |> line([-15, 0], %)\n |> close(%)\n\nconst example = extrude(5, exampleSketch)"
]
},
{
@ -40892,7 +40893,8 @@
"unpublished": false,
"deprecated": false,
"examples": [
"const exampleSketch = startSketchOn(\"-XZ\")\n |> startProfileAt([0, 0], %)\n |> line([10, 0], %)\n |> line([0, 10], %)\n |> line([-10, 0], %)\n |> close(%)\n\nconst example = extrude(5, exampleSketch)"
"const exampleSketch = startSketchOn(\"XZ\")\n |> startProfileAt([0, 0], %)\n |> line([25, 15], %)\n |> line([5, -6], %)\n |> line([-10, -10], %)\n |> close(%)\n\nconst example = extrude(5, exampleSketch)",
"const exampleSketch = startSketchOn(\"XZ\")\n |> startProfileAt([0, 0], %)\n |> line([10, 0], %)\n |> line([0, 10], %)\n |> line([-10, 0], %)\n |> close(%)\n\nconst example = extrude(5, exampleSketch)"
]
},
{
@ -42862,7 +42864,7 @@
"unpublished": false,
"deprecated": false,
"examples": [
"const exampleSketch = startSketchOn(\"-XZ\")\n |> startProfileAt([0, 0], %)\n |> lineTo([10, 0], %)\n |> lineTo([0, 10], %)\n |> lineTo([-10, 0], %)\n |> close(%)\n\nconst example = extrude(5, exampleSketch)"
"const exampleSketch = startSketchOn(\"XZ\")\n |> startProfileAt([0, 0], %)\n |> lineTo([10, 0], %)\n |> lineTo([0, 10], %)\n |> lineTo([-10, 0], %)\n |> close(%)\n\nconst example = extrude(5, exampleSketch)"
]
},
{
@ -42895,7 +42897,7 @@
"unpublished": false,
"deprecated": false,
"examples": [
"const myVar = ln(4)"
"const exampleSketch = startSketchOn(\"XZ\")\n |> startProfileAt([0, 0], %)\n |> line([ln(100), 15], %)\n |> line([5, -6], %)\n |> line([-10, -10], %)\n |> close(%)\n\nconst example = extrude(5, exampleSketch)"
]
},
{
@ -42937,7 +42939,7 @@
"unpublished": false,
"deprecated": false,
"examples": [
"const myVar = log(4, 2)"
"const exampleSketch = startSketchOn(\"XZ\")\n |> startProfileAt([0, 0], %)\n |> line([log(100, 5), 0], %)\n |> line([5, 8], %)\n |> line([-10, 0], %)\n |> close(%)\n\nconst example = extrude(5, exampleSketch)"
]
},
{
@ -42970,7 +42972,7 @@
"unpublished": false,
"deprecated": false,
"examples": [
"const myVar = log10(4)"
"const exampleSketch = startSketchOn(\"XZ\")\n |> startProfileAt([0, 0], %)\n |> line([log10(100), 0], %)\n |> line([5, 8], %)\n |> line([-10, 0], %)\n |> close(%)\n\nconst example = extrude(5, exampleSketch)"
]
},
{
@ -43003,7 +43005,7 @@
"unpublished": false,
"deprecated": false,
"examples": [
"const myVar = log2(4)"
"const exampleSketch = startSketchOn(\"XZ\")\n |> startProfileAt([0, 0], %)\n |> line([log2(100), 0], %)\n |> line([5, 8], %)\n |> line([-10, 0], %)\n |> close(%)\n\nconst example = extrude(5, exampleSketch)"
]
},
{
@ -43039,7 +43041,7 @@
"unpublished": false,
"deprecated": false,
"examples": [
"const myVar = max(4, 5, 6)"
"const exampleSketch = startSketchOn(\"XZ\")\n |> startProfileAt([0, 0], %)\n |> angledLine({\n angle: 70,\n length: max(15, 31, 4, 13, 22)\n }, %)\n |> line([20, 0], %)\n |> close(%)\n\nconst example = extrude(5, exampleSketch)"
]
},
{
@ -43075,7 +43077,7 @@
"unpublished": false,
"deprecated": false,
"examples": [
"const myVar = min(4, 5, 6)"
"const exampleSketch = startSketchOn(\"XZ\")\n |> startProfileAt([0, 0], %)\n |> angledLine({\n angle: 70,\n length: min(15, 31, 4, 13, 22)\n }, %)\n |> line([20, 0], %)\n |> close(%)\n\nconst example = extrude(5, exampleSketch)"
]
},
{
@ -45067,7 +45069,7 @@
"unpublished": false,
"deprecated": false,
"examples": [
"const exampleSketch = startSketchOn('-XZ')\n |> startProfileAt([.5, 25], %)\n |> line([0, 5], %)\n |> line([-1, 0], %)\n |> line([0, -5], %)\n |> close(%)\n |> patternCircular2d({\n center: [0, 0],\n repetitions: 12,\n arcDegrees: 360,\n rotateDuplicates: true\n }, %)\n\nconst example = extrude(1, exampleSketch)"
"const exampleSketch = startSketchOn('XZ')\n |> startProfileAt([.5, 25], %)\n |> line([0, 5], %)\n |> line([-1, 0], %)\n |> line([0, -5], %)\n |> close(%)\n |> patternCircular2d({\n center: [0, 0],\n repetitions: 12,\n arcDegrees: 360,\n rotateDuplicates: true\n }, %)\n\nconst example = extrude(1, exampleSketch)"
]
},
{
@ -46648,7 +46650,7 @@
"unpublished": false,
"deprecated": false,
"examples": [
"const exampleSketch = startSketchOn('-XZ')\n |> circle([0, 0], 1, %)\n\nconst example = extrude(-5, exampleSketch)\n |> patternCircular3d({\n axis: [1, -1, 0],\n center: [10, -20, 0],\n repetitions: 10,\n arcDegrees: 360,\n rotateDuplicates: true\n }, %)"
"const exampleSketch = startSketchOn('XZ')\n |> circle([0, 0], 1, %)\n\nconst example = extrude(-5, exampleSketch)\n |> patternCircular3d({\n axis: [1, -1, 0],\n center: [10, -20, 0],\n repetitions: 10,\n arcDegrees: 360,\n rotateDuplicates: true\n }, %)"
]
},
{
@ -49626,7 +49628,7 @@
"unpublished": false,
"deprecated": false,
"examples": [
"const exampleSketch = startSketchOn('-XZ')\n |> circle([0, 0], 1, %)\n |> patternLinear2d({\n axis: [1, 0],\n repetitions: 6,\n distance: 4\n }, %)\n\nconst example = extrude(1, exampleSketch)"
"const exampleSketch = startSketchOn('XZ')\n |> circle([0, 0], 1, %)\n |> patternLinear2d({\n axis: [1, 0],\n repetitions: 6,\n distance: 4\n }, %)\n\nconst example = extrude(1, exampleSketch)"
]
},
{
@ -51191,7 +51193,7 @@
"unpublished": false,
"deprecated": false,
"examples": [
"const exampleSketch = startSketchOn('-XZ')\n |> startProfileAt([0, 0], %)\n |> line([0, 2], %)\n |> line([3, 1], %)\n |> line([0, -4], %)\n |> close(%)\n\nconst example = extrude(1, exampleSketch)\n |> patternLinear3d({\n axis: [1, 0, 1],\n repetitions: 6,\n distance: 6\n }, %)"
"const exampleSketch = startSketchOn('XZ')\n |> startProfileAt([0, 0], %)\n |> line([0, 2], %)\n |> line([3, 1], %)\n |> line([0, -4], %)\n |> close(%)\n\nconst example = extrude(1, exampleSketch)\n |> patternLinear3d({\n axis: [1, 0, 1],\n repetitions: 6,\n distance: 6\n }, %)"
]
},
{
@ -51214,7 +51216,7 @@
"unpublished": false,
"deprecated": false,
"examples": [
"const myVar = pi() * 3.0"
"const circumference = 70\n\nconst exampleSketch = startSketchOn(\"XZ\")\n |> circle([0, 0], circumference / (2 * pi()), %)\n\nconst example = extrude(5, exampleSketch)"
]
},
{
@ -51256,7 +51258,7 @@
"unpublished": false,
"deprecated": false,
"examples": [
"const myVar = pow(4, 2)"
"const exampleSketch = startSketchOn(\"XZ\")\n |> startProfileAt([0, 0], %)\n |> angledLine({ angle: 50, length: pow(5, 2) }, %)\n |> yLineTo(0, %)\n |> close(%)\n\nconst example = extrude(5, exampleSketch)"
]
},
{
@ -57090,7 +57092,7 @@
"unpublished": false,
"deprecated": false,
"examples": [
"const exampleSketch = startSketchOn('-XZ')\n |> startProfileAt([0, 0], %)\n |> line([10, 0], %)\n |> line([5, 10], %, 'seg01')\n |> line([-10, 0], %)\n |> angledLine([segAng('seg01', %), 10], %)\n |> line([-10, 0], %)\n |> angledLine([segAng('seg01', %), -15], %)\n |> close(%)\n\nconst example = extrude(4, exampleSketch)"
"const exampleSketch = startSketchOn('XZ')\n |> startProfileAt([0, 0], %)\n |> line([10, 0], %)\n |> line([5, 10], %, 'seg01')\n |> line([-10, 0], %)\n |> angledLine([segAng('seg01', %), 10], %)\n |> line([-10, 0], %)\n |> angledLine([segAng('seg01', %), -15], %)\n |> close(%)\n\nconst example = extrude(4, exampleSketch)"
]
},
{
@ -58087,7 +58089,7 @@
"unpublished": false,
"deprecated": false,
"examples": [
"const exampleSketch = startSketchOn('-XZ')\n |> startProfileAt([0, 0], %)\n |> line([20, 0], %, \"thing\")\n |> line([0, 5], %)\n |> line([segEndX(\"thing\", %), 0], %)\n |> line([-20, 10], %)\n |> close(%)\n\nconst example = extrude(5, exampleSketch)"
"const exampleSketch = startSketchOn('XZ')\n |> startProfileAt([0, 0], %)\n |> line([20, 0], %, \"thing\")\n |> line([0, 5], %)\n |> line([segEndX(\"thing\", %), 0], %)\n |> line([-20, 10], %)\n |> close(%)\n\nconst example = extrude(5, exampleSketch)"
]
},
{
@ -59084,7 +59086,7 @@
"unpublished": false,
"deprecated": false,
"examples": [
"const exampleSketch = startSketchOn('-XZ')\n |> startProfileAt([0, 0], %)\n |> line([20, 0], %)\n |> line([0, 3], %, \"thing\")\n |> line([-10, 0], %)\n |> line([0, segEndY(\"thing\", %)], %)\n |> line([-10, 0], %)\n |> close(%)\n\nconst example = extrude(5, exampleSketch)"
"const exampleSketch = startSketchOn('XZ')\n |> startProfileAt([0, 0], %)\n |> line([20, 0], %)\n |> line([0, 3], %, \"thing\")\n |> line([-10, 0], %)\n |> line([0, segEndY(\"thing\", %)], %)\n |> line([-10, 0], %)\n |> close(%)\n\nconst example = extrude(5, exampleSketch)"
]
},
{
@ -60081,7 +60083,7 @@
"unpublished": false,
"deprecated": false,
"examples": [
"const exampleSketch = startSketchOn(\"-XZ\")\n |> startProfileAt([0, 0], %)\n |> angledLine({ angle: 60, length: 10 }, %, \"thing\")\n |> tangentialArc({ offset: -120, radius: 5 }, %)\n |> angledLine({\n angle: -60,\n length: segLen(\"thing\", %)\n }, %)\n |> close(%)\n\nconst example = extrude(5, exampleSketch)"
"const exampleSketch = startSketchOn(\"XZ\")\n |> startProfileAt([0, 0], %)\n |> angledLine({ angle: 60, length: 10 }, %, \"thing\")\n |> tangentialArc({ offset: -120, radius: 5 }, %)\n |> angledLine({\n angle: -60,\n length: segLen(\"thing\", %)\n }, %)\n |> close(%)\n\nconst example = extrude(5, exampleSketch)"
]
},
{
@ -60114,7 +60116,7 @@
"unpublished": false,
"deprecated": false,
"examples": [
"const myVar = sin(2 * pi())"
"const exampleSketch = startSketchOn(\"XZ\")\n |> startProfileAt([0, 0], %)\n |> angledLine({\n angle: 50,\n length: 15 / sin(toDegrees(135))\n }, %)\n |> yLineTo(0, %)\n |> close(%)\n\nconst example = extrude(5, exampleSketch)"
]
},
{
@ -60147,7 +60149,7 @@
"unpublished": false,
"deprecated": false,
"examples": [
"const myVar = sqrt(4)"
"const exampleSketch = startSketchOn(\"XZ\")\n |> startProfileAt([0, 0], %)\n |> angledLine({ angle: 50, length: sqrt(2500) }, %)\n |> yLineTo(0, %)\n |> close(%)\n\nconst example = extrude(5, exampleSketch)"
]
},
{
@ -61456,7 +61458,7 @@
"unpublished": false,
"deprecated": false,
"examples": [
"const exampleSketch = startSketchOn('-XZ')\n |> startProfileAt([0, 0], %)\n |> line([10, 0], %)\n |> line([0, 10], %)\n |> line([-10, 0], %)\n |> close(%)\n\nconst example = extrude(5, exampleSketch)",
"const exampleSketch = startSketchOn('XZ')\n |> startProfileAt([0, 0], %)\n |> line([10, 0], %)\n |> line([0, 10], %)\n |> line([-10, 0], %)\n |> close(%)\n\nconst example = extrude(5, exampleSketch)",
"const exampleSketch = startSketchOn('-XZ')\n |> startProfileAt([10, 10], %)\n |> line([10, 0], %)\n |> line([0, 10], %)\n |> line([-10, 0], %)\n |> close(%)\n\nconst example = extrude(5, exampleSketch)",
"const exampleSketch = startSketchOn('-XZ')\n |> startProfileAt([-10, 23], %)\n |> line([10, 0], %)\n |> line([0, 10], %)\n |> line([-10, 0], %)\n |> close(%)\n\nconst example = extrude(5, exampleSketch)"
]
@ -63762,7 +63764,7 @@
"unpublished": false,
"deprecated": false,
"examples": [
"const myVar = tan(2 * pi())"
"const exampleSketch = startSketchOn(\"XZ\")\n |> startProfileAt([0, 0], %)\n |> angledLine({ angle: 50, length: 50 * tan(1 / 2) }, %)\n |> yLineTo(0, %)\n |> close(%)\n\nconst example = extrude(5, exampleSketch)"
]
},
{
@ -65757,7 +65759,7 @@
"unpublished": false,
"deprecated": false,
"examples": [
"const exampleSketch = startSketchOn('-XZ')\n |> startProfileAt([0, 0], %)\n |> angledLine({ angle: 60, length: 10 }, %)\n |> tangentialArc({ radius: 10, offset: -120 }, %)\n |> angledLine({ angle: -60, length: 10 }, %)\n |> close(%)\n\nconst example = extrude(10, exampleSketch)"
"const exampleSketch = startSketchOn('XZ')\n |> startProfileAt([0, 0], %)\n |> angledLine({ angle: 60, length: 10 }, %)\n |> tangentialArc({ radius: 10, offset: -120 }, %)\n |> angledLine({ angle: -60, length: 10 }, %)\n |> close(%)\n\nconst example = extrude(10, exampleSketch)"
]
},
{
@ -67727,7 +67729,7 @@
"unpublished": false,
"deprecated": false,
"examples": [
"const exampleSketch = startSketchOn('-XZ')\n |> startProfileAt([0, 0], %)\n |> angledLine({ angle: 60, length: 10 }, %)\n |> tangentialArcTo([15, 15], %)\n |> line([10, -15], %)\n |> close(%)\n\nconst example = extrude(10, exampleSketch)"
"const exampleSketch = startSketchOn('XZ')\n |> startProfileAt([0, 0], %)\n |> angledLine({ angle: 60, length: 10 }, %)\n |> tangentialArcTo([15, 15], %)\n |> line([10, -15], %)\n |> close(%)\n\nconst example = extrude(10, exampleSketch)"
]
},
{
@ -67750,7 +67752,7 @@
"unpublished": false,
"deprecated": false,
"examples": [
"const myVar = tau()"
"const exampleSketch = startSketchOn(\"XZ\")\n |> startProfileAt([0, 0], %)\n |> angledLine({ angle: 50, length: 10 * tau() }, %)\n |> yLineTo(0, %)\n |> close(%)\n\nconst example = extrude(5, exampleSketch)"
]
},
{
@ -67783,7 +67785,7 @@
"unpublished": false,
"deprecated": false,
"examples": [
"const myVar = toDegrees(2 * pi())"
"const exampleSketch = startSketchOn(\"XZ\")\n |> startProfileAt([0, 0], %)\n |> angledLine({\n angle: 50,\n length: 70 * cos(toDegrees(pi() / 4))\n }, %)\n |> yLineTo(0, %)\n |> close(%)\n\nconst example = extrude(5, exampleSketch)"
]
},
{
@ -67816,7 +67818,7 @@
"unpublished": false,
"deprecated": false,
"examples": [
"const myVar = toRadians(180)"
"const exampleSketch = startSketchOn(\"XZ\")\n |> startProfileAt([0, 0], %)\n |> angledLine({\n angle: 50,\n length: 70 * cos(toRadians(45))\n }, %)\n |> yLineTo(0, %)\n |> close(%)\n\nconst example = extrude(5, exampleSketch)"
]
},
{
@ -69781,7 +69783,7 @@
"unpublished": false,
"deprecated": false,
"examples": [
"const exampleSketch = startSketchOn('-XZ')\n |> startProfileAt([0, 0], %)\n |> xLine(15, %)\n |> angledLine({ angle: 80, length: 15 }, %)\n |> line([8, -10], %)\n |> xLine(10, %)\n |> angledLine({ angle: 120, length: 30 }, %)\n |> xLine(-15, %)\n |> close(%)\n\nconst example = extrude(10, exampleSketch)"
"const exampleSketch = startSketchOn('XZ')\n |> startProfileAt([0, 0], %)\n |> xLine(15, %)\n |> angledLine({ angle: 80, length: 15 }, %)\n |> line([8, -10], %)\n |> xLine(10, %)\n |> angledLine({ angle: 120, length: 30 }, %)\n |> xLine(-15, %)\n |> close(%)\n\nconst example = extrude(10, exampleSketch)"
]
},
{
@ -71746,7 +71748,7 @@
"unpublished": false,
"deprecated": false,
"examples": [
"const exampleSketch = startSketchOn('-XZ')\n |> startProfileAt([0, 0], %)\n |> xLineTo(15, %)\n |> angledLine({ angle: 80, length: 15 }, %)\n |> line([8, -10], %)\n |> xLineTo(40, %)\n |> angledLine({ angle: 135, length: 30 }, %)\n |> xLineTo(10, %)\n |> close(%)\n\nconst example = extrude(10, exampleSketch)"
"const exampleSketch = startSketchOn('XZ')\n |> startProfileAt([0, 0], %)\n |> xLineTo(15, %)\n |> angledLine({ angle: 80, length: 15 }, %)\n |> line([8, -10], %)\n |> xLineTo(40, %)\n |> angledLine({ angle: 135, length: 30 }, %)\n |> xLineTo(10, %)\n |> close(%)\n\nconst example = extrude(10, exampleSketch)"
]
},
{
@ -73711,7 +73713,7 @@
"unpublished": false,
"deprecated": false,
"examples": [
"const exampleSketch = startSketchOn('-XZ')\n |> startProfileAt([0, 0], %)\n |> yLine(15, %)\n |> angledLine({ angle: 30, length: 15 }, %)\n |> line([8, -10], %)\n |> yLine(-5, %)\n |> close(%)\n\nconst example = extrude(10, exampleSketch)"
"const exampleSketch = startSketchOn('XZ')\n |> startProfileAt([0, 0], %)\n |> yLine(15, %)\n |> angledLine({ angle: 30, length: 15 }, %)\n |> line([8, -10], %)\n |> yLine(-5, %)\n |> close(%)\n\nconst example = extrude(10, exampleSketch)"
]
},
{
@ -75676,7 +75678,7 @@
"unpublished": false,
"deprecated": false,
"examples": [
"startSketchOn('XZ')\n |> startProfileAt([0, 0], %)\n |> yLineTo(10, %, \"edge1\")\n |> line([10, 10], %)\n |> close(%, \"edge2\")\n |> extrude(10, %)\n |> fillet({ radius: 2, tags: [\"edge2\"] }, %)"
"const exampleSketch = startSketchOn(\"XZ\")\n |> startProfileAt([0, 0], %)\n |> angledLine({ angle: 50, length: 45 }, %)\n |> yLineTo(0, %)\n |> close(%)\n\nconst example = extrude(5, exampleSketch)"
]
}
]

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -29,7 +29,7 @@ pub async fn extrude(args: Args) -> Result<MemoryItem, KclError> {
/// Extrudes by a given amount.
///
/// ```no_run
/// const example = startSketchOn('-XZ')
/// const example = startSketchOn('XZ')
/// |> startProfileAt([0, 0], %)
/// |> line([10, 0], %)
/// |> arc({
@ -50,7 +50,7 @@ pub async fn extrude(args: Args) -> Result<MemoryItem, KclError> {
/// ```
///
/// ```no_run
/// const exampleSketch = startSketchOn('-XZ')
/// const exampleSketch = startSketchOn('XZ')
/// |> startProfileAt([-10, 0], %)
/// |> arc({
/// angle_end: -60,

View File

@ -21,7 +21,16 @@ pub async fn cos(args: Args) -> Result<MemoryItem, KclError> {
/// Computes the cosine of a number (in radians).
///
/// ```no_run
/// const anotherVar = cos(2*pi())
/// const exampleSketch = startSketchOn("XZ")
/// |> startProfileAt([0, 0], %)
/// |> angledLine({
/// angle: 30,
/// length: 3 / cos(toRadians(30)),
/// }, %)
/// |> yLineTo(0, %)
/// |> close(%)
///
/// const example = extrude(5, exampleSketch)
/// ```
#[stdlib {
name = "cos",
@ -42,7 +51,16 @@ pub async fn sin(args: Args) -> Result<MemoryItem, KclError> {
/// Computes the sine of a number (in radians).
///
/// ```no_run
/// const myVar = sin(2*pi())
/// const exampleSketch = startSketchOn("XZ")
/// |> startProfileAt([0, 0], %)
/// |> angledLine({
/// angle: 50,
/// length: 15 / sin(toDegrees(135)),
/// }, %)
/// |> yLineTo(0, %)
/// |> close(%)
///
/// const example = extrude(5, exampleSketch)
/// ```
#[stdlib {
name = "sin",
@ -63,7 +81,16 @@ pub async fn tan(args: Args) -> Result<MemoryItem, KclError> {
/// Computes the tangent of a number (in radians).
///
/// ```no_run
/// const myVar = tan(2*pi())
/// const exampleSketch = startSketchOn("XZ")
/// |> startProfileAt([0, 0], %)
/// |> angledLine({
/// angle: 50,
/// length: 50 * tan(1/2),
/// }, %)
/// |> yLineTo(0, %)
/// |> close(%)
///
/// const example = extrude(5, exampleSketch)
/// ```
#[stdlib {
name = "tan",
@ -83,7 +110,12 @@ pub async fn pi(args: Args) -> Result<MemoryItem, KclError> {
/// Return the value of `pi`. Archimedes constant (π).
///
/// ```no_run
/// const myVar = pi() * 3.0
/// const circumference = 70
///
/// const exampleSketch = startSketchOn("XZ")
/// |> circle([0, 0], circumference/ (2 * pi()), %)
///
/// const example = extrude(5, exampleSketch)
/// ```
#[stdlib {
name = "pi",
@ -104,7 +136,16 @@ pub async fn sqrt(args: Args) -> Result<MemoryItem, KclError> {
/// Computes the square root of a number.
///
/// ```no_run
/// const myVar = sqrt(4)
/// const exampleSketch = startSketchOn("XZ")
/// |> startProfileAt([0, 0], %)
/// |> angledLine({
/// angle: 50,
/// length: sqrt(2500),
/// }, %)
/// |> yLineTo(0, %)
/// |> close(%)
///
/// const example = extrude(5, exampleSketch)
/// ```
#[stdlib {
name = "sqrt",
@ -127,7 +168,7 @@ pub async fn abs(args: Args) -> Result<MemoryItem, KclError> {
/// ```no_run
/// const myAngle = -120
///
/// const sketch001 = startSketchOn('-XZ')
/// const sketch001 = startSketchOn('XZ')
/// |> startProfileAt([0, 0], %)
/// |> line([8, 0], %)
/// |> angledLine({
@ -162,7 +203,14 @@ pub async fn floor(args: Args) -> Result<MemoryItem, KclError> {
/// Computes the largest integer less than or equal to a number.
///
/// ```no_run
/// const myVar = floor(4.5)
/// const sketch001 = startSketchOn('XZ')
/// |> startProfileAt([0, 0], %)
/// |> lineTo([12, 10], %)
/// |> line([floor(7.02986), 0], %)
/// |> yLineTo(0, %)
/// |> close(%)
///
/// const extrude001 = extrude(5, sketch001)
/// ```
#[stdlib {
name = "floor",
@ -183,7 +231,14 @@ pub async fn ceil(args: Args) -> Result<MemoryItem, KclError> {
/// Computes the smallest integer greater than or equal to a number.
///
/// ```no_run
/// const myVar = ceil(4.5)
/// const sketch001 = startSketchOn('XZ')
/// |> startProfileAt([0, 0], %)
/// |> lineTo([12, 10], %)
/// |> line([ceil(7.02986), 0], %)
/// |> yLineTo(0, %)
/// |> close(%)
///
/// const extrude001 = extrude(5, sketch001)
/// ```
#[stdlib {
name = "ceil",
@ -204,7 +259,16 @@ pub async fn min(args: Args) -> Result<MemoryItem, KclError> {
/// Computes the minimum of the given arguments.
///
/// ```no_run
/// const myVar = min(4, 5, 6)
/// const exampleSketch = startSketchOn("XZ")
/// |> startProfileAt([0, 0], %)
/// |> angledLine({
/// angle: 70,
/// length: min(15, 31, 4, 13, 22)
/// }, %)
/// |> line([20, 0], %)
/// |> close(%)
///
/// const example = extrude(5, exampleSketch)
/// ```
#[stdlib {
name = "min",
@ -232,7 +296,16 @@ pub async fn max(args: Args) -> Result<MemoryItem, KclError> {
/// Computes the maximum of the given arguments.
///
/// ```no_run
/// const myVar = max(4, 5, 6)
/// const exampleSketch = startSketchOn("XZ")
/// |> startProfileAt([0, 0], %)
/// |> angledLine({
/// angle: 70,
/// length: max(15, 31, 4, 13, 22)
/// }, %)
/// |> line([20, 0], %)
/// |> close(%)
///
/// const example = extrude(5, exampleSketch)
/// ```
#[stdlib {
name = "max",
@ -274,7 +347,16 @@ pub async fn pow(args: Args) -> Result<MemoryItem, KclError> {
/// Computes the number to a power.
///
/// ```no_run
/// const myVar = pow(4, 2)
/// const exampleSketch = startSketchOn("XZ")
/// |> startProfileAt([0, 0], %)
/// |> angledLine({
/// angle: 50,
/// length: pow(5, 2),
/// }, %)
/// |> yLineTo(0, %)
/// |> close(%)
///
/// const example = extrude(5, exampleSketch)
/// ```
#[stdlib {
name = "pow",
@ -295,7 +377,17 @@ pub async fn acos(args: Args) -> Result<MemoryItem, KclError> {
/// Computes the arccosine of a number (in radians).
///
/// ```no_run
/// const myVar = acos(0.5)
/// const sketch001 = startSketchOn('XZ')
/// |> startProfileAt([0, 0], %)
/// |> angledLine({
/// angle: toDegrees(acos(0.5)),
/// length: 10,
/// }, %)
/// |> line([5, 0], %)
/// |> lineTo([12, 0], %)
/// |> close(%)
///
/// const extrude001 = extrude(5, sketch001)
/// ```
#[stdlib {
name = "acos",
@ -316,7 +408,16 @@ pub async fn asin(args: Args) -> Result<MemoryItem, KclError> {
/// Computes the arcsine of a number (in radians).
///
/// ```no_run
/// const myVar = asin(0.5)
/// const sketch001 = startSketchOn('XZ')
/// |> startProfileAt([0, 0], %)
/// |> angledLine({
/// angle: toDegrees(asin(0.5)),
/// length: 20,
/// }, %)
/// |> yLineTo(0, %)
/// |> close(%)
///
/// const extrude001 = extrude(5, sketch001)
/// ```
#[stdlib {
name = "asin",
@ -337,7 +438,16 @@ pub async fn atan(args: Args) -> Result<MemoryItem, KclError> {
/// Computes the arctangent of a number (in radians).
///
/// ```no_run
/// const myVar = atan(1.0)
/// const sketch001 = startSketchOn('XZ')
/// |> startProfileAt([0, 0], %)
/// |> angledLine({
/// angle: toDegrees(atan(1.25)),
/// length: 20,
/// }, %)
/// |> yLineTo(0, %)
/// |> close(%)
///
/// const extrude001 = extrude(5, sketch001)
/// ```
#[stdlib {
name = "atan",
@ -379,7 +489,14 @@ pub async fn log(args: Args) -> Result<MemoryItem, KclError> {
/// and `log10()` can produce more accurate results for base 10.
///
/// ```no_run
/// const myVar = log(4, 2)
/// const exampleSketch = startSketchOn("XZ")
/// |> startProfileAt([0, 0], %)
/// |> line([log(100, 5), 0], %)
/// |> line([5, 8], %)
/// |> line([-10, 0], %)
/// |> close(%)
///
/// const example = extrude(5, exampleSketch)
/// ```
#[stdlib {
name = "log",
@ -400,7 +517,14 @@ pub async fn log2(args: Args) -> Result<MemoryItem, KclError> {
/// Computes the base 2 logarithm of the number.
///
/// ```no_run
/// const myVar = log2(4)
/// const exampleSketch = startSketchOn("XZ")
/// |> startProfileAt([0, 0], %)
/// |> line([log2(100), 0], %)
/// |> line([5, 8], %)
/// |> line([-10, 0], %)
/// |> close(%)
///
/// const example = extrude(5, exampleSketch)
/// ```
#[stdlib {
name = "log2",
@ -421,7 +545,14 @@ pub async fn log10(args: Args) -> Result<MemoryItem, KclError> {
/// Computes the base 10 logarithm of the number.
///
/// ```no_run
/// const myVar = log10(4)
/// const exampleSketch = startSketchOn("XZ")
/// |> startProfileAt([0, 0], %)
/// |> line([log10(100), 0], %)
/// |> line([5, 8], %)
/// |> line([-10, 0], %)
/// |> close(%)
///
/// const example = extrude(5, exampleSketch)
/// ```
#[stdlib {
name = "log10",
@ -442,7 +573,14 @@ pub async fn ln(args: Args) -> Result<MemoryItem, KclError> {
/// Computes the natural logarithm of the number.
///
/// ```no_run
/// const myVar = ln(4)
/// const exampleSketch = startSketchOn("XZ")
/// |> startProfileAt([0, 0], %)
/// |> line([ln(100), 15], %)
/// |> line([5, -6], %)
/// |> line([-10, -10], %)
/// |> close(%)
///
/// const example = extrude(5, exampleSketch)
/// ```
#[stdlib {
name = "ln",
@ -462,7 +600,16 @@ pub async fn e(args: Args) -> Result<MemoryItem, KclError> {
/// Return the value of Eulers number `e`.
///
/// ```no_run
/// const myVar = e()
/// const exampleSketch = startSketchOn("XZ")
/// |> startProfileAt([0, 0], %)
/// |> angledLine({
/// angle: 30,
/// length: 2 * e() ^ 2,
/// }, %)
/// |> yLineTo(0, %)
/// |> close(%)
///
/// const example = extrude(10, exampleSketch)
/// ```
#[stdlib {
name = "e",
@ -482,7 +629,16 @@ pub async fn tau(args: Args) -> Result<MemoryItem, KclError> {
/// Return the value of `tau`. The full circle constant (τ). Equal to 2π.
///
/// ```no_run
/// const myVar = tau()
/// const exampleSketch = startSketchOn("XZ")
/// |> startProfileAt([0, 0], %)
/// |> angledLine({
/// angle: 50,
/// length: 10 * tau(),
/// }, %)
/// |> yLineTo(0, %)
/// |> close(%)
///
/// const example = extrude(5, exampleSketch)
/// ```
#[stdlib {
name = "tau",
@ -503,7 +659,16 @@ pub async fn to_radians(args: Args) -> Result<MemoryItem, KclError> {
/// Converts a number from degrees to radians.
///
/// ```no_run
/// const myVar = toRadians(180)
/// const exampleSketch = startSketchOn("XZ")
/// |> startProfileAt([0, 0], %)
/// |> angledLine({
/// angle: 50,
/// length: 70 * cos(toRadians(45)),
/// }, %)
/// |> yLineTo(0, %)
/// |> close(%)
///
/// const example = extrude(5, exampleSketch)
/// ```
#[stdlib {
name = "toRadians",
@ -524,7 +689,16 @@ pub async fn to_degrees(args: Args) -> Result<MemoryItem, KclError> {
/// Converts a number from radians to degrees.
///
/// ```no_run
/// const myVar = toDegrees(2 * pi())
/// const exampleSketch = startSketchOn("XZ")
/// |> startProfileAt([0, 0], %)
/// |> angledLine({
/// angle: 50,
/// length: 70 * cos(toDegrees(pi()/4)),
/// }, %)
/// |> yLineTo(0, %)
/// |> close(%)
///
/// const example = extrude(5, exampleSketch)
/// ```
#[stdlib {
name = "toDegrees",

View File

@ -90,7 +90,7 @@ pub async fn pattern_linear_2d(args: Args) -> Result<MemoryItem, KclError> {
/// A linear pattern on a 2D sketch.
///
/// ```no_run
/// const exampleSketch = startSketchOn('-XZ')
/// const exampleSketch = startSketchOn('XZ')
/// |> circle([0, 0], 1, %)
/// |> patternLinear2d({
/// axis: [1, 0],
@ -159,7 +159,7 @@ pub async fn pattern_linear_3d(args: Args) -> Result<MemoryItem, KclError> {
/// A linear pattern on a 3D model.
///
/// ```no_run
/// const exampleSketch = startSketchOn('-XZ')
/// const exampleSketch = startSketchOn('XZ')
/// |> startProfileAt([0, 0], %)
/// |> line([0, 2], %)
/// |> line([3, 1], %)
@ -357,7 +357,7 @@ pub async fn pattern_circular_2d(args: Args) -> Result<MemoryItem, KclError> {
/// A circular pattern on a 2D sketch.
///
/// ```no_run
/// const exampleSketch = startSketchOn('-XZ')
/// const exampleSketch = startSketchOn('XZ')
/// |> startProfileAt([.5, 25], %)
/// |> line([0, 5], %)
/// |> line([-1, 0], %)
@ -412,7 +412,7 @@ pub async fn pattern_circular_3d(args: Args) -> Result<MemoryItem, KclError> {
/// A circular pattern on a 3D model.
///
/// ```no_run
/// const exampleSketch = startSketchOn('-XZ')
/// const exampleSketch = startSketchOn('XZ')
/// |> circle([0, 0], 1, %)
///
/// const example = extrude(-5, exampleSketch)

View File

@ -22,7 +22,7 @@ pub async fn segment_end_x(args: Args) -> Result<MemoryItem, KclError> {
/// Returns the segment end of x.
///
/// ```no_run
/// const exampleSketch = startSketchOn('-XZ')
/// const exampleSketch = startSketchOn('XZ')
/// |> startProfileAt([0, 0], %)
/// |> line([20, 0], %, "thing")
/// |> line([0, 5], %)
@ -60,7 +60,7 @@ pub async fn segment_end_y(args: Args) -> Result<MemoryItem, KclError> {
/// Returns the segment end of y.
///
/// ```no_run
/// const exampleSketch = startSketchOn('-XZ')
/// const exampleSketch = startSketchOn('XZ')
/// |> startProfileAt([0, 0], %)
/// |> line([20, 0], %)
/// |> line([0, 3], %, "thing")
@ -99,7 +99,7 @@ pub async fn last_segment_x(args: Args) -> Result<MemoryItem, KclError> {
/// Returns the last segment of x.
///
/// ```no_run
/// const exampleSketch = startSketchOn("-XZ")
/// const exampleSketch = startSketchOn("XZ")
/// |> startProfileAt([0, 0], %)
/// |> line([5, 0], %)
/// |> line([20, 5], %)
@ -141,7 +141,7 @@ pub async fn last_segment_y(args: Args) -> Result<MemoryItem, KclError> {
/// Returns the last segment of y.
///
/// ```no_run
/// const exampleSketch = startSketchOn("-XZ")
/// const exampleSketch = startSketchOn("XZ")
/// |> startProfileAt([0, 0], %)
/// |> line([5, 0], %)
/// |> line([20, 5], %)
@ -182,7 +182,7 @@ pub async fn segment_length(args: Args) -> Result<MemoryItem, KclError> {
/// Returns the length of the segment.
///
/// ```no_run
/// const exampleSketch = startSketchOn("-XZ")
/// const exampleSketch = startSketchOn("XZ")
/// |> startProfileAt([0, 0], %)
/// |> angledLine({
/// angle: 60,
@ -231,7 +231,7 @@ pub async fn segment_angle(args: Args) -> Result<MemoryItem, KclError> {
/// Returns the angle of the segment.
///
/// ```no_run
/// const exampleSketch = startSketchOn('-XZ')
/// const exampleSketch = startSketchOn('XZ')
/// |> startProfileAt([0, 0], %)
/// |> line([10, 0], %)
/// |> line([5, 10], %, 'seg01')
@ -273,7 +273,7 @@ pub async fn angle_to_match_length_x(args: Args) -> Result<MemoryItem, KclError>
/// Returns the angle to match the given length for x.
///
/// ```no_run
/// const sketch001 = startSketchOn('-XZ')
/// const sketch001 = startSketchOn('XZ')
/// |> startProfileAt([0, 0], %)
/// |> line([2, 5], %, 'seg01')
/// |> angledLineToX([
@ -341,7 +341,7 @@ pub async fn angle_to_match_length_y(args: Args) -> Result<MemoryItem, KclError>
/// Returns the angle to match the given length for y.
///
/// ```no_run
/// const sketch001 = startSketchOn('-XZ')
/// const sketch001 = startSketchOn('XZ')
/// |> startProfileAt([0, 0], %)
/// |> line([1, 2], %, 'seg01')
/// |> angledLine({

View File

@ -37,6 +37,18 @@ pub async fn circle(args: Args) -> Result<MemoryItem, KclError> {
///
/// const example = extrude(5, exampleSketch)
/// ```
///
/// ```no_run
/// const exampleSketch = startSketchOn("XZ")
/// |> startProfileAt([-15, 0], %)
/// |> line([30, 0], %)
/// |> line([0, 30], %)
/// |> line([-30, 0], %)
/// |> close(%)
/// |> hole(circle([0, 15], 5, %), %)
///
/// const example = extrude(5, exampleSketch)
///
#[stdlib {
name = "circle",
}]

View File

@ -35,7 +35,7 @@ pub async fn line_to(args: Args) -> Result<MemoryItem, KclError> {
/// Draw a line to a point.
///
/// ```no_run
/// const exampleSketch = startSketchOn("-XZ")
/// const exampleSketch = startSketchOn("XZ")
/// |> startProfileAt([0, 0], %)
/// |> lineTo([10, 0], %)
/// |> lineTo([0, 10], %)
@ -101,7 +101,7 @@ pub async fn x_line_to(args: Args) -> Result<MemoryItem, KclError> {
/// Draw a line to a point on the x-axis.
///
/// ```no_run
/// const exampleSketch = startSketchOn('-XZ')
/// const exampleSketch = startSketchOn('XZ')
/// |> startProfileAt([0, 0], %)
/// |> xLineTo(15, %)
/// |> angledLine({
@ -146,13 +146,16 @@ pub async fn y_line_to(args: Args) -> Result<MemoryItem, KclError> {
/// Draw a line to a point on the y-axis.
///
/// ```no_run
/// startSketchOn('XZ')
/// const exampleSketch = startSketchOn("XZ")
/// |> startProfileAt([0, 0], %)
/// |> yLineTo(10, %, "edge1")
/// |> line([10, 10], %)
/// |> close(%, "edge2")
/// |> extrude(10, %)
/// |> fillet({radius: 2, tags: ["edge2"]}, %)
/// |> angledLine({
/// angle: 50,
/// length: 45,
/// }, %)
/// |> yLineTo(0, %)
/// |> close(%)
///
/// const example = extrude(5, exampleSketch)
/// ```
#[stdlib {
name = "yLineTo",
@ -181,7 +184,18 @@ pub async fn line(args: Args) -> Result<MemoryItem, KclError> {
/// Draw a line.
///
/// ```no_run
/// const exampleSketch = startSketchOn("-XZ")
/// const exampleSketch = startSketchOn("XZ")
/// |> startProfileAt([0, 0], %)
/// |> line([25, 15], %)
/// |> line([5, -6], %)
/// |> line([-10, -10], %)
/// |> close(%)
///
/// const example = extrude(5, exampleSketch)
/// ```
///
/// ```no_run
/// const exampleSketch = startSketchOn("XZ")
/// |> startProfileAt([0, 0], %)
/// |> line([10, 0], %)
/// |> line([0, 10], %)
@ -250,7 +264,7 @@ pub async fn x_line(args: Args) -> Result<MemoryItem, KclError> {
/// Draw a line on the x-axis.
///
/// ```no_run
/// const exampleSketch = startSketchOn('-XZ')
/// const exampleSketch = startSketchOn('XZ')
/// |> startProfileAt([0, 0], %)
/// |> xLine(15, %)
/// |> angledLine({
@ -292,7 +306,7 @@ pub async fn y_line(args: Args) -> Result<MemoryItem, KclError> {
/// Draw a line on the y-axis.
///
/// ```no_run
/// const exampleSketch = startSketchOn('-XZ')
/// const exampleSketch = startSketchOn('XZ')
/// |> startProfileAt([0, 0], %)
/// |> yLine(15, %)
/// |> angledLine({
@ -345,7 +359,7 @@ pub async fn angled_line(args: Args) -> Result<MemoryItem, KclError> {
/// Draw an angled line.
///
/// ```no_run
/// const exampleSketch = startSketchOn('-XZ')
/// const exampleSketch = startSketchOn('XZ')
/// |> startProfileAt([0, 0], %)
/// |> yLineTo(15, %)
/// |> angledLine({
@ -482,7 +496,7 @@ pub async fn angled_line_to_x(args: Args) -> Result<MemoryItem, KclError> {
/// Draw an angled line to a given x coordinate.
///
/// ```no_run
/// const exampleSketch = startSketchOn('-XZ')
/// const exampleSketch = startSketchOn('XZ')
/// |> startProfileAt([0, 0], %)
/// |> angledLineToX({ angle: 30, to: 10 }, %)
/// |> line([0, 10], %)
@ -568,7 +582,7 @@ pub async fn angled_line_to_y(args: Args) -> Result<MemoryItem, KclError> {
/// Draw an angled line to a given y coordinate.
///
/// ```no_run
/// const exampleSketch = startSketchOn('-XZ')
/// const exampleSketch = startSketchOn('XZ')
/// |> startProfileAt([0, 0], %)
/// |> angledLineToY({ angle: 60, to: 20 }, %)
/// |> line([-20, 0], %)
@ -622,7 +636,7 @@ pub async fn angled_line_that_intersects(args: Args) -> Result<MemoryItem, KclEr
/// Draw an angled line that intersects with a given line.
///
/// ```no_run
/// const exampleSketch = startSketchOn('-XZ')
/// const exampleSketch = startSketchOn('XZ')
/// |> startProfileAt([0, 0], %)
/// |> lineTo([5, 10], %)
/// |> lineTo([-10, 10], %, "lineToIntersect")
@ -1131,7 +1145,7 @@ pub async fn start_profile_at(args: Args) -> Result<MemoryItem, KclError> {
/// Start a profile at a given point.
///
/// ```no_run
/// const exampleSketch = startSketchOn('-XZ')
/// const exampleSketch = startSketchOn('XZ')
/// |> startProfileAt([0, 0], %)
/// |> line([10, 0], %)
/// |> line([0, 10], %)
@ -1396,7 +1410,7 @@ pub async fn arc(args: Args) -> Result<MemoryItem, KclError> {
/// Draw an arc.
///
/// ```no_run
/// const exampleSketch = startSketchOn('-XZ')
/// const exampleSketch = startSketchOn('XZ')
/// |> startProfileAt([0, 0], %)
/// |> line([10, 0], %)
/// |> arc({
@ -1499,7 +1513,7 @@ pub async fn tangential_arc(args: Args) -> Result<MemoryItem, KclError> {
/// Draw an arc.
///
/// ```no_run
/// const exampleSketch = startSketchOn('-XZ')
/// const exampleSketch = startSketchOn('XZ')
/// |> startProfileAt([0, 0], %)
/// |> angledLine({
/// angle: 60,
@ -1623,7 +1637,7 @@ pub async fn tangential_arc_to(args: Args) -> Result<MemoryItem, KclError> {
/// Draw an arc.
///
/// ```no_run
/// const exampleSketch = startSketchOn('-XZ')
/// const exampleSketch = startSketchOn('XZ')
/// |> startProfileAt([0, 0], %)
/// |> angledLine({
/// angle: 60,
@ -1708,7 +1722,7 @@ pub async fn bezier_curve(args: Args) -> Result<MemoryItem, KclError> {
/// Draw a bezier curve.
///
/// ```no_run
/// const exampleSketch = startSketchOn('-XZ')
/// const exampleSketch = startSketchOn('XZ')
/// |> startProfileAt([0, 0], %)
/// |> line([0, 10], %)
/// |> bezierCurve({
@ -1819,7 +1833,7 @@ pub async fn hole(args: Args) -> Result<MemoryItem, KclError> {
/// const exampleSketch = startSketchOn('-XZ')
/// |> circle([0, 0], 3, %)
/// |> hole(squareHoleSketch(), %)
// const example = extrude(1, exampleSketch)
/// const example = extrude(1, exampleSketch)
/// ```
#[stdlib {
name = "hole",

Binary file not shown.

Before

Width:  |  Height:  |  Size: 123 KiB

After

Width:  |  Height:  |  Size: 82 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 116 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 113 KiB

After

Width:  |  Height:  |  Size: 82 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 108 KiB

After

Width:  |  Height:  |  Size: 88 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 129 KiB

After

Width:  |  Height:  |  Size: 134 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 118 KiB

After

Width:  |  Height:  |  Size: 121 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 125 KiB

After

Width:  |  Height:  |  Size: 130 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 129 KiB

After

Width:  |  Height:  |  Size: 129 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 123 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 126 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 122 KiB

After

Width:  |  Height:  |  Size: 127 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 122 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 181 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 127 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 119 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 134 KiB

After

Width:  |  Height:  |  Size: 133 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 141 KiB

After

Width:  |  Height:  |  Size: 143 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 120 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 108 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 133 KiB

After

Width:  |  Height:  |  Size: 122 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 119 KiB

After

Width:  |  Height:  |  Size: 114 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 121 KiB

After

Width:  |  Height:  |  Size: 136 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 117 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 136 KiB

After

Width:  |  Height:  |  Size: 131 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 124 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 103 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 104 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 99 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 111 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 97 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 121 KiB

After

Width:  |  Height:  |  Size: 120 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 216 KiB

After

Width:  |  Height:  |  Size: 189 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 109 KiB

After

Width:  |  Height:  |  Size: 112 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 110 KiB

After

Width:  |  Height:  |  Size: 112 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 149 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 129 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 130 KiB

After

Width:  |  Height:  |  Size: 130 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 119 KiB

After

Width:  |  Height:  |  Size: 118 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 96 KiB

After

Width:  |  Height:  |  Size: 105 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 120 KiB

After

Width:  |  Height:  |  Size: 132 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 124 KiB

Some files were not shown because too many files have changed in this diff Show More