Compare commits

..

3 Commits

Author SHA1 Message Date
a1157a8f99 tweak again 2024-10-02 20:59:37 +10:00
c2c81f3cbe reduce retries for debugging 2024-10-02 15:42:40 +10:00
0303445c0e debug retries 2024-10-02 15:39:42 +10:00
443 changed files with 3006 additions and 3502 deletions

View File

@ -1,59 +0,0 @@
# 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

View File

@ -1,63 +0,0 @@
# 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.6'
uses: 'google-github-actions/auth@v2.1.5'
with:
credentials_json: '${{ secrets.GOOGLE_CLOUD_DL_SA }}'
@ -343,12 +343,7 @@ jobs:
with:
files: 'out/Zoo*'
- 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
# TODO: Add GitHub publisher
announce_release:
needs: [publish-apps-release]

View File

@ -1,4 +1,4 @@
name: Static Analysis
name: build-test-web
on:
pull_request:
@ -16,7 +16,7 @@ permissions:
actions: read
jobs:
yarn-fmt-check:
check-format:
runs-on: 'ubuntu-22.04'
steps:
- uses: actions/checkout@v4
@ -27,23 +27,7 @@ jobs:
- run: yarn install
- run: yarn fmt-check
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:
check-types:
runs-on: ubuntu-22.04
steps:
@ -58,25 +42,13 @@ 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
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:
check-typos:
runs-on: ubuntu-22.04
steps:
- name: Checkout
@ -90,7 +62,7 @@ jobs:
run: codespell --config .codespellrc # Edit this file to tweak the typo list and other configuration.
yarn-unit-test:
build-test-web:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
@ -108,7 +80,7 @@ jobs:
- run: yarn build:wasm
- run: yarn simpleserver:bg
- run: yarn simpleserver:ci
if: ${{ github.event_name != 'release' && github.event_name != 'schedule' }}
- name: Install Chromium Browser
@ -117,7 +89,7 @@ jobs:
- name: run unit tests
if: ${{ github.event_name != 'release' && github.event_name != 'schedule' }}
run: yarn test:unit
run: yarn test:nowatch
env:
VITE_KC_DEV_TOKEN: ${{ secrets.KITTYCAD_API_TOKEN_DEV }}

View File

@ -1,4 +1,4 @@
name: E2E Tests
name: Playwright Tests
on:
push:
branches: [ main ]
@ -33,9 +33,8 @@ jobs:
rust:
- 'src/wasm-lib/**'
browser:
playwright-chrome:
timeout-minutes: ${{ matrix.os == 'macos-14' && 60 || 50 }}
name: playwright:browser:${{ matrix.os }} ${{ matrix.shardIndex }} ${{ matrix.shardTotal }}
strategy:
fail-fast: false
matrix:
@ -142,7 +141,6 @@ 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
@ -178,7 +176,6 @@ 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()) }}
@ -186,12 +183,69 @@ 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: |
.github/ci-cd-scripts/playwright-browser-chrome.sh ${{matrix.shardIndex}} ${{matrix.shardTotal}} ${{matrix.os}}
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
env:
CI: true
FAIL_ON_CONSOLE_ERRORS: true
@ -204,12 +258,27 @@ 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
@ -217,13 +286,11 @@ jobs:
with:
name: playwright-report-${{ matrix.os }}-${{ matrix.shardIndex }}-${{ github.sha }}
path: playwright-report/
include-hidden-files: true
retention-days: 30
overwrite: true
electron:
name: playwright:electron:${{matrix.os}}
playwright-electron:
strategy:
fail-fast: false
matrix:
@ -319,12 +386,77 @@ 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: |
.github/ci-cd-scripts/playwright-electron.sh ${{ matrix.os }}
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
env:
CI: true
FAIL_ON_CONSOLE_ERRORS: true
@ -338,12 +470,27 @@ 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
@ -351,6 +498,5 @@ jobs:
with:
name: playwright-report-electron-${{ matrix.os }}-${{ github.sha }}
path: playwright-report/
include-hidden-files: true
retention-days: 30
overwrite: true

View File

@ -304,7 +304,7 @@ yarn start
and finally:
```
yarn test:unit
yarn test:nowatch
```
For individual testing:
@ -322,69 +322,6 @@ 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": [
"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)"
"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)"
]
},
{
@ -70,7 +70,7 @@
"unpublished": false,
"deprecated": false,
"examples": [
"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)"
"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)"
]
},
{
@ -2147,7 +2147,7 @@
"unpublished": false,
"deprecated": false,
"examples": [
"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)"
"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)"
]
},
{
@ -4224,7 +4224,7 @@
"unpublished": false,
"deprecated": false,
"examples": [
"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)"
"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)"
]
},
{
@ -8117,7 +8117,7 @@
"unpublished": false,
"deprecated": false,
"examples": [
"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)"
"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)"
]
},
{
@ -12010,7 +12010,7 @@
"unpublished": false,
"deprecated": false,
"examples": [
"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)"
"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)"
]
},
{
@ -15903,7 +15903,7 @@
"unpublished": false,
"deprecated": false,
"examples": [
"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)"
"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)"
]
},
{
@ -20173,7 +20173,7 @@
"unpublished": false,
"deprecated": false,
"examples": [
"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)"
"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)"
]
},
{
@ -24051,7 +24051,7 @@
"unpublished": false,
"deprecated": false,
"examples": [
"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)"
"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)"
]
},
{
@ -27929,7 +27929,7 @@
"unpublished": false,
"deprecated": false,
"examples": [
"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)"
"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)"
]
},
{
@ -31858,7 +31858,7 @@
"unpublished": false,
"deprecated": false,
"examples": [
"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(%)"
"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(%)"
]
},
{
@ -31895,7 +31895,7 @@
"unpublished": false,
"deprecated": false,
"examples": [
"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)"
"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)"
]
},
{
@ -31938,7 +31938,7 @@
"unpublished": false,
"deprecated": false,
"examples": [
"myVar = true\nassert(myVar, \"should always be true\")"
"const myVar = true\nassert(myVar, \"should always be true\")"
]
},
{
@ -32004,7 +32004,7 @@
"unpublished": false,
"deprecated": false,
"examples": [
"n = 1.0285\no = 1.0286\nassertEqual(n, o, 0.01, \"n is within the given tolerance for o\")"
"let n = 1.0285\nlet o = 1.0286\nassertEqual(n, o, 0.01, \"n is within the given tolerance for o\")"
]
},
{
@ -32261,7 +32261,7 @@
"unpublished": false,
"deprecated": false,
"examples": [
"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)"
"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)"
]
},
{
@ -36160,7 +36160,7 @@
"unpublished": false,
"deprecated": false,
"examples": [
"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)"
"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)"
]
},
{
@ -36197,7 +36197,7 @@
"unpublished": false,
"deprecated": false,
"examples": [
"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)"
"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)"
]
},
{
@ -40532,8 +40532,8 @@
"unpublished": false,
"deprecated": false,
"examples": [
"// 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, %)"
"// 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, %)"
]
},
{
@ -44372,8 +44372,8 @@
"unpublished": false,
"deprecated": false,
"examples": [
"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)"
"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)"
]
},
{
@ -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, %)",
"exampleSketch = startSketchOn('-XZ')\n |> startProfileAt([0, 0], %)\n |> line([10, 0], %)\n |> line([0, 10], %)\n |> close(%)\n\nexample = extrude(10, exampleSketch)"
"const exampleSketch = startSketchOn('-XZ')\n |> startProfileAt([0, 0], %)\n |> line([10, 0], %)\n |> line([0, 10], %)\n |> close(%)\n\nconst example = extrude(10, exampleSketch)"
]
},
{
@ -48250,7 +48250,7 @@
"unpublished": false,
"deprecated": false,
"examples": [
"totalWidth = 10 * cm()"
"const totalWidth = 10 * cm()"
]
},
{
@ -48287,7 +48287,7 @@
"unpublished": false,
"deprecated": false,
"examples": [
"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)"
"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)"
]
},
{
@ -48312,7 +48312,7 @@
"unpublished": false,
"deprecated": false,
"examples": [
"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)"
"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)"
]
},
{
@ -50999,8 +50999,8 @@
"unpublished": false,
"deprecated": false,
"examples": [
"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)"
"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)"
]
},
{
@ -55342,8 +55342,8 @@
"unpublished": false,
"deprecated": false,
"examples": [
"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 }, %)"
"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 }, %)"
]
},
{
@ -55380,7 +55380,7 @@
"unpublished": false,
"deprecated": false,
"examples": [
"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)"
"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)"
]
},
{
@ -55405,7 +55405,7 @@
"unpublished": false,
"deprecated": false,
"examples": [
"totalWidth = 10 * ft()"
"const totalWidth = 10 * ft()"
]
},
{
@ -55819,7 +55819,7 @@
"unpublished": false,
"deprecated": false,
"examples": [
"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 }, %)"
"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 }, %)"
]
},
{
@ -56233,7 +56233,7 @@
"unpublished": false,
"deprecated": false,
"examples": [
"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 }, %)"
"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 }, %)"
]
},
{
@ -56647,7 +56647,7 @@
"unpublished": false,
"deprecated": false,
"examples": [
"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 }, %)"
"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 }, %)"
]
},
{
@ -59306,7 +59306,7 @@
"unpublished": false,
"deprecated": false,
"examples": [
"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 }, %)"
"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 }, %)"
]
},
{
@ -63236,8 +63236,8 @@
"unpublished": false,
"deprecated": false,
"examples": [
"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)"
"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)"
]
},
{
@ -65869,9 +65869,9 @@
"unpublished": false,
"deprecated": false,
"examples": [
"// 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)"
"// 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)"
]
},
{
@ -66277,11 +66277,11 @@
"unpublished": false,
"deprecated": false,
"examples": [
"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\")"
"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\")"
]
},
{
@ -66306,7 +66306,7 @@
"unpublished": false,
"deprecated": false,
"examples": [
"totalWidth = 10 * inch()"
"const totalWidth = 10 * inch()"
]
},
{
@ -66343,7 +66343,7 @@
"unpublished": false,
"deprecated": false,
"examples": [
"n = int(ceil(5 / 2))\nassertEqual(n, 3, 0.0001, \"5/2 = 2.5, rounded up makes 3\")\n// Draw n cylinders.\nstartSketchOn('XZ')\n |> circle({ center: [0, 0], radius: 2 }, %)\n |> extrude(5, %)\n |> patternTransform(n, (id) => {\n return { translate: [4 * id, 0, 0] }\n}, %)"
"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}, %)"
]
},
{
@ -67662,7 +67662,7 @@
"unpublished": false,
"deprecated": false,
"examples": [
"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)"
"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)"
]
},
{
@ -68981,7 +68981,7 @@
"unpublished": false,
"deprecated": false,
"examples": [
"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)"
"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)"
]
},
{
@ -72992,8 +72992,8 @@
"unpublished": false,
"deprecated": false,
"examples": [
"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)"
"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)"
]
},
{
@ -76860,7 +76860,7 @@
"unpublished": false,
"deprecated": false,
"examples": [
"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)"
"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)"
]
},
{
@ -76897,7 +76897,7 @@
"unpublished": false,
"deprecated": false,
"examples": [
"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)"
"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)"
]
},
{
@ -80742,9 +80742,9 @@
"unpublished": false,
"deprecated": false,
"examples": [
"// 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})"
"// 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})"
]
},
{
@ -80792,7 +80792,7 @@
"unpublished": false,
"deprecated": false,
"examples": [
"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)"
"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)"
]
},
{
@ -80829,7 +80829,7 @@
"unpublished": false,
"deprecated": false,
"examples": [
"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)"
"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)"
]
},
{
@ -80866,7 +80866,7 @@
"unpublished": false,
"deprecated": false,
"examples": [
"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)"
"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)"
]
},
{
@ -80891,7 +80891,7 @@
"unpublished": false,
"deprecated": false,
"examples": [
"totalWidth = 10 * m()"
"const totalWidth = 10 * m()"
]
},
{
@ -84386,7 +84386,14 @@
"VariableKind": {
"oneOf": [
{
"description": "Declare a named constant.",
"description": "Declare a variable.",
"type": "string",
"enum": [
"let"
]
},
{
"description": "Declare a variable that is read-only.",
"type": "string",
"enum": [
"const"
@ -84398,6 +84405,13 @@
"enum": [
"fn"
]
},
{
"description": "Declare a variable.",
"type": "string",
"enum": [
"var"
]
}
]
},
@ -87942,7 +87956,14 @@
"VariableKind": {
"oneOf": [
{
"description": "Declare a named constant.",
"description": "Declare a variable.",
"type": "string",
"enum": [
"let"
]
},
{
"description": "Declare a variable that is read-only.",
"type": "string",
"enum": [
"const"
@ -87954,6 +87975,13 @@
"enum": [
"fn"
]
},
{
"description": "Declare a variable.",
"type": "string",
"enum": [
"var"
]
}
]
},
@ -91502,7 +91530,14 @@
"VariableKind": {
"oneOf": [
{
"description": "Declare a named constant.",
"description": "Declare a variable.",
"type": "string",
"enum": [
"let"
]
},
{
"description": "Declare a variable that is read-only.",
"type": "string",
"enum": [
"const"
@ -91514,6 +91549,13 @@
"enum": [
"fn"
]
},
{
"description": "Declare a variable.",
"type": "string",
"enum": [
"var"
]
}
]
},
@ -91578,8 +91620,8 @@
"unpublished": false,
"deprecated": false,
"examples": [
"r = 10 // radius\nfn drawCircle = (id) => {\n return startSketchOn(\"XY\")\n |> circle({ center: [id * 2 * r, 0], radius: r }, %)\n}\n\n// Call `drawCircle`, passing in each element of the array.\n// The outputs from each `drawCircle` form a new array,\n// which is the return value from `map`.\ncircles = map([1, 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})"
"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})"
]
},
{
@ -91619,7 +91661,7 @@
"unpublished": false,
"deprecated": false,
"examples": [
"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)"
"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)"
]
},
{
@ -91659,7 +91701,7 @@
"unpublished": false,
"deprecated": false,
"examples": [
"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)"
"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)"
]
},
{
@ -94872,10 +94914,10 @@
"unpublished": false,
"deprecated": false,
"examples": [
"// 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)"
"// 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)"
]
},
{
@ -94900,7 +94942,7 @@
"unpublished": false,
"deprecated": false,
"examples": [
"totalWidth = 10 * mm()"
"const totalWidth = 10 * mm()"
]
},
{
@ -95109,10 +95151,10 @@
"unpublished": false,
"deprecated": false,
"examples": [
"// Loft a square and a circle on the `XY` plane using offset.\nsquareSketch = startSketchOn('XY')\n |> startProfileAt([-100, 200], %)\n |> line([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])"
"// 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])"
]
},
{
@ -97756,7 +97798,7 @@
"unpublished": false,
"deprecated": false,
"examples": [
"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)"
"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)"
]
},
{
@ -100420,7 +100462,7 @@
"unpublished": false,
"deprecated": false,
"examples": [
"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 }, %)"
"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 }, %)"
]
},
{
@ -103059,7 +103101,7 @@
"unpublished": false,
"deprecated": false,
"examples": [
"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)"
"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)"
]
},
{
@ -105707,7 +105749,7 @@
"unpublished": false,
"deprecated": false,
"examples": [
"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 }, %)"
"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 }, %)"
]
},
{
@ -108324,11 +108366,11 @@
"unpublished": false,
"deprecated": false,
"examples": [
"// Each instance will be shifted along the X axis.\nfn transform = (id) => {\n return { translate: [4 * id, 0, 0] }\n}\n\n// Sketch 4 cylinders.\nsketch001 = startSketchOn('XZ')\n |> circle({ center: [0, 0], radius: 2 }, %)\n |> extrude(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, %)"
"// 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, %)"
]
},
{
@ -108353,7 +108395,7 @@
"unpublished": false,
"deprecated": false,
"examples": [
"circumference = 70\n\nexampleSketch = startSketchOn(\"XZ\")\n |> circle({\n center: [0, 0],\n radius: circumference / (2 * pi())\n }, %)\n\nexample = extrude(5, exampleSketch)"
"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)"
]
},
{
@ -108409,7 +108451,7 @@
"unpublished": false,
"deprecated": false,
"examples": [
"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)"
"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)"
]
},
{
@ -108457,7 +108499,7 @@
"unpublished": false,
"deprecated": false,
"examples": [
"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)"
"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)"
]
},
{
@ -109781,7 +109823,7 @@
"unpublished": false,
"deprecated": false,
"examples": [
"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, %)"
"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, %)"
]
},
{
@ -111100,7 +111142,7 @@
"unpublished": false,
"deprecated": false,
"examples": [
"sketch001 = startSketchOn('XY')\n |> startProfileAt([5, 2], %)\n |> angledLine([-26.6, 50], %)\n |> angledLine([90, 50], %)\n |> angledLineToX({ angle: 30, to: profileStartX(%) }, %)"
"const sketch001 = startSketchOn('XY')\n |> startProfileAt([5, 2], %)\n |> angledLine([-26.6, 50], %)\n |> angledLine([90, 50], %)\n |> angledLineToX({ angle: 30, to: profileStartX(%) }, %)"
]
},
{
@ -112419,7 +112461,7 @@
"unpublished": false,
"deprecated": false,
"examples": [
"sketch001 = startSketchOn('XY')\n |> startProfileAt([5, 2], %)\n |> angledLine({ angle: -60, length: 14 }, %)\n |> angledLineToY({ angle: 30, to: profileStartY(%) }, %)"
"const sketch001 = startSketchOn('XY')\n |> startProfileAt([5, 2], %)\n |> angledLine({ angle: -60, length: 14 }, %)\n |> angledLineToY({ angle: 30, to: profileStartY(%) }, %)"
]
},
{
@ -116280,7 +116322,7 @@
"unpublished": false,
"deprecated": false,
"examples": [
"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(%)"
"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(%)"
]
},
{
@ -119583,14 +119625,14 @@
"unpublished": false,
"deprecated": false,
"examples": [
"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)"
"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)"
]
},
{
@ -120004,7 +120046,7 @@
"unpublished": false,
"deprecated": false,
"examples": [
"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)"
"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)"
]
},
{
@ -120418,7 +120460,7 @@
"unpublished": false,
"deprecated": false,
"examples": [
"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)"
"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)"
]
},
{
@ -120832,7 +120874,7 @@
"unpublished": false,
"deprecated": false,
"examples": [
"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)"
"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)"
]
},
{
@ -121246,7 +121288,7 @@
"unpublished": false,
"deprecated": false,
"examples": [
"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)"
"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)"
]
},
{
@ -124411,13 +124453,13 @@
"unpublished": false,
"deprecated": false,
"examples": [
"// 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])"
"// 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])"
]
},
{
@ -124454,7 +124496,7 @@
"unpublished": false,
"deprecated": false,
"examples": [
"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)"
"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)"
]
},
{
@ -124491,7 +124533,7 @@
"unpublished": false,
"deprecated": false,
"examples": [
"exampleSketch = startSketchOn(\"XZ\")\n |> startProfileAt([0, 0], %)\n |> angledLine({ angle: 50, length: sqrt(2500) }, %)\n |> yLineTo(0, %)\n |> close(%)\n\nexample = extrude(5, exampleSketch)"
"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)"
]
},
{
@ -128445,9 +128487,9 @@
"unpublished": false,
"deprecated": false,
"examples": [
"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)"
"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)"
]
},
{
@ -129771,9 +129813,9 @@
"unpublished": false,
"deprecated": false,
"examples": [
"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)"
"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)"
]
},
{
@ -133901,10 +133943,10 @@
"unpublished": false,
"deprecated": false,
"examples": [
"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, %)"
"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, %)"
]
},
{
@ -133941,7 +133983,7 @@
"unpublished": false,
"deprecated": false,
"examples": [
"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)"
"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)"
]
},
{
@ -137823,7 +137865,7 @@
"unpublished": false,
"deprecated": false,
"examples": [
"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)"
"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)"
]
},
{
@ -141690,7 +141732,7 @@
"unpublished": false,
"deprecated": false,
"examples": [
"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)"
"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)"
]
},
{
@ -145557,7 +145599,7 @@
"unpublished": false,
"deprecated": false,
"examples": [
"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)"
"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)"
]
},
{
@ -145582,7 +145624,7 @@
"unpublished": false,
"deprecated": false,
"examples": [
"exampleSketch = startSketchOn(\"XZ\")\n |> startProfileAt([0, 0], %)\n |> angledLine({ angle: 50, length: 10 * tau() }, %)\n |> yLineTo(0, %)\n |> close(%)\n\nexample = extrude(5, exampleSketch)"
"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)"
]
},
{
@ -145619,7 +145661,7 @@
"unpublished": false,
"deprecated": false,
"examples": [
"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)"
"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)"
]
},
{
@ -145656,7 +145698,7 @@
"unpublished": false,
"deprecated": false,
"examples": [
"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)"
"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)"
]
},
{
@ -149518,7 +149560,7 @@
"unpublished": false,
"deprecated": false,
"examples": [
"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)"
"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)"
]
},
{
@ -153380,7 +153422,7 @@
"unpublished": false,
"deprecated": false,
"examples": [
"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)"
"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)"
]
},
{
@ -157242,7 +157284,7 @@
"unpublished": false,
"deprecated": false,
"examples": [
"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)"
"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)"
]
},
{
@ -161104,7 +161146,7 @@
"unpublished": false,
"deprecated": false,
"examples": [
"exampleSketch = startSketchOn(\"XZ\")\n |> startProfileAt([0, 0], %)\n |> angledLine({ angle: 50, length: 45 }, %)\n |> yLineTo(0, %)\n |> close(%)\n\nexample = extrude(5, exampleSketch)"
"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)"
]
},
{
@ -161129,7 +161171,7 @@
"unpublished": false,
"deprecated": false,
"examples": [
"totalWidth = 10 * yd()"
"const 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 a name and a value, like so:
Constants are defined with the `let` keyword like so:
```
myBool = false
let 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:
```
myArray = ["thing", 2, false]
let 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:
```
myObj = {a: 0, b: "thing"}
let 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:
```
myMathExpression = 3 + 1 * 2 / 3 - 7
let myMathExpression = 3 + 1 * 2 / 3 - 7
```
You can nest expressions in parenthesis as well:
```
myMathExpression = 3 + (1 * 2 / (3 - 7))
let myMathExpression = 3 + (1 * 2 / (3 - 7))
```
## Tags
@ -163,7 +163,7 @@ fn rect = (origin) => {
}
rect([0, 0])
myRect = rect([20, 0])
const myRect = rect([20, 0])
myRect
|> extrude(10, %)

View File

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