Merge branch 'main' into pierremtb/issue1349

This commit is contained in:
Pierre Jacquier
2024-03-28 06:18:37 -04:00
31 changed files with 769 additions and 237 deletions

View File

@ -1,10 +1,10 @@
---
title: "cos"
excerpt: "Computes the sine of a number (in radians)."
excerpt: "Computes the cosine of a number (in radians)."
layout: manual
---
Computes the sine of a number (in radians).
Computes the cosine of a number (in radians).

View File

@ -20,11 +20,11 @@ const part001 = startSketchOn('XY')
|> line([0, 10], %, "thing")
|> line([10, 0], %, "thing1")
|> line([0, -10], %, "thing2")
|> close(%)
|> close(%, "thing3")
|> extrude(10, %)
|> fillet({
radius: 2,
tags: [getNextAdjacentEdge("thing", %)]
tags: [getNextAdjacentEdge("thing3", %)]
}, %)
```

View File

@ -20,11 +20,11 @@ const part001 = startSketchOn('XY')
|> line([0, 10], %, "thing")
|> line([10, 0], %, "thing1")
|> line([0, -10], %, "thing2")
|> close(%)
|> close(%, "thing3")
|> extrude(10, %)
|> fillet({
radius: 2,
tags: [getPreviousAdjacentEdge("thing2", %)]
tags: [getPreviousAdjacentEdge("thing3", %)]
}, %)
```

File diff suppressed because one or more lines are too long

View File

@ -22386,7 +22386,7 @@
},
{
"name": "cos",
"summary": "Computes the sine of a number (in radians).",
"summary": "Computes the cosine of a number (in radians).",
"description": "",
"tags": [
"math"
@ -28183,7 +28183,7 @@
"unpublished": false,
"deprecated": false,
"examples": [
"const part001 = startSketchOn('XY')\n |> startProfileAt([0, 0], %)\n |> line([0, 10], %, \"thing\")\n |> line([10, 0], %, \"thing1\")\n |> line([0, -10], %, \"thing2\")\n |> close(%)\n |> extrude(10, %)\n |> fillet({\n radius: 2,\n tags: [getNextAdjacentEdge(\"thing\", %)]\n }, %)"
"const part001 = startSketchOn('XY')\n |> startProfileAt([0, 0], %)\n |> line([0, 10], %, \"thing\")\n |> line([10, 0], %, \"thing1\")\n |> line([0, -10], %, \"thing2\")\n |> close(%, \"thing3\")\n |> extrude(10, %)\n |> fillet({\n radius: 2,\n tags: [getNextAdjacentEdge(\"thing3\", %)]\n }, %)"
]
},
{
@ -29755,7 +29755,7 @@
"unpublished": false,
"deprecated": false,
"examples": [
"const part001 = startSketchOn('XY')\n |> startProfileAt([0, 0], %)\n |> line([0, 10], %, \"thing\")\n |> line([10, 0], %, \"thing1\")\n |> line([0, -10], %, \"thing2\")\n |> close(%)\n |> extrude(10, %)\n |> fillet({\n radius: 2,\n tags: [getPreviousAdjacentEdge(\"thing2\", %)]\n }, %)"
"const part001 = startSketchOn('XY')\n |> startProfileAt([0, 0], %)\n |> line([0, 10], %, \"thing\")\n |> line([10, 0], %, \"thing1\")\n |> line([0, -10], %, \"thing2\")\n |> close(%, \"thing3\")\n |> extrude(10, %)\n |> fillet({\n radius: 2,\n tags: [getPreviousAdjacentEdge(\"thing3\", %)]\n }, %)"
]
},
{
@ -51189,7 +51189,9 @@
"deprecated": false,
"examples": [
"const part001 = startSketchOn('XY')\n |> startProfileAt([4, 12], %)\n |> line([2, 0], %)\n |> line([0, -6], %)\n |> line([4, -6], %)\n |> line([0, -6], %)\n |> line([-3.75, -4.5], %)\n |> line([0, -5.5], %)\n |> line([-2, 0], %)\n |> close(%)\n |> revolve({ axis: 'y' }, %) // default angle is 360",
"// A donut shape.\nconst sketch001 = startSketchOn('XY')\n |> circle([15, 0], 5, %)\n |> revolve({ angle: 360, axis: 'y' }, %)",
"const part001 = startSketchOn('XY')\n |> startProfileAt([4, 12], %)\n |> line([2, 0], %)\n |> line([0, -6], %)\n |> line([4, -6], %)\n |> line([0, -6], %)\n |> line([-3.75, -4.5], %)\n |> line([0, -5.5], %)\n |> line([-2, 0], %)\n |> close(%)\n |> revolve({ axis: 'y', angle: 180 }, %)",
"const part001 = startSketchOn('XY')\n |> startProfileAt([4, 12], %)\n |> line([2, 0], %)\n |> line([0, -6], %)\n |> line([4, -6], %)\n |> line([0, -6], %)\n |> line([-3.75, -4.5], %)\n |> line([0, -5.5], %)\n |> line([-2, 0], %)\n |> close(%)\n |> revolve({ axis: 'y', angle: 180 }, %)\nconst part002 = startSketchOn(part001, 'end')\n |> startProfileAt([4.5, -5], %)\n |> line([0, 5], %)\n |> line([5, 0], %)\n |> line([0, -5], %)\n |> close(%)\n |> extrude(5, %)",
"const box = startSketchOn('XY')\n |> startProfileAt([0, 0], %)\n |> line([0, 20], %)\n |> line([20, 0], %)\n |> line([0, -20], %)\n |> close(%)\n |> extrude(20, %)\n\nconst sketch001 = startSketchOn(box, \"END\")\n |> circle([10, 10], 4, %)\n |> revolve({ angle: -90, axis: 'y' }, %)",
"const box = startSketchOn('XY')\n |> startProfileAt([0, 0], %)\n |> line([0, 20], %)\n |> line([20, 0], %)\n |> line([0, -20], %, 'revolveAxis')\n |> close(%)\n |> extrude(20, %)\n\nconst sketch001 = startSketchOn(box, \"END\")\n |> circle([10, 10], 4, %)\n |> revolve({\n angle: 90,\n axis: getOppositeEdge('revolveAxis', box)\n }, %)"
]

234
src-tauri/Cargo.lock generated
View File

@ -387,7 +387,7 @@ dependencies = [
"async-channel",
"async-lock 3.3.0",
"async-task",
"fastrand 2.0.1",
"fastrand 2.0.2",
"futures-io",
"futures-lite",
"piper",
@ -513,9 +513,9 @@ dependencies = [
[[package]]
name = "cargo-platform"
version = "0.1.7"
version = "0.1.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "694c8807f2ae16faecc43dc17d74b3eb042482789fd0eb64b39a2e04e087053f"
checksum = "24b1f0365a6c6bb4020cd05806fd0d33c44d38046b8bd7f0e40814b9763cabfc"
dependencies = [
"serde",
]
@ -654,12 +654,6 @@ dependencies = [
"objc",
]
[[package]]
name = "color_quant"
version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3d7b894f5411737b7867f4827955924d7c254fc9f4d91a6aad6b097804b1018b"
[[package]]
name = "colored"
version = "2.0.4"
@ -1182,9 +1176,9 @@ dependencies = [
[[package]]
name = "fastrand"
version = "2.0.1"
version = "2.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "25cbce373ec4653f1a01a31e8a5e5ec0c622dc27ff9c4e6606eefef5cbbed4a5"
checksum = "658bd65b1cf4c852a3cc96f18a8ce7b5640f6b703f905c7d74532294c2a63984"
[[package]]
name = "fdeflate"
@ -1361,7 +1355,7 @@ version = "2.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "52527eb5074e35e9339c6b4e8d12600c7128b68fb25dcb9fa9dec18f7c25f3a5"
dependencies = [
"fastrand 2.0.1",
"fastrand 2.0.2",
"futures-core",
"futures-io",
"parking",
@ -1847,9 +1841,9 @@ dependencies = [
[[package]]
name = "hermit-abi"
version = "0.3.1"
version = "0.3.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fed44880c466736ef9a5c5b5facefb5ed0785676d0c02d612db14e54f0d84286"
checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024"
[[package]]
name = "hex"
@ -2001,19 +1995,6 @@ dependencies = [
"unicode-normalization",
]
[[package]]
name = "image"
version = "0.24.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "527909aa81e20ac3a44803521443a765550f09b5130c2c2fa1ea59c2f8f50a3a"
dependencies = [
"bytemuck",
"byteorder",
"color_quant",
"num-rational",
"num-traits",
]
[[package]]
name = "indexmap"
version = "1.9.3"
@ -2072,7 +2053,7 @@ version = "1.0.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "eae7b9aee968036d54dce06cebaefd919e4472e753296daccd6d344e3e2df0c2"
dependencies = [
"hermit-abi 0.3.1",
"hermit-abi 0.3.9",
"libc",
"windows-sys 0.48.0",
]
@ -2098,7 +2079,7 @@ version = "0.4.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cb0889898416213fab133e1d33a0e5858a48177452750691bde3666d0fdbaf8b"
dependencies = [
"hermit-abi 0.3.1",
"hermit-abi 0.3.9",
"rustix 0.38.32",
"windows-sys 0.48.0",
]
@ -2222,9 +2203,9 @@ dependencies = [
[[package]]
name = "kittycad"
version = "0.2.61"
version = "0.2.63"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "949555aa013e1cefa68f59671cfe96602a459c903376c53a410aebf3831d291f"
checksum = "93a332250e08fd715ad3d5826e04d36da1c5bb42d0c1b1ff1f0598278b9ebf3c"
dependencies = [
"anyhow",
"async-trait",
@ -2324,7 +2305,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0c2a198fb6b0eada2a8df47933734e6d35d350665a33a3593d7164fa52c75c19"
dependencies = [
"cfg-if",
"windows-targets 0.52.0",
"windows-targets 0.48.0",
]
[[package]]
@ -2543,9 +2524,9 @@ dependencies = [
[[package]]
name = "muda"
version = "0.12.1"
version = "0.12.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3e27c56b8cb9b3214d196556227b0eaa12db8393b4f919a0a93ffb67ed17d185"
checksum = "a40c16e25abca53b401d2972e8ad344820e318cf7e00ea8a951a5ca265590295"
dependencies = [
"cocoa",
"crossbeam-channel",
@ -2653,17 +2634,6 @@ dependencies = [
"num-traits",
]
[[package]]
name = "num-rational"
version = "0.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0638a1c9d0a3c0914158145bc76cff373a75a627e6ecbfb71cbe6f453a5a19b0"
dependencies = [
"autocfg",
"num-integer",
"num-traits",
]
[[package]]
name = "num-traits"
version = "0.2.16"
@ -3194,7 +3164,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "668d31b1c4eba19242f2088b2bf3316b82ca31082a8335764db4e083db7485d4"
dependencies = [
"atomic-waker",
"fastrand 2.0.1",
"fastrand 2.0.2",
"futures-io",
]
@ -3233,12 +3203,13 @@ dependencies = [
[[package]]
name = "polling"
version = "3.5.0"
version = "3.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "24f040dee2588b4963afb4e420540439d126f73fdacf4a9c486a96d840bac3c9"
checksum = "e0c976a60b2d7e99d6f229e414670a9b85d13ac305cc6d1e9c134de58c5aaaf6"
dependencies = [
"cfg-if",
"concurrent-queue",
"hermit-abi 0.3.9",
"pin-project-lite",
"rustix 0.38.32",
"tracing",
@ -3917,9 +3888,9 @@ dependencies = [
[[package]]
name = "serde_json"
version = "1.0.114"
version = "1.0.115"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c5f09b1bd632ef549eaa9f60a1f8de742bdbc698e6cee2095fc84dde5f549ae0"
checksum = "12dc5c46daa8e9fdf4f5e71b6cf9a53f2487da0e86e55808e2d35539666497dd"
dependencies = [
"itoa 1.0.6",
"ryu",
@ -4150,7 +4121,7 @@ dependencies = [
"cocoa",
"core-graphics",
"drm",
"fastrand 2.0.1",
"fastrand 2.0.2",
"foreign-types 0.5.0",
"js-sys",
"log",
@ -4383,9 +4354,9 @@ dependencies = [
[[package]]
name = "tao"
version = "0.26.1"
version = "0.26.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ccba570365293ca309d60f30fdac2c5271b732dc762e6154e59c85d2c762a0a1"
checksum = "69ebbccb78deb5a36744c079eea2981b4a48ecbbe6b1b2ffbaa528bea3f5e5db"
dependencies = [
"bitflags 1.3.2",
"cocoa",
@ -4397,7 +4368,6 @@ dependencies = [
"gdkwayland-sys",
"gdkx11-sys",
"gtk",
"image",
"instant",
"jni",
"lazy_static",
@ -4409,14 +4379,12 @@ dependencies = [
"objc",
"once_cell",
"parking_lot 0.12.1",
"png",
"raw-window-handle 0.6.0",
"scopeguard",
"tao-macros",
"unicode-segmentation",
"url",
"windows 0.52.0",
"windows-implement",
"windows 0.54.0",
"windows-version",
"x11-dl",
]
@ -4588,9 +4556,9 @@ dependencies = [
[[package]]
name = "tauri-plugin-dialog"
version = "2.0.0-beta.2"
version = "2.0.0-beta.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "14c7894fb904ed003fd15915b263655672be4e4581298f7fa8916016e50010ed"
checksum = "462456015607e4325d39dbb74e53f5a3cdcec3074b08ba8ce4936f7f936f8833"
dependencies = [
"glib 0.16.9",
"log",
@ -4606,9 +4574,9 @@ dependencies = [
[[package]]
name = "tauri-plugin-fs"
version = "2.0.0-beta.2"
version = "2.0.0-beta.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d5d71f69535111078131380bcf2a4c2f190ef4d045a33d787a606e7d4fc6a786"
checksum = "31961707e3be23c95f5fe39cb7688217e3c571a9a88aa9a03149b56bffd8036c"
dependencies = [
"anyhow",
"glob",
@ -4625,9 +4593,9 @@ dependencies = [
[[package]]
name = "tauri-plugin-http"
version = "2.0.0-beta.2"
version = "2.0.0-beta.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8ed4a2d9de58cafba4dbafff9330ed56b57176b9e6a153268113ffc66b5f70e7"
checksum = "d0a41e41d72f967b1c17417b9060bebf513f65895f94ba68c453218287d44346"
dependencies = [
"data-url",
"http",
@ -4646,9 +4614,9 @@ dependencies = [
[[package]]
name = "tauri-plugin-os"
version = "2.0.0-beta.2"
version = "2.0.0-beta.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "29d3b15199f234b9f9c9df69e75aaf0d3e001ffa71c53d7c91c0aaca02964503"
checksum = "c02dc0a2037ef113d9d9db85edceab6f95f83ae111e4d989d6bc1df79c8ab4cf"
dependencies = [
"gethostname",
"log",
@ -4664,9 +4632,9 @@ dependencies = [
[[package]]
name = "tauri-plugin-shell"
version = "2.0.0-beta.2"
version = "2.0.0-beta.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "19e5c2d4187bc552d1be72081588c34187eb29e4c375cdfe99872f8d57b6aead"
checksum = "5624537650f627707f3bd9c6562efe2116c7fb043fcfc2e3d10f802d7870a1cd"
dependencies = [
"encoding_rs",
"log",
@ -4684,9 +4652,9 @@ dependencies = [
[[package]]
name = "tauri-plugin-updater"
version = "2.0.0-beta.2"
version = "2.0.0-beta.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6cb1f95a0fa908434f19241137255ad84bc9433b4b5ce6727f26f6b22a74622e"
checksum = "106ed17da7442061bf3c0577cd22091424d1a64c86569064e99e7466d97dca65"
dependencies = [
"base64 0.21.2",
"dirs-next",
@ -4707,6 +4675,7 @@ dependencies = [
"time",
"tokio",
"url",
"windows-sys 0.52.0",
"zip",
]
@ -5537,9 +5506,9 @@ dependencies = [
"webview2-com-macros",
"webview2-com-sys",
"windows 0.52.0",
"windows-core",
"windows-implement",
"windows-interface",
"windows-core 0.52.0",
"windows-implement 0.52.0",
"windows-interface 0.52.0",
]
[[package]]
@ -5561,7 +5530,7 @@ checksum = "d6ad85fceee6c42fa3d61239eba5a11401bf38407a849ed5ea1b407df08cca72"
dependencies = [
"thiserror",
"windows 0.52.0",
"windows-core",
"windows-core 0.52.0",
]
[[package]]
@ -5623,10 +5592,22 @@ version = "0.52.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e48a53791691ab099e5e2ad123536d0fff50652600abaf43bbf952894110d0be"
dependencies = [
"windows-core",
"windows-implement",
"windows-interface",
"windows-targets 0.52.0",
"windows-core 0.52.0",
"windows-implement 0.52.0",
"windows-interface 0.52.0",
"windows-targets 0.52.4",
]
[[package]]
name = "windows"
version = "0.54.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9252e5725dbed82865af151df558e754e4a3c2c30818359eb17465f1346a1b49"
dependencies = [
"windows-core 0.54.0",
"windows-implement 0.53.0",
"windows-interface 0.53.0",
"windows-targets 0.52.4",
]
[[package]]
@ -5635,7 +5616,17 @@ version = "0.52.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9"
dependencies = [
"windows-targets 0.52.0",
"windows-targets 0.52.4",
]
[[package]]
name = "windows-core"
version = "0.54.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "12661b9c89351d684a50a8a643ce5f608e20243b9fb84687800163429f161d65"
dependencies = [
"windows-result",
"windows-targets 0.52.4",
]
[[package]]
@ -5649,6 +5640,17 @@ dependencies = [
"syn 2.0.48",
]
[[package]]
name = "windows-implement"
version = "0.53.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "942ac266be9249c84ca862f0a164a39533dc2f6f33dc98ec89c8da99b82ea0bd"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.48",
]
[[package]]
name = "windows-interface"
version = "0.52.0"
@ -5660,6 +5662,26 @@ dependencies = [
"syn 2.0.48",
]
[[package]]
name = "windows-interface"
version = "0.53.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "da33557140a288fae4e1d5f8873aaf9eb6613a9cf82c3e070223ff177f598b60"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.48",
]
[[package]]
name = "windows-result"
version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cd19df78e5168dfb0aedc343d1d1b8d422ab2db6756d2dc3fef75035402a3f64"
dependencies = [
"windows-targets 0.52.4",
]
[[package]]
name = "windows-sys"
version = "0.45.0"
@ -5684,7 +5706,7 @@ version = "0.52.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d"
dependencies = [
"windows-targets 0.52.0",
"windows-targets 0.52.4",
]
[[package]]
@ -5719,17 +5741,17 @@ dependencies = [
[[package]]
name = "windows-targets"
version = "0.52.0"
version = "0.52.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8a18201040b24831fbb9e4eb208f8892e1f50a37feb53cc7ff887feb8f50e7cd"
checksum = "7dd37b7e5ab9018759f893a1952c9420d060016fc19a472b4bb20d1bdd694d1b"
dependencies = [
"windows_aarch64_gnullvm 0.52.0",
"windows_aarch64_msvc 0.52.0",
"windows_i686_gnu 0.52.0",
"windows_i686_msvc 0.52.0",
"windows_x86_64_gnu 0.52.0",
"windows_x86_64_gnullvm 0.52.0",
"windows_x86_64_msvc 0.52.0",
"windows_aarch64_gnullvm 0.52.4",
"windows_aarch64_msvc 0.52.4",
"windows_i686_gnu 0.52.4",
"windows_i686_msvc 0.52.4",
"windows_x86_64_gnu 0.52.4",
"windows_x86_64_gnullvm 0.52.4",
"windows_x86_64_msvc 0.52.4",
]
[[package]]
@ -5738,7 +5760,7 @@ version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "75aa004c988e080ad34aff5739c39d0312f4684699d6d71fc8a198d057b8b9b4"
dependencies = [
"windows-targets 0.52.0",
"windows-targets 0.52.4",
]
[[package]]
@ -5755,9 +5777,9 @@ checksum = "91ae572e1b79dba883e0d315474df7305d12f569b400fcf90581b06062f7e1bc"
[[package]]
name = "windows_aarch64_gnullvm"
version = "0.52.0"
version = "0.52.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cb7764e35d4db8a7921e09562a0304bf2f93e0a51bfccee0bd0bb0b666b015ea"
checksum = "bcf46cf4c365c6f2d1cc93ce535f2c8b244591df96ceee75d8e83deb70a9cac9"
[[package]]
name = "windows_aarch64_msvc"
@ -5773,9 +5795,9 @@ checksum = "b2ef27e0d7bdfcfc7b868b317c1d32c641a6fe4629c171b8928c7b08d98d7cf3"
[[package]]
name = "windows_aarch64_msvc"
version = "0.52.0"
version = "0.52.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bbaa0368d4f1d2aaefc55b6fcfee13f41544ddf36801e793edbbfd7d7df075ef"
checksum = "da9f259dd3bcf6990b55bffd094c4f7235817ba4ceebde8e6d11cd0c5633b675"
[[package]]
name = "windows_i686_gnu"
@ -5791,9 +5813,9 @@ checksum = "622a1962a7db830d6fd0a69683c80a18fda201879f0f447f065a3b7467daa241"
[[package]]
name = "windows_i686_gnu"
version = "0.52.0"
version = "0.52.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a28637cb1fa3560a16915793afb20081aba2c92ee8af57b4d5f28e4b3e7df313"
checksum = "b474d8268f99e0995f25b9f095bc7434632601028cf86590aea5c8a5cb7801d3"
[[package]]
name = "windows_i686_msvc"
@ -5809,9 +5831,9 @@ checksum = "4542c6e364ce21bf45d69fdd2a8e455fa38d316158cfd43b3ac1c5b1b19f8e00"
[[package]]
name = "windows_i686_msvc"
version = "0.52.0"
version = "0.52.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ffe5e8e31046ce6230cc7215707b816e339ff4d4d67c65dffa206fd0f7aa7b9a"
checksum = "1515e9a29e5bed743cb4415a9ecf5dfca648ce85ee42e15873c3cd8610ff8e02"
[[package]]
name = "windows_x86_64_gnu"
@ -5827,9 +5849,9 @@ checksum = "ca2b8a661f7628cbd23440e50b05d705db3686f894fc9580820623656af974b1"
[[package]]
name = "windows_x86_64_gnu"
version = "0.52.0"
version = "0.52.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3d6fa32db2bc4a2f5abeacf2b69f7992cd09dca97498da74a151a3132c26befd"
checksum = "5eee091590e89cc02ad514ffe3ead9eb6b660aedca2183455434b93546371a03"
[[package]]
name = "windows_x86_64_gnullvm"
@ -5845,9 +5867,9 @@ checksum = "7896dbc1f41e08872e9d5e8f8baa8fdd2677f29468c4e156210174edc7f7b953"
[[package]]
name = "windows_x86_64_gnullvm"
version = "0.52.0"
version = "0.52.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1a657e1e9d3f514745a572a6846d3c7aa7dbe1658c056ed9c3344c4109a6949e"
checksum = "77ca79f2451b49fa9e2af39f0747fe999fcda4f5e241b2898624dca97a1f2177"
[[package]]
name = "windows_x86_64_msvc"
@ -5863,9 +5885,9 @@ checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a"
[[package]]
name = "windows_x86_64_msvc"
version = "0.52.0"
version = "0.52.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04"
checksum = "32b752e52a2da0ddfbdbcc6fceadfeede4c939ed16d13e648833a61dfb611ed8"
[[package]]
name = "winnow"
@ -5936,7 +5958,7 @@ dependencies = [
"webkit2gtk-sys",
"webview2-com",
"windows 0.52.0",
"windows-implement",
"windows-implement 0.52.0",
"windows-version",
"x11-dl",
]
@ -6111,9 +6133,9 @@ dependencies = [
[[package]]
name = "zstd-sys"
version = "2.0.9+zstd.1.5.5"
version = "2.0.10+zstd.1.5.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9e16efa8a874a0481a574084d34cc26fdb3b99627480f785888deb6386506656"
checksum = "c253a4914af5bafc8fa8c86ee400827e83cf6ec01195ec1f1ed8441bf00d65aa"
dependencies = [
"cc",
"pkg-config",

View File

@ -16,7 +16,7 @@ tauri-build = { version = "2.0.0-beta", features = [] }
[dependencies]
anyhow = "1"
kittycad = "0.2.61"
kittycad = "0.2.63"
oauth2 = "4.4.2"
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"

View File

@ -428,17 +428,15 @@ export class KclManager {
return this?.engineCommandManager?.defaultPlanes
}
getPlaneId(axis: 'xy' | 'xz' | 'yz'): string {
return this.defaultPlanes[axis]
}
showPlanes() {
if (!this.defaultPlanes) return
void this.engineCommandManager.setPlaneHidden(this.defaultPlanes.xy, false)
void this.engineCommandManager.setPlaneHidden(this.defaultPlanes.yz, false)
void this.engineCommandManager.setPlaneHidden(this.defaultPlanes.xz, false)
}
hidePlanes() {
if (!this.defaultPlanes) return
void this.engineCommandManager.setPlaneHidden(this.defaultPlanes.xy, true)
void this.engineCommandManager.setPlaneHidden(this.defaultPlanes.yz, true)
void this.engineCommandManager.setPlaneHidden(this.defaultPlanes.xz, true)
@ -464,11 +462,23 @@ function enterEditMode(
) as SketchGroup | ExtrudeGroup
firstSketchOrExtrudeGroup &&
engineCommandManager.sendSceneCommand({
type: 'modeling_cmd_req',
cmd_id: uuidv4(),
cmd: {
type: 'edit_mode_enter',
target: firstSketchOrExtrudeGroup.id,
},
type: 'modeling_cmd_batch_req',
batch_id: uuidv4(),
requests: [
{
cmd_id: uuidv4(),
cmd: {
type: 'edit_mode_enter',
target: firstSketchOrExtrudeGroup.id,
},
},
{
cmd_id: uuidv4(),
cmd: {
type: 'set_selection_filter',
filter: ['face', 'edge', 'solid2d'],
},
},
],
})
}

View File

@ -843,11 +843,7 @@ export class EngineCommandManager {
outSequence = 1
inSequence = 1
engineConnection?: EngineConnection
defaultPlanes: { xy: string; yz: string; xz: string } = {
xy: '',
yz: '',
xz: '',
}
defaultPlanes: { xy: string; yz: string; xz: string } | null = null
_commandLogs: CommandLog[] = []
_commandLogCallBack: (command: CommandLog[]) => void = () => {}
// Folks should realize that wait for ready does not get called _everytime_
@ -1245,6 +1241,7 @@ export class EngineCommandManager {
startNewSession() {
this.lastArtifactMap = this.artifactMap
this.artifactMap = {}
this.initPlanes()
}
subscribeTo<T extends ModelTypes>({
event,
@ -1296,6 +1293,7 @@ export class EngineCommandManager {
type: 'scene_clear_all',
},
}
this.defaultPlanes = null
this.engineConnection?.send(deleteCmd)
}
addCommandLog(message: CommandLog) {
@ -1603,6 +1601,7 @@ export class EngineCommandManager {
}
}
private async initPlanes() {
if (this.planesInitialized()) return
const [xy, yz, xz] = [
await this.createPlane({
x_axis: { x: 1, y: 0, z: 0 },
@ -1626,20 +1625,14 @@ export class EngineCommandManager {
event: 'select_with_point',
callback: ({ data }) => {
if (!data?.entity_id) return
if (
![
this.defaultPlanes.xy,
this.defaultPlanes.yz,
this.defaultPlanes.xz,
].includes(data.entity_id)
)
return
if (![xy, yz, xz].includes(data.entity_id)) return
this.onPlaneSelectCallback(data.entity_id)
},
})
}
planesInitialized(): boolean {
return (
!!this.defaultPlanes &&
this.defaultPlanes.xy !== '' &&
this.defaultPlanes.yz !== '' &&
this.defaultPlanes.xz !== ''

View File

@ -2,7 +2,12 @@ import { PathToNode, VariableDeclarator } from 'lang/wasm'
import { Axis, Selection, Selections } from 'lib/selections'
import { assign, createMachine } from 'xstate'
import { getNodePathFromSourceRange } from 'lang/queryAst'
import { kclManager, sceneInfra, sceneEntitiesManager } from 'lib/singletons'
import {
kclManager,
sceneInfra,
sceneEntitiesManager,
engineCommandManager,
} from 'lib/singletons'
import {
horzVertInfo,
applyConstraintHorzVert,
@ -37,6 +42,7 @@ import { ModelingCommandSchema } from 'lib/commandBarConfigs/modelingCommandConf
import { DefaultPlaneStr } from 'clientSideScene/sceneEntities'
import { Vector3 } from 'three'
import { quaternionFromUpNForward } from 'clientSideScene/helpers'
import { v4 as uuidv4 } from 'uuid'
export const MODELING_PERSIST_KEY = 'MODELING_PERSIST_KEY'
@ -127,7 +133,7 @@ export type MoveDesc = { line: number; snippet: string }
export const modelingMachine = createMachine(
{
/** @xstate-layout N4IgpgJg5mDOIC5QFkD2EwBsCWA7KAxAMICGuAxlgNoAMAuoqAA6qzYAu2qujIAHogC0AdgCsAZgB04gEyjhADnEA2GgoUAWJQBoQAT0QBGGuICckmoZkbTM42YWKAvk91oMOfAQDKYdgAJYLDByTm5aBiQQFjYwniiBBFtpGhlxDRphGg1ZURlhXQMEcRLDSVF5UwV84XEK8Rc3dCw8KElsCEwwHz9A4NCuXAjeGI5B3kTBLWFJDWV5hVSZZTrlBUKjS1FZiUrDeWVDasaQdxb8ds7ugFFcdjAAJ0CAaz9yAAthqNG4iaFlmZWZSmZRaKyGQzKYQaDYIGSmDSzdKyDSGcQ0KrAk5nTxtDpdAi3e5PWCvdgfKiGSLMVhjbh-BCCaw0WaQrZqdGLAr6RAZGSSWzCZSiIEKNFi5TY5q4y4E658dgPACuGC+NNi4wSQgqM3hNFEwNEGlEYthENELJkCjWplMFpsGlRUo8rVlNz4LAe7DV0Vpvy1jKtCkkVuZMjsDpNsOEwjKUIkcxNqWhomd5za3jJH2IZEomEzb0+9BGfs1oESEOtkmM0K0ahMplkZqOZUrYrRlgUJrTMoL5Pekj7HwAklcegEgl0BuFi99S-SA4ZoWUdWsTSLlsozZlzNkZPrG0a5F2e66hwPz6OCcgSK8+lAALZgO7+ABuj045BImB9PzL-CMeFW2qTQhU0ZMzVRKR0RoVJ6nyJQNFPC5z0HLN3ivbobzvIJH2fAJ3lQB5sA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HAv0iU4Gv2nhQuPHlmPUtNz1tG3DyBDDWAWEow3Fpw2KIXQIgKN2wPQlgPIptB+N3lSVC2hyKCNBsgH1sGP2GnM2nI+DULYI4PROjPwKZAyDBwBHkFyloJkMsmovKAPC70yFTmsHqNSKaPSMEKstqy9JWAFCFHbztB5NdlkJshMHUCFF3k5EYPYraB6M4H8rrhaKkjaPQnIuW19mFCyAjE4lsCixZAHmLOZGtCtBcBcCAA */
id: 'Modeling',
tsTypes: {} as import('./modelingMachine.typegen').Typegen0,
@ -505,9 +511,9 @@ export const modelingMachine = createMachine(
},
'Sketch no face': {
entry: 'show default planes',
entry: ['show default planes', 'set selection filter to faces only'],
exit: 'hide default planes',
exit: ['hide default planes', 'set selection filter to defaults'],
on: {
'Select default plane': {
target: 'animating to plane',
@ -940,6 +946,24 @@ export const modelingMachine = createMachine(
'engineToClient cam sync direction': () => {
sceneInfra.camControls.syncDirection = 'engineToClient'
},
'set selection filter to faces only': () =>
engineCommandManager.sendSceneCommand({
type: 'modeling_cmd_req',
cmd_id: uuidv4(),
cmd: {
type: 'set_selection_filter',
filter: ['face'],
},
}),
'set selection filter to defaults': () =>
engineCommandManager.sendSceneCommand({
type: 'modeling_cmd_req',
cmd_id: uuidv4(),
cmd: {
type: 'set_selection_filter',
filter: ['face', 'edge', 'solid2d'],
},
}),
},
// end actions
}

View File

@ -246,7 +246,7 @@ checksum = "30c5ef0ede93efbf733c1a727f3b6b5a1060bbedd5600183e66f6e4be4af0ec5"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.53",
"syn 2.0.55",
]
[[package]]
@ -257,7 +257,7 @@ checksum = "461abc97219de0eaaf81fe3ef974a540158f3d079c2ab200f891f1a2ef201e85"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.53",
"syn 2.0.55",
]
[[package]]
@ -280,7 +280,7 @@ checksum = "3c87f3f15e7794432337fc718554eaa4dc8f04c9677a950ffe366f20a162ae42"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.53",
"syn 2.0.55",
]
[[package]]
@ -596,7 +596,7 @@ dependencies = [
"heck 0.5.0",
"proc-macro2",
"quote",
"syn 2.0.53",
"syn 2.0.55",
]
[[package]]
@ -846,7 +846,7 @@ checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.53",
"syn 2.0.55",
]
[[package]]
@ -887,7 +887,7 @@ checksum = "377af281d8f23663862a7c84623bc5dcf7f8c44b13c7496a590bdc157f941a43"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.53",
"syn 2.0.55",
"synstructure 0.13.1",
]
@ -941,7 +941,7 @@ dependencies = [
"rustfmt-wrapper",
"serde",
"serde_tokenstream",
"syn 2.0.53",
"syn 2.0.55",
]
[[package]]
@ -953,7 +953,7 @@ dependencies = [
"diesel_table_macro_syntax",
"proc-macro2",
"quote",
"syn 2.0.53",
"syn 2.0.55",
]
[[package]]
@ -962,7 +962,7 @@ version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fc5557efc453706fed5e4fa85006fe9817c224c3f480a34c7e5959fd700921c5"
dependencies = [
"syn 2.0.53",
"syn 2.0.55",
]
[[package]]
@ -991,7 +991,7 @@ checksum = "487585f4d0c6655fe74905e2504d8ad6908e4db67f744eb140876906c2f3175d"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.53",
"syn 2.0.55",
]
[[package]]
@ -1073,7 +1073,7 @@ checksum = "03cdc46ec28bd728e67540c528013c6a10eb69a02eb31078a1bda695438cbfb8"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.53",
"syn 2.0.55",
]
[[package]]
@ -1290,7 +1290,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.53",
"syn 2.0.55",
]
[[package]]
@ -1395,7 +1395,7 @@ dependencies = [
"inflections",
"proc-macro2",
"quote",
"syn 2.0.53",
"syn 2.0.55",
]
[[package]]
@ -1901,7 +1901,7 @@ dependencies = [
"pretty_assertions",
"proc-macro2",
"quote",
"syn 2.0.53",
"syn 2.0.55",
]
[[package]]
@ -1971,7 +1971,7 @@ source = "git+https://github.com/KittyCAD/modeling-api?branch=main#a3b8df282c684
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.53",
"syn 2.0.55",
]
[[package]]
@ -2019,7 +2019,7 @@ source = "git+https://github.com/KittyCAD/modeling-api?branch=main#a3b8df282c684
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.53",
"syn 2.0.55",
]
[[package]]
@ -2392,7 +2392,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.53",
"syn 2.0.55",
]
[[package]]
@ -2549,7 +2549,7 @@ dependencies = [
"regex",
"regex-syntax 0.7.5",
"structmeta 0.2.0",
"syn 2.0.53",
"syn 2.0.55",
]
[[package]]
@ -2563,7 +2563,7 @@ dependencies = [
"regex",
"regex-syntax 0.8.2",
"structmeta 0.3.0",
"syn 2.0.53",
"syn 2.0.55",
]
[[package]]
@ -2629,7 +2629,7 @@ checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.53",
"syn 2.0.55",
]
[[package]]
@ -3491,7 +3491,7 @@ checksum = "7eb0b34b42edc17f6b7cac84a52a1c5f0e1bb2227e997ca9011ea3dd34e8610b"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.53",
"syn 2.0.55",
]
[[package]]
@ -3525,7 +3525,7 @@ checksum = "0b2e6b945e9d3df726b65d6ee24060aff8e3533d431f677a9695db04eff9dfdb"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.53",
"syn 2.0.55",
]
[[package]]
@ -3546,7 +3546,7 @@ dependencies = [
"proc-macro2",
"quote",
"serde",
"syn 2.0.53",
"syn 2.0.55",
]
[[package]]
@ -3715,7 +3715,7 @@ dependencies = [
"proc-macro2",
"quote",
"structmeta-derive 0.2.0",
"syn 2.0.53",
"syn 2.0.55",
]
[[package]]
@ -3727,7 +3727,7 @@ dependencies = [
"proc-macro2",
"quote",
"structmeta-derive 0.3.0",
"syn 2.0.53",
"syn 2.0.55",
]
[[package]]
@ -3738,7 +3738,7 @@ checksum = "a60bcaff7397072dca0017d1db428e30d5002e00b6847703e2e42005c95fbe00"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.53",
"syn 2.0.55",
]
[[package]]
@ -3749,7 +3749,7 @@ checksum = "152a0b65a590ff6c3da95cabe2353ee04e6167c896b28e3b14478c2636c922fc"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.53",
"syn 2.0.55",
]
[[package]]
@ -3821,9 +3821,9 @@ dependencies = [
[[package]]
name = "syn"
version = "2.0.53"
version = "2.0.55"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7383cd0e49fff4b6b90ca5670bfd3e9d6a733b3f90c686605aa7eec8c4996032"
checksum = "002a1b3dbf967edfafc32655d0f377ab0bb7b994aa1d32c8cc7e9b8bf3ebb8f0"
dependencies = [
"proc-macro2",
"quote",
@ -3856,7 +3856,7 @@ checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.53",
"syn 2.0.55",
]
[[package]]
@ -3957,7 +3957,7 @@ checksum = "c61f3ba182994efc43764a46c018c347bc492c79f024e705f46567b418f6d4f7"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.53",
"syn 2.0.55",
]
[[package]]
@ -4064,7 +4064,7 @@ checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.53",
"syn 2.0.55",
]
[[package]]
@ -4227,7 +4227,7 @@ checksum = "84fd902d4e0b9a4b27f2f440108dc034e1758628a9b702f8ec61ad66355422fa"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.53",
"syn 2.0.55",
]
[[package]]
@ -4255,7 +4255,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.53",
"syn 2.0.55",
]
[[package]]
@ -4330,7 +4330,7 @@ dependencies = [
"Inflector",
"proc-macro2",
"quote",
"syn 2.0.53",
"syn 2.0.55",
"termcolor",
]
@ -4572,7 +4572,7 @@ dependencies = [
"once_cell",
"proc-macro2",
"quote",
"syn 2.0.53",
"syn 2.0.55",
"wasm-bindgen-shared",
]
@ -4607,7 +4607,7 @@ checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.53",
"syn 2.0.55",
"wasm-bindgen-backend",
"wasm-bindgen-shared",
]
@ -5177,7 +5177,7 @@ checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.53",
"syn 2.0.55",
]
[[package]]
@ -5197,7 +5197,7 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.53",
"syn 2.0.55",
]
[[package]]

View File

@ -20,7 +20,7 @@ quote = "1"
regex = "1.10"
serde = { version = "1.0.197", features = ["derive"] }
serde_tokenstream = "0.2"
syn = { version = "2.0.53", features = ["full"] }
syn = { version = "2.0.55", features = ["full"] }
[dev-dependencies]
anyhow = "1.0.81"

View File

@ -15,7 +15,7 @@ databake = "0.1.7"
kcl-lib = { path = "../kcl" }
proc-macro2 = "1"
quote = "1"
syn = { version = "2.0.53", features = ["full"] }
syn = { version = "2.0.55", features = ["full"] }
[dev-dependencies]
pretty_assertions = "1.4.0"

View File

@ -12,6 +12,7 @@ pub fn bench_parse(c: &mut Criterion) {
("big_kitt", KITT_PROGRAM),
("cube", CUBE_PROGRAM),
("math", MATH_PROGRAM),
("mike_stress_test", MIKE_STRESS_TEST_PROGRAM),
] {
let tokens = kcl_lib::token::lexer(file);
c.bench_function(&format!("parse_{name}"), move |b| {
@ -35,3 +36,4 @@ const KITT_PROGRAM: &str = include_str!("../../tests/executor/inputs/kittycad_sv
const PIPES_PROGRAM: &str = include_str!("../../tests/executor/inputs/pipes_on_pipes.kcl");
const CUBE_PROGRAM: &str = include_str!("../../tests/executor/inputs/cube.kcl");
const MATH_PROGRAM: &str = include_str!("../../tests/executor/inputs/math.kcl");
const MIKE_STRESS_TEST_PROGRAM: &str = include_str!("../../tests/executor/inputs/mike_stress_test.kcl");

View File

@ -986,6 +986,17 @@ impl CallExpression {
})
}
/// Is at least one argument the '%' i.e. the substitution operator?
pub fn has_substitution_arg(&self) -> bool {
self.arguments
.iter()
.any(|arg| matches!(arg, Value::PipeSubstitution(_)))
}
pub fn as_source_ranges(&self) -> Vec<SourceRange> {
vec![SourceRange([self.start, self.end])]
}
pub fn replace_value(&mut self, source_range: SourceRange, new_value: Value) {
for arg in &mut self.arguments {
arg.replace_value(source_range, new_value.clone());
@ -2743,6 +2754,12 @@ async fn execute_pipe_body(
pipe_info.body = body.to_vec();
call_expression.execute(memory, pipe_info, ctx).await
}
Value::Identifier(identifier) => {
let result = memory.get(&identifier.name, identifier.into())?;
pipe_info.previous_results.push(result.clone());
pipe_info.index += 1;
execute_pipe_body(memory, body, pipe_info, source_range, ctx).await
}
_ => {
// Return an error this should not happen.
Err(KclError::Semantic(KclErrorDetails {

View File

@ -139,7 +139,7 @@ fn pipe_expression(i: TokenSlice) -> PResult<PipeExpression> {
let mut values = vec![head];
let value_surrounded_by_comments = (
repeat(0.., preceded(opt(whitespace), non_code_node)), // Before the value
preceded(opt(whitespace), value_allowed_in_pipe_expr), // The value
preceded(opt(whitespace), fn_call), // The value
repeat(0.., noncode_just_after_code), // After the value
);
let tail: Vec<(Vec<_>, _, Vec<_>)> = repeat(
@ -151,7 +151,23 @@ fn pipe_expression(i: TokenSlice) -> PResult<PipeExpression> {
))
.parse_next(i)?;
// All child parsers have been run. Time to structure the return value.
// All child parsers have been run.
// First, ensure they all have a % in their args.
let calls_without_substitution = tail.iter().find_map(|(_nc, call_expr, _nc2)| {
if !call_expr.has_substitution_arg() {
Some(call_expr.as_source_ranges())
} else {
None
}
});
if let Some(source_ranges) = calls_without_substitution {
let err = KclError::Syntax(KclErrorDetails {
source_ranges,
message: "All expressions in a pipeline must use the % (substitution operator)".to_owned(),
});
return Err(ErrMode::Cut(err.into()));
}
// Time to structure the return value.
let mut code_count = 0;
let mut max_noncode_end = 0;
for (noncode_before, code, noncode_after) in tail {
@ -159,7 +175,7 @@ fn pipe_expression(i: TokenSlice) -> PResult<PipeExpression> {
max_noncode_end = nc.end.max(max_noncode_end);
non_code_meta.insert(code_count, nc);
}
values.push(code);
values.push(Value::CallExpression(Box::new(code)));
code_count += 1;
for nc in noncode_after {
max_noncode_end = nc.end.max(max_noncode_end);
@ -1561,7 +1577,7 @@ const mySk1 = startSketchAt([0, 0])"#;
#[test]
fn inline_comment_pipe_expression() {
let test_input = r#"a('XY')
|> b()
|> b(%)
|> c(%) // inline-comment
|> d(%)"#;
@ -1778,10 +1794,10 @@ const mySk1 = startSketchAt([0, 0])"#;
#[test]
fn some_pipe_expr() {
let test_program = r#"x()
|> y() /* this is
|> y(%) /* this is
a comment
spanning a few lines */
|> z()"#;
|> z(%)"#;
let tokens = crate::token::lexer(test_program);
let actual = pipe_expression.parse(&tokens).unwrap();
let n = actual.non_code_meta.non_code_nodes.len();
@ -1795,17 +1811,17 @@ const mySk1 = startSketchAt([0, 0])"#;
fn comments_in_pipe_expr() {
for (i, test_program) in [
r#"y() |> /*hi*/ z(%)"#,
"1 |>/*hi*/ f",
"1 |>/*hi*/ f(%)",
r#"y() |> /*hi*/ z(%)"#,
"1 /*hi*/ |> f",
"1 /*hi*/ |> f(%)",
"1
// Hi
|> f",
|> f(%)",
"1
/* Hi
there
*/
|> f",
|> f(%)",
]
.into_iter()
.enumerate()
@ -2814,6 +2830,17 @@ let myBox = box([0,0], -3, -16, -10)
let parser = crate::parser::Parser::new(tokens);
parser.ast().unwrap();
}
#[test]
fn must_use_percent_in_pipeline_fn() {
let some_program_string = r#"
foo()
|> bar(2)
"#;
let tokens = crate::token::lexer(some_program_string);
let parser = crate::parser::Parser::new(tokens);
let err = parser.ast().unwrap_err();
println!("{err}")
}
}
#[cfg(test)]
@ -2864,7 +2891,7 @@ mod snapshot_tests {
let tokens = crate::token::lexer($test_kcl_program);
let actual = match program.parse(&tokens) {
Ok(x) => x,
Err(_e) => panic!("could not parse test"),
Err(e) => panic!("could not parse test: {e:?}"),
};
insta::assert_json_snapshot!(actual);
}
@ -2972,7 +2999,7 @@ mod snapshot_tests {
"const mySketch = startSketchAt([0,0]) |> lineTo([1, 1], %) |> close(%)"
);
snapshot_test!(ah, "const myBox = startSketchAt(p)");
snapshot_test!(ai, r#"const myBox = f(1) |> g(2)"#);
snapshot_test!(ai, r#"const myBox = f(1) |> g(2, %)"#);
snapshot_test!(aj, r#"const myBox = startSketchAt(p) |> line([0, l], %)"#);
snapshot_test!(ak, "lineTo({ to: [0, 1] })");
snapshot_test!(al, "lineTo({ to: [0, 1], from: [3, 3] })");

View File

@ -4,18 +4,18 @@ expression: actual
---
{
"start": 0,
"end": 26,
"end": 29,
"body": [
{
"type": "VariableDeclaration",
"type": "VariableDeclaration",
"start": 0,
"end": 26,
"end": 29,
"declarations": [
{
"type": "VariableDeclarator",
"start": 6,
"end": 26,
"end": 29,
"id": {
"type": "Identifier",
"start": 6,
@ -26,7 +26,7 @@ expression: actual
"type": "PipeExpression",
"type": "PipeExpression",
"start": 14,
"end": 26,
"end": 29,
"body": [
{
"type": "CallExpression",
@ -55,7 +55,7 @@ expression: actual
"type": "CallExpression",
"type": "CallExpression",
"start": 22,
"end": 26,
"end": 29,
"callee": {
"type": "Identifier",
"start": 22,
@ -70,6 +70,12 @@ expression: actual
"end": 25,
"value": 2,
"raw": "2"
},
{
"type": "PipeSubstitution",
"type": "PipeSubstitution",
"start": 27,
"end": 28
}
],
"optional": false

View File

@ -204,9 +204,9 @@ pub async fn get_next_adjacent_edge(args: Args) -> Result<MemoryItem, KclError>
/// |> line([0, 10], %, "thing")
/// |> line([10, 0], %, "thing1")
/// |> line([0, -10], %, "thing2")
/// |> close(%)
/// |> close(%, "thing3")
/// |> extrude(10, %)
/// |> fillet({radius: 2, tags: [getNextAdjacentEdge("thing", %)]}, %)
/// |> fillet({radius: 2, tags: [getNextAdjacentEdge("thing3", %)]}, %)
/// ```
#[stdlib {
name = "getNextAdjacentEdge",
@ -233,7 +233,7 @@ async fn inner_get_next_adjacent_edge(
let resp = args
.send_modeling_cmd(
uuid::Uuid::new_v4(),
ModelingCmd::Solid3DGetNextAdjacentEdge {
ModelingCmd::Solid3DGetPrevAdjacentEdge {
edge_id: tagged_path.geo_meta.id,
object_id: extrude_group.id,
face_id,
@ -241,7 +241,7 @@ async fn inner_get_next_adjacent_edge(
)
.await?;
let kittycad::types::OkWebSocketResponseData::Modeling {
modeling_response: kittycad::types::OkModelingCmdResponse::Solid3DGetNextAdjacentEdge { data: ajacent_edge },
modeling_response: kittycad::types::OkModelingCmdResponse::Solid3DGetPrevAdjacentEdge { data: ajacent_edge },
} = &resp
else {
return Err(KclError::Engine(KclErrorDetails {
@ -282,9 +282,9 @@ pub async fn get_previous_adjacent_edge(args: Args) -> Result<MemoryItem, KclErr
/// |> line([0, 10], %, "thing")
/// |> line([10, 0], %, "thing1")
/// |> line([0, -10], %, "thing2")
/// |> close(%)
/// |> close(%, "thing3")
/// |> extrude(10, %)
/// |> fillet({radius: 2, tags: [getPreviousAdjacentEdge("thing2", %)]}, %)
/// |> fillet({radius: 2, tags: [getPreviousAdjacentEdge("thing3", %)]}, %)
/// ```
#[stdlib {
name = "getPreviousAdjacentEdge",
@ -311,7 +311,7 @@ async fn inner_get_previous_adjacent_edge(
let resp = args
.send_modeling_cmd(
uuid::Uuid::new_v4(),
ModelingCmd::Solid3DGetPrevAdjacentEdge {
ModelingCmd::Solid3DGetNextAdjacentEdge {
edge_id: tagged_path.geo_meta.id,
object_id: extrude_group.id,
face_id,
@ -319,7 +319,7 @@ async fn inner_get_previous_adjacent_edge(
)
.await?;
let kittycad::types::OkWebSocketResponseData::Modeling {
modeling_response: kittycad::types::OkModelingCmdResponse::Solid3DGetPrevAdjacentEdge { data: ajacent_edge },
modeling_response: kittycad::types::OkModelingCmdResponse::Solid3DGetNextAdjacentEdge { data: ajacent_edge },
} = &resp
else {
return Err(KclError::Engine(KclErrorDetails {

View File

@ -18,7 +18,7 @@ pub async fn cos(args: Args) -> Result<MemoryItem, KclError> {
args.make_user_val_from_f64(result)
}
/// Computes the sine of a number (in radians).
/// Computes the cosine of a number (in radians).
///
/// ```no_run
/// const anotherVar = cos(2*pi())

View File

@ -123,6 +123,16 @@ pub async fn revolve(args: Args) -> Result<MemoryItem, KclError> {
/// ```
///
/// ```no_run
/// // A donut shape.
/// const sketch001 = startSketchOn('XY')
/// |> circle([15, 0], 5, %)
/// |> revolve({
/// angle: 360,
/// axis: 'y'
/// }, %)
/// ```
///
/// ```no_run
/// const part001 = startSketchOn('XY')
/// |> startProfileAt([4, 12], %)
/// |> line([2, 0], %)
@ -137,6 +147,27 @@ pub async fn revolve(args: Args) -> Result<MemoryItem, KclError> {
/// ```
///
/// ```no_run
/// const part001 = startSketchOn('XY')
/// |> startProfileAt([4, 12], %)
/// |> line([2, 0], %)
/// |> line([0, -6], %)
/// |> line([4, -6], %)
/// |> line([0, -6], %)
/// |> line([-3.75, -4.5], %)
/// |> line([0, -5.5], %)
/// |> line([-2, 0], %)
/// |> close(%)
/// |> revolve({axis: 'y', angle: 180}, %)
/// const part002 = startSketchOn(part001, 'end')
/// |> startProfileAt([4.5, -5], %)
/// |> line([0, 5], %)
/// |> line([5, 0], %)
/// |> line([0, -5], %)
/// |> close(%)
/// |> extrude(5, %)
/// ```
///
/// ```no_run
/// const box = startSketchOn('XY')
/// |> startProfileAt([0, 0], %)
/// |> line([0, 20], %)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 106 KiB

After

Width:  |  Height:  |  Size: 149 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 119 KiB

After

Width:  |  Height:  |  Size: 106 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 117 KiB

After

Width:  |  Height:  |  Size: 106 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 119 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 117 KiB

View File

@ -0,0 +1,51 @@
let d_wrist_circumference = [22.8, 10.7, 16.4, 18.5]
let width = d_wrist_circumference[0] + d_wrist_circumference[1] + d_wrist_circumference[2] + d_wrist_circumference[3]
let length = 120.0
let hand_thickness = 24.0
let corner_radius = 5.0
// At first I thought this was going to be symmetric,
// but I measured intentionally to not be symmetric,
// because your wrist isn't a perfect cylindrical surface
let brace_base = startSketchAt([corner_radius, 0])
|> line([width - corner_radius, 0.0], %)
|> tangentialArc([corner_radius, corner_radius], %)
|> yLine(25.0 - corner_radius, %)
|> tangentialArc([-corner_radius, corner_radius], %)
|> xLine(-(d_wrist_circumference[0] - (corner_radius * 2)), %)
|> tangentialArc([-corner_radius, corner_radius], %)
|> yLine(length - 25.0 - 23.0 - (corner_radius * 2), %)
|> tangentialArc([corner_radius, corner_radius], %)
|> xLine(15.0 - (corner_radius * 2), %)
|> tangentialArc([corner_radius, corner_radius], %)
|> yLine(23.0 - corner_radius, %)
|> tangentialArc([-corner_radius, corner_radius], %)
|> xLine(-(hand_thickness + 15.0 + 15.0 - (corner_radius * 2)), %)
|> tangentialArc([-corner_radius, -corner_radius], %)
|> yLine(-(23.0 - corner_radius), %)
|> tangentialArc([corner_radius, -corner_radius], %)
|> xLine(15.0 - (corner_radius * 2), %)
|> tangentialArc([corner_radius, -corner_radius], %)
|> yLine(-(length - 25.0 - 23.0 - (corner_radius * 2)), %)
|> tangentialArc([-corner_radius, -corner_radius], %)
|> xLine(-(d_wrist_circumference[1] + d_wrist_circumference[2] + d_wrist_circumference[3] - hand_thickness - corner_radius), %)
|> tangentialArc([-corner_radius, -corner_radius], %)
|> yLine(-(25.0 - corner_radius), %)
|> tangentialArc([corner_radius, -corner_radius], %)
|> close(%)
let inner = startSketchAt([0, 0])
|> xLine(1.0, %)
|> tangentialArc([corner_radius, corner_radius], %)
|> yLine(25.0 - (corner_radius * 2), %)
|> tangentialArc([-corner_radius, corner_radius], %)
|> xLine(-1.0, %)
|> tangentialArc([-corner_radius, -corner_radius], %)
|> yLine(-(25.0 - (corner_radius * 2)), %)
|> tangentialArc([corner_radius, -corner_radius], %)
|> close(%)
let final = brace_base
|> hole(inner, %)
|> extrude(3.0, %)

View File

@ -1,20 +1,20 @@
const svg = startSketchOn('XY')
|> lineTo([0])
|> lineTo([0 + 1])
|> lineTo([0 + 1 + 2])
|> lineTo([0 + 1 + 2 + 3])
|> lineTo([0 + 1 + 2 + 3 + 4])
|> lineTo([0 + 1 + 2 + 3 + 4 + 5])
|> lineTo([0 + 1 + 2 + 3 + 4 + 5 + 6])
|> lineTo([0 + 1 + 2 + 3 + 4 + 5 + 6 + 7])
|> lineTo([0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8])
|> lineTo([0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9])
|> lineTo([0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10])
|> lineTo([0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11])
|> lineTo([0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12])
|> lineTo([0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13])
|> lineTo([0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14])
|> lineTo([0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + 15])
|> lineTo([0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + 15 + 16])
|> lineTo([0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + 15 + 16 + 17])
|> lineTo([0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + 15 + 16 + 17 + 18])
|> lineTo([0],%)
|> lineTo([0 + 1],%)
|> lineTo([0 + 1 + 2],%)
|> lineTo([0 + 1 + 2 + 3],%)
|> lineTo([0 + 1 + 2 + 3 + 4],%)
|> lineTo([0 + 1 + 2 + 3 + 4 + 5],%)
|> lineTo([0 + 1 + 2 + 3 + 4 + 5 + 6],%)
|> lineTo([0 + 1 + 2 + 3 + 4 + 5 + 6 + 7],%)
|> lineTo([0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8],%)
|> lineTo([0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9],%)
|> lineTo([0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10],%)
|> lineTo([0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11],%)
|> lineTo([0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12],%)
|> lineTo([0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13],%)
|> lineTo([0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14],%)
|> lineTo([0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + 15],%)
|> lineTo([0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + 15 + 16],%)
|> lineTo([0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + 15 + 16 + 17],%)
|> lineTo([0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + 15 + 16 + 17 + 18],%)

View File

@ -0,0 +1,305 @@
const part001 = startSketchOn('XY')
|> startProfileAt([0.0, 0.0], %)
|> line([0.3095218558495034, -0.7083872933456363], %)
|> line([0.9654249947624629, -0.2160186018310415], %)
|> line([0.5639067891980512, 0.2782299956343597], %)
|> line([0.31099272713683224, -0.14283865756612024], %)
|> line([0.6050267610532611, 0.2419867749828144], %)
|> line([-0.4323915511683365, 0.5420452493934498], %)
|> line([-0.38075386000905387, -0.5066984514827444], %)
|> line([-0.24764758389378105, -0.028269261184496575], %)
|> line([-0.9547507244607472, 0.06698151094692739], %)
|> line([0.41281426037709057, 0.04247682532926844], %)
|> line([0.733675582700241, 0.3466438867749282], %)
|> line([-0.08320828774554445, 0.5306350687714299], %)
|> line([0.20070573965351035, -0.383629251628667], %)
|> line([-0.6100050904215362, 0.2122591494928594], %)
|> line([-0.8877251601125651, 0.9980849022788463], %)
|> line([0.3123326549087244, -0.13776227734026913], %)
|> line([-0.665018703555295, 0.9317350689283723], %)
|> line([0.11646747504481114, 0.44880962134512226], %)
|> line([-0.15034503757233764, -0.07514270519084065], %)
|> line([0.2106410349397485, -0.31901793587001537], %)
|> line([0.4367395608785267, -0.8469336669911456], %)
|> line([-0.6524104563094253, 0.022612116703192964], %)
|> line([0.04036408191329688, 0.7497713289526318], %)
|> line([-0.6099424500839847, 0.42578338327929477], %)
|> line([0.2738628173996067, 0.292996139723938], %)
|> line([0.8018957693340658, 0.5018988993652216], %)
|> line([0.9862148114460458, 0.8101962695418401], %)
|> line([0.18418024509134412, 0.6647051728461535], %)
|> line([-0.41769627175990043, -0.6264445510434984], %)
|> line([0.3991866953640668, 0.46136972597987436], %)
|> line([-0.44093982296772616, -0.8333288574682851], %)
|> line([-0.8447618278155113, -0.04502328445434012], %)
|> line([0.9053519778486987, 0.969918715258336], %)
|> line([0.3194360374757683, 0.03445025267979118], %)
|> line([0.06307363120331755, -0.0358428357517977], %)
|> line([-0.30728888002072186, -0.8058090225527681], %)
|> line([-0.2205915713289539, -0.68574749506418], %)
|> line([0.419141617082303, -0.374952391907611], %)
|> line([-0.7972443533406108, -0.37641928818278414], %)
|> line([0.3254690432623757, 0.800322923721221], %)
|> line([0.5419001425963772, 0.09338701240253178], %)
|> line([0.5272536888861876, -0.7219585162844677], %)
|> line([-0.9496693849948217, -0.2769753205653678], %)
|> line([0.4521856277880685, -0.962494995189215], %)
|> line([-0.07914106048413672, -0.5320023219059447], %)
|> line([-0.30087191904043586, -0.5990096310432906], %)
|> line([-0.9804312039683667, -0.20747398421974506], %)
|> line([0.7003345934688194, 0.34735726641904163], %)
|> line([-0.5812349365950902, 0.1245980114182097], %)
|> line([0.8562127850029553, 0.9561331524557184], %)
|> line([-0.3670208139314082, 0.21201331909674526], %)
|> line([-0.4707511307971115, 0.4905279615419764], %)
|> line([-0.8328324229085962, 0.4677492878818803], %)
|> line([-0.8111463382182231, -0.41814807547140576], %)
|> line([0.03807684940941125, 0.25664826686353326], %)
|> line([0.23950083339596384, 0.43693196301855575], %)
|> line([-0.16279444820904887, 0.8064475707664818], %)
|> line([-0.08972872009232558, -0.08887625823751266], %)
|> line([0.9203433427102556, -0.17343459369697545], %)
|> line([0.0017496234414517975, -0.5178508316168335], %)
|> line([0.6206263405732759, -0.8733399468665124], %)
|> line([-0.7776386664456383, 0.7602780485384968], %)
|> line([0.5439379760788592, 0.8449177589350552], %)
|> line([-0.13036646025917076, 0.012051713627069693], %)
|> line([-0.1656465612645519, -0.20775229173765486], %)
|> line([-0.0962723255929061, -0.05417797659066137], %)
|> line([0.902108945498191, 0.3958978534964961], %)
|> line([0.27997950083139167, -0.17778188444008958], %)
|> line([0.5235806061589545, 0.694318985642328], %)
|> line([0.39140760219992154, -0.7839795272576484], %)
|> line([0.8414243527073519, 0.5395591528940082], %)
|> line([-0.23919804420819268, 0.9950312242471215], %)
|> line([-0.24832135707240766, 0.12852484509989015], %)
|> line([-0.23306031340783884, -0.8746348470768666], %)
|> line([-0.982482038934116, 0.22333603211148145], %)
|> line([-0.8816255288350936, 0.5103601251495389], %)
|> line([0.15242108369693286, -0.7015378925056832], %)
|> line([-0.5385772302851539, -0.07031248099353693], %)
|> line([-0.16672156113764802, -0.5826174425548885], %)
|> line([0.25600811800134426, 0.025685903681070377], %)
|> line([0.9740978841265631, -0.9485583983333805], %)
|> line([0.7700855067313794, 0.9908891758829692], %)
|> line([-0.11756919649430464, 0.263852696629979], %)
|> line([0.622842218104259, -0.7773335041928975], %)
|> line([-0.9822916033957512, 0.9030795670859595], %)
|> line([0.17684671654276873, 0.5543296465531931], %)
|> line([-0.2585120033404764, -0.9946385700003058], %)
|> line([0.47903241172846855, 0.9436881919031574], %)
|> line([-0.34301067823447684, 0.6414567136954077], %)
|> line([0.6131643302815208, -0.4379709326841019], %)
|> line([-0.19976776590141587, 0.8961049779589205], %)
|> line([-0.8895558663652781, 0.08125215374497308], %)
|> line([0.7679023997363097, 0.05472225789480967], %)
|> line([-0.5573110628863549, -0.0493885276839825], %)
|> line([-0.8692870190797579, 0.34047428801384405], %)
|> line([-0.07963192514670636, 0.4906118707035698], %)
|> line([0.7546429709811202, 0.008793429901714722], %)
|> line([-0.33930119863603725, 0.904084721077185], %)
|> line([-0.9079263347011874, 0.05818097390308674], %)
|> line([0.9839286253275883, -0.4541365178001511], %)
|> line([-0.2630004661614309, -0.43811555004857716], %)
|> line([0.9656361166628373, -0.978769146384832], %)
|> line([-0.16395034069940184, -0.4639010139022397], %)
|> line([0.9105908865504724, -0.7176639594477656], %)
|> line([0.7070465909577839, 0.5157988806314064], %)
|> line([-0.012723556265232583, 0.6770815111856112], %)
|> line([-0.2943955496797206, -0.9743927595087347], %)
|> line([-0.1516930282544373, -0.3660544080480703], %)
|> line([-0.2695980406315064, -0.9768937499164652], %)
|> line([-0.3340785908248054, 0.5000926758093727], %)
|> line([-0.8613981451636481, 0.6683684704877668], %)
|> line([-0.8302138378432711, -0.0360629968083499], %)
|> line([-0.29040072414758744, 0.13018347388639695], %)
|> line([-0.4918613214920844, -0.6348418334773869], %)
|> line([-0.6621676894318094, -0.052130313096664604], %)
|> line([0.7417692436552934, 0.5896493608047846], %)
|> line([-0.7854331474660761, -0.032001603920813304], %)
|> line([-0.028697560050294113, 0.9608488511174829], %)
|> line([-0.7794985376111965, 0.4004278401373962], %)
|> line([-0.9333019526846862, 0.8413532084023534], %)
|> line([0.6669584789015472, 0.16795544524453265], %)
|> line([0.4691418582091864, -0.33541754144938984], %)
|> line([-0.3593199589576057, -0.7816337190621641], %)
|> line([-0.9145964527531667, -0.8064325123730209], %)
|> line([-0.9826383705388781, 0.3361524721141569], %)
|> line([-0.10809339353350111, -0.8758635697187047], %)
|> line([0.9541693823298274, 0.8263446355721698], %)
|> line([-0.44525574340096097, -0.6806381880440777], %)
|> line([-0.32599411929387645, 0.956248620927932], %)
|> line([0.9488597869031006, 0.045545197063536325], %)
|> line([0.7618475450804256, 0.10142472904482092], %)
|> line([0.3825096055636559, 0.10019167573578569], %)
|> line([-0.46148085777486303, 0.09056701568760928], %)
|> line([-0.22706656373264478, 0.9297166221335471], %)
|> line([-0.958861306195439, 0.31626278286591236], %)
|> line([-0.7010571654604918, 0.12109929549280829], %)
|> line([0.39726705538662155, 0.47600553691215475], %)
|> line([0.08621593475213007, -0.5296351060161009], %)
|> line([0.7754078435735718, 0.6093820711681557], %)
|> line([-0.3056814614007832, -0.8953363471752913], %)
|> line([0.48061255410893944, -0.38655492898582877], %)
|> line([-0.5989574891391645, 0.3133452514301842], %)
|> line([0.35506851023023334, 0.37705435800293374], %)
|> line([-0.6220678042464132, -0.5211627849228897], %)
|> line([0.2512638562718541, 0.951339134158065], %)
|> line([0.5205092100335389, -0.5136313372142864], %)
|> line([0.6606029240103481, 0.1887635591030341], %)
|> line([-0.22394411190507468, 0.5447920567080444], %)
|> line([0.5103589949893792, -0.29564917754139963], %)
|> line([0.16068072742941863, -0.22353679913991797], %)
|> line([-0.27792480093387906, 0.3435901480047461], %)
|> line([0.910750983246738, -0.9334565031046393], %)
|> line([-0.6515768237564095, 0.32212473016799326], %)
|> line([-0.5296333006910141, -0.3711267110258134], %)
|> line([0.2118314056290631, -0.33069360598339226], %)
|> line([-0.5365337213930894, -0.5473623916226522], %)
|> line([-0.5245048853127214, 0.8367949619466399], %)
|> line([-0.7540657866032676, 0.14769271338098067], %)
|> line([0.992763030391602, 0.7639316596588819], %)
|> line([0.857768378572884, -0.6944842500353121], %)
|> line([0.4005174768762376, 0.6600907669575815], %)
|> line([-0.645611390406511, -0.39861243885399], %)
|> line([0.009900486047594415, -0.77611756802181], %)
|> line([-0.19615593217773974, 0.41149023433301046], %)
|> line([0.42938472299603925, 0.9477517404188116], %)
|> line([0.40074130509588324, -0.566332587259486], %)
|> line([0.2898259341147218, 0.22590066890313354], %)
|> line([-0.5057556642549823, -0.5610169943703491], %)
|> line([0.4495779256452137, -0.021047394772889305], %)
|> line([0.173178392939364, -0.5498285342182849], %)
|> line([-0.08881879392509351, 0.25427796172400186], %)
|> line([-0.9657893584963719, 0.9839791825618085], %)
|> line([0.7083108746243418, -0.22535606355635363], %)
|> line([0.265419293693699, 0.35041736198594187], %)
|> line([0.7781087684483956, 0.05995639663529162], %)
|> line([-0.8768767310044128, -0.4718982924410984], %)
|> line([0.1678849629477135, -0.5293014024283789], %)
|> line([0.31120032834721156, 0.03705118004150609], %)
|> line([0.7329557552201549, -0.4314204260409016], %)
|> line([-0.6108642777595983, -0.35204612583851347], %)
|> line([-0.0839536144481916, -0.08354941188151321], %)
|> line([0.8371088826412028, 0.4260108441383106], %)
|> line([0.7493245515825924, 0.7618529060802053], %)
|> line([0.3221910673940078, 0.3927353824928492], %)
|> line([-0.9895483087404824, 0.18562652616960662], %)
|> line([-0.9579040110017665, 0.0353103934459702], %)
|> line([-0.05855811077127071, 0.12766243074937456], %)
|> line([0.15220552654559816, 0.576072300573911], %)
|> line([0.8846095083984233, -0.8738137361401468], %)
|> line([0.1506568989702708, -0.80620833872318], %)
|> line([0.6704828429539815, 0.3986607005727487], %)
|> line([-0.2113864165004411, 0.6162094819318868], %)
|> line([-0.9099033678353805, -0.7779600392259771], %)
|> line([0.11083360388105112, 0.34713599006897855], %)
|> line([0.15847847493707845, 0.3003425549761669], %)
|> line([0.057149024560813055, 0.6293978406406322], %)
|> line([0.02849804711673909, 0.3720708792227647], %)
|> line([0.9972884089146301, 0.83023332226007], %)
|> line([0.9345680207038343, 0.35203110690937445], %)
|> line([0.9001007717546186, -0.18486904592941977], %)
|> line([0.6170289088974352, -0.5164524313285441], %)
|> line([-0.960589963540097, 0.17372740027815037], %)
|> line([0.3862273162204759, 0.4119239419067209], %)
|> line([-0.9299016486339631, -0.8841302035625895], %)
|> line([0.2780400471183484, 0.8076195322861779], %)
|> line([0.3964118297657697, 0.22984978761967656], %)
|> line([-0.015952150868203674, -0.20163451763310558], %)
|> line([-0.4395610763077893, 0.6964676732605946], %)
|> line([-0.9111720887127097, 0.225080447388458], %)
|> line([0.07506155607092357, 0.6763598688853807], %)
|> line([0.7998287345894037, -0.7340954932733814], %)
|> line([-0.14730530701964129, 0.2647949264827336], %)
|> line([0.02956152490661612, -0.5657263126576406], %)
|> line([-0.8840295560189719, 0.7340227632302572], %)
|> line([0.45415942024525413, 0.15158083269451472], %)
|> line([0.9840487032500946, -0.6634475998601443], %)
|> line([0.13920534819599628, 0.736215165029908], %)
|> line([-0.1406599290299706, 0.40439717896079075], %)
|> line([-0.9169513885855405, 0.1570974766013722], %)
|> line([0.0034647416648696527, -0.6448386189259006], %)
|> line([0.1671862046540633, 0.5904328502842995], %)
|> line([0.6137667704875602, 0.22119647516722085], %)
|> line([0.8830488380766681, 0.6996724408425232], %)
|> line([-0.41290485754343953, -0.4152647361760933], %)
|> line([0.5169538755575687, -0.9085567867302617], %)
|> line([-0.6716353749059765, -0.9605576808879026], %)
|> line([0.010280170930300203, -0.37344123662342166], %)
|> line([0.10357375682791004, -0.42294321030821425], %)
|> line([0.4520311575096987, -0.11232675307600548], %)
|> line([-0.8821185914380845, -0.7155147434939819], %)
|> line([0.9195487101690416, 0.2691627465297364], %)
|> line([0.7098978191546745, 0.11710004169385968], %)
|> line([-0.37876368560819995, 0.7106729314759084], %)
|> line([-0.29728126898353335, -0.06649734568328003], %)
|> line([0.22965781558352072, -0.7601866432836641], %)
|> line([-0.6356501074317229, 0.19458425399338064], %)
|> line([0.5721251777404546, 0.2888584097921527], %)
|> line([-0.9580409549552311, -0.02243818192078395], %)
|> line([0.3299184618602866, -0.8353726942369875], %)
|> line([0.7434639386755209, -0.7919648864138378], %)
|> line([0.9935751011164615, 0.9042566468497608], %)
|> line([-0.5035812884687294, 0.5150967434989442], %)
|> line([0.5526227215900215, 0.7612604137272441], %)
|> line([0.8593271349126876, 0.08414894953725849], %)
|> line([-0.8181049219192864, -0.903548131323352], %)
|> line([0.3165782044458305, -0.24189274252014914], %)
|> line([-0.44390956414045135, -0.25912591535126905], %)
|> line([-0.6605165911891009, -0.40355115288839194], %)
|> line([-0.7170489950180006, 0.23454356079651384], %)
|> line([-0.2568187045379722, -0.45031188717601367], %)
|> line([0.6751951211858687, -0.9709424233465593], %)
|> line([-0.5689619842972184, 0.5918969913790362], %)
|> line([0.9464450621708211, -0.2684908127803667], %)
|> line([0.5241732366617591, 0.9011437416408563], %)
|> line([-0.14255393713960607, -0.5194262624564814], %)
|> line([-0.4287123231350338, -0.4223564528725028], %)
|> line([-0.09316367294024519, -0.9063127021008246], %)
|> line([-0.2767766535558669, 0.6816248114129131], %)
|> line([0.9796762495562534, -0.0822145668330625], %)
|> line([-0.8666513070867441, -0.301053160242023], %)
|> line([0.537415656028112, 0.020272692875002774], %)
|> line([0.9332396256457531, -0.6228175690649898], %)
|> line([0.18052415837320734, -0.36894384647296197], %)
|> line([0.5384372634075449, 0.2377565050887107], %)
|> line([0.39043436929278874, 0.14273182483160451], %)
|> line([0.09782890412897283, 0.9907667536909659], %)
|> line([0.5286610085921146, -0.7924508308419256], %)
|> line([0.3789978184503342, 0.12396120576838676], %)
|> line([-0.9484912744890612, 0.6729649846476855], %)
|> line([0.7451758753425153, -0.21318737562458967], %)
|> line([0.1873200727251887, -0.15961374297992448], %)
|> line([-0.05729464924537564, -0.5436345558508746], %)
|> line([-0.09582414374469184, -0.7533839681212353], %)
|> line([-0.17254116580051848, -0.7669113400341137], %)
|> line([0.8944730032887609, 0.6093318694741408], %)
|> line([-0.6238548626325471, 0.4053626746020169], %)
|> line([0.1379445992766417, -0.47871087958516045], %)
|> line([-0.9516767113283946, 0.8619900618578948], %)
|> line([0.9398732950992088, 0.6326239915683629], %)
|> line([-0.8631974445502164, 0.016153555523963137], %)
|> line([0.19167797120152907, -0.4916414381703984], %)
|> line([-0.8644261221501586, -0.11434763886359756], %)
|> line([-0.029081958413378572, -0.5214138808318329], %)
|> line([-0.8713091851579695, 0.7866284950967315], %)
|> line([0.884342023093545, -0.1825407002568431], %)
|> line([-0.6978385295364686, 0.0440574328736949], %)
|> line([-0.48055049324331556, -0.028546347149214002], %)
|> line([0.41283517382864776, -0.44938038251347323], %)
|> line([0.7911399832501751, 0.893446368526005], %)
|> line([0.6507434699009087, -0.6890023920962012], %)
|> line([0.10489019777253028, -0.5467450997193952], %)
|> line([-0.5760905289992633, -0.2639900702114173], %)
|> line([0.39828861790105297, 0.8036624129416385], %)
|> line([-0.673848991328553, -0.918443329270668], %)
|> line([-0.8599152936179257, -0.9499371022680787], %)
|> line([0.6285243831393765, -0.5186557636566307], %)
|> line([0.3222412784832269, 0.24621192679727177], %)
|> line([0.19754357911311016, -0.7529246632397206], %)
|> line([-0.43181570545865555, 0.18945437402201537], %)
|> line([0.8714511090241797, -0.7215844196844685], %)
|> close(%)
|> extrude(5, %)

View File

@ -293,9 +293,9 @@ async fn serial_test_basic_fillet_cube_next_adjacent() {
|> line([0, 10], %, "thing")
|> line([10, 0], %, "thing1")
|> line([0, -10], %, "thing2")
|> close(%)
|> close(%, "thing3")
|> extrude(10, %)
|> fillet({radius: 2, tags: [getNextAdjacentEdge("thing", %)]}, %)
|> fillet({radius: 2, tags: [getNextAdjacentEdge("thing3", %)]}, %)
"#;
let result = execute_and_snapshot(code, kittycad::types::UnitLength::Mm)
@ -315,9 +315,9 @@ async fn serial_test_basic_fillet_cube_previous_adjacent() {
|> line([0, 10], %, "thing")
|> line([10, 0], %, "thing1")
|> line([0, -10], %, "thing2")
|> close(%)
|> close(%, "thing3")
|> extrude(10, %)
|> fillet({radius: 2, tags: [getPreviousAdjacentEdge("thing2", %)]}, %)
|> fillet({radius: 2, tags: [getPreviousAdjacentEdge("thing3", %)]}, %)
"#;
let result = execute_and_snapshot(code, kittycad::types::UnitLength::Mm)
@ -481,6 +481,17 @@ async fn serial_test_execute_engine_error_return() {
);
}
#[tokio::test(flavor = "multi_thread")]
async fn serial_test_execute_i_shape() {
// This is some code from lee that starts a pipe expression with a variable.
let code = include_str!("inputs/i_shape.kcl");
let result = execute_and_snapshot(code, kittycad::types::UnitLength::Mm)
.await
.unwrap();
twenty_twenty::assert_image("tests/executor/outputs/i_shape.png", &result, 0.999);
}
#[tokio::test(flavor = "multi_thread")]
#[ignore] // ignore until more stack fixes
async fn serial_test_execute_pipes_on_pipes() {
@ -1793,7 +1804,6 @@ async fn serial_test_basic_revolve_circle() {
}
#[tokio::test(flavor = "multi_thread")]
#[ignore] // Ignore this test until https://github.com/KittyCAD/engine/pull/1930 is fixed
async fn serial_test_simple_revolve_sketch_on_edge() {
let code = r#"const part001 = startSketchOn('XY')
|> startProfileAt([4, 12], %)

Binary file not shown.

After

Width:  |  Height:  |  Size: 125 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 107 KiB

After

Width:  |  Height:  |  Size: 106 KiB