Compare commits
199 Commits
toast-does
...
callbacks-
| Author | SHA1 | Date | |
|---|---|---|---|
| cf068f325e | |||
| d60d2292f3 | |||
| 7d564cc2ac | |||
| 05a84213dd | |||
| a85c1a9375 | |||
| 5701616f3e | |||
| 846acaba2f | |||
| 0a524d42f6 | |||
| fe28527ef9 | |||
| 0e8d0083c4 | |||
| 4f4167b247 | |||
| fbc2e9d02c | |||
| 33b15e818b | |||
| 6cebb84ae0 | |||
| 85403e47e4 | |||
| 0dfee64e3b | |||
| 6370d45f94 | |||
| fb3e922180 | |||
| 1257ec0327 | |||
| 08e9fe2e52 | |||
| 7cec1d45fe | |||
| 93710bc8f2 | |||
| 87e7e9447f | |||
| 8be113d284 | |||
| 7cfc927d5c | |||
| c0f04d5f86 | |||
| 3dbc701f26 | |||
| 16e7ae38e3 | |||
| 24c7260327 | |||
| 72cfc4a471 | |||
| 2d128ed32e | |||
| cd6749ba02 | |||
| 7243405e1b | |||
| c8da057ec2 | |||
| 220fe5b2b8 | |||
| 4e6429de49 | |||
| 5391a65b18 | |||
| 592628917a | |||
| 4c6e8633f7 | |||
| c5150468a2 | |||
| 39126dbff1 | |||
| f86a69f12a | |||
| de354ee5d3 | |||
| dfef7338ee | |||
| ee08948f54 | |||
| 832f6b65e2 | |||
| 68efd77c5d | |||
| 8f138109dd | |||
| 8972f53256 | |||
| 0c5b13ade5 | |||
| 446f92a53a | |||
| 2256e3bc09 | |||
| 9e2876edc6 | |||
| a138af1ec8 | |||
| 684c585a48 | |||
| 500be20649 | |||
| 5fbbe2fa8c | |||
| 5f5ecc5afe | |||
| 3dafc31cad | |||
| 9c230bc678 | |||
| 1fad6966b6 | |||
| c7efb4c006 | |||
| 68fd921a64 | |||
| a20e710e8f | |||
| 9daf2d7794 | |||
| f86473d13b | |||
| 6fccc68c18 | |||
| ade66d0876 | |||
| b5f3a067ee | |||
| bb9d24f821 | |||
| bd3cd97d74 | |||
| 1b5839a7f8 | |||
| a9e480f0ed | |||
| 63fa04608c | |||
| 0d4d7fa751 | |||
| 68cdb68231 | |||
| 053bdffc45 | |||
| 9ffc08b84a | |||
| 47e8d3f4fc | |||
| 53db421d97 | |||
| 289ed291c4 | |||
| 39ceb83840 | |||
| af449ff6ca | |||
| e1bf55cc4a | |||
| 8fe2d33063 | |||
| d7e36eed24 | |||
| 6123ed6a82 | |||
| da6cd5cf9f | |||
| ad5bfa1a29 | |||
| 6358bdd7cd | |||
| d6fe414b2e | |||
| 25e7e8cb89 | |||
| a175870453 | |||
| 24516cdb2d | |||
| 496398de52 | |||
| 3304a74064 | |||
| f4877cb160 | |||
| f7196e7eb0 | |||
| 5260bd6820 | |||
| 394653247a | |||
| fbd22a2d17 | |||
| 7c568f68e5 | |||
| 31b0766754 | |||
| cd33b40c37 | |||
| 3300772e3d | |||
| fa37752a41 | |||
| 34c5c153c8 | |||
| 3f343698a8 | |||
| 0bd9f42e17 | |||
| aad29fca9f | |||
| a8c1a14d48 | |||
| 8194f8b70b | |||
| 03e4f457d4 | |||
| 226ed37c5f | |||
| 0f3f923019 | |||
| bf8fb0d127 | |||
| 4a275c2ff7 | |||
| baf5509f1d | |||
| 47a5e1f6d3 | |||
| d85211c5a4 | |||
| 1beb6b5186 | |||
| 17978ab1d7 | |||
| a1bcad9dfb | |||
| 2e7bdf02cf | |||
| 6f76196b72 | |||
| e7af064518 | |||
| 674d49e2ae | |||
| 4cb48674c6 | |||
| 82daec2aff | |||
| f1ef9d5200 | |||
| dc226d3270 | |||
| 7bf50d8fe0 | |||
| b26764bc9a | |||
| 1b0c6298d7 | |||
| fe9a483726 | |||
| bd42ea037b | |||
| fdb1b21af3 | |||
| 630ef316b8 | |||
| e322926be9 | |||
| a9e61da8b5 | |||
| e2a835a437 | |||
| c61273085f | |||
| a79e365c0f | |||
| 2386ba24e5 | |||
| e42a891df8 | |||
| 98200565bf | |||
| 570fd827ed | |||
| 0add26cf61 | |||
| b54fc534c2 | |||
| c66f851a3f | |||
| 13b8ab71d8 | |||
| bdeab4f87d | |||
| 05ccf5e2f4 | |||
| 7ab015d783 | |||
| 3d6cfa980f | |||
| 9f5f1eb8c3 | |||
| 50fcdff879 | |||
| efaae2b193 | |||
| 7e4ebacb72 | |||
| 72482506c3 | |||
| a51b5b09a3 | |||
| 53ccc1ed6c | |||
| 8106749ccf | |||
| 081e34a600 | |||
| 541400f4be | |||
| 39d249030d | |||
| f8a69fac73 | |||
| 24f4bf160f | |||
| 8011594e24 | |||
| 0e09affb8f | |||
| 197a47346a | |||
| 9d083710e0 | |||
| afa7c1dc4e | |||
| c74b695a71 | |||
| d0c244e05e | |||
| a315b77f02 | |||
| 15c854ff18 | |||
| acd3a5717d | |||
| 8a2555550f | |||
| 62e75c852a | |||
| dd3601ea7b | |||
| a5e7782d9a | |||
| 79b0b70688 | |||
| 1d134c1be0 | |||
| 1c58572234 | |||
| ecee51e82b | |||
| 978ac42f1c | |||
| 893996430e | |||
| 41e65fc4e9 | |||
| 99aa74ceba | |||
| 0bcf33ed00 | |||
| d0a9b5ecab | |||
| a569f818cf | |||
| f73556ba7b | |||
| 29cdc66b34 | |||
| c9800a58d0 | |||
| e46aca4992 | |||
| 9564890b29 | |||
| f8a1f40f20 |
@ -1,3 +1,3 @@
|
||||
[codespell]
|
||||
ignore-words-list: crate,everytime,inout,co-ordinate,ot,nwo,absolutey,atleast
|
||||
ignore-words-list: crate,everytime,inout,co-ordinate,ot,nwo,absolutey,atleast,ue
|
||||
skip: **/target,node_modules,build,**/Cargo.lock,./docs/kcl/*.md,./src-tauri/gen/schemas
|
||||
|
||||
10
.eslintrc
@ -4,7 +4,8 @@
|
||||
"project": "./tsconfig.json"
|
||||
},
|
||||
"plugins": [
|
||||
"css-modules"
|
||||
"css-modules",
|
||||
"suggest-no-throw",
|
||||
],
|
||||
"extends": [
|
||||
"react-app",
|
||||
@ -17,6 +18,7 @@
|
||||
"never"
|
||||
],
|
||||
"react-hooks/exhaustive-deps": "off",
|
||||
"suggest-no-throw/suggest-no-throw": "warn",
|
||||
},
|
||||
"overrides": [
|
||||
{
|
||||
@ -25,6 +27,12 @@
|
||||
"@typescript-eslint/no-floating-promises": "warn",
|
||||
"testing-library/prefer-screen-queries": "off"
|
||||
}
|
||||
},
|
||||
{
|
||||
"files": ["src/**/*.test.ts"],
|
||||
"rules": {
|
||||
"suggest-no-throw/suggest-no-throw": "off",
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
4
.github/workflows/cargo-bench.yml
vendored
@ -38,5 +38,7 @@ jobs:
|
||||
- name: Benchmark kcl library
|
||||
shell: bash
|
||||
run: |-
|
||||
cd src/wasm-lib/kcl; cargo bench -- iai
|
||||
cd src/wasm-lib/kcl; cargo bench --all-features -- iai
|
||||
env:
|
||||
KITTYCAD_API_TOKEN: ${{secrets.KITTYCAD_API_TOKEN}}
|
||||
|
||||
|
||||
40
.github/workflows/cargo-check.yml
vendored
Normal file
@ -0,0 +1,40 @@
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
paths:
|
||||
- '**/Cargo.toml'
|
||||
- '**/Cargo.lock'
|
||||
- '**/rust-toolchain.toml'
|
||||
- '**.rs'
|
||||
- .github/workflows/cargo-check.yml
|
||||
pull_request:
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
|
||||
cancel-in-progress: true
|
||||
name: cargo check
|
||||
jobs:
|
||||
cargocheck:
|
||||
name: cargo check
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
dir: ['src/wasm-lib']
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Install latest rust
|
||||
uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
toolchain: stable
|
||||
override: true
|
||||
|
||||
- name: Rust Cache
|
||||
uses: Swatinem/rust-cache@v2.6.1
|
||||
|
||||
- name: Run check
|
||||
run: |
|
||||
cd "${{ matrix.dir }}"
|
||||
# We specifically want to test the disable-println feature
|
||||
# Since it is not enabled by default, we need to specify it
|
||||
# This is used in kcl-lsp
|
||||
cargo check --all --features disable-println --features pyo3
|
||||
11
.github/workflows/cargo-clippy.yml
vendored
@ -9,6 +9,12 @@ on:
|
||||
- '**.rs'
|
||||
- .github/workflows/cargo-clippy.yml
|
||||
pull_request:
|
||||
paths:
|
||||
- '**/Cargo.toml'
|
||||
- '**/Cargo.lock'
|
||||
- '**/rust-toolchain.toml'
|
||||
- '**.rs'
|
||||
- .github/workflows/cargo-clippy.yml
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
|
||||
cancel-in-progress: true
|
||||
@ -54,3 +60,8 @@ jobs:
|
||||
run: |
|
||||
cd "${{ matrix.dir }}"
|
||||
cargo clippy --all --tests --benches -- -D warnings
|
||||
# If this fails, run "cargo check" to update Cargo.lock,
|
||||
# then add Cargo.lock to the PR.
|
||||
- name: Check Cargo.lock doesn't need updating
|
||||
run: |
|
||||
cargo check --locked || echo "Pls run cargo check and commit the changed Cargo.lock"
|
||||
|
||||
15
.github/workflows/ci.yml
vendored
@ -138,6 +138,7 @@ jobs:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- uses: actions/download-artifact@v3
|
||||
if: github.event_name == 'schedule'
|
||||
|
||||
- name: Copy updated .json files
|
||||
if: github.event_name == 'schedule'
|
||||
@ -180,9 +181,7 @@ jobs:
|
||||
- name: Setup Rust
|
||||
uses: dtolnay/rust-toolchain@stable
|
||||
|
||||
# TODO: re-enable for Windows builds, see https://github.com/tauri-apps/tauri/issues/9045
|
||||
- name: Setup Rust cache
|
||||
if: matrix.os != 'windows-latest'
|
||||
uses: swatinem/rust-cache@v2
|
||||
with:
|
||||
workspaces: './src-tauri -> target'
|
||||
@ -240,12 +239,8 @@ jobs:
|
||||
shell: cmd
|
||||
|
||||
- name: Build the app (debug)
|
||||
uses: tauri-apps/tauri-action@v0
|
||||
if: ${{ env.BUILD_RELEASE == 'false' }}
|
||||
with:
|
||||
includeRelease: false
|
||||
includeDebug: true
|
||||
args: "${{ env.TAURI_ARGS_MACOS }} ${{ env.TAURI_ARGS_UBUNTU }}"
|
||||
run: "yarn tauri build --debug ${{ env.TAURI_ARGS_MACOS }} ${{ env.TAURI_ARGS_UBUNTU }}"
|
||||
|
||||
- name: Build for Mac TestFlight (nightly)
|
||||
if: ${{ github.event_name == 'schedule' && matrix.os == 'macos-14' }}
|
||||
@ -338,7 +333,6 @@ jobs:
|
||||
# specific and we want to overwrite it with the this new build after and
|
||||
# not upload the apple store build to the public bucket
|
||||
- name: Build the app (release) and sign
|
||||
uses: tauri-apps/tauri-action@v0
|
||||
if: ${{ env.BUILD_RELEASE == 'true' }}
|
||||
env:
|
||||
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
|
||||
@ -350,8 +344,7 @@ jobs:
|
||||
APPLE_PASSWORD: ${{ secrets.APPLE_PASSWORD }}
|
||||
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
|
||||
TAURI_CONF_ARGS: "--config ${{ matrix.os == 'windows-latest' && 'src-tauri\\tauri.release.conf.json' || 'src-tauri/tauri.release.conf.json' }}"
|
||||
with:
|
||||
args: "${{ env.TAURI_CONF_ARGS }} ${{ env.TAURI_ARGS_MACOS }} ${{ env.TAURI_ARGS_UBUNTU }}"
|
||||
run: "yarn tauri build ${{ env.TAURI_CONF_ARGS }} ${{ env.TAURI_ARGS_MACOS }} ${{ env.TAURI_ARGS_UBUNTU }}"
|
||||
|
||||
- uses: actions/upload-artifact@v3
|
||||
if: matrix.os != 'ubuntu-latest'
|
||||
@ -385,6 +378,8 @@ jobs:
|
||||
TS_NODE_COMPILER_OPTIONS: '{"module": "commonjs"}'
|
||||
|
||||
publish-apps-release:
|
||||
permissions:
|
||||
contents: write
|
||||
runs-on: ubuntu-latest
|
||||
if: ${{ github.event_name == 'release' || github.event_name == 'schedule' }}
|
||||
needs: [check-format, check-types, check-typos, build-test-web, prepare-json-files, build-test-apps]
|
||||
|
||||
122
.github/workflows/playwright.yml
vendored
@ -38,6 +38,8 @@ jobs:
|
||||
runs-on: ubuntu-latest-8-cores
|
||||
needs: check-rust-changes
|
||||
steps:
|
||||
- name: Tune GitHub-hosted runner network
|
||||
uses: smorimoto/tune-github-hosted-runner-network@v1
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
@ -46,12 +48,18 @@ jobs:
|
||||
- uses: KittyCAD/action-install-cli@main
|
||||
- name: Install dependencies
|
||||
run: yarn
|
||||
- name: Cache Playwright Browsers
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: |
|
||||
~/.cache/ms-playwright/
|
||||
key: ${{ runner.os }}-playwright-${{ hashFiles('yarn.lock') }}
|
||||
- name: Install Playwright Browsers
|
||||
run: yarn playwright install --with-deps
|
||||
- name: Download Wasm Cache
|
||||
id: download-wasm
|
||||
if: needs.check-rust-changes.outputs.rust-changed == 'false'
|
||||
uses: dawidd6/action-download-artifact@v3
|
||||
uses: dawidd6/action-download-artifact@v6
|
||||
continue-on-error: true
|
||||
with:
|
||||
github_token: ${{secrets.GITHUB_TOKEN}}
|
||||
@ -84,26 +92,24 @@ jobs:
|
||||
- name: build web
|
||||
run: yarn build:local
|
||||
- name: Run ubuntu/chrome snapshots
|
||||
run: yarn playwright test --project="Google Chrome" --update-snapshots e2e/playwright/snapshot-tests.spec.ts
|
||||
continue-on-error: true
|
||||
run: |
|
||||
yarn playwright test --project="Google Chrome" --update-snapshots e2e/playwright/snapshot-tests.spec.ts
|
||||
env:
|
||||
CI: true
|
||||
token: ${{ secrets.KITTYCAD_API_TOKEN_DEV }}
|
||||
snapshottoken: ${{ secrets.KITTYCAD_API_TOKEN }}
|
||||
- uses: actions/upload-artifact@v3
|
||||
- name: Clean up test-results
|
||||
if: always()
|
||||
with:
|
||||
name: playwright-report
|
||||
path: playwright-report/
|
||||
retention-days: 30
|
||||
continue-on-error: true
|
||||
run: rm -r test-results
|
||||
- name: check for changes
|
||||
id: git-check
|
||||
run: |
|
||||
git add .
|
||||
if git status | grep -q "Changes to be committed"
|
||||
then
|
||||
echo "::set-output name=modified::true"
|
||||
else
|
||||
echo "::set-output name=modified::false"
|
||||
then echo "modified=true" >> $GITHUB_OUTPUT
|
||||
else echo "modified=false" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
- name: Commit changes, if any
|
||||
if: steps.git-check.outputs.modified == 'true'
|
||||
@ -119,23 +125,63 @@ jobs:
|
||||
git commit -am "A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu)" || true
|
||||
git push
|
||||
git push origin ${{ github.head_ref }}
|
||||
# only upload artifacts if there's actually changes
|
||||
- uses: actions/upload-artifact@v4
|
||||
if: steps.git-check.outputs.modified == 'true'
|
||||
with:
|
||||
name: playwright-report-ubuntu-${{ github.sha }}
|
||||
path: playwright-report/
|
||||
retention-days: 30
|
||||
# if have previous run results, use them
|
||||
- uses: actions/download-artifact@v4
|
||||
if: always()
|
||||
continue-on-error: true
|
||||
with:
|
||||
name: test-results-ubuntu-${{ github.sha }}
|
||||
path: test-results/
|
||||
- name: Run ubuntu/chrome flow retry failures
|
||||
id: retry
|
||||
if: always()
|
||||
run: |
|
||||
if [[ -d "test-results" ]];
|
||||
then if [[ $(ls -1 "test-results" | wc -l) != "0" ]];
|
||||
then echo "retried=true" >> $GITHUB_OUTPUT;
|
||||
else echo "retried=false" >> $GITHUB_OUTPUT; exit 0;
|
||||
fi;
|
||||
else echo "retried=false" >> $GITHUB_OUTPUT; exit 0;
|
||||
fi;
|
||||
yarn playwright test --project="Google Chrome" --last-failed e2e/playwright/flow-tests.spec.ts
|
||||
env:
|
||||
CI: true
|
||||
token: ${{ secrets.KITTYCAD_API_TOKEN_DEV }}
|
||||
- name: Run ubuntu/chrome flow
|
||||
if: steps.retry.outputs.retried == 'false'
|
||||
run: yarn playwright test --project="Google Chrome" e2e/playwright/flow-tests.spec.ts
|
||||
env:
|
||||
CI: true
|
||||
token: ${{ secrets.KITTYCAD_API_TOKEN_DEV }}
|
||||
- uses: actions/upload-artifact@v3
|
||||
- uses: actions/upload-artifact@v4
|
||||
if: always()
|
||||
with:
|
||||
name: playwright-report
|
||||
name: test-results-ubuntu-${{ github.sha }}
|
||||
path: test-results/
|
||||
retention-days: 30
|
||||
overwrite: true
|
||||
- uses: actions/upload-artifact@v4
|
||||
if: always()
|
||||
with:
|
||||
name: playwright-report-ubuntu-${{ github.sha }}
|
||||
path: playwright-report/
|
||||
retention-days: 30
|
||||
overwrite: true
|
||||
|
||||
playwright-macos:
|
||||
timeout-minutes: 60
|
||||
runs-on: macos-14
|
||||
runs-on: macos-14-large
|
||||
needs: check-rust-changes
|
||||
steps:
|
||||
- name: Tune GitHub-hosted runner network
|
||||
uses: smorimoto/tune-github-hosted-runner-network@v1
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
@ -143,12 +189,20 @@ jobs:
|
||||
cache: 'yarn'
|
||||
- name: Install dependencies
|
||||
run: yarn
|
||||
- name: Cache Playwright Browsers
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: |
|
||||
~/.cache/ms-playwright
|
||||
key: ${{ runner.os }}-playwright-${{ hashFiles('**/package-lock.json') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-playwright-
|
||||
- name: Install Playwright Browsers
|
||||
run: yarn playwright install --with-deps
|
||||
- name: Download Wasm Cache
|
||||
id: download-wasm
|
||||
if: needs.check-rust-changes.outputs.rust-changed == 'false'
|
||||
uses: dawidd6/action-download-artifact@v3
|
||||
uses: dawidd6/action-download-artifact@v6
|
||||
continue-on-error: true
|
||||
with:
|
||||
github_token: ${{secrets.GITHUB_TOKEN}}
|
||||
@ -180,16 +234,48 @@ jobs:
|
||||
run: yarn build:wasm
|
||||
- name: build web
|
||||
run: yarn build:local
|
||||
# if have previous run results, use them
|
||||
- uses: actions/download-artifact@v4
|
||||
if: ${{ always() }}
|
||||
continue-on-error: true
|
||||
with:
|
||||
name: test-results-macos-${{ github.sha }}
|
||||
path: test-results/
|
||||
- name: Run macos/safari flow retry failures
|
||||
id: retry
|
||||
if: always()
|
||||
run: |
|
||||
if [[ -d "test-results" ]];
|
||||
then if [[ $(ls -1 "test-results" | wc -l) != "0" ]];
|
||||
then echo "retried=true" >> $GITHUB_OUTPUT;
|
||||
else echo "retried=false" >> $GITHUB_OUTPUT; exit 0;
|
||||
fi;
|
||||
else echo "retried=false" >> $GITHUB_OUTPUT; exit 0;
|
||||
fi;
|
||||
yarn playwright test --project="webkit" --last-failed e2e/playwright/flow-tests.spec.ts
|
||||
env:
|
||||
CI: true
|
||||
token: ${{ secrets.KITTYCAD_API_TOKEN_DEV }}
|
||||
- name: Run macos/safari flow
|
||||
if: steps.retry.outputs.retried == 'false'
|
||||
# webkit doesn't work on Ubuntu because of the same reason tauri doesn't (webRTC issues)
|
||||
# TODO remove this and the matrix and run all tests on ubuntu when this is fixed
|
||||
run: yarn playwright test --project="webkit" e2e/playwright/flow-tests.spec.ts
|
||||
env:
|
||||
CI: true
|
||||
token: ${{ secrets.KITTYCAD_API_TOKEN_DEV }}
|
||||
- uses: actions/upload-artifact@v3
|
||||
if: always()
|
||||
- uses: actions/upload-artifact@v4
|
||||
if: ${{ always() }}
|
||||
with:
|
||||
name: playwright-report
|
||||
name: test-results-macos-${{ github.sha }}
|
||||
path: test-results/
|
||||
retention-days: 30
|
||||
overwrite: true
|
||||
- uses: actions/upload-artifact@v4
|
||||
if: ${{ always() }}
|
||||
with:
|
||||
name: playwright-report-macos-${{ github.sha }}
|
||||
path: playwright-report/
|
||||
retention-days: 30
|
||||
overwrite: true
|
||||
|
||||
|
||||
3
.gitignore
vendored
@ -17,6 +17,7 @@
|
||||
.env.development.local
|
||||
.env.test.local
|
||||
.env.production.local
|
||||
.direnv
|
||||
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
@ -55,3 +56,5 @@ src-tauri/gen
|
||||
|
||||
src/wasm-lib/grackle/stdlib_cube_partial.json
|
||||
Mac_App_Distribution.provisionprofile
|
||||
|
||||
*.tsbuildinfo
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
# Ignore artifacts:
|
||||
build
|
||||
dist
|
||||
coverage
|
||||
|
||||
# Ignore Rust projects:
|
||||
@ -9,5 +10,6 @@ src/wasm-lib/pkg
|
||||
src/wasm-lib/kcl/bindings
|
||||
e2e/playwright/export-snapshots
|
||||
|
||||
|
||||
# XState generated files
|
||||
src/machines/**.typegen.ts
|
||||
|
||||
7
.vscode/settings.json
vendored
@ -1,7 +0,0 @@
|
||||
{
|
||||
"cSpell.words": [
|
||||
"geos"
|
||||
],
|
||||
"editor.tabSize": 2,
|
||||
"editor.insertSpaces": true,
|
||||
}
|
||||
17
Makefile
Normal file
@ -0,0 +1,17 @@
|
||||
.PHONY: dev
|
||||
|
||||
WASM_LIB_FILES := $(wildcard src/wasm-lib/**/*.rs)
|
||||
TS_SRC := $(wildcard src/**/*.tsx) $(wildcard src/**/*.ts)
|
||||
XSTATE_TYPEGENS := $(wildcard src/machines/*.typegen.ts)
|
||||
|
||||
dev: node_modules public/wasm_lib_bg.wasm $(XSTATE_TYPEGENS)
|
||||
yarn start
|
||||
|
||||
$(XSTATE_TYPEGENS): $(TS_SRC)
|
||||
yarn xstate typegen 'src/**/*.ts?(x)'
|
||||
|
||||
public/wasm_lib_bg.wasm: $(WASM_LIB_FILES)
|
||||
yarn build:wasm-dev
|
||||
|
||||
node_modules: package.json yarn.lock
|
||||
yarn install
|
||||
118
README.md
@ -89,25 +89,6 @@ enable third-party cookies. You can enable third-party cookies by clicking on
|
||||
the eye with a slash through it in the URL bar, and clicking on "Enable
|
||||
Third-Party Cookies".
|
||||
|
||||
## Running tests
|
||||
|
||||
First, start the dev server following "Running a development build" above.
|
||||
|
||||
Then in another terminal tab, run:
|
||||
|
||||
```
|
||||
yarn test
|
||||
```
|
||||
|
||||
Which will run our suite of [Vitest unit](https://vitest.dev/) and [React Testing Library E2E](https://testing-library.com/docs/react-testing-library/intro/) tests, in interactive mode by default.
|
||||
|
||||
For running the rust (not tauri rust though) only, you can
|
||||
|
||||
```bash
|
||||
cd src/wasm-lib
|
||||
cargo test
|
||||
```
|
||||
|
||||
## Tauri
|
||||
|
||||
To spin up up tauri dev, `yarn install` and `yarn build:wasm-dev` need to have been done before hand then
|
||||
@ -143,36 +124,20 @@ Before you submit a contribution PR to this repo, please ensure that:
|
||||
|
||||
## Release a new version
|
||||
|
||||
1. Bump the versions in the .json files by creating a `Cut release v{x}.{y}.{z}` PR, committing the changes from
|
||||
1. Bump the versions by running `./make-realease.sh` while on a fresh pull of main
|
||||
|
||||
```bash
|
||||
VERSION=x.y.z yarn run bump-jsons
|
||||
```
|
||||
|
||||
Alternatively you can try the experimental `make-release.sh` bash script that will create the branch with the updated json files for you.
|
||||
That will create the branch with the updated json files for you.
|
||||
run `./make-release.sh` for a patch update
|
||||
run `./make-release.sh "minor"` for minor
|
||||
run `./make-release.sh "major"` for major
|
||||
|
||||
The PR may serve as a place to discuss the human-readable changelog and extra QA. A quick way of getting PR's merged since the last bump is to [use this PR filter](https://github.com/KittyCAD/modeling-app/pulls?q=is%3Apr+sort%3Aupdated-desc+is%3Amerged+), open up the browser console and paste in the following
|
||||
After it runs you should just need to push the push the branch and open a PR (it will suggest a changelog for you too, delete any that are not user facing)
|
||||
|
||||
```typescript
|
||||
console.log(
|
||||
'- ' +
|
||||
Array.from(
|
||||
document.querySelectorAll('[data-hovercard-type="pull_request"]')
|
||||
).map((a) => `[${a.innerText}](${a.href})`).join(`
|
||||
- `)
|
||||
)
|
||||
```
|
||||
|
||||
grab the md list and delete any that are older than the last bump
|
||||
The PR may serve as a place to discuss the human-readable changelog and extra QA.
|
||||
|
||||
2. Merge the PR
|
||||
|
||||
3. Create a new release and tag pointing to the bump version commit using semantic versioning `v{x}.{y}.{z}`
|
||||
|
||||
4. A new Action kicks in at https://github.com/KittyCAD/modeling-app/actions, uploading artifacts to the release
|
||||
3. Profit (A new Action kicks in at https://github.com/KittyCAD/modeling-app/actions if the PR was correctly named)
|
||||
|
||||
## Fuzzing the parser
|
||||
|
||||
@ -195,30 +160,36 @@ $ cargo +nightly fuzz run parser
|
||||
For more information on fuzzing you can check out
|
||||
[this guide](https://rust-fuzz.github.io/book/cargo-fuzz.html).
|
||||
|
||||
### Playwright
|
||||
## Tests
|
||||
|
||||
First time running plawright locally, you'll need to add the secrets file
|
||||
### Playwright tests
|
||||
|
||||
For a portable way to run Playwright you'll need Docker.
|
||||
|
||||
After that, open a terminal and run:
|
||||
|
||||
```bash
|
||||
touch ./e2e/playwright/playwright-secrets.env
|
||||
printf 'token="your-token"\nsnapshottoken="your-snapshot-token"' > ./e2e/playwright/playwright-secrets.env
|
||||
docker run --network host --rm --init -it playwright/chrome:playwright-1.43.1
|
||||
```
|
||||
|
||||
and in another terminal, run:
|
||||
|
||||
```bash
|
||||
PW_TEST_CONNECT_WS_ENDPOINT=ws://127.0.0.1:4444/ yarn playwright test --project="Google Chrome" <test suite>
|
||||
```
|
||||
|
||||
An example of a `<test suite>` is: `e2e/playwright/flow-tests.spec.ts`
|
||||
|
||||
YOU WILL NEED A PLAYWRIGHT-SECRETS.ENV FILE:
|
||||
|
||||
|
||||
```bash
|
||||
# ./e2e/playwright/playwright-secrets.env
|
||||
token=<your-token>
|
||||
snapshottoken=<your-snapshot-token>
|
||||
```
|
||||
then replace "your-token" with a dev token from dev.zoo.dev/account/api-tokens
|
||||
|
||||
then:
|
||||
run playwright
|
||||
|
||||
```
|
||||
yarn playwright test
|
||||
```
|
||||
|
||||
run a specific test suite
|
||||
|
||||
```
|
||||
yarn playwright test src/e2e-tests/example.spec.ts
|
||||
```
|
||||
|
||||
run a specific test change the test from `test('...` to `test.only('...`
|
||||
(note if you commit this, the tests will instantly fail without running any of the tests)
|
||||
|
||||
@ -280,6 +251,37 @@ Where `./store` should look like this
|
||||
|
||||
However because much of our tests involve clicking in the stream at specific locations, it's code-gen looks `await page.locator('video').click();` when really we need to use a pixel coord, so I think it's of limited use.
|
||||
|
||||
### Unit and component tests
|
||||
|
||||
If you already haven't, run the following:
|
||||
|
||||
```
|
||||
yarn
|
||||
yarn build:wasm
|
||||
yarn start
|
||||
```
|
||||
|
||||
and finally:
|
||||
|
||||
```
|
||||
yarn test:nowatch
|
||||
```
|
||||
|
||||
For individual testing:
|
||||
|
||||
```
|
||||
yarn test abstractSyntaxTree -t "unexpected closed curly brace" --silent=false
|
||||
```
|
||||
|
||||
Which will run our suite of [Vitest unit](https://vitest.dev/) and [React Testing Library E2E](https://testing-library.com/docs/react-testing-library/intro/) tests, in interactive mode by default.
|
||||
|
||||
### Rust tests
|
||||
|
||||
```bash
|
||||
cd src/wasm-lib
|
||||
cargo test
|
||||
```
|
||||
|
||||
#### 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.
|
||||
@ -315,7 +317,7 @@ PS: for the debug panel, the following JSON is useful for snapping the camera
|
||||
|
||||
```
|
||||
yarn install
|
||||
yarn build:wasm
|
||||
yarn build:wasm-dev
|
||||
cp src/wasm-lib/pkg/wasm_lib_bg.wasm public
|
||||
yarn vite build --mode development
|
||||
yarn tauri build --debug -b
|
||||
|
||||
@ -17,4 +17,13 @@ once fixed in engine will just start working here with no language changes.
|
||||
currently move or transform the imported objects at all, once we have assemblies
|
||||
this will work.
|
||||
|
||||
- **Fillets**: Fillets cannot intersect, you will get an error. Only simple fillet cases work currently.
|
||||
- **Fillets**: Fillets cannot intersect, you will get an error. Only simple fillet
|
||||
cases work currently.
|
||||
|
||||
- **Chamfers**: Chamfers cannot intersect, you will get an error. Only simple
|
||||
chamfer cases work currently.
|
||||
|
||||
Sketching on the chamfered face does not currently work.
|
||||
|
||||
- **Shell**: Shell is only working for `end` faces, not for `side` or `start`
|
||||
faces. We are tracking the engine side bug on this.
|
||||
|
||||
@ -9,7 +9,7 @@ Returns the angle to match the given length for x.
|
||||
|
||||
|
||||
```js
|
||||
angleToMatchLengthX(segment_name: string, to: number, sketch_group: SketchGroup) -> number
|
||||
angleToMatchLengthX(segment_name: TagIdentifier, to: number, sketch_group: SketchGroup) -> number
|
||||
```
|
||||
|
||||
### Examples
|
||||
@ -17,11 +17,8 @@ angleToMatchLengthX(segment_name: string, to: number, sketch_group: SketchGroup)
|
||||
```js
|
||||
const sketch001 = startSketchOn('XZ')
|
||||
|> startProfileAt([0, 0], %)
|
||||
|> line([2, 5], %, 'seg01')
|
||||
|> angledLineToX([
|
||||
-angleToMatchLengthX('seg01', 7, %),
|
||||
10
|
||||
], %)
|
||||
|> line([2, 5], %, $seg01)
|
||||
|> angledLineToX([-angleToMatchLengthX(seg01, 7, %), 10], %)
|
||||
|> close(%)
|
||||
|
||||
const extrusion = extrude(5, sketch001)
|
||||
@ -31,13 +28,16 @@ const extrusion = extrude(5, sketch001)
|
||||
|
||||
### Arguments
|
||||
|
||||
* `segment_name`: `string` (REQUIRED)
|
||||
* `segment_name`: `TagIdentifier` (REQUIRED)
|
||||
```js
|
||||
{
|
||||
value: string,
|
||||
}
|
||||
```
|
||||
* `to`: `number` (REQUIRED)
|
||||
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
|
||||
```js
|
||||
{
|
||||
// The plane id or face id of the sketch group.
|
||||
entityId: uuid,
|
||||
// The id of the sketch group.
|
||||
id: uuid,
|
||||
// What the sketch is on (can be a plane or a face).
|
||||
@ -73,12 +73,184 @@ const extrusion = extrude(5, sketch001)
|
||||
},
|
||||
} |
|
||||
{
|
||||
// the face id the sketch is on
|
||||
// The extrude group the face is on.
|
||||
extrudeGroup: {
|
||||
// The id of the extrusion end cap
|
||||
endCapId: uuid,
|
||||
// Chamfers or fillets on this extrude group.
|
||||
filletOrChamfers: [{
|
||||
// The engine id of the edge to fillet.
|
||||
edge_id: uuid,
|
||||
// The id of the engine command that called this fillet.
|
||||
id: uuid,
|
||||
radius: number,
|
||||
type: "fillet",
|
||||
} |
|
||||
{
|
||||
// The engine id of the edge to chamfer.
|
||||
edge_id: uuid,
|
||||
// The id of the engine command that called this chamfer.
|
||||
id: uuid,
|
||||
length: number,
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "chamfer",
|
||||
}],
|
||||
// The height of the extrude group.
|
||||
height: number,
|
||||
// The id of the extrude group.
|
||||
id: uuid,
|
||||
// The sketch group.
|
||||
sketchGroup: {
|
||||
// The id of the sketch group.
|
||||
id: uuid,
|
||||
// What the sketch is on (can be a plane or a face).
|
||||
on: SketchSurface,
|
||||
// The starting path.
|
||||
start: {
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
},
|
||||
// Tag identifiers that have been declared in this sketch group.
|
||||
tags: {
|
||||
},
|
||||
// The paths in the sketch group.
|
||||
value: [{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "ToPoint",
|
||||
} |
|
||||
{
|
||||
// arc's direction
|
||||
ccw: string,
|
||||
// the arc's center
|
||||
center: [number, number],
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArcTo",
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArc",
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Horizontal",
|
||||
// The x coordinate.
|
||||
x: number,
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "AngledLineTo",
|
||||
// The x coordinate.
|
||||
x: number,
|
||||
// The y coordinate.
|
||||
y: number,
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Base",
|
||||
}],
|
||||
},
|
||||
// The id of the extrusion start cap
|
||||
startCapId: uuid,
|
||||
// The extrude surfaces.
|
||||
value: [{
|
||||
// The face id for the extrude plane.
|
||||
faceId: uuid,
|
||||
// The id of the geometry.
|
||||
id: uuid,
|
||||
// The source range.
|
||||
sourceRange: [number, number],
|
||||
// The tag.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "extrudePlane",
|
||||
} |
|
||||
{
|
||||
// The face id for the extrude plane.
|
||||
faceId: uuid,
|
||||
// The id of the geometry.
|
||||
id: uuid,
|
||||
// The source range.
|
||||
sourceRange: [number, number],
|
||||
// The tag.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "extrudeArc",
|
||||
}],
|
||||
},
|
||||
// The id of the face.
|
||||
id: uuid,
|
||||
// The original sketch group id of the object we are sketching on.
|
||||
sketchGroupId: uuid,
|
||||
type: "face",
|
||||
// The tag of the face.
|
||||
value: string,
|
||||
@ -101,25 +273,32 @@ const extrusion = extrude(5, sketch001)
|
||||
z: number,
|
||||
},
|
||||
},
|
||||
// The position of the sketch group.
|
||||
position: [number, number, number],
|
||||
// The rotation of the sketch group base plane.
|
||||
rotation: [number, number, number, number],
|
||||
// The starting path.
|
||||
start: {
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
},
|
||||
// Tag identifiers that have been declared in this sketch group.
|
||||
tags: {
|
||||
},
|
||||
// The paths in the sketch group.
|
||||
value: [{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "ToPoint",
|
||||
@ -131,8 +310,12 @@ const extrusion = extrude(5, sketch001)
|
||||
center: [number, number],
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArcTo",
|
||||
@ -140,8 +323,12 @@ const extrusion = extrude(5, sketch001)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArc",
|
||||
@ -149,8 +336,12 @@ const extrusion = extrude(5, sketch001)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Horizontal",
|
||||
@ -160,8 +351,12 @@ const extrusion = extrude(5, sketch001)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "AngledLineTo",
|
||||
@ -173,30 +368,16 @@ const extrusion = extrude(5, sketch001)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Base",
|
||||
}],
|
||||
// The x-axis of the sketch group base plane in the 3D space
|
||||
xAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
// The y-axis of the sketch group base plane in the 3D space
|
||||
yAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
// The z-axis of the sketch group base plane in the 3D space
|
||||
zAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
@ -9,7 +9,7 @@ Returns the angle to match the given length for y.
|
||||
|
||||
|
||||
```js
|
||||
angleToMatchLengthY(segment_name: string, to: number, sketch_group: SketchGroup) -> number
|
||||
angleToMatchLengthY(segment_name: TagIdentifier, to: number, sketch_group: SketchGroup) -> number
|
||||
```
|
||||
|
||||
### Examples
|
||||
@ -17,9 +17,9 @@ angleToMatchLengthY(segment_name: string, to: number, sketch_group: SketchGroup)
|
||||
```js
|
||||
const sketch001 = startSketchOn('XZ')
|
||||
|> startProfileAt([0, 0], %)
|
||||
|> line([1, 2], %, 'seg01')
|
||||
|> line([1, 2], %, $seg01)
|
||||
|> angledLine({
|
||||
angle: angleToMatchLengthY('seg01', 15, %),
|
||||
angle: angleToMatchLengthY(seg01, 15, %),
|
||||
length: 5
|
||||
}, %)
|
||||
|> yLineTo(0, %)
|
||||
@ -32,13 +32,16 @@ const extrusion = extrude(5, sketch001)
|
||||
|
||||
### Arguments
|
||||
|
||||
* `segment_name`: `string` (REQUIRED)
|
||||
* `segment_name`: `TagIdentifier` (REQUIRED)
|
||||
```js
|
||||
{
|
||||
value: string,
|
||||
}
|
||||
```
|
||||
* `to`: `number` (REQUIRED)
|
||||
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
|
||||
```js
|
||||
{
|
||||
// The plane id or face id of the sketch group.
|
||||
entityId: uuid,
|
||||
// The id of the sketch group.
|
||||
id: uuid,
|
||||
// What the sketch is on (can be a plane or a face).
|
||||
@ -74,12 +77,184 @@ const extrusion = extrude(5, sketch001)
|
||||
},
|
||||
} |
|
||||
{
|
||||
// the face id the sketch is on
|
||||
// The extrude group the face is on.
|
||||
extrudeGroup: {
|
||||
// The id of the extrusion end cap
|
||||
endCapId: uuid,
|
||||
// Chamfers or fillets on this extrude group.
|
||||
filletOrChamfers: [{
|
||||
// The engine id of the edge to fillet.
|
||||
edge_id: uuid,
|
||||
// The id of the engine command that called this fillet.
|
||||
id: uuid,
|
||||
radius: number,
|
||||
type: "fillet",
|
||||
} |
|
||||
{
|
||||
// The engine id of the edge to chamfer.
|
||||
edge_id: uuid,
|
||||
// The id of the engine command that called this chamfer.
|
||||
id: uuid,
|
||||
length: number,
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "chamfer",
|
||||
}],
|
||||
// The height of the extrude group.
|
||||
height: number,
|
||||
// The id of the extrude group.
|
||||
id: uuid,
|
||||
// The sketch group.
|
||||
sketchGroup: {
|
||||
// The id of the sketch group.
|
||||
id: uuid,
|
||||
// What the sketch is on (can be a plane or a face).
|
||||
on: SketchSurface,
|
||||
// The starting path.
|
||||
start: {
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
},
|
||||
// Tag identifiers that have been declared in this sketch group.
|
||||
tags: {
|
||||
},
|
||||
// The paths in the sketch group.
|
||||
value: [{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "ToPoint",
|
||||
} |
|
||||
{
|
||||
// arc's direction
|
||||
ccw: string,
|
||||
// the arc's center
|
||||
center: [number, number],
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArcTo",
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArc",
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Horizontal",
|
||||
// The x coordinate.
|
||||
x: number,
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "AngledLineTo",
|
||||
// The x coordinate.
|
||||
x: number,
|
||||
// The y coordinate.
|
||||
y: number,
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Base",
|
||||
}],
|
||||
},
|
||||
// The id of the extrusion start cap
|
||||
startCapId: uuid,
|
||||
// The extrude surfaces.
|
||||
value: [{
|
||||
// The face id for the extrude plane.
|
||||
faceId: uuid,
|
||||
// The id of the geometry.
|
||||
id: uuid,
|
||||
// The source range.
|
||||
sourceRange: [number, number],
|
||||
// The tag.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "extrudePlane",
|
||||
} |
|
||||
{
|
||||
// The face id for the extrude plane.
|
||||
faceId: uuid,
|
||||
// The id of the geometry.
|
||||
id: uuid,
|
||||
// The source range.
|
||||
sourceRange: [number, number],
|
||||
// The tag.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "extrudeArc",
|
||||
}],
|
||||
},
|
||||
// The id of the face.
|
||||
id: uuid,
|
||||
// The original sketch group id of the object we are sketching on.
|
||||
sketchGroupId: uuid,
|
||||
type: "face",
|
||||
// The tag of the face.
|
||||
value: string,
|
||||
@ -102,25 +277,32 @@ const extrusion = extrude(5, sketch001)
|
||||
z: number,
|
||||
},
|
||||
},
|
||||
// The position of the sketch group.
|
||||
position: [number, number, number],
|
||||
// The rotation of the sketch group base plane.
|
||||
rotation: [number, number, number, number],
|
||||
// The starting path.
|
||||
start: {
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
},
|
||||
// Tag identifiers that have been declared in this sketch group.
|
||||
tags: {
|
||||
},
|
||||
// The paths in the sketch group.
|
||||
value: [{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "ToPoint",
|
||||
@ -132,8 +314,12 @@ const extrusion = extrude(5, sketch001)
|
||||
center: [number, number],
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArcTo",
|
||||
@ -141,8 +327,12 @@ const extrusion = extrude(5, sketch001)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArc",
|
||||
@ -150,8 +340,12 @@ const extrusion = extrude(5, sketch001)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Horizontal",
|
||||
@ -161,8 +355,12 @@ const extrusion = extrude(5, sketch001)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "AngledLineTo",
|
||||
@ -174,30 +372,16 @@ const extrusion = extrude(5, sketch001)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Base",
|
||||
}],
|
||||
// The x-axis of the sketch group base plane in the 3D space
|
||||
xAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
// The y-axis of the sketch group base plane in the 3D space
|
||||
yAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
// The z-axis of the sketch group base plane in the 3D space
|
||||
zAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
@ -9,7 +9,7 @@ Draw an angled line.
|
||||
|
||||
|
||||
```js
|
||||
angledLine(data: AngledLineData, sketch_group: SketchGroup, tag?: String) -> SketchGroup
|
||||
angledLine(data: AngledLineData, sketch_group: SketchGroup, tag?: TagDeclarator) -> SketchGroup
|
||||
```
|
||||
|
||||
### Examples
|
||||
@ -43,8 +43,6 @@ const example = extrude(10, exampleSketch)
|
||||
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
|
||||
```js
|
||||
{
|
||||
// The plane id or face id of the sketch group.
|
||||
entityId: uuid,
|
||||
// The id of the sketch group.
|
||||
id: uuid,
|
||||
// What the sketch is on (can be a plane or a face).
|
||||
@ -80,12 +78,184 @@ const example = extrude(10, exampleSketch)
|
||||
},
|
||||
} |
|
||||
{
|
||||
// the face id the sketch is on
|
||||
// The extrude group the face is on.
|
||||
extrudeGroup: {
|
||||
// The id of the extrusion end cap
|
||||
endCapId: uuid,
|
||||
// Chamfers or fillets on this extrude group.
|
||||
filletOrChamfers: [{
|
||||
// The engine id of the edge to fillet.
|
||||
edge_id: uuid,
|
||||
// The id of the engine command that called this fillet.
|
||||
id: uuid,
|
||||
radius: number,
|
||||
type: "fillet",
|
||||
} |
|
||||
{
|
||||
// The engine id of the edge to chamfer.
|
||||
edge_id: uuid,
|
||||
// The id of the engine command that called this chamfer.
|
||||
id: uuid,
|
||||
length: number,
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "chamfer",
|
||||
}],
|
||||
// The height of the extrude group.
|
||||
height: number,
|
||||
// The id of the extrude group.
|
||||
id: uuid,
|
||||
// The sketch group.
|
||||
sketchGroup: {
|
||||
// The id of the sketch group.
|
||||
id: uuid,
|
||||
// What the sketch is on (can be a plane or a face).
|
||||
on: SketchSurface,
|
||||
// The starting path.
|
||||
start: {
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
},
|
||||
// Tag identifiers that have been declared in this sketch group.
|
||||
tags: {
|
||||
},
|
||||
// The paths in the sketch group.
|
||||
value: [{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "ToPoint",
|
||||
} |
|
||||
{
|
||||
// arc's direction
|
||||
ccw: string,
|
||||
// the arc's center
|
||||
center: [number, number],
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArcTo",
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArc",
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Horizontal",
|
||||
// The x coordinate.
|
||||
x: number,
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "AngledLineTo",
|
||||
// The x coordinate.
|
||||
x: number,
|
||||
// The y coordinate.
|
||||
y: number,
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Base",
|
||||
}],
|
||||
},
|
||||
// The id of the extrusion start cap
|
||||
startCapId: uuid,
|
||||
// The extrude surfaces.
|
||||
value: [{
|
||||
// The face id for the extrude plane.
|
||||
faceId: uuid,
|
||||
// The id of the geometry.
|
||||
id: uuid,
|
||||
// The source range.
|
||||
sourceRange: [number, number],
|
||||
// The tag.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "extrudePlane",
|
||||
} |
|
||||
{
|
||||
// The face id for the extrude plane.
|
||||
faceId: uuid,
|
||||
// The id of the geometry.
|
||||
id: uuid,
|
||||
// The source range.
|
||||
sourceRange: [number, number],
|
||||
// The tag.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "extrudeArc",
|
||||
}],
|
||||
},
|
||||
// The id of the face.
|
||||
id: uuid,
|
||||
// The original sketch group id of the object we are sketching on.
|
||||
sketchGroupId: uuid,
|
||||
type: "face",
|
||||
// The tag of the face.
|
||||
value: string,
|
||||
@ -108,25 +278,32 @@ const example = extrude(10, exampleSketch)
|
||||
z: number,
|
||||
},
|
||||
},
|
||||
// The position of the sketch group.
|
||||
position: [number, number, number],
|
||||
// The rotation of the sketch group base plane.
|
||||
rotation: [number, number, number, number],
|
||||
// The starting path.
|
||||
start: {
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
},
|
||||
// Tag identifiers that have been declared in this sketch group.
|
||||
tags: {
|
||||
},
|
||||
// The paths in the sketch group.
|
||||
value: [{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "ToPoint",
|
||||
@ -138,8 +315,12 @@ const example = extrude(10, exampleSketch)
|
||||
center: [number, number],
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArcTo",
|
||||
@ -147,8 +328,12 @@ const example = extrude(10, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArc",
|
||||
@ -156,8 +341,12 @@ const example = extrude(10, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Horizontal",
|
||||
@ -167,8 +356,12 @@ const example = extrude(10, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "AngledLineTo",
|
||||
@ -180,41 +373,32 @@ const example = extrude(10, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Base",
|
||||
}],
|
||||
// The x-axis of the sketch group base plane in the 3D space
|
||||
xAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
// The y-axis of the sketch group base plane in the 3D space
|
||||
yAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
// The z-axis of the sketch group base plane in the 3D space
|
||||
zAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
}
|
||||
```
|
||||
* `tag`: `String` (OPTIONAL)
|
||||
* `tag`: `TagDeclarator` (OPTIONAL)
|
||||
```js
|
||||
{
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
}
|
||||
```
|
||||
|
||||
### Returns
|
||||
|
||||
`SketchGroup` - A sketch group is a collection of paths.
|
||||
```js
|
||||
{
|
||||
// The plane id or face id of the sketch group.
|
||||
entityId: uuid,
|
||||
// The id of the sketch group.
|
||||
id: uuid,
|
||||
// What the sketch is on (can be a plane or a face).
|
||||
@ -250,12 +434,184 @@ const example = extrude(10, exampleSketch)
|
||||
},
|
||||
} |
|
||||
{
|
||||
// the face id the sketch is on
|
||||
// The extrude group the face is on.
|
||||
extrudeGroup: {
|
||||
// The id of the extrusion end cap
|
||||
endCapId: uuid,
|
||||
// Chamfers or fillets on this extrude group.
|
||||
filletOrChamfers: [{
|
||||
// The engine id of the edge to fillet.
|
||||
edge_id: uuid,
|
||||
// The id of the engine command that called this fillet.
|
||||
id: uuid,
|
||||
radius: number,
|
||||
type: "fillet",
|
||||
} |
|
||||
{
|
||||
// The engine id of the edge to chamfer.
|
||||
edge_id: uuid,
|
||||
// The id of the engine command that called this chamfer.
|
||||
id: uuid,
|
||||
length: number,
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "chamfer",
|
||||
}],
|
||||
// The height of the extrude group.
|
||||
height: number,
|
||||
// The id of the extrude group.
|
||||
id: uuid,
|
||||
// The sketch group.
|
||||
sketchGroup: {
|
||||
// The id of the sketch group.
|
||||
id: uuid,
|
||||
// What the sketch is on (can be a plane or a face).
|
||||
on: SketchSurface,
|
||||
// The starting path.
|
||||
start: {
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
},
|
||||
// Tag identifiers that have been declared in this sketch group.
|
||||
tags: {
|
||||
},
|
||||
// The paths in the sketch group.
|
||||
value: [{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "ToPoint",
|
||||
} |
|
||||
{
|
||||
// arc's direction
|
||||
ccw: string,
|
||||
// the arc's center
|
||||
center: [number, number],
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArcTo",
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArc",
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Horizontal",
|
||||
// The x coordinate.
|
||||
x: number,
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "AngledLineTo",
|
||||
// The x coordinate.
|
||||
x: number,
|
||||
// The y coordinate.
|
||||
y: number,
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Base",
|
||||
}],
|
||||
},
|
||||
// The id of the extrusion start cap
|
||||
startCapId: uuid,
|
||||
// The extrude surfaces.
|
||||
value: [{
|
||||
// The face id for the extrude plane.
|
||||
faceId: uuid,
|
||||
// The id of the geometry.
|
||||
id: uuid,
|
||||
// The source range.
|
||||
sourceRange: [number, number],
|
||||
// The tag.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "extrudePlane",
|
||||
} |
|
||||
{
|
||||
// The face id for the extrude plane.
|
||||
faceId: uuid,
|
||||
// The id of the geometry.
|
||||
id: uuid,
|
||||
// The source range.
|
||||
sourceRange: [number, number],
|
||||
// The tag.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "extrudeArc",
|
||||
}],
|
||||
},
|
||||
// The id of the face.
|
||||
id: uuid,
|
||||
// The original sketch group id of the object we are sketching on.
|
||||
sketchGroupId: uuid,
|
||||
type: "face",
|
||||
// The tag of the face.
|
||||
value: string,
|
||||
@ -278,25 +634,32 @@ const example = extrude(10, exampleSketch)
|
||||
z: number,
|
||||
},
|
||||
},
|
||||
// The position of the sketch group.
|
||||
position: [number, number, number],
|
||||
// The rotation of the sketch group base plane.
|
||||
rotation: [number, number, number, number],
|
||||
// The starting path.
|
||||
start: {
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
},
|
||||
// Tag identifiers that have been declared in this sketch group.
|
||||
tags: {
|
||||
},
|
||||
// The paths in the sketch group.
|
||||
value: [{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "ToPoint",
|
||||
@ -308,8 +671,12 @@ const example = extrude(10, exampleSketch)
|
||||
center: [number, number],
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArcTo",
|
||||
@ -317,8 +684,12 @@ const example = extrude(10, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArc",
|
||||
@ -326,8 +697,12 @@ const example = extrude(10, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Horizontal",
|
||||
@ -337,8 +712,12 @@ const example = extrude(10, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "AngledLineTo",
|
||||
@ -350,30 +729,16 @@ const example = extrude(10, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Base",
|
||||
}],
|
||||
// The x-axis of the sketch group base plane in the 3D space
|
||||
xAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
// The y-axis of the sketch group base plane in the 3D space
|
||||
yAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
// The z-axis of the sketch group base plane in the 3D space
|
||||
zAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
@ -9,7 +9,7 @@ Draw an angled line of a given x length.
|
||||
|
||||
|
||||
```js
|
||||
angledLineOfXLength(data: AngledLineData, sketch_group: SketchGroup, tag?: String) -> SketchGroup
|
||||
angledLineOfXLength(data: AngledLineData, sketch_group: SketchGroup, tag?: TagDeclarator) -> SketchGroup
|
||||
```
|
||||
|
||||
### Examples
|
||||
@ -17,10 +17,10 @@ angledLineOfXLength(data: AngledLineData, sketch_group: SketchGroup, tag?: Strin
|
||||
```js
|
||||
const sketch001 = startSketchOn('XZ')
|
||||
|> startProfileAt([0, 0], %)
|
||||
|> angledLineOfXLength({ angle: 45, length: 10 }, %, "edge1")
|
||||
|> angledLineOfXLength({ angle: -15, length: 20 }, %, "edge2")
|
||||
|> angledLineOfXLength({ angle: 45, length: 10 }, %, $edge1)
|
||||
|> angledLineOfXLength({ angle: -15, length: 20 }, %, $edge2)
|
||||
|> line([0, -5], %)
|
||||
|> close(%, "edge3")
|
||||
|> close(%, $edge3)
|
||||
|
||||
const extrusion = extrude(10, sketch001)
|
||||
```
|
||||
@ -42,8 +42,6 @@ const extrusion = extrude(10, sketch001)
|
||||
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
|
||||
```js
|
||||
{
|
||||
// The plane id or face id of the sketch group.
|
||||
entityId: uuid,
|
||||
// The id of the sketch group.
|
||||
id: uuid,
|
||||
// What the sketch is on (can be a plane or a face).
|
||||
@ -79,12 +77,184 @@ const extrusion = extrude(10, sketch001)
|
||||
},
|
||||
} |
|
||||
{
|
||||
// the face id the sketch is on
|
||||
// The extrude group the face is on.
|
||||
extrudeGroup: {
|
||||
// The id of the extrusion end cap
|
||||
endCapId: uuid,
|
||||
// Chamfers or fillets on this extrude group.
|
||||
filletOrChamfers: [{
|
||||
// The engine id of the edge to fillet.
|
||||
edge_id: uuid,
|
||||
// The id of the engine command that called this fillet.
|
||||
id: uuid,
|
||||
radius: number,
|
||||
type: "fillet",
|
||||
} |
|
||||
{
|
||||
// The engine id of the edge to chamfer.
|
||||
edge_id: uuid,
|
||||
// The id of the engine command that called this chamfer.
|
||||
id: uuid,
|
||||
length: number,
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "chamfer",
|
||||
}],
|
||||
// The height of the extrude group.
|
||||
height: number,
|
||||
// The id of the extrude group.
|
||||
id: uuid,
|
||||
// The sketch group.
|
||||
sketchGroup: {
|
||||
// The id of the sketch group.
|
||||
id: uuid,
|
||||
// What the sketch is on (can be a plane or a face).
|
||||
on: SketchSurface,
|
||||
// The starting path.
|
||||
start: {
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
},
|
||||
// Tag identifiers that have been declared in this sketch group.
|
||||
tags: {
|
||||
},
|
||||
// The paths in the sketch group.
|
||||
value: [{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "ToPoint",
|
||||
} |
|
||||
{
|
||||
// arc's direction
|
||||
ccw: string,
|
||||
// the arc's center
|
||||
center: [number, number],
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArcTo",
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArc",
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Horizontal",
|
||||
// The x coordinate.
|
||||
x: number,
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "AngledLineTo",
|
||||
// The x coordinate.
|
||||
x: number,
|
||||
// The y coordinate.
|
||||
y: number,
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Base",
|
||||
}],
|
||||
},
|
||||
// The id of the extrusion start cap
|
||||
startCapId: uuid,
|
||||
// The extrude surfaces.
|
||||
value: [{
|
||||
// The face id for the extrude plane.
|
||||
faceId: uuid,
|
||||
// The id of the geometry.
|
||||
id: uuid,
|
||||
// The source range.
|
||||
sourceRange: [number, number],
|
||||
// The tag.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "extrudePlane",
|
||||
} |
|
||||
{
|
||||
// The face id for the extrude plane.
|
||||
faceId: uuid,
|
||||
// The id of the geometry.
|
||||
id: uuid,
|
||||
// The source range.
|
||||
sourceRange: [number, number],
|
||||
// The tag.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "extrudeArc",
|
||||
}],
|
||||
},
|
||||
// The id of the face.
|
||||
id: uuid,
|
||||
// The original sketch group id of the object we are sketching on.
|
||||
sketchGroupId: uuid,
|
||||
type: "face",
|
||||
// The tag of the face.
|
||||
value: string,
|
||||
@ -107,25 +277,32 @@ const extrusion = extrude(10, sketch001)
|
||||
z: number,
|
||||
},
|
||||
},
|
||||
// The position of the sketch group.
|
||||
position: [number, number, number],
|
||||
// The rotation of the sketch group base plane.
|
||||
rotation: [number, number, number, number],
|
||||
// The starting path.
|
||||
start: {
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
},
|
||||
// Tag identifiers that have been declared in this sketch group.
|
||||
tags: {
|
||||
},
|
||||
// The paths in the sketch group.
|
||||
value: [{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "ToPoint",
|
||||
@ -137,8 +314,12 @@ const extrusion = extrude(10, sketch001)
|
||||
center: [number, number],
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArcTo",
|
||||
@ -146,8 +327,12 @@ const extrusion = extrude(10, sketch001)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArc",
|
||||
@ -155,8 +340,12 @@ const extrusion = extrude(10, sketch001)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Horizontal",
|
||||
@ -166,8 +355,12 @@ const extrusion = extrude(10, sketch001)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "AngledLineTo",
|
||||
@ -179,41 +372,32 @@ const extrusion = extrude(10, sketch001)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Base",
|
||||
}],
|
||||
// The x-axis of the sketch group base plane in the 3D space
|
||||
xAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
// The y-axis of the sketch group base plane in the 3D space
|
||||
yAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
// The z-axis of the sketch group base plane in the 3D space
|
||||
zAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
}
|
||||
```
|
||||
* `tag`: `String` (OPTIONAL)
|
||||
* `tag`: `TagDeclarator` (OPTIONAL)
|
||||
```js
|
||||
{
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
}
|
||||
```
|
||||
|
||||
### Returns
|
||||
|
||||
`SketchGroup` - A sketch group is a collection of paths.
|
||||
```js
|
||||
{
|
||||
// The plane id or face id of the sketch group.
|
||||
entityId: uuid,
|
||||
// The id of the sketch group.
|
||||
id: uuid,
|
||||
// What the sketch is on (can be a plane or a face).
|
||||
@ -249,12 +433,184 @@ const extrusion = extrude(10, sketch001)
|
||||
},
|
||||
} |
|
||||
{
|
||||
// the face id the sketch is on
|
||||
// The extrude group the face is on.
|
||||
extrudeGroup: {
|
||||
// The id of the extrusion end cap
|
||||
endCapId: uuid,
|
||||
// Chamfers or fillets on this extrude group.
|
||||
filletOrChamfers: [{
|
||||
// The engine id of the edge to fillet.
|
||||
edge_id: uuid,
|
||||
// The id of the engine command that called this fillet.
|
||||
id: uuid,
|
||||
radius: number,
|
||||
type: "fillet",
|
||||
} |
|
||||
{
|
||||
// The engine id of the edge to chamfer.
|
||||
edge_id: uuid,
|
||||
// The id of the engine command that called this chamfer.
|
||||
id: uuid,
|
||||
length: number,
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "chamfer",
|
||||
}],
|
||||
// The height of the extrude group.
|
||||
height: number,
|
||||
// The id of the extrude group.
|
||||
id: uuid,
|
||||
// The sketch group.
|
||||
sketchGroup: {
|
||||
// The id of the sketch group.
|
||||
id: uuid,
|
||||
// What the sketch is on (can be a plane or a face).
|
||||
on: SketchSurface,
|
||||
// The starting path.
|
||||
start: {
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
},
|
||||
// Tag identifiers that have been declared in this sketch group.
|
||||
tags: {
|
||||
},
|
||||
// The paths in the sketch group.
|
||||
value: [{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "ToPoint",
|
||||
} |
|
||||
{
|
||||
// arc's direction
|
||||
ccw: string,
|
||||
// the arc's center
|
||||
center: [number, number],
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArcTo",
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArc",
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Horizontal",
|
||||
// The x coordinate.
|
||||
x: number,
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "AngledLineTo",
|
||||
// The x coordinate.
|
||||
x: number,
|
||||
// The y coordinate.
|
||||
y: number,
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Base",
|
||||
}],
|
||||
},
|
||||
// The id of the extrusion start cap
|
||||
startCapId: uuid,
|
||||
// The extrude surfaces.
|
||||
value: [{
|
||||
// The face id for the extrude plane.
|
||||
faceId: uuid,
|
||||
// The id of the geometry.
|
||||
id: uuid,
|
||||
// The source range.
|
||||
sourceRange: [number, number],
|
||||
// The tag.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "extrudePlane",
|
||||
} |
|
||||
{
|
||||
// The face id for the extrude plane.
|
||||
faceId: uuid,
|
||||
// The id of the geometry.
|
||||
id: uuid,
|
||||
// The source range.
|
||||
sourceRange: [number, number],
|
||||
// The tag.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "extrudeArc",
|
||||
}],
|
||||
},
|
||||
// The id of the face.
|
||||
id: uuid,
|
||||
// The original sketch group id of the object we are sketching on.
|
||||
sketchGroupId: uuid,
|
||||
type: "face",
|
||||
// The tag of the face.
|
||||
value: string,
|
||||
@ -277,25 +633,32 @@ const extrusion = extrude(10, sketch001)
|
||||
z: number,
|
||||
},
|
||||
},
|
||||
// The position of the sketch group.
|
||||
position: [number, number, number],
|
||||
// The rotation of the sketch group base plane.
|
||||
rotation: [number, number, number, number],
|
||||
// The starting path.
|
||||
start: {
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
},
|
||||
// Tag identifiers that have been declared in this sketch group.
|
||||
tags: {
|
||||
},
|
||||
// The paths in the sketch group.
|
||||
value: [{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "ToPoint",
|
||||
@ -307,8 +670,12 @@ const extrusion = extrude(10, sketch001)
|
||||
center: [number, number],
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArcTo",
|
||||
@ -316,8 +683,12 @@ const extrusion = extrude(10, sketch001)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArc",
|
||||
@ -325,8 +696,12 @@ const extrusion = extrude(10, sketch001)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Horizontal",
|
||||
@ -336,8 +711,12 @@ const extrusion = extrude(10, sketch001)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "AngledLineTo",
|
||||
@ -349,30 +728,16 @@ const extrusion = extrude(10, sketch001)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Base",
|
||||
}],
|
||||
// The x-axis of the sketch group base plane in the 3D space
|
||||
xAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
// The y-axis of the sketch group base plane in the 3D space
|
||||
yAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
// The z-axis of the sketch group base plane in the 3D space
|
||||
zAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
@ -9,7 +9,7 @@ Draw an angled line that intersects with a given line.
|
||||
|
||||
|
||||
```js
|
||||
angledLineThatIntersects(data: AngledLineThatIntersectsData, sketch_group: SketchGroup, tag?: String) -> SketchGroup
|
||||
angledLineThatIntersects(data: AngledLineThatIntersectsData, sketch_group: SketchGroup, tag?: TagDeclarator) -> SketchGroup
|
||||
```
|
||||
|
||||
### Examples
|
||||
@ -18,7 +18,7 @@ angledLineThatIntersects(data: AngledLineThatIntersectsData, sketch_group: Sketc
|
||||
const exampleSketch = startSketchOn('XZ')
|
||||
|> startProfileAt([0, 0], %)
|
||||
|> lineTo([5, 10], %)
|
||||
|> lineTo([-10, 10], %, "lineToIntersect")
|
||||
|> lineTo([-10, 10], %, $lineToIntersect)
|
||||
|> lineTo([0, 20], %)
|
||||
|> angledLineThatIntersects({
|
||||
angle: 80,
|
||||
@ -40,7 +40,9 @@ const example = extrude(10, exampleSketch)
|
||||
// The angle of the line.
|
||||
angle: number,
|
||||
// The tag of the line to intersect with.
|
||||
intersectTag: string,
|
||||
intersectTag: {
|
||||
value: string,
|
||||
},
|
||||
// The offset from the intersecting line.
|
||||
offset: number,
|
||||
}
|
||||
@ -48,8 +50,6 @@ const example = extrude(10, exampleSketch)
|
||||
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
|
||||
```js
|
||||
{
|
||||
// The plane id or face id of the sketch group.
|
||||
entityId: uuid,
|
||||
// The id of the sketch group.
|
||||
id: uuid,
|
||||
// What the sketch is on (can be a plane or a face).
|
||||
@ -85,12 +85,184 @@ const example = extrude(10, exampleSketch)
|
||||
},
|
||||
} |
|
||||
{
|
||||
// the face id the sketch is on
|
||||
// The extrude group the face is on.
|
||||
extrudeGroup: {
|
||||
// The id of the extrusion end cap
|
||||
endCapId: uuid,
|
||||
// Chamfers or fillets on this extrude group.
|
||||
filletOrChamfers: [{
|
||||
// The engine id of the edge to fillet.
|
||||
edge_id: uuid,
|
||||
// The id of the engine command that called this fillet.
|
||||
id: uuid,
|
||||
radius: number,
|
||||
type: "fillet",
|
||||
} |
|
||||
{
|
||||
// The engine id of the edge to chamfer.
|
||||
edge_id: uuid,
|
||||
// The id of the engine command that called this chamfer.
|
||||
id: uuid,
|
||||
length: number,
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "chamfer",
|
||||
}],
|
||||
// The height of the extrude group.
|
||||
height: number,
|
||||
// The id of the extrude group.
|
||||
id: uuid,
|
||||
// The sketch group.
|
||||
sketchGroup: {
|
||||
// The id of the sketch group.
|
||||
id: uuid,
|
||||
// What the sketch is on (can be a plane or a face).
|
||||
on: SketchSurface,
|
||||
// The starting path.
|
||||
start: {
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
},
|
||||
// Tag identifiers that have been declared in this sketch group.
|
||||
tags: {
|
||||
},
|
||||
// The paths in the sketch group.
|
||||
value: [{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "ToPoint",
|
||||
} |
|
||||
{
|
||||
// arc's direction
|
||||
ccw: string,
|
||||
// the arc's center
|
||||
center: [number, number],
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArcTo",
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArc",
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Horizontal",
|
||||
// The x coordinate.
|
||||
x: number,
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "AngledLineTo",
|
||||
// The x coordinate.
|
||||
x: number,
|
||||
// The y coordinate.
|
||||
y: number,
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Base",
|
||||
}],
|
||||
},
|
||||
// The id of the extrusion start cap
|
||||
startCapId: uuid,
|
||||
// The extrude surfaces.
|
||||
value: [{
|
||||
// The face id for the extrude plane.
|
||||
faceId: uuid,
|
||||
// The id of the geometry.
|
||||
id: uuid,
|
||||
// The source range.
|
||||
sourceRange: [number, number],
|
||||
// The tag.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "extrudePlane",
|
||||
} |
|
||||
{
|
||||
// The face id for the extrude plane.
|
||||
faceId: uuid,
|
||||
// The id of the geometry.
|
||||
id: uuid,
|
||||
// The source range.
|
||||
sourceRange: [number, number],
|
||||
// The tag.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "extrudeArc",
|
||||
}],
|
||||
},
|
||||
// The id of the face.
|
||||
id: uuid,
|
||||
// The original sketch group id of the object we are sketching on.
|
||||
sketchGroupId: uuid,
|
||||
type: "face",
|
||||
// The tag of the face.
|
||||
value: string,
|
||||
@ -113,25 +285,32 @@ const example = extrude(10, exampleSketch)
|
||||
z: number,
|
||||
},
|
||||
},
|
||||
// The position of the sketch group.
|
||||
position: [number, number, number],
|
||||
// The rotation of the sketch group base plane.
|
||||
rotation: [number, number, number, number],
|
||||
// The starting path.
|
||||
start: {
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
},
|
||||
// Tag identifiers that have been declared in this sketch group.
|
||||
tags: {
|
||||
},
|
||||
// The paths in the sketch group.
|
||||
value: [{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "ToPoint",
|
||||
@ -143,8 +322,12 @@ const example = extrude(10, exampleSketch)
|
||||
center: [number, number],
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArcTo",
|
||||
@ -152,8 +335,12 @@ const example = extrude(10, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArc",
|
||||
@ -161,8 +348,12 @@ const example = extrude(10, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Horizontal",
|
||||
@ -172,8 +363,12 @@ const example = extrude(10, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "AngledLineTo",
|
||||
@ -185,41 +380,32 @@ const example = extrude(10, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Base",
|
||||
}],
|
||||
// The x-axis of the sketch group base plane in the 3D space
|
||||
xAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
// The y-axis of the sketch group base plane in the 3D space
|
||||
yAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
// The z-axis of the sketch group base plane in the 3D space
|
||||
zAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
}
|
||||
```
|
||||
* `tag`: `String` (OPTIONAL)
|
||||
* `tag`: `TagDeclarator` (OPTIONAL)
|
||||
```js
|
||||
{
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
}
|
||||
```
|
||||
|
||||
### Returns
|
||||
|
||||
`SketchGroup` - A sketch group is a collection of paths.
|
||||
```js
|
||||
{
|
||||
// The plane id or face id of the sketch group.
|
||||
entityId: uuid,
|
||||
// The id of the sketch group.
|
||||
id: uuid,
|
||||
// What the sketch is on (can be a plane or a face).
|
||||
@ -255,12 +441,184 @@ const example = extrude(10, exampleSketch)
|
||||
},
|
||||
} |
|
||||
{
|
||||
// the face id the sketch is on
|
||||
// The extrude group the face is on.
|
||||
extrudeGroup: {
|
||||
// The id of the extrusion end cap
|
||||
endCapId: uuid,
|
||||
// Chamfers or fillets on this extrude group.
|
||||
filletOrChamfers: [{
|
||||
// The engine id of the edge to fillet.
|
||||
edge_id: uuid,
|
||||
// The id of the engine command that called this fillet.
|
||||
id: uuid,
|
||||
radius: number,
|
||||
type: "fillet",
|
||||
} |
|
||||
{
|
||||
// The engine id of the edge to chamfer.
|
||||
edge_id: uuid,
|
||||
// The id of the engine command that called this chamfer.
|
||||
id: uuid,
|
||||
length: number,
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "chamfer",
|
||||
}],
|
||||
// The height of the extrude group.
|
||||
height: number,
|
||||
// The id of the extrude group.
|
||||
id: uuid,
|
||||
// The sketch group.
|
||||
sketchGroup: {
|
||||
// The id of the sketch group.
|
||||
id: uuid,
|
||||
// What the sketch is on (can be a plane or a face).
|
||||
on: SketchSurface,
|
||||
// The starting path.
|
||||
start: {
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
},
|
||||
// Tag identifiers that have been declared in this sketch group.
|
||||
tags: {
|
||||
},
|
||||
// The paths in the sketch group.
|
||||
value: [{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "ToPoint",
|
||||
} |
|
||||
{
|
||||
// arc's direction
|
||||
ccw: string,
|
||||
// the arc's center
|
||||
center: [number, number],
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArcTo",
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArc",
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Horizontal",
|
||||
// The x coordinate.
|
||||
x: number,
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "AngledLineTo",
|
||||
// The x coordinate.
|
||||
x: number,
|
||||
// The y coordinate.
|
||||
y: number,
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Base",
|
||||
}],
|
||||
},
|
||||
// The id of the extrusion start cap
|
||||
startCapId: uuid,
|
||||
// The extrude surfaces.
|
||||
value: [{
|
||||
// The face id for the extrude plane.
|
||||
faceId: uuid,
|
||||
// The id of the geometry.
|
||||
id: uuid,
|
||||
// The source range.
|
||||
sourceRange: [number, number],
|
||||
// The tag.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "extrudePlane",
|
||||
} |
|
||||
{
|
||||
// The face id for the extrude plane.
|
||||
faceId: uuid,
|
||||
// The id of the geometry.
|
||||
id: uuid,
|
||||
// The source range.
|
||||
sourceRange: [number, number],
|
||||
// The tag.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "extrudeArc",
|
||||
}],
|
||||
},
|
||||
// The id of the face.
|
||||
id: uuid,
|
||||
// The original sketch group id of the object we are sketching on.
|
||||
sketchGroupId: uuid,
|
||||
type: "face",
|
||||
// The tag of the face.
|
||||
value: string,
|
||||
@ -283,25 +641,32 @@ const example = extrude(10, exampleSketch)
|
||||
z: number,
|
||||
},
|
||||
},
|
||||
// The position of the sketch group.
|
||||
position: [number, number, number],
|
||||
// The rotation of the sketch group base plane.
|
||||
rotation: [number, number, number, number],
|
||||
// The starting path.
|
||||
start: {
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
},
|
||||
// Tag identifiers that have been declared in this sketch group.
|
||||
tags: {
|
||||
},
|
||||
// The paths in the sketch group.
|
||||
value: [{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "ToPoint",
|
||||
@ -313,8 +678,12 @@ const example = extrude(10, exampleSketch)
|
||||
center: [number, number],
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArcTo",
|
||||
@ -322,8 +691,12 @@ const example = extrude(10, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArc",
|
||||
@ -331,8 +704,12 @@ const example = extrude(10, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Horizontal",
|
||||
@ -342,8 +719,12 @@ const example = extrude(10, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "AngledLineTo",
|
||||
@ -355,30 +736,16 @@ const example = extrude(10, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Base",
|
||||
}],
|
||||
// The x-axis of the sketch group base plane in the 3D space
|
||||
xAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
// The y-axis of the sketch group base plane in the 3D space
|
||||
yAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
// The z-axis of the sketch group base plane in the 3D space
|
||||
zAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
@ -9,7 +9,7 @@ Draw an angled line to a given x coordinate.
|
||||
|
||||
|
||||
```js
|
||||
angledLineToX(data: AngledLineToData, sketch_group: SketchGroup, tag?: String) -> SketchGroup
|
||||
angledLineToX(data: AngledLineToData, sketch_group: SketchGroup, tag?: TagDeclarator) -> SketchGroup
|
||||
```
|
||||
|
||||
### Examples
|
||||
@ -41,8 +41,6 @@ const example = extrude(10, exampleSketch)
|
||||
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
|
||||
```js
|
||||
{
|
||||
// The plane id or face id of the sketch group.
|
||||
entityId: uuid,
|
||||
// The id of the sketch group.
|
||||
id: uuid,
|
||||
// What the sketch is on (can be a plane or a face).
|
||||
@ -78,12 +76,184 @@ const example = extrude(10, exampleSketch)
|
||||
},
|
||||
} |
|
||||
{
|
||||
// the face id the sketch is on
|
||||
// The extrude group the face is on.
|
||||
extrudeGroup: {
|
||||
// The id of the extrusion end cap
|
||||
endCapId: uuid,
|
||||
// Chamfers or fillets on this extrude group.
|
||||
filletOrChamfers: [{
|
||||
// The engine id of the edge to fillet.
|
||||
edge_id: uuid,
|
||||
// The id of the engine command that called this fillet.
|
||||
id: uuid,
|
||||
radius: number,
|
||||
type: "fillet",
|
||||
} |
|
||||
{
|
||||
// The engine id of the edge to chamfer.
|
||||
edge_id: uuid,
|
||||
// The id of the engine command that called this chamfer.
|
||||
id: uuid,
|
||||
length: number,
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "chamfer",
|
||||
}],
|
||||
// The height of the extrude group.
|
||||
height: number,
|
||||
// The id of the extrude group.
|
||||
id: uuid,
|
||||
// The sketch group.
|
||||
sketchGroup: {
|
||||
// The id of the sketch group.
|
||||
id: uuid,
|
||||
// What the sketch is on (can be a plane or a face).
|
||||
on: SketchSurface,
|
||||
// The starting path.
|
||||
start: {
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
},
|
||||
// Tag identifiers that have been declared in this sketch group.
|
||||
tags: {
|
||||
},
|
||||
// The paths in the sketch group.
|
||||
value: [{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "ToPoint",
|
||||
} |
|
||||
{
|
||||
// arc's direction
|
||||
ccw: string,
|
||||
// the arc's center
|
||||
center: [number, number],
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArcTo",
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArc",
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Horizontal",
|
||||
// The x coordinate.
|
||||
x: number,
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "AngledLineTo",
|
||||
// The x coordinate.
|
||||
x: number,
|
||||
// The y coordinate.
|
||||
y: number,
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Base",
|
||||
}],
|
||||
},
|
||||
// The id of the extrusion start cap
|
||||
startCapId: uuid,
|
||||
// The extrude surfaces.
|
||||
value: [{
|
||||
// The face id for the extrude plane.
|
||||
faceId: uuid,
|
||||
// The id of the geometry.
|
||||
id: uuid,
|
||||
// The source range.
|
||||
sourceRange: [number, number],
|
||||
// The tag.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "extrudePlane",
|
||||
} |
|
||||
{
|
||||
// The face id for the extrude plane.
|
||||
faceId: uuid,
|
||||
// The id of the geometry.
|
||||
id: uuid,
|
||||
// The source range.
|
||||
sourceRange: [number, number],
|
||||
// The tag.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "extrudeArc",
|
||||
}],
|
||||
},
|
||||
// The id of the face.
|
||||
id: uuid,
|
||||
// The original sketch group id of the object we are sketching on.
|
||||
sketchGroupId: uuid,
|
||||
type: "face",
|
||||
// The tag of the face.
|
||||
value: string,
|
||||
@ -106,25 +276,32 @@ const example = extrude(10, exampleSketch)
|
||||
z: number,
|
||||
},
|
||||
},
|
||||
// The position of the sketch group.
|
||||
position: [number, number, number],
|
||||
// The rotation of the sketch group base plane.
|
||||
rotation: [number, number, number, number],
|
||||
// The starting path.
|
||||
start: {
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
},
|
||||
// Tag identifiers that have been declared in this sketch group.
|
||||
tags: {
|
||||
},
|
||||
// The paths in the sketch group.
|
||||
value: [{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "ToPoint",
|
||||
@ -136,8 +313,12 @@ const example = extrude(10, exampleSketch)
|
||||
center: [number, number],
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArcTo",
|
||||
@ -145,8 +326,12 @@ const example = extrude(10, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArc",
|
||||
@ -154,8 +339,12 @@ const example = extrude(10, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Horizontal",
|
||||
@ -165,8 +354,12 @@ const example = extrude(10, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "AngledLineTo",
|
||||
@ -178,41 +371,32 @@ const example = extrude(10, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Base",
|
||||
}],
|
||||
// The x-axis of the sketch group base plane in the 3D space
|
||||
xAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
// The y-axis of the sketch group base plane in the 3D space
|
||||
yAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
// The z-axis of the sketch group base plane in the 3D space
|
||||
zAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
}
|
||||
```
|
||||
* `tag`: `String` (OPTIONAL)
|
||||
* `tag`: `TagDeclarator` (OPTIONAL)
|
||||
```js
|
||||
{
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
}
|
||||
```
|
||||
|
||||
### Returns
|
||||
|
||||
`SketchGroup` - A sketch group is a collection of paths.
|
||||
```js
|
||||
{
|
||||
// The plane id or face id of the sketch group.
|
||||
entityId: uuid,
|
||||
// The id of the sketch group.
|
||||
id: uuid,
|
||||
// What the sketch is on (can be a plane or a face).
|
||||
@ -248,12 +432,184 @@ const example = extrude(10, exampleSketch)
|
||||
},
|
||||
} |
|
||||
{
|
||||
// the face id the sketch is on
|
||||
// The extrude group the face is on.
|
||||
extrudeGroup: {
|
||||
// The id of the extrusion end cap
|
||||
endCapId: uuid,
|
||||
// Chamfers or fillets on this extrude group.
|
||||
filletOrChamfers: [{
|
||||
// The engine id of the edge to fillet.
|
||||
edge_id: uuid,
|
||||
// The id of the engine command that called this fillet.
|
||||
id: uuid,
|
||||
radius: number,
|
||||
type: "fillet",
|
||||
} |
|
||||
{
|
||||
// The engine id of the edge to chamfer.
|
||||
edge_id: uuid,
|
||||
// The id of the engine command that called this chamfer.
|
||||
id: uuid,
|
||||
length: number,
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "chamfer",
|
||||
}],
|
||||
// The height of the extrude group.
|
||||
height: number,
|
||||
// The id of the extrude group.
|
||||
id: uuid,
|
||||
// The sketch group.
|
||||
sketchGroup: {
|
||||
// The id of the sketch group.
|
||||
id: uuid,
|
||||
// What the sketch is on (can be a plane or a face).
|
||||
on: SketchSurface,
|
||||
// The starting path.
|
||||
start: {
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
},
|
||||
// Tag identifiers that have been declared in this sketch group.
|
||||
tags: {
|
||||
},
|
||||
// The paths in the sketch group.
|
||||
value: [{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "ToPoint",
|
||||
} |
|
||||
{
|
||||
// arc's direction
|
||||
ccw: string,
|
||||
// the arc's center
|
||||
center: [number, number],
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArcTo",
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArc",
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Horizontal",
|
||||
// The x coordinate.
|
||||
x: number,
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "AngledLineTo",
|
||||
// The x coordinate.
|
||||
x: number,
|
||||
// The y coordinate.
|
||||
y: number,
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Base",
|
||||
}],
|
||||
},
|
||||
// The id of the extrusion start cap
|
||||
startCapId: uuid,
|
||||
// The extrude surfaces.
|
||||
value: [{
|
||||
// The face id for the extrude plane.
|
||||
faceId: uuid,
|
||||
// The id of the geometry.
|
||||
id: uuid,
|
||||
// The source range.
|
||||
sourceRange: [number, number],
|
||||
// The tag.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "extrudePlane",
|
||||
} |
|
||||
{
|
||||
// The face id for the extrude plane.
|
||||
faceId: uuid,
|
||||
// The id of the geometry.
|
||||
id: uuid,
|
||||
// The source range.
|
||||
sourceRange: [number, number],
|
||||
// The tag.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "extrudeArc",
|
||||
}],
|
||||
},
|
||||
// The id of the face.
|
||||
id: uuid,
|
||||
// The original sketch group id of the object we are sketching on.
|
||||
sketchGroupId: uuid,
|
||||
type: "face",
|
||||
// The tag of the face.
|
||||
value: string,
|
||||
@ -276,25 +632,32 @@ const example = extrude(10, exampleSketch)
|
||||
z: number,
|
||||
},
|
||||
},
|
||||
// The position of the sketch group.
|
||||
position: [number, number, number],
|
||||
// The rotation of the sketch group base plane.
|
||||
rotation: [number, number, number, number],
|
||||
// The starting path.
|
||||
start: {
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
},
|
||||
// Tag identifiers that have been declared in this sketch group.
|
||||
tags: {
|
||||
},
|
||||
// The paths in the sketch group.
|
||||
value: [{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "ToPoint",
|
||||
@ -306,8 +669,12 @@ const example = extrude(10, exampleSketch)
|
||||
center: [number, number],
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArcTo",
|
||||
@ -315,8 +682,12 @@ const example = extrude(10, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArc",
|
||||
@ -324,8 +695,12 @@ const example = extrude(10, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Horizontal",
|
||||
@ -335,8 +710,12 @@ const example = extrude(10, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "AngledLineTo",
|
||||
@ -348,30 +727,16 @@ const example = extrude(10, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Base",
|
||||
}],
|
||||
// The x-axis of the sketch group base plane in the 3D space
|
||||
xAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
// The y-axis of the sketch group base plane in the 3D space
|
||||
yAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
// The z-axis of the sketch group base plane in the 3D space
|
||||
zAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
@ -9,7 +9,7 @@ Draw an angled line to a given y coordinate.
|
||||
|
||||
|
||||
```js
|
||||
angledLineToY(data: AngledLineToData, sketch_group: SketchGroup, tag?: String) -> SketchGroup
|
||||
angledLineToY(data: AngledLineToData, sketch_group: SketchGroup, tag?: TagDeclarator) -> SketchGroup
|
||||
```
|
||||
|
||||
### Examples
|
||||
@ -41,8 +41,6 @@ const example = extrude(10, exampleSketch)
|
||||
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
|
||||
```js
|
||||
{
|
||||
// The plane id or face id of the sketch group.
|
||||
entityId: uuid,
|
||||
// The id of the sketch group.
|
||||
id: uuid,
|
||||
// What the sketch is on (can be a plane or a face).
|
||||
@ -78,12 +76,184 @@ const example = extrude(10, exampleSketch)
|
||||
},
|
||||
} |
|
||||
{
|
||||
// the face id the sketch is on
|
||||
// The extrude group the face is on.
|
||||
extrudeGroup: {
|
||||
// The id of the extrusion end cap
|
||||
endCapId: uuid,
|
||||
// Chamfers or fillets on this extrude group.
|
||||
filletOrChamfers: [{
|
||||
// The engine id of the edge to fillet.
|
||||
edge_id: uuid,
|
||||
// The id of the engine command that called this fillet.
|
||||
id: uuid,
|
||||
radius: number,
|
||||
type: "fillet",
|
||||
} |
|
||||
{
|
||||
// The engine id of the edge to chamfer.
|
||||
edge_id: uuid,
|
||||
// The id of the engine command that called this chamfer.
|
||||
id: uuid,
|
||||
length: number,
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "chamfer",
|
||||
}],
|
||||
// The height of the extrude group.
|
||||
height: number,
|
||||
// The id of the extrude group.
|
||||
id: uuid,
|
||||
// The sketch group.
|
||||
sketchGroup: {
|
||||
// The id of the sketch group.
|
||||
id: uuid,
|
||||
// What the sketch is on (can be a plane or a face).
|
||||
on: SketchSurface,
|
||||
// The starting path.
|
||||
start: {
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
},
|
||||
// Tag identifiers that have been declared in this sketch group.
|
||||
tags: {
|
||||
},
|
||||
// The paths in the sketch group.
|
||||
value: [{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "ToPoint",
|
||||
} |
|
||||
{
|
||||
// arc's direction
|
||||
ccw: string,
|
||||
// the arc's center
|
||||
center: [number, number],
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArcTo",
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArc",
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Horizontal",
|
||||
// The x coordinate.
|
||||
x: number,
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "AngledLineTo",
|
||||
// The x coordinate.
|
||||
x: number,
|
||||
// The y coordinate.
|
||||
y: number,
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Base",
|
||||
}],
|
||||
},
|
||||
// The id of the extrusion start cap
|
||||
startCapId: uuid,
|
||||
// The extrude surfaces.
|
||||
value: [{
|
||||
// The face id for the extrude plane.
|
||||
faceId: uuid,
|
||||
// The id of the geometry.
|
||||
id: uuid,
|
||||
// The source range.
|
||||
sourceRange: [number, number],
|
||||
// The tag.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "extrudePlane",
|
||||
} |
|
||||
{
|
||||
// The face id for the extrude plane.
|
||||
faceId: uuid,
|
||||
// The id of the geometry.
|
||||
id: uuid,
|
||||
// The source range.
|
||||
sourceRange: [number, number],
|
||||
// The tag.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "extrudeArc",
|
||||
}],
|
||||
},
|
||||
// The id of the face.
|
||||
id: uuid,
|
||||
// The original sketch group id of the object we are sketching on.
|
||||
sketchGroupId: uuid,
|
||||
type: "face",
|
||||
// The tag of the face.
|
||||
value: string,
|
||||
@ -106,25 +276,32 @@ const example = extrude(10, exampleSketch)
|
||||
z: number,
|
||||
},
|
||||
},
|
||||
// The position of the sketch group.
|
||||
position: [number, number, number],
|
||||
// The rotation of the sketch group base plane.
|
||||
rotation: [number, number, number, number],
|
||||
// The starting path.
|
||||
start: {
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
},
|
||||
// Tag identifiers that have been declared in this sketch group.
|
||||
tags: {
|
||||
},
|
||||
// The paths in the sketch group.
|
||||
value: [{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "ToPoint",
|
||||
@ -136,8 +313,12 @@ const example = extrude(10, exampleSketch)
|
||||
center: [number, number],
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArcTo",
|
||||
@ -145,8 +326,12 @@ const example = extrude(10, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArc",
|
||||
@ -154,8 +339,12 @@ const example = extrude(10, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Horizontal",
|
||||
@ -165,8 +354,12 @@ const example = extrude(10, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "AngledLineTo",
|
||||
@ -178,41 +371,32 @@ const example = extrude(10, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Base",
|
||||
}],
|
||||
// The x-axis of the sketch group base plane in the 3D space
|
||||
xAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
// The y-axis of the sketch group base plane in the 3D space
|
||||
yAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
// The z-axis of the sketch group base plane in the 3D space
|
||||
zAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
}
|
||||
```
|
||||
* `tag`: `String` (OPTIONAL)
|
||||
* `tag`: `TagDeclarator` (OPTIONAL)
|
||||
```js
|
||||
{
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
}
|
||||
```
|
||||
|
||||
### Returns
|
||||
|
||||
`SketchGroup` - A sketch group is a collection of paths.
|
||||
```js
|
||||
{
|
||||
// The plane id or face id of the sketch group.
|
||||
entityId: uuid,
|
||||
// The id of the sketch group.
|
||||
id: uuid,
|
||||
// What the sketch is on (can be a plane or a face).
|
||||
@ -248,12 +432,184 @@ const example = extrude(10, exampleSketch)
|
||||
},
|
||||
} |
|
||||
{
|
||||
// the face id the sketch is on
|
||||
// The extrude group the face is on.
|
||||
extrudeGroup: {
|
||||
// The id of the extrusion end cap
|
||||
endCapId: uuid,
|
||||
// Chamfers or fillets on this extrude group.
|
||||
filletOrChamfers: [{
|
||||
// The engine id of the edge to fillet.
|
||||
edge_id: uuid,
|
||||
// The id of the engine command that called this fillet.
|
||||
id: uuid,
|
||||
radius: number,
|
||||
type: "fillet",
|
||||
} |
|
||||
{
|
||||
// The engine id of the edge to chamfer.
|
||||
edge_id: uuid,
|
||||
// The id of the engine command that called this chamfer.
|
||||
id: uuid,
|
||||
length: number,
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "chamfer",
|
||||
}],
|
||||
// The height of the extrude group.
|
||||
height: number,
|
||||
// The id of the extrude group.
|
||||
id: uuid,
|
||||
// The sketch group.
|
||||
sketchGroup: {
|
||||
// The id of the sketch group.
|
||||
id: uuid,
|
||||
// What the sketch is on (can be a plane or a face).
|
||||
on: SketchSurface,
|
||||
// The starting path.
|
||||
start: {
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
},
|
||||
// Tag identifiers that have been declared in this sketch group.
|
||||
tags: {
|
||||
},
|
||||
// The paths in the sketch group.
|
||||
value: [{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "ToPoint",
|
||||
} |
|
||||
{
|
||||
// arc's direction
|
||||
ccw: string,
|
||||
// the arc's center
|
||||
center: [number, number],
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArcTo",
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArc",
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Horizontal",
|
||||
// The x coordinate.
|
||||
x: number,
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "AngledLineTo",
|
||||
// The x coordinate.
|
||||
x: number,
|
||||
// The y coordinate.
|
||||
y: number,
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Base",
|
||||
}],
|
||||
},
|
||||
// The id of the extrusion start cap
|
||||
startCapId: uuid,
|
||||
// The extrude surfaces.
|
||||
value: [{
|
||||
// The face id for the extrude plane.
|
||||
faceId: uuid,
|
||||
// The id of the geometry.
|
||||
id: uuid,
|
||||
// The source range.
|
||||
sourceRange: [number, number],
|
||||
// The tag.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "extrudePlane",
|
||||
} |
|
||||
{
|
||||
// The face id for the extrude plane.
|
||||
faceId: uuid,
|
||||
// The id of the geometry.
|
||||
id: uuid,
|
||||
// The source range.
|
||||
sourceRange: [number, number],
|
||||
// The tag.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "extrudeArc",
|
||||
}],
|
||||
},
|
||||
// The id of the face.
|
||||
id: uuid,
|
||||
// The original sketch group id of the object we are sketching on.
|
||||
sketchGroupId: uuid,
|
||||
type: "face",
|
||||
// The tag of the face.
|
||||
value: string,
|
||||
@ -276,25 +632,32 @@ const example = extrude(10, exampleSketch)
|
||||
z: number,
|
||||
},
|
||||
},
|
||||
// The position of the sketch group.
|
||||
position: [number, number, number],
|
||||
// The rotation of the sketch group base plane.
|
||||
rotation: [number, number, number, number],
|
||||
// The starting path.
|
||||
start: {
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
},
|
||||
// Tag identifiers that have been declared in this sketch group.
|
||||
tags: {
|
||||
},
|
||||
// The paths in the sketch group.
|
||||
value: [{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "ToPoint",
|
||||
@ -306,8 +669,12 @@ const example = extrude(10, exampleSketch)
|
||||
center: [number, number],
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArcTo",
|
||||
@ -315,8 +682,12 @@ const example = extrude(10, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArc",
|
||||
@ -324,8 +695,12 @@ const example = extrude(10, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Horizontal",
|
||||
@ -335,8 +710,12 @@ const example = extrude(10, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "AngledLineTo",
|
||||
@ -348,30 +727,16 @@ const example = extrude(10, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Base",
|
||||
}],
|
||||
// The x-axis of the sketch group base plane in the 3D space
|
||||
xAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
// The y-axis of the sketch group base plane in the 3D space
|
||||
yAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
// The z-axis of the sketch group base plane in the 3D space
|
||||
zAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
533
docs/kcl/arc.md
@ -9,7 +9,7 @@ Draw an arc.
|
||||
|
||||
|
||||
```js
|
||||
arc(data: ArcData, sketch_group: SketchGroup, tag?: String) -> SketchGroup
|
||||
arc(data: ArcData, sketch_group: SketchGroup, tag?: TagDeclarator) -> SketchGroup
|
||||
```
|
||||
|
||||
### Examples
|
||||
@ -52,8 +52,6 @@ const exampleSketch = startSketchOn('XZ')
|
||||
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
|
||||
```js
|
||||
{
|
||||
// The plane id or face id of the sketch group.
|
||||
entityId: uuid,
|
||||
// The id of the sketch group.
|
||||
id: uuid,
|
||||
// What the sketch is on (can be a plane or a face).
|
||||
@ -89,12 +87,184 @@ const exampleSketch = startSketchOn('XZ')
|
||||
},
|
||||
} |
|
||||
{
|
||||
// the face id the sketch is on
|
||||
// The extrude group the face is on.
|
||||
extrudeGroup: {
|
||||
// The id of the extrusion end cap
|
||||
endCapId: uuid,
|
||||
// Chamfers or fillets on this extrude group.
|
||||
filletOrChamfers: [{
|
||||
// The engine id of the edge to fillet.
|
||||
edge_id: uuid,
|
||||
// The id of the engine command that called this fillet.
|
||||
id: uuid,
|
||||
radius: number,
|
||||
type: "fillet",
|
||||
} |
|
||||
{
|
||||
// The engine id of the edge to chamfer.
|
||||
edge_id: uuid,
|
||||
// The id of the engine command that called this chamfer.
|
||||
id: uuid,
|
||||
length: number,
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "chamfer",
|
||||
}],
|
||||
// The height of the extrude group.
|
||||
height: number,
|
||||
// The id of the extrude group.
|
||||
id: uuid,
|
||||
// The sketch group.
|
||||
sketchGroup: {
|
||||
// The id of the sketch group.
|
||||
id: uuid,
|
||||
// What the sketch is on (can be a plane or a face).
|
||||
on: SketchSurface,
|
||||
// The starting path.
|
||||
start: {
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
},
|
||||
// Tag identifiers that have been declared in this sketch group.
|
||||
tags: {
|
||||
},
|
||||
// The paths in the sketch group.
|
||||
value: [{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "ToPoint",
|
||||
} |
|
||||
{
|
||||
// arc's direction
|
||||
ccw: string,
|
||||
// the arc's center
|
||||
center: [number, number],
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArcTo",
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArc",
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Horizontal",
|
||||
// The x coordinate.
|
||||
x: number,
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "AngledLineTo",
|
||||
// The x coordinate.
|
||||
x: number,
|
||||
// The y coordinate.
|
||||
y: number,
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Base",
|
||||
}],
|
||||
},
|
||||
// The id of the extrusion start cap
|
||||
startCapId: uuid,
|
||||
// The extrude surfaces.
|
||||
value: [{
|
||||
// The face id for the extrude plane.
|
||||
faceId: uuid,
|
||||
// The id of the geometry.
|
||||
id: uuid,
|
||||
// The source range.
|
||||
sourceRange: [number, number],
|
||||
// The tag.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "extrudePlane",
|
||||
} |
|
||||
{
|
||||
// The face id for the extrude plane.
|
||||
faceId: uuid,
|
||||
// The id of the geometry.
|
||||
id: uuid,
|
||||
// The source range.
|
||||
sourceRange: [number, number],
|
||||
// The tag.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "extrudeArc",
|
||||
}],
|
||||
},
|
||||
// The id of the face.
|
||||
id: uuid,
|
||||
// The original sketch group id of the object we are sketching on.
|
||||
sketchGroupId: uuid,
|
||||
type: "face",
|
||||
// The tag of the face.
|
||||
value: string,
|
||||
@ -117,25 +287,32 @@ const exampleSketch = startSketchOn('XZ')
|
||||
z: number,
|
||||
},
|
||||
},
|
||||
// The position of the sketch group.
|
||||
position: [number, number, number],
|
||||
// The rotation of the sketch group base plane.
|
||||
rotation: [number, number, number, number],
|
||||
// The starting path.
|
||||
start: {
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
},
|
||||
// Tag identifiers that have been declared in this sketch group.
|
||||
tags: {
|
||||
},
|
||||
// The paths in the sketch group.
|
||||
value: [{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "ToPoint",
|
||||
@ -147,8 +324,12 @@ const exampleSketch = startSketchOn('XZ')
|
||||
center: [number, number],
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArcTo",
|
||||
@ -156,8 +337,12 @@ const exampleSketch = startSketchOn('XZ')
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArc",
|
||||
@ -165,8 +350,12 @@ const exampleSketch = startSketchOn('XZ')
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Horizontal",
|
||||
@ -176,8 +365,12 @@ const exampleSketch = startSketchOn('XZ')
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "AngledLineTo",
|
||||
@ -189,41 +382,32 @@ const exampleSketch = startSketchOn('XZ')
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Base",
|
||||
}],
|
||||
// The x-axis of the sketch group base plane in the 3D space
|
||||
xAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
// The y-axis of the sketch group base plane in the 3D space
|
||||
yAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
// The z-axis of the sketch group base plane in the 3D space
|
||||
zAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
}
|
||||
```
|
||||
* `tag`: `String` (OPTIONAL)
|
||||
* `tag`: `TagDeclarator` (OPTIONAL)
|
||||
```js
|
||||
{
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
}
|
||||
```
|
||||
|
||||
### Returns
|
||||
|
||||
`SketchGroup` - A sketch group is a collection of paths.
|
||||
```js
|
||||
{
|
||||
// The plane id or face id of the sketch group.
|
||||
entityId: uuid,
|
||||
// The id of the sketch group.
|
||||
id: uuid,
|
||||
// What the sketch is on (can be a plane or a face).
|
||||
@ -259,12 +443,184 @@ const exampleSketch = startSketchOn('XZ')
|
||||
},
|
||||
} |
|
||||
{
|
||||
// the face id the sketch is on
|
||||
// The extrude group the face is on.
|
||||
extrudeGroup: {
|
||||
// The id of the extrusion end cap
|
||||
endCapId: uuid,
|
||||
// Chamfers or fillets on this extrude group.
|
||||
filletOrChamfers: [{
|
||||
// The engine id of the edge to fillet.
|
||||
edge_id: uuid,
|
||||
// The id of the engine command that called this fillet.
|
||||
id: uuid,
|
||||
radius: number,
|
||||
type: "fillet",
|
||||
} |
|
||||
{
|
||||
// The engine id of the edge to chamfer.
|
||||
edge_id: uuid,
|
||||
// The id of the engine command that called this chamfer.
|
||||
id: uuid,
|
||||
length: number,
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "chamfer",
|
||||
}],
|
||||
// The height of the extrude group.
|
||||
height: number,
|
||||
// The id of the extrude group.
|
||||
id: uuid,
|
||||
// The sketch group.
|
||||
sketchGroup: {
|
||||
// The id of the sketch group.
|
||||
id: uuid,
|
||||
// What the sketch is on (can be a plane or a face).
|
||||
on: SketchSurface,
|
||||
// The starting path.
|
||||
start: {
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
},
|
||||
// Tag identifiers that have been declared in this sketch group.
|
||||
tags: {
|
||||
},
|
||||
// The paths in the sketch group.
|
||||
value: [{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "ToPoint",
|
||||
} |
|
||||
{
|
||||
// arc's direction
|
||||
ccw: string,
|
||||
// the arc's center
|
||||
center: [number, number],
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArcTo",
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArc",
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Horizontal",
|
||||
// The x coordinate.
|
||||
x: number,
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "AngledLineTo",
|
||||
// The x coordinate.
|
||||
x: number,
|
||||
// The y coordinate.
|
||||
y: number,
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Base",
|
||||
}],
|
||||
},
|
||||
// The id of the extrusion start cap
|
||||
startCapId: uuid,
|
||||
// The extrude surfaces.
|
||||
value: [{
|
||||
// The face id for the extrude plane.
|
||||
faceId: uuid,
|
||||
// The id of the geometry.
|
||||
id: uuid,
|
||||
// The source range.
|
||||
sourceRange: [number, number],
|
||||
// The tag.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "extrudePlane",
|
||||
} |
|
||||
{
|
||||
// The face id for the extrude plane.
|
||||
faceId: uuid,
|
||||
// The id of the geometry.
|
||||
id: uuid,
|
||||
// The source range.
|
||||
sourceRange: [number, number],
|
||||
// The tag.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "extrudeArc",
|
||||
}],
|
||||
},
|
||||
// The id of the face.
|
||||
id: uuid,
|
||||
// The original sketch group id of the object we are sketching on.
|
||||
sketchGroupId: uuid,
|
||||
type: "face",
|
||||
// The tag of the face.
|
||||
value: string,
|
||||
@ -287,25 +643,32 @@ const exampleSketch = startSketchOn('XZ')
|
||||
z: number,
|
||||
},
|
||||
},
|
||||
// The position of the sketch group.
|
||||
position: [number, number, number],
|
||||
// The rotation of the sketch group base plane.
|
||||
rotation: [number, number, number, number],
|
||||
// The starting path.
|
||||
start: {
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
},
|
||||
// Tag identifiers that have been declared in this sketch group.
|
||||
tags: {
|
||||
},
|
||||
// The paths in the sketch group.
|
||||
value: [{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "ToPoint",
|
||||
@ -317,8 +680,12 @@ const exampleSketch = startSketchOn('XZ')
|
||||
center: [number, number],
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArcTo",
|
||||
@ -326,8 +693,12 @@ const exampleSketch = startSketchOn('XZ')
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArc",
|
||||
@ -335,8 +706,12 @@ const exampleSketch = startSketchOn('XZ')
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Horizontal",
|
||||
@ -346,8 +721,12 @@ const exampleSketch = startSketchOn('XZ')
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "AngledLineTo",
|
||||
@ -359,30 +738,16 @@ const exampleSketch = startSketchOn('XZ')
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Base",
|
||||
}],
|
||||
// The x-axis of the sketch group base plane in the 3D space
|
||||
xAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
// The y-axis of the sketch group base plane in the 3D space
|
||||
yAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
// The z-axis of the sketch group base plane in the 3D space
|
||||
zAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
@ -9,7 +9,7 @@ Draw a bezier curve.
|
||||
|
||||
|
||||
```js
|
||||
bezierCurve(data: BezierData, sketch_group: SketchGroup, tag?: String) -> SketchGroup
|
||||
bezierCurve(data: BezierData, sketch_group: SketchGroup, tag?: TagDeclarator) -> SketchGroup
|
||||
```
|
||||
|
||||
### Examples
|
||||
@ -47,8 +47,6 @@ const example = extrude(10, exampleSketch)
|
||||
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
|
||||
```js
|
||||
{
|
||||
// The plane id or face id of the sketch group.
|
||||
entityId: uuid,
|
||||
// The id of the sketch group.
|
||||
id: uuid,
|
||||
// What the sketch is on (can be a plane or a face).
|
||||
@ -84,12 +82,184 @@ const example = extrude(10, exampleSketch)
|
||||
},
|
||||
} |
|
||||
{
|
||||
// the face id the sketch is on
|
||||
// The extrude group the face is on.
|
||||
extrudeGroup: {
|
||||
// The id of the extrusion end cap
|
||||
endCapId: uuid,
|
||||
// Chamfers or fillets on this extrude group.
|
||||
filletOrChamfers: [{
|
||||
// The engine id of the edge to fillet.
|
||||
edge_id: uuid,
|
||||
// The id of the engine command that called this fillet.
|
||||
id: uuid,
|
||||
radius: number,
|
||||
type: "fillet",
|
||||
} |
|
||||
{
|
||||
// The engine id of the edge to chamfer.
|
||||
edge_id: uuid,
|
||||
// The id of the engine command that called this chamfer.
|
||||
id: uuid,
|
||||
length: number,
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "chamfer",
|
||||
}],
|
||||
// The height of the extrude group.
|
||||
height: number,
|
||||
// The id of the extrude group.
|
||||
id: uuid,
|
||||
// The sketch group.
|
||||
sketchGroup: {
|
||||
// The id of the sketch group.
|
||||
id: uuid,
|
||||
// What the sketch is on (can be a plane or a face).
|
||||
on: SketchSurface,
|
||||
// The starting path.
|
||||
start: {
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
},
|
||||
// Tag identifiers that have been declared in this sketch group.
|
||||
tags: {
|
||||
},
|
||||
// The paths in the sketch group.
|
||||
value: [{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "ToPoint",
|
||||
} |
|
||||
{
|
||||
// arc's direction
|
||||
ccw: string,
|
||||
// the arc's center
|
||||
center: [number, number],
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArcTo",
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArc",
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Horizontal",
|
||||
// The x coordinate.
|
||||
x: number,
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "AngledLineTo",
|
||||
// The x coordinate.
|
||||
x: number,
|
||||
// The y coordinate.
|
||||
y: number,
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Base",
|
||||
}],
|
||||
},
|
||||
// The id of the extrusion start cap
|
||||
startCapId: uuid,
|
||||
// The extrude surfaces.
|
||||
value: [{
|
||||
// The face id for the extrude plane.
|
||||
faceId: uuid,
|
||||
// The id of the geometry.
|
||||
id: uuid,
|
||||
// The source range.
|
||||
sourceRange: [number, number],
|
||||
// The tag.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "extrudePlane",
|
||||
} |
|
||||
{
|
||||
// The face id for the extrude plane.
|
||||
faceId: uuid,
|
||||
// The id of the geometry.
|
||||
id: uuid,
|
||||
// The source range.
|
||||
sourceRange: [number, number],
|
||||
// The tag.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "extrudeArc",
|
||||
}],
|
||||
},
|
||||
// The id of the face.
|
||||
id: uuid,
|
||||
// The original sketch group id of the object we are sketching on.
|
||||
sketchGroupId: uuid,
|
||||
type: "face",
|
||||
// The tag of the face.
|
||||
value: string,
|
||||
@ -112,25 +282,32 @@ const example = extrude(10, exampleSketch)
|
||||
z: number,
|
||||
},
|
||||
},
|
||||
// The position of the sketch group.
|
||||
position: [number, number, number],
|
||||
// The rotation of the sketch group base plane.
|
||||
rotation: [number, number, number, number],
|
||||
// The starting path.
|
||||
start: {
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
},
|
||||
// Tag identifiers that have been declared in this sketch group.
|
||||
tags: {
|
||||
},
|
||||
// The paths in the sketch group.
|
||||
value: [{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "ToPoint",
|
||||
@ -142,8 +319,12 @@ const example = extrude(10, exampleSketch)
|
||||
center: [number, number],
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArcTo",
|
||||
@ -151,8 +332,12 @@ const example = extrude(10, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArc",
|
||||
@ -160,8 +345,12 @@ const example = extrude(10, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Horizontal",
|
||||
@ -171,8 +360,12 @@ const example = extrude(10, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "AngledLineTo",
|
||||
@ -184,41 +377,32 @@ const example = extrude(10, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Base",
|
||||
}],
|
||||
// The x-axis of the sketch group base plane in the 3D space
|
||||
xAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
// The y-axis of the sketch group base plane in the 3D space
|
||||
yAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
// The z-axis of the sketch group base plane in the 3D space
|
||||
zAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
}
|
||||
```
|
||||
* `tag`: `String` (OPTIONAL)
|
||||
* `tag`: `TagDeclarator` (OPTIONAL)
|
||||
```js
|
||||
{
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
}
|
||||
```
|
||||
|
||||
### Returns
|
||||
|
||||
`SketchGroup` - A sketch group is a collection of paths.
|
||||
```js
|
||||
{
|
||||
// The plane id or face id of the sketch group.
|
||||
entityId: uuid,
|
||||
// The id of the sketch group.
|
||||
id: uuid,
|
||||
// What the sketch is on (can be a plane or a face).
|
||||
@ -254,12 +438,184 @@ const example = extrude(10, exampleSketch)
|
||||
},
|
||||
} |
|
||||
{
|
||||
// the face id the sketch is on
|
||||
// The extrude group the face is on.
|
||||
extrudeGroup: {
|
||||
// The id of the extrusion end cap
|
||||
endCapId: uuid,
|
||||
// Chamfers or fillets on this extrude group.
|
||||
filletOrChamfers: [{
|
||||
// The engine id of the edge to fillet.
|
||||
edge_id: uuid,
|
||||
// The id of the engine command that called this fillet.
|
||||
id: uuid,
|
||||
radius: number,
|
||||
type: "fillet",
|
||||
} |
|
||||
{
|
||||
// The engine id of the edge to chamfer.
|
||||
edge_id: uuid,
|
||||
// The id of the engine command that called this chamfer.
|
||||
id: uuid,
|
||||
length: number,
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "chamfer",
|
||||
}],
|
||||
// The height of the extrude group.
|
||||
height: number,
|
||||
// The id of the extrude group.
|
||||
id: uuid,
|
||||
// The sketch group.
|
||||
sketchGroup: {
|
||||
// The id of the sketch group.
|
||||
id: uuid,
|
||||
// What the sketch is on (can be a plane or a face).
|
||||
on: SketchSurface,
|
||||
// The starting path.
|
||||
start: {
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
},
|
||||
// Tag identifiers that have been declared in this sketch group.
|
||||
tags: {
|
||||
},
|
||||
// The paths in the sketch group.
|
||||
value: [{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "ToPoint",
|
||||
} |
|
||||
{
|
||||
// arc's direction
|
||||
ccw: string,
|
||||
// the arc's center
|
||||
center: [number, number],
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArcTo",
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArc",
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Horizontal",
|
||||
// The x coordinate.
|
||||
x: number,
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "AngledLineTo",
|
||||
// The x coordinate.
|
||||
x: number,
|
||||
// The y coordinate.
|
||||
y: number,
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Base",
|
||||
}],
|
||||
},
|
||||
// The id of the extrusion start cap
|
||||
startCapId: uuid,
|
||||
// The extrude surfaces.
|
||||
value: [{
|
||||
// The face id for the extrude plane.
|
||||
faceId: uuid,
|
||||
// The id of the geometry.
|
||||
id: uuid,
|
||||
// The source range.
|
||||
sourceRange: [number, number],
|
||||
// The tag.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "extrudePlane",
|
||||
} |
|
||||
{
|
||||
// The face id for the extrude plane.
|
||||
faceId: uuid,
|
||||
// The id of the geometry.
|
||||
id: uuid,
|
||||
// The source range.
|
||||
sourceRange: [number, number],
|
||||
// The tag.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "extrudeArc",
|
||||
}],
|
||||
},
|
||||
// The id of the face.
|
||||
id: uuid,
|
||||
// The original sketch group id of the object we are sketching on.
|
||||
sketchGroupId: uuid,
|
||||
type: "face",
|
||||
// The tag of the face.
|
||||
value: string,
|
||||
@ -282,25 +638,32 @@ const example = extrude(10, exampleSketch)
|
||||
z: number,
|
||||
},
|
||||
},
|
||||
// The position of the sketch group.
|
||||
position: [number, number, number],
|
||||
// The rotation of the sketch group base plane.
|
||||
rotation: [number, number, number, number],
|
||||
// The starting path.
|
||||
start: {
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
},
|
||||
// Tag identifiers that have been declared in this sketch group.
|
||||
tags: {
|
||||
},
|
||||
// The paths in the sketch group.
|
||||
value: [{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "ToPoint",
|
||||
@ -312,8 +675,12 @@ const example = extrude(10, exampleSketch)
|
||||
center: [number, number],
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArcTo",
|
||||
@ -321,8 +688,12 @@ const example = extrude(10, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArc",
|
||||
@ -330,8 +701,12 @@ const example = extrude(10, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Horizontal",
|
||||
@ -341,8 +716,12 @@ const example = extrude(10, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "AngledLineTo",
|
||||
@ -354,30 +733,16 @@ const example = extrude(10, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Base",
|
||||
}],
|
||||
// The x-axis of the sketch group base plane in the 3D space
|
||||
xAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
// The y-axis of the sketch group base plane in the 3D space
|
||||
yAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
// The z-axis of the sketch group base plane in the 3D space
|
||||
zAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
669
docs/kcl/chamfer.md
Normal file
@ -9,7 +9,7 @@ Sketch a circle.
|
||||
|
||||
|
||||
```js
|
||||
circle(center: [number], radius: number, tag?: String, sketch_surface_or_group: SketchSurfaceOrGroup) -> SketchGroup
|
||||
circle(center: [number], radius: number, sketch_surface_or_group: SketchSurfaceOrGroup, tag?: TagDeclarator) -> SketchGroup
|
||||
```
|
||||
|
||||
### Examples
|
||||
@ -41,7 +41,6 @@ const example = extrude(5, exampleSketch)
|
||||
|
||||
* `center`: `[number]` (REQUIRED)
|
||||
* `radius`: `number` (REQUIRED)
|
||||
* `tag`: `String` (OPTIONAL)
|
||||
* `sketch_surface_or_group`: `SketchSurfaceOrGroup` - A sketch surface or a sketch group. (REQUIRED)
|
||||
```js
|
||||
{
|
||||
@ -76,12 +75,184 @@ const example = extrude(5, exampleSketch)
|
||||
},
|
||||
} |
|
||||
{
|
||||
// the face id the sketch is on
|
||||
// The extrude group the face is on.
|
||||
extrudeGroup: {
|
||||
// The id of the extrusion end cap
|
||||
endCapId: uuid,
|
||||
// Chamfers or fillets on this extrude group.
|
||||
filletOrChamfers: [{
|
||||
// The engine id of the edge to fillet.
|
||||
edge_id: uuid,
|
||||
// The id of the engine command that called this fillet.
|
||||
id: uuid,
|
||||
radius: number,
|
||||
type: "fillet",
|
||||
} |
|
||||
{
|
||||
// The engine id of the edge to chamfer.
|
||||
edge_id: uuid,
|
||||
// The id of the engine command that called this chamfer.
|
||||
id: uuid,
|
||||
length: number,
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "chamfer",
|
||||
}],
|
||||
// The height of the extrude group.
|
||||
height: number,
|
||||
// The id of the extrude group.
|
||||
id: uuid,
|
||||
// The sketch group.
|
||||
sketchGroup: {
|
||||
// The id of the sketch group.
|
||||
id: uuid,
|
||||
// What the sketch is on (can be a plane or a face).
|
||||
on: SketchSurface,
|
||||
// The starting path.
|
||||
start: {
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
},
|
||||
// Tag identifiers that have been declared in this sketch group.
|
||||
tags: {
|
||||
},
|
||||
// The paths in the sketch group.
|
||||
value: [{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "ToPoint",
|
||||
} |
|
||||
{
|
||||
// arc's direction
|
||||
ccw: string,
|
||||
// the arc's center
|
||||
center: [number, number],
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArcTo",
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArc",
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Horizontal",
|
||||
// The x coordinate.
|
||||
x: number,
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "AngledLineTo",
|
||||
// The x coordinate.
|
||||
x: number,
|
||||
// The y coordinate.
|
||||
y: number,
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Base",
|
||||
}],
|
||||
},
|
||||
// The id of the extrusion start cap
|
||||
startCapId: uuid,
|
||||
// The extrude surfaces.
|
||||
value: [{
|
||||
// The face id for the extrude plane.
|
||||
faceId: uuid,
|
||||
// The id of the geometry.
|
||||
id: uuid,
|
||||
// The source range.
|
||||
sourceRange: [number, number],
|
||||
// The tag.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "extrudePlane",
|
||||
} |
|
||||
{
|
||||
// The face id for the extrude plane.
|
||||
faceId: uuid,
|
||||
// The id of the geometry.
|
||||
id: uuid,
|
||||
// The source range.
|
||||
sourceRange: [number, number],
|
||||
// The tag.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "extrudeArc",
|
||||
}],
|
||||
},
|
||||
// The id of the face.
|
||||
id: uuid,
|
||||
// The original sketch group id of the object we are sketching on.
|
||||
sketchGroupId: uuid,
|
||||
type: "face",
|
||||
// The tag of the face.
|
||||
value: string,
|
||||
@ -105,8 +276,6 @@ const example = extrude(5, exampleSketch)
|
||||
},
|
||||
} |
|
||||
{
|
||||
// The plane id or face id of the sketch group.
|
||||
entityId: uuid,
|
||||
// The id of the sketch group.
|
||||
id: uuid,
|
||||
// What the sketch is on (can be a plane or a face).
|
||||
@ -142,12 +311,74 @@ const example = extrude(5, exampleSketch)
|
||||
},
|
||||
} |
|
||||
{
|
||||
// the face id the sketch is on
|
||||
// The extrude group the face is on.
|
||||
extrudeGroup: {
|
||||
// The id of the extrusion end cap
|
||||
endCapId: uuid,
|
||||
// Chamfers or fillets on this extrude group.
|
||||
filletOrChamfers: [{
|
||||
// The engine id of the edge to fillet.
|
||||
edge_id: uuid,
|
||||
// The id of the engine command that called this fillet.
|
||||
id: uuid,
|
||||
radius: number,
|
||||
type: "fillet",
|
||||
} |
|
||||
{
|
||||
// The engine id of the edge to chamfer.
|
||||
edge_id: uuid,
|
||||
// The id of the engine command that called this chamfer.
|
||||
id: uuid,
|
||||
length: number,
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "chamfer",
|
||||
}],
|
||||
// The height of the extrude group.
|
||||
height: number,
|
||||
// The id of the extrude group.
|
||||
id: uuid,
|
||||
// The sketch group.
|
||||
sketchGroup: SketchGroup,
|
||||
// The id of the extrusion start cap
|
||||
startCapId: uuid,
|
||||
// The extrude surfaces.
|
||||
value: [{
|
||||
// The face id for the extrude plane.
|
||||
faceId: uuid,
|
||||
// The id of the geometry.
|
||||
id: uuid,
|
||||
// The source range.
|
||||
sourceRange: [number, number],
|
||||
// The tag.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "extrudePlane",
|
||||
} |
|
||||
{
|
||||
// The face id for the extrude plane.
|
||||
faceId: uuid,
|
||||
// The id of the geometry.
|
||||
id: uuid,
|
||||
// The source range.
|
||||
sourceRange: [number, number],
|
||||
// The tag.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "extrudeArc",
|
||||
}],
|
||||
},
|
||||
// The id of the face.
|
||||
id: uuid,
|
||||
// The original sketch group id of the object we are sketching on.
|
||||
sketchGroupId: uuid,
|
||||
type: "face",
|
||||
// The tag of the face.
|
||||
value: string,
|
||||
@ -170,25 +401,32 @@ const example = extrude(5, exampleSketch)
|
||||
z: number,
|
||||
},
|
||||
},
|
||||
// The position of the sketch group.
|
||||
position: [number, number, number],
|
||||
// The rotation of the sketch group base plane.
|
||||
rotation: [number, number, number, number],
|
||||
// The starting path.
|
||||
start: {
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
},
|
||||
// Tag identifiers that have been declared in this sketch group.
|
||||
tags: {
|
||||
},
|
||||
// The paths in the sketch group.
|
||||
value: [{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "ToPoint",
|
||||
@ -200,8 +438,12 @@ const example = extrude(5, exampleSketch)
|
||||
center: [number, number],
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArcTo",
|
||||
@ -209,8 +451,12 @@ const example = extrude(5, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArc",
|
||||
@ -218,8 +464,12 @@ const example = extrude(5, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Horizontal",
|
||||
@ -229,8 +479,12 @@ const example = extrude(5, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "AngledLineTo",
|
||||
@ -242,30 +496,24 @@ const example = extrude(5, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Base",
|
||||
}],
|
||||
// The x-axis of the sketch group base plane in the 3D space
|
||||
xAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
// The y-axis of the sketch group base plane in the 3D space
|
||||
yAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
// The z-axis of the sketch group base plane in the 3D space
|
||||
zAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
}
|
||||
```
|
||||
* `tag`: `TagDeclarator` (OPTIONAL)
|
||||
```js
|
||||
{
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
}
|
||||
```
|
||||
|
||||
@ -274,8 +522,6 @@ const example = extrude(5, exampleSketch)
|
||||
`SketchGroup` - A sketch group is a collection of paths.
|
||||
```js
|
||||
{
|
||||
// The plane id or face id of the sketch group.
|
||||
entityId: uuid,
|
||||
// The id of the sketch group.
|
||||
id: uuid,
|
||||
// What the sketch is on (can be a plane or a face).
|
||||
@ -311,12 +557,184 @@ const example = extrude(5, exampleSketch)
|
||||
},
|
||||
} |
|
||||
{
|
||||
// the face id the sketch is on
|
||||
// The extrude group the face is on.
|
||||
extrudeGroup: {
|
||||
// The id of the extrusion end cap
|
||||
endCapId: uuid,
|
||||
// Chamfers or fillets on this extrude group.
|
||||
filletOrChamfers: [{
|
||||
// The engine id of the edge to fillet.
|
||||
edge_id: uuid,
|
||||
// The id of the engine command that called this fillet.
|
||||
id: uuid,
|
||||
radius: number,
|
||||
type: "fillet",
|
||||
} |
|
||||
{
|
||||
// The engine id of the edge to chamfer.
|
||||
edge_id: uuid,
|
||||
// The id of the engine command that called this chamfer.
|
||||
id: uuid,
|
||||
length: number,
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "chamfer",
|
||||
}],
|
||||
// The height of the extrude group.
|
||||
height: number,
|
||||
// The id of the extrude group.
|
||||
id: uuid,
|
||||
// The sketch group.
|
||||
sketchGroup: {
|
||||
// The id of the sketch group.
|
||||
id: uuid,
|
||||
// What the sketch is on (can be a plane or a face).
|
||||
on: SketchSurface,
|
||||
// The starting path.
|
||||
start: {
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
},
|
||||
// Tag identifiers that have been declared in this sketch group.
|
||||
tags: {
|
||||
},
|
||||
// The paths in the sketch group.
|
||||
value: [{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "ToPoint",
|
||||
} |
|
||||
{
|
||||
// arc's direction
|
||||
ccw: string,
|
||||
// the arc's center
|
||||
center: [number, number],
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArcTo",
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArc",
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Horizontal",
|
||||
// The x coordinate.
|
||||
x: number,
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "AngledLineTo",
|
||||
// The x coordinate.
|
||||
x: number,
|
||||
// The y coordinate.
|
||||
y: number,
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Base",
|
||||
}],
|
||||
},
|
||||
// The id of the extrusion start cap
|
||||
startCapId: uuid,
|
||||
// The extrude surfaces.
|
||||
value: [{
|
||||
// The face id for the extrude plane.
|
||||
faceId: uuid,
|
||||
// The id of the geometry.
|
||||
id: uuid,
|
||||
// The source range.
|
||||
sourceRange: [number, number],
|
||||
// The tag.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "extrudePlane",
|
||||
} |
|
||||
{
|
||||
// The face id for the extrude plane.
|
||||
faceId: uuid,
|
||||
// The id of the geometry.
|
||||
id: uuid,
|
||||
// The source range.
|
||||
sourceRange: [number, number],
|
||||
// The tag.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "extrudeArc",
|
||||
}],
|
||||
},
|
||||
// The id of the face.
|
||||
id: uuid,
|
||||
// The original sketch group id of the object we are sketching on.
|
||||
sketchGroupId: uuid,
|
||||
type: "face",
|
||||
// The tag of the face.
|
||||
value: string,
|
||||
@ -339,25 +757,32 @@ const example = extrude(5, exampleSketch)
|
||||
z: number,
|
||||
},
|
||||
},
|
||||
// The position of the sketch group.
|
||||
position: [number, number, number],
|
||||
// The rotation of the sketch group base plane.
|
||||
rotation: [number, number, number, number],
|
||||
// The starting path.
|
||||
start: {
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
},
|
||||
// Tag identifiers that have been declared in this sketch group.
|
||||
tags: {
|
||||
},
|
||||
// The paths in the sketch group.
|
||||
value: [{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "ToPoint",
|
||||
@ -369,8 +794,12 @@ const example = extrude(5, exampleSketch)
|
||||
center: [number, number],
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArcTo",
|
||||
@ -378,8 +807,12 @@ const example = extrude(5, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArc",
|
||||
@ -387,8 +820,12 @@ const example = extrude(5, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Horizontal",
|
||||
@ -398,8 +835,12 @@ const example = extrude(5, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "AngledLineTo",
|
||||
@ -411,30 +852,16 @@ const example = extrude(5, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Base",
|
||||
}],
|
||||
// The x-axis of the sketch group base plane in the 3D space
|
||||
xAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
// The y-axis of the sketch group base plane in the 3D space
|
||||
yAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
// The z-axis of the sketch group base plane in the 3D space
|
||||
zAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
@ -9,7 +9,7 @@ Close the current sketch.
|
||||
|
||||
|
||||
```js
|
||||
close(sketch_group: SketchGroup, tag?: String) -> SketchGroup
|
||||
close(sketch_group: SketchGroup, tag?: TagDeclarator) -> SketchGroup
|
||||
```
|
||||
|
||||
### Examples
|
||||
@ -42,8 +42,6 @@ const example = extrude(10, exampleSketch)
|
||||
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
|
||||
```js
|
||||
{
|
||||
// The plane id or face id of the sketch group.
|
||||
entityId: uuid,
|
||||
// The id of the sketch group.
|
||||
id: uuid,
|
||||
// What the sketch is on (can be a plane or a face).
|
||||
@ -79,12 +77,184 @@ const example = extrude(10, exampleSketch)
|
||||
},
|
||||
} |
|
||||
{
|
||||
// the face id the sketch is on
|
||||
// The extrude group the face is on.
|
||||
extrudeGroup: {
|
||||
// The id of the extrusion end cap
|
||||
endCapId: uuid,
|
||||
// Chamfers or fillets on this extrude group.
|
||||
filletOrChamfers: [{
|
||||
// The engine id of the edge to fillet.
|
||||
edge_id: uuid,
|
||||
// The id of the engine command that called this fillet.
|
||||
id: uuid,
|
||||
radius: number,
|
||||
type: "fillet",
|
||||
} |
|
||||
{
|
||||
// The engine id of the edge to chamfer.
|
||||
edge_id: uuid,
|
||||
// The id of the engine command that called this chamfer.
|
||||
id: uuid,
|
||||
length: number,
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "chamfer",
|
||||
}],
|
||||
// The height of the extrude group.
|
||||
height: number,
|
||||
// The id of the extrude group.
|
||||
id: uuid,
|
||||
// The sketch group.
|
||||
sketchGroup: {
|
||||
// The id of the sketch group.
|
||||
id: uuid,
|
||||
// What the sketch is on (can be a plane or a face).
|
||||
on: SketchSurface,
|
||||
// The starting path.
|
||||
start: {
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
},
|
||||
// Tag identifiers that have been declared in this sketch group.
|
||||
tags: {
|
||||
},
|
||||
// The paths in the sketch group.
|
||||
value: [{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "ToPoint",
|
||||
} |
|
||||
{
|
||||
// arc's direction
|
||||
ccw: string,
|
||||
// the arc's center
|
||||
center: [number, number],
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArcTo",
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArc",
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Horizontal",
|
||||
// The x coordinate.
|
||||
x: number,
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "AngledLineTo",
|
||||
// The x coordinate.
|
||||
x: number,
|
||||
// The y coordinate.
|
||||
y: number,
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Base",
|
||||
}],
|
||||
},
|
||||
// The id of the extrusion start cap
|
||||
startCapId: uuid,
|
||||
// The extrude surfaces.
|
||||
value: [{
|
||||
// The face id for the extrude plane.
|
||||
faceId: uuid,
|
||||
// The id of the geometry.
|
||||
id: uuid,
|
||||
// The source range.
|
||||
sourceRange: [number, number],
|
||||
// The tag.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "extrudePlane",
|
||||
} |
|
||||
{
|
||||
// The face id for the extrude plane.
|
||||
faceId: uuid,
|
||||
// The id of the geometry.
|
||||
id: uuid,
|
||||
// The source range.
|
||||
sourceRange: [number, number],
|
||||
// The tag.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "extrudeArc",
|
||||
}],
|
||||
},
|
||||
// The id of the face.
|
||||
id: uuid,
|
||||
// The original sketch group id of the object we are sketching on.
|
||||
sketchGroupId: uuid,
|
||||
type: "face",
|
||||
// The tag of the face.
|
||||
value: string,
|
||||
@ -107,25 +277,32 @@ const example = extrude(10, exampleSketch)
|
||||
z: number,
|
||||
},
|
||||
},
|
||||
// The position of the sketch group.
|
||||
position: [number, number, number],
|
||||
// The rotation of the sketch group base plane.
|
||||
rotation: [number, number, number, number],
|
||||
// The starting path.
|
||||
start: {
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
},
|
||||
// Tag identifiers that have been declared in this sketch group.
|
||||
tags: {
|
||||
},
|
||||
// The paths in the sketch group.
|
||||
value: [{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "ToPoint",
|
||||
@ -137,8 +314,12 @@ const example = extrude(10, exampleSketch)
|
||||
center: [number, number],
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArcTo",
|
||||
@ -146,8 +327,12 @@ const example = extrude(10, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArc",
|
||||
@ -155,8 +340,12 @@ const example = extrude(10, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Horizontal",
|
||||
@ -166,8 +355,12 @@ const example = extrude(10, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "AngledLineTo",
|
||||
@ -179,41 +372,32 @@ const example = extrude(10, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Base",
|
||||
}],
|
||||
// The x-axis of the sketch group base plane in the 3D space
|
||||
xAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
// The y-axis of the sketch group base plane in the 3D space
|
||||
yAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
// The z-axis of the sketch group base plane in the 3D space
|
||||
zAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
}
|
||||
```
|
||||
* `tag`: `String` (OPTIONAL)
|
||||
* `tag`: `TagDeclarator` (OPTIONAL)
|
||||
```js
|
||||
{
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
}
|
||||
```
|
||||
|
||||
### Returns
|
||||
|
||||
`SketchGroup` - A sketch group is a collection of paths.
|
||||
```js
|
||||
{
|
||||
// The plane id or face id of the sketch group.
|
||||
entityId: uuid,
|
||||
// The id of the sketch group.
|
||||
id: uuid,
|
||||
// What the sketch is on (can be a plane or a face).
|
||||
@ -249,12 +433,184 @@ const example = extrude(10, exampleSketch)
|
||||
},
|
||||
} |
|
||||
{
|
||||
// the face id the sketch is on
|
||||
// The extrude group the face is on.
|
||||
extrudeGroup: {
|
||||
// The id of the extrusion end cap
|
||||
endCapId: uuid,
|
||||
// Chamfers or fillets on this extrude group.
|
||||
filletOrChamfers: [{
|
||||
// The engine id of the edge to fillet.
|
||||
edge_id: uuid,
|
||||
// The id of the engine command that called this fillet.
|
||||
id: uuid,
|
||||
radius: number,
|
||||
type: "fillet",
|
||||
} |
|
||||
{
|
||||
// The engine id of the edge to chamfer.
|
||||
edge_id: uuid,
|
||||
// The id of the engine command that called this chamfer.
|
||||
id: uuid,
|
||||
length: number,
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "chamfer",
|
||||
}],
|
||||
// The height of the extrude group.
|
||||
height: number,
|
||||
// The id of the extrude group.
|
||||
id: uuid,
|
||||
// The sketch group.
|
||||
sketchGroup: {
|
||||
// The id of the sketch group.
|
||||
id: uuid,
|
||||
// What the sketch is on (can be a plane or a face).
|
||||
on: SketchSurface,
|
||||
// The starting path.
|
||||
start: {
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
},
|
||||
// Tag identifiers that have been declared in this sketch group.
|
||||
tags: {
|
||||
},
|
||||
// The paths in the sketch group.
|
||||
value: [{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "ToPoint",
|
||||
} |
|
||||
{
|
||||
// arc's direction
|
||||
ccw: string,
|
||||
// the arc's center
|
||||
center: [number, number],
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArcTo",
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArc",
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Horizontal",
|
||||
// The x coordinate.
|
||||
x: number,
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "AngledLineTo",
|
||||
// The x coordinate.
|
||||
x: number,
|
||||
// The y coordinate.
|
||||
y: number,
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Base",
|
||||
}],
|
||||
},
|
||||
// The id of the extrusion start cap
|
||||
startCapId: uuid,
|
||||
// The extrude surfaces.
|
||||
value: [{
|
||||
// The face id for the extrude plane.
|
||||
faceId: uuid,
|
||||
// The id of the geometry.
|
||||
id: uuid,
|
||||
// The source range.
|
||||
sourceRange: [number, number],
|
||||
// The tag.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "extrudePlane",
|
||||
} |
|
||||
{
|
||||
// The face id for the extrude plane.
|
||||
faceId: uuid,
|
||||
// The id of the geometry.
|
||||
id: uuid,
|
||||
// The source range.
|
||||
sourceRange: [number, number],
|
||||
// The tag.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "extrudeArc",
|
||||
}],
|
||||
},
|
||||
// The id of the face.
|
||||
id: uuid,
|
||||
// The original sketch group id of the object we are sketching on.
|
||||
sketchGroupId: uuid,
|
||||
type: "face",
|
||||
// The tag of the face.
|
||||
value: string,
|
||||
@ -277,25 +633,32 @@ const example = extrude(10, exampleSketch)
|
||||
z: number,
|
||||
},
|
||||
},
|
||||
// The position of the sketch group.
|
||||
position: [number, number, number],
|
||||
// The rotation of the sketch group base plane.
|
||||
rotation: [number, number, number, number],
|
||||
// The starting path.
|
||||
start: {
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
},
|
||||
// Tag identifiers that have been declared in this sketch group.
|
||||
tags: {
|
||||
},
|
||||
// The paths in the sketch group.
|
||||
value: [{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "ToPoint",
|
||||
@ -307,8 +670,12 @@ const example = extrude(10, exampleSketch)
|
||||
center: [number, number],
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArcTo",
|
||||
@ -316,8 +683,12 @@ const example = extrude(10, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArc",
|
||||
@ -325,8 +696,12 @@ const example = extrude(10, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Horizontal",
|
||||
@ -336,8 +711,12 @@ const example = extrude(10, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "AngledLineTo",
|
||||
@ -349,30 +728,16 @@ const example = extrude(10, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Base",
|
||||
}],
|
||||
// The x-axis of the sketch group base plane in the 3D space
|
||||
xAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
// The y-axis of the sketch group base plane in the 3D space
|
||||
yAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
// The z-axis of the sketch group base plane in the 3D space
|
||||
zAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
@ -67,8 +67,6 @@ const example = extrude(10, exampleSketch)
|
||||
* `sketch_group_set`: `SketchGroupSet` - A sketch group or a group of sketch groups. (REQUIRED)
|
||||
```js
|
||||
{
|
||||
// The plane id or face id of the sketch group.
|
||||
entityId: uuid,
|
||||
// The id of the sketch group.
|
||||
id: uuid,
|
||||
// What the sketch is on (can be a plane or a face).
|
||||
@ -104,12 +102,184 @@ const example = extrude(10, exampleSketch)
|
||||
},
|
||||
} |
|
||||
{
|
||||
// the face id the sketch is on
|
||||
// The extrude group the face is on.
|
||||
extrudeGroup: {
|
||||
// The id of the extrusion end cap
|
||||
endCapId: uuid,
|
||||
// Chamfers or fillets on this extrude group.
|
||||
filletOrChamfers: [{
|
||||
// The engine id of the edge to fillet.
|
||||
edge_id: uuid,
|
||||
// The id of the engine command that called this fillet.
|
||||
id: uuid,
|
||||
radius: number,
|
||||
type: "fillet",
|
||||
} |
|
||||
{
|
||||
// The engine id of the edge to chamfer.
|
||||
edge_id: uuid,
|
||||
// The id of the engine command that called this chamfer.
|
||||
id: uuid,
|
||||
length: number,
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "chamfer",
|
||||
}],
|
||||
// The height of the extrude group.
|
||||
height: number,
|
||||
// The id of the extrude group.
|
||||
id: uuid,
|
||||
// The sketch group.
|
||||
sketchGroup: {
|
||||
// The id of the sketch group.
|
||||
id: uuid,
|
||||
// What the sketch is on (can be a plane or a face).
|
||||
on: SketchSurface,
|
||||
// The starting path.
|
||||
start: {
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
},
|
||||
// Tag identifiers that have been declared in this sketch group.
|
||||
tags: {
|
||||
},
|
||||
// The paths in the sketch group.
|
||||
value: [{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "ToPoint",
|
||||
} |
|
||||
{
|
||||
// arc's direction
|
||||
ccw: string,
|
||||
// the arc's center
|
||||
center: [number, number],
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArcTo",
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArc",
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Horizontal",
|
||||
// The x coordinate.
|
||||
x: number,
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "AngledLineTo",
|
||||
// The x coordinate.
|
||||
x: number,
|
||||
// The y coordinate.
|
||||
y: number,
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Base",
|
||||
}],
|
||||
},
|
||||
// The id of the extrusion start cap
|
||||
startCapId: uuid,
|
||||
// The extrude surfaces.
|
||||
value: [{
|
||||
// The face id for the extrude plane.
|
||||
faceId: uuid,
|
||||
// The id of the geometry.
|
||||
id: uuid,
|
||||
// The source range.
|
||||
sourceRange: [number, number],
|
||||
// The tag.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "extrudePlane",
|
||||
} |
|
||||
{
|
||||
// The face id for the extrude plane.
|
||||
faceId: uuid,
|
||||
// The id of the geometry.
|
||||
id: uuid,
|
||||
// The source range.
|
||||
sourceRange: [number, number],
|
||||
// The tag.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "extrudeArc",
|
||||
}],
|
||||
},
|
||||
// The id of the face.
|
||||
id: uuid,
|
||||
// The original sketch group id of the object we are sketching on.
|
||||
sketchGroupId: uuid,
|
||||
type: "face",
|
||||
// The tag of the face.
|
||||
value: string,
|
||||
@ -132,26 +302,33 @@ const example = extrude(10, exampleSketch)
|
||||
z: number,
|
||||
},
|
||||
},
|
||||
// The position of the sketch group.
|
||||
position: [number, number, number],
|
||||
// The rotation of the sketch group base plane.
|
||||
rotation: [number, number, number, number],
|
||||
// The starting path.
|
||||
start: {
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
},
|
||||
// Tag identifiers that have been declared in this sketch group.
|
||||
tags: {
|
||||
},
|
||||
type: "sketchGroup",
|
||||
// The paths in the sketch group.
|
||||
value: [{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "ToPoint",
|
||||
@ -163,8 +340,12 @@ const example = extrude(10, exampleSketch)
|
||||
center: [number, number],
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArcTo",
|
||||
@ -172,8 +353,12 @@ const example = extrude(10, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArc",
|
||||
@ -181,8 +366,12 @@ const example = extrude(10, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Horizontal",
|
||||
@ -192,8 +381,12 @@ const example = extrude(10, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "AngledLineTo",
|
||||
@ -205,30 +398,16 @@ const example = extrude(10, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Base",
|
||||
}],
|
||||
// The x-axis of the sketch group base plane in the 3D space
|
||||
xAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
// The y-axis of the sketch group base plane in the 3D space
|
||||
yAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
// The z-axis of the sketch group base plane in the 3D space
|
||||
zAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
} |
|
||||
{
|
||||
type: "sketchGroups",
|
||||
@ -242,20 +421,185 @@ const example = extrude(10, exampleSketch)
|
||||
{
|
||||
// The id of the extrusion end cap
|
||||
endCapId: uuid,
|
||||
// Chamfers or fillets on this extrude group.
|
||||
filletOrChamfers: [{
|
||||
// The engine id of the edge to fillet.
|
||||
edge_id: uuid,
|
||||
// The id of the engine command that called this fillet.
|
||||
id: uuid,
|
||||
radius: number,
|
||||
type: "fillet",
|
||||
} |
|
||||
{
|
||||
// The engine id of the edge to chamfer.
|
||||
edge_id: uuid,
|
||||
// The id of the engine command that called this chamfer.
|
||||
id: uuid,
|
||||
length: number,
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "chamfer",
|
||||
}],
|
||||
// The height of the extrude group.
|
||||
height: number,
|
||||
// The id of the extrude group.
|
||||
id: uuid,
|
||||
// The position of the extrude group.
|
||||
position: [number, number, number],
|
||||
// The rotation of the extrude group.
|
||||
rotation: [number, number, number, number],
|
||||
// The sketch group paths.
|
||||
sketchGroupValues: [{
|
||||
// The sketch group.
|
||||
sketchGroup: {
|
||||
// The id of the sketch group.
|
||||
id: uuid,
|
||||
// What the sketch is on (can be a plane or a face).
|
||||
on: {
|
||||
// The id of the plane.
|
||||
id: uuid,
|
||||
// Origin of the plane.
|
||||
origin: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
type: "plane",
|
||||
// Type for a plane.
|
||||
value: "XY" | "XZ" | "YZ" | "Custom",
|
||||
// What should the plane’s X axis be?
|
||||
xAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
// What should the plane’s Y axis be?
|
||||
yAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
// The z-axis (normal).
|
||||
zAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
} |
|
||||
{
|
||||
// The extrude group the face is on.
|
||||
extrudeGroup: {
|
||||
// The id of the extrusion end cap
|
||||
endCapId: uuid,
|
||||
// Chamfers or fillets on this extrude group.
|
||||
filletOrChamfers: [{
|
||||
// The engine id of the edge to fillet.
|
||||
edge_id: uuid,
|
||||
// The id of the engine command that called this fillet.
|
||||
id: uuid,
|
||||
radius: number,
|
||||
type: "fillet",
|
||||
} |
|
||||
{
|
||||
// The engine id of the edge to chamfer.
|
||||
edge_id: uuid,
|
||||
// The id of the engine command that called this chamfer.
|
||||
id: uuid,
|
||||
length: number,
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "chamfer",
|
||||
}],
|
||||
// The height of the extrude group.
|
||||
height: number,
|
||||
// The id of the extrude group.
|
||||
id: uuid,
|
||||
// The sketch group.
|
||||
sketchGroup: SketchGroup,
|
||||
// The id of the extrusion start cap
|
||||
startCapId: uuid,
|
||||
// The extrude surfaces.
|
||||
value: [{
|
||||
// The face id for the extrude plane.
|
||||
faceId: uuid,
|
||||
// The id of the geometry.
|
||||
id: uuid,
|
||||
// The source range.
|
||||
sourceRange: [number, number],
|
||||
// The tag.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "extrudePlane",
|
||||
} |
|
||||
{
|
||||
// The face id for the extrude plane.
|
||||
faceId: uuid,
|
||||
// The id of the geometry.
|
||||
id: uuid,
|
||||
// The source range.
|
||||
sourceRange: [number, number],
|
||||
// The tag.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "extrudeArc",
|
||||
}],
|
||||
},
|
||||
// The id of the face.
|
||||
id: uuid,
|
||||
type: "face",
|
||||
// The tag of the face.
|
||||
value: string,
|
||||
// What should the face’s X axis be?
|
||||
xAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
// What should the face’s Y axis be?
|
||||
yAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
// The z-axis (normal).
|
||||
zAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
},
|
||||
// The starting path.
|
||||
start: {
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
},
|
||||
// Tag identifiers that have been declared in this sketch group.
|
||||
tags: {
|
||||
},
|
||||
// The paths in the sketch group.
|
||||
value: [{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "ToPoint",
|
||||
@ -267,8 +611,12 @@ const example = extrude(10, exampleSketch)
|
||||
center: [number, number],
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArcTo",
|
||||
@ -276,8 +624,12 @@ const example = extrude(10, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArc",
|
||||
@ -285,8 +637,12 @@ const example = extrude(10, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Horizontal",
|
||||
@ -296,8 +652,12 @@ const example = extrude(10, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "AngledLineTo",
|
||||
@ -309,12 +669,17 @@ const example = extrude(10, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Base",
|
||||
}],
|
||||
},
|
||||
// The id of the extrusion start cap
|
||||
startCapId: uuid,
|
||||
type: "extrudeGroup",
|
||||
@ -324,14 +689,14 @@ const example = extrude(10, exampleSketch)
|
||||
faceId: uuid,
|
||||
// The id of the geometry.
|
||||
id: uuid,
|
||||
// The name.
|
||||
name: string,
|
||||
// The position.
|
||||
position: [number, number, number],
|
||||
// The rotation.
|
||||
rotation: [number, number, number, number],
|
||||
// The source range.
|
||||
sourceRange: [number, number],
|
||||
// The tag.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "extrudePlane",
|
||||
} |
|
||||
{
|
||||
@ -339,34 +704,16 @@ const example = extrude(10, exampleSketch)
|
||||
faceId: uuid,
|
||||
// The id of the geometry.
|
||||
id: uuid,
|
||||
// The name.
|
||||
name: string,
|
||||
// The position.
|
||||
position: [number, number, number],
|
||||
// The rotation.
|
||||
rotation: [number, number, number, number],
|
||||
// The source range.
|
||||
sourceRange: [number, number],
|
||||
// The tag.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "extrudeArc",
|
||||
}],
|
||||
// The x-axis of the extrude group base plane in the 3D space
|
||||
xAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
// The y-axis of the extrude group base plane in the 3D space
|
||||
yAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
// The z-axis of the extrude group base plane in the 3D space
|
||||
zAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
} |
|
||||
{
|
||||
type: "extrudeGroups",
|
||||
|
||||
@ -22,19 +22,19 @@ const filletRadius = 2
|
||||
|
||||
const mountingPlateSketch = startSketchOn("XY")
|
||||
|> startProfileAt([-width / 2, -length / 2], %)
|
||||
|> lineTo([width / 2, -length / 2], %, 'edge1')
|
||||
|> lineTo([width / 2, length / 2], %, 'edge2')
|
||||
|> lineTo([-width / 2, length / 2], %, 'edge3')
|
||||
|> close(%, 'edge4')
|
||||
|> lineTo([width / 2, -length / 2], %, $edge1)
|
||||
|> lineTo([width / 2, length / 2], %, $edge2)
|
||||
|> lineTo([-width / 2, length / 2], %, $edge3)
|
||||
|> close(%, $edge4)
|
||||
|
||||
const mountingPlate = extrude(thickness, mountingPlateSketch)
|
||||
|> fillet({
|
||||
radius: filletRadius,
|
||||
tags: [
|
||||
getNextAdjacentEdge('edge1', %),
|
||||
getNextAdjacentEdge('edge2', %),
|
||||
getNextAdjacentEdge('edge3', %),
|
||||
getNextAdjacentEdge('edge4', %)
|
||||
getNextAdjacentEdge(edge1, %),
|
||||
getNextAdjacentEdge(edge2, %),
|
||||
getNextAdjacentEdge(edge3, %),
|
||||
getNextAdjacentEdge(edge4, %)
|
||||
]
|
||||
}, %)
|
||||
```
|
||||
@ -50,7 +50,9 @@ const mountingPlate = extrude(thickness, mountingPlateSketch)
|
||||
radius: number,
|
||||
// The tags of the paths you want to fillet.
|
||||
tags: [uuid |
|
||||
string],
|
||||
{
|
||||
value: string,
|
||||
}],
|
||||
}
|
||||
```
|
||||
* `extrude_group`: `ExtrudeGroup` - An extrude group is a collection of extrude surfaces. (REQUIRED)
|
||||
@ -58,20 +60,185 @@ string],
|
||||
{
|
||||
// The id of the extrusion end cap
|
||||
endCapId: uuid,
|
||||
// Chamfers or fillets on this extrude group.
|
||||
filletOrChamfers: [{
|
||||
// The engine id of the edge to fillet.
|
||||
edge_id: uuid,
|
||||
// The id of the engine command that called this fillet.
|
||||
id: uuid,
|
||||
radius: number,
|
||||
type: "fillet",
|
||||
} |
|
||||
{
|
||||
// The engine id of the edge to chamfer.
|
||||
edge_id: uuid,
|
||||
// The id of the engine command that called this chamfer.
|
||||
id: uuid,
|
||||
length: number,
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "chamfer",
|
||||
}],
|
||||
// The height of the extrude group.
|
||||
height: number,
|
||||
// The id of the extrude group.
|
||||
id: uuid,
|
||||
// The position of the extrude group.
|
||||
position: [number, number, number],
|
||||
// The rotation of the extrude group.
|
||||
rotation: [number, number, number, number],
|
||||
// The sketch group paths.
|
||||
sketchGroupValues: [{
|
||||
// The sketch group.
|
||||
sketchGroup: {
|
||||
// The id of the sketch group.
|
||||
id: uuid,
|
||||
// What the sketch is on (can be a plane or a face).
|
||||
on: {
|
||||
// The id of the plane.
|
||||
id: uuid,
|
||||
// Origin of the plane.
|
||||
origin: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
type: "plane",
|
||||
// Type for a plane.
|
||||
value: "XY" | "XZ" | "YZ" | "Custom",
|
||||
// What should the plane’s X axis be?
|
||||
xAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
// What should the plane’s Y axis be?
|
||||
yAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
// The z-axis (normal).
|
||||
zAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
} |
|
||||
{
|
||||
// The extrude group the face is on.
|
||||
extrudeGroup: {
|
||||
// The id of the extrusion end cap
|
||||
endCapId: uuid,
|
||||
// Chamfers or fillets on this extrude group.
|
||||
filletOrChamfers: [{
|
||||
// The engine id of the edge to fillet.
|
||||
edge_id: uuid,
|
||||
// The id of the engine command that called this fillet.
|
||||
id: uuid,
|
||||
radius: number,
|
||||
type: "fillet",
|
||||
} |
|
||||
{
|
||||
// The engine id of the edge to chamfer.
|
||||
edge_id: uuid,
|
||||
// The id of the engine command that called this chamfer.
|
||||
id: uuid,
|
||||
length: number,
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "chamfer",
|
||||
}],
|
||||
// The height of the extrude group.
|
||||
height: number,
|
||||
// The id of the extrude group.
|
||||
id: uuid,
|
||||
// The sketch group.
|
||||
sketchGroup: SketchGroup,
|
||||
// The id of the extrusion start cap
|
||||
startCapId: uuid,
|
||||
// The extrude surfaces.
|
||||
value: [{
|
||||
// The face id for the extrude plane.
|
||||
faceId: uuid,
|
||||
// The id of the geometry.
|
||||
id: uuid,
|
||||
// The source range.
|
||||
sourceRange: [number, number],
|
||||
// The tag.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "extrudePlane",
|
||||
} |
|
||||
{
|
||||
// The face id for the extrude plane.
|
||||
faceId: uuid,
|
||||
// The id of the geometry.
|
||||
id: uuid,
|
||||
// The source range.
|
||||
sourceRange: [number, number],
|
||||
// The tag.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "extrudeArc",
|
||||
}],
|
||||
},
|
||||
// The id of the face.
|
||||
id: uuid,
|
||||
type: "face",
|
||||
// The tag of the face.
|
||||
value: string,
|
||||
// What should the face’s X axis be?
|
||||
xAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
// What should the face’s Y axis be?
|
||||
yAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
// The z-axis (normal).
|
||||
zAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
},
|
||||
// The starting path.
|
||||
start: {
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
},
|
||||
// Tag identifiers that have been declared in this sketch group.
|
||||
tags: {
|
||||
},
|
||||
// The paths in the sketch group.
|
||||
value: [{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "ToPoint",
|
||||
@ -83,8 +250,12 @@ string],
|
||||
center: [number, number],
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArcTo",
|
||||
@ -92,8 +263,12 @@ string],
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArc",
|
||||
@ -101,8 +276,12 @@ string],
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Horizontal",
|
||||
@ -112,8 +291,12 @@ string],
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "AngledLineTo",
|
||||
@ -125,12 +308,17 @@ string],
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Base",
|
||||
}],
|
||||
},
|
||||
// The id of the extrusion start cap
|
||||
startCapId: uuid,
|
||||
// The extrude surfaces.
|
||||
@ -139,14 +327,14 @@ string],
|
||||
faceId: uuid,
|
||||
// The id of the geometry.
|
||||
id: uuid,
|
||||
// The name.
|
||||
name: string,
|
||||
// The position.
|
||||
position: [number, number, number],
|
||||
// The rotation.
|
||||
rotation: [number, number, number, number],
|
||||
// The source range.
|
||||
sourceRange: [number, number],
|
||||
// The tag.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "extrudePlane",
|
||||
} |
|
||||
{
|
||||
@ -154,34 +342,16 @@ string],
|
||||
faceId: uuid,
|
||||
// The id of the geometry.
|
||||
id: uuid,
|
||||
// The name.
|
||||
name: string,
|
||||
// The position.
|
||||
position: [number, number, number],
|
||||
// The rotation.
|
||||
rotation: [number, number, number, number],
|
||||
// The source range.
|
||||
sourceRange: [number, number],
|
||||
// The tag.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "extrudeArc",
|
||||
}],
|
||||
// The x-axis of the extrude group base plane in the 3D space
|
||||
xAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
// The y-axis of the extrude group base plane in the 3D space
|
||||
yAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
// The z-axis of the extrude group base plane in the 3D space
|
||||
zAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
}
|
||||
```
|
||||
|
||||
@ -192,20 +362,185 @@ string],
|
||||
{
|
||||
// The id of the extrusion end cap
|
||||
endCapId: uuid,
|
||||
// Chamfers or fillets on this extrude group.
|
||||
filletOrChamfers: [{
|
||||
// The engine id of the edge to fillet.
|
||||
edge_id: uuid,
|
||||
// The id of the engine command that called this fillet.
|
||||
id: uuid,
|
||||
radius: number,
|
||||
type: "fillet",
|
||||
} |
|
||||
{
|
||||
// The engine id of the edge to chamfer.
|
||||
edge_id: uuid,
|
||||
// The id of the engine command that called this chamfer.
|
||||
id: uuid,
|
||||
length: number,
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "chamfer",
|
||||
}],
|
||||
// The height of the extrude group.
|
||||
height: number,
|
||||
// The id of the extrude group.
|
||||
id: uuid,
|
||||
// The position of the extrude group.
|
||||
position: [number, number, number],
|
||||
// The rotation of the extrude group.
|
||||
rotation: [number, number, number, number],
|
||||
// The sketch group paths.
|
||||
sketchGroupValues: [{
|
||||
// The sketch group.
|
||||
sketchGroup: {
|
||||
// The id of the sketch group.
|
||||
id: uuid,
|
||||
// What the sketch is on (can be a plane or a face).
|
||||
on: {
|
||||
// The id of the plane.
|
||||
id: uuid,
|
||||
// Origin of the plane.
|
||||
origin: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
type: "plane",
|
||||
// Type for a plane.
|
||||
value: "XY" | "XZ" | "YZ" | "Custom",
|
||||
// What should the plane’s X axis be?
|
||||
xAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
// What should the plane’s Y axis be?
|
||||
yAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
// The z-axis (normal).
|
||||
zAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
} |
|
||||
{
|
||||
// The extrude group the face is on.
|
||||
extrudeGroup: {
|
||||
// The id of the extrusion end cap
|
||||
endCapId: uuid,
|
||||
// Chamfers or fillets on this extrude group.
|
||||
filletOrChamfers: [{
|
||||
// The engine id of the edge to fillet.
|
||||
edge_id: uuid,
|
||||
// The id of the engine command that called this fillet.
|
||||
id: uuid,
|
||||
radius: number,
|
||||
type: "fillet",
|
||||
} |
|
||||
{
|
||||
// The engine id of the edge to chamfer.
|
||||
edge_id: uuid,
|
||||
// The id of the engine command that called this chamfer.
|
||||
id: uuid,
|
||||
length: number,
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "chamfer",
|
||||
}],
|
||||
// The height of the extrude group.
|
||||
height: number,
|
||||
// The id of the extrude group.
|
||||
id: uuid,
|
||||
// The sketch group.
|
||||
sketchGroup: SketchGroup,
|
||||
// The id of the extrusion start cap
|
||||
startCapId: uuid,
|
||||
// The extrude surfaces.
|
||||
value: [{
|
||||
// The face id for the extrude plane.
|
||||
faceId: uuid,
|
||||
// The id of the geometry.
|
||||
id: uuid,
|
||||
// The source range.
|
||||
sourceRange: [number, number],
|
||||
// The tag.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "extrudePlane",
|
||||
} |
|
||||
{
|
||||
// The face id for the extrude plane.
|
||||
faceId: uuid,
|
||||
// The id of the geometry.
|
||||
id: uuid,
|
||||
// The source range.
|
||||
sourceRange: [number, number],
|
||||
// The tag.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "extrudeArc",
|
||||
}],
|
||||
},
|
||||
// The id of the face.
|
||||
id: uuid,
|
||||
type: "face",
|
||||
// The tag of the face.
|
||||
value: string,
|
||||
// What should the face’s X axis be?
|
||||
xAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
// What should the face’s Y axis be?
|
||||
yAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
// The z-axis (normal).
|
||||
zAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
},
|
||||
// The starting path.
|
||||
start: {
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
},
|
||||
// Tag identifiers that have been declared in this sketch group.
|
||||
tags: {
|
||||
},
|
||||
// The paths in the sketch group.
|
||||
value: [{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "ToPoint",
|
||||
@ -217,8 +552,12 @@ string],
|
||||
center: [number, number],
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArcTo",
|
||||
@ -226,8 +565,12 @@ string],
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArc",
|
||||
@ -235,8 +578,12 @@ string],
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Horizontal",
|
||||
@ -246,8 +593,12 @@ string],
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "AngledLineTo",
|
||||
@ -259,12 +610,17 @@ string],
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Base",
|
||||
}],
|
||||
},
|
||||
// The id of the extrusion start cap
|
||||
startCapId: uuid,
|
||||
// The extrude surfaces.
|
||||
@ -273,14 +629,14 @@ string],
|
||||
faceId: uuid,
|
||||
// The id of the geometry.
|
||||
id: uuid,
|
||||
// The name.
|
||||
name: string,
|
||||
// The position.
|
||||
position: [number, number, number],
|
||||
// The rotation.
|
||||
rotation: [number, number, number, number],
|
||||
// The source range.
|
||||
sourceRange: [number, number],
|
||||
// The tag.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "extrudePlane",
|
||||
} |
|
||||
{
|
||||
@ -288,34 +644,16 @@ string],
|
||||
faceId: uuid,
|
||||
// The id of the geometry.
|
||||
id: uuid,
|
||||
// The name.
|
||||
name: string,
|
||||
// The position.
|
||||
position: [number, number, number],
|
||||
// The rotation.
|
||||
rotation: [number, number, number, number],
|
||||
// The source range.
|
||||
sourceRange: [number, number],
|
||||
// The tag.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "extrudeArc",
|
||||
}],
|
||||
// The x-axis of the extrude group base plane in the 3D space
|
||||
xAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
// The y-axis of the extrude group base plane in the 3D space
|
||||
yAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
// The z-axis of the extrude group base plane in the 3D space
|
||||
zAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
@ -9,7 +9,7 @@ Get an edge on a 3D solid.
|
||||
|
||||
|
||||
```js
|
||||
getEdge(tag: String, extrude_group: ExtrudeGroup) -> Uuid
|
||||
getEdge(tag: TagIdentifier, extrude_group: ExtrudeGroup) -> Uuid
|
||||
```
|
||||
|
||||
### Examples
|
||||
@ -17,7 +17,7 @@ getEdge(tag: String, extrude_group: ExtrudeGroup) -> Uuid
|
||||
```js
|
||||
const box = startSketchOn('XZ')
|
||||
|> startProfileAt([0, 0], %)
|
||||
|> line([0, 10], %, 'revolveAxis')
|
||||
|> line([0, 10], %, $revolveAxis)
|
||||
|> line([10, 0], %)
|
||||
|> line([0, -10], %)
|
||||
|> close(%)
|
||||
@ -30,7 +30,7 @@ const revolution = startSketchOn(box, "revolveAxis")
|
||||
|> line([0, -10], %)
|
||||
|> close(%)
|
||||
|> revolve({
|
||||
axis: getEdge('revolveAxis', box),
|
||||
axis: getEdge(revolveAxis, box),
|
||||
angle: 90
|
||||
}, %)
|
||||
```
|
||||
@ -39,26 +39,196 @@ const revolution = startSketchOn(box, "revolveAxis")
|
||||
|
||||
### Arguments
|
||||
|
||||
* `tag`: `String` (REQUIRED)
|
||||
* `tag`: `TagIdentifier` (REQUIRED)
|
||||
```js
|
||||
{
|
||||
value: string,
|
||||
}
|
||||
```
|
||||
* `extrude_group`: `ExtrudeGroup` - An extrude group is a collection of extrude surfaces. (REQUIRED)
|
||||
```js
|
||||
{
|
||||
// The id of the extrusion end cap
|
||||
endCapId: uuid,
|
||||
// Chamfers or fillets on this extrude group.
|
||||
filletOrChamfers: [{
|
||||
// The engine id of the edge to fillet.
|
||||
edge_id: uuid,
|
||||
// The id of the engine command that called this fillet.
|
||||
id: uuid,
|
||||
radius: number,
|
||||
type: "fillet",
|
||||
} |
|
||||
{
|
||||
// The engine id of the edge to chamfer.
|
||||
edge_id: uuid,
|
||||
// The id of the engine command that called this chamfer.
|
||||
id: uuid,
|
||||
length: number,
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "chamfer",
|
||||
}],
|
||||
// The height of the extrude group.
|
||||
height: number,
|
||||
// The id of the extrude group.
|
||||
id: uuid,
|
||||
// The position of the extrude group.
|
||||
position: [number, number, number],
|
||||
// The rotation of the extrude group.
|
||||
rotation: [number, number, number, number],
|
||||
// The sketch group paths.
|
||||
sketchGroupValues: [{
|
||||
// The sketch group.
|
||||
sketchGroup: {
|
||||
// The id of the sketch group.
|
||||
id: uuid,
|
||||
// What the sketch is on (can be a plane or a face).
|
||||
on: {
|
||||
// The id of the plane.
|
||||
id: uuid,
|
||||
// Origin of the plane.
|
||||
origin: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
type: "plane",
|
||||
// Type for a plane.
|
||||
value: "XY" | "XZ" | "YZ" | "Custom",
|
||||
// What should the plane’s X axis be?
|
||||
xAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
// What should the plane’s Y axis be?
|
||||
yAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
// The z-axis (normal).
|
||||
zAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
} |
|
||||
{
|
||||
// The extrude group the face is on.
|
||||
extrudeGroup: {
|
||||
// The id of the extrusion end cap
|
||||
endCapId: uuid,
|
||||
// Chamfers or fillets on this extrude group.
|
||||
filletOrChamfers: [{
|
||||
// The engine id of the edge to fillet.
|
||||
edge_id: uuid,
|
||||
// The id of the engine command that called this fillet.
|
||||
id: uuid,
|
||||
radius: number,
|
||||
type: "fillet",
|
||||
} |
|
||||
{
|
||||
// The engine id of the edge to chamfer.
|
||||
edge_id: uuid,
|
||||
// The id of the engine command that called this chamfer.
|
||||
id: uuid,
|
||||
length: number,
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "chamfer",
|
||||
}],
|
||||
// The height of the extrude group.
|
||||
height: number,
|
||||
// The id of the extrude group.
|
||||
id: uuid,
|
||||
// The sketch group.
|
||||
sketchGroup: SketchGroup,
|
||||
// The id of the extrusion start cap
|
||||
startCapId: uuid,
|
||||
// The extrude surfaces.
|
||||
value: [{
|
||||
// The face id for the extrude plane.
|
||||
faceId: uuid,
|
||||
// The id of the geometry.
|
||||
id: uuid,
|
||||
// The source range.
|
||||
sourceRange: [number, number],
|
||||
// The tag.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "extrudePlane",
|
||||
} |
|
||||
{
|
||||
// The face id for the extrude plane.
|
||||
faceId: uuid,
|
||||
// The id of the geometry.
|
||||
id: uuid,
|
||||
// The source range.
|
||||
sourceRange: [number, number],
|
||||
// The tag.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "extrudeArc",
|
||||
}],
|
||||
},
|
||||
// The id of the face.
|
||||
id: uuid,
|
||||
type: "face",
|
||||
// The tag of the face.
|
||||
value: string,
|
||||
// What should the face’s X axis be?
|
||||
xAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
// What should the face’s Y axis be?
|
||||
yAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
// The z-axis (normal).
|
||||
zAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
},
|
||||
// The starting path.
|
||||
start: {
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
},
|
||||
// Tag identifiers that have been declared in this sketch group.
|
||||
tags: {
|
||||
},
|
||||
// The paths in the sketch group.
|
||||
value: [{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "ToPoint",
|
||||
@ -70,8 +240,12 @@ const revolution = startSketchOn(box, "revolveAxis")
|
||||
center: [number, number],
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArcTo",
|
||||
@ -79,8 +253,12 @@ const revolution = startSketchOn(box, "revolveAxis")
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArc",
|
||||
@ -88,8 +266,12 @@ const revolution = startSketchOn(box, "revolveAxis")
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Horizontal",
|
||||
@ -99,8 +281,12 @@ const revolution = startSketchOn(box, "revolveAxis")
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "AngledLineTo",
|
||||
@ -112,12 +298,17 @@ const revolution = startSketchOn(box, "revolveAxis")
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Base",
|
||||
}],
|
||||
},
|
||||
// The id of the extrusion start cap
|
||||
startCapId: uuid,
|
||||
// The extrude surfaces.
|
||||
@ -126,14 +317,14 @@ const revolution = startSketchOn(box, "revolveAxis")
|
||||
faceId: uuid,
|
||||
// The id of the geometry.
|
||||
id: uuid,
|
||||
// The name.
|
||||
name: string,
|
||||
// The position.
|
||||
position: [number, number, number],
|
||||
// The rotation.
|
||||
rotation: [number, number, number, number],
|
||||
// The source range.
|
||||
sourceRange: [number, number],
|
||||
// The tag.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "extrudePlane",
|
||||
} |
|
||||
{
|
||||
@ -141,34 +332,16 @@ const revolution = startSketchOn(box, "revolveAxis")
|
||||
faceId: uuid,
|
||||
// The id of the geometry.
|
||||
id: uuid,
|
||||
// The name.
|
||||
name: string,
|
||||
// The position.
|
||||
position: [number, number, number],
|
||||
// The rotation.
|
||||
rotation: [number, number, number, number],
|
||||
// The source range.
|
||||
sourceRange: [number, number],
|
||||
// The tag.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "extrudeArc",
|
||||
}],
|
||||
// The x-axis of the extrude group base plane in the 3D space
|
||||
xAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
// The y-axis of the extrude group base plane in the 3D space
|
||||
yAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
// The z-axis of the extrude group base plane in the 3D space
|
||||
zAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
@ -9,7 +9,7 @@ Get the next adjacent edge to the edge given.
|
||||
|
||||
|
||||
```js
|
||||
getNextAdjacentEdge(tag: String, extrude_group: ExtrudeGroup) -> Uuid
|
||||
getNextAdjacentEdge(tag: TagIdentifier, extrude_group: ExtrudeGroup) -> Uuid
|
||||
```
|
||||
|
||||
### Examples
|
||||
@ -21,15 +21,13 @@ const exampleSketch = startSketchOn('XZ')
|
||||
|> angledLine({ angle: 60, length: 10 }, %)
|
||||
|> angledLine({ angle: 120, length: 10 }, %)
|
||||
|> line([-10, 0], %)
|
||||
|> angledLine({ angle: 240, length: 10 }, %, 'referenceEdge')
|
||||
|> angledLine({ angle: 240, length: 10 }, %, $referenceEdge)
|
||||
|> close(%)
|
||||
|
||||
const example = extrude(5, exampleSketch)
|
||||
|> fillet({
|
||||
radius: 3,
|
||||
tags: [
|
||||
getNextAdjacentEdge("referenceEdge", %)
|
||||
]
|
||||
tags: [getNextAdjacentEdge(referenceEdge, %)]
|
||||
}, %)
|
||||
```
|
||||
|
||||
@ -37,26 +35,196 @@ const example = extrude(5, exampleSketch)
|
||||
|
||||
### Arguments
|
||||
|
||||
* `tag`: `String` (REQUIRED)
|
||||
* `tag`: `TagIdentifier` (REQUIRED)
|
||||
```js
|
||||
{
|
||||
value: string,
|
||||
}
|
||||
```
|
||||
* `extrude_group`: `ExtrudeGroup` - An extrude group is a collection of extrude surfaces. (REQUIRED)
|
||||
```js
|
||||
{
|
||||
// The id of the extrusion end cap
|
||||
endCapId: uuid,
|
||||
// Chamfers or fillets on this extrude group.
|
||||
filletOrChamfers: [{
|
||||
// The engine id of the edge to fillet.
|
||||
edge_id: uuid,
|
||||
// The id of the engine command that called this fillet.
|
||||
id: uuid,
|
||||
radius: number,
|
||||
type: "fillet",
|
||||
} |
|
||||
{
|
||||
// The engine id of the edge to chamfer.
|
||||
edge_id: uuid,
|
||||
// The id of the engine command that called this chamfer.
|
||||
id: uuid,
|
||||
length: number,
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "chamfer",
|
||||
}],
|
||||
// The height of the extrude group.
|
||||
height: number,
|
||||
// The id of the extrude group.
|
||||
id: uuid,
|
||||
// The position of the extrude group.
|
||||
position: [number, number, number],
|
||||
// The rotation of the extrude group.
|
||||
rotation: [number, number, number, number],
|
||||
// The sketch group paths.
|
||||
sketchGroupValues: [{
|
||||
// The sketch group.
|
||||
sketchGroup: {
|
||||
// The id of the sketch group.
|
||||
id: uuid,
|
||||
// What the sketch is on (can be a plane or a face).
|
||||
on: {
|
||||
// The id of the plane.
|
||||
id: uuid,
|
||||
// Origin of the plane.
|
||||
origin: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
type: "plane",
|
||||
// Type for a plane.
|
||||
value: "XY" | "XZ" | "YZ" | "Custom",
|
||||
// What should the plane’s X axis be?
|
||||
xAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
// What should the plane’s Y axis be?
|
||||
yAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
// The z-axis (normal).
|
||||
zAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
} |
|
||||
{
|
||||
// The extrude group the face is on.
|
||||
extrudeGroup: {
|
||||
// The id of the extrusion end cap
|
||||
endCapId: uuid,
|
||||
// Chamfers or fillets on this extrude group.
|
||||
filletOrChamfers: [{
|
||||
// The engine id of the edge to fillet.
|
||||
edge_id: uuid,
|
||||
// The id of the engine command that called this fillet.
|
||||
id: uuid,
|
||||
radius: number,
|
||||
type: "fillet",
|
||||
} |
|
||||
{
|
||||
// The engine id of the edge to chamfer.
|
||||
edge_id: uuid,
|
||||
// The id of the engine command that called this chamfer.
|
||||
id: uuid,
|
||||
length: number,
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "chamfer",
|
||||
}],
|
||||
// The height of the extrude group.
|
||||
height: number,
|
||||
// The id of the extrude group.
|
||||
id: uuid,
|
||||
// The sketch group.
|
||||
sketchGroup: SketchGroup,
|
||||
// The id of the extrusion start cap
|
||||
startCapId: uuid,
|
||||
// The extrude surfaces.
|
||||
value: [{
|
||||
// The face id for the extrude plane.
|
||||
faceId: uuid,
|
||||
// The id of the geometry.
|
||||
id: uuid,
|
||||
// The source range.
|
||||
sourceRange: [number, number],
|
||||
// The tag.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "extrudePlane",
|
||||
} |
|
||||
{
|
||||
// The face id for the extrude plane.
|
||||
faceId: uuid,
|
||||
// The id of the geometry.
|
||||
id: uuid,
|
||||
// The source range.
|
||||
sourceRange: [number, number],
|
||||
// The tag.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "extrudeArc",
|
||||
}],
|
||||
},
|
||||
// The id of the face.
|
||||
id: uuid,
|
||||
type: "face",
|
||||
// The tag of the face.
|
||||
value: string,
|
||||
// What should the face’s X axis be?
|
||||
xAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
// What should the face’s Y axis be?
|
||||
yAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
// The z-axis (normal).
|
||||
zAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
},
|
||||
// The starting path.
|
||||
start: {
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
},
|
||||
// Tag identifiers that have been declared in this sketch group.
|
||||
tags: {
|
||||
},
|
||||
// The paths in the sketch group.
|
||||
value: [{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "ToPoint",
|
||||
@ -68,8 +236,12 @@ const example = extrude(5, exampleSketch)
|
||||
center: [number, number],
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArcTo",
|
||||
@ -77,8 +249,12 @@ const example = extrude(5, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArc",
|
||||
@ -86,8 +262,12 @@ const example = extrude(5, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Horizontal",
|
||||
@ -97,8 +277,12 @@ const example = extrude(5, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "AngledLineTo",
|
||||
@ -110,12 +294,17 @@ const example = extrude(5, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Base",
|
||||
}],
|
||||
},
|
||||
// The id of the extrusion start cap
|
||||
startCapId: uuid,
|
||||
// The extrude surfaces.
|
||||
@ -124,14 +313,14 @@ const example = extrude(5, exampleSketch)
|
||||
faceId: uuid,
|
||||
// The id of the geometry.
|
||||
id: uuid,
|
||||
// The name.
|
||||
name: string,
|
||||
// The position.
|
||||
position: [number, number, number],
|
||||
// The rotation.
|
||||
rotation: [number, number, number, number],
|
||||
// The source range.
|
||||
sourceRange: [number, number],
|
||||
// The tag.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "extrudePlane",
|
||||
} |
|
||||
{
|
||||
@ -139,34 +328,16 @@ const example = extrude(5, exampleSketch)
|
||||
faceId: uuid,
|
||||
// The id of the geometry.
|
||||
id: uuid,
|
||||
// The name.
|
||||
name: string,
|
||||
// The position.
|
||||
position: [number, number, number],
|
||||
// The rotation.
|
||||
rotation: [number, number, number, number],
|
||||
// The source range.
|
||||
sourceRange: [number, number],
|
||||
// The tag.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "extrudeArc",
|
||||
}],
|
||||
// The x-axis of the extrude group base plane in the 3D space
|
||||
xAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
// The y-axis of the extrude group base plane in the 3D space
|
||||
yAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
// The z-axis of the extrude group base plane in the 3D space
|
||||
zAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
@ -9,7 +9,7 @@ Get the opposite edge to the edge given.
|
||||
|
||||
|
||||
```js
|
||||
getOppositeEdge(tag: String, extrude_group: ExtrudeGroup) -> Uuid
|
||||
getOppositeEdge(tag: TagIdentifier, extrude_group: ExtrudeGroup) -> Uuid
|
||||
```
|
||||
|
||||
### Examples
|
||||
@ -21,13 +21,13 @@ const exampleSketch = startSketchOn('XZ')
|
||||
|> angledLine({ angle: 60, length: 10 }, %)
|
||||
|> angledLine({ angle: 120, length: 10 }, %)
|
||||
|> line([-10, 0], %)
|
||||
|> angledLine({ angle: 240, length: 10 }, %, 'referenceEdge')
|
||||
|> angledLine({ angle: 240, length: 10 }, %, $referenceEdge)
|
||||
|> close(%)
|
||||
|
||||
const example = extrude(5, exampleSketch)
|
||||
|> fillet({
|
||||
radius: 3,
|
||||
tags: [getOppositeEdge("referenceEdge", %)]
|
||||
tags: [getOppositeEdge(referenceEdge, %)]
|
||||
}, %)
|
||||
```
|
||||
|
||||
@ -35,26 +35,196 @@ const example = extrude(5, exampleSketch)
|
||||
|
||||
### Arguments
|
||||
|
||||
* `tag`: `String` (REQUIRED)
|
||||
* `tag`: `TagIdentifier` (REQUIRED)
|
||||
```js
|
||||
{
|
||||
value: string,
|
||||
}
|
||||
```
|
||||
* `extrude_group`: `ExtrudeGroup` - An extrude group is a collection of extrude surfaces. (REQUIRED)
|
||||
```js
|
||||
{
|
||||
// The id of the extrusion end cap
|
||||
endCapId: uuid,
|
||||
// Chamfers or fillets on this extrude group.
|
||||
filletOrChamfers: [{
|
||||
// The engine id of the edge to fillet.
|
||||
edge_id: uuid,
|
||||
// The id of the engine command that called this fillet.
|
||||
id: uuid,
|
||||
radius: number,
|
||||
type: "fillet",
|
||||
} |
|
||||
{
|
||||
// The engine id of the edge to chamfer.
|
||||
edge_id: uuid,
|
||||
// The id of the engine command that called this chamfer.
|
||||
id: uuid,
|
||||
length: number,
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "chamfer",
|
||||
}],
|
||||
// The height of the extrude group.
|
||||
height: number,
|
||||
// The id of the extrude group.
|
||||
id: uuid,
|
||||
// The position of the extrude group.
|
||||
position: [number, number, number],
|
||||
// The rotation of the extrude group.
|
||||
rotation: [number, number, number, number],
|
||||
// The sketch group paths.
|
||||
sketchGroupValues: [{
|
||||
// The sketch group.
|
||||
sketchGroup: {
|
||||
// The id of the sketch group.
|
||||
id: uuid,
|
||||
// What the sketch is on (can be a plane or a face).
|
||||
on: {
|
||||
// The id of the plane.
|
||||
id: uuid,
|
||||
// Origin of the plane.
|
||||
origin: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
type: "plane",
|
||||
// Type for a plane.
|
||||
value: "XY" | "XZ" | "YZ" | "Custom",
|
||||
// What should the plane’s X axis be?
|
||||
xAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
// What should the plane’s Y axis be?
|
||||
yAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
// The z-axis (normal).
|
||||
zAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
} |
|
||||
{
|
||||
// The extrude group the face is on.
|
||||
extrudeGroup: {
|
||||
// The id of the extrusion end cap
|
||||
endCapId: uuid,
|
||||
// Chamfers or fillets on this extrude group.
|
||||
filletOrChamfers: [{
|
||||
// The engine id of the edge to fillet.
|
||||
edge_id: uuid,
|
||||
// The id of the engine command that called this fillet.
|
||||
id: uuid,
|
||||
radius: number,
|
||||
type: "fillet",
|
||||
} |
|
||||
{
|
||||
// The engine id of the edge to chamfer.
|
||||
edge_id: uuid,
|
||||
// The id of the engine command that called this chamfer.
|
||||
id: uuid,
|
||||
length: number,
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "chamfer",
|
||||
}],
|
||||
// The height of the extrude group.
|
||||
height: number,
|
||||
// The id of the extrude group.
|
||||
id: uuid,
|
||||
// The sketch group.
|
||||
sketchGroup: SketchGroup,
|
||||
// The id of the extrusion start cap
|
||||
startCapId: uuid,
|
||||
// The extrude surfaces.
|
||||
value: [{
|
||||
// The face id for the extrude plane.
|
||||
faceId: uuid,
|
||||
// The id of the geometry.
|
||||
id: uuid,
|
||||
// The source range.
|
||||
sourceRange: [number, number],
|
||||
// The tag.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "extrudePlane",
|
||||
} |
|
||||
{
|
||||
// The face id for the extrude plane.
|
||||
faceId: uuid,
|
||||
// The id of the geometry.
|
||||
id: uuid,
|
||||
// The source range.
|
||||
sourceRange: [number, number],
|
||||
// The tag.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "extrudeArc",
|
||||
}],
|
||||
},
|
||||
// The id of the face.
|
||||
id: uuid,
|
||||
type: "face",
|
||||
// The tag of the face.
|
||||
value: string,
|
||||
// What should the face’s X axis be?
|
||||
xAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
// What should the face’s Y axis be?
|
||||
yAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
// The z-axis (normal).
|
||||
zAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
},
|
||||
// The starting path.
|
||||
start: {
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
},
|
||||
// Tag identifiers that have been declared in this sketch group.
|
||||
tags: {
|
||||
},
|
||||
// The paths in the sketch group.
|
||||
value: [{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "ToPoint",
|
||||
@ -66,8 +236,12 @@ const example = extrude(5, exampleSketch)
|
||||
center: [number, number],
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArcTo",
|
||||
@ -75,8 +249,12 @@ const example = extrude(5, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArc",
|
||||
@ -84,8 +262,12 @@ const example = extrude(5, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Horizontal",
|
||||
@ -95,8 +277,12 @@ const example = extrude(5, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "AngledLineTo",
|
||||
@ -108,12 +294,17 @@ const example = extrude(5, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Base",
|
||||
}],
|
||||
},
|
||||
// The id of the extrusion start cap
|
||||
startCapId: uuid,
|
||||
// The extrude surfaces.
|
||||
@ -122,14 +313,14 @@ const example = extrude(5, exampleSketch)
|
||||
faceId: uuid,
|
||||
// The id of the geometry.
|
||||
id: uuid,
|
||||
// The name.
|
||||
name: string,
|
||||
// The position.
|
||||
position: [number, number, number],
|
||||
// The rotation.
|
||||
rotation: [number, number, number, number],
|
||||
// The source range.
|
||||
sourceRange: [number, number],
|
||||
// The tag.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "extrudePlane",
|
||||
} |
|
||||
{
|
||||
@ -137,34 +328,16 @@ const example = extrude(5, exampleSketch)
|
||||
faceId: uuid,
|
||||
// The id of the geometry.
|
||||
id: uuid,
|
||||
// The name.
|
||||
name: string,
|
||||
// The position.
|
||||
position: [number, number, number],
|
||||
// The rotation.
|
||||
rotation: [number, number, number, number],
|
||||
// The source range.
|
||||
sourceRange: [number, number],
|
||||
// The tag.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "extrudeArc",
|
||||
}],
|
||||
// The x-axis of the extrude group base plane in the 3D space
|
||||
xAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
// The y-axis of the extrude group base plane in the 3D space
|
||||
yAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
// The z-axis of the extrude group base plane in the 3D space
|
||||
zAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
@ -9,7 +9,7 @@ Get the previous adjacent edge to the edge given.
|
||||
|
||||
|
||||
```js
|
||||
getPreviousAdjacentEdge(tag: String, extrude_group: ExtrudeGroup) -> Uuid
|
||||
getPreviousAdjacentEdge(tag: TagIdentifier, extrude_group: ExtrudeGroup) -> Uuid
|
||||
```
|
||||
|
||||
### Examples
|
||||
@ -21,14 +21,14 @@ const exampleSketch = startSketchOn('XZ')
|
||||
|> angledLine({ angle: 60, length: 10 }, %)
|
||||
|> angledLine({ angle: 120, length: 10 }, %)
|
||||
|> line([-10, 0], %)
|
||||
|> angledLine({ angle: 240, length: 10 }, %, 'referenceEdge')
|
||||
|> angledLine({ angle: 240, length: 10 }, %, $referenceEdge)
|
||||
|> close(%)
|
||||
|
||||
const example = extrude(5, exampleSketch)
|
||||
|> fillet({
|
||||
radius: 3,
|
||||
tags: [
|
||||
getPreviousAdjacentEdge("referenceEdge", %)
|
||||
getPreviousAdjacentEdge(referenceEdge, %)
|
||||
]
|
||||
}, %)
|
||||
```
|
||||
@ -37,26 +37,196 @@ const example = extrude(5, exampleSketch)
|
||||
|
||||
### Arguments
|
||||
|
||||
* `tag`: `String` (REQUIRED)
|
||||
* `tag`: `TagIdentifier` (REQUIRED)
|
||||
```js
|
||||
{
|
||||
value: string,
|
||||
}
|
||||
```
|
||||
* `extrude_group`: `ExtrudeGroup` - An extrude group is a collection of extrude surfaces. (REQUIRED)
|
||||
```js
|
||||
{
|
||||
// The id of the extrusion end cap
|
||||
endCapId: uuid,
|
||||
// Chamfers or fillets on this extrude group.
|
||||
filletOrChamfers: [{
|
||||
// The engine id of the edge to fillet.
|
||||
edge_id: uuid,
|
||||
// The id of the engine command that called this fillet.
|
||||
id: uuid,
|
||||
radius: number,
|
||||
type: "fillet",
|
||||
} |
|
||||
{
|
||||
// The engine id of the edge to chamfer.
|
||||
edge_id: uuid,
|
||||
// The id of the engine command that called this chamfer.
|
||||
id: uuid,
|
||||
length: number,
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "chamfer",
|
||||
}],
|
||||
// The height of the extrude group.
|
||||
height: number,
|
||||
// The id of the extrude group.
|
||||
id: uuid,
|
||||
// The position of the extrude group.
|
||||
position: [number, number, number],
|
||||
// The rotation of the extrude group.
|
||||
rotation: [number, number, number, number],
|
||||
// The sketch group paths.
|
||||
sketchGroupValues: [{
|
||||
// The sketch group.
|
||||
sketchGroup: {
|
||||
// The id of the sketch group.
|
||||
id: uuid,
|
||||
// What the sketch is on (can be a plane or a face).
|
||||
on: {
|
||||
// The id of the plane.
|
||||
id: uuid,
|
||||
// Origin of the plane.
|
||||
origin: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
type: "plane",
|
||||
// Type for a plane.
|
||||
value: "XY" | "XZ" | "YZ" | "Custom",
|
||||
// What should the plane’s X axis be?
|
||||
xAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
// What should the plane’s Y axis be?
|
||||
yAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
// The z-axis (normal).
|
||||
zAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
} |
|
||||
{
|
||||
// The extrude group the face is on.
|
||||
extrudeGroup: {
|
||||
// The id of the extrusion end cap
|
||||
endCapId: uuid,
|
||||
// Chamfers or fillets on this extrude group.
|
||||
filletOrChamfers: [{
|
||||
// The engine id of the edge to fillet.
|
||||
edge_id: uuid,
|
||||
// The id of the engine command that called this fillet.
|
||||
id: uuid,
|
||||
radius: number,
|
||||
type: "fillet",
|
||||
} |
|
||||
{
|
||||
// The engine id of the edge to chamfer.
|
||||
edge_id: uuid,
|
||||
// The id of the engine command that called this chamfer.
|
||||
id: uuid,
|
||||
length: number,
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "chamfer",
|
||||
}],
|
||||
// The height of the extrude group.
|
||||
height: number,
|
||||
// The id of the extrude group.
|
||||
id: uuid,
|
||||
// The sketch group.
|
||||
sketchGroup: SketchGroup,
|
||||
// The id of the extrusion start cap
|
||||
startCapId: uuid,
|
||||
// The extrude surfaces.
|
||||
value: [{
|
||||
// The face id for the extrude plane.
|
||||
faceId: uuid,
|
||||
// The id of the geometry.
|
||||
id: uuid,
|
||||
// The source range.
|
||||
sourceRange: [number, number],
|
||||
// The tag.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "extrudePlane",
|
||||
} |
|
||||
{
|
||||
// The face id for the extrude plane.
|
||||
faceId: uuid,
|
||||
// The id of the geometry.
|
||||
id: uuid,
|
||||
// The source range.
|
||||
sourceRange: [number, number],
|
||||
// The tag.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "extrudeArc",
|
||||
}],
|
||||
},
|
||||
// The id of the face.
|
||||
id: uuid,
|
||||
type: "face",
|
||||
// The tag of the face.
|
||||
value: string,
|
||||
// What should the face’s X axis be?
|
||||
xAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
// What should the face’s Y axis be?
|
||||
yAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
// The z-axis (normal).
|
||||
zAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
},
|
||||
// The starting path.
|
||||
start: {
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
},
|
||||
// Tag identifiers that have been declared in this sketch group.
|
||||
tags: {
|
||||
},
|
||||
// The paths in the sketch group.
|
||||
value: [{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "ToPoint",
|
||||
@ -68,8 +238,12 @@ const example = extrude(5, exampleSketch)
|
||||
center: [number, number],
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArcTo",
|
||||
@ -77,8 +251,12 @@ const example = extrude(5, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArc",
|
||||
@ -86,8 +264,12 @@ const example = extrude(5, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Horizontal",
|
||||
@ -97,8 +279,12 @@ const example = extrude(5, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "AngledLineTo",
|
||||
@ -110,12 +296,17 @@ const example = extrude(5, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Base",
|
||||
}],
|
||||
},
|
||||
// The id of the extrusion start cap
|
||||
startCapId: uuid,
|
||||
// The extrude surfaces.
|
||||
@ -124,14 +315,14 @@ const example = extrude(5, exampleSketch)
|
||||
faceId: uuid,
|
||||
// The id of the geometry.
|
||||
id: uuid,
|
||||
// The name.
|
||||
name: string,
|
||||
// The position.
|
||||
position: [number, number, number],
|
||||
// The rotation.
|
||||
rotation: [number, number, number, number],
|
||||
// The source range.
|
||||
sourceRange: [number, number],
|
||||
// The tag.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "extrudePlane",
|
||||
} |
|
||||
{
|
||||
@ -139,34 +330,16 @@ const example = extrude(5, exampleSketch)
|
||||
faceId: uuid,
|
||||
// The id of the geometry.
|
||||
id: uuid,
|
||||
// The name.
|
||||
name: string,
|
||||
// The position.
|
||||
position: [number, number, number],
|
||||
// The rotation.
|
||||
rotation: [number, number, number, number],
|
||||
// The source range.
|
||||
sourceRange: [number, number],
|
||||
// The tag.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "extrudeArc",
|
||||
}],
|
||||
// The x-axis of the extrude group base plane in the 3D space
|
||||
xAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
// The y-axis of the extrude group base plane in the 3D space
|
||||
yAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
// The z-axis of the extrude group base plane in the 3D space
|
||||
zAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
@ -48,20 +48,185 @@ const part001 = startSketchOn('XY')
|
||||
{
|
||||
// The id of the extrusion end cap
|
||||
endCapId: uuid,
|
||||
// Chamfers or fillets on this extrude group.
|
||||
filletOrChamfers: [{
|
||||
// The engine id of the edge to fillet.
|
||||
edge_id: uuid,
|
||||
// The id of the engine command that called this fillet.
|
||||
id: uuid,
|
||||
radius: number,
|
||||
type: "fillet",
|
||||
} |
|
||||
{
|
||||
// The engine id of the edge to chamfer.
|
||||
edge_id: uuid,
|
||||
// The id of the engine command that called this chamfer.
|
||||
id: uuid,
|
||||
length: number,
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "chamfer",
|
||||
}],
|
||||
// The height of the extrude group.
|
||||
height: number,
|
||||
// The id of the extrude group.
|
||||
id: uuid,
|
||||
// The position of the extrude group.
|
||||
position: [number, number, number],
|
||||
// The rotation of the extrude group.
|
||||
rotation: [number, number, number, number],
|
||||
// The sketch group paths.
|
||||
sketchGroupValues: [{
|
||||
// The sketch group.
|
||||
sketchGroup: {
|
||||
// The id of the sketch group.
|
||||
id: uuid,
|
||||
// What the sketch is on (can be a plane or a face).
|
||||
on: {
|
||||
// The id of the plane.
|
||||
id: uuid,
|
||||
// Origin of the plane.
|
||||
origin: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
type: "plane",
|
||||
// Type for a plane.
|
||||
value: "XY" | "XZ" | "YZ" | "Custom",
|
||||
// What should the plane’s X axis be?
|
||||
xAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
// What should the plane’s Y axis be?
|
||||
yAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
// The z-axis (normal).
|
||||
zAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
} |
|
||||
{
|
||||
// The extrude group the face is on.
|
||||
extrudeGroup: {
|
||||
// The id of the extrusion end cap
|
||||
endCapId: uuid,
|
||||
// Chamfers or fillets on this extrude group.
|
||||
filletOrChamfers: [{
|
||||
// The engine id of the edge to fillet.
|
||||
edge_id: uuid,
|
||||
// The id of the engine command that called this fillet.
|
||||
id: uuid,
|
||||
radius: number,
|
||||
type: "fillet",
|
||||
} |
|
||||
{
|
||||
// The engine id of the edge to chamfer.
|
||||
edge_id: uuid,
|
||||
// The id of the engine command that called this chamfer.
|
||||
id: uuid,
|
||||
length: number,
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "chamfer",
|
||||
}],
|
||||
// The height of the extrude group.
|
||||
height: number,
|
||||
// The id of the extrude group.
|
||||
id: uuid,
|
||||
// The sketch group.
|
||||
sketchGroup: SketchGroup,
|
||||
// The id of the extrusion start cap
|
||||
startCapId: uuid,
|
||||
// The extrude surfaces.
|
||||
value: [{
|
||||
// The face id for the extrude plane.
|
||||
faceId: uuid,
|
||||
// The id of the geometry.
|
||||
id: uuid,
|
||||
// The source range.
|
||||
sourceRange: [number, number],
|
||||
// The tag.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "extrudePlane",
|
||||
} |
|
||||
{
|
||||
// The face id for the extrude plane.
|
||||
faceId: uuid,
|
||||
// The id of the geometry.
|
||||
id: uuid,
|
||||
// The source range.
|
||||
sourceRange: [number, number],
|
||||
// The tag.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "extrudeArc",
|
||||
}],
|
||||
},
|
||||
// The id of the face.
|
||||
id: uuid,
|
||||
type: "face",
|
||||
// The tag of the face.
|
||||
value: string,
|
||||
// What should the face’s X axis be?
|
||||
xAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
// What should the face’s Y axis be?
|
||||
yAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
// The z-axis (normal).
|
||||
zAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
},
|
||||
// The starting path.
|
||||
start: {
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
},
|
||||
// Tag identifiers that have been declared in this sketch group.
|
||||
tags: {
|
||||
},
|
||||
// The paths in the sketch group.
|
||||
value: [{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "ToPoint",
|
||||
@ -73,8 +238,12 @@ const part001 = startSketchOn('XY')
|
||||
center: [number, number],
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArcTo",
|
||||
@ -82,8 +251,12 @@ const part001 = startSketchOn('XY')
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArc",
|
||||
@ -91,8 +264,12 @@ const part001 = startSketchOn('XY')
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Horizontal",
|
||||
@ -102,8 +279,12 @@ const part001 = startSketchOn('XY')
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "AngledLineTo",
|
||||
@ -115,12 +296,17 @@ const part001 = startSketchOn('XY')
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Base",
|
||||
}],
|
||||
},
|
||||
// The id of the extrusion start cap
|
||||
startCapId: uuid,
|
||||
// The extrude surfaces.
|
||||
@ -129,14 +315,14 @@ const part001 = startSketchOn('XY')
|
||||
faceId: uuid,
|
||||
// The id of the geometry.
|
||||
id: uuid,
|
||||
// The name.
|
||||
name: string,
|
||||
// The position.
|
||||
position: [number, number, number],
|
||||
// The rotation.
|
||||
rotation: [number, number, number, number],
|
||||
// The source range.
|
||||
sourceRange: [number, number],
|
||||
// The tag.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "extrudePlane",
|
||||
} |
|
||||
{
|
||||
@ -144,34 +330,16 @@ const part001 = startSketchOn('XY')
|
||||
faceId: uuid,
|
||||
// The id of the geometry.
|
||||
id: uuid,
|
||||
// The name.
|
||||
name: string,
|
||||
// The position.
|
||||
position: [number, number, number],
|
||||
// The rotation.
|
||||
rotation: [number, number, number, number],
|
||||
// The source range.
|
||||
sourceRange: [number, number],
|
||||
// The tag.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "extrudeArc",
|
||||
}],
|
||||
// The x-axis of the extrude group base plane in the 3D space
|
||||
xAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
// The y-axis of the extrude group base plane in the 3D space
|
||||
yAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
// The z-axis of the extrude group base plane in the 3D space
|
||||
zAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
}
|
||||
```
|
||||
|
||||
@ -182,20 +350,185 @@ const part001 = startSketchOn('XY')
|
||||
{
|
||||
// The id of the extrusion end cap
|
||||
endCapId: uuid,
|
||||
// Chamfers or fillets on this extrude group.
|
||||
filletOrChamfers: [{
|
||||
// The engine id of the edge to fillet.
|
||||
edge_id: uuid,
|
||||
// The id of the engine command that called this fillet.
|
||||
id: uuid,
|
||||
radius: number,
|
||||
type: "fillet",
|
||||
} |
|
||||
{
|
||||
// The engine id of the edge to chamfer.
|
||||
edge_id: uuid,
|
||||
// The id of the engine command that called this chamfer.
|
||||
id: uuid,
|
||||
length: number,
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "chamfer",
|
||||
}],
|
||||
// The height of the extrude group.
|
||||
height: number,
|
||||
// The id of the extrude group.
|
||||
id: uuid,
|
||||
// The position of the extrude group.
|
||||
position: [number, number, number],
|
||||
// The rotation of the extrude group.
|
||||
rotation: [number, number, number, number],
|
||||
// The sketch group paths.
|
||||
sketchGroupValues: [{
|
||||
// The sketch group.
|
||||
sketchGroup: {
|
||||
// The id of the sketch group.
|
||||
id: uuid,
|
||||
// What the sketch is on (can be a plane or a face).
|
||||
on: {
|
||||
// The id of the plane.
|
||||
id: uuid,
|
||||
// Origin of the plane.
|
||||
origin: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
type: "plane",
|
||||
// Type for a plane.
|
||||
value: "XY" | "XZ" | "YZ" | "Custom",
|
||||
// What should the plane’s X axis be?
|
||||
xAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
// What should the plane’s Y axis be?
|
||||
yAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
// The z-axis (normal).
|
||||
zAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
} |
|
||||
{
|
||||
// The extrude group the face is on.
|
||||
extrudeGroup: {
|
||||
// The id of the extrusion end cap
|
||||
endCapId: uuid,
|
||||
// Chamfers or fillets on this extrude group.
|
||||
filletOrChamfers: [{
|
||||
// The engine id of the edge to fillet.
|
||||
edge_id: uuid,
|
||||
// The id of the engine command that called this fillet.
|
||||
id: uuid,
|
||||
radius: number,
|
||||
type: "fillet",
|
||||
} |
|
||||
{
|
||||
// The engine id of the edge to chamfer.
|
||||
edge_id: uuid,
|
||||
// The id of the engine command that called this chamfer.
|
||||
id: uuid,
|
||||
length: number,
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "chamfer",
|
||||
}],
|
||||
// The height of the extrude group.
|
||||
height: number,
|
||||
// The id of the extrude group.
|
||||
id: uuid,
|
||||
// The sketch group.
|
||||
sketchGroup: SketchGroup,
|
||||
// The id of the extrusion start cap
|
||||
startCapId: uuid,
|
||||
// The extrude surfaces.
|
||||
value: [{
|
||||
// The face id for the extrude plane.
|
||||
faceId: uuid,
|
||||
// The id of the geometry.
|
||||
id: uuid,
|
||||
// The source range.
|
||||
sourceRange: [number, number],
|
||||
// The tag.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "extrudePlane",
|
||||
} |
|
||||
{
|
||||
// The face id for the extrude plane.
|
||||
faceId: uuid,
|
||||
// The id of the geometry.
|
||||
id: uuid,
|
||||
// The source range.
|
||||
sourceRange: [number, number],
|
||||
// The tag.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "extrudeArc",
|
||||
}],
|
||||
},
|
||||
// The id of the face.
|
||||
id: uuid,
|
||||
type: "face",
|
||||
// The tag of the face.
|
||||
value: string,
|
||||
// What should the face’s X axis be?
|
||||
xAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
// What should the face’s Y axis be?
|
||||
yAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
// The z-axis (normal).
|
||||
zAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
},
|
||||
// The starting path.
|
||||
start: {
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
},
|
||||
// Tag identifiers that have been declared in this sketch group.
|
||||
tags: {
|
||||
},
|
||||
// The paths in the sketch group.
|
||||
value: [{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "ToPoint",
|
||||
@ -207,8 +540,12 @@ const part001 = startSketchOn('XY')
|
||||
center: [number, number],
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArcTo",
|
||||
@ -216,8 +553,12 @@ const part001 = startSketchOn('XY')
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArc",
|
||||
@ -225,8 +566,12 @@ const part001 = startSketchOn('XY')
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Horizontal",
|
||||
@ -236,8 +581,12 @@ const part001 = startSketchOn('XY')
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "AngledLineTo",
|
||||
@ -249,12 +598,17 @@ const part001 = startSketchOn('XY')
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Base",
|
||||
}],
|
||||
},
|
||||
// The id of the extrusion start cap
|
||||
startCapId: uuid,
|
||||
// The extrude surfaces.
|
||||
@ -263,14 +617,14 @@ const part001 = startSketchOn('XY')
|
||||
faceId: uuid,
|
||||
// The id of the geometry.
|
||||
id: uuid,
|
||||
// The name.
|
||||
name: string,
|
||||
// The position.
|
||||
position: [number, number, number],
|
||||
// The rotation.
|
||||
rotation: [number, number, number, number],
|
||||
// The source range.
|
||||
sourceRange: [number, number],
|
||||
// The tag.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "extrudePlane",
|
||||
} |
|
||||
{
|
||||
@ -278,34 +632,16 @@ const part001 = startSketchOn('XY')
|
||||
faceId: uuid,
|
||||
// The id of the geometry.
|
||||
id: uuid,
|
||||
// The name.
|
||||
name: string,
|
||||
// The position.
|
||||
position: [number, number, number],
|
||||
// The rotation.
|
||||
rotation: [number, number, number, number],
|
||||
// The source range.
|
||||
sourceRange: [number, number],
|
||||
// The tag.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "extrudeArc",
|
||||
}],
|
||||
// The x-axis of the extrude group base plane in the 3D space
|
||||
xAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
// The y-axis of the extrude group base plane in the 3D space
|
||||
yAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
// The z-axis of the extrude group base plane in the 3D space
|
||||
zAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
783
docs/kcl/hole.md
@ -53,8 +53,6 @@ const example = extrude(1, exampleSketch)
|
||||
* `hole_sketch_group`: `SketchGroupSet` - A sketch group or a group of sketch groups. (REQUIRED)
|
||||
```js
|
||||
{
|
||||
// The plane id or face id of the sketch group.
|
||||
entityId: uuid,
|
||||
// The id of the sketch group.
|
||||
id: uuid,
|
||||
// What the sketch is on (can be a plane or a face).
|
||||
@ -90,12 +88,184 @@ const example = extrude(1, exampleSketch)
|
||||
},
|
||||
} |
|
||||
{
|
||||
// the face id the sketch is on
|
||||
// The extrude group the face is on.
|
||||
extrudeGroup: {
|
||||
// The id of the extrusion end cap
|
||||
endCapId: uuid,
|
||||
// Chamfers or fillets on this extrude group.
|
||||
filletOrChamfers: [{
|
||||
// The engine id of the edge to fillet.
|
||||
edge_id: uuid,
|
||||
// The id of the engine command that called this fillet.
|
||||
id: uuid,
|
||||
radius: number,
|
||||
type: "fillet",
|
||||
} |
|
||||
{
|
||||
// The engine id of the edge to chamfer.
|
||||
edge_id: uuid,
|
||||
// The id of the engine command that called this chamfer.
|
||||
id: uuid,
|
||||
length: number,
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "chamfer",
|
||||
}],
|
||||
// The height of the extrude group.
|
||||
height: number,
|
||||
// The id of the extrude group.
|
||||
id: uuid,
|
||||
// The sketch group.
|
||||
sketchGroup: {
|
||||
// The id of the sketch group.
|
||||
id: uuid,
|
||||
// What the sketch is on (can be a plane or a face).
|
||||
on: SketchSurface,
|
||||
// The starting path.
|
||||
start: {
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
},
|
||||
// Tag identifiers that have been declared in this sketch group.
|
||||
tags: {
|
||||
},
|
||||
// The paths in the sketch group.
|
||||
value: [{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "ToPoint",
|
||||
} |
|
||||
{
|
||||
// arc's direction
|
||||
ccw: string,
|
||||
// the arc's center
|
||||
center: [number, number],
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArcTo",
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArc",
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Horizontal",
|
||||
// The x coordinate.
|
||||
x: number,
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "AngledLineTo",
|
||||
// The x coordinate.
|
||||
x: number,
|
||||
// The y coordinate.
|
||||
y: number,
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Base",
|
||||
}],
|
||||
},
|
||||
// The id of the extrusion start cap
|
||||
startCapId: uuid,
|
||||
// The extrude surfaces.
|
||||
value: [{
|
||||
// The face id for the extrude plane.
|
||||
faceId: uuid,
|
||||
// The id of the geometry.
|
||||
id: uuid,
|
||||
// The source range.
|
||||
sourceRange: [number, number],
|
||||
// The tag.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "extrudePlane",
|
||||
} |
|
||||
{
|
||||
// The face id for the extrude plane.
|
||||
faceId: uuid,
|
||||
// The id of the geometry.
|
||||
id: uuid,
|
||||
// The source range.
|
||||
sourceRange: [number, number],
|
||||
// The tag.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "extrudeArc",
|
||||
}],
|
||||
},
|
||||
// The id of the face.
|
||||
id: uuid,
|
||||
// The original sketch group id of the object we are sketching on.
|
||||
sketchGroupId: uuid,
|
||||
type: "face",
|
||||
// The tag of the face.
|
||||
value: string,
|
||||
@ -118,26 +288,33 @@ const example = extrude(1, exampleSketch)
|
||||
z: number,
|
||||
},
|
||||
},
|
||||
// The position of the sketch group.
|
||||
position: [number, number, number],
|
||||
// The rotation of the sketch group base plane.
|
||||
rotation: [number, number, number, number],
|
||||
// The starting path.
|
||||
start: {
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
},
|
||||
// Tag identifiers that have been declared in this sketch group.
|
||||
tags: {
|
||||
},
|
||||
type: "sketchGroup",
|
||||
// The paths in the sketch group.
|
||||
value: [{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "ToPoint",
|
||||
@ -149,8 +326,12 @@ const example = extrude(1, exampleSketch)
|
||||
center: [number, number],
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArcTo",
|
||||
@ -158,8 +339,12 @@ const example = extrude(1, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArc",
|
||||
@ -167,8 +352,12 @@ const example = extrude(1, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Horizontal",
|
||||
@ -178,8 +367,12 @@ const example = extrude(1, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "AngledLineTo",
|
||||
@ -191,30 +384,16 @@ const example = extrude(1, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Base",
|
||||
}],
|
||||
// The x-axis of the sketch group base plane in the 3D space
|
||||
xAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
// The y-axis of the sketch group base plane in the 3D space
|
||||
yAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
// The z-axis of the sketch group base plane in the 3D space
|
||||
zAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
} |
|
||||
{
|
||||
type: "sketchGroups",
|
||||
@ -223,8 +402,6 @@ const example = extrude(1, exampleSketch)
|
||||
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
|
||||
```js
|
||||
{
|
||||
// The plane id or face id of the sketch group.
|
||||
entityId: uuid,
|
||||
// The id of the sketch group.
|
||||
id: uuid,
|
||||
// What the sketch is on (can be a plane or a face).
|
||||
@ -260,12 +437,184 @@ const example = extrude(1, exampleSketch)
|
||||
},
|
||||
} |
|
||||
{
|
||||
// the face id the sketch is on
|
||||
// The extrude group the face is on.
|
||||
extrudeGroup: {
|
||||
// The id of the extrusion end cap
|
||||
endCapId: uuid,
|
||||
// Chamfers or fillets on this extrude group.
|
||||
filletOrChamfers: [{
|
||||
// The engine id of the edge to fillet.
|
||||
edge_id: uuid,
|
||||
// The id of the engine command that called this fillet.
|
||||
id: uuid,
|
||||
radius: number,
|
||||
type: "fillet",
|
||||
} |
|
||||
{
|
||||
// The engine id of the edge to chamfer.
|
||||
edge_id: uuid,
|
||||
// The id of the engine command that called this chamfer.
|
||||
id: uuid,
|
||||
length: number,
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "chamfer",
|
||||
}],
|
||||
// The height of the extrude group.
|
||||
height: number,
|
||||
// The id of the extrude group.
|
||||
id: uuid,
|
||||
// The sketch group.
|
||||
sketchGroup: {
|
||||
// The id of the sketch group.
|
||||
id: uuid,
|
||||
// What the sketch is on (can be a plane or a face).
|
||||
on: SketchSurface,
|
||||
// The starting path.
|
||||
start: {
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
},
|
||||
// Tag identifiers that have been declared in this sketch group.
|
||||
tags: {
|
||||
},
|
||||
// The paths in the sketch group.
|
||||
value: [{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "ToPoint",
|
||||
} |
|
||||
{
|
||||
// arc's direction
|
||||
ccw: string,
|
||||
// the arc's center
|
||||
center: [number, number],
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArcTo",
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArc",
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Horizontal",
|
||||
// The x coordinate.
|
||||
x: number,
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "AngledLineTo",
|
||||
// The x coordinate.
|
||||
x: number,
|
||||
// The y coordinate.
|
||||
y: number,
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Base",
|
||||
}],
|
||||
},
|
||||
// The id of the extrusion start cap
|
||||
startCapId: uuid,
|
||||
// The extrude surfaces.
|
||||
value: [{
|
||||
// The face id for the extrude plane.
|
||||
faceId: uuid,
|
||||
// The id of the geometry.
|
||||
id: uuid,
|
||||
// The source range.
|
||||
sourceRange: [number, number],
|
||||
// The tag.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "extrudePlane",
|
||||
} |
|
||||
{
|
||||
// The face id for the extrude plane.
|
||||
faceId: uuid,
|
||||
// The id of the geometry.
|
||||
id: uuid,
|
||||
// The source range.
|
||||
sourceRange: [number, number],
|
||||
// The tag.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "extrudeArc",
|
||||
}],
|
||||
},
|
||||
// The id of the face.
|
||||
id: uuid,
|
||||
// The original sketch group id of the object we are sketching on.
|
||||
sketchGroupId: uuid,
|
||||
type: "face",
|
||||
// The tag of the face.
|
||||
value: string,
|
||||
@ -288,25 +637,32 @@ const example = extrude(1, exampleSketch)
|
||||
z: number,
|
||||
},
|
||||
},
|
||||
// The position of the sketch group.
|
||||
position: [number, number, number],
|
||||
// The rotation of the sketch group base plane.
|
||||
rotation: [number, number, number, number],
|
||||
// The starting path.
|
||||
start: {
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
},
|
||||
// Tag identifiers that have been declared in this sketch group.
|
||||
tags: {
|
||||
},
|
||||
// The paths in the sketch group.
|
||||
value: [{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "ToPoint",
|
||||
@ -318,8 +674,12 @@ const example = extrude(1, exampleSketch)
|
||||
center: [number, number],
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArcTo",
|
||||
@ -327,8 +687,12 @@ const example = extrude(1, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArc",
|
||||
@ -336,8 +700,12 @@ const example = extrude(1, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Horizontal",
|
||||
@ -347,8 +715,12 @@ const example = extrude(1, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "AngledLineTo",
|
||||
@ -360,30 +732,16 @@ const example = extrude(1, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Base",
|
||||
}],
|
||||
// The x-axis of the sketch group base plane in the 3D space
|
||||
xAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
// The y-axis of the sketch group base plane in the 3D space
|
||||
yAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
// The z-axis of the sketch group base plane in the 3D space
|
||||
zAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
}
|
||||
```
|
||||
|
||||
@ -392,8 +750,6 @@ const example = extrude(1, exampleSketch)
|
||||
`SketchGroup` - A sketch group is a collection of paths.
|
||||
```js
|
||||
{
|
||||
// The plane id or face id of the sketch group.
|
||||
entityId: uuid,
|
||||
// The id of the sketch group.
|
||||
id: uuid,
|
||||
// What the sketch is on (can be a plane or a face).
|
||||
@ -429,12 +785,184 @@ const example = extrude(1, exampleSketch)
|
||||
},
|
||||
} |
|
||||
{
|
||||
// the face id the sketch is on
|
||||
// The extrude group the face is on.
|
||||
extrudeGroup: {
|
||||
// The id of the extrusion end cap
|
||||
endCapId: uuid,
|
||||
// Chamfers or fillets on this extrude group.
|
||||
filletOrChamfers: [{
|
||||
// The engine id of the edge to fillet.
|
||||
edge_id: uuid,
|
||||
// The id of the engine command that called this fillet.
|
||||
id: uuid,
|
||||
radius: number,
|
||||
type: "fillet",
|
||||
} |
|
||||
{
|
||||
// The engine id of the edge to chamfer.
|
||||
edge_id: uuid,
|
||||
// The id of the engine command that called this chamfer.
|
||||
id: uuid,
|
||||
length: number,
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "chamfer",
|
||||
}],
|
||||
// The height of the extrude group.
|
||||
height: number,
|
||||
// The id of the extrude group.
|
||||
id: uuid,
|
||||
// The sketch group.
|
||||
sketchGroup: {
|
||||
// The id of the sketch group.
|
||||
id: uuid,
|
||||
// What the sketch is on (can be a plane or a face).
|
||||
on: SketchSurface,
|
||||
// The starting path.
|
||||
start: {
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
},
|
||||
// Tag identifiers that have been declared in this sketch group.
|
||||
tags: {
|
||||
},
|
||||
// The paths in the sketch group.
|
||||
value: [{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "ToPoint",
|
||||
} |
|
||||
{
|
||||
// arc's direction
|
||||
ccw: string,
|
||||
// the arc's center
|
||||
center: [number, number],
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArcTo",
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArc",
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Horizontal",
|
||||
// The x coordinate.
|
||||
x: number,
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "AngledLineTo",
|
||||
// The x coordinate.
|
||||
x: number,
|
||||
// The y coordinate.
|
||||
y: number,
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Base",
|
||||
}],
|
||||
},
|
||||
// The id of the extrusion start cap
|
||||
startCapId: uuid,
|
||||
// The extrude surfaces.
|
||||
value: [{
|
||||
// The face id for the extrude plane.
|
||||
faceId: uuid,
|
||||
// The id of the geometry.
|
||||
id: uuid,
|
||||
// The source range.
|
||||
sourceRange: [number, number],
|
||||
// The tag.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "extrudePlane",
|
||||
} |
|
||||
{
|
||||
// The face id for the extrude plane.
|
||||
faceId: uuid,
|
||||
// The id of the geometry.
|
||||
id: uuid,
|
||||
// The source range.
|
||||
sourceRange: [number, number],
|
||||
// The tag.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "extrudeArc",
|
||||
}],
|
||||
},
|
||||
// The id of the face.
|
||||
id: uuid,
|
||||
// The original sketch group id of the object we are sketching on.
|
||||
sketchGroupId: uuid,
|
||||
type: "face",
|
||||
// The tag of the face.
|
||||
value: string,
|
||||
@ -457,25 +985,32 @@ const example = extrude(1, exampleSketch)
|
||||
z: number,
|
||||
},
|
||||
},
|
||||
// The position of the sketch group.
|
||||
position: [number, number, number],
|
||||
// The rotation of the sketch group base plane.
|
||||
rotation: [number, number, number, number],
|
||||
// The starting path.
|
||||
start: {
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
},
|
||||
// Tag identifiers that have been declared in this sketch group.
|
||||
tags: {
|
||||
},
|
||||
// The paths in the sketch group.
|
||||
value: [{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "ToPoint",
|
||||
@ -487,8 +1022,12 @@ const example = extrude(1, exampleSketch)
|
||||
center: [number, number],
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArcTo",
|
||||
@ -496,8 +1035,12 @@ const example = extrude(1, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArc",
|
||||
@ -505,8 +1048,12 @@ const example = extrude(1, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Horizontal",
|
||||
@ -516,8 +1063,12 @@ const example = extrude(1, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "AngledLineTo",
|
||||
@ -529,30 +1080,16 @@ const example = extrude(1, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Base",
|
||||
}],
|
||||
// The x-axis of the sketch group base plane in the 3D space
|
||||
xAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
// The y-axis of the sketch group base plane in the 3D space
|
||||
yAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
// The z-axis of the sketch group base plane in the 3D space
|
||||
zAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
@ -23,6 +23,7 @@ layout: manual
|
||||
* [`atan`](kcl/atan)
|
||||
* [`bezierCurve`](kcl/bezierCurve)
|
||||
* [`ceil`](kcl/ceil)
|
||||
* [`chamfer`](kcl/chamfer)
|
||||
* [`circle`](kcl/circle)
|
||||
* [`close`](kcl/close)
|
||||
* [`cos`](kcl/cos)
|
||||
@ -54,6 +55,7 @@ layout: manual
|
||||
* [`patternCircular3d`](kcl/patternCircular3d)
|
||||
* [`patternLinear2d`](kcl/patternLinear2d)
|
||||
* [`patternLinear3d`](kcl/patternLinear3d)
|
||||
* [`patternTransform`](kcl/patternTransform)
|
||||
* [`pi`](kcl/pi)
|
||||
* [`pow`](kcl/pow)
|
||||
* [`profileStart`](kcl/profileStart)
|
||||
@ -64,6 +66,7 @@ layout: manual
|
||||
* [`segEndX`](kcl/segEndX)
|
||||
* [`segEndY`](kcl/segEndY)
|
||||
* [`segLen`](kcl/segLen)
|
||||
* [`shell`](kcl/shell)
|
||||
* [`sin`](kcl/sin)
|
||||
* [`sqrt`](kcl/sqrt)
|
||||
* [`startProfileAt`](kcl/startProfileAt)
|
||||
|
||||
@ -33,8 +33,6 @@ const example = extrude(5, exampleSketch)
|
||||
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
|
||||
```js
|
||||
{
|
||||
// The plane id or face id of the sketch group.
|
||||
entityId: uuid,
|
||||
// The id of the sketch group.
|
||||
id: uuid,
|
||||
// What the sketch is on (can be a plane or a face).
|
||||
@ -70,12 +68,184 @@ const example = extrude(5, exampleSketch)
|
||||
},
|
||||
} |
|
||||
{
|
||||
// the face id the sketch is on
|
||||
// The extrude group the face is on.
|
||||
extrudeGroup: {
|
||||
// The id of the extrusion end cap
|
||||
endCapId: uuid,
|
||||
// Chamfers or fillets on this extrude group.
|
||||
filletOrChamfers: [{
|
||||
// The engine id of the edge to fillet.
|
||||
edge_id: uuid,
|
||||
// The id of the engine command that called this fillet.
|
||||
id: uuid,
|
||||
radius: number,
|
||||
type: "fillet",
|
||||
} |
|
||||
{
|
||||
// The engine id of the edge to chamfer.
|
||||
edge_id: uuid,
|
||||
// The id of the engine command that called this chamfer.
|
||||
id: uuid,
|
||||
length: number,
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "chamfer",
|
||||
}],
|
||||
// The height of the extrude group.
|
||||
height: number,
|
||||
// The id of the extrude group.
|
||||
id: uuid,
|
||||
// The sketch group.
|
||||
sketchGroup: {
|
||||
// The id of the sketch group.
|
||||
id: uuid,
|
||||
// What the sketch is on (can be a plane or a face).
|
||||
on: SketchSurface,
|
||||
// The starting path.
|
||||
start: {
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
},
|
||||
// Tag identifiers that have been declared in this sketch group.
|
||||
tags: {
|
||||
},
|
||||
// The paths in the sketch group.
|
||||
value: [{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "ToPoint",
|
||||
} |
|
||||
{
|
||||
// arc's direction
|
||||
ccw: string,
|
||||
// the arc's center
|
||||
center: [number, number],
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArcTo",
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArc",
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Horizontal",
|
||||
// The x coordinate.
|
||||
x: number,
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "AngledLineTo",
|
||||
// The x coordinate.
|
||||
x: number,
|
||||
// The y coordinate.
|
||||
y: number,
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Base",
|
||||
}],
|
||||
},
|
||||
// The id of the extrusion start cap
|
||||
startCapId: uuid,
|
||||
// The extrude surfaces.
|
||||
value: [{
|
||||
// The face id for the extrude plane.
|
||||
faceId: uuid,
|
||||
// The id of the geometry.
|
||||
id: uuid,
|
||||
// The source range.
|
||||
sourceRange: [number, number],
|
||||
// The tag.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "extrudePlane",
|
||||
} |
|
||||
{
|
||||
// The face id for the extrude plane.
|
||||
faceId: uuid,
|
||||
// The id of the geometry.
|
||||
id: uuid,
|
||||
// The source range.
|
||||
sourceRange: [number, number],
|
||||
// The tag.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "extrudeArc",
|
||||
}],
|
||||
},
|
||||
// The id of the face.
|
||||
id: uuid,
|
||||
// The original sketch group id of the object we are sketching on.
|
||||
sketchGroupId: uuid,
|
||||
type: "face",
|
||||
// The tag of the face.
|
||||
value: string,
|
||||
@ -98,25 +268,32 @@ const example = extrude(5, exampleSketch)
|
||||
z: number,
|
||||
},
|
||||
},
|
||||
// The position of the sketch group.
|
||||
position: [number, number, number],
|
||||
// The rotation of the sketch group base plane.
|
||||
rotation: [number, number, number, number],
|
||||
// The starting path.
|
||||
start: {
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
},
|
||||
// Tag identifiers that have been declared in this sketch group.
|
||||
tags: {
|
||||
},
|
||||
// The paths in the sketch group.
|
||||
value: [{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "ToPoint",
|
||||
@ -128,8 +305,12 @@ const example = extrude(5, exampleSketch)
|
||||
center: [number, number],
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArcTo",
|
||||
@ -137,8 +318,12 @@ const example = extrude(5, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArc",
|
||||
@ -146,8 +331,12 @@ const example = extrude(5, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Horizontal",
|
||||
@ -157,8 +346,12 @@ const example = extrude(5, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "AngledLineTo",
|
||||
@ -170,30 +363,16 @@ const example = extrude(5, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Base",
|
||||
}],
|
||||
// The x-axis of the sketch group base plane in the 3D space
|
||||
xAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
// The y-axis of the sketch group base plane in the 3D space
|
||||
yAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
// The z-axis of the sketch group base plane in the 3D space
|
||||
zAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
@ -33,8 +33,6 @@ const example = extrude(5, exampleSketch)
|
||||
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
|
||||
```js
|
||||
{
|
||||
// The plane id or face id of the sketch group.
|
||||
entityId: uuid,
|
||||
// The id of the sketch group.
|
||||
id: uuid,
|
||||
// What the sketch is on (can be a plane or a face).
|
||||
@ -70,12 +68,184 @@ const example = extrude(5, exampleSketch)
|
||||
},
|
||||
} |
|
||||
{
|
||||
// the face id the sketch is on
|
||||
// The extrude group the face is on.
|
||||
extrudeGroup: {
|
||||
// The id of the extrusion end cap
|
||||
endCapId: uuid,
|
||||
// Chamfers or fillets on this extrude group.
|
||||
filletOrChamfers: [{
|
||||
// The engine id of the edge to fillet.
|
||||
edge_id: uuid,
|
||||
// The id of the engine command that called this fillet.
|
||||
id: uuid,
|
||||
radius: number,
|
||||
type: "fillet",
|
||||
} |
|
||||
{
|
||||
// The engine id of the edge to chamfer.
|
||||
edge_id: uuid,
|
||||
// The id of the engine command that called this chamfer.
|
||||
id: uuid,
|
||||
length: number,
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "chamfer",
|
||||
}],
|
||||
// The height of the extrude group.
|
||||
height: number,
|
||||
// The id of the extrude group.
|
||||
id: uuid,
|
||||
// The sketch group.
|
||||
sketchGroup: {
|
||||
// The id of the sketch group.
|
||||
id: uuid,
|
||||
// What the sketch is on (can be a plane or a face).
|
||||
on: SketchSurface,
|
||||
// The starting path.
|
||||
start: {
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
},
|
||||
// Tag identifiers that have been declared in this sketch group.
|
||||
tags: {
|
||||
},
|
||||
// The paths in the sketch group.
|
||||
value: [{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "ToPoint",
|
||||
} |
|
||||
{
|
||||
// arc's direction
|
||||
ccw: string,
|
||||
// the arc's center
|
||||
center: [number, number],
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArcTo",
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArc",
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Horizontal",
|
||||
// The x coordinate.
|
||||
x: number,
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "AngledLineTo",
|
||||
// The x coordinate.
|
||||
x: number,
|
||||
// The y coordinate.
|
||||
y: number,
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Base",
|
||||
}],
|
||||
},
|
||||
// The id of the extrusion start cap
|
||||
startCapId: uuid,
|
||||
// The extrude surfaces.
|
||||
value: [{
|
||||
// The face id for the extrude plane.
|
||||
faceId: uuid,
|
||||
// The id of the geometry.
|
||||
id: uuid,
|
||||
// The source range.
|
||||
sourceRange: [number, number],
|
||||
// The tag.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "extrudePlane",
|
||||
} |
|
||||
{
|
||||
// The face id for the extrude plane.
|
||||
faceId: uuid,
|
||||
// The id of the geometry.
|
||||
id: uuid,
|
||||
// The source range.
|
||||
sourceRange: [number, number],
|
||||
// The tag.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "extrudeArc",
|
||||
}],
|
||||
},
|
||||
// The id of the face.
|
||||
id: uuid,
|
||||
// The original sketch group id of the object we are sketching on.
|
||||
sketchGroupId: uuid,
|
||||
type: "face",
|
||||
// The tag of the face.
|
||||
value: string,
|
||||
@ -98,25 +268,32 @@ const example = extrude(5, exampleSketch)
|
||||
z: number,
|
||||
},
|
||||
},
|
||||
// The position of the sketch group.
|
||||
position: [number, number, number],
|
||||
// The rotation of the sketch group base plane.
|
||||
rotation: [number, number, number, number],
|
||||
// The starting path.
|
||||
start: {
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
},
|
||||
// Tag identifiers that have been declared in this sketch group.
|
||||
tags: {
|
||||
},
|
||||
// The paths in the sketch group.
|
||||
value: [{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "ToPoint",
|
||||
@ -128,8 +305,12 @@ const example = extrude(5, exampleSketch)
|
||||
center: [number, number],
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArcTo",
|
||||
@ -137,8 +318,12 @@ const example = extrude(5, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArc",
|
||||
@ -146,8 +331,12 @@ const example = extrude(5, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Horizontal",
|
||||
@ -157,8 +346,12 @@ const example = extrude(5, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "AngledLineTo",
|
||||
@ -170,30 +363,16 @@ const example = extrude(5, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Base",
|
||||
}],
|
||||
// The x-axis of the sketch group base plane in the 3D space
|
||||
xAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
// The y-axis of the sketch group base plane in the 3D space
|
||||
yAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
// The z-axis of the sketch group base plane in the 3D space
|
||||
zAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
533
docs/kcl/line.md
@ -9,7 +9,7 @@ Draw a line.
|
||||
|
||||
|
||||
```js
|
||||
line(delta: [number], sketch_group: SketchGroup, tag?: String) -> SketchGroup
|
||||
line(delta: [number], sketch_group: SketchGroup, tag?: TagDeclarator) -> SketchGroup
|
||||
```
|
||||
|
||||
### Examples
|
||||
@ -46,8 +46,6 @@ const example = extrude(5, exampleSketch)
|
||||
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
|
||||
```js
|
||||
{
|
||||
// The plane id or face id of the sketch group.
|
||||
entityId: uuid,
|
||||
// The id of the sketch group.
|
||||
id: uuid,
|
||||
// What the sketch is on (can be a plane or a face).
|
||||
@ -83,12 +81,184 @@ const example = extrude(5, exampleSketch)
|
||||
},
|
||||
} |
|
||||
{
|
||||
// the face id the sketch is on
|
||||
// The extrude group the face is on.
|
||||
extrudeGroup: {
|
||||
// The id of the extrusion end cap
|
||||
endCapId: uuid,
|
||||
// Chamfers or fillets on this extrude group.
|
||||
filletOrChamfers: [{
|
||||
// The engine id of the edge to fillet.
|
||||
edge_id: uuid,
|
||||
// The id of the engine command that called this fillet.
|
||||
id: uuid,
|
||||
radius: number,
|
||||
type: "fillet",
|
||||
} |
|
||||
{
|
||||
// The engine id of the edge to chamfer.
|
||||
edge_id: uuid,
|
||||
// The id of the engine command that called this chamfer.
|
||||
id: uuid,
|
||||
length: number,
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "chamfer",
|
||||
}],
|
||||
// The height of the extrude group.
|
||||
height: number,
|
||||
// The id of the extrude group.
|
||||
id: uuid,
|
||||
// The sketch group.
|
||||
sketchGroup: {
|
||||
// The id of the sketch group.
|
||||
id: uuid,
|
||||
// What the sketch is on (can be a plane or a face).
|
||||
on: SketchSurface,
|
||||
// The starting path.
|
||||
start: {
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
},
|
||||
// Tag identifiers that have been declared in this sketch group.
|
||||
tags: {
|
||||
},
|
||||
// The paths in the sketch group.
|
||||
value: [{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "ToPoint",
|
||||
} |
|
||||
{
|
||||
// arc's direction
|
||||
ccw: string,
|
||||
// the arc's center
|
||||
center: [number, number],
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArcTo",
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArc",
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Horizontal",
|
||||
// The x coordinate.
|
||||
x: number,
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "AngledLineTo",
|
||||
// The x coordinate.
|
||||
x: number,
|
||||
// The y coordinate.
|
||||
y: number,
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Base",
|
||||
}],
|
||||
},
|
||||
// The id of the extrusion start cap
|
||||
startCapId: uuid,
|
||||
// The extrude surfaces.
|
||||
value: [{
|
||||
// The face id for the extrude plane.
|
||||
faceId: uuid,
|
||||
// The id of the geometry.
|
||||
id: uuid,
|
||||
// The source range.
|
||||
sourceRange: [number, number],
|
||||
// The tag.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "extrudePlane",
|
||||
} |
|
||||
{
|
||||
// The face id for the extrude plane.
|
||||
faceId: uuid,
|
||||
// The id of the geometry.
|
||||
id: uuid,
|
||||
// The source range.
|
||||
sourceRange: [number, number],
|
||||
// The tag.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "extrudeArc",
|
||||
}],
|
||||
},
|
||||
// The id of the face.
|
||||
id: uuid,
|
||||
// The original sketch group id of the object we are sketching on.
|
||||
sketchGroupId: uuid,
|
||||
type: "face",
|
||||
// The tag of the face.
|
||||
value: string,
|
||||
@ -111,25 +281,32 @@ const example = extrude(5, exampleSketch)
|
||||
z: number,
|
||||
},
|
||||
},
|
||||
// The position of the sketch group.
|
||||
position: [number, number, number],
|
||||
// The rotation of the sketch group base plane.
|
||||
rotation: [number, number, number, number],
|
||||
// The starting path.
|
||||
start: {
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
},
|
||||
// Tag identifiers that have been declared in this sketch group.
|
||||
tags: {
|
||||
},
|
||||
// The paths in the sketch group.
|
||||
value: [{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "ToPoint",
|
||||
@ -141,8 +318,12 @@ const example = extrude(5, exampleSketch)
|
||||
center: [number, number],
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArcTo",
|
||||
@ -150,8 +331,12 @@ const example = extrude(5, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArc",
|
||||
@ -159,8 +344,12 @@ const example = extrude(5, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Horizontal",
|
||||
@ -170,8 +359,12 @@ const example = extrude(5, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "AngledLineTo",
|
||||
@ -183,41 +376,32 @@ const example = extrude(5, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Base",
|
||||
}],
|
||||
// The x-axis of the sketch group base plane in the 3D space
|
||||
xAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
// The y-axis of the sketch group base plane in the 3D space
|
||||
yAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
// The z-axis of the sketch group base plane in the 3D space
|
||||
zAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
}
|
||||
```
|
||||
* `tag`: `String` (OPTIONAL)
|
||||
* `tag`: `TagDeclarator` (OPTIONAL)
|
||||
```js
|
||||
{
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
}
|
||||
```
|
||||
|
||||
### Returns
|
||||
|
||||
`SketchGroup` - A sketch group is a collection of paths.
|
||||
```js
|
||||
{
|
||||
// The plane id or face id of the sketch group.
|
||||
entityId: uuid,
|
||||
// The id of the sketch group.
|
||||
id: uuid,
|
||||
// What the sketch is on (can be a plane or a face).
|
||||
@ -253,12 +437,184 @@ const example = extrude(5, exampleSketch)
|
||||
},
|
||||
} |
|
||||
{
|
||||
// the face id the sketch is on
|
||||
// The extrude group the face is on.
|
||||
extrudeGroup: {
|
||||
// The id of the extrusion end cap
|
||||
endCapId: uuid,
|
||||
// Chamfers or fillets on this extrude group.
|
||||
filletOrChamfers: [{
|
||||
// The engine id of the edge to fillet.
|
||||
edge_id: uuid,
|
||||
// The id of the engine command that called this fillet.
|
||||
id: uuid,
|
||||
radius: number,
|
||||
type: "fillet",
|
||||
} |
|
||||
{
|
||||
// The engine id of the edge to chamfer.
|
||||
edge_id: uuid,
|
||||
// The id of the engine command that called this chamfer.
|
||||
id: uuid,
|
||||
length: number,
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "chamfer",
|
||||
}],
|
||||
// The height of the extrude group.
|
||||
height: number,
|
||||
// The id of the extrude group.
|
||||
id: uuid,
|
||||
// The sketch group.
|
||||
sketchGroup: {
|
||||
// The id of the sketch group.
|
||||
id: uuid,
|
||||
// What the sketch is on (can be a plane or a face).
|
||||
on: SketchSurface,
|
||||
// The starting path.
|
||||
start: {
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
},
|
||||
// Tag identifiers that have been declared in this sketch group.
|
||||
tags: {
|
||||
},
|
||||
// The paths in the sketch group.
|
||||
value: [{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "ToPoint",
|
||||
} |
|
||||
{
|
||||
// arc's direction
|
||||
ccw: string,
|
||||
// the arc's center
|
||||
center: [number, number],
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArcTo",
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArc",
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Horizontal",
|
||||
// The x coordinate.
|
||||
x: number,
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "AngledLineTo",
|
||||
// The x coordinate.
|
||||
x: number,
|
||||
// The y coordinate.
|
||||
y: number,
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Base",
|
||||
}],
|
||||
},
|
||||
// The id of the extrusion start cap
|
||||
startCapId: uuid,
|
||||
// The extrude surfaces.
|
||||
value: [{
|
||||
// The face id for the extrude plane.
|
||||
faceId: uuid,
|
||||
// The id of the geometry.
|
||||
id: uuid,
|
||||
// The source range.
|
||||
sourceRange: [number, number],
|
||||
// The tag.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "extrudePlane",
|
||||
} |
|
||||
{
|
||||
// The face id for the extrude plane.
|
||||
faceId: uuid,
|
||||
// The id of the geometry.
|
||||
id: uuid,
|
||||
// The source range.
|
||||
sourceRange: [number, number],
|
||||
// The tag.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "extrudeArc",
|
||||
}],
|
||||
},
|
||||
// The id of the face.
|
||||
id: uuid,
|
||||
// The original sketch group id of the object we are sketching on.
|
||||
sketchGroupId: uuid,
|
||||
type: "face",
|
||||
// The tag of the face.
|
||||
value: string,
|
||||
@ -281,25 +637,32 @@ const example = extrude(5, exampleSketch)
|
||||
z: number,
|
||||
},
|
||||
},
|
||||
// The position of the sketch group.
|
||||
position: [number, number, number],
|
||||
// The rotation of the sketch group base plane.
|
||||
rotation: [number, number, number, number],
|
||||
// The starting path.
|
||||
start: {
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
},
|
||||
// Tag identifiers that have been declared in this sketch group.
|
||||
tags: {
|
||||
},
|
||||
// The paths in the sketch group.
|
||||
value: [{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "ToPoint",
|
||||
@ -311,8 +674,12 @@ const example = extrude(5, exampleSketch)
|
||||
center: [number, number],
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArcTo",
|
||||
@ -320,8 +687,12 @@ const example = extrude(5, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArc",
|
||||
@ -329,8 +700,12 @@ const example = extrude(5, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Horizontal",
|
||||
@ -340,8 +715,12 @@ const example = extrude(5, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "AngledLineTo",
|
||||
@ -353,30 +732,16 @@ const example = extrude(5, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Base",
|
||||
}],
|
||||
// The x-axis of the sketch group base plane in the 3D space
|
||||
xAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
// The y-axis of the sketch group base plane in the 3D space
|
||||
yAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
// The z-axis of the sketch group base plane in the 3D space
|
||||
zAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
@ -9,7 +9,7 @@ Draw a line to a point.
|
||||
|
||||
|
||||
```js
|
||||
lineTo(to: [number], sketch_group: SketchGroup, tag?: String) -> SketchGroup
|
||||
lineTo(to: [number], sketch_group: SketchGroup, tag?: TagDeclarator) -> SketchGroup
|
||||
```
|
||||
|
||||
### Examples
|
||||
@ -33,8 +33,6 @@ const example = extrude(5, exampleSketch)
|
||||
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
|
||||
```js
|
||||
{
|
||||
// The plane id or face id of the sketch group.
|
||||
entityId: uuid,
|
||||
// The id of the sketch group.
|
||||
id: uuid,
|
||||
// What the sketch is on (can be a plane or a face).
|
||||
@ -70,12 +68,184 @@ const example = extrude(5, exampleSketch)
|
||||
},
|
||||
} |
|
||||
{
|
||||
// the face id the sketch is on
|
||||
// The extrude group the face is on.
|
||||
extrudeGroup: {
|
||||
// The id of the extrusion end cap
|
||||
endCapId: uuid,
|
||||
// Chamfers or fillets on this extrude group.
|
||||
filletOrChamfers: [{
|
||||
// The engine id of the edge to fillet.
|
||||
edge_id: uuid,
|
||||
// The id of the engine command that called this fillet.
|
||||
id: uuid,
|
||||
radius: number,
|
||||
type: "fillet",
|
||||
} |
|
||||
{
|
||||
// The engine id of the edge to chamfer.
|
||||
edge_id: uuid,
|
||||
// The id of the engine command that called this chamfer.
|
||||
id: uuid,
|
||||
length: number,
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "chamfer",
|
||||
}],
|
||||
// The height of the extrude group.
|
||||
height: number,
|
||||
// The id of the extrude group.
|
||||
id: uuid,
|
||||
// The sketch group.
|
||||
sketchGroup: {
|
||||
// The id of the sketch group.
|
||||
id: uuid,
|
||||
// What the sketch is on (can be a plane or a face).
|
||||
on: SketchSurface,
|
||||
// The starting path.
|
||||
start: {
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
},
|
||||
// Tag identifiers that have been declared in this sketch group.
|
||||
tags: {
|
||||
},
|
||||
// The paths in the sketch group.
|
||||
value: [{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "ToPoint",
|
||||
} |
|
||||
{
|
||||
// arc's direction
|
||||
ccw: string,
|
||||
// the arc's center
|
||||
center: [number, number],
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArcTo",
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArc",
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Horizontal",
|
||||
// The x coordinate.
|
||||
x: number,
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "AngledLineTo",
|
||||
// The x coordinate.
|
||||
x: number,
|
||||
// The y coordinate.
|
||||
y: number,
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Base",
|
||||
}],
|
||||
},
|
||||
// The id of the extrusion start cap
|
||||
startCapId: uuid,
|
||||
// The extrude surfaces.
|
||||
value: [{
|
||||
// The face id for the extrude plane.
|
||||
faceId: uuid,
|
||||
// The id of the geometry.
|
||||
id: uuid,
|
||||
// The source range.
|
||||
sourceRange: [number, number],
|
||||
// The tag.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "extrudePlane",
|
||||
} |
|
||||
{
|
||||
// The face id for the extrude plane.
|
||||
faceId: uuid,
|
||||
// The id of the geometry.
|
||||
id: uuid,
|
||||
// The source range.
|
||||
sourceRange: [number, number],
|
||||
// The tag.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "extrudeArc",
|
||||
}],
|
||||
},
|
||||
// The id of the face.
|
||||
id: uuid,
|
||||
// The original sketch group id of the object we are sketching on.
|
||||
sketchGroupId: uuid,
|
||||
type: "face",
|
||||
// The tag of the face.
|
||||
value: string,
|
||||
@ -98,25 +268,32 @@ const example = extrude(5, exampleSketch)
|
||||
z: number,
|
||||
},
|
||||
},
|
||||
// The position of the sketch group.
|
||||
position: [number, number, number],
|
||||
// The rotation of the sketch group base plane.
|
||||
rotation: [number, number, number, number],
|
||||
// The starting path.
|
||||
start: {
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
},
|
||||
// Tag identifiers that have been declared in this sketch group.
|
||||
tags: {
|
||||
},
|
||||
// The paths in the sketch group.
|
||||
value: [{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "ToPoint",
|
||||
@ -128,8 +305,12 @@ const example = extrude(5, exampleSketch)
|
||||
center: [number, number],
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArcTo",
|
||||
@ -137,8 +318,12 @@ const example = extrude(5, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArc",
|
||||
@ -146,8 +331,12 @@ const example = extrude(5, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Horizontal",
|
||||
@ -157,8 +346,12 @@ const example = extrude(5, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "AngledLineTo",
|
||||
@ -170,41 +363,32 @@ const example = extrude(5, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Base",
|
||||
}],
|
||||
// The x-axis of the sketch group base plane in the 3D space
|
||||
xAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
// The y-axis of the sketch group base plane in the 3D space
|
||||
yAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
// The z-axis of the sketch group base plane in the 3D space
|
||||
zAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
}
|
||||
```
|
||||
* `tag`: `String` (OPTIONAL)
|
||||
* `tag`: `TagDeclarator` (OPTIONAL)
|
||||
```js
|
||||
{
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
}
|
||||
```
|
||||
|
||||
### Returns
|
||||
|
||||
`SketchGroup` - A sketch group is a collection of paths.
|
||||
```js
|
||||
{
|
||||
// The plane id or face id of the sketch group.
|
||||
entityId: uuid,
|
||||
// The id of the sketch group.
|
||||
id: uuid,
|
||||
// What the sketch is on (can be a plane or a face).
|
||||
@ -240,12 +424,184 @@ const example = extrude(5, exampleSketch)
|
||||
},
|
||||
} |
|
||||
{
|
||||
// the face id the sketch is on
|
||||
// The extrude group the face is on.
|
||||
extrudeGroup: {
|
||||
// The id of the extrusion end cap
|
||||
endCapId: uuid,
|
||||
// Chamfers or fillets on this extrude group.
|
||||
filletOrChamfers: [{
|
||||
// The engine id of the edge to fillet.
|
||||
edge_id: uuid,
|
||||
// The id of the engine command that called this fillet.
|
||||
id: uuid,
|
||||
radius: number,
|
||||
type: "fillet",
|
||||
} |
|
||||
{
|
||||
// The engine id of the edge to chamfer.
|
||||
edge_id: uuid,
|
||||
// The id of the engine command that called this chamfer.
|
||||
id: uuid,
|
||||
length: number,
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "chamfer",
|
||||
}],
|
||||
// The height of the extrude group.
|
||||
height: number,
|
||||
// The id of the extrude group.
|
||||
id: uuid,
|
||||
// The sketch group.
|
||||
sketchGroup: {
|
||||
// The id of the sketch group.
|
||||
id: uuid,
|
||||
// What the sketch is on (can be a plane or a face).
|
||||
on: SketchSurface,
|
||||
// The starting path.
|
||||
start: {
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
},
|
||||
// Tag identifiers that have been declared in this sketch group.
|
||||
tags: {
|
||||
},
|
||||
// The paths in the sketch group.
|
||||
value: [{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "ToPoint",
|
||||
} |
|
||||
{
|
||||
// arc's direction
|
||||
ccw: string,
|
||||
// the arc's center
|
||||
center: [number, number],
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArcTo",
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArc",
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Horizontal",
|
||||
// The x coordinate.
|
||||
x: number,
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "AngledLineTo",
|
||||
// The x coordinate.
|
||||
x: number,
|
||||
// The y coordinate.
|
||||
y: number,
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Base",
|
||||
}],
|
||||
},
|
||||
// The id of the extrusion start cap
|
||||
startCapId: uuid,
|
||||
// The extrude surfaces.
|
||||
value: [{
|
||||
// The face id for the extrude plane.
|
||||
faceId: uuid,
|
||||
// The id of the geometry.
|
||||
id: uuid,
|
||||
// The source range.
|
||||
sourceRange: [number, number],
|
||||
// The tag.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "extrudePlane",
|
||||
} |
|
||||
{
|
||||
// The face id for the extrude plane.
|
||||
faceId: uuid,
|
||||
// The id of the geometry.
|
||||
id: uuid,
|
||||
// The source range.
|
||||
sourceRange: [number, number],
|
||||
// The tag.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "extrudeArc",
|
||||
}],
|
||||
},
|
||||
// The id of the face.
|
||||
id: uuid,
|
||||
// The original sketch group id of the object we are sketching on.
|
||||
sketchGroupId: uuid,
|
||||
type: "face",
|
||||
// The tag of the face.
|
||||
value: string,
|
||||
@ -268,25 +624,32 @@ const example = extrude(5, exampleSketch)
|
||||
z: number,
|
||||
},
|
||||
},
|
||||
// The position of the sketch group.
|
||||
position: [number, number, number],
|
||||
// The rotation of the sketch group base plane.
|
||||
rotation: [number, number, number, number],
|
||||
// The starting path.
|
||||
start: {
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
},
|
||||
// Tag identifiers that have been declared in this sketch group.
|
||||
tags: {
|
||||
},
|
||||
// The paths in the sketch group.
|
||||
value: [{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "ToPoint",
|
||||
@ -298,8 +661,12 @@ const example = extrude(5, exampleSketch)
|
||||
center: [number, number],
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArcTo",
|
||||
@ -307,8 +674,12 @@ const example = extrude(5, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArc",
|
||||
@ -316,8 +687,12 @@ const example = extrude(5, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Horizontal",
|
||||
@ -327,8 +702,12 @@ const example = extrude(5, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "AngledLineTo",
|
||||
@ -340,30 +719,16 @@ const example = extrude(5, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Base",
|
||||
}],
|
||||
// The x-axis of the sketch group base plane in the 3D space
|
||||
xAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
// The y-axis of the sketch group base plane in the 3D space
|
||||
yAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
// The z-axis of the sketch group base plane in the 3D space
|
||||
zAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
@ -9,7 +9,7 @@ A circular pattern on a 2D sketch.
|
||||
|
||||
|
||||
```js
|
||||
patternCircular2d(data: CircularPattern2dData, sketch_group: SketchGroup) -> [SketchGroup]
|
||||
patternCircular2d(data: CircularPattern2dData, sketch_group_set: SketchGroupSet) -> [SketchGroup]
|
||||
```
|
||||
|
||||
### Examples
|
||||
@ -48,11 +48,9 @@ const example = extrude(1, exampleSketch)
|
||||
rotateDuplicates: string,
|
||||
}
|
||||
```
|
||||
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
|
||||
* `sketch_group_set`: `SketchGroupSet` - A sketch group or a group of sketch groups. (REQUIRED)
|
||||
```js
|
||||
{
|
||||
// The plane id or face id of the sketch group.
|
||||
entityId: uuid,
|
||||
// The id of the sketch group.
|
||||
id: uuid,
|
||||
// What the sketch is on (can be a plane or a face).
|
||||
@ -88,12 +86,184 @@ const example = extrude(1, exampleSketch)
|
||||
},
|
||||
} |
|
||||
{
|
||||
// the face id the sketch is on
|
||||
// The extrude group the face is on.
|
||||
extrudeGroup: {
|
||||
// The id of the extrusion end cap
|
||||
endCapId: uuid,
|
||||
// Chamfers or fillets on this extrude group.
|
||||
filletOrChamfers: [{
|
||||
// The engine id of the edge to fillet.
|
||||
edge_id: uuid,
|
||||
// The id of the engine command that called this fillet.
|
||||
id: uuid,
|
||||
radius: number,
|
||||
type: "fillet",
|
||||
} |
|
||||
{
|
||||
// The engine id of the edge to chamfer.
|
||||
edge_id: uuid,
|
||||
// The id of the engine command that called this chamfer.
|
||||
id: uuid,
|
||||
length: number,
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "chamfer",
|
||||
}],
|
||||
// The height of the extrude group.
|
||||
height: number,
|
||||
// The id of the extrude group.
|
||||
id: uuid,
|
||||
// The sketch group.
|
||||
sketchGroup: {
|
||||
// The id of the sketch group.
|
||||
id: uuid,
|
||||
// What the sketch is on (can be a plane or a face).
|
||||
on: SketchSurface,
|
||||
// The starting path.
|
||||
start: {
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
},
|
||||
// Tag identifiers that have been declared in this sketch group.
|
||||
tags: {
|
||||
},
|
||||
// The paths in the sketch group.
|
||||
value: [{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "ToPoint",
|
||||
} |
|
||||
{
|
||||
// arc's direction
|
||||
ccw: string,
|
||||
// the arc's center
|
||||
center: [number, number],
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArcTo",
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArc",
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Horizontal",
|
||||
// The x coordinate.
|
||||
x: number,
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "AngledLineTo",
|
||||
// The x coordinate.
|
||||
x: number,
|
||||
// The y coordinate.
|
||||
y: number,
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Base",
|
||||
}],
|
||||
},
|
||||
// The id of the extrusion start cap
|
||||
startCapId: uuid,
|
||||
// The extrude surfaces.
|
||||
value: [{
|
||||
// The face id for the extrude plane.
|
||||
faceId: uuid,
|
||||
// The id of the geometry.
|
||||
id: uuid,
|
||||
// The source range.
|
||||
sourceRange: [number, number],
|
||||
// The tag.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "extrudePlane",
|
||||
} |
|
||||
{
|
||||
// The face id for the extrude plane.
|
||||
faceId: uuid,
|
||||
// The id of the geometry.
|
||||
id: uuid,
|
||||
// The source range.
|
||||
sourceRange: [number, number],
|
||||
// The tag.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "extrudeArc",
|
||||
}],
|
||||
},
|
||||
// The id of the face.
|
||||
id: uuid,
|
||||
// The original sketch group id of the object we are sketching on.
|
||||
sketchGroupId: uuid,
|
||||
type: "face",
|
||||
// The tag of the face.
|
||||
value: string,
|
||||
@ -116,25 +286,33 @@ const example = extrude(1, exampleSketch)
|
||||
z: number,
|
||||
},
|
||||
},
|
||||
// The position of the sketch group.
|
||||
position: [number, number, number],
|
||||
// The rotation of the sketch group base plane.
|
||||
rotation: [number, number, number, number],
|
||||
// The starting path.
|
||||
start: {
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
},
|
||||
// Tag identifiers that have been declared in this sketch group.
|
||||
tags: {
|
||||
},
|
||||
type: "sketchGroup",
|
||||
// The paths in the sketch group.
|
||||
value: [{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "ToPoint",
|
||||
@ -146,8 +324,12 @@ const example = extrude(1, exampleSketch)
|
||||
center: [number, number],
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArcTo",
|
||||
@ -155,8 +337,12 @@ const example = extrude(1, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArc",
|
||||
@ -164,8 +350,12 @@ const example = extrude(1, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Horizontal",
|
||||
@ -175,8 +365,12 @@ const example = extrude(1, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "AngledLineTo",
|
||||
@ -188,30 +382,19 @@ const example = extrude(1, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Base",
|
||||
}],
|
||||
// The x-axis of the sketch group base plane in the 3D space
|
||||
xAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
// The y-axis of the sketch group base plane in the 3D space
|
||||
yAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
// The z-axis of the sketch group base plane in the 3D space
|
||||
zAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
} |
|
||||
{
|
||||
type: "sketchGroups",
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
@ -9,7 +9,7 @@ A circular pattern on a 3D model.
|
||||
|
||||
|
||||
```js
|
||||
patternCircular3d(data: CircularPattern3dData, extrude_group: ExtrudeGroup) -> [ExtrudeGroup]
|
||||
patternCircular3d(data: CircularPattern3dData, extrude_group_set: ExtrudeGroupSet) -> [ExtrudeGroup]
|
||||
```
|
||||
|
||||
### Examples
|
||||
@ -47,25 +47,190 @@ const example = extrude(-5, exampleSketch)
|
||||
rotateDuplicates: string,
|
||||
}
|
||||
```
|
||||
* `extrude_group`: `ExtrudeGroup` - An extrude group is a collection of extrude surfaces. (REQUIRED)
|
||||
* `extrude_group_set`: `ExtrudeGroupSet` - A extrude group or a group of extrude groups. (REQUIRED)
|
||||
```js
|
||||
{
|
||||
// The id of the extrusion end cap
|
||||
endCapId: uuid,
|
||||
// Chamfers or fillets on this extrude group.
|
||||
filletOrChamfers: [{
|
||||
// The engine id of the edge to fillet.
|
||||
edge_id: uuid,
|
||||
// The id of the engine command that called this fillet.
|
||||
id: uuid,
|
||||
radius: number,
|
||||
type: "fillet",
|
||||
} |
|
||||
{
|
||||
// The engine id of the edge to chamfer.
|
||||
edge_id: uuid,
|
||||
// The id of the engine command that called this chamfer.
|
||||
id: uuid,
|
||||
length: number,
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "chamfer",
|
||||
}],
|
||||
// The height of the extrude group.
|
||||
height: number,
|
||||
// The id of the extrude group.
|
||||
id: uuid,
|
||||
// The position of the extrude group.
|
||||
position: [number, number, number],
|
||||
// The rotation of the extrude group.
|
||||
rotation: [number, number, number, number],
|
||||
// The sketch group paths.
|
||||
sketchGroupValues: [{
|
||||
// The sketch group.
|
||||
sketchGroup: {
|
||||
// The id of the sketch group.
|
||||
id: uuid,
|
||||
// What the sketch is on (can be a plane or a face).
|
||||
on: {
|
||||
// The id of the plane.
|
||||
id: uuid,
|
||||
// Origin of the plane.
|
||||
origin: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
type: "plane",
|
||||
// Type for a plane.
|
||||
value: "XY" | "XZ" | "YZ" | "Custom",
|
||||
// What should the plane’s X axis be?
|
||||
xAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
// What should the plane’s Y axis be?
|
||||
yAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
// The z-axis (normal).
|
||||
zAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
} |
|
||||
{
|
||||
// The extrude group the face is on.
|
||||
extrudeGroup: {
|
||||
// The id of the extrusion end cap
|
||||
endCapId: uuid,
|
||||
// Chamfers or fillets on this extrude group.
|
||||
filletOrChamfers: [{
|
||||
// The engine id of the edge to fillet.
|
||||
edge_id: uuid,
|
||||
// The id of the engine command that called this fillet.
|
||||
id: uuid,
|
||||
radius: number,
|
||||
type: "fillet",
|
||||
} |
|
||||
{
|
||||
// The engine id of the edge to chamfer.
|
||||
edge_id: uuid,
|
||||
// The id of the engine command that called this chamfer.
|
||||
id: uuid,
|
||||
length: number,
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "chamfer",
|
||||
}],
|
||||
// The height of the extrude group.
|
||||
height: number,
|
||||
// The id of the extrude group.
|
||||
id: uuid,
|
||||
// The sketch group.
|
||||
sketchGroup: SketchGroup,
|
||||
// The id of the extrusion start cap
|
||||
startCapId: uuid,
|
||||
// The extrude surfaces.
|
||||
value: [{
|
||||
// The face id for the extrude plane.
|
||||
faceId: uuid,
|
||||
// The id of the geometry.
|
||||
id: uuid,
|
||||
// The source range.
|
||||
sourceRange: [number, number],
|
||||
// The tag.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "extrudePlane",
|
||||
} |
|
||||
{
|
||||
// The face id for the extrude plane.
|
||||
faceId: uuid,
|
||||
// The id of the geometry.
|
||||
id: uuid,
|
||||
// The source range.
|
||||
sourceRange: [number, number],
|
||||
// The tag.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "extrudeArc",
|
||||
}],
|
||||
},
|
||||
// The id of the face.
|
||||
id: uuid,
|
||||
type: "face",
|
||||
// The tag of the face.
|
||||
value: string,
|
||||
// What should the face’s X axis be?
|
||||
xAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
// What should the face’s Y axis be?
|
||||
yAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
// The z-axis (normal).
|
||||
zAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
},
|
||||
// The starting path.
|
||||
start: {
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
},
|
||||
// Tag identifiers that have been declared in this sketch group.
|
||||
tags: {
|
||||
},
|
||||
// The paths in the sketch group.
|
||||
value: [{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "ToPoint",
|
||||
@ -77,8 +242,12 @@ const example = extrude(-5, exampleSketch)
|
||||
center: [number, number],
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArcTo",
|
||||
@ -86,8 +255,12 @@ const example = extrude(-5, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArc",
|
||||
@ -95,8 +268,12 @@ const example = extrude(-5, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Horizontal",
|
||||
@ -106,8 +283,12 @@ const example = extrude(-5, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "AngledLineTo",
|
||||
@ -119,28 +300,34 @@ const example = extrude(-5, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Base",
|
||||
}],
|
||||
},
|
||||
// The id of the extrusion start cap
|
||||
startCapId: uuid,
|
||||
type: "extrudeGroup",
|
||||
// The extrude surfaces.
|
||||
value: [{
|
||||
// The face id for the extrude plane.
|
||||
faceId: uuid,
|
||||
// The id of the geometry.
|
||||
id: uuid,
|
||||
// The name.
|
||||
name: string,
|
||||
// The position.
|
||||
position: [number, number, number],
|
||||
// The rotation.
|
||||
rotation: [number, number, number, number],
|
||||
// The source range.
|
||||
sourceRange: [number, number],
|
||||
// The tag.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "extrudePlane",
|
||||
} |
|
||||
{
|
||||
@ -148,34 +335,19 @@ const example = extrude(-5, exampleSketch)
|
||||
faceId: uuid,
|
||||
// The id of the geometry.
|
||||
id: uuid,
|
||||
// The name.
|
||||
name: string,
|
||||
// The position.
|
||||
position: [number, number, number],
|
||||
// The rotation.
|
||||
rotation: [number, number, number, number],
|
||||
// The source range.
|
||||
sourceRange: [number, number],
|
||||
// The tag.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "extrudeArc",
|
||||
}],
|
||||
// The x-axis of the extrude group base plane in the 3D space
|
||||
xAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
// The y-axis of the extrude group base plane in the 3D space
|
||||
yAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
// The z-axis of the extrude group base plane in the 3D space
|
||||
zAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
} |
|
||||
{
|
||||
type: "extrudeGroups",
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
@ -44,8 +44,6 @@ const example = extrude(1, exampleSketch)
|
||||
* `sketch_group_set`: `SketchGroupSet` - A sketch group or a group of sketch groups. (REQUIRED)
|
||||
```js
|
||||
{
|
||||
// The plane id or face id of the sketch group.
|
||||
entityId: uuid,
|
||||
// The id of the sketch group.
|
||||
id: uuid,
|
||||
// What the sketch is on (can be a plane or a face).
|
||||
@ -81,12 +79,184 @@ const example = extrude(1, exampleSketch)
|
||||
},
|
||||
} |
|
||||
{
|
||||
// the face id the sketch is on
|
||||
// The extrude group the face is on.
|
||||
extrudeGroup: {
|
||||
// The id of the extrusion end cap
|
||||
endCapId: uuid,
|
||||
// Chamfers or fillets on this extrude group.
|
||||
filletOrChamfers: [{
|
||||
// The engine id of the edge to fillet.
|
||||
edge_id: uuid,
|
||||
// The id of the engine command that called this fillet.
|
||||
id: uuid,
|
||||
radius: number,
|
||||
type: "fillet",
|
||||
} |
|
||||
{
|
||||
// The engine id of the edge to chamfer.
|
||||
edge_id: uuid,
|
||||
// The id of the engine command that called this chamfer.
|
||||
id: uuid,
|
||||
length: number,
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "chamfer",
|
||||
}],
|
||||
// The height of the extrude group.
|
||||
height: number,
|
||||
// The id of the extrude group.
|
||||
id: uuid,
|
||||
// The sketch group.
|
||||
sketchGroup: {
|
||||
// The id of the sketch group.
|
||||
id: uuid,
|
||||
// What the sketch is on (can be a plane or a face).
|
||||
on: SketchSurface,
|
||||
// The starting path.
|
||||
start: {
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
},
|
||||
// Tag identifiers that have been declared in this sketch group.
|
||||
tags: {
|
||||
},
|
||||
// The paths in the sketch group.
|
||||
value: [{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "ToPoint",
|
||||
} |
|
||||
{
|
||||
// arc's direction
|
||||
ccw: string,
|
||||
// the arc's center
|
||||
center: [number, number],
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArcTo",
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArc",
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Horizontal",
|
||||
// The x coordinate.
|
||||
x: number,
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "AngledLineTo",
|
||||
// The x coordinate.
|
||||
x: number,
|
||||
// The y coordinate.
|
||||
y: number,
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Base",
|
||||
}],
|
||||
},
|
||||
// The id of the extrusion start cap
|
||||
startCapId: uuid,
|
||||
// The extrude surfaces.
|
||||
value: [{
|
||||
// The face id for the extrude plane.
|
||||
faceId: uuid,
|
||||
// The id of the geometry.
|
||||
id: uuid,
|
||||
// The source range.
|
||||
sourceRange: [number, number],
|
||||
// The tag.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "extrudePlane",
|
||||
} |
|
||||
{
|
||||
// The face id for the extrude plane.
|
||||
faceId: uuid,
|
||||
// The id of the geometry.
|
||||
id: uuid,
|
||||
// The source range.
|
||||
sourceRange: [number, number],
|
||||
// The tag.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "extrudeArc",
|
||||
}],
|
||||
},
|
||||
// The id of the face.
|
||||
id: uuid,
|
||||
// The original sketch group id of the object we are sketching on.
|
||||
sketchGroupId: uuid,
|
||||
type: "face",
|
||||
// The tag of the face.
|
||||
value: string,
|
||||
@ -109,26 +279,33 @@ const example = extrude(1, exampleSketch)
|
||||
z: number,
|
||||
},
|
||||
},
|
||||
// The position of the sketch group.
|
||||
position: [number, number, number],
|
||||
// The rotation of the sketch group base plane.
|
||||
rotation: [number, number, number, number],
|
||||
// The starting path.
|
||||
start: {
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
},
|
||||
// Tag identifiers that have been declared in this sketch group.
|
||||
tags: {
|
||||
},
|
||||
type: "sketchGroup",
|
||||
// The paths in the sketch group.
|
||||
value: [{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "ToPoint",
|
||||
@ -140,8 +317,12 @@ const example = extrude(1, exampleSketch)
|
||||
center: [number, number],
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArcTo",
|
||||
@ -149,8 +330,12 @@ const example = extrude(1, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArc",
|
||||
@ -158,8 +343,12 @@ const example = extrude(1, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Horizontal",
|
||||
@ -169,8 +358,12 @@ const example = extrude(1, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "AngledLineTo",
|
||||
@ -182,30 +375,16 @@ const example = extrude(1, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Base",
|
||||
}],
|
||||
// The x-axis of the sketch group base plane in the 3D space
|
||||
xAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
// The y-axis of the sketch group base plane in the 3D space
|
||||
yAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
// The z-axis of the sketch group base plane in the 3D space
|
||||
zAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
} |
|
||||
{
|
||||
type: "sketchGroups",
|
||||
|
||||
@ -9,7 +9,7 @@ A linear pattern on a 3D model.
|
||||
|
||||
|
||||
```js
|
||||
patternLinear3d(data: LinearPattern3dData, extrude_group: ExtrudeGroup) -> [ExtrudeGroup]
|
||||
patternLinear3d(data: LinearPattern3dData, extrude_group_set: ExtrudeGroupSet) -> [ExtrudeGroup]
|
||||
```
|
||||
|
||||
### Examples
|
||||
@ -45,25 +45,190 @@ const example = extrude(1, exampleSketch)
|
||||
repetitions: number,
|
||||
}
|
||||
```
|
||||
* `extrude_group`: `ExtrudeGroup` - An extrude group is a collection of extrude surfaces. (REQUIRED)
|
||||
* `extrude_group_set`: `ExtrudeGroupSet` - A extrude group or a group of extrude groups. (REQUIRED)
|
||||
```js
|
||||
{
|
||||
// The id of the extrusion end cap
|
||||
endCapId: uuid,
|
||||
// Chamfers or fillets on this extrude group.
|
||||
filletOrChamfers: [{
|
||||
// The engine id of the edge to fillet.
|
||||
edge_id: uuid,
|
||||
// The id of the engine command that called this fillet.
|
||||
id: uuid,
|
||||
radius: number,
|
||||
type: "fillet",
|
||||
} |
|
||||
{
|
||||
// The engine id of the edge to chamfer.
|
||||
edge_id: uuid,
|
||||
// The id of the engine command that called this chamfer.
|
||||
id: uuid,
|
||||
length: number,
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "chamfer",
|
||||
}],
|
||||
// The height of the extrude group.
|
||||
height: number,
|
||||
// The id of the extrude group.
|
||||
id: uuid,
|
||||
// The position of the extrude group.
|
||||
position: [number, number, number],
|
||||
// The rotation of the extrude group.
|
||||
rotation: [number, number, number, number],
|
||||
// The sketch group paths.
|
||||
sketchGroupValues: [{
|
||||
// The sketch group.
|
||||
sketchGroup: {
|
||||
// The id of the sketch group.
|
||||
id: uuid,
|
||||
// What the sketch is on (can be a plane or a face).
|
||||
on: {
|
||||
// The id of the plane.
|
||||
id: uuid,
|
||||
// Origin of the plane.
|
||||
origin: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
type: "plane",
|
||||
// Type for a plane.
|
||||
value: "XY" | "XZ" | "YZ" | "Custom",
|
||||
// What should the plane’s X axis be?
|
||||
xAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
// What should the plane’s Y axis be?
|
||||
yAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
// The z-axis (normal).
|
||||
zAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
} |
|
||||
{
|
||||
// The extrude group the face is on.
|
||||
extrudeGroup: {
|
||||
// The id of the extrusion end cap
|
||||
endCapId: uuid,
|
||||
// Chamfers or fillets on this extrude group.
|
||||
filletOrChamfers: [{
|
||||
// The engine id of the edge to fillet.
|
||||
edge_id: uuid,
|
||||
// The id of the engine command that called this fillet.
|
||||
id: uuid,
|
||||
radius: number,
|
||||
type: "fillet",
|
||||
} |
|
||||
{
|
||||
// The engine id of the edge to chamfer.
|
||||
edge_id: uuid,
|
||||
// The id of the engine command that called this chamfer.
|
||||
id: uuid,
|
||||
length: number,
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "chamfer",
|
||||
}],
|
||||
// The height of the extrude group.
|
||||
height: number,
|
||||
// The id of the extrude group.
|
||||
id: uuid,
|
||||
// The sketch group.
|
||||
sketchGroup: SketchGroup,
|
||||
// The id of the extrusion start cap
|
||||
startCapId: uuid,
|
||||
// The extrude surfaces.
|
||||
value: [{
|
||||
// The face id for the extrude plane.
|
||||
faceId: uuid,
|
||||
// The id of the geometry.
|
||||
id: uuid,
|
||||
// The source range.
|
||||
sourceRange: [number, number],
|
||||
// The tag.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "extrudePlane",
|
||||
} |
|
||||
{
|
||||
// The face id for the extrude plane.
|
||||
faceId: uuid,
|
||||
// The id of the geometry.
|
||||
id: uuid,
|
||||
// The source range.
|
||||
sourceRange: [number, number],
|
||||
// The tag.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "extrudeArc",
|
||||
}],
|
||||
},
|
||||
// The id of the face.
|
||||
id: uuid,
|
||||
type: "face",
|
||||
// The tag of the face.
|
||||
value: string,
|
||||
// What should the face’s X axis be?
|
||||
xAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
// What should the face’s Y axis be?
|
||||
yAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
// The z-axis (normal).
|
||||
zAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
},
|
||||
// The starting path.
|
||||
start: {
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
},
|
||||
// Tag identifiers that have been declared in this sketch group.
|
||||
tags: {
|
||||
},
|
||||
// The paths in the sketch group.
|
||||
value: [{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "ToPoint",
|
||||
@ -75,8 +240,12 @@ const example = extrude(1, exampleSketch)
|
||||
center: [number, number],
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArcTo",
|
||||
@ -84,8 +253,12 @@ const example = extrude(1, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArc",
|
||||
@ -93,8 +266,12 @@ const example = extrude(1, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Horizontal",
|
||||
@ -104,8 +281,12 @@ const example = extrude(1, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "AngledLineTo",
|
||||
@ -117,28 +298,34 @@ const example = extrude(1, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Base",
|
||||
}],
|
||||
},
|
||||
// The id of the extrusion start cap
|
||||
startCapId: uuid,
|
||||
type: "extrudeGroup",
|
||||
// The extrude surfaces.
|
||||
value: [{
|
||||
// The face id for the extrude plane.
|
||||
faceId: uuid,
|
||||
// The id of the geometry.
|
||||
id: uuid,
|
||||
// The name.
|
||||
name: string,
|
||||
// The position.
|
||||
position: [number, number, number],
|
||||
// The rotation.
|
||||
rotation: [number, number, number, number],
|
||||
// The source range.
|
||||
sourceRange: [number, number],
|
||||
// The tag.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "extrudePlane",
|
||||
} |
|
||||
{
|
||||
@ -146,34 +333,19 @@ const example = extrude(1, exampleSketch)
|
||||
faceId: uuid,
|
||||
// The id of the geometry.
|
||||
id: uuid,
|
||||
// The name.
|
||||
name: string,
|
||||
// The position.
|
||||
position: [number, number, number],
|
||||
// The rotation.
|
||||
rotation: [number, number, number, number],
|
||||
// The source range.
|
||||
sourceRange: [number, number],
|
||||
// The tag.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "extrudeArc",
|
||||
}],
|
||||
// The x-axis of the extrude group base plane in the 3D space
|
||||
xAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
// The y-axis of the extrude group base plane in the 3D space
|
||||
yAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
// The z-axis of the extrude group base plane in the 3D space
|
||||
zAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
} |
|
||||
{
|
||||
type: "extrudeGroups",
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
359
docs/kcl/patternTransform.md
Normal file
@ -17,9 +17,9 @@ profileStart(sketch_group: SketchGroup) -> [number]
|
||||
```js
|
||||
const sketch001 = startSketchOn('XY')
|
||||
|> startProfileAt([5, 2], %)
|
||||
|> angledLine({ angle: 120, length: 50 }, %, 'seg01')
|
||||
|> angledLine({ angle: 120, length: 50 }, %, $seg01)
|
||||
|> angledLine({
|
||||
angle: segAng('seg01', %) + 120,
|
||||
angle: segAng(seg01, %) + 120,
|
||||
length: 50
|
||||
}, %)
|
||||
|> lineTo(profileStart(%), %)
|
||||
@ -34,8 +34,6 @@ const sketch001 = startSketchOn('XY')
|
||||
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
|
||||
```js
|
||||
{
|
||||
// The plane id or face id of the sketch group.
|
||||
entityId: uuid,
|
||||
// The id of the sketch group.
|
||||
id: uuid,
|
||||
// What the sketch is on (can be a plane or a face).
|
||||
@ -71,12 +69,184 @@ const sketch001 = startSketchOn('XY')
|
||||
},
|
||||
} |
|
||||
{
|
||||
// the face id the sketch is on
|
||||
// The extrude group the face is on.
|
||||
extrudeGroup: {
|
||||
// The id of the extrusion end cap
|
||||
endCapId: uuid,
|
||||
// Chamfers or fillets on this extrude group.
|
||||
filletOrChamfers: [{
|
||||
// The engine id of the edge to fillet.
|
||||
edge_id: uuid,
|
||||
// The id of the engine command that called this fillet.
|
||||
id: uuid,
|
||||
radius: number,
|
||||
type: "fillet",
|
||||
} |
|
||||
{
|
||||
// The engine id of the edge to chamfer.
|
||||
edge_id: uuid,
|
||||
// The id of the engine command that called this chamfer.
|
||||
id: uuid,
|
||||
length: number,
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "chamfer",
|
||||
}],
|
||||
// The height of the extrude group.
|
||||
height: number,
|
||||
// The id of the extrude group.
|
||||
id: uuid,
|
||||
// The sketch group.
|
||||
sketchGroup: {
|
||||
// The id of the sketch group.
|
||||
id: uuid,
|
||||
// What the sketch is on (can be a plane or a face).
|
||||
on: SketchSurface,
|
||||
// The starting path.
|
||||
start: {
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
},
|
||||
// Tag identifiers that have been declared in this sketch group.
|
||||
tags: {
|
||||
},
|
||||
// The paths in the sketch group.
|
||||
value: [{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "ToPoint",
|
||||
} |
|
||||
{
|
||||
// arc's direction
|
||||
ccw: string,
|
||||
// the arc's center
|
||||
center: [number, number],
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArcTo",
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArc",
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Horizontal",
|
||||
// The x coordinate.
|
||||
x: number,
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "AngledLineTo",
|
||||
// The x coordinate.
|
||||
x: number,
|
||||
// The y coordinate.
|
||||
y: number,
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Base",
|
||||
}],
|
||||
},
|
||||
// The id of the extrusion start cap
|
||||
startCapId: uuid,
|
||||
// The extrude surfaces.
|
||||
value: [{
|
||||
// The face id for the extrude plane.
|
||||
faceId: uuid,
|
||||
// The id of the geometry.
|
||||
id: uuid,
|
||||
// The source range.
|
||||
sourceRange: [number, number],
|
||||
// The tag.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "extrudePlane",
|
||||
} |
|
||||
{
|
||||
// The face id for the extrude plane.
|
||||
faceId: uuid,
|
||||
// The id of the geometry.
|
||||
id: uuid,
|
||||
// The source range.
|
||||
sourceRange: [number, number],
|
||||
// The tag.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "extrudeArc",
|
||||
}],
|
||||
},
|
||||
// The id of the face.
|
||||
id: uuid,
|
||||
// The original sketch group id of the object we are sketching on.
|
||||
sketchGroupId: uuid,
|
||||
type: "face",
|
||||
// The tag of the face.
|
||||
value: string,
|
||||
@ -99,25 +269,32 @@ const sketch001 = startSketchOn('XY')
|
||||
z: number,
|
||||
},
|
||||
},
|
||||
// The position of the sketch group.
|
||||
position: [number, number, number],
|
||||
// The rotation of the sketch group base plane.
|
||||
rotation: [number, number, number, number],
|
||||
// The starting path.
|
||||
start: {
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
},
|
||||
// Tag identifiers that have been declared in this sketch group.
|
||||
tags: {
|
||||
},
|
||||
// The paths in the sketch group.
|
||||
value: [{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "ToPoint",
|
||||
@ -129,8 +306,12 @@ const sketch001 = startSketchOn('XY')
|
||||
center: [number, number],
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArcTo",
|
||||
@ -138,8 +319,12 @@ const sketch001 = startSketchOn('XY')
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArc",
|
||||
@ -147,8 +332,12 @@ const sketch001 = startSketchOn('XY')
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Horizontal",
|
||||
@ -158,8 +347,12 @@ const sketch001 = startSketchOn('XY')
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "AngledLineTo",
|
||||
@ -171,30 +364,16 @@ const sketch001 = startSketchOn('XY')
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Base",
|
||||
}],
|
||||
// The x-axis of the sketch group base plane in the 3D space
|
||||
xAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
// The y-axis of the sketch group base plane in the 3D space
|
||||
yAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
// The z-axis of the sketch group base plane in the 3D space
|
||||
zAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
@ -29,8 +29,6 @@ const sketch001 = startSketchOn('XY')
|
||||
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
|
||||
```js
|
||||
{
|
||||
// The plane id or face id of the sketch group.
|
||||
entityId: uuid,
|
||||
// The id of the sketch group.
|
||||
id: uuid,
|
||||
// What the sketch is on (can be a plane or a face).
|
||||
@ -66,12 +64,184 @@ const sketch001 = startSketchOn('XY')
|
||||
},
|
||||
} |
|
||||
{
|
||||
// the face id the sketch is on
|
||||
// The extrude group the face is on.
|
||||
extrudeGroup: {
|
||||
// The id of the extrusion end cap
|
||||
endCapId: uuid,
|
||||
// Chamfers or fillets on this extrude group.
|
||||
filletOrChamfers: [{
|
||||
// The engine id of the edge to fillet.
|
||||
edge_id: uuid,
|
||||
// The id of the engine command that called this fillet.
|
||||
id: uuid,
|
||||
radius: number,
|
||||
type: "fillet",
|
||||
} |
|
||||
{
|
||||
// The engine id of the edge to chamfer.
|
||||
edge_id: uuid,
|
||||
// The id of the engine command that called this chamfer.
|
||||
id: uuid,
|
||||
length: number,
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "chamfer",
|
||||
}],
|
||||
// The height of the extrude group.
|
||||
height: number,
|
||||
// The id of the extrude group.
|
||||
id: uuid,
|
||||
// The sketch group.
|
||||
sketchGroup: {
|
||||
// The id of the sketch group.
|
||||
id: uuid,
|
||||
// What the sketch is on (can be a plane or a face).
|
||||
on: SketchSurface,
|
||||
// The starting path.
|
||||
start: {
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
},
|
||||
// Tag identifiers that have been declared in this sketch group.
|
||||
tags: {
|
||||
},
|
||||
// The paths in the sketch group.
|
||||
value: [{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "ToPoint",
|
||||
} |
|
||||
{
|
||||
// arc's direction
|
||||
ccw: string,
|
||||
// the arc's center
|
||||
center: [number, number],
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArcTo",
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArc",
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Horizontal",
|
||||
// The x coordinate.
|
||||
x: number,
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "AngledLineTo",
|
||||
// The x coordinate.
|
||||
x: number,
|
||||
// The y coordinate.
|
||||
y: number,
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Base",
|
||||
}],
|
||||
},
|
||||
// The id of the extrusion start cap
|
||||
startCapId: uuid,
|
||||
// The extrude surfaces.
|
||||
value: [{
|
||||
// The face id for the extrude plane.
|
||||
faceId: uuid,
|
||||
// The id of the geometry.
|
||||
id: uuid,
|
||||
// The source range.
|
||||
sourceRange: [number, number],
|
||||
// The tag.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "extrudePlane",
|
||||
} |
|
||||
{
|
||||
// The face id for the extrude plane.
|
||||
faceId: uuid,
|
||||
// The id of the geometry.
|
||||
id: uuid,
|
||||
// The source range.
|
||||
sourceRange: [number, number],
|
||||
// The tag.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "extrudeArc",
|
||||
}],
|
||||
},
|
||||
// The id of the face.
|
||||
id: uuid,
|
||||
// The original sketch group id of the object we are sketching on.
|
||||
sketchGroupId: uuid,
|
||||
type: "face",
|
||||
// The tag of the face.
|
||||
value: string,
|
||||
@ -94,25 +264,32 @@ const sketch001 = startSketchOn('XY')
|
||||
z: number,
|
||||
},
|
||||
},
|
||||
// The position of the sketch group.
|
||||
position: [number, number, number],
|
||||
// The rotation of the sketch group base plane.
|
||||
rotation: [number, number, number, number],
|
||||
// The starting path.
|
||||
start: {
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
},
|
||||
// Tag identifiers that have been declared in this sketch group.
|
||||
tags: {
|
||||
},
|
||||
// The paths in the sketch group.
|
||||
value: [{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "ToPoint",
|
||||
@ -124,8 +301,12 @@ const sketch001 = startSketchOn('XY')
|
||||
center: [number, number],
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArcTo",
|
||||
@ -133,8 +314,12 @@ const sketch001 = startSketchOn('XY')
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArc",
|
||||
@ -142,8 +327,12 @@ const sketch001 = startSketchOn('XY')
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Horizontal",
|
||||
@ -153,8 +342,12 @@ const sketch001 = startSketchOn('XY')
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "AngledLineTo",
|
||||
@ -166,30 +359,16 @@ const sketch001 = startSketchOn('XY')
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Base",
|
||||
}],
|
||||
// The x-axis of the sketch group base plane in the 3D space
|
||||
xAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
// The y-axis of the sketch group base plane in the 3D space
|
||||
yAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
// The z-axis of the sketch group base plane in the 3D space
|
||||
zAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
@ -28,8 +28,6 @@ const sketch001 = startSketchOn('XY')
|
||||
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
|
||||
```js
|
||||
{
|
||||
// The plane id or face id of the sketch group.
|
||||
entityId: uuid,
|
||||
// The id of the sketch group.
|
||||
id: uuid,
|
||||
// What the sketch is on (can be a plane or a face).
|
||||
@ -65,12 +63,184 @@ const sketch001 = startSketchOn('XY')
|
||||
},
|
||||
} |
|
||||
{
|
||||
// the face id the sketch is on
|
||||
// The extrude group the face is on.
|
||||
extrudeGroup: {
|
||||
// The id of the extrusion end cap
|
||||
endCapId: uuid,
|
||||
// Chamfers or fillets on this extrude group.
|
||||
filletOrChamfers: [{
|
||||
// The engine id of the edge to fillet.
|
||||
edge_id: uuid,
|
||||
// The id of the engine command that called this fillet.
|
||||
id: uuid,
|
||||
radius: number,
|
||||
type: "fillet",
|
||||
} |
|
||||
{
|
||||
// The engine id of the edge to chamfer.
|
||||
edge_id: uuid,
|
||||
// The id of the engine command that called this chamfer.
|
||||
id: uuid,
|
||||
length: number,
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "chamfer",
|
||||
}],
|
||||
// The height of the extrude group.
|
||||
height: number,
|
||||
// The id of the extrude group.
|
||||
id: uuid,
|
||||
// The sketch group.
|
||||
sketchGroup: {
|
||||
// The id of the sketch group.
|
||||
id: uuid,
|
||||
// What the sketch is on (can be a plane or a face).
|
||||
on: SketchSurface,
|
||||
// The starting path.
|
||||
start: {
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
},
|
||||
// Tag identifiers that have been declared in this sketch group.
|
||||
tags: {
|
||||
},
|
||||
// The paths in the sketch group.
|
||||
value: [{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "ToPoint",
|
||||
} |
|
||||
{
|
||||
// arc's direction
|
||||
ccw: string,
|
||||
// the arc's center
|
||||
center: [number, number],
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArcTo",
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArc",
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Horizontal",
|
||||
// The x coordinate.
|
||||
x: number,
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "AngledLineTo",
|
||||
// The x coordinate.
|
||||
x: number,
|
||||
// The y coordinate.
|
||||
y: number,
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Base",
|
||||
}],
|
||||
},
|
||||
// The id of the extrusion start cap
|
||||
startCapId: uuid,
|
||||
// The extrude surfaces.
|
||||
value: [{
|
||||
// The face id for the extrude plane.
|
||||
faceId: uuid,
|
||||
// The id of the geometry.
|
||||
id: uuid,
|
||||
// The source range.
|
||||
sourceRange: [number, number],
|
||||
// The tag.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "extrudePlane",
|
||||
} |
|
||||
{
|
||||
// The face id for the extrude plane.
|
||||
faceId: uuid,
|
||||
// The id of the geometry.
|
||||
id: uuid,
|
||||
// The source range.
|
||||
sourceRange: [number, number],
|
||||
// The tag.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "extrudeArc",
|
||||
}],
|
||||
},
|
||||
// The id of the face.
|
||||
id: uuid,
|
||||
// The original sketch group id of the object we are sketching on.
|
||||
sketchGroupId: uuid,
|
||||
type: "face",
|
||||
// The tag of the face.
|
||||
value: string,
|
||||
@ -93,25 +263,32 @@ const sketch001 = startSketchOn('XY')
|
||||
z: number,
|
||||
},
|
||||
},
|
||||
// The position of the sketch group.
|
||||
position: [number, number, number],
|
||||
// The rotation of the sketch group base plane.
|
||||
rotation: [number, number, number, number],
|
||||
// The starting path.
|
||||
start: {
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
},
|
||||
// Tag identifiers that have been declared in this sketch group.
|
||||
tags: {
|
||||
},
|
||||
// The paths in the sketch group.
|
||||
value: [{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "ToPoint",
|
||||
@ -123,8 +300,12 @@ const sketch001 = startSketchOn('XY')
|
||||
center: [number, number],
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArcTo",
|
||||
@ -132,8 +313,12 @@ const sketch001 = startSketchOn('XY')
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArc",
|
||||
@ -141,8 +326,12 @@ const sketch001 = startSketchOn('XY')
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Horizontal",
|
||||
@ -152,8 +341,12 @@ const sketch001 = startSketchOn('XY')
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "AngledLineTo",
|
||||
@ -165,30 +358,16 @@ const sketch001 = startSketchOn('XY')
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Base",
|
||||
}],
|
||||
// The x-axis of the sketch group base plane in the 3D space
|
||||
xAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
// The y-axis of the sketch group base plane in the 3D space
|
||||
yAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
// The z-axis of the sketch group base plane in the 3D space
|
||||
zAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
@ -9,7 +9,7 @@ Returns the angle of the segment.
|
||||
|
||||
|
||||
```js
|
||||
segAng(segment_name: string, sketch_group: SketchGroup) -> number
|
||||
segAng(segment_name: TagIdentifier, sketch_group: SketchGroup) -> number
|
||||
```
|
||||
|
||||
### Examples
|
||||
@ -18,11 +18,11 @@ segAng(segment_name: string, sketch_group: SketchGroup) -> number
|
||||
const exampleSketch = startSketchOn('XZ')
|
||||
|> startProfileAt([0, 0], %)
|
||||
|> line([10, 0], %)
|
||||
|> line([5, 10], %, 'seg01')
|
||||
|> line([5, 10], %, $seg01)
|
||||
|> line([-10, 0], %)
|
||||
|> angledLine([segAng('seg01', %), 10], %)
|
||||
|> angledLine([segAng(seg01, %), 10], %)
|
||||
|> line([-10, 0], %)
|
||||
|> angledLine([segAng('seg01', %), -15], %)
|
||||
|> angledLine([segAng(seg01, %), -15], %)
|
||||
|> close(%)
|
||||
|
||||
const example = extrude(4, exampleSketch)
|
||||
@ -32,12 +32,15 @@ const example = extrude(4, exampleSketch)
|
||||
|
||||
### Arguments
|
||||
|
||||
* `segment_name`: `string` (REQUIRED)
|
||||
* `segment_name`: `TagIdentifier` (REQUIRED)
|
||||
```js
|
||||
{
|
||||
value: string,
|
||||
}
|
||||
```
|
||||
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
|
||||
```js
|
||||
{
|
||||
// The plane id or face id of the sketch group.
|
||||
entityId: uuid,
|
||||
// The id of the sketch group.
|
||||
id: uuid,
|
||||
// What the sketch is on (can be a plane or a face).
|
||||
@ -73,12 +76,184 @@ const example = extrude(4, exampleSketch)
|
||||
},
|
||||
} |
|
||||
{
|
||||
// the face id the sketch is on
|
||||
// The extrude group the face is on.
|
||||
extrudeGroup: {
|
||||
// The id of the extrusion end cap
|
||||
endCapId: uuid,
|
||||
// Chamfers or fillets on this extrude group.
|
||||
filletOrChamfers: [{
|
||||
// The engine id of the edge to fillet.
|
||||
edge_id: uuid,
|
||||
// The id of the engine command that called this fillet.
|
||||
id: uuid,
|
||||
radius: number,
|
||||
type: "fillet",
|
||||
} |
|
||||
{
|
||||
// The engine id of the edge to chamfer.
|
||||
edge_id: uuid,
|
||||
// The id of the engine command that called this chamfer.
|
||||
id: uuid,
|
||||
length: number,
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "chamfer",
|
||||
}],
|
||||
// The height of the extrude group.
|
||||
height: number,
|
||||
// The id of the extrude group.
|
||||
id: uuid,
|
||||
// The sketch group.
|
||||
sketchGroup: {
|
||||
// The id of the sketch group.
|
||||
id: uuid,
|
||||
// What the sketch is on (can be a plane or a face).
|
||||
on: SketchSurface,
|
||||
// The starting path.
|
||||
start: {
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
},
|
||||
// Tag identifiers that have been declared in this sketch group.
|
||||
tags: {
|
||||
},
|
||||
// The paths in the sketch group.
|
||||
value: [{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "ToPoint",
|
||||
} |
|
||||
{
|
||||
// arc's direction
|
||||
ccw: string,
|
||||
// the arc's center
|
||||
center: [number, number],
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArcTo",
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArc",
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Horizontal",
|
||||
// The x coordinate.
|
||||
x: number,
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "AngledLineTo",
|
||||
// The x coordinate.
|
||||
x: number,
|
||||
// The y coordinate.
|
||||
y: number,
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Base",
|
||||
}],
|
||||
},
|
||||
// The id of the extrusion start cap
|
||||
startCapId: uuid,
|
||||
// The extrude surfaces.
|
||||
value: [{
|
||||
// The face id for the extrude plane.
|
||||
faceId: uuid,
|
||||
// The id of the geometry.
|
||||
id: uuid,
|
||||
// The source range.
|
||||
sourceRange: [number, number],
|
||||
// The tag.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "extrudePlane",
|
||||
} |
|
||||
{
|
||||
// The face id for the extrude plane.
|
||||
faceId: uuid,
|
||||
// The id of the geometry.
|
||||
id: uuid,
|
||||
// The source range.
|
||||
sourceRange: [number, number],
|
||||
// The tag.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "extrudeArc",
|
||||
}],
|
||||
},
|
||||
// The id of the face.
|
||||
id: uuid,
|
||||
// The original sketch group id of the object we are sketching on.
|
||||
sketchGroupId: uuid,
|
||||
type: "face",
|
||||
// The tag of the face.
|
||||
value: string,
|
||||
@ -101,25 +276,32 @@ const example = extrude(4, exampleSketch)
|
||||
z: number,
|
||||
},
|
||||
},
|
||||
// The position of the sketch group.
|
||||
position: [number, number, number],
|
||||
// The rotation of the sketch group base plane.
|
||||
rotation: [number, number, number, number],
|
||||
// The starting path.
|
||||
start: {
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
},
|
||||
// Tag identifiers that have been declared in this sketch group.
|
||||
tags: {
|
||||
},
|
||||
// The paths in the sketch group.
|
||||
value: [{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "ToPoint",
|
||||
@ -131,8 +313,12 @@ const example = extrude(4, exampleSketch)
|
||||
center: [number, number],
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArcTo",
|
||||
@ -140,8 +326,12 @@ const example = extrude(4, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArc",
|
||||
@ -149,8 +339,12 @@ const example = extrude(4, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Horizontal",
|
||||
@ -160,8 +354,12 @@ const example = extrude(4, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "AngledLineTo",
|
||||
@ -173,30 +371,16 @@ const example = extrude(4, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Base",
|
||||
}],
|
||||
// The x-axis of the sketch group base plane in the 3D space
|
||||
xAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
// The y-axis of the sketch group base plane in the 3D space
|
||||
yAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
// The z-axis of the sketch group base plane in the 3D space
|
||||
zAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
@ -9,7 +9,7 @@ Returns the segment end of x.
|
||||
|
||||
|
||||
```js
|
||||
segEndX(segment_name: string, sketch_group: SketchGroup) -> number
|
||||
segEndX(segment_name: TagIdentifier, sketch_group: SketchGroup) -> number
|
||||
```
|
||||
|
||||
### Examples
|
||||
@ -17,9 +17,9 @@ segEndX(segment_name: string, sketch_group: SketchGroup) -> number
|
||||
```js
|
||||
const exampleSketch = startSketchOn('XZ')
|
||||
|> startProfileAt([0, 0], %)
|
||||
|> line([20, 0], %, "thing")
|
||||
|> line([20, 0], %, $thing)
|
||||
|> line([0, 5], %)
|
||||
|> line([segEndX("thing", %), 0], %)
|
||||
|> line([segEndX(thing, %), 0], %)
|
||||
|> line([-20, 10], %)
|
||||
|> close(%)
|
||||
|
||||
@ -30,12 +30,15 @@ const example = extrude(5, exampleSketch)
|
||||
|
||||
### Arguments
|
||||
|
||||
* `segment_name`: `string` (REQUIRED)
|
||||
* `segment_name`: `TagIdentifier` (REQUIRED)
|
||||
```js
|
||||
{
|
||||
value: string,
|
||||
}
|
||||
```
|
||||
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
|
||||
```js
|
||||
{
|
||||
// The plane id or face id of the sketch group.
|
||||
entityId: uuid,
|
||||
// The id of the sketch group.
|
||||
id: uuid,
|
||||
// What the sketch is on (can be a plane or a face).
|
||||
@ -71,12 +74,184 @@ const example = extrude(5, exampleSketch)
|
||||
},
|
||||
} |
|
||||
{
|
||||
// the face id the sketch is on
|
||||
// The extrude group the face is on.
|
||||
extrudeGroup: {
|
||||
// The id of the extrusion end cap
|
||||
endCapId: uuid,
|
||||
// Chamfers or fillets on this extrude group.
|
||||
filletOrChamfers: [{
|
||||
// The engine id of the edge to fillet.
|
||||
edge_id: uuid,
|
||||
// The id of the engine command that called this fillet.
|
||||
id: uuid,
|
||||
radius: number,
|
||||
type: "fillet",
|
||||
} |
|
||||
{
|
||||
// The engine id of the edge to chamfer.
|
||||
edge_id: uuid,
|
||||
// The id of the engine command that called this chamfer.
|
||||
id: uuid,
|
||||
length: number,
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "chamfer",
|
||||
}],
|
||||
// The height of the extrude group.
|
||||
height: number,
|
||||
// The id of the extrude group.
|
||||
id: uuid,
|
||||
// The sketch group.
|
||||
sketchGroup: {
|
||||
// The id of the sketch group.
|
||||
id: uuid,
|
||||
// What the sketch is on (can be a plane or a face).
|
||||
on: SketchSurface,
|
||||
// The starting path.
|
||||
start: {
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
},
|
||||
// Tag identifiers that have been declared in this sketch group.
|
||||
tags: {
|
||||
},
|
||||
// The paths in the sketch group.
|
||||
value: [{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "ToPoint",
|
||||
} |
|
||||
{
|
||||
// arc's direction
|
||||
ccw: string,
|
||||
// the arc's center
|
||||
center: [number, number],
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArcTo",
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArc",
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Horizontal",
|
||||
// The x coordinate.
|
||||
x: number,
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "AngledLineTo",
|
||||
// The x coordinate.
|
||||
x: number,
|
||||
// The y coordinate.
|
||||
y: number,
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Base",
|
||||
}],
|
||||
},
|
||||
// The id of the extrusion start cap
|
||||
startCapId: uuid,
|
||||
// The extrude surfaces.
|
||||
value: [{
|
||||
// The face id for the extrude plane.
|
||||
faceId: uuid,
|
||||
// The id of the geometry.
|
||||
id: uuid,
|
||||
// The source range.
|
||||
sourceRange: [number, number],
|
||||
// The tag.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "extrudePlane",
|
||||
} |
|
||||
{
|
||||
// The face id for the extrude plane.
|
||||
faceId: uuid,
|
||||
// The id of the geometry.
|
||||
id: uuid,
|
||||
// The source range.
|
||||
sourceRange: [number, number],
|
||||
// The tag.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "extrudeArc",
|
||||
}],
|
||||
},
|
||||
// The id of the face.
|
||||
id: uuid,
|
||||
// The original sketch group id of the object we are sketching on.
|
||||
sketchGroupId: uuid,
|
||||
type: "face",
|
||||
// The tag of the face.
|
||||
value: string,
|
||||
@ -99,25 +274,32 @@ const example = extrude(5, exampleSketch)
|
||||
z: number,
|
||||
},
|
||||
},
|
||||
// The position of the sketch group.
|
||||
position: [number, number, number],
|
||||
// The rotation of the sketch group base plane.
|
||||
rotation: [number, number, number, number],
|
||||
// The starting path.
|
||||
start: {
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
},
|
||||
// Tag identifiers that have been declared in this sketch group.
|
||||
tags: {
|
||||
},
|
||||
// The paths in the sketch group.
|
||||
value: [{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "ToPoint",
|
||||
@ -129,8 +311,12 @@ const example = extrude(5, exampleSketch)
|
||||
center: [number, number],
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArcTo",
|
||||
@ -138,8 +324,12 @@ const example = extrude(5, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArc",
|
||||
@ -147,8 +337,12 @@ const example = extrude(5, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Horizontal",
|
||||
@ -158,8 +352,12 @@ const example = extrude(5, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "AngledLineTo",
|
||||
@ -171,30 +369,16 @@ const example = extrude(5, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Base",
|
||||
}],
|
||||
// The x-axis of the sketch group base plane in the 3D space
|
||||
xAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
// The y-axis of the sketch group base plane in the 3D space
|
||||
yAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
// The z-axis of the sketch group base plane in the 3D space
|
||||
zAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
@ -9,7 +9,7 @@ Returns the segment end of y.
|
||||
|
||||
|
||||
```js
|
||||
segEndY(segment_name: string, sketch_group: SketchGroup) -> number
|
||||
segEndY(segment_name: TagIdentifier, sketch_group: SketchGroup) -> number
|
||||
```
|
||||
|
||||
### Examples
|
||||
@ -18,9 +18,9 @@ segEndY(segment_name: string, sketch_group: SketchGroup) -> number
|
||||
const exampleSketch = startSketchOn('XZ')
|
||||
|> startProfileAt([0, 0], %)
|
||||
|> line([20, 0], %)
|
||||
|> line([0, 3], %, "thing")
|
||||
|> line([0, 3], %, $thing)
|
||||
|> line([-10, 0], %)
|
||||
|> line([0, segEndY("thing", %)], %)
|
||||
|> line([0, segEndY(thing, %)], %)
|
||||
|> line([-10, 0], %)
|
||||
|> close(%)
|
||||
|
||||
@ -31,12 +31,15 @@ const example = extrude(5, exampleSketch)
|
||||
|
||||
### Arguments
|
||||
|
||||
* `segment_name`: `string` (REQUIRED)
|
||||
* `segment_name`: `TagIdentifier` (REQUIRED)
|
||||
```js
|
||||
{
|
||||
value: string,
|
||||
}
|
||||
```
|
||||
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
|
||||
```js
|
||||
{
|
||||
// The plane id or face id of the sketch group.
|
||||
entityId: uuid,
|
||||
// The id of the sketch group.
|
||||
id: uuid,
|
||||
// What the sketch is on (can be a plane or a face).
|
||||
@ -72,12 +75,184 @@ const example = extrude(5, exampleSketch)
|
||||
},
|
||||
} |
|
||||
{
|
||||
// the face id the sketch is on
|
||||
// The extrude group the face is on.
|
||||
extrudeGroup: {
|
||||
// The id of the extrusion end cap
|
||||
endCapId: uuid,
|
||||
// Chamfers or fillets on this extrude group.
|
||||
filletOrChamfers: [{
|
||||
// The engine id of the edge to fillet.
|
||||
edge_id: uuid,
|
||||
// The id of the engine command that called this fillet.
|
||||
id: uuid,
|
||||
radius: number,
|
||||
type: "fillet",
|
||||
} |
|
||||
{
|
||||
// The engine id of the edge to chamfer.
|
||||
edge_id: uuid,
|
||||
// The id of the engine command that called this chamfer.
|
||||
id: uuid,
|
||||
length: number,
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "chamfer",
|
||||
}],
|
||||
// The height of the extrude group.
|
||||
height: number,
|
||||
// The id of the extrude group.
|
||||
id: uuid,
|
||||
// The sketch group.
|
||||
sketchGroup: {
|
||||
// The id of the sketch group.
|
||||
id: uuid,
|
||||
// What the sketch is on (can be a plane or a face).
|
||||
on: SketchSurface,
|
||||
// The starting path.
|
||||
start: {
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
},
|
||||
// Tag identifiers that have been declared in this sketch group.
|
||||
tags: {
|
||||
},
|
||||
// The paths in the sketch group.
|
||||
value: [{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "ToPoint",
|
||||
} |
|
||||
{
|
||||
// arc's direction
|
||||
ccw: string,
|
||||
// the arc's center
|
||||
center: [number, number],
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArcTo",
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArc",
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Horizontal",
|
||||
// The x coordinate.
|
||||
x: number,
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "AngledLineTo",
|
||||
// The x coordinate.
|
||||
x: number,
|
||||
// The y coordinate.
|
||||
y: number,
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Base",
|
||||
}],
|
||||
},
|
||||
// The id of the extrusion start cap
|
||||
startCapId: uuid,
|
||||
// The extrude surfaces.
|
||||
value: [{
|
||||
// The face id for the extrude plane.
|
||||
faceId: uuid,
|
||||
// The id of the geometry.
|
||||
id: uuid,
|
||||
// The source range.
|
||||
sourceRange: [number, number],
|
||||
// The tag.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "extrudePlane",
|
||||
} |
|
||||
{
|
||||
// The face id for the extrude plane.
|
||||
faceId: uuid,
|
||||
// The id of the geometry.
|
||||
id: uuid,
|
||||
// The source range.
|
||||
sourceRange: [number, number],
|
||||
// The tag.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "extrudeArc",
|
||||
}],
|
||||
},
|
||||
// The id of the face.
|
||||
id: uuid,
|
||||
// The original sketch group id of the object we are sketching on.
|
||||
sketchGroupId: uuid,
|
||||
type: "face",
|
||||
// The tag of the face.
|
||||
value: string,
|
||||
@ -100,25 +275,32 @@ const example = extrude(5, exampleSketch)
|
||||
z: number,
|
||||
},
|
||||
},
|
||||
// The position of the sketch group.
|
||||
position: [number, number, number],
|
||||
// The rotation of the sketch group base plane.
|
||||
rotation: [number, number, number, number],
|
||||
// The starting path.
|
||||
start: {
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
},
|
||||
// Tag identifiers that have been declared in this sketch group.
|
||||
tags: {
|
||||
},
|
||||
// The paths in the sketch group.
|
||||
value: [{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "ToPoint",
|
||||
@ -130,8 +312,12 @@ const example = extrude(5, exampleSketch)
|
||||
center: [number, number],
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArcTo",
|
||||
@ -139,8 +325,12 @@ const example = extrude(5, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArc",
|
||||
@ -148,8 +338,12 @@ const example = extrude(5, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Horizontal",
|
||||
@ -159,8 +353,12 @@ const example = extrude(5, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "AngledLineTo",
|
||||
@ -172,30 +370,16 @@ const example = extrude(5, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Base",
|
||||
}],
|
||||
// The x-axis of the sketch group base plane in the 3D space
|
||||
xAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
// The y-axis of the sketch group base plane in the 3D space
|
||||
yAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
// The z-axis of the sketch group base plane in the 3D space
|
||||
zAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
@ -9,7 +9,7 @@ Returns the length of the segment.
|
||||
|
||||
|
||||
```js
|
||||
segLen(segment_name: string, sketch_group: SketchGroup) -> number
|
||||
segLen(segment_name: TagIdentifier, sketch_group: SketchGroup) -> number
|
||||
```
|
||||
|
||||
### Examples
|
||||
@ -17,12 +17,9 @@ segLen(segment_name: string, sketch_group: SketchGroup) -> number
|
||||
```js
|
||||
const exampleSketch = startSketchOn("XZ")
|
||||
|> startProfileAt([0, 0], %)
|
||||
|> angledLine({ angle: 60, length: 10 }, %, "thing")
|
||||
|> angledLine({ angle: 60, length: 10 }, %, $thing)
|
||||
|> tangentialArc({ offset: -120, radius: 5 }, %)
|
||||
|> angledLine({
|
||||
angle: -60,
|
||||
length: segLen("thing", %)
|
||||
}, %)
|
||||
|> angledLine({ angle: -60, length: segLen(thing, %) }, %)
|
||||
|> close(%)
|
||||
|
||||
const example = extrude(5, exampleSketch)
|
||||
@ -32,12 +29,15 @@ const example = extrude(5, exampleSketch)
|
||||
|
||||
### Arguments
|
||||
|
||||
* `segment_name`: `string` (REQUIRED)
|
||||
* `segment_name`: `TagIdentifier` (REQUIRED)
|
||||
```js
|
||||
{
|
||||
value: string,
|
||||
}
|
||||
```
|
||||
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
|
||||
```js
|
||||
{
|
||||
// The plane id or face id of the sketch group.
|
||||
entityId: uuid,
|
||||
// The id of the sketch group.
|
||||
id: uuid,
|
||||
// What the sketch is on (can be a plane or a face).
|
||||
@ -73,12 +73,184 @@ const example = extrude(5, exampleSketch)
|
||||
},
|
||||
} |
|
||||
{
|
||||
// the face id the sketch is on
|
||||
// The extrude group the face is on.
|
||||
extrudeGroup: {
|
||||
// The id of the extrusion end cap
|
||||
endCapId: uuid,
|
||||
// Chamfers or fillets on this extrude group.
|
||||
filletOrChamfers: [{
|
||||
// The engine id of the edge to fillet.
|
||||
edge_id: uuid,
|
||||
// The id of the engine command that called this fillet.
|
||||
id: uuid,
|
||||
radius: number,
|
||||
type: "fillet",
|
||||
} |
|
||||
{
|
||||
// The engine id of the edge to chamfer.
|
||||
edge_id: uuid,
|
||||
// The id of the engine command that called this chamfer.
|
||||
id: uuid,
|
||||
length: number,
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "chamfer",
|
||||
}],
|
||||
// The height of the extrude group.
|
||||
height: number,
|
||||
// The id of the extrude group.
|
||||
id: uuid,
|
||||
// The sketch group.
|
||||
sketchGroup: {
|
||||
// The id of the sketch group.
|
||||
id: uuid,
|
||||
// What the sketch is on (can be a plane or a face).
|
||||
on: SketchSurface,
|
||||
// The starting path.
|
||||
start: {
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
},
|
||||
// Tag identifiers that have been declared in this sketch group.
|
||||
tags: {
|
||||
},
|
||||
// The paths in the sketch group.
|
||||
value: [{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "ToPoint",
|
||||
} |
|
||||
{
|
||||
// arc's direction
|
||||
ccw: string,
|
||||
// the arc's center
|
||||
center: [number, number],
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArcTo",
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArc",
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Horizontal",
|
||||
// The x coordinate.
|
||||
x: number,
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "AngledLineTo",
|
||||
// The x coordinate.
|
||||
x: number,
|
||||
// The y coordinate.
|
||||
y: number,
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Base",
|
||||
}],
|
||||
},
|
||||
// The id of the extrusion start cap
|
||||
startCapId: uuid,
|
||||
// The extrude surfaces.
|
||||
value: [{
|
||||
// The face id for the extrude plane.
|
||||
faceId: uuid,
|
||||
// The id of the geometry.
|
||||
id: uuid,
|
||||
// The source range.
|
||||
sourceRange: [number, number],
|
||||
// The tag.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "extrudePlane",
|
||||
} |
|
||||
{
|
||||
// The face id for the extrude plane.
|
||||
faceId: uuid,
|
||||
// The id of the geometry.
|
||||
id: uuid,
|
||||
// The source range.
|
||||
sourceRange: [number, number],
|
||||
// The tag.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "extrudeArc",
|
||||
}],
|
||||
},
|
||||
// The id of the face.
|
||||
id: uuid,
|
||||
// The original sketch group id of the object we are sketching on.
|
||||
sketchGroupId: uuid,
|
||||
type: "face",
|
||||
// The tag of the face.
|
||||
value: string,
|
||||
@ -101,25 +273,32 @@ const example = extrude(5, exampleSketch)
|
||||
z: number,
|
||||
},
|
||||
},
|
||||
// The position of the sketch group.
|
||||
position: [number, number, number],
|
||||
// The rotation of the sketch group base plane.
|
||||
rotation: [number, number, number, number],
|
||||
// The starting path.
|
||||
start: {
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
},
|
||||
// Tag identifiers that have been declared in this sketch group.
|
||||
tags: {
|
||||
},
|
||||
// The paths in the sketch group.
|
||||
value: [{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "ToPoint",
|
||||
@ -131,8 +310,12 @@ const example = extrude(5, exampleSketch)
|
||||
center: [number, number],
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArcTo",
|
||||
@ -140,8 +323,12 @@ const example = extrude(5, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArc",
|
||||
@ -149,8 +336,12 @@ const example = extrude(5, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Horizontal",
|
||||
@ -160,8 +351,12 @@ const example = extrude(5, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "AngledLineTo",
|
||||
@ -173,30 +368,16 @@ const example = extrude(5, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Base",
|
||||
}],
|
||||
// The x-axis of the sketch group base plane in the 3D space
|
||||
xAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
// The y-axis of the sketch group base plane in the 3D space
|
||||
yAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
// The z-axis of the sketch group base plane in the 3D space
|
||||
zAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
649
docs/kcl/shell.md
Normal file
@ -9,7 +9,7 @@ Start a profile at a given point.
|
||||
|
||||
|
||||
```js
|
||||
startProfileAt(to: [number], sketch_surface: SketchSurface, tag?: String) -> SketchGroup
|
||||
startProfileAt(to: [number], sketch_surface: SketchSurface, tag?: TagDeclarator) -> SketchGroup
|
||||
```
|
||||
|
||||
### Examples
|
||||
@ -90,44 +90,38 @@ const example = extrude(5, exampleSketch)
|
||||
},
|
||||
} |
|
||||
{
|
||||
// the face id the sketch is on
|
||||
faceId: uuid,
|
||||
// The id of the face.
|
||||
// The extrude group the face is on.
|
||||
extrudeGroup: {
|
||||
// The id of the extrusion end cap
|
||||
endCapId: uuid,
|
||||
// Chamfers or fillets on this extrude group.
|
||||
filletOrChamfers: [{
|
||||
// The engine id of the edge to fillet.
|
||||
edge_id: uuid,
|
||||
// The id of the engine command that called this fillet.
|
||||
id: uuid,
|
||||
// The original sketch group id of the object we are sketching on.
|
||||
sketchGroupId: uuid,
|
||||
type: "face",
|
||||
// The tag of the face.
|
||||
value: string,
|
||||
// What should the face’s X axis be?
|
||||
xAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
// What should the face’s Y axis be?
|
||||
yAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
// The z-axis (normal).
|
||||
zAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
}
|
||||
```
|
||||
* `tag`: `String` (OPTIONAL)
|
||||
|
||||
### Returns
|
||||
|
||||
`SketchGroup` - A sketch group is a collection of paths.
|
||||
```js
|
||||
radius: number,
|
||||
type: "fillet",
|
||||
} |
|
||||
{
|
||||
// The plane id or face id of the sketch group.
|
||||
entityId: uuid,
|
||||
// The engine id of the edge to chamfer.
|
||||
edge_id: uuid,
|
||||
// The id of the engine command that called this chamfer.
|
||||
id: uuid,
|
||||
length: number,
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "chamfer",
|
||||
}],
|
||||
// The height of the extrude group.
|
||||
height: number,
|
||||
// The id of the extrude group.
|
||||
id: uuid,
|
||||
// The sketch group.
|
||||
sketchGroup: {
|
||||
// The id of the sketch group.
|
||||
id: uuid,
|
||||
// What the sketch is on (can be a plane or a face).
|
||||
@ -163,12 +157,10 @@ const example = extrude(5, exampleSketch)
|
||||
},
|
||||
} |
|
||||
{
|
||||
// the face id the sketch is on
|
||||
faceId: uuid,
|
||||
// The extrude group the face is on.
|
||||
extrudeGroup: ExtrudeGroup,
|
||||
// The id of the face.
|
||||
id: uuid,
|
||||
// The original sketch group id of the object we are sketching on.
|
||||
sketchGroupId: uuid,
|
||||
type: "face",
|
||||
// The tag of the face.
|
||||
value: string,
|
||||
@ -191,25 +183,32 @@ const example = extrude(5, exampleSketch)
|
||||
z: number,
|
||||
},
|
||||
},
|
||||
// The position of the sketch group.
|
||||
position: [number, number, number],
|
||||
// The rotation of the sketch group base plane.
|
||||
rotation: [number, number, number, number],
|
||||
// The starting path.
|
||||
start: {
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
},
|
||||
// Tag identifiers that have been declared in this sketch group.
|
||||
tags: {
|
||||
},
|
||||
// The paths in the sketch group.
|
||||
value: [{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "ToPoint",
|
||||
@ -221,8 +220,12 @@ const example = extrude(5, exampleSketch)
|
||||
center: [number, number],
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArcTo",
|
||||
@ -230,8 +233,12 @@ const example = extrude(5, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArc",
|
||||
@ -239,8 +246,12 @@ const example = extrude(5, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Horizontal",
|
||||
@ -250,8 +261,12 @@ const example = extrude(5, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "AngledLineTo",
|
||||
@ -263,25 +278,69 @@ const example = extrude(5, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Base",
|
||||
}],
|
||||
// The x-axis of the sketch group base plane in the 3D space
|
||||
},
|
||||
// The id of the extrusion start cap
|
||||
startCapId: uuid,
|
||||
// The extrude surfaces.
|
||||
value: [{
|
||||
// The face id for the extrude plane.
|
||||
faceId: uuid,
|
||||
// The id of the geometry.
|
||||
id: uuid,
|
||||
// The source range.
|
||||
sourceRange: [number, number],
|
||||
// The tag.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "extrudePlane",
|
||||
} |
|
||||
{
|
||||
// The face id for the extrude plane.
|
||||
faceId: uuid,
|
||||
// The id of the geometry.
|
||||
id: uuid,
|
||||
// The source range.
|
||||
sourceRange: [number, number],
|
||||
// The tag.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "extrudeArc",
|
||||
}],
|
||||
},
|
||||
// The id of the face.
|
||||
id: uuid,
|
||||
type: "face",
|
||||
// The tag of the face.
|
||||
value: string,
|
||||
// What should the face’s X axis be?
|
||||
xAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
// The y-axis of the sketch group base plane in the 3D space
|
||||
// What should the face’s Y axis be?
|
||||
yAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
// The z-axis of the sketch group base plane in the 3D space
|
||||
// The z-axis (normal).
|
||||
zAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
@ -289,6 +348,362 @@ const example = extrude(5, exampleSketch)
|
||||
},
|
||||
}
|
||||
```
|
||||
* `tag`: `TagDeclarator` (OPTIONAL)
|
||||
```js
|
||||
{
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
}
|
||||
```
|
||||
|
||||
### Returns
|
||||
|
||||
`SketchGroup` - A sketch group is a collection of paths.
|
||||
```js
|
||||
{
|
||||
// The id of the sketch group.
|
||||
id: uuid,
|
||||
// What the sketch is on (can be a plane or a face).
|
||||
on: {
|
||||
// The id of the plane.
|
||||
id: uuid,
|
||||
// Origin of the plane.
|
||||
origin: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
type: "plane",
|
||||
// Type for a plane.
|
||||
value: "XY" | "XZ" | "YZ" | "Custom",
|
||||
// What should the plane’s X axis be?
|
||||
xAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
// What should the plane’s Y axis be?
|
||||
yAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
// The z-axis (normal).
|
||||
zAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
} |
|
||||
{
|
||||
// The extrude group the face is on.
|
||||
extrudeGroup: {
|
||||
// The id of the extrusion end cap
|
||||
endCapId: uuid,
|
||||
// Chamfers or fillets on this extrude group.
|
||||
filletOrChamfers: [{
|
||||
// The engine id of the edge to fillet.
|
||||
edge_id: uuid,
|
||||
// The id of the engine command that called this fillet.
|
||||
id: uuid,
|
||||
radius: number,
|
||||
type: "fillet",
|
||||
} |
|
||||
{
|
||||
// The engine id of the edge to chamfer.
|
||||
edge_id: uuid,
|
||||
// The id of the engine command that called this chamfer.
|
||||
id: uuid,
|
||||
length: number,
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "chamfer",
|
||||
}],
|
||||
// The height of the extrude group.
|
||||
height: number,
|
||||
// The id of the extrude group.
|
||||
id: uuid,
|
||||
// The sketch group.
|
||||
sketchGroup: {
|
||||
// The id of the sketch group.
|
||||
id: uuid,
|
||||
// What the sketch is on (can be a plane or a face).
|
||||
on: SketchSurface,
|
||||
// The starting path.
|
||||
start: {
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
},
|
||||
// Tag identifiers that have been declared in this sketch group.
|
||||
tags: {
|
||||
},
|
||||
// The paths in the sketch group.
|
||||
value: [{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "ToPoint",
|
||||
} |
|
||||
{
|
||||
// arc's direction
|
||||
ccw: string,
|
||||
// the arc's center
|
||||
center: [number, number],
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArcTo",
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArc",
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Horizontal",
|
||||
// The x coordinate.
|
||||
x: number,
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "AngledLineTo",
|
||||
// The x coordinate.
|
||||
x: number,
|
||||
// The y coordinate.
|
||||
y: number,
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Base",
|
||||
}],
|
||||
},
|
||||
// The id of the extrusion start cap
|
||||
startCapId: uuid,
|
||||
// The extrude surfaces.
|
||||
value: [{
|
||||
// The face id for the extrude plane.
|
||||
faceId: uuid,
|
||||
// The id of the geometry.
|
||||
id: uuid,
|
||||
// The source range.
|
||||
sourceRange: [number, number],
|
||||
// The tag.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "extrudePlane",
|
||||
} |
|
||||
{
|
||||
// The face id for the extrude plane.
|
||||
faceId: uuid,
|
||||
// The id of the geometry.
|
||||
id: uuid,
|
||||
// The source range.
|
||||
sourceRange: [number, number],
|
||||
// The tag.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "extrudeArc",
|
||||
}],
|
||||
},
|
||||
// The id of the face.
|
||||
id: uuid,
|
||||
type: "face",
|
||||
// The tag of the face.
|
||||
value: string,
|
||||
// What should the face’s X axis be?
|
||||
xAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
// What should the face’s Y axis be?
|
||||
yAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
// The z-axis (normal).
|
||||
zAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
},
|
||||
// The starting path.
|
||||
start: {
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
},
|
||||
// Tag identifiers that have been declared in this sketch group.
|
||||
tags: {
|
||||
},
|
||||
// The paths in the sketch group.
|
||||
value: [{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "ToPoint",
|
||||
} |
|
||||
{
|
||||
// arc's direction
|
||||
ccw: string,
|
||||
// the arc's center
|
||||
center: [number, number],
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArcTo",
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArc",
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Horizontal",
|
||||
// The x coordinate.
|
||||
x: number,
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "AngledLineTo",
|
||||
// The x coordinate.
|
||||
x: number,
|
||||
// The y coordinate.
|
||||
y: number,
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Base",
|
||||
}],
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
@ -59,8 +59,6 @@ const example = extrude(5, exampleSketch)
|
||||
`SketchGroup` - A sketch group is a collection of paths.
|
||||
```js
|
||||
{
|
||||
// The plane id or face id of the sketch group.
|
||||
entityId: uuid,
|
||||
// The id of the sketch group.
|
||||
id: uuid,
|
||||
// What the sketch is on (can be a plane or a face).
|
||||
@ -96,12 +94,184 @@ const example = extrude(5, exampleSketch)
|
||||
},
|
||||
} |
|
||||
{
|
||||
// the face id the sketch is on
|
||||
// The extrude group the face is on.
|
||||
extrudeGroup: {
|
||||
// The id of the extrusion end cap
|
||||
endCapId: uuid,
|
||||
// Chamfers or fillets on this extrude group.
|
||||
filletOrChamfers: [{
|
||||
// The engine id of the edge to fillet.
|
||||
edge_id: uuid,
|
||||
// The id of the engine command that called this fillet.
|
||||
id: uuid,
|
||||
radius: number,
|
||||
type: "fillet",
|
||||
} |
|
||||
{
|
||||
// The engine id of the edge to chamfer.
|
||||
edge_id: uuid,
|
||||
// The id of the engine command that called this chamfer.
|
||||
id: uuid,
|
||||
length: number,
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "chamfer",
|
||||
}],
|
||||
// The height of the extrude group.
|
||||
height: number,
|
||||
// The id of the extrude group.
|
||||
id: uuid,
|
||||
// The sketch group.
|
||||
sketchGroup: {
|
||||
// The id of the sketch group.
|
||||
id: uuid,
|
||||
// What the sketch is on (can be a plane or a face).
|
||||
on: SketchSurface,
|
||||
// The starting path.
|
||||
start: {
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
},
|
||||
// Tag identifiers that have been declared in this sketch group.
|
||||
tags: {
|
||||
},
|
||||
// The paths in the sketch group.
|
||||
value: [{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "ToPoint",
|
||||
} |
|
||||
{
|
||||
// arc's direction
|
||||
ccw: string,
|
||||
// the arc's center
|
||||
center: [number, number],
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArcTo",
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArc",
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Horizontal",
|
||||
// The x coordinate.
|
||||
x: number,
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "AngledLineTo",
|
||||
// The x coordinate.
|
||||
x: number,
|
||||
// The y coordinate.
|
||||
y: number,
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Base",
|
||||
}],
|
||||
},
|
||||
// The id of the extrusion start cap
|
||||
startCapId: uuid,
|
||||
// The extrude surfaces.
|
||||
value: [{
|
||||
// The face id for the extrude plane.
|
||||
faceId: uuid,
|
||||
// The id of the geometry.
|
||||
id: uuid,
|
||||
// The source range.
|
||||
sourceRange: [number, number],
|
||||
// The tag.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "extrudePlane",
|
||||
} |
|
||||
{
|
||||
// The face id for the extrude plane.
|
||||
faceId: uuid,
|
||||
// The id of the geometry.
|
||||
id: uuid,
|
||||
// The source range.
|
||||
sourceRange: [number, number],
|
||||
// The tag.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "extrudeArc",
|
||||
}],
|
||||
},
|
||||
// The id of the face.
|
||||
id: uuid,
|
||||
// The original sketch group id of the object we are sketching on.
|
||||
sketchGroupId: uuid,
|
||||
type: "face",
|
||||
// The tag of the face.
|
||||
value: string,
|
||||
@ -124,25 +294,32 @@ const example = extrude(5, exampleSketch)
|
||||
z: number,
|
||||
},
|
||||
},
|
||||
// The position of the sketch group.
|
||||
position: [number, number, number],
|
||||
// The rotation of the sketch group base plane.
|
||||
rotation: [number, number, number, number],
|
||||
// The starting path.
|
||||
start: {
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
},
|
||||
// Tag identifiers that have been declared in this sketch group.
|
||||
tags: {
|
||||
},
|
||||
// The paths in the sketch group.
|
||||
value: [{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "ToPoint",
|
||||
@ -154,8 +331,12 @@ const example = extrude(5, exampleSketch)
|
||||
center: [number, number],
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArcTo",
|
||||
@ -163,8 +344,12 @@ const example = extrude(5, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArc",
|
||||
@ -172,8 +357,12 @@ const example = extrude(5, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Horizontal",
|
||||
@ -183,8 +372,12 @@ const example = extrude(5, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "AngledLineTo",
|
||||
@ -196,30 +389,16 @@ const example = extrude(5, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Base",
|
||||
}],
|
||||
// The x-axis of the sketch group base plane in the 3D space
|
||||
xAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
// The y-axis of the sketch group base plane in the 3D space
|
||||
yAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
// The z-axis of the sketch group base plane in the 3D space
|
||||
zAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
@ -9,7 +9,7 @@ Start a sketch on a specific plane or face.
|
||||
|
||||
|
||||
```js
|
||||
startSketchOn(data: SketchData, tag?: SketchOnFaceTag) -> SketchSurface
|
||||
startSketchOn(data: SketchData, tag?: FaceTag) -> SketchSurface
|
||||
```
|
||||
|
||||
### Examples
|
||||
@ -49,7 +49,7 @@ const example003 = extrude(5, exampleSketch003)
|
||||
const exampleSketch = startSketchOn("XY")
|
||||
|> startProfileAt([0, 0], %)
|
||||
|> line([10, 0], %)
|
||||
|> line([0, 10], %, 'sketchingFace')
|
||||
|> line([0, 10], %, $sketchingFace)
|
||||
|> line([-10, 0], %)
|
||||
|> close(%)
|
||||
|
||||
@ -60,7 +60,7 @@ const exampleSketch002 = startSketchOn(example, 'sketchingFace')
|
||||
|> line([8, 0], %)
|
||||
|> line([0, 8], %)
|
||||
|> line([-8, 0], %)
|
||||
|> close(%, 'sketchingFace002')
|
||||
|> close(%, $sketchingFace002)
|
||||
|
||||
const example002 = extrude(10, exampleSketch002)
|
||||
|
||||
@ -163,20 +163,121 @@ const a1 = startSketchOn({
|
||||
{
|
||||
// The id of the extrusion end cap
|
||||
endCapId: uuid,
|
||||
// Chamfers or fillets on this extrude group.
|
||||
filletOrChamfers: [{
|
||||
// The engine id of the edge to fillet.
|
||||
edge_id: uuid,
|
||||
// The id of the engine command that called this fillet.
|
||||
id: uuid,
|
||||
radius: number,
|
||||
type: "fillet",
|
||||
} |
|
||||
{
|
||||
// The engine id of the edge to chamfer.
|
||||
edge_id: uuid,
|
||||
// The id of the engine command that called this chamfer.
|
||||
id: uuid,
|
||||
length: number,
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "chamfer",
|
||||
}],
|
||||
// The height of the extrude group.
|
||||
height: number,
|
||||
// The id of the extrude group.
|
||||
id: uuid,
|
||||
// The position of the extrude group.
|
||||
position: [number, number, number],
|
||||
// The rotation of the extrude group.
|
||||
rotation: [number, number, number, number],
|
||||
// The sketch group paths.
|
||||
sketchGroupValues: [{
|
||||
// The sketch group.
|
||||
sketchGroup: {
|
||||
// The id of the sketch group.
|
||||
id: uuid,
|
||||
// What the sketch is on (can be a plane or a face).
|
||||
on: {
|
||||
// The id of the plane.
|
||||
id: uuid,
|
||||
// Origin of the plane.
|
||||
origin: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
type: "plane",
|
||||
// Type for a plane.
|
||||
value: "XY" | "XZ" | "YZ" | "Custom",
|
||||
// What should the plane’s X axis be?
|
||||
xAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
// What should the plane’s Y axis be?
|
||||
yAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
// The z-axis (normal).
|
||||
zAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
} |
|
||||
{
|
||||
// The extrude group the face is on.
|
||||
extrudeGroup: ExtrudeGroup,
|
||||
// The id of the face.
|
||||
id: uuid,
|
||||
type: "face",
|
||||
// The tag of the face.
|
||||
value: string,
|
||||
// What should the face’s X axis be?
|
||||
xAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
// What should the face’s Y axis be?
|
||||
yAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
// The z-axis (normal).
|
||||
zAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
},
|
||||
// The starting path.
|
||||
start: {
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
},
|
||||
// Tag identifiers that have been declared in this sketch group.
|
||||
tags: {
|
||||
},
|
||||
// The paths in the sketch group.
|
||||
value: [{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "ToPoint",
|
||||
@ -188,8 +289,12 @@ const a1 = startSketchOn({
|
||||
center: [number, number],
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArcTo",
|
||||
@ -197,8 +302,12 @@ const a1 = startSketchOn({
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArc",
|
||||
@ -206,8 +315,12 @@ const a1 = startSketchOn({
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Horizontal",
|
||||
@ -217,8 +330,12 @@ const a1 = startSketchOn({
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "AngledLineTo",
|
||||
@ -230,12 +347,17 @@ const a1 = startSketchOn({
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Base",
|
||||
}],
|
||||
},
|
||||
// The id of the extrusion start cap
|
||||
startCapId: uuid,
|
||||
// The extrude surfaces.
|
||||
@ -244,14 +366,14 @@ const a1 = startSketchOn({
|
||||
faceId: uuid,
|
||||
// The id of the geometry.
|
||||
id: uuid,
|
||||
// The name.
|
||||
name: string,
|
||||
// The position.
|
||||
position: [number, number, number],
|
||||
// The rotation.
|
||||
rotation: [number, number, number, number],
|
||||
// The source range.
|
||||
sourceRange: [number, number],
|
||||
// The tag.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "extrudePlane",
|
||||
} |
|
||||
{
|
||||
@ -259,40 +381,24 @@ const a1 = startSketchOn({
|
||||
faceId: uuid,
|
||||
// The id of the geometry.
|
||||
id: uuid,
|
||||
// The name.
|
||||
name: string,
|
||||
// The position.
|
||||
position: [number, number, number],
|
||||
// The rotation.
|
||||
rotation: [number, number, number, number],
|
||||
// The source range.
|
||||
sourceRange: [number, number],
|
||||
// The tag.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "extrudeArc",
|
||||
}],
|
||||
// The x-axis of the extrude group base plane in the 3D space
|
||||
xAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
// The y-axis of the extrude group base plane in the 3D space
|
||||
yAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
// The z-axis of the extrude group base plane in the 3D space
|
||||
zAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
}
|
||||
```
|
||||
* `tag`: `SketchOnFaceTag` - A tag for sketch on face. (OPTIONAL)
|
||||
* `tag`: `FaceTag` - A tag for a face. (OPTIONAL)
|
||||
```js
|
||||
"start" | "end" |
|
||||
string
|
||||
{
|
||||
value: string,
|
||||
}
|
||||
```
|
||||
|
||||
### Returns
|
||||
@ -331,12 +437,241 @@ string
|
||||
},
|
||||
} |
|
||||
{
|
||||
// the face id the sketch is on
|
||||
faceId: uuid,
|
||||
// The extrude group the face is on.
|
||||
extrudeGroup: {
|
||||
// The id of the extrusion end cap
|
||||
endCapId: uuid,
|
||||
// Chamfers or fillets on this extrude group.
|
||||
filletOrChamfers: [{
|
||||
// The engine id of the edge to fillet.
|
||||
edge_id: uuid,
|
||||
// The id of the engine command that called this fillet.
|
||||
id: uuid,
|
||||
radius: number,
|
||||
type: "fillet",
|
||||
} |
|
||||
{
|
||||
// The engine id of the edge to chamfer.
|
||||
edge_id: uuid,
|
||||
// The id of the engine command that called this chamfer.
|
||||
id: uuid,
|
||||
length: number,
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "chamfer",
|
||||
}],
|
||||
// The height of the extrude group.
|
||||
height: number,
|
||||
// The id of the extrude group.
|
||||
id: uuid,
|
||||
// The sketch group.
|
||||
sketchGroup: {
|
||||
// The id of the sketch group.
|
||||
id: uuid,
|
||||
// What the sketch is on (can be a plane or a face).
|
||||
on: {
|
||||
// The id of the plane.
|
||||
id: uuid,
|
||||
// Origin of the plane.
|
||||
origin: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
type: "plane",
|
||||
// Type for a plane.
|
||||
value: "XY" | "XZ" | "YZ" | "Custom",
|
||||
// What should the plane’s X axis be?
|
||||
xAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
// What should the plane’s Y axis be?
|
||||
yAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
// The z-axis (normal).
|
||||
zAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
} |
|
||||
{
|
||||
// The extrude group the face is on.
|
||||
extrudeGroup: ExtrudeGroup,
|
||||
// The id of the face.
|
||||
id: uuid,
|
||||
type: "face",
|
||||
// The tag of the face.
|
||||
value: string,
|
||||
// What should the face’s X axis be?
|
||||
xAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
// What should the face’s Y axis be?
|
||||
yAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
// The z-axis (normal).
|
||||
zAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
},
|
||||
// The starting path.
|
||||
start: {
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
},
|
||||
// Tag identifiers that have been declared in this sketch group.
|
||||
tags: {
|
||||
},
|
||||
// The paths in the sketch group.
|
||||
value: [{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "ToPoint",
|
||||
} |
|
||||
{
|
||||
// arc's direction
|
||||
ccw: string,
|
||||
// the arc's center
|
||||
center: [number, number],
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArcTo",
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArc",
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Horizontal",
|
||||
// The x coordinate.
|
||||
x: number,
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "AngledLineTo",
|
||||
// The x coordinate.
|
||||
x: number,
|
||||
// The y coordinate.
|
||||
y: number,
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Base",
|
||||
}],
|
||||
},
|
||||
// The id of the extrusion start cap
|
||||
startCapId: uuid,
|
||||
// The extrude surfaces.
|
||||
value: [{
|
||||
// The face id for the extrude plane.
|
||||
faceId: uuid,
|
||||
// The id of the geometry.
|
||||
id: uuid,
|
||||
// The source range.
|
||||
sourceRange: [number, number],
|
||||
// The tag.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "extrudePlane",
|
||||
} |
|
||||
{
|
||||
// The face id for the extrude plane.
|
||||
faceId: uuid,
|
||||
// The id of the geometry.
|
||||
id: uuid,
|
||||
// The source range.
|
||||
sourceRange: [number, number],
|
||||
// The tag.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "extrudeArc",
|
||||
}],
|
||||
},
|
||||
// The id of the face.
|
||||
id: uuid,
|
||||
// The original sketch group id of the object we are sketching on.
|
||||
sketchGroupId: uuid,
|
||||
type: "face",
|
||||
// The tag of the face.
|
||||
value: string,
|
||||
|
||||
138294
docs/kcl/std.json
@ -9,7 +9,7 @@ Draw an arc.
|
||||
|
||||
|
||||
```js
|
||||
tangentialArc(data: TangentialArcData, sketch_group: SketchGroup, tag?: String) -> SketchGroup
|
||||
tangentialArc(data: TangentialArcData, sketch_group: SketchGroup, tag?: TagDeclarator) -> SketchGroup
|
||||
```
|
||||
|
||||
### Examples
|
||||
@ -42,8 +42,6 @@ const example = extrude(10, exampleSketch)
|
||||
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
|
||||
```js
|
||||
{
|
||||
// The plane id or face id of the sketch group.
|
||||
entityId: uuid,
|
||||
// The id of the sketch group.
|
||||
id: uuid,
|
||||
// What the sketch is on (can be a plane or a face).
|
||||
@ -79,12 +77,184 @@ const example = extrude(10, exampleSketch)
|
||||
},
|
||||
} |
|
||||
{
|
||||
// the face id the sketch is on
|
||||
// The extrude group the face is on.
|
||||
extrudeGroup: {
|
||||
// The id of the extrusion end cap
|
||||
endCapId: uuid,
|
||||
// Chamfers or fillets on this extrude group.
|
||||
filletOrChamfers: [{
|
||||
// The engine id of the edge to fillet.
|
||||
edge_id: uuid,
|
||||
// The id of the engine command that called this fillet.
|
||||
id: uuid,
|
||||
radius: number,
|
||||
type: "fillet",
|
||||
} |
|
||||
{
|
||||
// The engine id of the edge to chamfer.
|
||||
edge_id: uuid,
|
||||
// The id of the engine command that called this chamfer.
|
||||
id: uuid,
|
||||
length: number,
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "chamfer",
|
||||
}],
|
||||
// The height of the extrude group.
|
||||
height: number,
|
||||
// The id of the extrude group.
|
||||
id: uuid,
|
||||
// The sketch group.
|
||||
sketchGroup: {
|
||||
// The id of the sketch group.
|
||||
id: uuid,
|
||||
// What the sketch is on (can be a plane or a face).
|
||||
on: SketchSurface,
|
||||
// The starting path.
|
||||
start: {
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
},
|
||||
// Tag identifiers that have been declared in this sketch group.
|
||||
tags: {
|
||||
},
|
||||
// The paths in the sketch group.
|
||||
value: [{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "ToPoint",
|
||||
} |
|
||||
{
|
||||
// arc's direction
|
||||
ccw: string,
|
||||
// the arc's center
|
||||
center: [number, number],
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArcTo",
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArc",
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Horizontal",
|
||||
// The x coordinate.
|
||||
x: number,
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "AngledLineTo",
|
||||
// The x coordinate.
|
||||
x: number,
|
||||
// The y coordinate.
|
||||
y: number,
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Base",
|
||||
}],
|
||||
},
|
||||
// The id of the extrusion start cap
|
||||
startCapId: uuid,
|
||||
// The extrude surfaces.
|
||||
value: [{
|
||||
// The face id for the extrude plane.
|
||||
faceId: uuid,
|
||||
// The id of the geometry.
|
||||
id: uuid,
|
||||
// The source range.
|
||||
sourceRange: [number, number],
|
||||
// The tag.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "extrudePlane",
|
||||
} |
|
||||
{
|
||||
// The face id for the extrude plane.
|
||||
faceId: uuid,
|
||||
// The id of the geometry.
|
||||
id: uuid,
|
||||
// The source range.
|
||||
sourceRange: [number, number],
|
||||
// The tag.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "extrudeArc",
|
||||
}],
|
||||
},
|
||||
// The id of the face.
|
||||
id: uuid,
|
||||
// The original sketch group id of the object we are sketching on.
|
||||
sketchGroupId: uuid,
|
||||
type: "face",
|
||||
// The tag of the face.
|
||||
value: string,
|
||||
@ -107,25 +277,32 @@ const example = extrude(10, exampleSketch)
|
||||
z: number,
|
||||
},
|
||||
},
|
||||
// The position of the sketch group.
|
||||
position: [number, number, number],
|
||||
// The rotation of the sketch group base plane.
|
||||
rotation: [number, number, number, number],
|
||||
// The starting path.
|
||||
start: {
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
},
|
||||
// Tag identifiers that have been declared in this sketch group.
|
||||
tags: {
|
||||
},
|
||||
// The paths in the sketch group.
|
||||
value: [{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "ToPoint",
|
||||
@ -137,8 +314,12 @@ const example = extrude(10, exampleSketch)
|
||||
center: [number, number],
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArcTo",
|
||||
@ -146,8 +327,12 @@ const example = extrude(10, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArc",
|
||||
@ -155,8 +340,12 @@ const example = extrude(10, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Horizontal",
|
||||
@ -166,8 +355,12 @@ const example = extrude(10, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "AngledLineTo",
|
||||
@ -179,41 +372,32 @@ const example = extrude(10, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Base",
|
||||
}],
|
||||
// The x-axis of the sketch group base plane in the 3D space
|
||||
xAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
// The y-axis of the sketch group base plane in the 3D space
|
||||
yAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
// The z-axis of the sketch group base plane in the 3D space
|
||||
zAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
}
|
||||
```
|
||||
* `tag`: `String` (OPTIONAL)
|
||||
* `tag`: `TagDeclarator` (OPTIONAL)
|
||||
```js
|
||||
{
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
}
|
||||
```
|
||||
|
||||
### Returns
|
||||
|
||||
`SketchGroup` - A sketch group is a collection of paths.
|
||||
```js
|
||||
{
|
||||
// The plane id or face id of the sketch group.
|
||||
entityId: uuid,
|
||||
// The id of the sketch group.
|
||||
id: uuid,
|
||||
// What the sketch is on (can be a plane or a face).
|
||||
@ -249,12 +433,184 @@ const example = extrude(10, exampleSketch)
|
||||
},
|
||||
} |
|
||||
{
|
||||
// the face id the sketch is on
|
||||
// The extrude group the face is on.
|
||||
extrudeGroup: {
|
||||
// The id of the extrusion end cap
|
||||
endCapId: uuid,
|
||||
// Chamfers or fillets on this extrude group.
|
||||
filletOrChamfers: [{
|
||||
// The engine id of the edge to fillet.
|
||||
edge_id: uuid,
|
||||
// The id of the engine command that called this fillet.
|
||||
id: uuid,
|
||||
radius: number,
|
||||
type: "fillet",
|
||||
} |
|
||||
{
|
||||
// The engine id of the edge to chamfer.
|
||||
edge_id: uuid,
|
||||
// The id of the engine command that called this chamfer.
|
||||
id: uuid,
|
||||
length: number,
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "chamfer",
|
||||
}],
|
||||
// The height of the extrude group.
|
||||
height: number,
|
||||
// The id of the extrude group.
|
||||
id: uuid,
|
||||
// The sketch group.
|
||||
sketchGroup: {
|
||||
// The id of the sketch group.
|
||||
id: uuid,
|
||||
// What the sketch is on (can be a plane or a face).
|
||||
on: SketchSurface,
|
||||
// The starting path.
|
||||
start: {
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
},
|
||||
// Tag identifiers that have been declared in this sketch group.
|
||||
tags: {
|
||||
},
|
||||
// The paths in the sketch group.
|
||||
value: [{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "ToPoint",
|
||||
} |
|
||||
{
|
||||
// arc's direction
|
||||
ccw: string,
|
||||
// the arc's center
|
||||
center: [number, number],
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArcTo",
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArc",
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Horizontal",
|
||||
// The x coordinate.
|
||||
x: number,
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "AngledLineTo",
|
||||
// The x coordinate.
|
||||
x: number,
|
||||
// The y coordinate.
|
||||
y: number,
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Base",
|
||||
}],
|
||||
},
|
||||
// The id of the extrusion start cap
|
||||
startCapId: uuid,
|
||||
// The extrude surfaces.
|
||||
value: [{
|
||||
// The face id for the extrude plane.
|
||||
faceId: uuid,
|
||||
// The id of the geometry.
|
||||
id: uuid,
|
||||
// The source range.
|
||||
sourceRange: [number, number],
|
||||
// The tag.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "extrudePlane",
|
||||
} |
|
||||
{
|
||||
// The face id for the extrude plane.
|
||||
faceId: uuid,
|
||||
// The id of the geometry.
|
||||
id: uuid,
|
||||
// The source range.
|
||||
sourceRange: [number, number],
|
||||
// The tag.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "extrudeArc",
|
||||
}],
|
||||
},
|
||||
// The id of the face.
|
||||
id: uuid,
|
||||
// The original sketch group id of the object we are sketching on.
|
||||
sketchGroupId: uuid,
|
||||
type: "face",
|
||||
// The tag of the face.
|
||||
value: string,
|
||||
@ -277,25 +633,32 @@ const example = extrude(10, exampleSketch)
|
||||
z: number,
|
||||
},
|
||||
},
|
||||
// The position of the sketch group.
|
||||
position: [number, number, number],
|
||||
// The rotation of the sketch group base plane.
|
||||
rotation: [number, number, number, number],
|
||||
// The starting path.
|
||||
start: {
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
},
|
||||
// Tag identifiers that have been declared in this sketch group.
|
||||
tags: {
|
||||
},
|
||||
// The paths in the sketch group.
|
||||
value: [{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "ToPoint",
|
||||
@ -307,8 +670,12 @@ const example = extrude(10, exampleSketch)
|
||||
center: [number, number],
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArcTo",
|
||||
@ -316,8 +683,12 @@ const example = extrude(10, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArc",
|
||||
@ -325,8 +696,12 @@ const example = extrude(10, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Horizontal",
|
||||
@ -336,8 +711,12 @@ const example = extrude(10, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "AngledLineTo",
|
||||
@ -349,30 +728,16 @@ const example = extrude(10, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Base",
|
||||
}],
|
||||
// The x-axis of the sketch group base plane in the 3D space
|
||||
xAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
// The y-axis of the sketch group base plane in the 3D space
|
||||
yAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
// The z-axis of the sketch group base plane in the 3D space
|
||||
zAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
@ -9,7 +9,7 @@ Draw an arc.
|
||||
|
||||
|
||||
```js
|
||||
tangentialArcTo(to: [number], sketch_group: SketchGroup, tag?: String) -> SketchGroup
|
||||
tangentialArcTo(to: [number], sketch_group: SketchGroup, tag?: TagDeclarator) -> SketchGroup
|
||||
```
|
||||
|
||||
### Examples
|
||||
@ -33,8 +33,6 @@ const example = extrude(10, exampleSketch)
|
||||
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
|
||||
```js
|
||||
{
|
||||
// The plane id or face id of the sketch group.
|
||||
entityId: uuid,
|
||||
// The id of the sketch group.
|
||||
id: uuid,
|
||||
// What the sketch is on (can be a plane or a face).
|
||||
@ -70,12 +68,184 @@ const example = extrude(10, exampleSketch)
|
||||
},
|
||||
} |
|
||||
{
|
||||
// the face id the sketch is on
|
||||
// The extrude group the face is on.
|
||||
extrudeGroup: {
|
||||
// The id of the extrusion end cap
|
||||
endCapId: uuid,
|
||||
// Chamfers or fillets on this extrude group.
|
||||
filletOrChamfers: [{
|
||||
// The engine id of the edge to fillet.
|
||||
edge_id: uuid,
|
||||
// The id of the engine command that called this fillet.
|
||||
id: uuid,
|
||||
radius: number,
|
||||
type: "fillet",
|
||||
} |
|
||||
{
|
||||
// The engine id of the edge to chamfer.
|
||||
edge_id: uuid,
|
||||
// The id of the engine command that called this chamfer.
|
||||
id: uuid,
|
||||
length: number,
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "chamfer",
|
||||
}],
|
||||
// The height of the extrude group.
|
||||
height: number,
|
||||
// The id of the extrude group.
|
||||
id: uuid,
|
||||
// The sketch group.
|
||||
sketchGroup: {
|
||||
// The id of the sketch group.
|
||||
id: uuid,
|
||||
// What the sketch is on (can be a plane or a face).
|
||||
on: SketchSurface,
|
||||
// The starting path.
|
||||
start: {
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
},
|
||||
// Tag identifiers that have been declared in this sketch group.
|
||||
tags: {
|
||||
},
|
||||
// The paths in the sketch group.
|
||||
value: [{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "ToPoint",
|
||||
} |
|
||||
{
|
||||
// arc's direction
|
||||
ccw: string,
|
||||
// the arc's center
|
||||
center: [number, number],
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArcTo",
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArc",
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Horizontal",
|
||||
// The x coordinate.
|
||||
x: number,
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "AngledLineTo",
|
||||
// The x coordinate.
|
||||
x: number,
|
||||
// The y coordinate.
|
||||
y: number,
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Base",
|
||||
}],
|
||||
},
|
||||
// The id of the extrusion start cap
|
||||
startCapId: uuid,
|
||||
// The extrude surfaces.
|
||||
value: [{
|
||||
// The face id for the extrude plane.
|
||||
faceId: uuid,
|
||||
// The id of the geometry.
|
||||
id: uuid,
|
||||
// The source range.
|
||||
sourceRange: [number, number],
|
||||
// The tag.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "extrudePlane",
|
||||
} |
|
||||
{
|
||||
// The face id for the extrude plane.
|
||||
faceId: uuid,
|
||||
// The id of the geometry.
|
||||
id: uuid,
|
||||
// The source range.
|
||||
sourceRange: [number, number],
|
||||
// The tag.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "extrudeArc",
|
||||
}],
|
||||
},
|
||||
// The id of the face.
|
||||
id: uuid,
|
||||
// The original sketch group id of the object we are sketching on.
|
||||
sketchGroupId: uuid,
|
||||
type: "face",
|
||||
// The tag of the face.
|
||||
value: string,
|
||||
@ -98,25 +268,32 @@ const example = extrude(10, exampleSketch)
|
||||
z: number,
|
||||
},
|
||||
},
|
||||
// The position of the sketch group.
|
||||
position: [number, number, number],
|
||||
// The rotation of the sketch group base plane.
|
||||
rotation: [number, number, number, number],
|
||||
// The starting path.
|
||||
start: {
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
},
|
||||
// Tag identifiers that have been declared in this sketch group.
|
||||
tags: {
|
||||
},
|
||||
// The paths in the sketch group.
|
||||
value: [{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "ToPoint",
|
||||
@ -128,8 +305,12 @@ const example = extrude(10, exampleSketch)
|
||||
center: [number, number],
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArcTo",
|
||||
@ -137,8 +318,12 @@ const example = extrude(10, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArc",
|
||||
@ -146,8 +331,12 @@ const example = extrude(10, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Horizontal",
|
||||
@ -157,8 +346,12 @@ const example = extrude(10, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "AngledLineTo",
|
||||
@ -170,41 +363,32 @@ const example = extrude(10, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Base",
|
||||
}],
|
||||
// The x-axis of the sketch group base plane in the 3D space
|
||||
xAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
// The y-axis of the sketch group base plane in the 3D space
|
||||
yAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
// The z-axis of the sketch group base plane in the 3D space
|
||||
zAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
}
|
||||
```
|
||||
* `tag`: `String` (OPTIONAL)
|
||||
* `tag`: `TagDeclarator` (OPTIONAL)
|
||||
```js
|
||||
{
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
}
|
||||
```
|
||||
|
||||
### Returns
|
||||
|
||||
`SketchGroup` - A sketch group is a collection of paths.
|
||||
```js
|
||||
{
|
||||
// The plane id or face id of the sketch group.
|
||||
entityId: uuid,
|
||||
// The id of the sketch group.
|
||||
id: uuid,
|
||||
// What the sketch is on (can be a plane or a face).
|
||||
@ -240,12 +424,184 @@ const example = extrude(10, exampleSketch)
|
||||
},
|
||||
} |
|
||||
{
|
||||
// the face id the sketch is on
|
||||
// The extrude group the face is on.
|
||||
extrudeGroup: {
|
||||
// The id of the extrusion end cap
|
||||
endCapId: uuid,
|
||||
// Chamfers or fillets on this extrude group.
|
||||
filletOrChamfers: [{
|
||||
// The engine id of the edge to fillet.
|
||||
edge_id: uuid,
|
||||
// The id of the engine command that called this fillet.
|
||||
id: uuid,
|
||||
radius: number,
|
||||
type: "fillet",
|
||||
} |
|
||||
{
|
||||
// The engine id of the edge to chamfer.
|
||||
edge_id: uuid,
|
||||
// The id of the engine command that called this chamfer.
|
||||
id: uuid,
|
||||
length: number,
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "chamfer",
|
||||
}],
|
||||
// The height of the extrude group.
|
||||
height: number,
|
||||
// The id of the extrude group.
|
||||
id: uuid,
|
||||
// The sketch group.
|
||||
sketchGroup: {
|
||||
// The id of the sketch group.
|
||||
id: uuid,
|
||||
// What the sketch is on (can be a plane or a face).
|
||||
on: SketchSurface,
|
||||
// The starting path.
|
||||
start: {
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
},
|
||||
// Tag identifiers that have been declared in this sketch group.
|
||||
tags: {
|
||||
},
|
||||
// The paths in the sketch group.
|
||||
value: [{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "ToPoint",
|
||||
} |
|
||||
{
|
||||
// arc's direction
|
||||
ccw: string,
|
||||
// the arc's center
|
||||
center: [number, number],
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArcTo",
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArc",
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Horizontal",
|
||||
// The x coordinate.
|
||||
x: number,
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "AngledLineTo",
|
||||
// The x coordinate.
|
||||
x: number,
|
||||
// The y coordinate.
|
||||
y: number,
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Base",
|
||||
}],
|
||||
},
|
||||
// The id of the extrusion start cap
|
||||
startCapId: uuid,
|
||||
// The extrude surfaces.
|
||||
value: [{
|
||||
// The face id for the extrude plane.
|
||||
faceId: uuid,
|
||||
// The id of the geometry.
|
||||
id: uuid,
|
||||
// The source range.
|
||||
sourceRange: [number, number],
|
||||
// The tag.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "extrudePlane",
|
||||
} |
|
||||
{
|
||||
// The face id for the extrude plane.
|
||||
faceId: uuid,
|
||||
// The id of the geometry.
|
||||
id: uuid,
|
||||
// The source range.
|
||||
sourceRange: [number, number],
|
||||
// The tag.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "extrudeArc",
|
||||
}],
|
||||
},
|
||||
// The id of the face.
|
||||
id: uuid,
|
||||
// The original sketch group id of the object we are sketching on.
|
||||
sketchGroupId: uuid,
|
||||
type: "face",
|
||||
// The tag of the face.
|
||||
value: string,
|
||||
@ -268,25 +624,32 @@ const example = extrude(10, exampleSketch)
|
||||
z: number,
|
||||
},
|
||||
},
|
||||
// The position of the sketch group.
|
||||
position: [number, number, number],
|
||||
// The rotation of the sketch group base plane.
|
||||
rotation: [number, number, number, number],
|
||||
// The starting path.
|
||||
start: {
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
},
|
||||
// Tag identifiers that have been declared in this sketch group.
|
||||
tags: {
|
||||
},
|
||||
// The paths in the sketch group.
|
||||
value: [{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "ToPoint",
|
||||
@ -298,8 +661,12 @@ const example = extrude(10, exampleSketch)
|
||||
center: [number, number],
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArcTo",
|
||||
@ -307,8 +674,12 @@ const example = extrude(10, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArc",
|
||||
@ -316,8 +687,12 @@ const example = extrude(10, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Horizontal",
|
||||
@ -327,8 +702,12 @@ const example = extrude(10, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "AngledLineTo",
|
||||
@ -340,30 +719,16 @@ const example = extrude(10, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Base",
|
||||
}],
|
||||
// The x-axis of the sketch group base plane in the 3D space
|
||||
xAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
// The y-axis of the sketch group base plane in the 3D space
|
||||
yAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
// The z-axis of the sketch group base plane in the 3D space
|
||||
zAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
@ -74,6 +74,107 @@ You can nest expressions in parenthesis as well:
|
||||
let myMathExpression = 3 + (1 * 2 / (3 - 7))
|
||||
```
|
||||
|
||||
Please if you find any issues using any of the above expressions or syntax
|
||||
## Tags
|
||||
|
||||
Tags are used to give a name (tag) to a specific path.
|
||||
|
||||
### Tag Declaration
|
||||
|
||||
The syntax for declaring a tag is `$myTag` you would use it in the following
|
||||
way:
|
||||
|
||||
```
|
||||
startSketchOn('XZ')
|
||||
|> startProfileAt(origin, %)
|
||||
|> angledLine([0, 191.26], %, $rectangleSegmentA001)
|
||||
|> angledLine([
|
||||
segAng(rectangleSegmentA001, %) - 90,
|
||||
196.99
|
||||
], %, $rectangleSegmentB001)
|
||||
|> angledLine([
|
||||
segAng(rectangleSegmentA001, %),
|
||||
-segLen(rectangleSegmentA001, %)
|
||||
], %, $rectangleSegmentC001)
|
||||
|> lineTo([profileStartX(%), profileStartY(%)], %)
|
||||
|> close(%)
|
||||
```
|
||||
|
||||
### Tag Identifier
|
||||
|
||||
As per the example above you can use the tag identifier to get a reference to the
|
||||
tagged object. The syntax for this is `myTag`.
|
||||
|
||||
In the example above we use the tag identifier to get the angle of the segment
|
||||
`segAng(rectangleSegmentA001, %)`.
|
||||
|
||||
|
||||
### Tag Scope
|
||||
|
||||
Tags are scoped globally if in the root context meaning in this example you can
|
||||
use the tag `rectangleSegmentA001` in any function or expression in the file.
|
||||
|
||||
However if the code was written like this:
|
||||
|
||||
```
|
||||
fn rect = (origin) => {
|
||||
return startSketchOn('XZ')
|
||||
|> startProfileAt(origin, %)
|
||||
|> angledLine([0, 191.26], %, $rectangleSegmentA001)
|
||||
|> angledLine([
|
||||
segAng(rectangleSegmentA001, %) - 90,
|
||||
196.99
|
||||
], %, $rectangleSegmentB001)
|
||||
|> angledLine([
|
||||
segAng(rectangleSegmentA001, %),
|
||||
-segLen(rectangleSegmentA001, %)
|
||||
], %, $rectangleSegmentC001)
|
||||
|> lineTo([profileStartX(%), profileStartY(%)], %)
|
||||
|> close(%)
|
||||
}
|
||||
|
||||
rect([0, 0])
|
||||
rect([20, 0])
|
||||
```
|
||||
|
||||
Those tags would only be available in the `rect` function and not globally.
|
||||
|
||||
However you likely want to use those tags somewhere outside the `rect` function.
|
||||
|
||||
Tags are accessible through the sketch group they are declared in.
|
||||
For example the following code works.
|
||||
|
||||
```
|
||||
fn rect = (origin) => {
|
||||
return startSketchOn('XZ')
|
||||
|> startProfileAt(origin, %)
|
||||
|> angledLine([0, 191.26], %, $rectangleSegmentA001)
|
||||
|> angledLine([
|
||||
segAng(rectangleSegmentA001, %) - 90,
|
||||
196.99
|
||||
], %, $rectangleSegmentB001)
|
||||
|> angledLine([
|
||||
segAng(rectangleSegmentA001, %),
|
||||
-segLen(rectangleSegmentA001, %)
|
||||
], %, $rectangleSegmentC001)
|
||||
|> lineTo([profileStartX(%), profileStartY(%)], %)
|
||||
|> close(%)
|
||||
}
|
||||
|
||||
rect([0, 0])
|
||||
const myRect = rect([20, 0])
|
||||
|
||||
myRect
|
||||
|> extrude(10, %)
|
||||
|> fillet({radius: 0.5, tags: [myRect.tags.rectangleSegmentA001]}, %)
|
||||
```
|
||||
|
||||
See how we use the tag `rectangleSegmentA001` in the `fillet` function outside
|
||||
the `rect` function. This is because the `rect` function is returning the
|
||||
sketch group that contains the tags.
|
||||
|
||||
|
||||
---
|
||||
|
||||
If you find any issues using any of the above expressions or syntax,
|
||||
please file an issue with the `ast` label on the [modeling-app
|
||||
repo](https://github.com/KittyCAD/modeling-app/issues/new).
|
||||
|
||||
@ -9,7 +9,7 @@ Draw a line on the x-axis.
|
||||
|
||||
|
||||
```js
|
||||
xLine(length: number, sketch_group: SketchGroup, tag?: String) -> SketchGroup
|
||||
xLine(length: number, sketch_group: SketchGroup, tag?: TagDeclarator) -> SketchGroup
|
||||
```
|
||||
|
||||
### Examples
|
||||
@ -36,8 +36,6 @@ const example = extrude(10, exampleSketch)
|
||||
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
|
||||
```js
|
||||
{
|
||||
// The plane id or face id of the sketch group.
|
||||
entityId: uuid,
|
||||
// The id of the sketch group.
|
||||
id: uuid,
|
||||
// What the sketch is on (can be a plane or a face).
|
||||
@ -73,12 +71,184 @@ const example = extrude(10, exampleSketch)
|
||||
},
|
||||
} |
|
||||
{
|
||||
// the face id the sketch is on
|
||||
// The extrude group the face is on.
|
||||
extrudeGroup: {
|
||||
// The id of the extrusion end cap
|
||||
endCapId: uuid,
|
||||
// Chamfers or fillets on this extrude group.
|
||||
filletOrChamfers: [{
|
||||
// The engine id of the edge to fillet.
|
||||
edge_id: uuid,
|
||||
// The id of the engine command that called this fillet.
|
||||
id: uuid,
|
||||
radius: number,
|
||||
type: "fillet",
|
||||
} |
|
||||
{
|
||||
// The engine id of the edge to chamfer.
|
||||
edge_id: uuid,
|
||||
// The id of the engine command that called this chamfer.
|
||||
id: uuid,
|
||||
length: number,
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "chamfer",
|
||||
}],
|
||||
// The height of the extrude group.
|
||||
height: number,
|
||||
// The id of the extrude group.
|
||||
id: uuid,
|
||||
// The sketch group.
|
||||
sketchGroup: {
|
||||
// The id of the sketch group.
|
||||
id: uuid,
|
||||
// What the sketch is on (can be a plane or a face).
|
||||
on: SketchSurface,
|
||||
// The starting path.
|
||||
start: {
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
},
|
||||
// Tag identifiers that have been declared in this sketch group.
|
||||
tags: {
|
||||
},
|
||||
// The paths in the sketch group.
|
||||
value: [{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "ToPoint",
|
||||
} |
|
||||
{
|
||||
// arc's direction
|
||||
ccw: string,
|
||||
// the arc's center
|
||||
center: [number, number],
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArcTo",
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArc",
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Horizontal",
|
||||
// The x coordinate.
|
||||
x: number,
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "AngledLineTo",
|
||||
// The x coordinate.
|
||||
x: number,
|
||||
// The y coordinate.
|
||||
y: number,
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Base",
|
||||
}],
|
||||
},
|
||||
// The id of the extrusion start cap
|
||||
startCapId: uuid,
|
||||
// The extrude surfaces.
|
||||
value: [{
|
||||
// The face id for the extrude plane.
|
||||
faceId: uuid,
|
||||
// The id of the geometry.
|
||||
id: uuid,
|
||||
// The source range.
|
||||
sourceRange: [number, number],
|
||||
// The tag.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "extrudePlane",
|
||||
} |
|
||||
{
|
||||
// The face id for the extrude plane.
|
||||
faceId: uuid,
|
||||
// The id of the geometry.
|
||||
id: uuid,
|
||||
// The source range.
|
||||
sourceRange: [number, number],
|
||||
// The tag.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "extrudeArc",
|
||||
}],
|
||||
},
|
||||
// The id of the face.
|
||||
id: uuid,
|
||||
// The original sketch group id of the object we are sketching on.
|
||||
sketchGroupId: uuid,
|
||||
type: "face",
|
||||
// The tag of the face.
|
||||
value: string,
|
||||
@ -101,25 +271,32 @@ const example = extrude(10, exampleSketch)
|
||||
z: number,
|
||||
},
|
||||
},
|
||||
// The position of the sketch group.
|
||||
position: [number, number, number],
|
||||
// The rotation of the sketch group base plane.
|
||||
rotation: [number, number, number, number],
|
||||
// The starting path.
|
||||
start: {
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
},
|
||||
// Tag identifiers that have been declared in this sketch group.
|
||||
tags: {
|
||||
},
|
||||
// The paths in the sketch group.
|
||||
value: [{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "ToPoint",
|
||||
@ -131,8 +308,12 @@ const example = extrude(10, exampleSketch)
|
||||
center: [number, number],
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArcTo",
|
||||
@ -140,8 +321,12 @@ const example = extrude(10, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArc",
|
||||
@ -149,8 +334,12 @@ const example = extrude(10, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Horizontal",
|
||||
@ -160,8 +349,12 @@ const example = extrude(10, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "AngledLineTo",
|
||||
@ -173,41 +366,32 @@ const example = extrude(10, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Base",
|
||||
}],
|
||||
// The x-axis of the sketch group base plane in the 3D space
|
||||
xAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
// The y-axis of the sketch group base plane in the 3D space
|
||||
yAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
// The z-axis of the sketch group base plane in the 3D space
|
||||
zAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
}
|
||||
```
|
||||
* `tag`: `String` (OPTIONAL)
|
||||
* `tag`: `TagDeclarator` (OPTIONAL)
|
||||
```js
|
||||
{
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
}
|
||||
```
|
||||
|
||||
### Returns
|
||||
|
||||
`SketchGroup` - A sketch group is a collection of paths.
|
||||
```js
|
||||
{
|
||||
// The plane id or face id of the sketch group.
|
||||
entityId: uuid,
|
||||
// The id of the sketch group.
|
||||
id: uuid,
|
||||
// What the sketch is on (can be a plane or a face).
|
||||
@ -243,12 +427,184 @@ const example = extrude(10, exampleSketch)
|
||||
},
|
||||
} |
|
||||
{
|
||||
// the face id the sketch is on
|
||||
// The extrude group the face is on.
|
||||
extrudeGroup: {
|
||||
// The id of the extrusion end cap
|
||||
endCapId: uuid,
|
||||
// Chamfers or fillets on this extrude group.
|
||||
filletOrChamfers: [{
|
||||
// The engine id of the edge to fillet.
|
||||
edge_id: uuid,
|
||||
// The id of the engine command that called this fillet.
|
||||
id: uuid,
|
||||
radius: number,
|
||||
type: "fillet",
|
||||
} |
|
||||
{
|
||||
// The engine id of the edge to chamfer.
|
||||
edge_id: uuid,
|
||||
// The id of the engine command that called this chamfer.
|
||||
id: uuid,
|
||||
length: number,
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "chamfer",
|
||||
}],
|
||||
// The height of the extrude group.
|
||||
height: number,
|
||||
// The id of the extrude group.
|
||||
id: uuid,
|
||||
// The sketch group.
|
||||
sketchGroup: {
|
||||
// The id of the sketch group.
|
||||
id: uuid,
|
||||
// What the sketch is on (can be a plane or a face).
|
||||
on: SketchSurface,
|
||||
// The starting path.
|
||||
start: {
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
},
|
||||
// Tag identifiers that have been declared in this sketch group.
|
||||
tags: {
|
||||
},
|
||||
// The paths in the sketch group.
|
||||
value: [{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "ToPoint",
|
||||
} |
|
||||
{
|
||||
// arc's direction
|
||||
ccw: string,
|
||||
// the arc's center
|
||||
center: [number, number],
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArcTo",
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArc",
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Horizontal",
|
||||
// The x coordinate.
|
||||
x: number,
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "AngledLineTo",
|
||||
// The x coordinate.
|
||||
x: number,
|
||||
// The y coordinate.
|
||||
y: number,
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Base",
|
||||
}],
|
||||
},
|
||||
// The id of the extrusion start cap
|
||||
startCapId: uuid,
|
||||
// The extrude surfaces.
|
||||
value: [{
|
||||
// The face id for the extrude plane.
|
||||
faceId: uuid,
|
||||
// The id of the geometry.
|
||||
id: uuid,
|
||||
// The source range.
|
||||
sourceRange: [number, number],
|
||||
// The tag.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "extrudePlane",
|
||||
} |
|
||||
{
|
||||
// The face id for the extrude plane.
|
||||
faceId: uuid,
|
||||
// The id of the geometry.
|
||||
id: uuid,
|
||||
// The source range.
|
||||
sourceRange: [number, number],
|
||||
// The tag.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "extrudeArc",
|
||||
}],
|
||||
},
|
||||
// The id of the face.
|
||||
id: uuid,
|
||||
// The original sketch group id of the object we are sketching on.
|
||||
sketchGroupId: uuid,
|
||||
type: "face",
|
||||
// The tag of the face.
|
||||
value: string,
|
||||
@ -271,25 +627,32 @@ const example = extrude(10, exampleSketch)
|
||||
z: number,
|
||||
},
|
||||
},
|
||||
// The position of the sketch group.
|
||||
position: [number, number, number],
|
||||
// The rotation of the sketch group base plane.
|
||||
rotation: [number, number, number, number],
|
||||
// The starting path.
|
||||
start: {
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
},
|
||||
// Tag identifiers that have been declared in this sketch group.
|
||||
tags: {
|
||||
},
|
||||
// The paths in the sketch group.
|
||||
value: [{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "ToPoint",
|
||||
@ -301,8 +664,12 @@ const example = extrude(10, exampleSketch)
|
||||
center: [number, number],
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArcTo",
|
||||
@ -310,8 +677,12 @@ const example = extrude(10, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArc",
|
||||
@ -319,8 +690,12 @@ const example = extrude(10, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Horizontal",
|
||||
@ -330,8 +705,12 @@ const example = extrude(10, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "AngledLineTo",
|
||||
@ -343,30 +722,16 @@ const example = extrude(10, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Base",
|
||||
}],
|
||||
// The x-axis of the sketch group base plane in the 3D space
|
||||
xAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
// The y-axis of the sketch group base plane in the 3D space
|
||||
yAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
// The z-axis of the sketch group base plane in the 3D space
|
||||
zAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
@ -9,7 +9,7 @@ Draw a line to a point on the x-axis.
|
||||
|
||||
|
||||
```js
|
||||
xLineTo(to: number, sketch_group: SketchGroup, tag?: String) -> SketchGroup
|
||||
xLineTo(to: number, sketch_group: SketchGroup, tag?: TagDeclarator) -> SketchGroup
|
||||
```
|
||||
|
||||
### Examples
|
||||
@ -36,8 +36,6 @@ const example = extrude(10, exampleSketch)
|
||||
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
|
||||
```js
|
||||
{
|
||||
// The plane id or face id of the sketch group.
|
||||
entityId: uuid,
|
||||
// The id of the sketch group.
|
||||
id: uuid,
|
||||
// What the sketch is on (can be a plane or a face).
|
||||
@ -73,12 +71,184 @@ const example = extrude(10, exampleSketch)
|
||||
},
|
||||
} |
|
||||
{
|
||||
// the face id the sketch is on
|
||||
// The extrude group the face is on.
|
||||
extrudeGroup: {
|
||||
// The id of the extrusion end cap
|
||||
endCapId: uuid,
|
||||
// Chamfers or fillets on this extrude group.
|
||||
filletOrChamfers: [{
|
||||
// The engine id of the edge to fillet.
|
||||
edge_id: uuid,
|
||||
// The id of the engine command that called this fillet.
|
||||
id: uuid,
|
||||
radius: number,
|
||||
type: "fillet",
|
||||
} |
|
||||
{
|
||||
// The engine id of the edge to chamfer.
|
||||
edge_id: uuid,
|
||||
// The id of the engine command that called this chamfer.
|
||||
id: uuid,
|
||||
length: number,
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "chamfer",
|
||||
}],
|
||||
// The height of the extrude group.
|
||||
height: number,
|
||||
// The id of the extrude group.
|
||||
id: uuid,
|
||||
// The sketch group.
|
||||
sketchGroup: {
|
||||
// The id of the sketch group.
|
||||
id: uuid,
|
||||
// What the sketch is on (can be a plane or a face).
|
||||
on: SketchSurface,
|
||||
// The starting path.
|
||||
start: {
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
},
|
||||
// Tag identifiers that have been declared in this sketch group.
|
||||
tags: {
|
||||
},
|
||||
// The paths in the sketch group.
|
||||
value: [{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "ToPoint",
|
||||
} |
|
||||
{
|
||||
// arc's direction
|
||||
ccw: string,
|
||||
// the arc's center
|
||||
center: [number, number],
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArcTo",
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArc",
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Horizontal",
|
||||
// The x coordinate.
|
||||
x: number,
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "AngledLineTo",
|
||||
// The x coordinate.
|
||||
x: number,
|
||||
// The y coordinate.
|
||||
y: number,
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Base",
|
||||
}],
|
||||
},
|
||||
// The id of the extrusion start cap
|
||||
startCapId: uuid,
|
||||
// The extrude surfaces.
|
||||
value: [{
|
||||
// The face id for the extrude plane.
|
||||
faceId: uuid,
|
||||
// The id of the geometry.
|
||||
id: uuid,
|
||||
// The source range.
|
||||
sourceRange: [number, number],
|
||||
// The tag.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "extrudePlane",
|
||||
} |
|
||||
{
|
||||
// The face id for the extrude plane.
|
||||
faceId: uuid,
|
||||
// The id of the geometry.
|
||||
id: uuid,
|
||||
// The source range.
|
||||
sourceRange: [number, number],
|
||||
// The tag.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "extrudeArc",
|
||||
}],
|
||||
},
|
||||
// The id of the face.
|
||||
id: uuid,
|
||||
// The original sketch group id of the object we are sketching on.
|
||||
sketchGroupId: uuid,
|
||||
type: "face",
|
||||
// The tag of the face.
|
||||
value: string,
|
||||
@ -101,25 +271,32 @@ const example = extrude(10, exampleSketch)
|
||||
z: number,
|
||||
},
|
||||
},
|
||||
// The position of the sketch group.
|
||||
position: [number, number, number],
|
||||
// The rotation of the sketch group base plane.
|
||||
rotation: [number, number, number, number],
|
||||
// The starting path.
|
||||
start: {
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
},
|
||||
// Tag identifiers that have been declared in this sketch group.
|
||||
tags: {
|
||||
},
|
||||
// The paths in the sketch group.
|
||||
value: [{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "ToPoint",
|
||||
@ -131,8 +308,12 @@ const example = extrude(10, exampleSketch)
|
||||
center: [number, number],
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArcTo",
|
||||
@ -140,8 +321,12 @@ const example = extrude(10, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArc",
|
||||
@ -149,8 +334,12 @@ const example = extrude(10, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Horizontal",
|
||||
@ -160,8 +349,12 @@ const example = extrude(10, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "AngledLineTo",
|
||||
@ -173,41 +366,32 @@ const example = extrude(10, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Base",
|
||||
}],
|
||||
// The x-axis of the sketch group base plane in the 3D space
|
||||
xAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
// The y-axis of the sketch group base plane in the 3D space
|
||||
yAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
// The z-axis of the sketch group base plane in the 3D space
|
||||
zAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
}
|
||||
```
|
||||
* `tag`: `String` (OPTIONAL)
|
||||
* `tag`: `TagDeclarator` (OPTIONAL)
|
||||
```js
|
||||
{
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
}
|
||||
```
|
||||
|
||||
### Returns
|
||||
|
||||
`SketchGroup` - A sketch group is a collection of paths.
|
||||
```js
|
||||
{
|
||||
// The plane id or face id of the sketch group.
|
||||
entityId: uuid,
|
||||
// The id of the sketch group.
|
||||
id: uuid,
|
||||
// What the sketch is on (can be a plane or a face).
|
||||
@ -243,12 +427,184 @@ const example = extrude(10, exampleSketch)
|
||||
},
|
||||
} |
|
||||
{
|
||||
// the face id the sketch is on
|
||||
// The extrude group the face is on.
|
||||
extrudeGroup: {
|
||||
// The id of the extrusion end cap
|
||||
endCapId: uuid,
|
||||
// Chamfers or fillets on this extrude group.
|
||||
filletOrChamfers: [{
|
||||
// The engine id of the edge to fillet.
|
||||
edge_id: uuid,
|
||||
// The id of the engine command that called this fillet.
|
||||
id: uuid,
|
||||
radius: number,
|
||||
type: "fillet",
|
||||
} |
|
||||
{
|
||||
// The engine id of the edge to chamfer.
|
||||
edge_id: uuid,
|
||||
// The id of the engine command that called this chamfer.
|
||||
id: uuid,
|
||||
length: number,
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "chamfer",
|
||||
}],
|
||||
// The height of the extrude group.
|
||||
height: number,
|
||||
// The id of the extrude group.
|
||||
id: uuid,
|
||||
// The sketch group.
|
||||
sketchGroup: {
|
||||
// The id of the sketch group.
|
||||
id: uuid,
|
||||
// What the sketch is on (can be a plane or a face).
|
||||
on: SketchSurface,
|
||||
// The starting path.
|
||||
start: {
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
},
|
||||
// Tag identifiers that have been declared in this sketch group.
|
||||
tags: {
|
||||
},
|
||||
// The paths in the sketch group.
|
||||
value: [{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "ToPoint",
|
||||
} |
|
||||
{
|
||||
// arc's direction
|
||||
ccw: string,
|
||||
// the arc's center
|
||||
center: [number, number],
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArcTo",
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArc",
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Horizontal",
|
||||
// The x coordinate.
|
||||
x: number,
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "AngledLineTo",
|
||||
// The x coordinate.
|
||||
x: number,
|
||||
// The y coordinate.
|
||||
y: number,
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Base",
|
||||
}],
|
||||
},
|
||||
// The id of the extrusion start cap
|
||||
startCapId: uuid,
|
||||
// The extrude surfaces.
|
||||
value: [{
|
||||
// The face id for the extrude plane.
|
||||
faceId: uuid,
|
||||
// The id of the geometry.
|
||||
id: uuid,
|
||||
// The source range.
|
||||
sourceRange: [number, number],
|
||||
// The tag.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "extrudePlane",
|
||||
} |
|
||||
{
|
||||
// The face id for the extrude plane.
|
||||
faceId: uuid,
|
||||
// The id of the geometry.
|
||||
id: uuid,
|
||||
// The source range.
|
||||
sourceRange: [number, number],
|
||||
// The tag.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "extrudeArc",
|
||||
}],
|
||||
},
|
||||
// The id of the face.
|
||||
id: uuid,
|
||||
// The original sketch group id of the object we are sketching on.
|
||||
sketchGroupId: uuid,
|
||||
type: "face",
|
||||
// The tag of the face.
|
||||
value: string,
|
||||
@ -271,25 +627,32 @@ const example = extrude(10, exampleSketch)
|
||||
z: number,
|
||||
},
|
||||
},
|
||||
// The position of the sketch group.
|
||||
position: [number, number, number],
|
||||
// The rotation of the sketch group base plane.
|
||||
rotation: [number, number, number, number],
|
||||
// The starting path.
|
||||
start: {
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
},
|
||||
// Tag identifiers that have been declared in this sketch group.
|
||||
tags: {
|
||||
},
|
||||
// The paths in the sketch group.
|
||||
value: [{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "ToPoint",
|
||||
@ -301,8 +664,12 @@ const example = extrude(10, exampleSketch)
|
||||
center: [number, number],
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArcTo",
|
||||
@ -310,8 +677,12 @@ const example = extrude(10, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArc",
|
||||
@ -319,8 +690,12 @@ const example = extrude(10, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Horizontal",
|
||||
@ -330,8 +705,12 @@ const example = extrude(10, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "AngledLineTo",
|
||||
@ -343,30 +722,16 @@ const example = extrude(10, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Base",
|
||||
}],
|
||||
// The x-axis of the sketch group base plane in the 3D space
|
||||
xAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
// The y-axis of the sketch group base plane in the 3D space
|
||||
yAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
// The z-axis of the sketch group base plane in the 3D space
|
||||
zAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
@ -9,7 +9,7 @@ Draw a line on the y-axis.
|
||||
|
||||
|
||||
```js
|
||||
yLine(length: number, sketch_group: SketchGroup, tag?: String) -> SketchGroup
|
||||
yLine(length: number, sketch_group: SketchGroup, tag?: TagDeclarator) -> SketchGroup
|
||||
```
|
||||
|
||||
### Examples
|
||||
@ -34,8 +34,6 @@ const example = extrude(10, exampleSketch)
|
||||
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
|
||||
```js
|
||||
{
|
||||
// The plane id or face id of the sketch group.
|
||||
entityId: uuid,
|
||||
// The id of the sketch group.
|
||||
id: uuid,
|
||||
// What the sketch is on (can be a plane or a face).
|
||||
@ -71,12 +69,184 @@ const example = extrude(10, exampleSketch)
|
||||
},
|
||||
} |
|
||||
{
|
||||
// the face id the sketch is on
|
||||
// The extrude group the face is on.
|
||||
extrudeGroup: {
|
||||
// The id of the extrusion end cap
|
||||
endCapId: uuid,
|
||||
// Chamfers or fillets on this extrude group.
|
||||
filletOrChamfers: [{
|
||||
// The engine id of the edge to fillet.
|
||||
edge_id: uuid,
|
||||
// The id of the engine command that called this fillet.
|
||||
id: uuid,
|
||||
radius: number,
|
||||
type: "fillet",
|
||||
} |
|
||||
{
|
||||
// The engine id of the edge to chamfer.
|
||||
edge_id: uuid,
|
||||
// The id of the engine command that called this chamfer.
|
||||
id: uuid,
|
||||
length: number,
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "chamfer",
|
||||
}],
|
||||
// The height of the extrude group.
|
||||
height: number,
|
||||
// The id of the extrude group.
|
||||
id: uuid,
|
||||
// The sketch group.
|
||||
sketchGroup: {
|
||||
// The id of the sketch group.
|
||||
id: uuid,
|
||||
// What the sketch is on (can be a plane or a face).
|
||||
on: SketchSurface,
|
||||
// The starting path.
|
||||
start: {
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
},
|
||||
// Tag identifiers that have been declared in this sketch group.
|
||||
tags: {
|
||||
},
|
||||
// The paths in the sketch group.
|
||||
value: [{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "ToPoint",
|
||||
} |
|
||||
{
|
||||
// arc's direction
|
||||
ccw: string,
|
||||
// the arc's center
|
||||
center: [number, number],
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArcTo",
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArc",
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Horizontal",
|
||||
// The x coordinate.
|
||||
x: number,
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "AngledLineTo",
|
||||
// The x coordinate.
|
||||
x: number,
|
||||
// The y coordinate.
|
||||
y: number,
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Base",
|
||||
}],
|
||||
},
|
||||
// The id of the extrusion start cap
|
||||
startCapId: uuid,
|
||||
// The extrude surfaces.
|
||||
value: [{
|
||||
// The face id for the extrude plane.
|
||||
faceId: uuid,
|
||||
// The id of the geometry.
|
||||
id: uuid,
|
||||
// The source range.
|
||||
sourceRange: [number, number],
|
||||
// The tag.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "extrudePlane",
|
||||
} |
|
||||
{
|
||||
// The face id for the extrude plane.
|
||||
faceId: uuid,
|
||||
// The id of the geometry.
|
||||
id: uuid,
|
||||
// The source range.
|
||||
sourceRange: [number, number],
|
||||
// The tag.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "extrudeArc",
|
||||
}],
|
||||
},
|
||||
// The id of the face.
|
||||
id: uuid,
|
||||
// The original sketch group id of the object we are sketching on.
|
||||
sketchGroupId: uuid,
|
||||
type: "face",
|
||||
// The tag of the face.
|
||||
value: string,
|
||||
@ -99,25 +269,32 @@ const example = extrude(10, exampleSketch)
|
||||
z: number,
|
||||
},
|
||||
},
|
||||
// The position of the sketch group.
|
||||
position: [number, number, number],
|
||||
// The rotation of the sketch group base plane.
|
||||
rotation: [number, number, number, number],
|
||||
// The starting path.
|
||||
start: {
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
},
|
||||
// Tag identifiers that have been declared in this sketch group.
|
||||
tags: {
|
||||
},
|
||||
// The paths in the sketch group.
|
||||
value: [{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "ToPoint",
|
||||
@ -129,8 +306,12 @@ const example = extrude(10, exampleSketch)
|
||||
center: [number, number],
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArcTo",
|
||||
@ -138,8 +319,12 @@ const example = extrude(10, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArc",
|
||||
@ -147,8 +332,12 @@ const example = extrude(10, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Horizontal",
|
||||
@ -158,8 +347,12 @@ const example = extrude(10, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "AngledLineTo",
|
||||
@ -171,41 +364,32 @@ const example = extrude(10, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Base",
|
||||
}],
|
||||
// The x-axis of the sketch group base plane in the 3D space
|
||||
xAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
// The y-axis of the sketch group base plane in the 3D space
|
||||
yAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
// The z-axis of the sketch group base plane in the 3D space
|
||||
zAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
}
|
||||
```
|
||||
* `tag`: `String` (OPTIONAL)
|
||||
* `tag`: `TagDeclarator` (OPTIONAL)
|
||||
```js
|
||||
{
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
}
|
||||
```
|
||||
|
||||
### Returns
|
||||
|
||||
`SketchGroup` - A sketch group is a collection of paths.
|
||||
```js
|
||||
{
|
||||
// The plane id or face id of the sketch group.
|
||||
entityId: uuid,
|
||||
// The id of the sketch group.
|
||||
id: uuid,
|
||||
// What the sketch is on (can be a plane or a face).
|
||||
@ -241,12 +425,184 @@ const example = extrude(10, exampleSketch)
|
||||
},
|
||||
} |
|
||||
{
|
||||
// the face id the sketch is on
|
||||
// The extrude group the face is on.
|
||||
extrudeGroup: {
|
||||
// The id of the extrusion end cap
|
||||
endCapId: uuid,
|
||||
// Chamfers or fillets on this extrude group.
|
||||
filletOrChamfers: [{
|
||||
// The engine id of the edge to fillet.
|
||||
edge_id: uuid,
|
||||
// The id of the engine command that called this fillet.
|
||||
id: uuid,
|
||||
radius: number,
|
||||
type: "fillet",
|
||||
} |
|
||||
{
|
||||
// The engine id of the edge to chamfer.
|
||||
edge_id: uuid,
|
||||
// The id of the engine command that called this chamfer.
|
||||
id: uuid,
|
||||
length: number,
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "chamfer",
|
||||
}],
|
||||
// The height of the extrude group.
|
||||
height: number,
|
||||
// The id of the extrude group.
|
||||
id: uuid,
|
||||
// The sketch group.
|
||||
sketchGroup: {
|
||||
// The id of the sketch group.
|
||||
id: uuid,
|
||||
// What the sketch is on (can be a plane or a face).
|
||||
on: SketchSurface,
|
||||
// The starting path.
|
||||
start: {
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
},
|
||||
// Tag identifiers that have been declared in this sketch group.
|
||||
tags: {
|
||||
},
|
||||
// The paths in the sketch group.
|
||||
value: [{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "ToPoint",
|
||||
} |
|
||||
{
|
||||
// arc's direction
|
||||
ccw: string,
|
||||
// the arc's center
|
||||
center: [number, number],
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArcTo",
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArc",
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Horizontal",
|
||||
// The x coordinate.
|
||||
x: number,
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "AngledLineTo",
|
||||
// The x coordinate.
|
||||
x: number,
|
||||
// The y coordinate.
|
||||
y: number,
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Base",
|
||||
}],
|
||||
},
|
||||
// The id of the extrusion start cap
|
||||
startCapId: uuid,
|
||||
// The extrude surfaces.
|
||||
value: [{
|
||||
// The face id for the extrude plane.
|
||||
faceId: uuid,
|
||||
// The id of the geometry.
|
||||
id: uuid,
|
||||
// The source range.
|
||||
sourceRange: [number, number],
|
||||
// The tag.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "extrudePlane",
|
||||
} |
|
||||
{
|
||||
// The face id for the extrude plane.
|
||||
faceId: uuid,
|
||||
// The id of the geometry.
|
||||
id: uuid,
|
||||
// The source range.
|
||||
sourceRange: [number, number],
|
||||
// The tag.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "extrudeArc",
|
||||
}],
|
||||
},
|
||||
// The id of the face.
|
||||
id: uuid,
|
||||
// The original sketch group id of the object we are sketching on.
|
||||
sketchGroupId: uuid,
|
||||
type: "face",
|
||||
// The tag of the face.
|
||||
value: string,
|
||||
@ -269,25 +625,32 @@ const example = extrude(10, exampleSketch)
|
||||
z: number,
|
||||
},
|
||||
},
|
||||
// The position of the sketch group.
|
||||
position: [number, number, number],
|
||||
// The rotation of the sketch group base plane.
|
||||
rotation: [number, number, number, number],
|
||||
// The starting path.
|
||||
start: {
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
},
|
||||
// Tag identifiers that have been declared in this sketch group.
|
||||
tags: {
|
||||
},
|
||||
// The paths in the sketch group.
|
||||
value: [{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "ToPoint",
|
||||
@ -299,8 +662,12 @@ const example = extrude(10, exampleSketch)
|
||||
center: [number, number],
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArcTo",
|
||||
@ -308,8 +675,12 @@ const example = extrude(10, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArc",
|
||||
@ -317,8 +688,12 @@ const example = extrude(10, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Horizontal",
|
||||
@ -328,8 +703,12 @@ const example = extrude(10, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "AngledLineTo",
|
||||
@ -341,30 +720,16 @@ const example = extrude(10, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Base",
|
||||
}],
|
||||
// The x-axis of the sketch group base plane in the 3D space
|
||||
xAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
// The y-axis of the sketch group base plane in the 3D space
|
||||
yAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
// The z-axis of the sketch group base plane in the 3D space
|
||||
zAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
@ -9,7 +9,7 @@ Draw a line to a point on the y-axis.
|
||||
|
||||
|
||||
```js
|
||||
yLineTo(to: number, sketch_group: SketchGroup, tag?: String) -> SketchGroup
|
||||
yLineTo(to: number, sketch_group: SketchGroup, tag?: TagDeclarator) -> SketchGroup
|
||||
```
|
||||
|
||||
### Examples
|
||||
@ -32,8 +32,6 @@ const example = extrude(5, exampleSketch)
|
||||
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
|
||||
```js
|
||||
{
|
||||
// The plane id or face id of the sketch group.
|
||||
entityId: uuid,
|
||||
// The id of the sketch group.
|
||||
id: uuid,
|
||||
// What the sketch is on (can be a plane or a face).
|
||||
@ -69,12 +67,184 @@ const example = extrude(5, exampleSketch)
|
||||
},
|
||||
} |
|
||||
{
|
||||
// the face id the sketch is on
|
||||
// The extrude group the face is on.
|
||||
extrudeGroup: {
|
||||
// The id of the extrusion end cap
|
||||
endCapId: uuid,
|
||||
// Chamfers or fillets on this extrude group.
|
||||
filletOrChamfers: [{
|
||||
// The engine id of the edge to fillet.
|
||||
edge_id: uuid,
|
||||
// The id of the engine command that called this fillet.
|
||||
id: uuid,
|
||||
radius: number,
|
||||
type: "fillet",
|
||||
} |
|
||||
{
|
||||
// The engine id of the edge to chamfer.
|
||||
edge_id: uuid,
|
||||
// The id of the engine command that called this chamfer.
|
||||
id: uuid,
|
||||
length: number,
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "chamfer",
|
||||
}],
|
||||
// The height of the extrude group.
|
||||
height: number,
|
||||
// The id of the extrude group.
|
||||
id: uuid,
|
||||
// The sketch group.
|
||||
sketchGroup: {
|
||||
// The id of the sketch group.
|
||||
id: uuid,
|
||||
// What the sketch is on (can be a plane or a face).
|
||||
on: SketchSurface,
|
||||
// The starting path.
|
||||
start: {
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
},
|
||||
// Tag identifiers that have been declared in this sketch group.
|
||||
tags: {
|
||||
},
|
||||
// The paths in the sketch group.
|
||||
value: [{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "ToPoint",
|
||||
} |
|
||||
{
|
||||
// arc's direction
|
||||
ccw: string,
|
||||
// the arc's center
|
||||
center: [number, number],
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArcTo",
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArc",
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Horizontal",
|
||||
// The x coordinate.
|
||||
x: number,
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "AngledLineTo",
|
||||
// The x coordinate.
|
||||
x: number,
|
||||
// The y coordinate.
|
||||
y: number,
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Base",
|
||||
}],
|
||||
},
|
||||
// The id of the extrusion start cap
|
||||
startCapId: uuid,
|
||||
// The extrude surfaces.
|
||||
value: [{
|
||||
// The face id for the extrude plane.
|
||||
faceId: uuid,
|
||||
// The id of the geometry.
|
||||
id: uuid,
|
||||
// The source range.
|
||||
sourceRange: [number, number],
|
||||
// The tag.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "extrudePlane",
|
||||
} |
|
||||
{
|
||||
// The face id for the extrude plane.
|
||||
faceId: uuid,
|
||||
// The id of the geometry.
|
||||
id: uuid,
|
||||
// The source range.
|
||||
sourceRange: [number, number],
|
||||
// The tag.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "extrudeArc",
|
||||
}],
|
||||
},
|
||||
// The id of the face.
|
||||
id: uuid,
|
||||
// The original sketch group id of the object we are sketching on.
|
||||
sketchGroupId: uuid,
|
||||
type: "face",
|
||||
// The tag of the face.
|
||||
value: string,
|
||||
@ -97,25 +267,32 @@ const example = extrude(5, exampleSketch)
|
||||
z: number,
|
||||
},
|
||||
},
|
||||
// The position of the sketch group.
|
||||
position: [number, number, number],
|
||||
// The rotation of the sketch group base plane.
|
||||
rotation: [number, number, number, number],
|
||||
// The starting path.
|
||||
start: {
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
},
|
||||
// Tag identifiers that have been declared in this sketch group.
|
||||
tags: {
|
||||
},
|
||||
// The paths in the sketch group.
|
||||
value: [{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "ToPoint",
|
||||
@ -127,8 +304,12 @@ const example = extrude(5, exampleSketch)
|
||||
center: [number, number],
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArcTo",
|
||||
@ -136,8 +317,12 @@ const example = extrude(5, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArc",
|
||||
@ -145,8 +330,12 @@ const example = extrude(5, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Horizontal",
|
||||
@ -156,8 +345,12 @@ const example = extrude(5, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "AngledLineTo",
|
||||
@ -169,41 +362,32 @@ const example = extrude(5, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Base",
|
||||
}],
|
||||
// The x-axis of the sketch group base plane in the 3D space
|
||||
xAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
// The y-axis of the sketch group base plane in the 3D space
|
||||
yAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
// The z-axis of the sketch group base plane in the 3D space
|
||||
zAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
}
|
||||
```
|
||||
* `tag`: `String` (OPTIONAL)
|
||||
* `tag`: `TagDeclarator` (OPTIONAL)
|
||||
```js
|
||||
{
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
}
|
||||
```
|
||||
|
||||
### Returns
|
||||
|
||||
`SketchGroup` - A sketch group is a collection of paths.
|
||||
```js
|
||||
{
|
||||
// The plane id or face id of the sketch group.
|
||||
entityId: uuid,
|
||||
// The id of the sketch group.
|
||||
id: uuid,
|
||||
// What the sketch is on (can be a plane or a face).
|
||||
@ -239,12 +423,184 @@ const example = extrude(5, exampleSketch)
|
||||
},
|
||||
} |
|
||||
{
|
||||
// the face id the sketch is on
|
||||
// The extrude group the face is on.
|
||||
extrudeGroup: {
|
||||
// The id of the extrusion end cap
|
||||
endCapId: uuid,
|
||||
// Chamfers or fillets on this extrude group.
|
||||
filletOrChamfers: [{
|
||||
// The engine id of the edge to fillet.
|
||||
edge_id: uuid,
|
||||
// The id of the engine command that called this fillet.
|
||||
id: uuid,
|
||||
radius: number,
|
||||
type: "fillet",
|
||||
} |
|
||||
{
|
||||
// The engine id of the edge to chamfer.
|
||||
edge_id: uuid,
|
||||
// The id of the engine command that called this chamfer.
|
||||
id: uuid,
|
||||
length: number,
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "chamfer",
|
||||
}],
|
||||
// The height of the extrude group.
|
||||
height: number,
|
||||
// The id of the extrude group.
|
||||
id: uuid,
|
||||
// The sketch group.
|
||||
sketchGroup: {
|
||||
// The id of the sketch group.
|
||||
id: uuid,
|
||||
// What the sketch is on (can be a plane or a face).
|
||||
on: SketchSurface,
|
||||
// The starting path.
|
||||
start: {
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
},
|
||||
// Tag identifiers that have been declared in this sketch group.
|
||||
tags: {
|
||||
},
|
||||
// The paths in the sketch group.
|
||||
value: [{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "ToPoint",
|
||||
} |
|
||||
{
|
||||
// arc's direction
|
||||
ccw: string,
|
||||
// the arc's center
|
||||
center: [number, number],
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArcTo",
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArc",
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Horizontal",
|
||||
// The x coordinate.
|
||||
x: number,
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "AngledLineTo",
|
||||
// The x coordinate.
|
||||
x: number,
|
||||
// The y coordinate.
|
||||
y: number,
|
||||
} |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Base",
|
||||
}],
|
||||
},
|
||||
// The id of the extrusion start cap
|
||||
startCapId: uuid,
|
||||
// The extrude surfaces.
|
||||
value: [{
|
||||
// The face id for the extrude plane.
|
||||
faceId: uuid,
|
||||
// The id of the geometry.
|
||||
id: uuid,
|
||||
// The source range.
|
||||
sourceRange: [number, number],
|
||||
// The tag.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "extrudePlane",
|
||||
} |
|
||||
{
|
||||
// The face id for the extrude plane.
|
||||
faceId: uuid,
|
||||
// The id of the geometry.
|
||||
id: uuid,
|
||||
// The source range.
|
||||
sourceRange: [number, number],
|
||||
// The tag.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
type: "extrudeArc",
|
||||
}],
|
||||
},
|
||||
// The id of the face.
|
||||
id: uuid,
|
||||
// The original sketch group id of the object we are sketching on.
|
||||
sketchGroupId: uuid,
|
||||
type: "face",
|
||||
// The tag of the face.
|
||||
value: string,
|
||||
@ -267,25 +623,32 @@ const example = extrude(5, exampleSketch)
|
||||
z: number,
|
||||
},
|
||||
},
|
||||
// The position of the sketch group.
|
||||
position: [number, number, number],
|
||||
// The rotation of the sketch group base plane.
|
||||
rotation: [number, number, number, number],
|
||||
// The starting path.
|
||||
start: {
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
},
|
||||
// Tag identifiers that have been declared in this sketch group.
|
||||
tags: {
|
||||
},
|
||||
// The paths in the sketch group.
|
||||
value: [{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "ToPoint",
|
||||
@ -297,8 +660,12 @@ const example = extrude(5, exampleSketch)
|
||||
center: [number, number],
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArcTo",
|
||||
@ -306,8 +673,12 @@ const example = extrude(5, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArc",
|
||||
@ -315,8 +686,12 @@ const example = extrude(5, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Horizontal",
|
||||
@ -326,8 +701,12 @@ const example = extrude(5, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "AngledLineTo",
|
||||
@ -339,30 +718,16 @@ const example = extrude(5, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Base",
|
||||
}],
|
||||
// The x-axis of the sketch group base plane in the 3D space
|
||||
xAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
// The y-axis of the sketch group base plane in the 3D space
|
||||
yAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
// The z-axis of the sketch group base plane in the 3D space
|
||||
zAxis: {
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
},
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
@ -91,8 +91,9 @@ const part001 = startSketchOn('-XZ')
|
||||
)
|
||||
})
|
||||
await page.setViewportSize({ width: 1200, height: 500 })
|
||||
await page.goto('/')
|
||||
|
||||
await u.waitForAuthSkipAppStart()
|
||||
|
||||
await u.openDebugPanel()
|
||||
await u.expectCmdLog('[data-message-type="execution-done"]')
|
||||
await u.waitForCmdReceive('extrude')
|
||||
@ -330,7 +331,7 @@ const extrudeDefaultPlane = async (context: any, page: any, plane: string) => {
|
||||
|
||||
const u = await getUtils(page)
|
||||
await page.setViewportSize({ width: 1200, height: 500 })
|
||||
await page.goto('/')
|
||||
|
||||
await u.waitForAuthSkipAppStart()
|
||||
|
||||
// wait for execution done
|
||||
@ -386,8 +387,8 @@ test('Draft segments should look right', async ({ page, context }) => {
|
||||
const u = await getUtils(page)
|
||||
await page.setViewportSize({ width: 1200, height: 500 })
|
||||
const PUR = 400 / 37.5 //pixeltoUnitRatio
|
||||
await page.goto('/')
|
||||
await u.waitForAuthSkipAppStart()
|
||||
|
||||
await u.openDebugPanel()
|
||||
|
||||
await expect(
|
||||
@ -405,17 +406,16 @@ test('Draft segments should look right', async ({ page, context }) => {
|
||||
// select a plane
|
||||
await page.mouse.click(700, 200)
|
||||
|
||||
await expect(page.locator('.cm-content')).toHaveText(
|
||||
`const part001 = startSketchOn('XZ')`
|
||||
)
|
||||
let code = `const sketch001 = startSketchOn('XZ')`
|
||||
await expect(page.locator('.cm-content')).toHaveText(code)
|
||||
|
||||
await page.waitForTimeout(300) // TODO detect animation ending, or disable animation
|
||||
await page.waitForTimeout(700) // TODO detect animation ending, or disable animation
|
||||
|
||||
const startXPx = 600
|
||||
await page.mouse.click(startXPx + PUR * 10, 500 - PUR * 10)
|
||||
await expect(page.locator('.cm-content'))
|
||||
.toHaveText(`const part001 = startSketchOn('XZ')
|
||||
|> startProfileAt([9.06, -12.22], %)`)
|
||||
code += `
|
||||
|> startProfileAt([7.19, -9.7], %)`
|
||||
await expect(page.locator('.cm-content')).toHaveText(code)
|
||||
await page.waitForTimeout(100)
|
||||
|
||||
await u.closeDebugPanel()
|
||||
@ -427,10 +427,9 @@ test('Draft segments should look right', async ({ page, context }) => {
|
||||
await page.mouse.click(startXPx + PUR * 20, 500 - PUR * 10)
|
||||
await page.waitForTimeout(100)
|
||||
|
||||
await expect(page.locator('.cm-content'))
|
||||
.toHaveText(`const part001 = startSketchOn('XZ')
|
||||
|> startProfileAt([9.06, -12.22], %)
|
||||
|> line([9.14, 0], %)`)
|
||||
code += `
|
||||
|> line([7.25, 0], %)`
|
||||
await expect(page.locator('.cm-content')).toHaveText(code)
|
||||
|
||||
await page.getByRole('button', { name: 'Tangential Arc' }).click()
|
||||
|
||||
@ -445,7 +444,7 @@ test('Draft rectangles should look right', async ({ page, context }) => {
|
||||
const u = await getUtils(page)
|
||||
await page.setViewportSize({ width: 1200, height: 500 })
|
||||
const PUR = 400 / 37.5 //pixeltoUnitRatio
|
||||
await page.goto('/')
|
||||
|
||||
await u.waitForAuthSkipAppStart()
|
||||
await u.openDebugPanel()
|
||||
|
||||
@ -465,7 +464,7 @@ test('Draft rectangles should look right', async ({ page, context }) => {
|
||||
await page.mouse.click(700, 200)
|
||||
|
||||
await expect(page.locator('.cm-content')).toHaveText(
|
||||
`const part001 = startSketchOn('XZ')`
|
||||
`const sketch001 = startSketchOn('XZ')`
|
||||
)
|
||||
|
||||
await page.waitForTimeout(500) // TODO detect animation ending, or disable animation
|
||||
@ -492,7 +491,7 @@ test.describe('Client side scene scale should match engine scale', () => {
|
||||
const u = await getUtils(page)
|
||||
await page.setViewportSize({ width: 1200, height: 500 })
|
||||
const PUR = 400 / 37.5 //pixeltoUnitRatio
|
||||
await page.goto('/')
|
||||
|
||||
await u.waitForAuthSkipAppStart()
|
||||
await u.openDebugPanel()
|
||||
|
||||
@ -513,17 +512,16 @@ test.describe('Client side scene scale should match engine scale', () => {
|
||||
// select a plane
|
||||
await page.mouse.click(700, 200)
|
||||
|
||||
await expect(page.locator('.cm-content')).toHaveText(
|
||||
`const part001 = startSketchOn('XZ')`
|
||||
)
|
||||
let code = `const sketch001 = startSketchOn('XZ')`
|
||||
await expect(page.locator('.cm-content')).toHaveText(code)
|
||||
|
||||
await page.waitForTimeout(300) // TODO detect animation ending, or disable animation
|
||||
await page.waitForTimeout(600) // TODO detect animation ending, or disable animation
|
||||
|
||||
const startXPx = 600
|
||||
await page.mouse.click(startXPx + PUR * 10, 500 - PUR * 10)
|
||||
await expect(page.locator('.cm-content'))
|
||||
.toHaveText(`const part001 = startSketchOn('XZ')
|
||||
|> startProfileAt([9.06, -12.22], %)`)
|
||||
code += `
|
||||
|> startProfileAt([7.19, -9.7], %)`
|
||||
await expect(u.codeLocator).toHaveText(code)
|
||||
await page.waitForTimeout(100)
|
||||
|
||||
await u.closeDebugPanel()
|
||||
@ -531,21 +529,18 @@ test.describe('Client side scene scale should match engine scale', () => {
|
||||
await page.mouse.click(startXPx + PUR * 20, 500 - PUR * 10)
|
||||
await page.waitForTimeout(100)
|
||||
|
||||
await expect(page.locator('.cm-content'))
|
||||
.toHaveText(`const part001 = startSketchOn('XZ')
|
||||
|> startProfileAt([9.06, -12.22], %)
|
||||
|> line([9.14, 0], %)`)
|
||||
code += `
|
||||
|> line([7.25, 0], %)`
|
||||
await expect(u.codeLocator).toHaveText(code)
|
||||
|
||||
await page.getByRole('button', { name: 'Tangential Arc' }).click()
|
||||
await page.waitForTimeout(100)
|
||||
|
||||
await page.mouse.click(startXPx + PUR * 30, 500 - PUR * 20)
|
||||
|
||||
await expect(page.locator('.cm-content'))
|
||||
.toHaveText(`const part001 = startSketchOn('XZ')
|
||||
|> startProfileAt([9.06, -12.22], %)
|
||||
|> line([9.14, 0], %)
|
||||
|> tangentialArcTo([27.34, -3.08], %)`)
|
||||
code += `
|
||||
|> tangentialArcTo([21.7, -2.44], %)`
|
||||
await expect(u.codeLocator).toHaveText(code)
|
||||
|
||||
// click tangential arc tool again to unequip it
|
||||
await page.getByRole('button', { name: 'Tangential Arc' }).click()
|
||||
@ -595,7 +590,7 @@ test.describe('Client side scene scale should match engine scale', () => {
|
||||
const u = await getUtils(page)
|
||||
await page.setViewportSize({ width: 1200, height: 500 })
|
||||
const PUR = 400 / 37.5 //pixeltoUnitRatio
|
||||
await page.goto('/')
|
||||
|
||||
await u.waitForAuthSkipAppStart()
|
||||
await u.openDebugPanel()
|
||||
|
||||
@ -616,17 +611,16 @@ test.describe('Client side scene scale should match engine scale', () => {
|
||||
// select a plane
|
||||
await page.mouse.click(700, 200)
|
||||
|
||||
await expect(page.locator('.cm-content')).toHaveText(
|
||||
`const part001 = startSketchOn('XZ')`
|
||||
)
|
||||
let code = `const sketch001 = startSketchOn('XZ')`
|
||||
await expect(u.codeLocator).toHaveText(code)
|
||||
|
||||
await page.waitForTimeout(300) // TODO detect animation ending, or disable animation
|
||||
await page.waitForTimeout(600) // TODO detect animation ending, or disable animation
|
||||
|
||||
const startXPx = 600
|
||||
await page.mouse.click(startXPx + PUR * 10, 500 - PUR * 10)
|
||||
await expect(page.locator('.cm-content'))
|
||||
.toHaveText(`const part001 = startSketchOn('XZ')
|
||||
|> startProfileAt([230.03, -310.32], %)`)
|
||||
code += `
|
||||
|> startProfileAt([182.59, -246.32], %)`
|
||||
await expect(u.codeLocator).toHaveText(code)
|
||||
await page.waitForTimeout(100)
|
||||
|
||||
await u.closeDebugPanel()
|
||||
@ -634,21 +628,18 @@ test.describe('Client side scene scale should match engine scale', () => {
|
||||
await page.mouse.click(startXPx + PUR * 20, 500 - PUR * 10)
|
||||
await page.waitForTimeout(100)
|
||||
|
||||
await expect(page.locator('.cm-content'))
|
||||
.toHaveText(`const part001 = startSketchOn('XZ')
|
||||
|> startProfileAt([230.03, -310.32], %)
|
||||
|> line([232.2, 0], %)`)
|
||||
code += `
|
||||
|> line([184.3, 0], %)`
|
||||
await expect(u.codeLocator).toHaveText(code)
|
||||
|
||||
await page.getByRole('button', { name: 'Tangential Arc' }).click()
|
||||
await page.waitForTimeout(100)
|
||||
|
||||
await page.mouse.click(startXPx + PUR * 30, 500 - PUR * 20)
|
||||
|
||||
await expect(page.locator('.cm-content'))
|
||||
.toHaveText(`const part001 = startSketchOn('XZ')
|
||||
|> startProfileAt([230.03, -310.32], %)
|
||||
|> line([232.2, 0], %)
|
||||
|> tangentialArcTo([694.43, -78.12], %)`)
|
||||
code += `
|
||||
|> tangentialArcTo([551.2, -62.01], %)`
|
||||
await expect(u.codeLocator).toHaveText(code)
|
||||
|
||||
await page.getByRole('button', { name: 'Tangential Arc' }).click()
|
||||
await page.waitForTimeout(100)
|
||||
@ -699,7 +690,7 @@ const part002 = startSketchOn(part001, 'seg01')
|
||||
}, KCL_DEFAULT_LENGTH)
|
||||
|
||||
await page.setViewportSize({ width: 1200, height: 500 })
|
||||
await page.goto('/')
|
||||
|
||||
await u.waitForAuthSkipAppStart()
|
||||
|
||||
await u.openDebugPanel()
|
||||
@ -749,7 +740,7 @@ test('Zoom to fit on load - solid 2d', async ({ page, context }) => {
|
||||
}, KCL_DEFAULT_LENGTH)
|
||||
|
||||
await page.setViewportSize({ width: 1200, height: 500 })
|
||||
await page.goto('/')
|
||||
|
||||
await u.waitForAuthSkipAppStart()
|
||||
|
||||
await u.openDebugPanel()
|
||||
@ -786,7 +777,7 @@ test('Zoom to fit on load - solid 3d', async ({ page, context }) => {
|
||||
}, KCL_DEFAULT_LENGTH)
|
||||
|
||||
await page.setViewportSize({ width: 1200, height: 500 })
|
||||
await page.goto('/')
|
||||
|
||||
await u.waitForAuthSkipAppStart()
|
||||
|
||||
await u.openDebugPanel()
|
||||
@ -805,3 +796,83 @@ test('Zoom to fit on load - solid 3d', async ({ page, context }) => {
|
||||
maxDiffPixels: 100,
|
||||
})
|
||||
})
|
||||
|
||||
test.describe('Grid visibility', () => {
|
||||
test('Grid turned off', async ({ page }) => {
|
||||
const u = await getUtils(page)
|
||||
const stream = page.getByTestId('stream')
|
||||
const mask = [
|
||||
page.locator('#app-header'),
|
||||
page.locator('#sidebar-top-ribbon'),
|
||||
page.locator('#sidebar-bottom-ribbon'),
|
||||
]
|
||||
|
||||
await page.setViewportSize({ width: 1200, height: 500 })
|
||||
await page.goto('/')
|
||||
await u.waitForAuthSkipAppStart()
|
||||
|
||||
await u.openDebugPanel()
|
||||
// wait for execution done
|
||||
await expect(
|
||||
page.locator('[data-message-type="execution-done"]')
|
||||
).toHaveCount(2)
|
||||
await u.closeDebugPanel()
|
||||
await u.closeKclCodePanel()
|
||||
// TODO: Find a way to truly know that the objects have finished
|
||||
// rendering, because an execution-done message is not sufficient.
|
||||
await page.waitForTimeout(1000)
|
||||
|
||||
await expect(stream).toHaveScreenshot({
|
||||
maxDiffPixels: 100,
|
||||
mask,
|
||||
})
|
||||
})
|
||||
|
||||
test('Grid turned on', async ({ page }) => {
|
||||
await page.addInitScript(
|
||||
async ({ settingsKey, settings }) => {
|
||||
localStorage.setItem(settingsKey, settings)
|
||||
},
|
||||
{
|
||||
settingsKey: TEST_SETTINGS_KEY,
|
||||
settings: TOML.stringify({
|
||||
settings: {
|
||||
...TEST_SETTINGS,
|
||||
modeling: {
|
||||
...TEST_SETTINGS.modeling,
|
||||
showScaleGrid: true,
|
||||
},
|
||||
},
|
||||
}),
|
||||
}
|
||||
)
|
||||
|
||||
const u = await getUtils(page)
|
||||
const stream = page.getByTestId('stream')
|
||||
const mask = [
|
||||
page.locator('#app-header'),
|
||||
page.locator('#sidebar-top-ribbon'),
|
||||
page.locator('#sidebar-bottom-ribbon'),
|
||||
]
|
||||
|
||||
await page.setViewportSize({ width: 1200, height: 500 })
|
||||
await page.goto('/')
|
||||
await u.waitForAuthSkipAppStart()
|
||||
|
||||
await u.openDebugPanel()
|
||||
// wait for execution done
|
||||
await expect(
|
||||
page.locator('[data-message-type="execution-done"]')
|
||||
).toHaveCount(2)
|
||||
await u.closeDebugPanel()
|
||||
await u.closeKclCodePanel()
|
||||
// TODO: Find a way to truly know that the objects have finished
|
||||
// rendering, because an execution-done message is not sufficient.
|
||||
await page.waitForTimeout(1000)
|
||||
|
||||
await expect(stream).toHaveScreenshot({
|
||||
maxDiffPixels: 100,
|
||||
mask,
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
|
Before Width: | Height: | Size: 41 KiB After Width: | Height: | Size: 42 KiB |
|
Before Width: | Height: | Size: 41 KiB After Width: | Height: | Size: 43 KiB |
|
Before Width: | Height: | Size: 46 KiB After Width: | Height: | Size: 49 KiB |
|
Before Width: | Height: | Size: 42 KiB After Width: | Height: | Size: 44 KiB |
|
Before Width: | Height: | Size: 28 KiB After Width: | Height: | Size: 32 KiB |
|
Before Width: | Height: | Size: 31 KiB After Width: | Height: | Size: 35 KiB |
|
Before Width: | Height: | Size: 34 KiB After Width: | Height: | Size: 38 KiB |
|
After Width: | Height: | Size: 13 KiB |
|
After Width: | Height: | Size: 29 KiB |
|
Before Width: | Height: | Size: 65 KiB After Width: | Height: | Size: 71 KiB |
|
Before Width: | Height: | Size: 71 KiB After Width: | Height: | Size: 43 KiB |
|
Before Width: | Height: | Size: 75 KiB After Width: | Height: | Size: 61 KiB |
|
Before Width: | Height: | Size: 43 KiB After Width: | Height: | Size: 29 KiB |
|
Before Width: | Height: | Size: 45 KiB After Width: | Height: | Size: 32 KiB |
|
Before Width: | Height: | Size: 43 KiB After Width: | Height: | Size: 32 KiB |
|
Before Width: | Height: | Size: 44 KiB After Width: | Height: | Size: 31 KiB |
|
Before Width: | Height: | Size: 46 KiB After Width: | Height: | Size: 35 KiB |
|
Before Width: | Height: | Size: 42 KiB After Width: | Height: | Size: 29 KiB |
@ -1,5 +1,6 @@
|
||||
import { SaveSettingsPayload } from 'lib/settings/settingsTypes'
|
||||
import { Themes } from 'lib/theme'
|
||||
import { onboardingPaths } from 'routes/Onboarding/paths'
|
||||
|
||||
export const TEST_SETTINGS_KEY = '/settings.toml'
|
||||
export const TEST_SETTINGS = {
|
||||
@ -22,9 +23,22 @@ export const TEST_SETTINGS = {
|
||||
},
|
||||
} satisfies Partial<SaveSettingsPayload>
|
||||
|
||||
export const TEST_SETTINGS_ONBOARDING_USER_MENU = {
|
||||
...TEST_SETTINGS,
|
||||
app: { ...TEST_SETTINGS.app, onboardingStatus: onboardingPaths.USER_MENU },
|
||||
} satisfies Partial<SaveSettingsPayload>
|
||||
|
||||
export const TEST_SETTINGS_ONBOARDING_EXPORT = {
|
||||
...TEST_SETTINGS,
|
||||
app: { ...TEST_SETTINGS.app, onboardingStatus: '/export' },
|
||||
app: { ...TEST_SETTINGS.app, onboardingStatus: onboardingPaths.EXPORT },
|
||||
} satisfies Partial<SaveSettingsPayload>
|
||||
|
||||
export const TEST_SETTINGS_ONBOARDING_PARAMETRIC_MODELING = {
|
||||
...TEST_SETTINGS,
|
||||
app: {
|
||||
...TEST_SETTINGS.app,
|
||||
onboardingStatus: onboardingPaths.PARAMETRIC_MODELING,
|
||||
},
|
||||
} satisfies Partial<SaveSettingsPayload>
|
||||
|
||||
export const TEST_SETTINGS_ONBOARDING_START = {
|
||||
@ -50,3 +64,25 @@ export const TEST_SETTINGS_CORRUPTED = {
|
||||
textWrapping: true,
|
||||
},
|
||||
} satisfies Partial<SaveSettingsPayload>
|
||||
|
||||
export const TEST_CODE_GIZMO = `const part001 = startSketchOn('XZ')
|
||||
|> startProfileAt([20, 0], %)
|
||||
|> line([7.13, 4 + 0], %)
|
||||
|> angledLine({ angle: 3 + 0, length: 3.14 + 0 }, %)
|
||||
|> lineTo([20.14 + 0, -0.14 + 0], %)
|
||||
|> xLineTo(29 + 0, %)
|
||||
|> yLine(-3.14 + 0, %, 'a')
|
||||
|> xLine(1.63, %)
|
||||
|> angledLineOfXLength({ angle: 3 + 0, length: 3.14 }, %)
|
||||
|> angledLineOfYLength({ angle: 30, length: 3 + 0 }, %)
|
||||
|> angledLineToX({ angle: 22.14 + 0, to: 12 }, %)
|
||||
|> angledLineToY({ angle: 30, to: 11.14 }, %)
|
||||
|> angledLineThatIntersects({
|
||||
angle: 3.14,
|
||||
intersectTag: 'a',
|
||||
offset: 0
|
||||
}, %)
|
||||
|> tangentialArcTo([13.14 + 0, 13.14], %)
|
||||
|> close(%)
|
||||
|> extrude(5 + 7, %)
|
||||
`
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
import { test, expect, Page, Download } from '@playwright/test'
|
||||
import { EngineCommand } from '../../src/lang/std/engineConnection'
|
||||
import os from 'os'
|
||||
import fsp from 'fs/promises'
|
||||
import pixelMatch from 'pixelmatch'
|
||||
import { PNG } from 'pngjs'
|
||||
@ -7,18 +8,27 @@ import { Protocol } from 'playwright-core/types/protocol'
|
||||
import type { Models } from '@kittycad/lib'
|
||||
import { APP_NAME } from 'lib/constants'
|
||||
|
||||
type TestColor = [number, number, number]
|
||||
export const TEST_COLORS = {
|
||||
WHITE: [249, 249, 249] as TestColor,
|
||||
YELLOW: [255, 255, 0] as TestColor,
|
||||
BLUE: [0, 0, 255] as TestColor,
|
||||
} as const
|
||||
|
||||
async function waitForPageLoad(page: Page) {
|
||||
// wait for 'Loading stream...' spinner
|
||||
await page.getByTestId('loading-stream').waitFor()
|
||||
// wait for all spinners to be gone
|
||||
await page.getByTestId('loading').waitFor({ state: 'detached' })
|
||||
await page
|
||||
.getByTestId('loading')
|
||||
.waitFor({ state: 'detached', timeout: 20_000 })
|
||||
|
||||
await page.getByTestId('start-sketch').waitFor()
|
||||
}
|
||||
|
||||
async function removeCurrentCode(page: Page) {
|
||||
const hotkey = process.platform === 'darwin' ? 'Meta' : 'Control'
|
||||
await page.click('.cm-content')
|
||||
await page.locator('.cm-content').click()
|
||||
await page.keyboard.down(hotkey)
|
||||
await page.keyboard.press('a')
|
||||
await page.keyboard.up(hotkey)
|
||||
@ -27,16 +37,16 @@ async function removeCurrentCode(page: Page) {
|
||||
}
|
||||
|
||||
async function sendCustomCmd(page: Page, cmd: EngineCommand) {
|
||||
await page.fill('[data-testid="custom-cmd-input"]', JSON.stringify(cmd))
|
||||
await page.click('[data-testid="custom-cmd-send-button"]')
|
||||
await page.getByTestId('custom-cmd-input').fill(JSON.stringify(cmd))
|
||||
await page.getByTestId('custom-cmd-send-button').click()
|
||||
}
|
||||
|
||||
async function clearCommandLogs(page: Page) {
|
||||
await page.click('[data-testid="clear-commands"]')
|
||||
await page.getByTestId('clear-commands').click()
|
||||
}
|
||||
|
||||
async function expectCmdLog(page: Page, locatorStr: string) {
|
||||
await expect(page.locator(locatorStr).last()).toBeVisible()
|
||||
async function expectCmdLog(page: Page, locatorStr: string, timeout = 5000) {
|
||||
await expect(page.locator(locatorStr).last()).toBeVisible({ timeout })
|
||||
}
|
||||
|
||||
async function waitForDefaultPlanesToBeVisible(page: Page) {
|
||||
@ -96,6 +106,124 @@ async function waitForCmdReceive(page: Page, commandType: string) {
|
||||
.waitFor()
|
||||
}
|
||||
|
||||
export const wiggleMove = async (
|
||||
page: any,
|
||||
x: number,
|
||||
y: number,
|
||||
steps: number,
|
||||
dist: number,
|
||||
ang: number,
|
||||
amplitude: number,
|
||||
freq: number,
|
||||
locator?: string
|
||||
) => {
|
||||
const tau = Math.PI * 2
|
||||
const deg = tau / 360
|
||||
const step = dist / steps
|
||||
for (let i = 0, j = 0; i < dist; i += step, j += 1) {
|
||||
if (locator) {
|
||||
const isElVis = await page.locator(locator).isVisible()
|
||||
if (isElVis) return
|
||||
}
|
||||
const [x1, y1] = [0, Math.sin((tau / steps) * j * freq) * amplitude]
|
||||
const [x2, y2] = [
|
||||
Math.cos(-ang * deg) * i - Math.sin(-ang * deg) * y1,
|
||||
Math.sin(-ang * deg) * i + Math.cos(-ang * deg) * y1,
|
||||
]
|
||||
const [xr, yr] = [x2, y2]
|
||||
await page.mouse.move(x + xr, y + yr, { steps: 5 })
|
||||
}
|
||||
}
|
||||
|
||||
export const circleMove = async (
|
||||
page: any,
|
||||
x: number,
|
||||
y: number,
|
||||
steps: number,
|
||||
diameter: number,
|
||||
locator?: string
|
||||
) => {
|
||||
const tau = Math.PI * 2
|
||||
const step = tau / steps
|
||||
for (let i = 0; i < tau; i += step) {
|
||||
if (locator) {
|
||||
const isElVis = await page.locator(locator).isVisible()
|
||||
if (isElVis) return
|
||||
}
|
||||
const [x1, y1] = [Math.cos(i) * diameter, Math.sin(i) * diameter]
|
||||
const [xr, yr] = [x1, y1]
|
||||
await page.mouse.move(x + xr, y + yr, { steps: 5 })
|
||||
}
|
||||
}
|
||||
|
||||
export const getMovementUtils = (opts: any) => {
|
||||
// The way we truncate is kinda odd apparently, so we need this function
|
||||
// "[k]itty[c]ad round"
|
||||
const kcRound = (n: number) => Math.trunc(n * 100) / 100
|
||||
|
||||
// To translate between screen and engine ("[U]nit") coordinates
|
||||
// NOTE: these pretty much can't be perfect because of screen scaling.
|
||||
// Handle on a case-by-case.
|
||||
const toU = (x: number, y: number) => [
|
||||
kcRound(x * 0.0678),
|
||||
kcRound(-y * 0.0678), // Y is inverted in our coordinate system
|
||||
]
|
||||
|
||||
// Turn the array into a string with specific formatting
|
||||
const fromUToString = (xy: number[]) => `[${xy[0]}, ${xy[1]}]`
|
||||
|
||||
// Combine because used often
|
||||
const toSU = (xy: number[]) => fromUToString(toU(xy[0], xy[1]))
|
||||
|
||||
// Make it easier to click around from center ("click [from] zero zero")
|
||||
const click00 = (x: number, y: number) =>
|
||||
opts.page.mouse.click(opts.center.x + x, opts.center.y + y, { delay: 100 })
|
||||
|
||||
// Relative clicker, must keep state
|
||||
let last = { x: 0, y: 0 }
|
||||
const click00r = async (x?: number, y?: number) => {
|
||||
// reset relative coordinates when anything is undefined
|
||||
if (x === undefined || y === undefined) {
|
||||
last.x = 0
|
||||
last.y = 0
|
||||
return
|
||||
}
|
||||
|
||||
await circleMove(
|
||||
opts.page,
|
||||
opts.center.x + last.x + x,
|
||||
opts.center.y + last.y + y,
|
||||
10,
|
||||
10
|
||||
)
|
||||
await click00(last.x + x, last.y + y)
|
||||
last.x += x
|
||||
last.y += y
|
||||
|
||||
// Returns the new absolute coordinate if you need it.
|
||||
return [last.x, last.y]
|
||||
}
|
||||
|
||||
return { toSU, click00r }
|
||||
}
|
||||
|
||||
async function waitForAuthAndLsp(page: Page) {
|
||||
const waitForLspPromise = page.waitForEvent('console', async (message) => {
|
||||
// it would be better to wait for a message that the kcl lsp has started by looking for the message message.text().includes('[lsp] [window/logMessage]')
|
||||
// but that doesn't seem to make it to the console for macos/safari :(
|
||||
if (message.text().includes('start kcl lsp')) {
|
||||
await new Promise((resolve) => setTimeout(resolve, 200))
|
||||
return true
|
||||
}
|
||||
return false
|
||||
})
|
||||
|
||||
await page.goto('/')
|
||||
await waitForPageLoad(page)
|
||||
|
||||
return waitForLspPromise
|
||||
}
|
||||
|
||||
export async function getUtils(page: Page) {
|
||||
// Chrome devtools protocol session only works in Chromium
|
||||
const browserType = page.context().browser()?.browserType().name()
|
||||
@ -103,7 +231,8 @@ export async function getUtils(page: Page) {
|
||||
browserType !== 'chromium' ? null : await page.context().newCDPSession(page)
|
||||
|
||||
return {
|
||||
waitForAuthSkipAppStart: () => waitForPageLoad(page),
|
||||
waitForAuthSkipAppStart: () => waitForAuthAndLsp(page),
|
||||
waitForPageLoad: () => waitForPageLoad(page),
|
||||
removeCurrentCode: () => removeCurrentCode(page),
|
||||
sendCustomCmd: (cmd: EngineCommand) => sendCustomCmd(page, cmd),
|
||||
updateCamPosition: async (xyz: [number, number, number]) => {
|
||||
@ -117,7 +246,8 @@ export async function getUtils(page: Page) {
|
||||
await fillInput('z', xyz[2])
|
||||
},
|
||||
clearCommandLogs: () => clearCommandLogs(page),
|
||||
expectCmdLog: (locatorStr: string) => expectCmdLog(page, locatorStr),
|
||||
expectCmdLog: (locatorStr: string, timeout = 5000) =>
|
||||
expectCmdLog(page, locatorStr, timeout),
|
||||
openKclCodePanel: () => openKclCodePanel(page),
|
||||
closeKclCodePanel: () => closeKclCodePanel(page),
|
||||
openDebugPanel: () => openDebugPanel(page),
|
||||
@ -141,15 +271,21 @@ export async function getUtils(page: Page) {
|
||||
const angleXOffset = Math.cos(((angle - 180) * Math.PI) / 180) * px
|
||||
const angleYOffset = Math.sin(((angle - 180) * Math.PI) / 180) * px
|
||||
return {
|
||||
x: bbox.x + angleXOffset,
|
||||
y: bbox.y - angleYOffset,
|
||||
x: Math.round(bbox.x + angleXOffset),
|
||||
y: Math.round(bbox.y - angleYOffset),
|
||||
}
|
||||
},
|
||||
getAngle: async (locator: string) => {
|
||||
const overlay = page.locator(locator)
|
||||
return Number(await overlay.getAttribute('data-overlay-angle'))
|
||||
},
|
||||
getBoundingBox: async (locator: string) =>
|
||||
page
|
||||
.locator(locator)
|
||||
.boundingBox()
|
||||
.then((box) => ({ x: box?.x || 0, y: box?.y || 0 })),
|
||||
.then((box) => ({ ...box, x: box?.x || 0, y: box?.y || 0 })),
|
||||
codeLocator: page.locator('.cm-content'),
|
||||
canvasLocator: page.getByTestId('client-side-scene'),
|
||||
doAndWaitForCmd: async (
|
||||
fn: () => Promise<void>,
|
||||
commandType: string,
|
||||
@ -165,6 +301,38 @@ export async function getUtils(page: Page) {
|
||||
await closeDebugPanel(page)
|
||||
}
|
||||
},
|
||||
/**
|
||||
* Given an expected RGB value, diff if the channel with the largest difference
|
||||
*/
|
||||
getGreatestPixDiff: async (
|
||||
coords: { x: number; y: number },
|
||||
expected: [number, number, number]
|
||||
): Promise<number> => {
|
||||
const buffer = await page.screenshot({
|
||||
fullPage: true,
|
||||
})
|
||||
const screenshot = await PNG.sync.read(buffer)
|
||||
// most likely related to pixel density but the screenshots for webkit are 2x the size
|
||||
// there might be a more robust way of doing this.
|
||||
const pixMultiplier = browserType === 'webkit' ? 2 : 1
|
||||
const index =
|
||||
(screenshot.width * coords.y * pixMultiplier +
|
||||
coords.x * pixMultiplier) *
|
||||
4 // rbga is 4 channels
|
||||
const maxDiff = Math.max(
|
||||
Math.abs(screenshot.data[index] - expected[0]),
|
||||
Math.abs(screenshot.data[index + 1] - expected[1]),
|
||||
Math.abs(screenshot.data[index + 2] - expected[2])
|
||||
)
|
||||
if (maxDiff > 4) {
|
||||
console.log(
|
||||
`Expected: ${expected} Actual: [${screenshot.data[index]}, ${
|
||||
screenshot.data[index + 1]
|
||||
}, ${screenshot.data[index + 2]}]`
|
||||
)
|
||||
}
|
||||
return maxDiff
|
||||
},
|
||||
doAndWaitForImageDiff: (fn: () => Promise<any>, diffCount = 200) =>
|
||||
new Promise(async (resolve) => {
|
||||
await page.screenshot({
|
||||
@ -366,3 +534,8 @@ export const doExport = async (
|
||||
outputType: output.type,
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the appropriate modifier key for the platform.
|
||||
*/
|
||||
export const metaModifier = os.platform() === 'darwin' ? 'Meta' : 'Control'
|
||||
|
||||
@ -2,6 +2,7 @@ import { browser, $, expect } from '@wdio/globals'
|
||||
import fs from 'fs/promises'
|
||||
import path from 'path'
|
||||
import os from 'os'
|
||||
import { click, setDatasetValue } from '../utils'
|
||||
|
||||
const isWin32 = os.platform() === 'win32'
|
||||
const documentsDir = path.join(os.homedir(), 'Documents')
|
||||
@ -15,25 +16,8 @@ const newProjectDir = path.join(documentsDir, 'a-different-directory')
|
||||
const tmp = process.env.TEMP || '/tmp'
|
||||
const userCodeDir = path.join(tmp, 'kittycad_user_code')
|
||||
|
||||
async function click(element: WebdriverIO.Element): Promise<void> {
|
||||
// Workaround for .click(), see https://github.com/tauri-apps/tauri/issues/6541
|
||||
await element.waitForClickable()
|
||||
await browser.execute('arguments[0].click();', element)
|
||||
}
|
||||
|
||||
/* Shoutout to @Sheap on Github for a great workaround utility:
|
||||
* https://github.com/tauri-apps/tauri/issues/6541#issue-1638944060
|
||||
*/
|
||||
async function setDatasetValue(
|
||||
field: WebdriverIO.Element,
|
||||
property: string,
|
||||
value: string
|
||||
) {
|
||||
await browser.execute(`arguments[0].dataset.${property} = "${value}"`, field)
|
||||
}
|
||||
|
||||
describe('ZMA (Tauri)', () => {
|
||||
it('opens the auth page and signs in', async () => {
|
||||
describe('ZMA sign in flow', () => {
|
||||
before(async () => {
|
||||
// Clean up filesystem from previous tests
|
||||
await new Promise((resolve) => setTimeout(resolve, 100))
|
||||
await fs.rm(defaultProjectDir, { force: true, recursive: true })
|
||||
@ -42,7 +26,9 @@ describe('ZMA (Tauri)', () => {
|
||||
await fs.rm(userSettingsDir, { force: true, recursive: true })
|
||||
await fs.mkdir(defaultProjectDir, { recursive: true })
|
||||
await fs.mkdir(newProjectDir, { recursive: true })
|
||||
})
|
||||
|
||||
it('opens the auth page and signs in', async () => {
|
||||
const signInButton = await $('[data-testid="sign-in-button"]')
|
||||
expect(await signInButton.getText()).toEqual('Sign in')
|
||||
|
||||
@ -82,6 +68,10 @@ describe('ZMA (Tauri)', () => {
|
||||
const newFileButton = await $('[data-testid="home-new-file"]')
|
||||
expect(await newFileButton.getText()).toEqual('New project')
|
||||
})
|
||||
})
|
||||
|
||||
describe('ZMA authorized user flows', () => {
|
||||
// Note: each flow below is intended to start *and* end from the home page
|
||||
|
||||
it('opens the settings page, checks filesystem settings, and closes the settings page', async () => {
|
||||
const menuButton = await $('[data-testid="user-sidebar-toggle"]')
|
||||
@ -150,8 +140,11 @@ describe('ZMA (Tauri)', () => {
|
||||
const base = isWin32 ? 'http://tauri.localhost' : 'tauri://localhost'
|
||||
await browser.execute(`window.location.href = "${base}/home"`)
|
||||
})
|
||||
})
|
||||
|
||||
describe('ZMA sign out flow', () => {
|
||||
it('signs out', async () => {
|
||||
await new Promise((resolve) => setTimeout(resolve, 1000))
|
||||
const menuButton = await $('[data-testid="user-sidebar-toggle"]')
|
||||
await click(menuButton)
|
||||
const signoutButton = await $('[data-testid="user-sidebar-sign-out"]')
|
||||
18
e2e/tauri/utils.ts
Normal file
@ -0,0 +1,18 @@
|
||||
import { browser } from '@wdio/globals'
|
||||
|
||||
export async function click(element: WebdriverIO.Element): Promise<void> {
|
||||
// Workaround for .click(), see https://github.com/tauri-apps/tauri/issues/6541
|
||||
await element.waitForClickable()
|
||||
await browser.execute('arguments[0].click();', element)
|
||||
}
|
||||
|
||||
/* Shoutout to @Sheap on Github for a great workaround utility:
|
||||
* https://github.com/tauri-apps/tauri/issues/6541#issue-1638944060
|
||||
*/
|
||||
export async function setDatasetValue(
|
||||
field: WebdriverIO.Element,
|
||||
property: string,
|
||||
value: string
|
||||
) {
|
||||
await browser.execute(`arguments[0].dataset.${property} = "${value}"`, field)
|
||||
}
|
||||
@ -1,3 +0,0 @@
|
||||
// comment
|
||||
|
||||
const hi = 5 + 4
|
||||
62
flake.lock
generated
Normal file
@ -0,0 +1,62 @@
|
||||
{
|
||||
"nodes": {
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1718470082,
|
||||
"narHash": "sha256-u2F0MMYE+Efc+ocruTbtU/wWHuYHWcJafp5zJ++n/YE=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "3027ba73dfef68eb555fc2fa97aed4e999e74f97",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "NixOS",
|
||||
"ref": "nixpkgs-unstable",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs_2": {
|
||||
"locked": {
|
||||
"lastModified": 1718428119,
|
||||
"narHash": "sha256-WdWDpNaq6u1IPtxtYHHWpl5BmabtpmLnMAx0RdJ/vo8=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "e6cea36f83499eb4e9cd184c8a8e823296b50ad5",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "NixOS",
|
||||
"ref": "nixpkgs-unstable",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"inputs": {
|
||||
"nixpkgs": "nixpkgs",
|
||||
"rust-overlay": "rust-overlay"
|
||||
}
|
||||
},
|
||||
"rust-overlay": {
|
||||
"inputs": {
|
||||
"nixpkgs": "nixpkgs_2"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1718681902,
|
||||
"narHash": "sha256-E/T7Ge6ayEQe7FVKMJqDBoHyLhRhjc6u9CmU8MyYfy0=",
|
||||
"owner": "oxalica",
|
||||
"repo": "rust-overlay",
|
||||
"rev": "16c8ad83297c278eebe740dea5491c1708960dd1",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "oxalica",
|
||||
"repo": "rust-overlay",
|
||||
"type": "github"
|
||||
}
|
||||
}
|
||||
},
|
||||
"root": "root",
|
||||
"version": 7
|
||||
}
|
||||
70
flake.nix
Normal file
@ -0,0 +1,70 @@
|
||||
{
|
||||
description = "modeling-app development environment";
|
||||
|
||||
# Flake inputs
|
||||
inputs = {
|
||||
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
|
||||
rust-overlay.url = "github:oxalica/rust-overlay"; # A helper for Rust + Nix
|
||||
};
|
||||
|
||||
# Flake outputs
|
||||
outputs = { self, nixpkgs, rust-overlay }:
|
||||
let
|
||||
# Overlays enable you to customize the Nixpkgs attribute set
|
||||
overlays = [
|
||||
# Makes a `rust-bin` attribute available in Nixpkgs
|
||||
(import rust-overlay)
|
||||
# Provides a `rustToolchain` attribute for Nixpkgs that we can use to
|
||||
# create a Rust environment
|
||||
(self: super: {
|
||||
rustToolchain = super. rust-bin.stable.latest.default.override {
|
||||
targets = [ "wasm32-unknown-unknown" ];
|
||||
extensions = [ "rustfmt" "llvm-tools-preview" ];
|
||||
};
|
||||
})
|
||||
];
|
||||
|
||||
# Systems supported
|
||||
allSystems = [
|
||||
"x86_64-linux" # 64-bit Intel/AMD Linux
|
||||
"aarch64-linux" # 64-bit ARM Linux
|
||||
"x86_64-darwin" # 64-bit Intel macOS
|
||||
"aarch64-darwin" # 64-bit ARM macOS
|
||||
];
|
||||
|
||||
# Helper to provide system-specific attributes
|
||||
forAllSystems = f: nixpkgs.lib.genAttrs allSystems (system: f {
|
||||
pkgs = import nixpkgs { inherit overlays system; };
|
||||
});
|
||||
|
||||
in
|
||||
{
|
||||
# Development environment output
|
||||
devShells = forAllSystems ({ pkgs }: {
|
||||
default = pkgs.mkShell {
|
||||
# The Nix packages provided in the environment
|
||||
packages = (with pkgs; [
|
||||
# The package provided by our custom overlay. Includes cargo, Clippy, cargo-fmt,
|
||||
# rustdoc, rustfmt, and other tools.
|
||||
rustToolchain
|
||||
|
||||
cargo-llvm-cov
|
||||
cargo-nextest
|
||||
|
||||
just
|
||||
postgresql.lib
|
||||
openssl
|
||||
pkg-config
|
||||
|
||||
nodejs_22
|
||||
]) ++ pkgs.lib.optionals pkgs.stdenv.isDarwin (with pkgs; [
|
||||
libiconv
|
||||
darwin.apple_sdk.frameworks.Security
|
||||
]);
|
||||
|
||||
TARGET_CC = "${pkgs.stdenv.cc}/bin/${pkgs.stdenv.cc.targetPrefix}cc";
|
||||
LIBCLANG_PATH = "${pkgs.libclang.lib}/lib";
|
||||
};
|
||||
});
|
||||
};
|
||||
}
|
||||
85
package.json
@ -1,49 +1,43 @@
|
||||
{
|
||||
"name": "untitled-app",
|
||||
"version": "0.22.0",
|
||||
"version": "0.23.1",
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"@codemirror/autocomplete": "^6.16.0",
|
||||
"@codemirror/autocomplete": "^6.17.0",
|
||||
"@codemirror/commands": "^6.6.0",
|
||||
"@codemirror/language": "^6.10.2",
|
||||
"@codemirror/lint": "^6.8.1",
|
||||
"@codemirror/search": "^6.5.6",
|
||||
"@codemirror/state": "^6.4.1",
|
||||
"@codemirror/theme-one-dark": "^6.1.2",
|
||||
"@csstools/postcss-oklab-function": "^3.0.16",
|
||||
"@fortawesome/fontawesome-svg-core": "^6.5.2",
|
||||
"@fortawesome/free-brands-svg-icons": "^6.5.2",
|
||||
"@fortawesome/free-solid-svg-icons": "^6.4.2",
|
||||
"@fortawesome/react-fontawesome": "^0.2.0",
|
||||
"@headlessui/react": "^1.7.19",
|
||||
"@headlessui/tailwindcss": "^0.2.0",
|
||||
"@kittycad/lib": "^0.0.63",
|
||||
"@lezer/javascript": "^1.4.9",
|
||||
"@open-rpc/client-js": "^1.8.1",
|
||||
"@kittycad/lib": "^0.0.69",
|
||||
"@react-hook/resize-observer": "^2.0.1",
|
||||
"@replit/codemirror-interact": "^6.3.1",
|
||||
"@tauri-apps/api": "2.0.0-beta.12",
|
||||
"@tauri-apps/plugin-dialog": "^2.0.0-beta.2",
|
||||
"@tauri-apps/plugin-fs": "^2.0.0-beta.3",
|
||||
"@tauri-apps/plugin-http": "^2.0.0-beta.2",
|
||||
"@tauri-apps/plugin-os": "^2.0.0-beta.3",
|
||||
"@tauri-apps/plugin-process": "^2.0.0-beta.2",
|
||||
"@tauri-apps/plugin-shell": "^2.0.0-beta.2",
|
||||
"@tauri-apps/plugin-updater": "^2.0.0-beta.3",
|
||||
"@testing-library/jest-dom": "^5.14.1",
|
||||
"@testing-library/react": "^15.0.2",
|
||||
"@testing-library/user-event": "^14.5.2",
|
||||
"@tauri-apps/api": "^2.0.0-beta.14",
|
||||
"@tauri-apps/plugin-dialog": "^2.0.0-beta.6",
|
||||
"@tauri-apps/plugin-fs": "^2.0.0-beta.6",
|
||||
"@tauri-apps/plugin-http": "^2.0.0-beta.7",
|
||||
"@tauri-apps/plugin-os": "^2.0.0-beta.6",
|
||||
"@tauri-apps/plugin-process": "^2.0.0-beta.6",
|
||||
"@tauri-apps/plugin-shell": "^2.0.0-beta.7",
|
||||
"@tauri-apps/plugin-updater": "^2.0.0-beta.6",
|
||||
"@ts-stack/markdown": "^1.5.0",
|
||||
"@tweenjs/tween.js": "^23.1.1",
|
||||
"@types/node": "^18.19.31",
|
||||
"@types/react": "^18.3.2",
|
||||
"@types/react-dom": "^18.2.25",
|
||||
"@uiw/react-codemirror": "^4.21.25",
|
||||
"@xstate/inspect": "^0.8.0",
|
||||
"@xstate/react": "^3.2.2",
|
||||
"crypto-js": "^4.2.0",
|
||||
"debounce-promise": "^3.1.2",
|
||||
"codemirror": "^6.0.1",
|
||||
"decamelize": "^6.0.0",
|
||||
"formik": "^2.4.6",
|
||||
"fuse.js": "^7.0.0",
|
||||
"html2canvas-pro": "^1.4.3",
|
||||
"http-server": "^14.1.1",
|
||||
"html2canvas-pro": "^1.5.2",
|
||||
"json-rpc-2.0": "^1.6.0",
|
||||
"jszip": "^3.10.1",
|
||||
"node-fetch": "^3.3.2",
|
||||
"re-resizable": "^6.9.11",
|
||||
"react": "^18.3.1",
|
||||
"react-dom": "^18.2.0",
|
||||
@ -54,20 +48,15 @@
|
||||
"react-modal-promise": "^1.0.2",
|
||||
"react-router-dom": "^6.23.1",
|
||||
"sketch-helpers": "^0.0.4",
|
||||
"swr": "^2.2.5",
|
||||
"three": "^0.164.1",
|
||||
"ts-node": "^10.9.2",
|
||||
"three": "^0.166.1",
|
||||
"typescript": "^5.4.5",
|
||||
"ua-parser-js": "^1.0.37",
|
||||
"uuid": "^9.0.1",
|
||||
"vitest": "^1.6.0",
|
||||
"vscode-jsonrpc": "^8.2.1",
|
||||
"vscode-languageserver-protocol": "^3.17.5",
|
||||
"wasm-pack": "^0.12.1",
|
||||
"vscode-uri": "^3.0.8",
|
||||
"web-vitals": "^3.5.2",
|
||||
"ws": "^8.17.0",
|
||||
"xstate": "^4.38.2",
|
||||
"zustand": "^4.5.2"
|
||||
"xstate": "^4.38.2"
|
||||
},
|
||||
"scripts": {
|
||||
"start": "vite",
|
||||
@ -84,18 +73,19 @@
|
||||
"test:e2e:tauri": "E2E_TAURI_ENABLED=true TS_NODE_COMPILER_OPTIONS='{\"module\": \"commonjs\"}' wdio run wdio.conf.ts",
|
||||
"simpleserver:ci": "yarn pretest && http-server ./public --cors -p 3000 &",
|
||||
"simpleserver": "yarn pretest && http-server ./public --cors -p 3000",
|
||||
"fmt": "prettier --write ./src *.ts *.json *.js ./e2e",
|
||||
"fmt-check": "prettier --check ./src *.ts *.json *.js ./e2e",
|
||||
"fmt": "prettier --write ./src *.ts *.json *.js ./e2e ./packages",
|
||||
"fmt-check": "prettier --check ./src *.ts *.json *.js ./e2e ./packages",
|
||||
"fetch:wasm": "./get-latest-wasm-bundle.sh",
|
||||
"build:wasm-dev": "(cd src/wasm-lib && wasm-pack build --dev --target web --out-dir pkg && cargo test -p kcl-lib export_bindings) && cp src/wasm-lib/pkg/wasm_lib_bg.wasm public && yarn fmt",
|
||||
"build:wasm": "(cd src/wasm-lib && wasm-pack build --target web --out-dir pkg && cargo test -p kcl-lib export_bindings) && cp src/wasm-lib/pkg/wasm_lib_bg.wasm public && yarn fmt",
|
||||
"build:wasm": "(cd src/wasm-lib && wasm-pack build --release --target web --out-dir pkg && cargo test -p kcl-lib export_bindings) && cp src/wasm-lib/pkg/wasm_lib_bg.wasm public && yarn fmt",
|
||||
"build:wasm-clean": "yarn wasm-prep && yarn build:wasm",
|
||||
"remove-importmeta": "sed -i 's/import.meta.url/window.location.origin/g' \"./src/wasm-lib/pkg/wasm_lib.js\"; sed -i '' 's/import.meta.url/window.location.origin/g' \"./src/wasm-lib/pkg/wasm_lib.js\" || echo \"sed for both mac and linux\"",
|
||||
"wasm-prep": "rm -rf src/wasm-lib/pkg && mkdir src/wasm-lib/pkg && rm -rf src/wasm-lib/kcl/bindings",
|
||||
"lint": "eslint --fix src",
|
||||
"bump-jsons": "echo \"$(jq --arg v \"$VERSION\" '.version=$v' package.json --indent 2)\" > package.json && echo \"$(jq --arg v \"$VERSION\" '.version=$v' src-tauri/tauri.conf.json --indent 2)\" > src-tauri/tauri.conf.json",
|
||||
"postinstall": "yarn xstate:typegen",
|
||||
"xstate:typegen": "yarn xstate typegen \"src/**/*.ts?(x)\""
|
||||
"xstate:typegen": "yarn xstate typegen \"src/**/*.ts?(x)\"",
|
||||
"make:dev": "make dev"
|
||||
},
|
||||
"prettier": {
|
||||
"trailingComma": "es5",
|
||||
@ -119,13 +109,16 @@
|
||||
"@babel/plugin-proposal-private-property-in-object": "^7.21.11",
|
||||
"@babel/preset-env": "^7.24.3",
|
||||
"@iarna/toml": "^2.2.5",
|
||||
"@playwright/test": "^1.43.1",
|
||||
"@tauri-apps/cli": "^2.0.0-beta.13",
|
||||
"@types/crypto-js": "^4.2.2",
|
||||
"@types/debounce-promise": "^3.1.9",
|
||||
"@playwright/test": "^1.45.1",
|
||||
"@tauri-apps/cli": "==2.0.0-beta.13",
|
||||
"@testing-library/jest-dom": "^5.14.1",
|
||||
"@testing-library/react": "^15.0.2",
|
||||
"@types/mocha": "^10.0.6",
|
||||
"@types/node": "^18.19.31",
|
||||
"@types/pixelmatch": "^5.2.6",
|
||||
"@types/pngjs": "^6.0.4",
|
||||
"@types/react": "^18.3.2",
|
||||
"@types/react-dom": "^18.2.25",
|
||||
"@types/react-modal": "^3.16.3",
|
||||
"@types/three": "^0.163.0",
|
||||
"@types/ua-parser-js": "^0.7.39",
|
||||
@ -145,21 +138,27 @@
|
||||
"eslint": "^8.57.0",
|
||||
"eslint-config-react-app": "^7.0.1",
|
||||
"eslint-plugin-css-modules": "^2.12.0",
|
||||
"eslint-plugin-suggest-no-throw": "^1.0.0",
|
||||
"happy-dom": "^14.3.10",
|
||||
"http-server": "^14.1.1",
|
||||
"husky": "^9.0.11",
|
||||
"node-fetch": "^3.3.2",
|
||||
"pixelmatch": "^5.3.0",
|
||||
"pngjs": "^7.0.0",
|
||||
"postcss": "^8.4.31",
|
||||
"postinstall-postinstall": "^2.1.0",
|
||||
"prettier": "^2.8.0",
|
||||
"prettier": "^2.8.8",
|
||||
"setimmediate": "^1.0.5",
|
||||
"tailwindcss": "^3.4.1",
|
||||
"vite": "^5.2.9",
|
||||
"vite-plugin-eslint": "^1.8.1",
|
||||
"vite-plugin-package-version": "^1.1.0",
|
||||
"vite-tsconfig-paths": "^4.3.2",
|
||||
"vitest": "^1.6.0",
|
||||
"vitest-webgl-canvas-mock": "^1.1.0",
|
||||
"wait-on": "^7.2.0",
|
||||
"wasm-pack": "^0.13.0",
|
||||
"ws": "^8.17.0",
|
||||
"yarn": "^1.22.22"
|
||||
}
|
||||
}
|
||||
|
||||
6
packages/codemirror-lsp-client/.gitignore
vendored
Normal file
@ -0,0 +1,6 @@
|
||||
node_modules
|
||||
build
|
||||
dist
|
||||
tsconfig.tsbuildinfo
|
||||
*.d.ts
|
||||
*.js
|
||||
35
packages/codemirror-lsp-client/package.json
Normal file
@ -0,0 +1,35 @@
|
||||
{
|
||||
"name": "@kittycad/codemirror-lsp-client",
|
||||
"version": "1.0.0",
|
||||
"description": "An LSP client for the codemirror editor.",
|
||||
"main": "src/index.ts",
|
||||
"exports": {
|
||||
"import": "./dist/index.js",
|
||||
"require": "./dist/index.js"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "tsc"
|
||||
},
|
||||
"types": "dist/index.d.ts",
|
||||
"module": "dist/index.js",
|
||||
"type": "module",
|
||||
"repository": "https://github.com/KittyCAD/modeling-app",
|
||||
"author": "Zoo Engineering Team",
|
||||
"license": "MIT",
|
||||
"private": false,
|
||||
"dependencies": {
|
||||
"@codemirror/autocomplete": "^6.16.3",
|
||||
"@codemirror/language": "^6.10.2",
|
||||
"@codemirror/state": "^6.4.1",
|
||||
"@lezer/highlight": "^1.2.0",
|
||||
"@ts-stack/markdown": "^1.5.0",
|
||||
"json-rpc-2.0": "^1.7.0",
|
||||
"typescript": "^5.5.2",
|
||||
"vscode-languageserver-protocol": "^3.17.5",
|
||||
"vscode-uri": "^3.0.8"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^20.14.9",
|
||||
"ts-node": "^10.9.2"
|
||||
}
|
||||
}
|
||||
@ -1,10 +1,10 @@
|
||||
import * as vsrpc from 'vscode-jsonrpc'
|
||||
|
||||
import { Codec } from '.'
|
||||
import Bytes from './bytes'
|
||||
import PromiseMap from './map'
|
||||
import Queue from './queue'
|
||||
import Tracer from '../tracer'
|
||||
import { Codec } from '../codec'
|
||||
import Tracer from './tracer'
|
||||
import PromiseMap from './map'
|
||||
|
||||
export default class StreamDemuxer extends Queue<Uint8Array> {
|
||||
readonly responses: PromiseMap<number | string, vsrpc.ResponseMessage> =
|
||||
@ -15,9 +15,12 @@ export default class StreamDemuxer extends Queue<Uint8Array> {
|
||||
new Queue<vsrpc.RequestMessage>()
|
||||
|
||||
readonly #start: Promise<void>
|
||||
private trace: boolean = false
|
||||
|
||||
constructor() {
|
||||
constructor(trace?: boolean) {
|
||||
super()
|
||||
this.trace = trace || false
|
||||
|
||||
this.#start = this.start()
|
||||
}
|
||||
|
||||
@ -38,7 +41,9 @@ export default class StreamDemuxer extends Queue<Uint8Array> {
|
||||
|
||||
// try to parse the content-length from the headers
|
||||
const length = parseInt(match[1])
|
||||
if (isNaN(length)) throw new Error('invalid content length')
|
||||
|
||||
if (isNaN(length))
|
||||
return Promise.reject(new Error('invalid content length'))
|
||||
|
||||
// slice the headers since we now have the content length
|
||||
buffer = buffer.slice(match[0].length)
|
||||
@ -62,7 +67,10 @@ export default class StreamDemuxer extends Queue<Uint8Array> {
|
||||
contentLength = null
|
||||
|
||||
const message = JSON.parse(delimited) as vsrpc.Message
|
||||
Tracer.server(message)
|
||||
|
||||
if (this.trace) {
|
||||
Tracer.server(message)
|
||||
}
|
||||
|
||||
// demux the message stream
|
||||
if (vsrpc.Message.isResponse(message) && null != message.id) {
|
||||
@ -83,7 +91,9 @@ export default class StreamDemuxer extends Queue<Uint8Array> {
|
||||
|
||||
add(bytes: Uint8Array): void {
|
||||
const message = Codec.decode(bytes) as vsrpc.Message
|
||||
Tracer.server(message)
|
||||
if (this.trace) {
|
||||
Tracer.server(message)
|
||||
}
|
||||
|
||||
// demux the message stream
|
||||
if (vsrpc.Message.isResponse(message) && null != message.id) {
|
||||
@ -1,12 +1,16 @@
|
||||
import * as jsrpc from 'json-rpc-2.0'
|
||||
import * as vsrpc from 'vscode-jsonrpc'
|
||||
|
||||
import Bytes from './codec/bytes'
|
||||
import StreamDemuxer from './codec/demuxer'
|
||||
import Headers from './codec/headers'
|
||||
import Queue from './codec/queue'
|
||||
import Bytes from './bytes'
|
||||
import StreamDemuxer from './demuxer'
|
||||
import Headers from './headers'
|
||||
import Queue from './queue'
|
||||
import Tracer from './tracer'
|
||||
import { LspWorkerEventType, LspWorker } from './types'
|
||||
|
||||
export enum LspWorkerEventType {
|
||||
Init = 'init',
|
||||
Call = 'call',
|
||||
}
|
||||
|
||||
export const encoder = new TextEncoder()
|
||||
export const decoder = new TextDecoder()
|
||||
@ -33,16 +37,24 @@ export class IntoServer
|
||||
implements AsyncGenerator<Uint8Array, never, void>
|
||||
{
|
||||
private worker: Worker | null = null
|
||||
private type_: LspWorker | null = null
|
||||
constructor(type_?: LspWorker, worker?: Worker) {
|
||||
private type_: String | null = null
|
||||
|
||||
private trace: boolean = false
|
||||
|
||||
constructor(type_?: String, worker?: Worker, trace?: boolean) {
|
||||
super()
|
||||
if (worker && type_) {
|
||||
this.worker = worker
|
||||
this.type_ = type_
|
||||
}
|
||||
|
||||
this.trace = trace || false
|
||||
}
|
||||
enqueue(item: Uint8Array): void {
|
||||
Tracer.client(Headers.remove(decoder.decode(item)))
|
||||
if (this.trace) {
|
||||
Tracer.client(Headers.remove(decoder.decode(item)))
|
||||
}
|
||||
|
||||
if (this.worker) {
|
||||
this.worker.postMessage({
|
||||
worker: this.type_,
|
||||
@ -67,7 +79,13 @@ export interface FromServer extends WritableStream<Uint8Array> {
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-namespace
|
||||
export namespace FromServer {
|
||||
export function create(): FromServer {
|
||||
return new StreamDemuxer()
|
||||
export function create(): FromServer | Error {
|
||||
// Calls private method .start() which can throw.
|
||||
// This is an odd one of the bunch but try/catch seems most suitable here.
|
||||
try {
|
||||
return new StreamDemuxer(false)
|
||||
} catch (e: any) {
|
||||
return e
|
||||
}
|
||||
}
|
||||
}
|
||||