Compare commits

..

27 Commits

Author SHA1 Message Date
eea823e0bc Merge remote-tracking branch 'origin/main' into paultag/machine-api-api 2024-10-04 13:10:24 -04:00
a1b875062f more 2024-10-04 13:10:09 -04:00
4e0dd12f5a Update machine-api spec (#4091)
* YOYO NEW API SPEC!

* New machine-api types

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-10-04 08:34:06 -07:00
bcf2572739 chore: implemented web playwright test to catch this regression (#3982) 2024-10-04 09:12:40 -04:00
074c285e04 Add syntax highlighting for if-else (#4090)
* Add syntax highlighting for if-else

* A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest)

* Confirm

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-10-04 08:34:09 -04:00
0924dd4f60 A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest) 2024-10-04 02:08:13 +00:00
6b7f200564 noop 2024-10-03 22:00:55 -04:00
1a7339fb70 New machine-api types 2024-10-04 01:39:15 +00:00
c1a450b15e update machine-api openapi 2024-10-03 21:37:23 -04:00
d7bc92afd9 Fix CodeMirror syntax highlighting of variables without keyword (#4089)
* Fix CodeMirror syntax highlighting of variables without keyword

* A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu-latest)

* A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest)

* Confirm

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-10-04 01:29:13 +00:00
11dfd87240 adhoc/Bug fixing the last-failed retries across jobs (#4086)
* chore: adding Kurt's fix for electron in the new CI CD files. Adding a forced failure to test

* chore: increasing max retry for electron to match the playwright browser retry count

* fix: debugging ci cd for playwright last report

* fix: changing the output dir for snapshot to a custom one to not overwrite the previous job runs failure

* fix: found out hidden files are excluded automatically, was a breaking change :(

* fix: output typo

* A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu-latest)

* A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest)

* Delete test-results-snapshots/.last-run.json

* A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu-latest)

* A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest)

* A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu-latest)

* fix: cleanup

* A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest)

* Delete test-results-snapshots/.last-run.json

* fix: removing this folder, should have been git ignored

* fix: do not need these anymore since the hidden files is fixed

* fix: removed hard coded failure for debugging

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-10-03 20:09:30 -05:00
bf3815086a Bump kittycad-modeling-cmds from 0.2.67 to 0.2.68 in /src/wasm-lib (#4081)
Bumps [kittycad-modeling-cmds](https://github.com/KittyCAD/modeling-api) from 0.2.67 to 0.2.68.
- [Commits](https://github.com/KittyCAD/modeling-api/compare/kittycad-modeling-cmds-0.2.67...kittycad-modeling-cmds-0.2.68)

---
updated-dependencies:
- dependency-name: kittycad-modeling-cmds
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-03 11:36:39 -07:00
115e6baa53 Reload projects when there are external changes on the file-system (#4077) 2024-10-03 13:02:57 -04:00
e1406012b4 Nadro/4012/ci cd update (#4062)
* chore: saving off package.json progress unit tests fail in main

* fix: implementing a one liner for unit tests

* fix: renaming test:unit:local

* chore: adding playwright tests

* fix: making package.json not destructive to keep same pipeline commands for now

* fix: reordering

* fix: added tags for OS tests, moved kill-port to dev depen

* fix: OS skipping at tag level

* fix: lint, fmt, tsc, etc...

* Look at this (photo)Graph *in the voice of Nickelback*

* fix: new formatting

* fix: removing the ci copy, do not like it

* Look at this (photo)Graph *in the voice of Nickelback*

* chore: updating readme with explanation on the commands for CI CD simulation locally

* fix: package.json command for unit test, removing cached breaking cache in unit tests

* fix: fixing copy and typos in README.md for CI CD section

* fix: adding a duplicate command for a better name. CI CD will use it in a future PR

* chore: trying to clean up the copy and commands for CI CD tests

* chore: porting the bash code in the YAML to a bash script then using matrix permutations to control the runtime

* fix: typos

* fix: another typo, missed these went porting to the bash script logic

* fix: I think I need the checkout action since it has the repo code?

* fix: wrote absolute path not the relative hidden path, ope

* fix: does this cache give me the yarn install of playwright?

* fix: yarn cannot find the binary, use the yarn command

* fix: remove all uses...?

* chore: adding bash script for electron runtimes

* fix: copy cleanup

* fix: typo when copy and pasting the exclude logic, ope

* fix: this is wrong

* fix: build:wasm is a requirement for yarn tsc

* fix: reorder?

* fix: renaming integrations to e2e

* fix: windows is complaining about a pipe issue in the bash script?

* fix: escaping double quotes in windows?

* chore: consolidating commands into 1 file and easier YAML configuation for electron

* chore: mapped multiple OS playwright browser into a single bash script

* fix: removing old bash scripts, renaming matrix jobs

* fix: missed deleting this when I added the if statements.

* chore: removing unused job, xstate typegen more more since v5

* fix: trying to get these two tests to pass on first try

* fix: auto fixes

* fix: removing old unit test command

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-10-03 09:40:12 -05:00
max
46d335f916 Refactor Fillet Logic to Combine Multiple Tags Within the Same Fillet Expression (#4058)
* combine tags + tests

* delete getFilletTag function

* fix playwright test

* make eslint happy

* delete missed 'const'

* delete const rev2
2024-10-03 11:14:02 +02:00
c84c0b0fef return errors back to user (#4075)
* Log any Errors to stderr

This isn't perfect -- in fact, this is maybe not even very good at all,
but it's better than what we have today.

Currently, when we get an Erorr back from the WebSocket, we drop it in
kcl-lib. The web-app logs these to the console (I can't find my commit
doing that off the top of my head, but I remember doing it) -- so this
is some degree of partity.

This won't be very useful at all for wasm usage, but it will fix issues
with the zoo cli silently breaking with a "WebSocket Closed" error --
which is the same issue I was solving for in the desktop app too.

In the future perhaps this can be a real Error? I'm not totally sure
yet, since we can't align to the request-id, so we can't really tie it
to a specific call (yet).

* add to responses

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

* A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu-latest)

* add a test

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

* clippy[

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

* A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu-latest)

* empty

* fix error

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

* updates tests

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

* docs

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

---------

Signed-off-by: Jess Frazelle <github@jessfraz.com>
Co-authored-by: Jess Frazelle <github@jessfraz.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Jess Frazelle <jessfraz@users.noreply.github.com>
2024-10-02 22:05:12 -07:00
c0afbff377 Fix wasm executor tests to use no const keyword (#4079) 2024-10-03 00:59:57 +00:00
88510e30b2 Fix broken test from 'no const/let' PR (#4078)
I must have missed this amongst all the "websocket closed early" noise,
sorry.
2024-10-02 18:23:47 -05:00
f9a07627d8 Make scroll mouse controls not fire if buttons are pressed (#4053)
* Make scroll mouse controls not fire if buttons are pressed

* Add an E2E test
2024-10-02 17:19:29 -04:00
3ad3c56b2c Bump async-trait from 0.1.82 to 0.1.83 in /src/wasm-lib (#3978)
Bumps [async-trait](https://github.com/dtolnay/async-trait) from 0.1.82 to 0.1.83.
- [Release notes](https://github.com/dtolnay/async-trait/releases)
- [Commits](https://github.com/dtolnay/async-trait/compare/0.1.82...0.1.83)

---
updated-dependencies:
- dependency-name: async-trait
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-02 12:59:26 -07:00
30e417dffd Bump google-github-actions/auth from 2.1.5 to 2.1.6 (#4073)
Bumps [google-github-actions/auth](https://github.com/google-github-actions/auth) from 2.1.5 to 2.1.6.
- [Release notes](https://github.com/google-github-actions/auth/releases)
- [Changelog](https://github.com/google-github-actions/auth/blob/main/CHANGELOG.md)
- [Commits](https://github.com/google-github-actions/auth/compare/v2.1.5...v2.1.6)

---
updated-dependencies:
- dependency-name: google-github-actions/auth
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-02 12:59:12 -07:00
631513443d Bump clap from 4.5.18 to 4.5.19 in /src/wasm-lib (#4072)
Bumps [clap](https://github.com/clap-rs/clap) from 4.5.18 to 4.5.19.
- [Release notes](https://github.com/clap-rs/clap/releases)
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/clap-rs/clap/compare/clap_complete-v4.5.18...clap_complete-v4.5.19)

---
updated-dependencies:
- dependency-name: clap
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-02 12:59:01 -07:00
e7aebeac12 Bump indexmap from 2.5.0 to 2.6.0 in /src/wasm-lib (#4071)
Bumps [indexmap](https://github.com/indexmap-rs/indexmap) from 2.5.0 to 2.6.0.
- [Changelog](https://github.com/indexmap-rs/indexmap/blob/master/RELEASES.md)
- [Commits](https://github.com/indexmap-rs/indexmap/compare/2.5.0...2.6.0)

---
updated-dependencies:
- dependency-name: indexmap
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-02 12:58:51 -07:00
0c478680cb KCL: No 'let' or 'const' required when declaring vars (#4063)
Previously variable declaration required a keyword, e.g.

```kcl
let x = 4
const x = 4
var x = 4
```

These were all valid, and did the exact same thing. As of this PR, they're all still valid, but the KCL formatter will change them all to just:

```kcl
x = 4
```

which is the new preferred way to declare a constant. 

But the formatter will remove the var/let/const keywords.

Closes https://github.com/KittyCAD/modeling-app/issues/3985
2024-10-02 14:19:40 -05:00
a24789c236 Make web app warning banner in the middle of the screen and simpler (#4044)
* Make web app warning banner in the middle of the screen and simpler

* Some dark mode styles were whack

* Better wording for second sentence

* Update text in popup and appearance of download link

* Make download link first in focus order
2024-10-02 14:29:57 -04:00
3035ad16fc Nadro/adhoc/e2e improvements (#4013)
* chore: saving off package.json progress unit tests fail in main

* fix: implementing a one liner for unit tests

* fix: renaming test:unit:local

* chore: adding playwright tests

* fix: making package.json not destructive to keep same pipeline commands for now

* fix: reordering

* fix: added tags for OS tests, moved kill-port to dev depen

* fix: OS skipping at tag level

* fix: lint, fmt, tsc, etc...

* Look at this (photo)Graph *in the voice of Nickelback*

* fix: new formatting

* fix: removing the ci copy, do not like it

* Look at this (photo)Graph *in the voice of Nickelback*

* chore: updating readme with explanation on the commands for CI CD simulation locally

* fix: package.json command for unit test, removing cached breaking cache in unit tests

* fix: fixing copy and typos in README.md for CI CD section

* fix: adding a duplicate command for a better name. CI CD will use it in a future PR

* fix: this is wrong... removing it

* A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest)

* Revert "A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest)"

This reverts commit f767dd46d4.

* fix: typos in README.md

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Kurt Hutten Irev-Dev <k.hutten@protonmail.ch>
2024-10-02 10:58:17 -05:00
74faf0461c Invalidate bucket cache on release (#4057) 2024-10-02 08:08:37 -04:00
443 changed files with 3486 additions and 2990 deletions

View File

@ -0,0 +1,59 @@
# bash strict mode
set -euo pipefail
if [[ ! -f "test-results/.last-run.json" ]]; then
# if no last run artifact, than run plawright normally
echo "run playwright normally"
if [[ "$3" == "ubuntu-latest" ]]; then
yarn test:playwright:browser:chrome:ubuntu -- --shard=$1/$2 || true
elif [[ "$3" == "windows-latest" ]]; then
yarn test:playwright:browser:chrome:windows -- --shard=$1/$2 || true
else
echo "Do not run playwright. Unable to detect os runtime."
exit 1
fi
# # send to axiom
node playwrightProcess.mjs | tee /tmp/github-actions.log > /dev/null 2>&1
fi
retry=1
max_retrys=4
# retry failed tests, doing our own retries because using inbuilt playwright retries causes connection issues
while [[ $retry -le $max_retrys ]]; do
if [[ -f "test-results/.last-run.json" ]]; then
failed_tests=$(jq '.failedTests | length' test-results/.last-run.json)
if [[ $failed_tests -gt 0 ]]; then
echo "retried=true" >>$GITHUB_OUTPUT
echo "run playwright with last failed tests and retry $retry"
if [[ "$3" == "ubuntu-latest" ]]; then
yarn test:playwright:browser:chrome:ubuntu -- --last-failed || true
elif [[ "$3" == "windows-latest" ]]; then
yarn test:playwright:browser:chrome:windows -- --last-failed || true
else
echo "Do not run playwright. Unable to detect os runtime."
exit 1
fi
# send to axiom
node playwrightProcess.mjs | tee /tmp/github-actions.log > /dev/null 2>&1
retry=$((retry + 1))
else
echo "retried=false" >>$GITHUB_OUTPUT
exit 0
fi
else
echo "retried=false" >>$GITHUB_OUTPUT
exit 0
fi
done
echo "retried=false" >>$GITHUB_OUTPUT
if [[ -f "test-results/.last-run.json" ]]; then
failed_tests=$(jq '.failedTests | length' test-results/.last-run.json)
if [[ $failed_tests -gt 0 ]]; then
# if it still fails after 3 retrys, then fail the job
exit 1
fi
fi
exit 0

63
.github/ci-cd-scripts/playwright-electron.sh vendored Executable file
View File

@ -0,0 +1,63 @@
# bash strict mode
set -euo pipefail
if [[ ! -f "test-results/.last-run.json" ]]; then
# if no last run artifact, than run plawright normally
echo "run playwright normally"
if [[ "$1" == "ubuntu-latest" ]]; then
xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" -- yarn test:playwright:electron:ubuntu || true
elif [[ "$1" == "windows-latest" ]]; then
yarn test:playwright:electron:windows || true
elif [[ "$1" == "macos-14" ]]; then
yarn test:playwright:electron:macos || true
else
echo "Do not run playwright. Unable to detect os runtime."
exit 1
fi
# # send to axiom
node playwrightProcess.mjs | tee /tmp/github-actions.log > /dev/null 2>&1
fi
retry=1
max_retrys=4
# retry failed tests, doing our own retries because using inbuilt playwright retries causes connection issues
while [[ $retry -le $max_retrys ]]; do
if [[ -f "test-results/.last-run.json" ]]; then
failed_tests=$(jq '.failedTests | length' test-results/.last-run.json)
if [[ $failed_tests -gt 0 ]]; then
echo "retried=true" >>$GITHUB_OUTPUT
echo "run playwright with last failed tests and retry $retry"
if [[ "$1" == "ubuntu-latest" ]]; then
xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" -- yarn test:playwright:electron:ubuntu -- --last-failed || true
elif [[ "$1" == "windows-latest" ]]; then
yarn test:playwright:electron:windows -- --last-failed || true
elif [[ "$1" == "macos-14" ]]; then
yarn test:playwright:electron:macos -- --last-failed || true
else
echo "Do not run playwright. Unable to detect os runtime."
exit 1
fi
# send to axiom
node playwrightProcess.mjs | tee /tmp/github-actions.log > /dev/null 2>&1
retry=$((retry + 1))
else
echo "retried=false" >>$GITHUB_OUTPUT
exit 0
fi
else
echo "retried=false" >>$GITHUB_OUTPUT
exit 0
fi
done
echo "retried=false" >>$GITHUB_OUTPUT
if [[ -f "test-results/.last-run.json" ]]; then
failed_tests=$(jq '.failedTests | length' test-results/.last-run.json)
if [[ $failed_tests -gt 0 ]]; then
# if it still fails after 3 retrys, then fail the job
exit 1
fi
fi
exit 0

View File

@ -306,7 +306,7 @@ jobs:
run: "ls -R out"
- name: Authenticate to Google Cloud
uses: 'google-github-actions/auth@v2.1.5'
uses: 'google-github-actions/auth@v2.1.6'
with:
credentials_json: '${{ secrets.GOOGLE_CLOUD_DL_SA }}'
@ -343,7 +343,12 @@ jobs:
with:
files: 'out/Zoo*'
# TODO: Add GitHub publisher
- name: Invalidate bucket cache on latest*.yml and last_download.json files
run: |
gcloud compute url-maps invalidate-cdn-cache dl-url-map --path="/releases/modeling-app/last_download.json" --async
gcloud compute url-maps invalidate-cdn-cache dl-url-map --path="/releases/modeling-app/latest-linux-arm64.yml" --async
gcloud compute url-maps invalidate-cdn-cache dl-url-map --path="/releases/modeling-app/latest-mac.yml" --async
gcloud compute url-maps invalidate-cdn-cache dl-url-map --path="/releases/modeling-app/latest.yml" --async
announce_release:
needs: [publish-apps-release]

View File

@ -1,4 +1,4 @@
name: Playwright Tests
name: E2E Tests
on:
push:
branches: [ main ]
@ -33,8 +33,9 @@ jobs:
rust:
- 'src/wasm-lib/**'
playwright-chrome:
browser:
timeout-minutes: ${{ matrix.os == 'macos-14' && 60 || 50 }}
name: playwright:browser:${{ matrix.os }} ${{ matrix.shardIndex }} ${{ matrix.shardTotal }}
strategy:
fail-fast: false
matrix:
@ -141,6 +142,7 @@ jobs:
with:
name: playwright-report-${{ matrix.os }}-snapshot-${{ matrix.shardIndex }}-${{ github.sha }}
path: playwright-report/
include-hidden-files: true
retention-days: 30
overwrite: true
- name: Clean up test-results
@ -176,6 +178,7 @@ jobs:
with:
name: playwright-report-${{ matrix.os }}-${{ matrix.shardIndex }}-${{ github.sha }}
path: playwright-report/
include-hidden-files: true
retention-days: 30
- uses: actions/download-artifact@v4
if: ${{ !cancelled() && (success() || failure()) }}
@ -183,69 +186,12 @@ jobs:
with:
name: test-results-${{ matrix.os }}-${{ matrix.shardIndex }}-${{ github.sha }}
path: test-results/
- name: Debug test-results folder
if: ${{ !cancelled() && (success() || failure()) }}
shell: bash
run: |
if [[ -d "test-results" ]]; then
echo "Contents of test-results folder:"
ls -la test-results
if [[ -f "test-results/.last-run.json" ]]; then
echo "Contents of test-results/.last-run.json:"
cat test-results/.last-run.json
else
echo "test-results/.last-run.json does not exist"
fi
else
echo "test-results folder does not exist"
fi
- name: Run playwright/chrome flow (with retries)
id: retry
if: ${{ !cancelled() && (success() || failure()) }}
shell: bash
run: |
if [[ ! -f "test-results/.last-run.json" ]]; then
# if no last run artifact, than run plawright normally
echo "run playwright normally"
yarn playwright test --project="Google Chrome" --config=playwright.ci.config.ts --shard=${{ matrix.shardIndex }}/${{ matrix.shardTotal }} --grep-invert="@snapshot|@electron" || true
# # send to axiom
node playwrightProcess.mjs | tee /tmp/github-actions.log > /dev/null 2>&1
fi
retry=1
max_retrys=1
# retry failed tests, doing our own retries because using inbuilt playwright retries causes connection issues
while [[ $retry -le $max_retrys ]]; do
if [[ -f "test-results/.last-run.json" ]]; then
failed_tests=$(jq '.failedTests | length' test-results/.last-run.json)
if [[ $failed_tests -gt 0 ]]; then
echo "retried=true" >>$GITHUB_OUTPUT
echo "run playwright with last failed tests and retry $retry"
yarn playwright test --project="Google Chrome" --config=playwright.ci.config.ts --last-failed --grep-invert="@snapshot|@electron" || true
# send to axiom
node playwrightProcess.mjs | tee /tmp/github-actions.log > /dev/null 2>&1
retry=$((retry + 1))
else
echo "retried=false" >>$GITHUB_OUTPUT
exit 0
fi
else
echo "retried=false" >>$GITHUB_OUTPUT
exit 0
fi
done
echo "retried=false" >>$GITHUB_OUTPUT
if [[ -f "test-results/.last-run.json" ]]; then
failed_tests=$(jq '.failedTests | length' test-results/.last-run.json)
if [[ $failed_tests -gt 0 ]]; then
# if it still fails after 3 retrys, then fail the job
exit 1
fi
fi
exit 0
.github/ci-cd-scripts/playwright-browser-chrome.sh ${{matrix.shardIndex}} ${{matrix.shardTotal}} ${{matrix.os}}
env:
CI: true
FAIL_ON_CONSOLE_ERRORS: true
@ -258,27 +204,12 @@ jobs:
shell: bash
run: |
node playwrightProcess.mjs | tee /tmp/github-actions.log
- name: Debug test-results folder
if: ${{ !cancelled() && (success() || failure()) }}
shell: bash
run: |
if [[ -d "test-results" ]]; then
echo "Contents of test-results folder:"
ls -la test-results
if [[ -f "test-results/.last-run.json" ]]; then
echo "Contents of test-results/.last-run.json:"
cat test-results/.last-run.json
else
echo "test-results/.last-run.json does not exist"
fi
else
echo "test-results folder does not exist"
fi
- uses: actions/upload-artifact@v4
if: always()
with:
name: test-results-${{ matrix.os }}-${{ matrix.shardIndex }}-${{ github.sha }}
path: test-results/
include-hidden-files: true
retention-days: 30
overwrite: true
- uses: actions/upload-artifact@v4
@ -286,11 +217,13 @@ jobs:
with:
name: playwright-report-${{ matrix.os }}-${{ matrix.shardIndex }}-${{ github.sha }}
path: playwright-report/
include-hidden-files: true
retention-days: 30
overwrite: true
playwright-electron:
electron:
name: playwright:electron:${{matrix.os}}
strategy:
fail-fast: false
matrix:
@ -386,77 +319,12 @@ jobs:
with:
name: test-results-electron-${{ matrix.os }}-${{ github.sha }}
path: test-results/
- name: Debug test-results folder
if: ${{ !cancelled() && (success() || failure()) }}
shell: bash
run: |
if [[ -d "test-results" ]]; then
echo "Contents of test-results folder:"
ls -la test-results
if [[ -f "test-results/.last-run.json" ]]; then
echo "Contents of test-results/.last-run.json:"
cat test-results/.last-run.json
else
echo "test-results/.last-run.json does not exist"
fi
else
echo "test-results folder does not exist"
fi
- name: Run electron tests (with retries)
id: retry
if: ${{ !cancelled() && (success() || failure()) }}
shell: bash
run: |
if [[ ! -f "test-results/.last-run.json" ]]; then
# if no last run artifact, than run plawright normally
echo "run playwright normally"
if [[ "$IS_UBUNTU" == "true" ]]; then
xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" -- yarn playwright test --config=playwright.electron.config.ts --grep=@electron || true
else
yarn playwright test --config=playwright.electron.config.ts --grep=@electron || true
fi
# # send to axiom
node playwrightProcess.mjs | tee /tmp/github-actions.log > /dev/null 2>&1
fi
retry=1
max_retrys=1
# retry failed tests, doing our own retries because using inbuilt playwright retries causes connection issues
while [[ $retry -le $max_retrys ]]; do
if [[ -f "test-results/.last-run.json" ]]; then
failed_tests=$(jq '.failedTests | length' test-results/.last-run.json)
if [[ $failed_tests -gt 0 ]]; then
echo "retried=true" >>$GITHUB_OUTPUT
echo "run playwright with last failed tests and retry $retry"
if [[ "$IS_UBUNTU" == "true" ]]; then
xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" -- yarn playwright test --config=playwright.electron.config.ts --last-failed --grep=@electron || true
else
yarn playwright test --config=playwright.electron.config.ts --grep=@electron || true
fi
# send to axiom
node playwrightProcess.mjs | tee /tmp/github-actions.log > /dev/null 2>&1
retry=$((retry + 1))
else
echo "retried=false" >>$GITHUB_OUTPUT
exit 0
fi
else
echo "retried=false" >>$GITHUB_OUTPUT
exit 0
fi
done
echo "retried=false" >>$GITHUB_OUTPUT
if [[ -f "test-results/.last-run.json" ]]; then
failed_tests=$(jq '.failedTests | length' test-results/.last-run.json)
if [[ $failed_tests -gt 0 ]]; then
# if it still fails after 3 retrys, then fail the job
exit 1
fi
fi
exit 0
.github/ci-cd-scripts/playwright-electron.sh ${{ matrix.os }}
env:
CI: true
FAIL_ON_CONSOLE_ERRORS: true
@ -470,27 +338,12 @@ jobs:
shell: bash
run: |
node playwrightProcess.mjs | tee /tmp/github-actions.log
- name: Debug test-results folder
if: ${{ !cancelled() && (success() || failure()) }}
shell: bash
run: |
if [[ -d "test-results" ]]; then
echo "Contents of test-results folder:"
ls -la test-results
if [[ -f "test-results/.last-run.json" ]]; then
echo "Contents of test-results/.last-run.json:"
cat test-results/.last-run.json
else
echo "test-results/.last-run.json does not exist"
fi
else
echo "test-results folder does not exist"
fi
- uses: actions/upload-artifact@v4
if: ${{ !cancelled() && (success() || failure()) }}
with:
name: test-results-electron-${{ matrix.os }}-${{ github.sha }}
path: test-results/
include-hidden-files: true
retention-days: 30
overwrite: true
- uses: actions/upload-artifact@v4
@ -498,5 +351,6 @@ jobs:
with:
name: playwright-report-electron-${{ matrix.os }}-${{ github.sha }}
path: playwright-report/
include-hidden-files: true
retention-days: 30
overwrite: true

View File

@ -1,4 +1,4 @@
name: build-test-web
name: Static Analysis
on:
pull_request:
@ -16,7 +16,7 @@ permissions:
actions: read
jobs:
check-format:
yarn-fmt-check:
runs-on: 'ubuntu-22.04'
steps:
- uses: actions/checkout@v4
@ -27,7 +27,23 @@ jobs:
- run: yarn install
- run: yarn fmt-check
check-types:
yarn-build-wasm:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'yarn'
- run: yarn install
- uses: Swatinem/rust-cache@v2
with:
workspaces: './src/wasm-lib'
- run: yarn build:wasm
yarn-tsc:
runs-on: ubuntu-22.04
steps:
@ -42,13 +58,25 @@ jobs:
workspaces: './src/wasm-lib'
- run: yarn build:wasm
- run: yarn xstate:typegen
- run: yarn tsc
- name: Lint
run: yarn eslint --max-warnings 0 src e2e packages/codemirror-lsp-client
yarn-lint:
runs-on: ubuntu-22.04
check-typos:
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'yarn'
- run: yarn install
- uses: Swatinem/rust-cache@v2
with:
workspaces: './src/wasm-lib'
- run: yarn lint
python-codespell:
runs-on: ubuntu-22.04
steps:
- name: Checkout
@ -62,7 +90,7 @@ jobs:
run: codespell --config .codespellrc # Edit this file to tweak the typo list and other configuration.
build-test-web:
yarn-unit-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
@ -80,7 +108,7 @@ jobs:
- run: yarn build:wasm
- run: yarn simpleserver:ci
- run: yarn simpleserver:bg
if: ${{ github.event_name != 'release' && github.event_name != 'schedule' }}
- name: Install Chromium Browser
@ -89,7 +117,7 @@ jobs:
- name: run unit tests
if: ${{ github.event_name != 'release' && github.event_name != 'schedule' }}
run: yarn test:nowatch
run: yarn test:unit
env:
VITE_KC_DEV_TOKEN: ${{ secrets.KITTYCAD_API_TOKEN_DEV }}

View File

@ -304,7 +304,7 @@ yarn start
and finally:
```
yarn test:nowatch
yarn test:unit
```
For individual testing:
@ -322,6 +322,69 @@ cd src/wasm-lib
cargo test
```
### Mapping CI CD jobs to local commands
When you see the CI CD fail on jobs you may wonder three things
- Do I have a bug in my code?
- Is the test flaky?
- Is there a bug in `main`?
To answer these questions the following commands will give you confidence to locate the issue.
#### Static Analysis
Part of the CI CD pipeline performs static analysis on the code. Use the following commands to mimic the CI CD jobs.
The following set of commands should get us closer to one and done commands to instantly retest issues.
```
yarn test-setup
```
> Gotcha, are packages up to date and is the wasm built?
```
yarn tsc
yarn fmt-check
yarn lint
yarn test:unit:local
```
> Gotcha: Our unit tests have integration tests in them. You need to run a localhost server to run the unit tests.
#### E2E Tests
**Playwright Browser**
These E2E tests run in a browser (without electron).
There are tests that are skipped if they are ran in a windows OS or Linux OS. We can use playwright tags to implement test skipping.
Breaking down the command `yarn test:playwright:browser:chrome:windows`
- The application is `playwright`
- The runtime is a `browser`
- The specific `browser` is `chrome`
- The test should run in a `windows` environment. It will skip tests that are broken or flaky in the windows OS.
```
yarn test:playwright:browser:chrome
yarn test:playwright:browser:chrome:windows
yarn test:playwright:browser:chrome:ubuntu
```
**Playwright Electron**
These E2E tests run in electron. There are tests that are skipped if they are ran in a windows, linux, or macos environment. We can use playwright tags to implement test skipping.
```
yarn test:playwright:electron:local
yarn test:playwright:electron:windows:local
yarn test:playwright:electron:macos:local
yarn test:playwright:electron:ubuntu:local
```
> Why does it say local? The CI CD commands that run in the pipeline cannot be ran locally. A single command will not properly setup the testing environment locally.
#### Some notes on CI
The tests are broken into snapshot tests and non-snapshot tests, and they run in that order, they automatically commit new snap shots, so if you see an image commit check it was an intended change. If we have non-determinism in the snapshots such that they are always committing new images, hopefully this annoyance makes us fix them asap, if you notice this happening let Kurt know. But for the odd occasion `git reset --hard HEAD~ && git push -f` is your friend.

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

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

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

@ -33,7 +33,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)"
"myAngle = -120\n\nsketch001 = 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\nbaseExtrusion = extrude(5, sketch001)"
]
},
{
@ -70,7 +70,7 @@
"unpublished": false,
"deprecated": false,
"examples": [
"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)"
"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\nextrude001 = extrude(5, sketch001)"
]
},
{
@ -2147,7 +2147,7 @@
"unpublished": false,
"deprecated": false,
"examples": [
"const sketch001 = startSketchOn('XZ')\n |> startProfileAt([0, 0], %)\n |> line([2, 5], %, $seg01)\n |> angledLineToX([-angleToMatchLengthX(seg01, 7, %), 10], %)\n |> close(%)\n\nconst extrusion = extrude(5, sketch001)"
"sketch001 = startSketchOn('XZ')\n |> startProfileAt([0, 0], %)\n |> line([2, 5], %, $seg01)\n |> angledLineToX([-angleToMatchLengthX(seg01, 7, %), 10], %)\n |> close(%)\n\nextrusion = extrude(5, sketch001)"
]
},
{
@ -4224,7 +4224,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)"
"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\nextrusion = extrude(5, sketch001)"
]
},
{
@ -8117,7 +8117,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)"
"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\nexample = extrude(10, exampleSketch)"
]
},
{
@ -12010,7 +12010,7 @@
"unpublished": false,
"deprecated": false,
"examples": [
"const sketch001 = startSketchOn('XZ')\n |> startProfileAt([0, 0], %)\n |> angledLineOfXLength({ angle: 45, length: 10 }, %, $edge1)\n |> angledLineOfXLength({ angle: -15, length: 20 }, %, $edge2)\n |> line([0, -5], %)\n |> close(%, $edge3)\n\nconst extrusion = extrude(10, sketch001)"
"sketch001 = startSketchOn('XZ')\n |> startProfileAt([0, 0], %)\n |> angledLineOfXLength({ angle: 45, length: 10 }, %, $edge1)\n |> angledLineOfXLength({ angle: -15, length: 20 }, %, $edge2)\n |> line([0, -5], %)\n |> close(%, $edge3)\n\nextrusion = extrude(10, sketch001)"
]
},
{
@ -15903,7 +15903,7 @@
"unpublished": false,
"deprecated": false,
"examples": [
"const exampleSketch = startSketchOn('XZ')\n |> startProfileAt([0, 0], %)\n |> line([10, 0], %)\n |> angledLineOfYLength({ angle: 45, length: 10 }, %)\n |> line([0, 10], %)\n |> angledLineOfYLength({ angle: 135, length: 10 }, %)\n |> line([-10, 0], %)\n |> line([0, -30], %)\n\nconst example = extrude(10, exampleSketch)"
"exampleSketch = startSketchOn('XZ')\n |> startProfileAt([0, 0], %)\n |> line([10, 0], %)\n |> angledLineOfYLength({ angle: 45, length: 10 }, %)\n |> line([0, 10], %)\n |> angledLineOfYLength({ angle: 135, length: 10 }, %)\n |> line([-10, 0], %)\n |> line([0, -30], %)\n\nexample = extrude(10, exampleSketch)"
]
},
{
@ -20173,7 +20173,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)"
"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\nexample = extrude(10, exampleSketch)"
]
},
{
@ -24051,7 +24051,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)"
"exampleSketch = startSketchOn('XZ')\n |> startProfileAt([0, 0], %)\n |> angledLineToX({ angle: 30, to: 10 }, %)\n |> line([0, 10], %)\n |> line([-10, 0], %)\n |> close(%)\n\nexample = extrude(10, exampleSketch)"
]
},
{
@ -27929,7 +27929,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)"
"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\nexample = extrude(10, exampleSketch)"
]
},
{
@ -31858,7 +31858,7 @@
"unpublished": false,
"deprecated": false,
"examples": [
"const exampleSketch = startSketchOn('XZ')\n |> startProfileAt([0, 0], %)\n |> line([10, 0], %)\n |> arc({\n angleStart: 0,\n angleEnd: 280,\n radius: 16\n }, %)\n |> close(%)"
"exampleSketch = startSketchOn('XZ')\n |> startProfileAt([0, 0], %)\n |> line([10, 0], %)\n |> arc({\n angleStart: 0,\n angleEnd: 280,\n radius: 16\n }, %)\n |> close(%)"
]
},
{
@ -31895,7 +31895,7 @@
"unpublished": false,
"deprecated": false,
"examples": [
"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)"
"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\nextrude001 = extrude(5, sketch001)"
]
},
{
@ -31938,7 +31938,7 @@
"unpublished": false,
"deprecated": false,
"examples": [
"const myVar = true\nassert(myVar, \"should always be true\")"
"myVar = true\nassert(myVar, \"should always be true\")"
]
},
{
@ -32004,7 +32004,7 @@
"unpublished": false,
"deprecated": false,
"examples": [
"let n = 1.0285\nlet o = 1.0286\nassertEqual(n, o, 0.01, \"n is within the given tolerance for o\")"
"n = 1.0285\no = 1.0286\nassertEqual(n, o, 0.01, \"n is within the given tolerance for o\")"
]
},
{
@ -32261,7 +32261,7 @@
"unpublished": false,
"deprecated": false,
"examples": [
"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)"
"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\nextrude001 = extrude(5, sketch001)"
]
},
{
@ -36160,7 +36160,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)"
"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\nexample = extrude(10, exampleSketch)"
]
},
{
@ -36197,7 +36197,7 @@
"unpublished": false,
"deprecated": false,
"examples": [
"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)"
"sketch001 = startSketchOn('XZ')\n |> startProfileAt([0, 0], %)\n |> lineTo([12, 10], %)\n |> line([ceil(7.02986), 0], %)\n |> yLineTo(0, %)\n |> close(%)\n\nextrude001 = extrude(5, sketch001)"
]
},
{
@ -40532,8 +40532,8 @@
"unpublished": false,
"deprecated": false,
"examples": [
"// Chamfer a mounting plate.\nconst width = 20\nconst length = 10\nconst thickness = 1\nconst chamferLength = 2\n\nconst mountingPlateSketch = startSketchOn(\"XY\")\n |> startProfileAt([-width / 2, -length / 2], %)\n |> lineTo([width / 2, -length / 2], %, $edge1)\n |> lineTo([width / 2, length / 2], %, $edge2)\n |> lineTo([-width / 2, length / 2], %, $edge3)\n |> close(%, $edge4)\n\nconst mountingPlate = extrude(thickness, mountingPlateSketch)\n |> chamfer({\n length: chamferLength,\n tags: [\n getNextAdjacentEdge(edge1),\n getNextAdjacentEdge(edge2),\n getNextAdjacentEdge(edge3),\n getNextAdjacentEdge(edge4)\n ]\n }, %)",
"// Sketch on the face of a chamfer.\nfn cube = (pos, scale) => {\n const sg = startSketchOn('XY')\n |> startProfileAt(pos, %)\n |> line([0, scale], %)\n |> line([scale, 0], %)\n |> line([0, -scale], %)\n\n return sg\n}\n\nconst part001 = cube([0, 0], 20)\n |> close(%, $line1)\n |> extrude(20, %)\n |> chamfer({\n length: 10,\n tags: [getOppositeEdge(line1)]\n }, %, $chamfer1) // We tag the chamfer to reference it later.\n\nconst sketch001 = startSketchOn(part001, chamfer1)\n |> startProfileAt([10, 10], %)\n |> line([2, 0], %)\n |> line([0, 2], %)\n |> line([-2, 0], %)\n |> lineTo([profileStartX(%), profileStartY(%)], %)\n |> close(%)\n |> extrude(10, %)"
"// Chamfer a mounting plate.\nwidth = 20\nlength = 10\nthickness = 1\nchamferLength = 2\n\nmountingPlateSketch = startSketchOn(\"XY\")\n |> startProfileAt([-width / 2, -length / 2], %)\n |> lineTo([width / 2, -length / 2], %, $edge1)\n |> lineTo([width / 2, length / 2], %, $edge2)\n |> lineTo([-width / 2, length / 2], %, $edge3)\n |> close(%, $edge4)\n\nmountingPlate = extrude(thickness, mountingPlateSketch)\n |> chamfer({\n length: chamferLength,\n tags: [\n getNextAdjacentEdge(edge1),\n getNextAdjacentEdge(edge2),\n getNextAdjacentEdge(edge3),\n getNextAdjacentEdge(edge4)\n ]\n }, %)",
"// Sketch on the face of a chamfer.\nfn cube = (pos, scale) => {\n sg = startSketchOn('XY')\n |> startProfileAt(pos, %)\n |> line([0, scale], %)\n |> line([scale, 0], %)\n |> line([0, -scale], %)\n\n return sg\n}\n\npart001 = cube([0, 0], 20)\n |> close(%, $line1)\n |> extrude(20, %)\n |> chamfer({\n length: 10,\n tags: [getOppositeEdge(line1)]\n }, %, $chamfer1) // We tag the chamfer to reference it later.\n\nsketch001 = startSketchOn(part001, chamfer1)\n |> startProfileAt([10, 10], %)\n |> line([2, 0], %)\n |> line([0, 2], %)\n |> line([-2, 0], %)\n |> lineTo([profileStartX(%), profileStartY(%)], %)\n |> close(%)\n |> extrude(10, %)"
]
},
{
@ -44372,8 +44372,8 @@
"unpublished": false,
"deprecated": false,
"examples": [
"const exampleSketch = startSketchOn(\"-XZ\")\n |> circle({ center: [0, 0], radius: 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({ center: [0, 15], radius: 5 }, %), %)\n\nconst example = extrude(5, exampleSketch)"
"exampleSketch = startSketchOn(\"-XZ\")\n |> circle({ center: [0, 0], radius: 10 }, %)\n\nexample = extrude(5, exampleSketch)",
"exampleSketch = startSketchOn(\"XZ\")\n |> startProfileAt([-15, 0], %)\n |> line([30, 0], %)\n |> line([0, 30], %)\n |> line([-30, 0], %)\n |> close(%)\n |> hole(circle({ center: [0, 15], radius: 5 }, %), %)\n\nexample = extrude(5, exampleSketch)"
]
},
{
@ -48225,7 +48225,7 @@
"deprecated": false,
"examples": [
"startSketchOn('XZ')\n |> startProfileAt([0, 0], %)\n |> line([10, 10], %)\n |> line([10, 0], %)\n |> close(%)\n |> extrude(10, %)",
"const exampleSketch = startSketchOn('-XZ')\n |> startProfileAt([0, 0], %)\n |> line([10, 0], %)\n |> line([0, 10], %)\n |> close(%)\n\nconst example = extrude(10, exampleSketch)"
"exampleSketch = startSketchOn('-XZ')\n |> startProfileAt([0, 0], %)\n |> line([10, 0], %)\n |> line([0, 10], %)\n |> close(%)\n\nexample = extrude(10, exampleSketch)"
]
},
{
@ -48250,7 +48250,7 @@
"unpublished": false,
"deprecated": false,
"examples": [
"const totalWidth = 10 * cm()"
"totalWidth = 10 * cm()"
]
},
{
@ -48287,7 +48287,7 @@
"unpublished": false,
"deprecated": false,
"examples": [
"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)"
"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\nexample = extrude(5, exampleSketch)"
]
},
{
@ -48312,7 +48312,7 @@
"unpublished": false,
"deprecated": false,
"examples": [
"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)"
"exampleSketch = startSketchOn(\"XZ\")\n |> startProfileAt([0, 0], %)\n |> angledLine({ angle: 30, length: 2 * e() ^ 2 }, %)\n |> yLineTo(0, %)\n |> close(%)\n\nexample = extrude(10, exampleSketch)"
]
},
{
@ -50999,8 +50999,8 @@
"unpublished": false,
"deprecated": false,
"examples": [
"const example = startSketchOn('XZ')\n |> startProfileAt([0, 0], %)\n |> line([10, 0], %)\n |> arc({\n angleStart: 120,\n angleEnd: 0,\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 angleStart: 120,\n angleEnd: -60,\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)"
"example = startSketchOn('XZ')\n |> startProfileAt([0, 0], %)\n |> line([10, 0], %)\n |> arc({\n angleStart: 120,\n angleEnd: 0,\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, %)",
"exampleSketch = startSketchOn('XZ')\n |> startProfileAt([-10, 0], %)\n |> arc({\n angleStart: 120,\n angleEnd: -60,\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\nexample = extrude(10, exampleSketch)"
]
},
{
@ -55342,8 +55342,8 @@
"unpublished": false,
"deprecated": false,
"examples": [
"const width = 20\nconst length = 10\nconst thickness = 1\nconst filletRadius = 2\n\nconst mountingPlateSketch = startSketchOn(\"XY\")\n |> startProfileAt([-width / 2, -length / 2], %)\n |> lineTo([width / 2, -length / 2], %, $edge1)\n |> lineTo([width / 2, length / 2], %, $edge2)\n |> lineTo([-width / 2, length / 2], %, $edge3)\n |> close(%, $edge4)\n\nconst mountingPlate = extrude(thickness, mountingPlateSketch)\n |> fillet({\n radius: filletRadius,\n tags: [\n getNextAdjacentEdge(edge1),\n getNextAdjacentEdge(edge2),\n getNextAdjacentEdge(edge3),\n getNextAdjacentEdge(edge4)\n ]\n }, %)",
"const width = 20\nconst length = 10\nconst thickness = 1\nconst filletRadius = 1\n\nconst mountingPlateSketch = startSketchOn(\"XY\")\n |> startProfileAt([-width / 2, -length / 2], %)\n |> lineTo([width / 2, -length / 2], %, $edge1)\n |> lineTo([width / 2, length / 2], %, $edge2)\n |> lineTo([-width / 2, length / 2], %, $edge3)\n |> close(%, $edge4)\n\nconst mountingPlate = extrude(thickness, mountingPlateSketch)\n |> fillet({\n radius: filletRadius,\n tolerance: 0.000001,\n tags: [\n getNextAdjacentEdge(edge1),\n getNextAdjacentEdge(edge2),\n getNextAdjacentEdge(edge3),\n getNextAdjacentEdge(edge4)\n ]\n }, %)"
"width = 20\nlength = 10\nthickness = 1\nfilletRadius = 2\n\nmountingPlateSketch = startSketchOn(\"XY\")\n |> startProfileAt([-width / 2, -length / 2], %)\n |> lineTo([width / 2, -length / 2], %, $edge1)\n |> lineTo([width / 2, length / 2], %, $edge2)\n |> lineTo([-width / 2, length / 2], %, $edge3)\n |> close(%, $edge4)\n\nmountingPlate = extrude(thickness, mountingPlateSketch)\n |> fillet({\n radius: filletRadius,\n tags: [\n getNextAdjacentEdge(edge1),\n getNextAdjacentEdge(edge2),\n getNextAdjacentEdge(edge3),\n getNextAdjacentEdge(edge4)\n ]\n }, %)",
"width = 20\nlength = 10\nthickness = 1\nfilletRadius = 1\n\nmountingPlateSketch = startSketchOn(\"XY\")\n |> startProfileAt([-width / 2, -length / 2], %)\n |> lineTo([width / 2, -length / 2], %, $edge1)\n |> lineTo([width / 2, length / 2], %, $edge2)\n |> lineTo([-width / 2, length / 2], %, $edge3)\n |> close(%, $edge4)\n\nmountingPlate = extrude(thickness, mountingPlateSketch)\n |> fillet({\n radius: filletRadius,\n tolerance: 0.000001,\n tags: [\n getNextAdjacentEdge(edge1),\n getNextAdjacentEdge(edge2),\n getNextAdjacentEdge(edge3),\n getNextAdjacentEdge(edge4)\n ]\n }, %)"
]
},
{
@ -55380,7 +55380,7 @@
"unpublished": false,
"deprecated": false,
"examples": [
"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)"
"sketch001 = startSketchOn('XZ')\n |> startProfileAt([0, 0], %)\n |> lineTo([12, 10], %)\n |> line([floor(7.02986), 0], %)\n |> yLineTo(0, %)\n |> close(%)\n\nextrude001 = extrude(5, sketch001)"
]
},
{
@ -55405,7 +55405,7 @@
"unpublished": false,
"deprecated": false,
"examples": [
"const totalWidth = 10 * ft()"
"totalWidth = 10 * ft()"
]
},
{
@ -55819,7 +55819,7 @@
"unpublished": false,
"deprecated": false,
"examples": [
"const exampleSketch = startSketchOn('XZ')\n |> startProfileAt([0, 0], %)\n |> line([10, 0], %)\n |> angledLine({ angle: 60, length: 10 }, %)\n |> angledLine({ angle: 120, length: 10 }, %)\n |> line([-10, 0], %)\n |> angledLine({ angle: 240, length: 10 }, %, $referenceEdge)\n |> close(%)\n\nconst example = extrude(5, exampleSketch)\n |> fillet({\n radius: 3,\n tags: [getNextAdjacentEdge(referenceEdge)]\n }, %)"
"exampleSketch = startSketchOn('XZ')\n |> startProfileAt([0, 0], %)\n |> line([10, 0], %)\n |> angledLine({ angle: 60, length: 10 }, %)\n |> angledLine({ angle: 120, length: 10 }, %)\n |> line([-10, 0], %)\n |> angledLine({ angle: 240, length: 10 }, %, $referenceEdge)\n |> close(%)\n\nexample = extrude(5, exampleSketch)\n |> fillet({\n radius: 3,\n tags: [getNextAdjacentEdge(referenceEdge)]\n }, %)"
]
},
{
@ -56233,7 +56233,7 @@
"unpublished": false,
"deprecated": false,
"examples": [
"const exampleSketch = startSketchOn('XZ')\n |> startProfileAt([0, 0], %)\n |> line([10, 0], %)\n |> angledLine({ angle: 60, length: 10 }, %)\n |> angledLine({ angle: 120, length: 10 }, %)\n |> line([-10, 0], %)\n |> angledLine({ angle: 240, length: 10 }, %, $referenceEdge)\n |> close(%)\n\nconst example = extrude(5, exampleSketch)\n |> fillet({\n radius: 3,\n tags: [getOppositeEdge(referenceEdge)]\n }, %)"
"exampleSketch = startSketchOn('XZ')\n |> startProfileAt([0, 0], %)\n |> line([10, 0], %)\n |> angledLine({ angle: 60, length: 10 }, %)\n |> angledLine({ angle: 120, length: 10 }, %)\n |> line([-10, 0], %)\n |> angledLine({ angle: 240, length: 10 }, %, $referenceEdge)\n |> close(%)\n\nexample = extrude(5, exampleSketch)\n |> fillet({\n radius: 3,\n tags: [getOppositeEdge(referenceEdge)]\n }, %)"
]
},
{
@ -56647,7 +56647,7 @@
"unpublished": false,
"deprecated": false,
"examples": [
"const exampleSketch = startSketchOn('XZ')\n |> startProfileAt([0, 0], %)\n |> line([10, 0], %)\n |> angledLine({ angle: 60, length: 10 }, %)\n |> angledLine({ angle: 120, length: 10 }, %)\n |> line([-10, 0], %)\n |> angledLine({ angle: 240, length: 10 }, %, $referenceEdge)\n |> close(%)\n\nconst example = extrude(5, exampleSketch)\n |> fillet({\n radius: 3,\n tags: [getPreviousAdjacentEdge(referenceEdge)]\n }, %)"
"exampleSketch = startSketchOn('XZ')\n |> startProfileAt([0, 0], %)\n |> line([10, 0], %)\n |> angledLine({ angle: 60, length: 10 }, %)\n |> angledLine({ angle: 120, length: 10 }, %)\n |> line([-10, 0], %)\n |> angledLine({ angle: 240, length: 10 }, %, $referenceEdge)\n |> close(%)\n\nexample = extrude(5, exampleSketch)\n |> fillet({\n radius: 3,\n tags: [getPreviousAdjacentEdge(referenceEdge)]\n }, %)"
]
},
{
@ -59306,7 +59306,7 @@
"unpublished": false,
"deprecated": false,
"examples": [
"const part001 = startSketchOn('XY')\n |> circle({ center: [5, 5], radius: 10 }, %)\n |> extrude(10, %)\n |> helix({\n angleStart: 0,\n ccw: true,\n revolutions: 16\n }, %)"
"part001 = startSketchOn('XY')\n |> circle({ center: [5, 5], radius: 10 }, %)\n |> extrude(10, %)\n |> helix({\n angleStart: 0,\n ccw: true,\n revolutions: 16\n }, %)"
]
},
{
@ -63236,8 +63236,8 @@
"unpublished": false,
"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({ center: [1, 1], radius: .25 }, %), %)\n |> hole(circle({ center: [1, 4], radius: .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({ center: [0, 0], radius: 3 }, %)\n |> hole(squareHoleSketch(), %)\nconst example = extrude(1, exampleSketch)"
"exampleSketch = startSketchOn('XY')\n |> startProfileAt([0, 0], %)\n |> line([0, 5], %)\n |> line([5, 0], %)\n |> line([0, -5], %)\n |> close(%)\n |> hole(circle({ center: [1, 1], radius: .25 }, %), %)\n |> hole(circle({ center: [1, 4], radius: .25 }, %), %)\n\nexample = extrude(1, exampleSketch)",
"fn squareHoleSketch = () => {\n 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\nexampleSketch = startSketchOn('-XZ')\n |> circle({ center: [0, 0], radius: 3 }, %)\n |> hole(squareHoleSketch(), %)\nexample = extrude(1, exampleSketch)"
]
},
{
@ -65869,9 +65869,9 @@
"unpublished": false,
"deprecated": false,
"examples": [
"// Hollow a basic sketch.\nconst firstSketch = startSketchOn('XY')\n |> startProfileAt([-12, 12], %)\n |> line([24, 0], %)\n |> line([0, -24], %)\n |> line([-24, 0], %)\n |> close(%)\n |> extrude(6, %)\n |> hollow(0.25, %)",
"// Hollow a basic sketch.\nconst firstSketch = startSketchOn('-XZ')\n |> startProfileAt([-12, 12], %)\n |> line([24, 0], %)\n |> line([0, -24], %)\n |> line([-24, 0], %)\n |> close(%)\n |> extrude(6, %)\n |> hollow(0.5, %)",
"// Hollow a sketch on face object.\nlet size = 100\nconst case = startSketchOn('-XZ')\n |> startProfileAt([-size, -size], %)\n |> line([2 * size, 0], %)\n |> line([0, 2 * size], %)\n |> tangentialArcTo([-size, size], %)\n |> close(%)\n |> extrude(65, %)\n\nconst thing1 = startSketchOn(case, 'end')\n |> circle({\n center: [-size / 2, -size / 2],\n radius: 25\n }, %)\n |> extrude(50, %)\n\nconst thing2 = startSketchOn(case, 'end')\n |> circle({\n center: [size / 2, -size / 2],\n radius: 25\n }, %)\n |> extrude(50, %)\n\nhollow(0.5, case)"
"// Hollow a basic sketch.\nfirstSketch = startSketchOn('XY')\n |> startProfileAt([-12, 12], %)\n |> line([24, 0], %)\n |> line([0, -24], %)\n |> line([-24, 0], %)\n |> close(%)\n |> extrude(6, %)\n |> hollow(0.25, %)",
"// Hollow a basic sketch.\nfirstSketch = startSketchOn('-XZ')\n |> startProfileAt([-12, 12], %)\n |> line([24, 0], %)\n |> line([0, -24], %)\n |> line([-24, 0], %)\n |> close(%)\n |> extrude(6, %)\n |> hollow(0.5, %)",
"// Hollow a sketch on face object.\nsize = 100\ncase = startSketchOn('-XZ')\n |> startProfileAt([-size, -size], %)\n |> line([2 * size, 0], %)\n |> line([0, 2 * size], %)\n |> tangentialArcTo([-size, size], %)\n |> close(%)\n |> extrude(65, %)\n\nthing1 = startSketchOn(case, 'end')\n |> circle({\n center: [-size / 2, -size / 2],\n radius: 25\n }, %)\n |> extrude(50, %)\n\nthing2 = startSketchOn(case, 'end')\n |> circle({\n center: [size / 2, -size / 2],\n radius: 25\n }, %)\n |> extrude(50, %)\n\nhollow(0.5, case)"
]
},
{
@ -66277,11 +66277,11 @@
"unpublished": false,
"deprecated": false,
"examples": [
"const model = import(\"tests/inputs/cube.obj\")",
"const model = import(\"tests/inputs/cube.obj\", { type: \"obj\", units: \"m\" })",
"const model = import(\"tests/inputs/cube.gltf\")",
"const model = import(\"tests/inputs/cube.sldprt\")",
"const model = import(\"tests/inputs/cube.step\")"
"model = import(\"tests/inputs/cube.obj\")",
"model = import(\"tests/inputs/cube.obj\", { type: \"obj\", units: \"m\" })",
"model = import(\"tests/inputs/cube.gltf\")",
"model = import(\"tests/inputs/cube.sldprt\")",
"model = import(\"tests/inputs/cube.step\")"
]
},
{
@ -66306,7 +66306,7 @@
"unpublished": false,
"deprecated": false,
"examples": [
"const totalWidth = 10 * inch()"
"totalWidth = 10 * inch()"
]
},
{
@ -66343,7 +66343,7 @@
"unpublished": false,
"deprecated": false,
"examples": [
"let n = int(ceil(5 / 2))\nassertEqual(n, 3, 0.0001, \"5/2 = 2.5, rounded up makes 3\")\n// Draw n cylinders.\nstartSketchOn('XZ')\n |> circle({ center: [0, 0], radius: 2 }, %)\n |> extrude(5, %)\n |> patternTransform(n, (id) => {\n return { translate: [4 * id, 0, 0] }\n}, %)"
"n = int(ceil(5 / 2))\nassertEqual(n, 3, 0.0001, \"5/2 = 2.5, rounded up makes 3\")\n// Draw n cylinders.\nstartSketchOn('XZ')\n |> circle({ center: [0, 0], radius: 2 }, %)\n |> extrude(5, %)\n |> patternTransform(n, (id) => {\n return { translate: [4 * id, 0, 0] }\n}, %)"
]
},
{
@ -67662,7 +67662,7 @@
"unpublished": false,
"deprecated": false,
"examples": [
"const exampleSketch = startSketchOn(\"XZ\")\n |> startProfileAt([0, 0], %)\n |> line([5, 0], %)\n |> line([20, 5], %)\n |> line([lastSegX(%), 0], %)\n |> line([-15, 0], %)\n |> close(%)\n\nconst example = extrude(5, exampleSketch)"
"exampleSketch = startSketchOn(\"XZ\")\n |> startProfileAt([0, 0], %)\n |> line([5, 0], %)\n |> line([20, 5], %)\n |> line([lastSegX(%), 0], %)\n |> line([-15, 0], %)\n |> close(%)\n\nexample = extrude(5, exampleSketch)"
]
},
{
@ -68981,7 +68981,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)"
"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\nexample = extrude(5, exampleSketch)"
]
},
{
@ -72992,8 +72992,8 @@
"unpublished": false,
"deprecated": false,
"examples": [
"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)"
"exampleSketch = startSketchOn(\"XZ\")\n |> startProfileAt([0, 0], %)\n |> line([25, 15], %)\n |> line([5, -6], %)\n |> line([-10, -10], %)\n |> close(%)\n\nexample = extrude(5, exampleSketch)",
"exampleSketch = startSketchOn(\"XZ\")\n |> startProfileAt([0, 0], %)\n |> line([10, 0], %)\n |> line([0, 10], %)\n |> line([-10, 0], %)\n |> close(%)\n\nexample = extrude(5, exampleSketch)"
]
},
{
@ -76860,7 +76860,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)"
"exampleSketch = startSketchOn(\"XZ\")\n |> startProfileAt([0, 0], %)\n |> lineTo([10, 0], %)\n |> lineTo([0, 10], %)\n |> lineTo([-10, 0], %)\n |> close(%)\n\nexample = extrude(5, exampleSketch)"
]
},
{
@ -76897,7 +76897,7 @@
"unpublished": false,
"deprecated": false,
"examples": [
"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)"
"exampleSketch = startSketchOn(\"XZ\")\n |> startProfileAt([0, 0], %)\n |> line([ln(100), 15], %)\n |> line([5, -6], %)\n |> line([-10, -10], %)\n |> close(%)\n\nexample = extrude(5, exampleSketch)"
]
},
{
@ -80742,9 +80742,9 @@
"unpublished": false,
"deprecated": false,
"examples": [
"// Loft a square and a triangle.\nconst squareSketch = startSketchOn('XY')\n |> startProfileAt([-100, 200], %)\n |> line([200, 0], %)\n |> line([0, -200], %)\n |> line([-200, 0], %)\n |> lineTo([profileStartX(%), profileStartY(%)], %)\n |> close(%)\n\nconst triangleSketch = startSketchOn(offsetPlane('XY', 75))\n |> startProfileAt([0, 125], %)\n |> line([-15, -30], %)\n |> line([30, 0], %)\n |> lineTo([profileStartX(%), profileStartY(%)], %)\n |> close(%)\n\nloft([squareSketch, triangleSketch])",
"// Loft a square, a circle, and another circle.\nconst squareSketch = startSketchOn('XY')\n |> startProfileAt([-100, 200], %)\n |> line([200, 0], %)\n |> line([0, -200], %)\n |> line([-200, 0], %)\n |> lineTo([profileStartX(%), profileStartY(%)], %)\n |> close(%)\n\nconst circleSketch0 = startSketchOn(offsetPlane('XY', 75))\n |> circle({ center: [0, 100], radius: 50 }, %)\n\nconst circleSketch1 = startSketchOn(offsetPlane('XY', 150))\n |> circle({ center: [0, 100], radius: 20 }, %)\n\nloft([\n squareSketch,\n circleSketch0,\n circleSketch1\n])",
"// Loft a square, a circle, and another circle with options.\nconst squareSketch = startSketchOn('XY')\n |> startProfileAt([-100, 200], %)\n |> line([200, 0], %)\n |> line([0, -200], %)\n |> line([-200, 0], %)\n |> lineTo([profileStartX(%), profileStartY(%)], %)\n |> close(%)\n\nconst circleSketch0 = startSketchOn(offsetPlane('XY', 75))\n |> circle({ center: [0, 100], radius: 50 }, %)\n\nconst circleSketch1 = startSketchOn(offsetPlane('XY', 150))\n |> circle({ center: [0, 100], radius: 20 }, %)\n\nloft([\n squareSketch,\n circleSketch0,\n circleSketch1\n], {\n // This can be set to override the automatically determined\n // topological base curve, which is usually the first section encountered.\n baseCurveIndex: 0,\n // Attempt to approximate rational curves (such as arcs) using a bezier.\n // This will remove banding around interpolations between arcs and non-arcs.\n // It may produce errors in other scenarios Over time, this field won't be necessary.\n bezApproximateRational: false,\n // Tolerance for the loft operation.\n tolerance: 0.000001,\n // Degree of the interpolation. Must be greater than zero.\n // For example, use 2 for quadratic, or 3 for cubic interpolation in\n // the V direction. This defaults to 2, if not specified.\n vDegree: 2\n})"
"// Loft a square and a triangle.\nsquareSketch = startSketchOn('XY')\n |> startProfileAt([-100, 200], %)\n |> line([200, 0], %)\n |> line([0, -200], %)\n |> line([-200, 0], %)\n |> lineTo([profileStartX(%), profileStartY(%)], %)\n |> close(%)\n\ntriangleSketch = startSketchOn(offsetPlane('XY', 75))\n |> startProfileAt([0, 125], %)\n |> line([-15, -30], %)\n |> line([30, 0], %)\n |> lineTo([profileStartX(%), profileStartY(%)], %)\n |> close(%)\n\nloft([squareSketch, triangleSketch])",
"// Loft a square, a circle, and another circle.\nsquareSketch = startSketchOn('XY')\n |> startProfileAt([-100, 200], %)\n |> line([200, 0], %)\n |> line([0, -200], %)\n |> line([-200, 0], %)\n |> lineTo([profileStartX(%), profileStartY(%)], %)\n |> close(%)\n\ncircleSketch0 = startSketchOn(offsetPlane('XY', 75))\n |> circle({ center: [0, 100], radius: 50 }, %)\n\ncircleSketch1 = startSketchOn(offsetPlane('XY', 150))\n |> circle({ center: [0, 100], radius: 20 }, %)\n\nloft([\n squareSketch,\n circleSketch0,\n circleSketch1\n])",
"// Loft a square, a circle, and another circle with options.\nsquareSketch = startSketchOn('XY')\n |> startProfileAt([-100, 200], %)\n |> line([200, 0], %)\n |> line([0, -200], %)\n |> line([-200, 0], %)\n |> lineTo([profileStartX(%), profileStartY(%)], %)\n |> close(%)\n\ncircleSketch0 = startSketchOn(offsetPlane('XY', 75))\n |> circle({ center: [0, 100], radius: 50 }, %)\n\ncircleSketch1 = startSketchOn(offsetPlane('XY', 150))\n |> circle({ center: [0, 100], radius: 20 }, %)\n\nloft([\n squareSketch,\n circleSketch0,\n circleSketch1\n], {\n // This can be set to override the automatically determined\n // topological base curve, which is usually the first section encountered.\n baseCurveIndex: 0,\n // Attempt to approximate rational curves (such as arcs) using a bezier.\n // This will remove banding around interpolations between arcs and non-arcs.\n // It may produce errors in other scenarios Over time, this field won't be necessary.\n bezApproximateRational: false,\n // Tolerance for the loft operation.\n tolerance: 0.000001,\n // Degree of the interpolation. Must be greater than zero.\n // For example, use 2 for quadratic, or 3 for cubic interpolation in\n // the V direction. This defaults to 2, if not specified.\n vDegree: 2\n})"
]
},
{
@ -80792,7 +80792,7 @@
"unpublished": false,
"deprecated": false,
"examples": [
"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)"
"exampleSketch = startSketchOn(\"XZ\")\n |> startProfileAt([0, 0], %)\n |> line([log(100, 5), 0], %)\n |> line([5, 8], %)\n |> line([-10, 0], %)\n |> close(%)\n\nexample = extrude(5, exampleSketch)"
]
},
{
@ -80829,7 +80829,7 @@
"unpublished": false,
"deprecated": false,
"examples": [
"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)"
"exampleSketch = startSketchOn(\"XZ\")\n |> startProfileAt([0, 0], %)\n |> line([log10(100), 0], %)\n |> line([5, 8], %)\n |> line([-10, 0], %)\n |> close(%)\n\nexample = extrude(5, exampleSketch)"
]
},
{
@ -80866,7 +80866,7 @@
"unpublished": false,
"deprecated": false,
"examples": [
"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)"
"exampleSketch = startSketchOn(\"XZ\")\n |> startProfileAt([0, 0], %)\n |> line([log2(100), 0], %)\n |> line([5, 8], %)\n |> line([-10, 0], %)\n |> close(%)\n\nexample = extrude(5, exampleSketch)"
]
},
{
@ -80891,7 +80891,7 @@
"unpublished": false,
"deprecated": false,
"examples": [
"const totalWidth = 10 * m()"
"totalWidth = 10 * m()"
]
},
{
@ -84386,14 +84386,7 @@
"VariableKind": {
"oneOf": [
{
"description": "Declare a variable.",
"type": "string",
"enum": [
"let"
]
},
{
"description": "Declare a variable that is read-only.",
"description": "Declare a named constant.",
"type": "string",
"enum": [
"const"
@ -84405,13 +84398,6 @@
"enum": [
"fn"
]
},
{
"description": "Declare a variable.",
"type": "string",
"enum": [
"var"
]
}
]
},
@ -87956,14 +87942,7 @@
"VariableKind": {
"oneOf": [
{
"description": "Declare a variable.",
"type": "string",
"enum": [
"let"
]
},
{
"description": "Declare a variable that is read-only.",
"description": "Declare a named constant.",
"type": "string",
"enum": [
"const"
@ -87975,13 +87954,6 @@
"enum": [
"fn"
]
},
{
"description": "Declare a variable.",
"type": "string",
"enum": [
"var"
]
}
]
},
@ -91530,14 +91502,7 @@
"VariableKind": {
"oneOf": [
{
"description": "Declare a variable.",
"type": "string",
"enum": [
"let"
]
},
{
"description": "Declare a variable that is read-only.",
"description": "Declare a named constant.",
"type": "string",
"enum": [
"const"
@ -91549,13 +91514,6 @@
"enum": [
"fn"
]
},
{
"description": "Declare a variable.",
"type": "string",
"enum": [
"var"
]
}
]
},
@ -91620,8 +91578,8 @@
"unpublished": false,
"deprecated": false,
"examples": [
"const r = 10 // radius\nfn drawCircle = (id) => {\n return startSketchOn(\"XY\")\n |> circle({ center: [id * 2 * r, 0], radius: r }, %)\n}\n\n// Call `drawCircle`, passing in each element of the array.\n// The outputs from each `drawCircle` form a new array,\n// which is the return value from `map`.\nconst circles = map([1, 2, 3], drawCircle)",
"const r = 10 // radius\n// Call `map`, using an anonymous function instead of a named one.\nconst circles = map([1, 2, 3], (id) => {\n return startSketchOn(\"XY\")\n |> circle({ center: [id * 2 * r, 0], radius: r }, %)\n})"
"r = 10 // radius\nfn drawCircle = (id) => {\n return startSketchOn(\"XY\")\n |> circle({ center: [id * 2 * r, 0], radius: r }, %)\n}\n\n// Call `drawCircle`, passing in each element of the array.\n// The outputs from each `drawCircle` form a new array,\n// which is the return value from `map`.\ncircles = map([1, 2, 3], drawCircle)",
"r = 10 // radius\n// Call `map`, using an anonymous function instead of a named one.\ncircles = map([1, 2, 3], (id) => {\n return startSketchOn(\"XY\")\n |> circle({ center: [id * 2 * r, 0], radius: r }, %)\n})"
]
},
{
@ -91661,7 +91619,7 @@
"unpublished": false,
"deprecated": false,
"examples": [
"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)"
"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\nexample = extrude(5, exampleSketch)"
]
},
{
@ -91701,7 +91659,7 @@
"unpublished": false,
"deprecated": false,
"examples": [
"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)"
"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\nexample = extrude(5, exampleSketch)"
]
},
{
@ -94914,10 +94872,10 @@
"unpublished": false,
"deprecated": false,
"examples": [
"// Mirror an un-closed sketch across the Y axis.\nconst sketch001 = startSketchOn('XZ')\n |> startProfileAt([0, 10], %)\n |> line([15, 0], %)\n |> line([-7, -3], %)\n |> line([9, -1], %)\n |> line([-8, -5], %)\n |> line([9, -3], %)\n |> line([-8, -3], %)\n |> line([9, -1], %)\n |> line([-19, -0], %)\n |> mirror2d({ axis: 'Y' }, %)\n\nconst example = extrude(10, sketch001)",
"// Mirror a un-closed sketch across the Y axis.\nconst sketch001 = startSketchOn('XZ')\n |> startProfileAt([0, 8.5], %)\n |> line([20, -8.5], %)\n |> line([-20, -8.5], %)\n |> mirror2d({ axis: 'Y' }, %)\n\nconst example = extrude(10, sketch001)",
"// Mirror a un-closed sketch across an edge.\nconst helper001 = startSketchOn('XZ')\n |> startProfileAt([0, 0], %)\n |> line([0, 10], %, $edge001)\n\nconst sketch001 = startSketchOn('XZ')\n |> startProfileAt([0, 8.5], %)\n |> line([20, -8.5], %)\n |> line([-20, -8.5], %)\n |> mirror2d({ axis: edge001 }, %)\n\nconst example = extrude(10, sketch001)",
"// Mirror an un-closed sketch across a custom axis.\nconst sketch001 = startSketchOn('XZ')\n |> startProfileAt([0, 8.5], %)\n |> line([20, -8.5], %)\n |> line([-20, -8.5], %)\n |> mirror2d({\n axis: {\n custom: { axis: [0.0, 1.0], origin: [0.0, 0.0] }\n }\n }, %)\n\nconst example = extrude(10, sketch001)"
"// Mirror an un-closed sketch across the Y axis.\nsketch001 = startSketchOn('XZ')\n |> startProfileAt([0, 10], %)\n |> line([15, 0], %)\n |> line([-7, -3], %)\n |> line([9, -1], %)\n |> line([-8, -5], %)\n |> line([9, -3], %)\n |> line([-8, -3], %)\n |> line([9, -1], %)\n |> line([-19, -0], %)\n |> mirror2d({ axis: 'Y' }, %)\n\nexample = extrude(10, sketch001)",
"// Mirror a un-closed sketch across the Y axis.\nsketch001 = startSketchOn('XZ')\n |> startProfileAt([0, 8.5], %)\n |> line([20, -8.5], %)\n |> line([-20, -8.5], %)\n |> mirror2d({ axis: 'Y' }, %)\n\nexample = extrude(10, sketch001)",
"// Mirror a un-closed sketch across an edge.\nhelper001 = startSketchOn('XZ')\n |> startProfileAt([0, 0], %)\n |> line([0, 10], %, $edge001)\n\nsketch001 = startSketchOn('XZ')\n |> startProfileAt([0, 8.5], %)\n |> line([20, -8.5], %)\n |> line([-20, -8.5], %)\n |> mirror2d({ axis: edge001 }, %)\n\nexample = extrude(10, sketch001)",
"// Mirror an un-closed sketch across a custom axis.\nsketch001 = startSketchOn('XZ')\n |> startProfileAt([0, 8.5], %)\n |> line([20, -8.5], %)\n |> line([-20, -8.5], %)\n |> mirror2d({\n axis: {\n custom: { axis: [0.0, 1.0], origin: [0.0, 0.0] }\n }\n }, %)\n\nexample = extrude(10, sketch001)"
]
},
{
@ -94942,7 +94900,7 @@
"unpublished": false,
"deprecated": false,
"examples": [
"const totalWidth = 10 * mm()"
"totalWidth = 10 * mm()"
]
},
{
@ -95151,10 +95109,10 @@
"unpublished": false,
"deprecated": false,
"examples": [
"// Loft a square and a circle on the `XY` plane using offset.\nconst squareSketch = startSketchOn('XY')\n |> startProfileAt([-100, 200], %)\n |> line([200, 0], %)\n |> line([0, -200], %)\n |> line([-200, 0], %)\n |> lineTo([profileStartX(%), profileStartY(%)], %)\n |> close(%)\n\nconst circleSketch = startSketchOn(offsetPlane('XY', 150))\n |> circle({ center: [0, 100], radius: 50 }, %)\n\nloft([squareSketch, circleSketch])",
"// Loft a square and a circle on the `XZ` plane using offset.\nconst squareSketch = startSketchOn('XZ')\n |> startProfileAt([-100, 200], %)\n |> line([200, 0], %)\n |> line([0, -200], %)\n |> line([-200, 0], %)\n |> lineTo([profileStartX(%), profileStartY(%)], %)\n |> close(%)\n\nconst circleSketch = startSketchOn(offsetPlane('XZ', 150))\n |> circle({ center: [0, 100], radius: 50 }, %)\n\nloft([squareSketch, circleSketch])",
"// Loft a square and a circle on the `YZ` plane using offset.\nconst squareSketch = startSketchOn('YZ')\n |> startProfileAt([-100, 200], %)\n |> line([200, 0], %)\n |> line([0, -200], %)\n |> line([-200, 0], %)\n |> lineTo([profileStartX(%), profileStartY(%)], %)\n |> close(%)\n\nconst circleSketch = startSketchOn(offsetPlane('YZ', 150))\n |> circle({ center: [0, 100], radius: 50 }, %)\n\nloft([squareSketch, circleSketch])",
"// Loft a square and a circle on the `-XZ` plane using offset.\nconst squareSketch = startSketchOn('-XZ')\n |> startProfileAt([-100, 200], %)\n |> line([200, 0], %)\n |> line([0, -200], %)\n |> line([-200, 0], %)\n |> lineTo([profileStartX(%), profileStartY(%)], %)\n |> close(%)\n\nconst circleSketch = startSketchOn(offsetPlane('-XZ', -150))\n |> circle({ center: [0, 100], radius: 50 }, %)\n\nloft([squareSketch, circleSketch])"
"// Loft a square and a circle on the `XY` plane using offset.\nsquareSketch = startSketchOn('XY')\n |> startProfileAt([-100, 200], %)\n |> line([200, 0], %)\n |> line([0, -200], %)\n |> line([-200, 0], %)\n |> lineTo([profileStartX(%), profileStartY(%)], %)\n |> close(%)\n\ncircleSketch = startSketchOn(offsetPlane('XY', 150))\n |> circle({ center: [0, 100], radius: 50 }, %)\n\nloft([squareSketch, circleSketch])",
"// Loft a square and a circle on the `XZ` plane using offset.\nsquareSketch = startSketchOn('XZ')\n |> startProfileAt([-100, 200], %)\n |> line([200, 0], %)\n |> line([0, -200], %)\n |> line([-200, 0], %)\n |> lineTo([profileStartX(%), profileStartY(%)], %)\n |> close(%)\n\ncircleSketch = startSketchOn(offsetPlane('XZ', 150))\n |> circle({ center: [0, 100], radius: 50 }, %)\n\nloft([squareSketch, circleSketch])",
"// Loft a square and a circle on the `YZ` plane using offset.\nsquareSketch = startSketchOn('YZ')\n |> startProfileAt([-100, 200], %)\n |> line([200, 0], %)\n |> line([0, -200], %)\n |> line([-200, 0], %)\n |> lineTo([profileStartX(%), profileStartY(%)], %)\n |> close(%)\n\ncircleSketch = startSketchOn(offsetPlane('YZ', 150))\n |> circle({ center: [0, 100], radius: 50 }, %)\n\nloft([squareSketch, circleSketch])",
"// Loft a square and a circle on the `-XZ` plane using offset.\nsquareSketch = startSketchOn('-XZ')\n |> startProfileAt([-100, 200], %)\n |> line([200, 0], %)\n |> line([0, -200], %)\n |> line([-200, 0], %)\n |> lineTo([profileStartX(%), profileStartY(%)], %)\n |> close(%)\n\ncircleSketch = startSketchOn(offsetPlane('-XZ', -150))\n |> circle({ center: [0, 100], radius: 50 }, %)\n\nloft([squareSketch, circleSketch])"
]
},
{
@ -97798,7 +97756,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)"
"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\nexample = extrude(1, exampleSketch)"
]
},
{
@ -100462,7 +100420,7 @@
"unpublished": false,
"deprecated": false,
"examples": [
"const exampleSketch = startSketchOn('XZ')\n |> circle({ center: [0, 0], radius: 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 }, %)"
"exampleSketch = startSketchOn('XZ')\n |> circle({ center: [0, 0], radius: 1 }, %)\n\nexample = 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 }, %)"
]
},
{
@ -103101,7 +103059,7 @@
"unpublished": false,
"deprecated": false,
"examples": [
"const exampleSketch = startSketchOn('XZ')\n |> circle({ center: [0, 0], radius: 1 }, %)\n |> patternLinear2d({\n axis: [1, 0],\n repetitions: 6,\n distance: 4\n }, %)\n\nconst example = extrude(1, exampleSketch)"
"exampleSketch = startSketchOn('XZ')\n |> circle({ center: [0, 0], radius: 1 }, %)\n |> patternLinear2d({\n axis: [1, 0],\n repetitions: 6,\n distance: 4\n }, %)\n\nexample = extrude(1, exampleSketch)"
]
},
{
@ -105749,7 +105707,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 }, %)"
"exampleSketch = startSketchOn('XZ')\n |> startProfileAt([0, 0], %)\n |> line([0, 2], %)\n |> line([3, 1], %)\n |> line([0, -4], %)\n |> close(%)\n\nexample = extrude(1, exampleSketch)\n |> patternLinear3d({\n axis: [1, 0, 1],\n repetitions: 6,\n distance: 6\n }, %)"
]
},
{
@ -108366,11 +108324,11 @@
"unpublished": false,
"deprecated": false,
"examples": [
"// Each instance will be shifted along the X axis.\nfn transform = (id) => {\n return { translate: [4 * id, 0, 0] }\n}\n\n// Sketch 4 cylinders.\nconst sketch001 = startSketchOn('XZ')\n |> circle({ center: [0, 0], radius: 2 }, %)\n |> extrude(5, %)\n |> patternTransform(4, transform, %)",
"// Each instance will be shifted along the X axis,\n// with a gap between the original (at x = 0) and the first replica\n// (at x = 8). This is because `id` starts at 1.\nfn transform = (id) => {\n return { translate: [4 * (1 + id), 0, 0] }\n}\n\nconst sketch001 = startSketchOn('XZ')\n |> circle({ center: [0, 0], radius: 2 }, %)\n |> extrude(5, %)\n |> patternTransform(4, transform, %)",
"fn cube = (length, center) => {\n let l = length / 2\n let x = center[0]\n let y = center[1]\n let p0 = [-l + x, -l + y]\n let p1 = [-l + x, l + y]\n let p2 = [l + x, l + y]\n let p3 = [l + x, -l + y]\n\n return startSketchAt(p0)\n |> lineTo(p1, %)\n |> lineTo(p2, %)\n |> lineTo(p3, %)\n |> lineTo(p0, %)\n |> close(%)\n |> extrude(length, %)\n}\n\nlet width = 20\nfn transform = (i) => {\n return {\n // Move down each time.\n translate: [0, 0, -i * width],\n // Make the cube longer, wider and flatter each time.\n scale: [pow(1.1, i), pow(1.1, i), pow(0.9, i)],\n // Turn by 15 degrees each time.\n rotation: { angle: 15 * i, origin: \"local\" }\n}\n}\n\nlet myCubes = cube(width, [100, 0])\n |> patternTransform(25, transform, %)",
"fn cube = (length, center) => {\n let l = length / 2\n let x = center[0]\n let y = center[1]\n let p0 = [-l + x, -l + y]\n let p1 = [-l + x, l + y]\n let p2 = [l + x, l + y]\n let p3 = [l + x, -l + y]\n\n return startSketchAt(p0)\n |> lineTo(p1, %)\n |> lineTo(p2, %)\n |> lineTo(p3, %)\n |> lineTo(p0, %)\n |> close(%)\n |> extrude(length, %)\n}\n\nlet width = 20\nfn transform = (i) => {\n return {\n translate: [0, 0, -i * width],\n rotation: {\n angle: 90 * i,\n // Rotate around the overall scene's origin.\n origin: \"global\"\n }\n}\n}\nlet myCubes = cube(width, [100, 100])\n |> patternTransform(4, transform, %)",
"// Parameters\nconst r = 50 // base radius\nconst h = 10 // layer height\nconst t = 0.005 // taper factor [0-1)\n// Defines how to modify each layer of the vase.\n// Each replica is shifted up the Z axis, and has a smoothly-varying radius\nfn transform = (replicaId) => {\n let scale = r * abs(1 - (t * replicaId)) * (5 + cos(replicaId / 8))\n return {\n translate: [0, 0, replicaId * 10],\n scale: [scale, scale, 0]\n}\n}\n// Each layer is just a pretty thin cylinder.\nfn layer = () => {\n return startSketchOn(\"XY\")\n // or some other plane idk\n |> circle({ center: [0, 0], radius: 1 }, %, $tag1)\n |> extrude(h, %)\n}\n// The vase is 100 layers tall.\n// The 100 layers are replica of each other, with a slight transformation applied to each.\nlet vase = layer()\n |> patternTransform(100, transform, %)"
"// Each instance will be shifted along the X axis.\nfn transform = (id) => {\n return { translate: [4 * id, 0, 0] }\n}\n\n// Sketch 4 cylinders.\nsketch001 = startSketchOn('XZ')\n |> circle({ center: [0, 0], radius: 2 }, %)\n |> extrude(5, %)\n |> patternTransform(4, transform, %)",
"// Each instance will be shifted along the X axis,\n// with a gap between the original (at x = 0) and the first replica\n// (at x = 8). This is because `id` starts at 1.\nfn transform = (id) => {\n return { translate: [4 * (1 + id), 0, 0] }\n}\n\nsketch001 = startSketchOn('XZ')\n |> circle({ center: [0, 0], radius: 2 }, %)\n |> extrude(5, %)\n |> patternTransform(4, transform, %)",
"fn cube = (length, center) => {\n l = length / 2\n x = center[0]\n y = center[1]\n p0 = [-l + x, -l + y]\n p1 = [-l + x, l + y]\n p2 = [l + x, l + y]\n p3 = [l + x, -l + y]\n\n return startSketchAt(p0)\n |> lineTo(p1, %)\n |> lineTo(p2, %)\n |> lineTo(p3, %)\n |> lineTo(p0, %)\n |> close(%)\n |> extrude(length, %)\n}\n\nwidth = 20\nfn transform = (i) => {\n return {\n // Move down each time.\n translate: [0, 0, -i * width],\n // Make the cube longer, wider and flatter each time.\n scale: [pow(1.1, i), pow(1.1, i), pow(0.9, i)],\n // Turn by 15 degrees each time.\n rotation: { angle: 15 * i, origin: \"local\" }\n}\n}\n\nmyCubes = cube(width, [100, 0])\n |> patternTransform(25, transform, %)",
"fn cube = (length, center) => {\n l = length / 2\n x = center[0]\n y = center[1]\n p0 = [-l + x, -l + y]\n p1 = [-l + x, l + y]\n p2 = [l + x, l + y]\n p3 = [l + x, -l + y]\n\n return startSketchAt(p0)\n |> lineTo(p1, %)\n |> lineTo(p2, %)\n |> lineTo(p3, %)\n |> lineTo(p0, %)\n |> close(%)\n |> extrude(length, %)\n}\n\nwidth = 20\nfn transform = (i) => {\n return {\n translate: [0, 0, -i * width],\n rotation: {\n angle: 90 * i,\n // Rotate around the overall scene's origin.\n origin: \"global\"\n }\n}\n}\nmyCubes = cube(width, [100, 100])\n |> patternTransform(4, transform, %)",
"// Parameters\nr = 50 // base radius\nh = 10 // layer height\nt = 0.005 // taper factor [0-1)\n// Defines how to modify each layer of the vase.\n// Each replica is shifted up the Z axis, and has a smoothly-varying radius\nfn transform = (replicaId) => {\n scale = r * abs(1 - (t * replicaId)) * (5 + cos(replicaId / 8))\n return {\n translate: [0, 0, replicaId * 10],\n scale: [scale, scale, 0]\n}\n}\n// Each layer is just a pretty thin cylinder.\nfn layer = () => {\n return startSketchOn(\"XY\")\n // or some other plane idk\n |> circle({ center: [0, 0], radius: 1 }, %, $tag1)\n |> extrude(h, %)\n}\n// The vase is 100 layers tall.\n// The 100 layers are replica of each other, with a slight transformation applied to each.\nvase = layer()\n |> patternTransform(100, transform, %)"
]
},
{
@ -108395,7 +108353,7 @@
"unpublished": false,
"deprecated": false,
"examples": [
"const circumference = 70\n\nconst exampleSketch = startSketchOn(\"XZ\")\n |> circle({\n center: [0, 0],\n radius: circumference / (2 * pi())\n }, %)\n\nconst example = extrude(5, exampleSketch)"
"circumference = 70\n\nexampleSketch = startSketchOn(\"XZ\")\n |> circle({\n center: [0, 0],\n radius: circumference / (2 * pi())\n }, %)\n\nexample = extrude(5, exampleSketch)"
]
},
{
@ -108451,7 +108409,7 @@
"unpublished": false,
"deprecated": false,
"examples": [
"const exampleSketch = startSketchOn('XZ')\n |> startProfileAt([0, 0], %)\n |> line(polar({ angle: 30, length: 5 }), %, $thing)\n |> line([0, 5], %)\n |> line([segEndX(thing), 0], %)\n |> line([-20, 10], %)\n |> close(%)\n\nconst example = extrude(5, exampleSketch)"
"exampleSketch = startSketchOn('XZ')\n |> startProfileAt([0, 0], %)\n |> line(polar({ angle: 30, length: 5 }), %, $thing)\n |> line([0, 5], %)\n |> line([segEndX(thing), 0], %)\n |> line([-20, 10], %)\n |> close(%)\n\nexample = extrude(5, exampleSketch)"
]
},
{
@ -108499,7 +108457,7 @@
"unpublished": false,
"deprecated": false,
"examples": [
"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)"
"exampleSketch = startSketchOn(\"XZ\")\n |> startProfileAt([0, 0], %)\n |> angledLine({ angle: 50, length: pow(5, 2) }, %)\n |> yLineTo(0, %)\n |> close(%)\n\nexample = extrude(5, exampleSketch)"
]
},
{
@ -109823,7 +109781,7 @@
"unpublished": false,
"deprecated": false,
"examples": [
"const sketch001 = startSketchOn('XY')\n |> startProfileAt([5, 2], %)\n |> angledLine({ angle: 120, length: 50 }, %, $seg01)\n |> angledLine({\n angle: segAng(seg01) + 120,\n length: 50\n }, %)\n |> lineTo(profileStart(%), %)\n |> close(%)\n |> extrude(20, %)"
"sketch001 = startSketchOn('XY')\n |> startProfileAt([5, 2], %)\n |> angledLine({ angle: 120, length: 50 }, %, $seg01)\n |> angledLine({\n angle: segAng(seg01) + 120,\n length: 50\n }, %)\n |> lineTo(profileStart(%), %)\n |> close(%)\n |> extrude(20, %)"
]
},
{
@ -111142,7 +111100,7 @@
"unpublished": false,
"deprecated": false,
"examples": [
"const sketch001 = startSketchOn('XY')\n |> startProfileAt([5, 2], %)\n |> angledLine([-26.6, 50], %)\n |> angledLine([90, 50], %)\n |> angledLineToX({ angle: 30, to: profileStartX(%) }, %)"
"sketch001 = startSketchOn('XY')\n |> startProfileAt([5, 2], %)\n |> angledLine([-26.6, 50], %)\n |> angledLine([90, 50], %)\n |> angledLineToX({ angle: 30, to: profileStartX(%) }, %)"
]
},
{
@ -112461,7 +112419,7 @@
"unpublished": false,
"deprecated": false,
"examples": [
"const sketch001 = startSketchOn('XY')\n |> startProfileAt([5, 2], %)\n |> angledLine({ angle: -60, length: 14 }, %)\n |> angledLineToY({ angle: 30, to: profileStartY(%) }, %)"
"sketch001 = startSketchOn('XY')\n |> startProfileAt([5, 2], %)\n |> angledLine({ angle: -60, length: 14 }, %)\n |> angledLineToY({ angle: 30, to: profileStartY(%) }, %)"
]
},
{
@ -116322,7 +116280,7 @@
"unpublished": false,
"deprecated": false,
"examples": [
"fn decagon = (radius) => {\n let step = 1 / 10 * tau()\n let sketch001 = startSketchAt([cos(0) * radius, sin(0) * radius])\n return reduce([1, 2, 3, 4, 5, 6, 7, 8, 9, 10], sketch001, (i, sg) => {\n let x = cos(step * i) * radius\n let y = sin(step * i) * radius\n return lineTo([x, y], sg)\n})\n}\ndecagon(5.0)\n |> close(%)"
"fn decagon = (radius) => {\n step = 1 / 10 * tau()\n sketch001 = startSketchAt([cos(0) * radius, sin(0) * radius])\n return reduce([1, 2, 3, 4, 5, 6, 7, 8, 9, 10], sketch001, (i, sg) => {\n x = cos(step * i) * radius\n y = sin(step * i) * radius\n return lineTo([x, y], sg)\n})\n}\ndecagon(5.0)\n |> close(%)"
]
},
{
@ -119625,14 +119583,14 @@
"unpublished": false,
"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({ center: [15, 0], radius: 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({ center: [10, 10], radius: 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({ center: [10, 10], radius: 4 }, %)\n |> revolve({\n angle: 90,\n axis: getOppositeEdge(revolveAxis)\n }, %)",
"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({ center: [10, 10], radius: 4 }, %)\n |> revolve({\n angle: 90,\n axis: getOppositeEdge(revolveAxis),\n tolerance: 0.0001\n }, %)",
"const sketch001 = startSketchOn('XY')\n |> startProfileAt([10, 0], %)\n |> line([5, -5], %)\n |> line([5, 5], %)\n |> lineTo([profileStartX(%), profileStartY(%)], %)\n |> close(%)\n\nconst part001 = revolve({\n axis: {\n custom: { axis: [0.0, 1.0], origin: [0.0, 0.0] }\n }\n}, sketch001)"
"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.\nsketch001 = startSketchOn('XY')\n |> circle({ center: [15, 0], radius: 5 }, %)\n |> revolve({ angle: 360, axis: 'y' }, %)",
"part001 = startSketchOn('XY')\n |> startProfileAt([4, 12], %)\n |> line([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 }, %)",
"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 }, %)\npart002 = 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, %)",
"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\nsketch001 = startSketchOn(box, \"END\")\n |> circle({ center: [10, 10], radius: 4 }, %)\n |> revolve({ angle: -90, axis: 'y' }, %)",
"box = startSketchOn('XY')\n |> startProfileAt([0, 0], %)\n |> line([0, 20], %)\n |> line([20, 0], %)\n |> line([0, -20], %, $revolveAxis)\n |> close(%)\n |> extrude(20, %)\n\nsketch001 = startSketchOn(box, \"END\")\n |> circle({ center: [10, 10], radius: 4 }, %)\n |> revolve({\n angle: 90,\n axis: getOppositeEdge(revolveAxis)\n }, %)",
"box = startSketchOn('XY')\n |> startProfileAt([0, 0], %)\n |> line([0, 20], %)\n |> line([20, 0], %)\n |> line([0, -20], %, $revolveAxis)\n |> close(%)\n |> extrude(20, %)\n\nsketch001 = startSketchOn(box, \"END\")\n |> circle({ center: [10, 10], radius: 4 }, %)\n |> revolve({\n angle: 90,\n axis: getOppositeEdge(revolveAxis),\n tolerance: 0.0001\n }, %)",
"sketch001 = startSketchOn('XY')\n |> startProfileAt([10, 0], %)\n |> line([5, -5], %)\n |> line([5, 5], %)\n |> lineTo([profileStartX(%), profileStartY(%)], %)\n |> close(%)\n\npart001 = revolve({\n axis: {\n custom: { axis: [0.0, 1.0], origin: [0.0, 0.0] }\n }\n}, sketch001)"
]
},
{
@ -120046,7 +120004,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)"
"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\nexample = extrude(4, exampleSketch)"
]
},
{
@ -120460,7 +120418,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)"
"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\nexample = extrude(5, exampleSketch)"
]
},
{
@ -120874,7 +120832,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)"
"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\nexample = extrude(5, exampleSketch)"
]
},
{
@ -121288,7 +121246,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({ angle: -60, length: segLen(thing) }, %)\n |> close(%)\n\nconst example = extrude(5, exampleSketch)"
"exampleSketch = startSketchOn(\"XZ\")\n |> startProfileAt([0, 0], %)\n |> angledLine({ angle: 60, length: 10 }, %, $thing)\n |> tangentialArc({ offset: -120, radius: 5 }, %)\n |> angledLine({ angle: -60, length: segLen(thing) }, %)\n |> close(%)\n\nexample = extrude(5, exampleSketch)"
]
},
{
@ -124453,13 +124411,13 @@
"unpublished": false,
"deprecated": false,
"examples": [
"// Remove the end face for the extrusion.\nconst firstSketch = startSketchOn('XY')\n |> startProfileAt([-12, 12], %)\n |> line([24, 0], %)\n |> line([0, -24], %)\n |> line([-24, 0], %)\n |> close(%)\n |> extrude(6, %)\n\n// Remove the end face for the extrusion.\nshell({ faces: ['end'], thickness: 0.25 }, firstSketch)",
"// Remove the start face for the extrusion.\nconst firstSketch = startSketchOn('-XZ')\n |> startProfileAt([-12, 12], %)\n |> line([24, 0], %)\n |> line([0, -24], %)\n |> line([-24, 0], %)\n |> close(%)\n |> extrude(6, %)\n\n// Remove the start face for the extrusion.\nshell({ faces: ['start'], thickness: 0.25 }, firstSketch)",
"// Remove a tagged face and the end face for the extrusion.\nconst firstSketch = startSketchOn('XY')\n |> startProfileAt([-12, 12], %)\n |> line([24, 0], %)\n |> line([0, -24], %)\n |> line([-24, 0], %, $myTag)\n |> close(%)\n |> extrude(6, %)\n\n// Remove a tagged face for the extrusion.\nshell({ faces: [myTag], thickness: 0.25 }, firstSketch)",
"// Remove multiple faces at once.\nconst firstSketch = startSketchOn('XY')\n |> startProfileAt([-12, 12], %)\n |> line([24, 0], %)\n |> line([0, -24], %)\n |> line([-24, 0], %, $myTag)\n |> close(%)\n |> extrude(6, %)\n\n// Remove a tagged face and the end face for the extrusion.\nshell({\n faces: [myTag, 'end'],\n thickness: 0.25\n}, firstSketch)",
"// Shell a sketch on face.\nlet size = 100\nconst case = startSketchOn('-XZ')\n |> startProfileAt([-size, -size], %)\n |> line([2 * size, 0], %)\n |> line([0, 2 * size], %)\n |> tangentialArcTo([-size, size], %)\n |> close(%)\n |> extrude(65, %)\n\nconst thing1 = startSketchOn(case, 'end')\n |> circle({\n center: [-size / 2, -size / 2],\n radius: 25\n }, %)\n |> extrude(50, %)\n\nconst thing2 = startSketchOn(case, 'end')\n |> circle({\n center: [size / 2, -size / 2],\n radius: 25\n }, %)\n |> extrude(50, %)\n\n// We put \"case\" in the shell function to shell the entire object.\nshell({ faces: ['start'], thickness: 5 }, case)",
"// Shell a sketch on face object on the end face.\nlet size = 100\nconst case = startSketchOn('XY')\n |> startProfileAt([-size, -size], %)\n |> line([2 * size, 0], %)\n |> line([0, 2 * size], %)\n |> tangentialArcTo([-size, size], %)\n |> close(%)\n |> extrude(65, %)\n\nconst thing1 = startSketchOn(case, 'end')\n |> circle({\n center: [-size / 2, -size / 2],\n radius: 25\n }, %)\n |> extrude(50, %)\n\nconst thing2 = startSketchOn(case, 'end')\n |> circle({\n center: [size / 2, -size / 2],\n radius: 25\n }, %)\n |> extrude(50, %)\n\n// We put \"thing1\" in the shell function to shell the end face of the object.\nshell({ faces: ['end'], thickness: 5 }, thing1)",
"// Shell sketched on face objects on the end face, include all sketches to shell\n// the entire object.\n\n\nlet size = 100\nconst case = startSketchOn('XY')\n |> startProfileAt([-size, -size], %)\n |> line([2 * size, 0], %)\n |> line([0, 2 * size], %)\n |> tangentialArcTo([-size, size], %)\n |> close(%)\n |> extrude(65, %)\n\nconst thing1 = startSketchOn(case, 'end')\n |> circle({\n center: [-size / 2, -size / 2],\n radius: 25\n }, %)\n |> extrude(50, %)\n\nconst thing2 = startSketchOn(case, 'end')\n |> circle({\n center: [size / 2, -size / 2],\n radius: 25\n }, %)\n |> extrude(50, %)\n\n// We put \"thing1\" and \"thing2\" in the shell function to shell the end face of the object.\nshell({ faces: ['end'], thickness: 5 }, [thing1, thing2])"
"// Remove the end face for the extrusion.\nfirstSketch = startSketchOn('XY')\n |> startProfileAt([-12, 12], %)\n |> line([24, 0], %)\n |> line([0, -24], %)\n |> line([-24, 0], %)\n |> close(%)\n |> extrude(6, %)\n\n// Remove the end face for the extrusion.\nshell({ faces: ['end'], thickness: 0.25 }, firstSketch)",
"// Remove the start face for the extrusion.\nfirstSketch = startSketchOn('-XZ')\n |> startProfileAt([-12, 12], %)\n |> line([24, 0], %)\n |> line([0, -24], %)\n |> line([-24, 0], %)\n |> close(%)\n |> extrude(6, %)\n\n// Remove the start face for the extrusion.\nshell({ faces: ['start'], thickness: 0.25 }, firstSketch)",
"// Remove a tagged face and the end face for the extrusion.\nfirstSketch = startSketchOn('XY')\n |> startProfileAt([-12, 12], %)\n |> line([24, 0], %)\n |> line([0, -24], %)\n |> line([-24, 0], %, $myTag)\n |> close(%)\n |> extrude(6, %)\n\n// Remove a tagged face for the extrusion.\nshell({ faces: [myTag], thickness: 0.25 }, firstSketch)",
"// Remove multiple faces at once.\nfirstSketch = startSketchOn('XY')\n |> startProfileAt([-12, 12], %)\n |> line([24, 0], %)\n |> line([0, -24], %)\n |> line([-24, 0], %, $myTag)\n |> close(%)\n |> extrude(6, %)\n\n// Remove a tagged face and the end face for the extrusion.\nshell({\n faces: [myTag, 'end'],\n thickness: 0.25\n}, firstSketch)",
"// Shell a sketch on face.\nsize = 100\ncase = startSketchOn('-XZ')\n |> startProfileAt([-size, -size], %)\n |> line([2 * size, 0], %)\n |> line([0, 2 * size], %)\n |> tangentialArcTo([-size, size], %)\n |> close(%)\n |> extrude(65, %)\n\nthing1 = startSketchOn(case, 'end')\n |> circle({\n center: [-size / 2, -size / 2],\n radius: 25\n }, %)\n |> extrude(50, %)\n\nthing2 = startSketchOn(case, 'end')\n |> circle({\n center: [size / 2, -size / 2],\n radius: 25\n }, %)\n |> extrude(50, %)\n\n// We put \"case\" in the shell function to shell the entire object.\nshell({ faces: ['start'], thickness: 5 }, case)",
"// Shell a sketch on face object on the end face.\nsize = 100\ncase = startSketchOn('XY')\n |> startProfileAt([-size, -size], %)\n |> line([2 * size, 0], %)\n |> line([0, 2 * size], %)\n |> tangentialArcTo([-size, size], %)\n |> close(%)\n |> extrude(65, %)\n\nthing1 = startSketchOn(case, 'end')\n |> circle({\n center: [-size / 2, -size / 2],\n radius: 25\n }, %)\n |> extrude(50, %)\n\nthing2 = startSketchOn(case, 'end')\n |> circle({\n center: [size / 2, -size / 2],\n radius: 25\n }, %)\n |> extrude(50, %)\n\n// We put \"thing1\" in the shell function to shell the end face of the object.\nshell({ faces: ['end'], thickness: 5 }, thing1)",
"// Shell sketched on face objects on the end face, include all sketches to shell\n// the entire object.\n\n\nsize = 100\ncase = startSketchOn('XY')\n |> startProfileAt([-size, -size], %)\n |> line([2 * size, 0], %)\n |> line([0, 2 * size], %)\n |> tangentialArcTo([-size, size], %)\n |> close(%)\n |> extrude(65, %)\n\nthing1 = startSketchOn(case, 'end')\n |> circle({\n center: [-size / 2, -size / 2],\n radius: 25\n }, %)\n |> extrude(50, %)\n\nthing2 = startSketchOn(case, 'end')\n |> circle({\n center: [size / 2, -size / 2],\n radius: 25\n }, %)\n |> extrude(50, %)\n\n// We put \"thing1\" and \"thing2\" in the shell function to shell the end face of the object.\nshell({ faces: ['end'], thickness: 5 }, [thing1, thing2])"
]
},
{
@ -124496,7 +124454,7 @@
"unpublished": false,
"deprecated": false,
"examples": [
"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)"
"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\nexample = extrude(5, exampleSketch)"
]
},
{
@ -124533,7 +124491,7 @@
"unpublished": false,
"deprecated": false,
"examples": [
"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)"
"exampleSketch = startSketchOn(\"XZ\")\n |> startProfileAt([0, 0], %)\n |> angledLine({ angle: 50, length: sqrt(2500) }, %)\n |> yLineTo(0, %)\n |> close(%)\n\nexample = extrude(5, exampleSketch)"
]
},
{
@ -128487,9 +128445,9 @@
"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([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)"
"exampleSketch = startSketchOn('XZ')\n |> startProfileAt([0, 0], %)\n |> line([10, 0], %)\n |> line([0, 10], %)\n |> line([-10, 0], %)\n |> close(%)\n\nexample = extrude(5, exampleSketch)",
"exampleSketch = startSketchOn('-XZ')\n |> startProfileAt([10, 10], %)\n |> line([10, 0], %)\n |> line([0, 10], %)\n |> line([-10, 0], %)\n |> close(%)\n\nexample = extrude(5, exampleSketch)",
"exampleSketch = startSketchOn('-XZ')\n |> startProfileAt([-10, 23], %)\n |> line([10, 0], %)\n |> line([0, 10], %)\n |> line([-10, 0], %)\n |> close(%)\n\nexample = extrude(5, exampleSketch)"
]
},
{
@ -129813,9 +129771,9 @@
"unpublished": false,
"deprecated": false,
"examples": [
"const exampleSketch = startSketchAt([0, 0])\n |> line([10, 0], %)\n |> line([0, 10], %)\n |> line([-10, 0], %)\n |> close(%)\n\nconst example = extrude(5, exampleSketch)",
"const exampleSketch = startSketchAt([10, 10])\n |> line([10, 0], %)\n |> line([0, 10], %)\n |> line([-10, 0], %)\n |> close(%)\n\nconst example = extrude(5, exampleSketch)",
"const exampleSketch = startSketchAt([-10, 23])\n |> line([10, 0], %)\n |> line([0, 10], %)\n |> line([-10, 0], %)\n |> close(%)\n\nconst example = extrude(5, exampleSketch)"
"exampleSketch = startSketchAt([0, 0])\n |> line([10, 0], %)\n |> line([0, 10], %)\n |> line([-10, 0], %)\n |> close(%)\n\nexample = extrude(5, exampleSketch)",
"exampleSketch = startSketchAt([10, 10])\n |> line([10, 0], %)\n |> line([0, 10], %)\n |> line([-10, 0], %)\n |> close(%)\n\nexample = extrude(5, exampleSketch)",
"exampleSketch = startSketchAt([-10, 23])\n |> line([10, 0], %)\n |> line([0, 10], %)\n |> line([-10, 0], %)\n |> close(%)\n\nexample = extrude(5, exampleSketch)"
]
},
{
@ -133943,10 +133901,10 @@
"unpublished": false,
"deprecated": false,
"examples": [
"const exampleSketch = startSketchOn(\"XY\")\n |> startProfileAt([0, 0], %)\n |> line([10, 0], %)\n |> line([0, 10], %)\n |> line([-10, 0], %)\n |> close(%)\n\nconst example = extrude(5, exampleSketch)\n\nconst exampleSketch002 = startSketchOn(example, 'end')\n |> startProfileAt([1, 1], %)\n |> line([8, 0], %)\n |> line([0, 8], %)\n |> line([-8, 0], %)\n |> close(%)\n\nconst example002 = extrude(5, exampleSketch002)\n\nconst exampleSketch003 = startSketchOn(example002, 'end')\n |> startProfileAt([2, 2], %)\n |> line([6, 0], %)\n |> line([0, 6], %)\n |> line([-6, 0], %)\n |> close(%)\n\nconst example003 = extrude(5, exampleSketch003)",
"const exampleSketch = startSketchOn(\"XY\")\n |> startProfileAt([0, 0], %)\n |> line([10, 0], %)\n |> line([0, 10], %, $sketchingFace)\n |> line([-10, 0], %)\n |> close(%)\n\nconst example = extrude(10, exampleSketch)\n\nconst exampleSketch002 = startSketchOn(example, sketchingFace)\n |> startProfileAt([1, 1], %)\n |> line([8, 0], %)\n |> line([0, 8], %)\n |> line([-8, 0], %)\n |> close(%, $sketchingFace002)\n\nconst example002 = extrude(10, exampleSketch002)\n\nconst exampleSketch003 = startSketchOn(example002, sketchingFace002)\n |> startProfileAt([-8, 12], %)\n |> line([0, 6], %)\n |> line([6, 0], %)\n |> line([0, -6], %)\n |> close(%)\n\nconst example003 = extrude(5, exampleSketch003)",
"const exampleSketch = 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\nconst example = revolve({ axis: 'y', angle: 180 }, exampleSketch)\n\nconst exampleSketch002 = startSketchOn(example, 'end')\n |> startProfileAt([4.5, -5], %)\n |> line([0, 5], %)\n |> line([5, 0], %)\n |> line([0, -5], %)\n |> close(%)\n\nconst example002 = extrude(5, exampleSketch002)",
"const a1 = startSketchOn({\n plane: {\n origin: { x: 0, y: 0, z: 0 },\n xAxis: { x: 1, y: 0, z: 0 },\n yAxis: { x: 0, y: 1, z: 0 },\n zAxis: { x: 0, y: 0, z: 1 }\n }\n })\n |> startProfileAt([0, 0], %)\n |> line([100.0, 0], %)\n |> yLine(-100.0, %)\n |> xLine(-100.0, %)\n |> yLine(100.0, %)\n |> close(%)\n |> extrude(3.14, %)"
"exampleSketch = startSketchOn(\"XY\")\n |> startProfileAt([0, 0], %)\n |> line([10, 0], %)\n |> line([0, 10], %)\n |> line([-10, 0], %)\n |> close(%)\n\nexample = extrude(5, exampleSketch)\n\nexampleSketch002 = startSketchOn(example, 'end')\n |> startProfileAt([1, 1], %)\n |> line([8, 0], %)\n |> line([0, 8], %)\n |> line([-8, 0], %)\n |> close(%)\n\nexample002 = extrude(5, exampleSketch002)\n\nexampleSketch003 = startSketchOn(example002, 'end')\n |> startProfileAt([2, 2], %)\n |> line([6, 0], %)\n |> line([0, 6], %)\n |> line([-6, 0], %)\n |> close(%)\n\nexample003 = extrude(5, exampleSketch003)",
"exampleSketch = startSketchOn(\"XY\")\n |> startProfileAt([0, 0], %)\n |> line([10, 0], %)\n |> line([0, 10], %, $sketchingFace)\n |> line([-10, 0], %)\n |> close(%)\n\nexample = extrude(10, exampleSketch)\n\nexampleSketch002 = startSketchOn(example, sketchingFace)\n |> startProfileAt([1, 1], %)\n |> line([8, 0], %)\n |> line([0, 8], %)\n |> line([-8, 0], %)\n |> close(%, $sketchingFace002)\n\nexample002 = extrude(10, exampleSketch002)\n\nexampleSketch003 = startSketchOn(example002, sketchingFace002)\n |> startProfileAt([-8, 12], %)\n |> line([0, 6], %)\n |> line([6, 0], %)\n |> line([0, -6], %)\n |> close(%)\n\nexample003 = extrude(5, exampleSketch003)",
"exampleSketch = 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\nexample = revolve({ axis: 'y', angle: 180 }, exampleSketch)\n\nexampleSketch002 = startSketchOn(example, 'end')\n |> startProfileAt([4.5, -5], %)\n |> line([0, 5], %)\n |> line([5, 0], %)\n |> line([0, -5], %)\n |> close(%)\n\nexample002 = extrude(5, exampleSketch002)",
"a1 = startSketchOn({\n plane: {\n origin: { x: 0, y: 0, z: 0 },\n xAxis: { x: 1, y: 0, z: 0 },\n yAxis: { x: 0, y: 1, z: 0 },\n zAxis: { x: 0, y: 0, z: 1 }\n }\n })\n |> startProfileAt([0, 0], %)\n |> line([100.0, 0], %)\n |> yLine(-100.0, %)\n |> xLine(-100.0, %)\n |> yLine(100.0, %)\n |> close(%)\n |> extrude(3.14, %)"
]
},
{
@ -133983,7 +133941,7 @@
"unpublished": false,
"deprecated": false,
"examples": [
"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)"
"exampleSketch = startSketchOn(\"XZ\")\n |> startProfileAt([0, 0], %)\n |> angledLine({ angle: 50, length: 50 * tan(1 / 2) }, %)\n |> yLineTo(0, %)\n |> close(%)\n\nexample = extrude(5, exampleSketch)"
]
},
{
@ -137865,7 +137823,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)"
"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\nexample = extrude(10, exampleSketch)"
]
},
{
@ -141732,7 +141690,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)"
"exampleSketch = startSketchOn('XZ')\n |> startProfileAt([0, 0], %)\n |> angledLine({ angle: 60, length: 10 }, %)\n |> tangentialArcTo([15, 15], %)\n |> line([10, -15], %)\n |> close(%)\n\nexample = extrude(10, exampleSketch)"
]
},
{
@ -145599,7 +145557,7 @@
"unpublished": false,
"deprecated": false,
"examples": [
"const exampleSketch = startSketchOn('XZ')\n |> startProfileAt([0, 0], %)\n |> angledLine({ angle: 45, length: 10 }, %)\n |> tangentialArcToRelative([0, -10], %)\n |> line([-10, 0], %)\n |> close(%)\n\nconst example = extrude(10, exampleSketch)"
"exampleSketch = startSketchOn('XZ')\n |> startProfileAt([0, 0], %)\n |> angledLine({ angle: 45, length: 10 }, %)\n |> tangentialArcToRelative([0, -10], %)\n |> line([-10, 0], %)\n |> close(%)\n\nexample = extrude(10, exampleSketch)"
]
},
{
@ -145624,7 +145582,7 @@
"unpublished": false,
"deprecated": false,
"examples": [
"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)"
"exampleSketch = startSketchOn(\"XZ\")\n |> startProfileAt([0, 0], %)\n |> angledLine({ angle: 50, length: 10 * tau() }, %)\n |> yLineTo(0, %)\n |> close(%)\n\nexample = extrude(5, exampleSketch)"
]
},
{
@ -145661,7 +145619,7 @@
"unpublished": false,
"deprecated": false,
"examples": [
"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)"
"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\nexample = extrude(5, exampleSketch)"
]
},
{
@ -145698,7 +145656,7 @@
"unpublished": false,
"deprecated": false,
"examples": [
"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)"
"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\nexample = extrude(5, exampleSketch)"
]
},
{
@ -149560,7 +149518,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)"
"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\nexample = extrude(10, exampleSketch)"
]
},
{
@ -153422,7 +153380,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)"
"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\nexample = extrude(10, exampleSketch)"
]
},
{
@ -157284,7 +157242,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)"
"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\nexample = extrude(10, exampleSketch)"
]
},
{
@ -161146,7 +161104,7 @@
"unpublished": false,
"deprecated": false,
"examples": [
"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)"
"exampleSketch = startSketchOn(\"XZ\")\n |> startProfileAt([0, 0], %)\n |> angledLine({ angle: 50, length: 45 }, %)\n |> yLineTo(0, %)\n |> close(%)\n\nexample = extrude(5, exampleSketch)"
]
},
{
@ -161171,7 +161129,7 @@
"unpublished": false,
"deprecated": false,
"examples": [
"const totalWidth = 10 * yd()"
"totalWidth = 10 * yd()"
]
}
]

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,10 +15,10 @@ arrays can hold objects and vice versa.
## Constant declaration
Constants are defined with the `let` keyword like so:
Constants are defined with a name and a value, like so:
```
let myBool = false
myBool = false
```
Currently you cannot redeclare a constant.
@ -29,7 +29,7 @@ An array is defined with `[]` braces. What is inside the brackets can
be of any type. For example, the following is completely valid:
```
let myArray = ["thing", 2, false]
myArray = ["thing", 2, false]
```
If you want to get a value from an array you can use the index like so:
@ -41,7 +41,7 @@ If you want to get a value from an array you can use the index like so:
An object is defined with `{}` braces. Here is an example object:
```
let myObj = {a: 0, b: "thing"}
myObj = {a: 0, b: "thing"}
```
We support two different ways of getting properties from objects, you can call
@ -67,13 +67,13 @@ As you can see above `myFn` just returns whatever it is given.
You can also do math! Let's show an example below:
```
let myMathExpression = 3 + 1 * 2 / 3 - 7
myMathExpression = 3 + 1 * 2 / 3 - 7
```
You can nest expressions in parenthesis as well:
```
let myMathExpression = 3 + (1 * 2 / (3 - 7))
myMathExpression = 3 + (1 * 2 / (3 - 7))
```
## Tags
@ -163,7 +163,7 @@ fn rect = (origin) => {
}
rect([0, 0])
const myRect = rect([20, 0])
myRect = rect([20, 0])
myRect
|> extrude(10, %)

View File

@ -11,19 +11,7 @@ layout: manual
**This schema accepts exactly one of the following:**
Declare a variable.
**enum:** `let`
----
Declare a variable that is read-only.
Declare a named constant.
**enum:** `const`
@ -46,18 +34,6 @@ Declare a function.
----
Declare a variable.
**enum:** `var`
----

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

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