Compare commits
1 Commits
callbacks-
...
achalmers/
| Author | SHA1 | Date | |
|---|---|---|---|
| 7c1a94af10 |
@ -1,3 +1,3 @@
|
||||
[codespell]
|
||||
ignore-words-list: crate,everytime,inout,co-ordinate,ot,nwo,absolutey,atleast,ue
|
||||
ignore-words-list: crate,everytime,inout,co-ordinate,ot,nwo,absolutey,atleast
|
||||
skip: **/target,node_modules,build,**/Cargo.lock,./docs/kcl/*.md,./src-tauri/gen/schemas
|
||||
|
||||
10
.eslintrc
@ -4,8 +4,7 @@
|
||||
"project": "./tsconfig.json"
|
||||
},
|
||||
"plugins": [
|
||||
"css-modules",
|
||||
"suggest-no-throw",
|
||||
"css-modules"
|
||||
],
|
||||
"extends": [
|
||||
"react-app",
|
||||
@ -18,7 +17,6 @@
|
||||
"never"
|
||||
],
|
||||
"react-hooks/exhaustive-deps": "off",
|
||||
"suggest-no-throw/suggest-no-throw": "warn",
|
||||
},
|
||||
"overrides": [
|
||||
{
|
||||
@ -27,12 +25,6 @@
|
||||
"@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,7 +38,5 @@ jobs:
|
||||
- name: Benchmark kcl library
|
||||
shell: bash
|
||||
run: |-
|
||||
cd src/wasm-lib/kcl; cargo bench --all-features -- iai
|
||||
env:
|
||||
KITTYCAD_API_TOKEN: ${{secrets.KITTYCAD_API_TOKEN}}
|
||||
cd src/wasm-lib/kcl; cargo bench -- iai
|
||||
|
||||
|
||||
40
.github/workflows/cargo-check.yml
vendored
@ -1,40 +0,0 @@
|
||||
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,12 +9,6 @@ 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
|
||||
@ -60,8 +54,3 @@ 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"
|
||||
|
||||
13
.github/workflows/ci.yml
vendored
@ -138,7 +138,6 @@ 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'
|
||||
@ -239,8 +238,12 @@ jobs:
|
||||
shell: cmd
|
||||
|
||||
- name: Build the app (debug)
|
||||
uses: tauri-apps/tauri-action@v0
|
||||
if: ${{ env.BUILD_RELEASE == 'false' }}
|
||||
run: "yarn tauri build --debug ${{ env.TAURI_ARGS_MACOS }} ${{ env.TAURI_ARGS_UBUNTU }}"
|
||||
with:
|
||||
includeRelease: false
|
||||
includeDebug: true
|
||||
args: "${{ env.TAURI_ARGS_MACOS }} ${{ env.TAURI_ARGS_UBUNTU }}"
|
||||
|
||||
- name: Build for Mac TestFlight (nightly)
|
||||
if: ${{ github.event_name == 'schedule' && matrix.os == 'macos-14' }}
|
||||
@ -333,6 +336,7 @@ 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 }}
|
||||
@ -344,7 +348,8 @@ 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' }}"
|
||||
run: "yarn tauri build ${{ env.TAURI_CONF_ARGS }} ${{ env.TAURI_ARGS_MACOS }} ${{ env.TAURI_ARGS_UBUNTU }}"
|
||||
with:
|
||||
args: "${{ env.TAURI_CONF_ARGS }} ${{ env.TAURI_ARGS_MACOS }} ${{ env.TAURI_ARGS_UBUNTU }}"
|
||||
|
||||
- uses: actions/upload-artifact@v3
|
||||
if: matrix.os != 'ubuntu-latest'
|
||||
@ -378,8 +383,6 @@ 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]
|
||||
|
||||
108
.github/workflows/playwright.yml
vendored
@ -38,8 +38,6 @@ 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:
|
||||
@ -59,7 +57,7 @@ jobs:
|
||||
- name: Download Wasm Cache
|
||||
id: download-wasm
|
||||
if: needs.check-rust-changes.outputs.rust-changed == 'false'
|
||||
uses: dawidd6/action-download-artifact@v6
|
||||
uses: dawidd6/action-download-artifact@v5
|
||||
continue-on-error: true
|
||||
with:
|
||||
github_token: ${{secrets.GITHUB_TOKEN}}
|
||||
@ -92,24 +90,26 @@ jobs:
|
||||
- name: build web
|
||||
run: yarn build:local
|
||||
- name: Run ubuntu/chrome snapshots
|
||||
continue-on-error: true
|
||||
run: |
|
||||
yarn playwright test --project="Google Chrome" --update-snapshots e2e/playwright/snapshot-tests.spec.ts
|
||||
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 }}
|
||||
- name: Clean up test-results
|
||||
- uses: actions/upload-artifact@v3
|
||||
if: always()
|
||||
continue-on-error: true
|
||||
run: rm -r test-results
|
||||
with:
|
||||
name: playwright-report
|
||||
path: playwright-report/
|
||||
retention-days: 30
|
||||
- name: check for changes
|
||||
id: git-check
|
||||
run: |
|
||||
git add .
|
||||
if git status | grep -q "Changes to be committed"
|
||||
then echo "modified=true" >> $GITHUB_OUTPUT
|
||||
else echo "modified=false" >> $GITHUB_OUTPUT
|
||||
then
|
||||
echo "::set-output name=modified::true"
|
||||
else
|
||||
echo "::set-output name=modified::false"
|
||||
fi
|
||||
- name: Commit changes, if any
|
||||
if: steps.git-check.outputs.modified == 'true'
|
||||
@ -125,63 +125,23 @@ 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@v4
|
||||
- uses: actions/upload-artifact@v3
|
||||
if: always()
|
||||
with:
|
||||
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 }}
|
||||
name: playwright-report
|
||||
path: playwright-report/
|
||||
retention-days: 30
|
||||
overwrite: true
|
||||
|
||||
playwright-macos:
|
||||
timeout-minutes: 60
|
||||
runs-on: macos-14-large
|
||||
runs-on: macos-14
|
||||
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:
|
||||
@ -202,7 +162,7 @@ jobs:
|
||||
- name: Download Wasm Cache
|
||||
id: download-wasm
|
||||
if: needs.check-rust-changes.outputs.rust-changed == 'false'
|
||||
uses: dawidd6/action-download-artifact@v6
|
||||
uses: dawidd6/action-download-artifact@v5
|
||||
continue-on-error: true
|
||||
with:
|
||||
github_token: ${{secrets.GITHUB_TOKEN}}
|
||||
@ -234,48 +194,16 @@ 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@v4
|
||||
if: ${{ always() }}
|
||||
- uses: actions/upload-artifact@v3
|
||||
if: always()
|
||||
with:
|
||||
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 }}
|
||||
name: playwright-report
|
||||
path: playwright-report/
|
||||
retention-days: 30
|
||||
overwrite: true
|
||||
|
||||
|
||||
3
.gitignore
vendored
@ -17,7 +17,6 @@
|
||||
.env.development.local
|
||||
.env.test.local
|
||||
.env.production.local
|
||||
.direnv
|
||||
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
@ -56,5 +55,3 @@ src-tauri/gen
|
||||
|
||||
src/wasm-lib/grackle/stdlib_cube_partial.json
|
||||
Mac_App_Distribution.provisionprofile
|
||||
|
||||
*.tsbuildinfo
|
||||
|
||||
@ -1,6 +1,5 @@
|
||||
# Ignore artifacts:
|
||||
build
|
||||
dist
|
||||
coverage
|
||||
|
||||
# Ignore Rust projects:
|
||||
@ -10,6 +9,5 @@ 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
Normal file
@ -0,0 +1,7 @@
|
||||
{
|
||||
"cSpell.words": [
|
||||
"geos"
|
||||
],
|
||||
"editor.tabSize": 2,
|
||||
"editor.insertSpaces": true,
|
||||
}
|
||||
11
Makefile
@ -1,17 +1,14 @@
|
||||
.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)
|
||||
dev: node_modules public/wasm_lib_bg.wasm
|
||||
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
|
||||
node_modules: package.json
|
||||
|
||||
package.json:
|
||||
yarn install
|
||||
|
||||
82
README.md
@ -89,6 +89,25 @@ 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
|
||||
@ -124,20 +143,36 @@ Before you submit a contribution PR to this repo, please ensure that:
|
||||
|
||||
## Release a new version
|
||||
|
||||
1. Bump the versions by running `./make-realease.sh` while on a fresh pull of main
|
||||
1. Bump the versions in the .json files by creating a `Cut release v{x}.{y}.{z}` PR, committing the changes from
|
||||
|
||||
That will create the branch with the updated json files for you.
|
||||
```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.
|
||||
run `./make-release.sh` for a patch update
|
||||
run `./make-release.sh "minor"` for minor
|
||||
run `./make-release.sh "major"` for major
|
||||
|
||||
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)
|
||||
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
|
||||
|
||||
The PR may serve as a place to discuss the human-readable changelog and extra QA.
|
||||
```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
|
||||
|
||||
2. Merge the PR
|
||||
|
||||
3. Profit (A new Action kicks in at https://github.com/KittyCAD/modeling-app/actions if the PR was correctly named)
|
||||
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
|
||||
|
||||
## Fuzzing the parser
|
||||
|
||||
@ -160,9 +195,7 @@ $ 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).
|
||||
|
||||
## Tests
|
||||
|
||||
### Playwright tests
|
||||
### Playwright
|
||||
|
||||
For a portable way to run Playwright you'll need Docker.
|
||||
|
||||
@ -251,37 +284,6 @@ 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.
|
||||
@ -317,7 +319,7 @@ PS: for the debug panel, the following JSON is useful for snapping the camera
|
||||
|
||||
```
|
||||
yarn install
|
||||
yarn build:wasm-dev
|
||||
yarn build:wasm
|
||||
cp src/wasm-lib/pkg/wasm_lib_bg.wasm public
|
||||
yarn vite build --mode development
|
||||
yarn tauri build --debug -b
|
||||
|
||||
@ -17,13 +17,4 @@ 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.
|
||||
|
||||
- **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.
|
||||
- **Fillets**: Fillets cannot intersect, you will get an error. Only simple fillet cases work currently.
|
||||
|
||||
@ -9,7 +9,7 @@ Returns the angle to match the given length for x.
|
||||
|
||||
|
||||
```js
|
||||
angleToMatchLengthX(segment_name: TagIdentifier, to: number, sketch_group: SketchGroup) -> number
|
||||
angleToMatchLengthX(segment_name: string, to: number, sketch_group: SketchGroup) -> number
|
||||
```
|
||||
|
||||
### Examples
|
||||
@ -17,8 +17,11 @@ angleToMatchLengthX(segment_name: TagIdentifier, to: number, sketch_group: Sketc
|
||||
```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)
|
||||
@ -28,16 +31,13 @@ const extrusion = extrude(5, sketch001)
|
||||
|
||||
### Arguments
|
||||
|
||||
* `segment_name`: `TagIdentifier` (REQUIRED)
|
||||
```js
|
||||
{
|
||||
value: string,
|
||||
}
|
||||
```
|
||||
* `segment_name`: `string` (REQUIRED)
|
||||
* `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,184 +73,12 @@ const extrusion = extrude(5, sketch001)
|
||||
},
|
||||
} |
|
||||
{
|
||||
// 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.
|
||||
// the face id the sketch is on
|
||||
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,
|
||||
@ -273,32 +101,25 @@ 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 tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: 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 name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "ToPoint",
|
||||
@ -310,12 +131,8 @@ const extrusion = extrude(5, sketch001)
|
||||
center: [number, number],
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArcTo",
|
||||
@ -323,12 +140,8 @@ const extrusion = extrude(5, sketch001)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArc",
|
||||
@ -336,12 +149,8 @@ const extrusion = extrude(5, sketch001)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Horizontal",
|
||||
@ -351,12 +160,8 @@ const extrusion = extrude(5, sketch001)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "AngledLineTo",
|
||||
@ -368,16 +173,30 @@ const extrusion = extrude(5, sketch001)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: 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: TagIdentifier, to: number, sketch_group: SketchGroup) -> number
|
||||
angleToMatchLengthY(segment_name: string, to: number, sketch_group: SketchGroup) -> number
|
||||
```
|
||||
|
||||
### Examples
|
||||
@ -17,9 +17,9 @@ angleToMatchLengthY(segment_name: TagIdentifier, to: number, sketch_group: Sketc
|
||||
```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,16 +32,13 @@ const extrusion = extrude(5, sketch001)
|
||||
|
||||
### Arguments
|
||||
|
||||
* `segment_name`: `TagIdentifier` (REQUIRED)
|
||||
```js
|
||||
{
|
||||
value: string,
|
||||
}
|
||||
```
|
||||
* `segment_name`: `string` (REQUIRED)
|
||||
* `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).
|
||||
@ -77,184 +74,12 @@ const extrusion = extrude(5, sketch001)
|
||||
},
|
||||
} |
|
||||
{
|
||||
// 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.
|
||||
// the face id the sketch is on
|
||||
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,32 +102,25 @@ 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 tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: 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 name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "ToPoint",
|
||||
@ -314,12 +132,8 @@ const extrusion = extrude(5, sketch001)
|
||||
center: [number, number],
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArcTo",
|
||||
@ -327,12 +141,8 @@ const extrusion = extrude(5, sketch001)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArc",
|
||||
@ -340,12 +150,8 @@ const extrusion = extrude(5, sketch001)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Horizontal",
|
||||
@ -355,12 +161,8 @@ const extrusion = extrude(5, sketch001)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "AngledLineTo",
|
||||
@ -372,16 +174,30 @@ const extrusion = extrude(5, sketch001)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: 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?: TagDeclarator) -> SketchGroup
|
||||
angledLine(data: AngledLineData, sketch_group: SketchGroup, tag?: String) -> SketchGroup
|
||||
```
|
||||
|
||||
### Examples
|
||||
@ -43,6 +43,8 @@ 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,184 +80,12 @@ const example = extrude(10, exampleSketch)
|
||||
},
|
||||
} |
|
||||
{
|
||||
// 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.
|
||||
// the face id the sketch is on
|
||||
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,32 +108,25 @@ 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 tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: 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 name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "ToPoint",
|
||||
@ -315,12 +138,8 @@ const example = extrude(10, exampleSketch)
|
||||
center: [number, number],
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArcTo",
|
||||
@ -328,12 +147,8 @@ const example = extrude(10, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArc",
|
||||
@ -341,12 +156,8 @@ const example = extrude(10, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Horizontal",
|
||||
@ -356,12 +167,8 @@ const example = extrude(10, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "AngledLineTo",
|
||||
@ -373,32 +180,41 @@ const example = extrude(10, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: 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,
|
||||
}
|
||||
```
|
||||
* `tag`: `String` (OPTIONAL)
|
||||
|
||||
### 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).
|
||||
@ -434,184 +250,12 @@ const example = extrude(10, exampleSketch)
|
||||
},
|
||||
} |
|
||||
{
|
||||
// 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.
|
||||
// the face id the sketch is on
|
||||
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,
|
||||
@ -634,32 +278,25 @@ 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 tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: 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 name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "ToPoint",
|
||||
@ -671,12 +308,8 @@ const example = extrude(10, exampleSketch)
|
||||
center: [number, number],
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArcTo",
|
||||
@ -684,12 +317,8 @@ const example = extrude(10, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArc",
|
||||
@ -697,12 +326,8 @@ const example = extrude(10, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Horizontal",
|
||||
@ -712,12 +337,8 @@ const example = extrude(10, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "AngledLineTo",
|
||||
@ -729,16 +350,30 @@ const example = extrude(10, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: 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?: TagDeclarator) -> SketchGroup
|
||||
angledLineOfXLength(data: AngledLineData, sketch_group: SketchGroup, tag?: String) -> SketchGroup
|
||||
```
|
||||
|
||||
### Examples
|
||||
@ -17,10 +17,10 @@ angledLineOfXLength(data: AngledLineData, sketch_group: SketchGroup, tag?: TagDe
|
||||
```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,6 +42,8 @@ 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).
|
||||
@ -77,184 +79,12 @@ const extrusion = extrude(10, sketch001)
|
||||
},
|
||||
} |
|
||||
{
|
||||
// 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.
|
||||
// the face id the sketch is on
|
||||
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,32 +107,25 @@ 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 tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: 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 name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "ToPoint",
|
||||
@ -314,12 +137,8 @@ const extrusion = extrude(10, sketch001)
|
||||
center: [number, number],
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArcTo",
|
||||
@ -327,12 +146,8 @@ const extrusion = extrude(10, sketch001)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArc",
|
||||
@ -340,12 +155,8 @@ const extrusion = extrude(10, sketch001)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Horizontal",
|
||||
@ -355,12 +166,8 @@ const extrusion = extrude(10, sketch001)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "AngledLineTo",
|
||||
@ -372,32 +179,41 @@ const extrusion = extrude(10, sketch001)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: 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,
|
||||
}
|
||||
```
|
||||
* `tag`: `String` (OPTIONAL)
|
||||
|
||||
### 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).
|
||||
@ -433,184 +249,12 @@ const extrusion = extrude(10, sketch001)
|
||||
},
|
||||
} |
|
||||
{
|
||||
// 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.
|
||||
// the face id the sketch is on
|
||||
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,
|
||||
@ -633,32 +277,25 @@ 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 tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: 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 name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "ToPoint",
|
||||
@ -670,12 +307,8 @@ const extrusion = extrude(10, sketch001)
|
||||
center: [number, number],
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArcTo",
|
||||
@ -683,12 +316,8 @@ const extrusion = extrude(10, sketch001)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArc",
|
||||
@ -696,12 +325,8 @@ const extrusion = extrude(10, sketch001)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Horizontal",
|
||||
@ -711,12 +336,8 @@ const extrusion = extrude(10, sketch001)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "AngledLineTo",
|
||||
@ -728,16 +349,30 @@ const extrusion = extrude(10, sketch001)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: 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?: TagDeclarator) -> SketchGroup
|
||||
angledLineThatIntersects(data: AngledLineThatIntersectsData, sketch_group: SketchGroup, tag?: String) -> 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,9 +40,7 @@ const example = extrude(10, exampleSketch)
|
||||
// The angle of the line.
|
||||
angle: number,
|
||||
// The tag of the line to intersect with.
|
||||
intersectTag: {
|
||||
value: string,
|
||||
},
|
||||
intersectTag: string,
|
||||
// The offset from the intersecting line.
|
||||
offset: number,
|
||||
}
|
||||
@ -50,6 +48,8 @@ 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,184 +85,12 @@ const example = extrude(10, exampleSketch)
|
||||
},
|
||||
} |
|
||||
{
|
||||
// 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.
|
||||
// the face id the sketch is on
|
||||
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,
|
||||
@ -285,32 +113,25 @@ 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 tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: 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 name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "ToPoint",
|
||||
@ -322,12 +143,8 @@ const example = extrude(10, exampleSketch)
|
||||
center: [number, number],
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArcTo",
|
||||
@ -335,12 +152,8 @@ const example = extrude(10, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArc",
|
||||
@ -348,12 +161,8 @@ const example = extrude(10, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Horizontal",
|
||||
@ -363,12 +172,8 @@ const example = extrude(10, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "AngledLineTo",
|
||||
@ -380,32 +185,41 @@ const example = extrude(10, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: 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,
|
||||
}
|
||||
```
|
||||
* `tag`: `String` (OPTIONAL)
|
||||
|
||||
### 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).
|
||||
@ -441,184 +255,12 @@ const example = extrude(10, exampleSketch)
|
||||
},
|
||||
} |
|
||||
{
|
||||
// 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.
|
||||
// the face id the sketch is on
|
||||
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,
|
||||
@ -641,32 +283,25 @@ 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 tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: 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 name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "ToPoint",
|
||||
@ -678,12 +313,8 @@ const example = extrude(10, exampleSketch)
|
||||
center: [number, number],
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArcTo",
|
||||
@ -691,12 +322,8 @@ const example = extrude(10, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArc",
|
||||
@ -704,12 +331,8 @@ const example = extrude(10, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Horizontal",
|
||||
@ -719,12 +342,8 @@ const example = extrude(10, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "AngledLineTo",
|
||||
@ -736,16 +355,30 @@ const example = extrude(10, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: 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?: TagDeclarator) -> SketchGroup
|
||||
angledLineToX(data: AngledLineToData, sketch_group: SketchGroup, tag?: String) -> SketchGroup
|
||||
```
|
||||
|
||||
### Examples
|
||||
@ -41,6 +41,8 @@ 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).
|
||||
@ -76,184 +78,12 @@ const example = extrude(10, exampleSketch)
|
||||
},
|
||||
} |
|
||||
{
|
||||
// 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.
|
||||
// the face id the sketch is on
|
||||
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,32 +106,25 @@ 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 tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: 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 name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "ToPoint",
|
||||
@ -313,12 +136,8 @@ const example = extrude(10, exampleSketch)
|
||||
center: [number, number],
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArcTo",
|
||||
@ -326,12 +145,8 @@ const example = extrude(10, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArc",
|
||||
@ -339,12 +154,8 @@ const example = extrude(10, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Horizontal",
|
||||
@ -354,12 +165,8 @@ const example = extrude(10, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "AngledLineTo",
|
||||
@ -371,32 +178,41 @@ const example = extrude(10, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: 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,
|
||||
}
|
||||
```
|
||||
* `tag`: `String` (OPTIONAL)
|
||||
|
||||
### 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).
|
||||
@ -432,184 +248,12 @@ const example = extrude(10, exampleSketch)
|
||||
},
|
||||
} |
|
||||
{
|
||||
// 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.
|
||||
// the face id the sketch is on
|
||||
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,
|
||||
@ -632,32 +276,25 @@ 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 tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: 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 name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "ToPoint",
|
||||
@ -669,12 +306,8 @@ const example = extrude(10, exampleSketch)
|
||||
center: [number, number],
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArcTo",
|
||||
@ -682,12 +315,8 @@ const example = extrude(10, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArc",
|
||||
@ -695,12 +324,8 @@ const example = extrude(10, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Horizontal",
|
||||
@ -710,12 +335,8 @@ const example = extrude(10, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "AngledLineTo",
|
||||
@ -727,16 +348,30 @@ const example = extrude(10, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: 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?: TagDeclarator) -> SketchGroup
|
||||
angledLineToY(data: AngledLineToData, sketch_group: SketchGroup, tag?: String) -> SketchGroup
|
||||
```
|
||||
|
||||
### Examples
|
||||
@ -41,6 +41,8 @@ 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).
|
||||
@ -76,184 +78,12 @@ const example = extrude(10, exampleSketch)
|
||||
},
|
||||
} |
|
||||
{
|
||||
// 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.
|
||||
// the face id the sketch is on
|
||||
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,32 +106,25 @@ 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 tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: 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 name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "ToPoint",
|
||||
@ -313,12 +136,8 @@ const example = extrude(10, exampleSketch)
|
||||
center: [number, number],
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArcTo",
|
||||
@ -326,12 +145,8 @@ const example = extrude(10, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArc",
|
||||
@ -339,12 +154,8 @@ const example = extrude(10, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Horizontal",
|
||||
@ -354,12 +165,8 @@ const example = extrude(10, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "AngledLineTo",
|
||||
@ -371,32 +178,41 @@ const example = extrude(10, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: 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,
|
||||
}
|
||||
```
|
||||
* `tag`: `String` (OPTIONAL)
|
||||
|
||||
### 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).
|
||||
@ -432,184 +248,12 @@ const example = extrude(10, exampleSketch)
|
||||
},
|
||||
} |
|
||||
{
|
||||
// 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.
|
||||
// the face id the sketch is on
|
||||
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,
|
||||
@ -632,32 +276,25 @@ 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 tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: 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 name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "ToPoint",
|
||||
@ -669,12 +306,8 @@ const example = extrude(10, exampleSketch)
|
||||
center: [number, number],
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArcTo",
|
||||
@ -682,12 +315,8 @@ const example = extrude(10, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArc",
|
||||
@ -695,12 +324,8 @@ const example = extrude(10, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Horizontal",
|
||||
@ -710,12 +335,8 @@ const example = extrude(10, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "AngledLineTo",
|
||||
@ -727,16 +348,30 @@ const example = extrude(10, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: 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?: TagDeclarator) -> SketchGroup
|
||||
arc(data: ArcData, sketch_group: SketchGroup, tag?: String) -> SketchGroup
|
||||
```
|
||||
|
||||
### Examples
|
||||
@ -52,6 +52,8 @@ 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).
|
||||
@ -87,184 +89,12 @@ const exampleSketch = startSketchOn('XZ')
|
||||
},
|
||||
} |
|
||||
{
|
||||
// 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.
|
||||
// the face id the sketch is on
|
||||
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,32 +117,25 @@ 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 tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: 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 name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "ToPoint",
|
||||
@ -324,12 +147,8 @@ const exampleSketch = startSketchOn('XZ')
|
||||
center: [number, number],
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArcTo",
|
||||
@ -337,12 +156,8 @@ const exampleSketch = startSketchOn('XZ')
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArc",
|
||||
@ -350,12 +165,8 @@ const exampleSketch = startSketchOn('XZ')
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Horizontal",
|
||||
@ -365,12 +176,8 @@ const exampleSketch = startSketchOn('XZ')
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "AngledLineTo",
|
||||
@ -382,32 +189,41 @@ const exampleSketch = startSketchOn('XZ')
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: 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,
|
||||
}
|
||||
```
|
||||
* `tag`: `String` (OPTIONAL)
|
||||
|
||||
### 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).
|
||||
@ -443,184 +259,12 @@ const exampleSketch = startSketchOn('XZ')
|
||||
},
|
||||
} |
|
||||
{
|
||||
// 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.
|
||||
// the face id the sketch is on
|
||||
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,
|
||||
@ -643,32 +287,25 @@ 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 tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: 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 name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "ToPoint",
|
||||
@ -680,12 +317,8 @@ const exampleSketch = startSketchOn('XZ')
|
||||
center: [number, number],
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArcTo",
|
||||
@ -693,12 +326,8 @@ const exampleSketch = startSketchOn('XZ')
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArc",
|
||||
@ -706,12 +335,8 @@ const exampleSketch = startSketchOn('XZ')
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Horizontal",
|
||||
@ -721,12 +346,8 @@ const exampleSketch = startSketchOn('XZ')
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "AngledLineTo",
|
||||
@ -738,16 +359,30 @@ const exampleSketch = startSketchOn('XZ')
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: 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?: TagDeclarator) -> SketchGroup
|
||||
bezierCurve(data: BezierData, sketch_group: SketchGroup, tag?: String) -> SketchGroup
|
||||
```
|
||||
|
||||
### Examples
|
||||
@ -47,6 +47,8 @@ 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).
|
||||
@ -82,184 +84,12 @@ const example = extrude(10, exampleSketch)
|
||||
},
|
||||
} |
|
||||
{
|
||||
// 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.
|
||||
// the face id the sketch is on
|
||||
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,32 +112,25 @@ 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 tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: 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 name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "ToPoint",
|
||||
@ -319,12 +142,8 @@ const example = extrude(10, exampleSketch)
|
||||
center: [number, number],
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArcTo",
|
||||
@ -332,12 +151,8 @@ const example = extrude(10, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArc",
|
||||
@ -345,12 +160,8 @@ const example = extrude(10, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Horizontal",
|
||||
@ -360,12 +171,8 @@ const example = extrude(10, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "AngledLineTo",
|
||||
@ -377,32 +184,41 @@ const example = extrude(10, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: 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,
|
||||
}
|
||||
```
|
||||
* `tag`: `String` (OPTIONAL)
|
||||
|
||||
### 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).
|
||||
@ -438,184 +254,12 @@ const example = extrude(10, exampleSketch)
|
||||
},
|
||||
} |
|
||||
{
|
||||
// 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.
|
||||
// the face id the sketch is on
|
||||
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,
|
||||
@ -638,32 +282,25 @@ 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 tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: 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 name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "ToPoint",
|
||||
@ -675,12 +312,8 @@ const example = extrude(10, exampleSketch)
|
||||
center: [number, number],
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArcTo",
|
||||
@ -688,12 +321,8 @@ const example = extrude(10, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArc",
|
||||
@ -701,12 +330,8 @@ const example = extrude(10, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Horizontal",
|
||||
@ -716,12 +341,8 @@ const example = extrude(10, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "AngledLineTo",
|
||||
@ -733,16 +354,30 @@ const example = extrude(10, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: 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 @@ Sketch a circle.
|
||||
|
||||
|
||||
```js
|
||||
circle(center: [number], radius: number, sketch_surface_or_group: SketchSurfaceOrGroup, tag?: TagDeclarator) -> SketchGroup
|
||||
circle(center: [number], radius: number, tag?: String, sketch_surface_or_group: SketchSurfaceOrGroup) -> SketchGroup
|
||||
```
|
||||
|
||||
### Examples
|
||||
@ -41,6 +41,7 @@ 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
|
||||
{
|
||||
@ -75,184 +76,12 @@ const example = extrude(5, exampleSketch)
|
||||
},
|
||||
} |
|
||||
{
|
||||
// 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.
|
||||
// the face id the sketch is on
|
||||
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,6 +105,8 @@ 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).
|
||||
@ -311,74 +142,12 @@ const example = extrude(5, exampleSketch)
|
||||
},
|
||||
} |
|
||||
{
|
||||
// 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.
|
||||
// the face id the sketch is on
|
||||
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,
|
||||
@ -401,32 +170,25 @@ 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 tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: 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 name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "ToPoint",
|
||||
@ -438,12 +200,8 @@ const example = extrude(5, exampleSketch)
|
||||
center: [number, number],
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArcTo",
|
||||
@ -451,12 +209,8 @@ const example = extrude(5, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArc",
|
||||
@ -464,12 +218,8 @@ const example = extrude(5, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Horizontal",
|
||||
@ -479,12 +229,8 @@ const example = extrude(5, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "AngledLineTo",
|
||||
@ -496,24 +242,30 @@ const example = extrude(5, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Base",
|
||||
}],
|
||||
}
|
||||
```
|
||||
* `tag`: `TagDeclarator` (OPTIONAL)
|
||||
```js
|
||||
{
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
// 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,
|
||||
},
|
||||
}
|
||||
```
|
||||
|
||||
@ -522,6 +274,8 @@ 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).
|
||||
@ -557,184 +311,12 @@ const example = extrude(5, exampleSketch)
|
||||
},
|
||||
} |
|
||||
{
|
||||
// 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.
|
||||
// the face id the sketch is on
|
||||
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,
|
||||
@ -757,32 +339,25 @@ 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 tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: 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 name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "ToPoint",
|
||||
@ -794,12 +369,8 @@ const example = extrude(5, exampleSketch)
|
||||
center: [number, number],
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArcTo",
|
||||
@ -807,12 +378,8 @@ const example = extrude(5, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArc",
|
||||
@ -820,12 +387,8 @@ const example = extrude(5, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Horizontal",
|
||||
@ -835,12 +398,8 @@ const example = extrude(5, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "AngledLineTo",
|
||||
@ -852,16 +411,30 @@ const example = extrude(5, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: 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?: TagDeclarator) -> SketchGroup
|
||||
close(sketch_group: SketchGroup, tag?: String) -> SketchGroup
|
||||
```
|
||||
|
||||
### Examples
|
||||
@ -42,6 +42,8 @@ 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).
|
||||
@ -77,184 +79,12 @@ const example = extrude(10, exampleSketch)
|
||||
},
|
||||
} |
|
||||
{
|
||||
// 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.
|
||||
// the face id the sketch is on
|
||||
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,32 +107,25 @@ 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 tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: 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 name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "ToPoint",
|
||||
@ -314,12 +137,8 @@ const example = extrude(10, exampleSketch)
|
||||
center: [number, number],
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArcTo",
|
||||
@ -327,12 +146,8 @@ const example = extrude(10, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArc",
|
||||
@ -340,12 +155,8 @@ const example = extrude(10, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Horizontal",
|
||||
@ -355,12 +166,8 @@ const example = extrude(10, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "AngledLineTo",
|
||||
@ -372,32 +179,41 @@ const example = extrude(10, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: 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,
|
||||
}
|
||||
```
|
||||
* `tag`: `String` (OPTIONAL)
|
||||
|
||||
### 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).
|
||||
@ -433,184 +249,12 @@ const example = extrude(10, exampleSketch)
|
||||
},
|
||||
} |
|
||||
{
|
||||
// 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.
|
||||
// the face id the sketch is on
|
||||
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,
|
||||
@ -633,32 +277,25 @@ 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 tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: 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 name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "ToPoint",
|
||||
@ -670,12 +307,8 @@ const example = extrude(10, exampleSketch)
|
||||
center: [number, number],
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArcTo",
|
||||
@ -683,12 +316,8 @@ const example = extrude(10, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArc",
|
||||
@ -696,12 +325,8 @@ const example = extrude(10, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Horizontal",
|
||||
@ -711,12 +336,8 @@ const example = extrude(10, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "AngledLineTo",
|
||||
@ -728,16 +349,30 @@ const example = extrude(10, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: 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,6 +67,8 @@ 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).
|
||||
@ -102,184 +104,12 @@ const example = extrude(10, exampleSketch)
|
||||
},
|
||||
} |
|
||||
{
|
||||
// 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.
|
||||
// the face id the sketch is on
|
||||
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,
|
||||
@ -302,33 +132,26 @@ 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 tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: 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 tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "ToPoint",
|
||||
@ -340,12 +163,8 @@ const example = extrude(10, exampleSketch)
|
||||
center: [number, number],
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArcTo",
|
||||
@ -353,12 +172,8 @@ const example = extrude(10, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArc",
|
||||
@ -366,12 +181,8 @@ const example = extrude(10, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Horizontal",
|
||||
@ -381,12 +192,8 @@ const example = extrude(10, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "AngledLineTo",
|
||||
@ -398,16 +205,30 @@ const example = extrude(10, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: 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",
|
||||
@ -421,185 +242,20 @@ 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 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 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 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 name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "ToPoint",
|
||||
@ -611,12 +267,8 @@ const example = extrude(10, exampleSketch)
|
||||
center: [number, number],
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArcTo",
|
||||
@ -624,12 +276,8 @@ const example = extrude(10, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArc",
|
||||
@ -637,12 +285,8 @@ const example = extrude(10, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Horizontal",
|
||||
@ -652,12 +296,8 @@ const example = extrude(10, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "AngledLineTo",
|
||||
@ -669,17 +309,12 @@ const example = extrude(10, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Base",
|
||||
}],
|
||||
},
|
||||
// The id of the extrusion start cap
|
||||
startCapId: uuid,
|
||||
type: "extrudeGroup",
|
||||
@ -689,14 +324,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",
|
||||
} |
|
||||
{
|
||||
@ -704,16 +339,34 @@ 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,9 +50,7 @@ const mountingPlate = extrude(thickness, mountingPlateSketch)
|
||||
radius: number,
|
||||
// The tags of the paths you want to fillet.
|
||||
tags: [uuid |
|
||||
{
|
||||
value: string,
|
||||
}],
|
||||
string],
|
||||
}
|
||||
```
|
||||
* `extrude_group`: `ExtrudeGroup` - An extrude group is a collection of extrude surfaces. (REQUIRED)
|
||||
@ -60,185 +58,20 @@ const mountingPlate = extrude(thickness, mountingPlateSketch)
|
||||
{
|
||||
// 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: {
|
||||
// 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 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 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 name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "ToPoint",
|
||||
@ -250,12 +83,8 @@ const mountingPlate = extrude(thickness, mountingPlateSketch)
|
||||
center: [number, number],
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArcTo",
|
||||
@ -263,12 +92,8 @@ const mountingPlate = extrude(thickness, mountingPlateSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArc",
|
||||
@ -276,12 +101,8 @@ const mountingPlate = extrude(thickness, mountingPlateSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Horizontal",
|
||||
@ -291,12 +112,8 @@ const mountingPlate = extrude(thickness, mountingPlateSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "AngledLineTo",
|
||||
@ -308,17 +125,12 @@ const mountingPlate = extrude(thickness, mountingPlateSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Base",
|
||||
}],
|
||||
},
|
||||
// The id of the extrusion start cap
|
||||
startCapId: uuid,
|
||||
// The extrude surfaces.
|
||||
@ -327,14 +139,14 @@ const mountingPlate = extrude(thickness, mountingPlateSketch)
|
||||
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",
|
||||
} |
|
||||
{
|
||||
@ -342,16 +154,34 @@ const mountingPlate = extrude(thickness, mountingPlateSketch)
|
||||
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,
|
||||
},
|
||||
}
|
||||
```
|
||||
|
||||
@ -362,185 +192,20 @@ const mountingPlate = extrude(thickness, mountingPlateSketch)
|
||||
{
|
||||
// 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: {
|
||||
// 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 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 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 name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "ToPoint",
|
||||
@ -552,12 +217,8 @@ const mountingPlate = extrude(thickness, mountingPlateSketch)
|
||||
center: [number, number],
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArcTo",
|
||||
@ -565,12 +226,8 @@ const mountingPlate = extrude(thickness, mountingPlateSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArc",
|
||||
@ -578,12 +235,8 @@ const mountingPlate = extrude(thickness, mountingPlateSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Horizontal",
|
||||
@ -593,12 +246,8 @@ const mountingPlate = extrude(thickness, mountingPlateSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "AngledLineTo",
|
||||
@ -610,17 +259,12 @@ const mountingPlate = extrude(thickness, mountingPlateSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Base",
|
||||
}],
|
||||
},
|
||||
// The id of the extrusion start cap
|
||||
startCapId: uuid,
|
||||
// The extrude surfaces.
|
||||
@ -629,14 +273,14 @@ const mountingPlate = extrude(thickness, mountingPlateSketch)
|
||||
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",
|
||||
} |
|
||||
{
|
||||
@ -644,16 +288,34 @@ const mountingPlate = extrude(thickness, mountingPlateSketch)
|
||||
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: TagIdentifier, extrude_group: ExtrudeGroup) -> Uuid
|
||||
getEdge(tag: String, extrude_group: ExtrudeGroup) -> Uuid
|
||||
```
|
||||
|
||||
### Examples
|
||||
@ -17,7 +17,7 @@ getEdge(tag: TagIdentifier, 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,196 +39,26 @@ const revolution = startSketchOn(box, "revolveAxis")
|
||||
|
||||
### Arguments
|
||||
|
||||
* `tag`: `TagIdentifier` (REQUIRED)
|
||||
```js
|
||||
{
|
||||
value: string,
|
||||
}
|
||||
```
|
||||
* `tag`: `String` (REQUIRED)
|
||||
* `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 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 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 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 name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "ToPoint",
|
||||
@ -240,12 +70,8 @@ const revolution = startSketchOn(box, "revolveAxis")
|
||||
center: [number, number],
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArcTo",
|
||||
@ -253,12 +79,8 @@ const revolution = startSketchOn(box, "revolveAxis")
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArc",
|
||||
@ -266,12 +88,8 @@ const revolution = startSketchOn(box, "revolveAxis")
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Horizontal",
|
||||
@ -281,12 +99,8 @@ const revolution = startSketchOn(box, "revolveAxis")
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "AngledLineTo",
|
||||
@ -298,17 +112,12 @@ const revolution = startSketchOn(box, "revolveAxis")
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Base",
|
||||
}],
|
||||
},
|
||||
// The id of the extrusion start cap
|
||||
startCapId: uuid,
|
||||
// The extrude surfaces.
|
||||
@ -317,14 +126,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",
|
||||
} |
|
||||
{
|
||||
@ -332,16 +141,34 @@ 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: TagIdentifier, extrude_group: ExtrudeGroup) -> Uuid
|
||||
getNextAdjacentEdge(tag: String, extrude_group: ExtrudeGroup) -> Uuid
|
||||
```
|
||||
|
||||
### Examples
|
||||
@ -21,13 +21,15 @@ 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", %)
|
||||
]
|
||||
}, %)
|
||||
```
|
||||
|
||||
@ -35,196 +37,26 @@ const example = extrude(5, exampleSketch)
|
||||
|
||||
### Arguments
|
||||
|
||||
* `tag`: `TagIdentifier` (REQUIRED)
|
||||
```js
|
||||
{
|
||||
value: string,
|
||||
}
|
||||
```
|
||||
* `tag`: `String` (REQUIRED)
|
||||
* `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 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 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 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 name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "ToPoint",
|
||||
@ -236,12 +68,8 @@ const example = extrude(5, exampleSketch)
|
||||
center: [number, number],
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArcTo",
|
||||
@ -249,12 +77,8 @@ const example = extrude(5, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArc",
|
||||
@ -262,12 +86,8 @@ const example = extrude(5, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Horizontal",
|
||||
@ -277,12 +97,8 @@ const example = extrude(5, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "AngledLineTo",
|
||||
@ -294,17 +110,12 @@ const example = extrude(5, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Base",
|
||||
}],
|
||||
},
|
||||
// The id of the extrusion start cap
|
||||
startCapId: uuid,
|
||||
// The extrude surfaces.
|
||||
@ -313,14 +124,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",
|
||||
} |
|
||||
{
|
||||
@ -328,16 +139,34 @@ 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: TagIdentifier, extrude_group: ExtrudeGroup) -> Uuid
|
||||
getOppositeEdge(tag: String, 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,196 +35,26 @@ const example = extrude(5, exampleSketch)
|
||||
|
||||
### Arguments
|
||||
|
||||
* `tag`: `TagIdentifier` (REQUIRED)
|
||||
```js
|
||||
{
|
||||
value: string,
|
||||
}
|
||||
```
|
||||
* `tag`: `String` (REQUIRED)
|
||||
* `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 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 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 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 name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "ToPoint",
|
||||
@ -236,12 +66,8 @@ const example = extrude(5, exampleSketch)
|
||||
center: [number, number],
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArcTo",
|
||||
@ -249,12 +75,8 @@ const example = extrude(5, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArc",
|
||||
@ -262,12 +84,8 @@ const example = extrude(5, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Horizontal",
|
||||
@ -277,12 +95,8 @@ const example = extrude(5, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "AngledLineTo",
|
||||
@ -294,17 +108,12 @@ const example = extrude(5, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Base",
|
||||
}],
|
||||
},
|
||||
// The id of the extrusion start cap
|
||||
startCapId: uuid,
|
||||
// The extrude surfaces.
|
||||
@ -313,14 +122,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",
|
||||
} |
|
||||
{
|
||||
@ -328,16 +137,34 @@ 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: TagIdentifier, extrude_group: ExtrudeGroup) -> Uuid
|
||||
getPreviousAdjacentEdge(tag: String, 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,196 +37,26 @@ const example = extrude(5, exampleSketch)
|
||||
|
||||
### Arguments
|
||||
|
||||
* `tag`: `TagIdentifier` (REQUIRED)
|
||||
```js
|
||||
{
|
||||
value: string,
|
||||
}
|
||||
```
|
||||
* `tag`: `String` (REQUIRED)
|
||||
* `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 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 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 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 name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "ToPoint",
|
||||
@ -238,12 +68,8 @@ const example = extrude(5, exampleSketch)
|
||||
center: [number, number],
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArcTo",
|
||||
@ -251,12 +77,8 @@ const example = extrude(5, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArc",
|
||||
@ -264,12 +86,8 @@ const example = extrude(5, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Horizontal",
|
||||
@ -279,12 +97,8 @@ const example = extrude(5, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "AngledLineTo",
|
||||
@ -296,17 +110,12 @@ const example = extrude(5, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Base",
|
||||
}],
|
||||
},
|
||||
// The id of the extrusion start cap
|
||||
startCapId: uuid,
|
||||
// The extrude surfaces.
|
||||
@ -315,14 +124,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",
|
||||
} |
|
||||
{
|
||||
@ -330,16 +139,34 @@ 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,185 +48,20 @@ 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 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 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 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 name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "ToPoint",
|
||||
@ -238,12 +73,8 @@ const part001 = startSketchOn('XY')
|
||||
center: [number, number],
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArcTo",
|
||||
@ -251,12 +82,8 @@ const part001 = startSketchOn('XY')
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArc",
|
||||
@ -264,12 +91,8 @@ const part001 = startSketchOn('XY')
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Horizontal",
|
||||
@ -279,12 +102,8 @@ const part001 = startSketchOn('XY')
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "AngledLineTo",
|
||||
@ -296,17 +115,12 @@ const part001 = startSketchOn('XY')
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Base",
|
||||
}],
|
||||
},
|
||||
// The id of the extrusion start cap
|
||||
startCapId: uuid,
|
||||
// The extrude surfaces.
|
||||
@ -315,14 +129,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",
|
||||
} |
|
||||
{
|
||||
@ -330,16 +144,34 @@ 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,
|
||||
},
|
||||
}
|
||||
```
|
||||
|
||||
@ -350,185 +182,20 @@ 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 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 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 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 name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "ToPoint",
|
||||
@ -540,12 +207,8 @@ const part001 = startSketchOn('XY')
|
||||
center: [number, number],
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArcTo",
|
||||
@ -553,12 +216,8 @@ const part001 = startSketchOn('XY')
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArc",
|
||||
@ -566,12 +225,8 @@ const part001 = startSketchOn('XY')
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Horizontal",
|
||||
@ -581,12 +236,8 @@ const part001 = startSketchOn('XY')
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "AngledLineTo",
|
||||
@ -598,17 +249,12 @@ const part001 = startSketchOn('XY')
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Base",
|
||||
}],
|
||||
},
|
||||
// The id of the extrusion start cap
|
||||
startCapId: uuid,
|
||||
// The extrude surfaces.
|
||||
@ -617,14 +263,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",
|
||||
} |
|
||||
{
|
||||
@ -632,16 +278,34 @@ 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,6 +53,8 @@ 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).
|
||||
@ -88,184 +90,12 @@ const example = extrude(1, exampleSketch)
|
||||
},
|
||||
} |
|
||||
{
|
||||
// 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.
|
||||
// the face id the sketch is on
|
||||
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,33 +118,26 @@ 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 tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: 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 tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "ToPoint",
|
||||
@ -326,12 +149,8 @@ const example = extrude(1, exampleSketch)
|
||||
center: [number, number],
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArcTo",
|
||||
@ -339,12 +158,8 @@ const example = extrude(1, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArc",
|
||||
@ -352,12 +167,8 @@ const example = extrude(1, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Horizontal",
|
||||
@ -367,12 +178,8 @@ const example = extrude(1, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "AngledLineTo",
|
||||
@ -384,16 +191,30 @@ const example = extrude(1, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: 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",
|
||||
@ -402,6 +223,8 @@ 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).
|
||||
@ -437,184 +260,12 @@ const example = extrude(1, exampleSketch)
|
||||
},
|
||||
} |
|
||||
{
|
||||
// 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.
|
||||
// the face id the sketch is on
|
||||
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,
|
||||
@ -637,32 +288,25 @@ 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 tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: 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 name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "ToPoint",
|
||||
@ -674,12 +318,8 @@ const example = extrude(1, exampleSketch)
|
||||
center: [number, number],
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArcTo",
|
||||
@ -687,12 +327,8 @@ const example = extrude(1, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArc",
|
||||
@ -700,12 +336,8 @@ const example = extrude(1, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Horizontal",
|
||||
@ -715,12 +347,8 @@ const example = extrude(1, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "AngledLineTo",
|
||||
@ -732,16 +360,30 @@ const example = extrude(1, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: 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,
|
||||
},
|
||||
}
|
||||
```
|
||||
|
||||
@ -750,6 +392,8 @@ 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).
|
||||
@ -785,184 +429,12 @@ const example = extrude(1, exampleSketch)
|
||||
},
|
||||
} |
|
||||
{
|
||||
// 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.
|
||||
// the face id the sketch is on
|
||||
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,
|
||||
@ -985,32 +457,25 @@ 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 tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: 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 name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "ToPoint",
|
||||
@ -1022,12 +487,8 @@ const example = extrude(1, exampleSketch)
|
||||
center: [number, number],
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArcTo",
|
||||
@ -1035,12 +496,8 @@ const example = extrude(1, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArc",
|
||||
@ -1048,12 +505,8 @@ const example = extrude(1, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Horizontal",
|
||||
@ -1063,12 +516,8 @@ const example = extrude(1, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "AngledLineTo",
|
||||
@ -1080,16 +529,30 @@ const example = extrude(1, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: 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,7 +23,6 @@ layout: manual
|
||||
* [`atan`](kcl/atan)
|
||||
* [`bezierCurve`](kcl/bezierCurve)
|
||||
* [`ceil`](kcl/ceil)
|
||||
* [`chamfer`](kcl/chamfer)
|
||||
* [`circle`](kcl/circle)
|
||||
* [`close`](kcl/close)
|
||||
* [`cos`](kcl/cos)
|
||||
@ -55,7 +54,6 @@ layout: manual
|
||||
* [`patternCircular3d`](kcl/patternCircular3d)
|
||||
* [`patternLinear2d`](kcl/patternLinear2d)
|
||||
* [`patternLinear3d`](kcl/patternLinear3d)
|
||||
* [`patternTransform`](kcl/patternTransform)
|
||||
* [`pi`](kcl/pi)
|
||||
* [`pow`](kcl/pow)
|
||||
* [`profileStart`](kcl/profileStart)
|
||||
@ -66,7 +64,6 @@ layout: manual
|
||||
* [`segEndX`](kcl/segEndX)
|
||||
* [`segEndY`](kcl/segEndY)
|
||||
* [`segLen`](kcl/segLen)
|
||||
* [`shell`](kcl/shell)
|
||||
* [`sin`](kcl/sin)
|
||||
* [`sqrt`](kcl/sqrt)
|
||||
* [`startProfileAt`](kcl/startProfileAt)
|
||||
|
||||
@ -33,6 +33,8 @@ 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).
|
||||
@ -68,184 +70,12 @@ const example = extrude(5, exampleSketch)
|
||||
},
|
||||
} |
|
||||
{
|
||||
// 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.
|
||||
// the face id the sketch is on
|
||||
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,32 +98,25 @@ 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 tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: 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 name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "ToPoint",
|
||||
@ -305,12 +128,8 @@ const example = extrude(5, exampleSketch)
|
||||
center: [number, number],
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArcTo",
|
||||
@ -318,12 +137,8 @@ const example = extrude(5, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArc",
|
||||
@ -331,12 +146,8 @@ const example = extrude(5, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Horizontal",
|
||||
@ -346,12 +157,8 @@ const example = extrude(5, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "AngledLineTo",
|
||||
@ -363,16 +170,30 @@ const example = extrude(5, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: 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,6 +33,8 @@ 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).
|
||||
@ -68,184 +70,12 @@ const example = extrude(5, exampleSketch)
|
||||
},
|
||||
} |
|
||||
{
|
||||
// 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.
|
||||
// the face id the sketch is on
|
||||
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,32 +98,25 @@ 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 tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: 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 name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "ToPoint",
|
||||
@ -305,12 +128,8 @@ const example = extrude(5, exampleSketch)
|
||||
center: [number, number],
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArcTo",
|
||||
@ -318,12 +137,8 @@ const example = extrude(5, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArc",
|
||||
@ -331,12 +146,8 @@ const example = extrude(5, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Horizontal",
|
||||
@ -346,12 +157,8 @@ const example = extrude(5, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "AngledLineTo",
|
||||
@ -363,16 +170,30 @@ const example = extrude(5, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: 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?: TagDeclarator) -> SketchGroup
|
||||
line(delta: [number], sketch_group: SketchGroup, tag?: String) -> SketchGroup
|
||||
```
|
||||
|
||||
### Examples
|
||||
@ -46,6 +46,8 @@ 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).
|
||||
@ -81,184 +83,12 @@ const example = extrude(5, exampleSketch)
|
||||
},
|
||||
} |
|
||||
{
|
||||
// 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.
|
||||
// the face id the sketch is on
|
||||
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,32 +111,25 @@ 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 tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: 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 name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "ToPoint",
|
||||
@ -318,12 +141,8 @@ const example = extrude(5, exampleSketch)
|
||||
center: [number, number],
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArcTo",
|
||||
@ -331,12 +150,8 @@ const example = extrude(5, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArc",
|
||||
@ -344,12 +159,8 @@ const example = extrude(5, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Horizontal",
|
||||
@ -359,12 +170,8 @@ const example = extrude(5, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "AngledLineTo",
|
||||
@ -376,32 +183,41 @@ const example = extrude(5, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: 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,
|
||||
}
|
||||
```
|
||||
* `tag`: `String` (OPTIONAL)
|
||||
|
||||
### 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).
|
||||
@ -437,184 +253,12 @@ const example = extrude(5, exampleSketch)
|
||||
},
|
||||
} |
|
||||
{
|
||||
// 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.
|
||||
// the face id the sketch is on
|
||||
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,
|
||||
@ -637,32 +281,25 @@ 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 tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: 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 name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "ToPoint",
|
||||
@ -674,12 +311,8 @@ const example = extrude(5, exampleSketch)
|
||||
center: [number, number],
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArcTo",
|
||||
@ -687,12 +320,8 @@ const example = extrude(5, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArc",
|
||||
@ -700,12 +329,8 @@ const example = extrude(5, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Horizontal",
|
||||
@ -715,12 +340,8 @@ const example = extrude(5, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "AngledLineTo",
|
||||
@ -732,16 +353,30 @@ const example = extrude(5, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: 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?: TagDeclarator) -> SketchGroup
|
||||
lineTo(to: [number], sketch_group: SketchGroup, tag?: String) -> SketchGroup
|
||||
```
|
||||
|
||||
### Examples
|
||||
@ -33,6 +33,8 @@ 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).
|
||||
@ -68,184 +70,12 @@ const example = extrude(5, exampleSketch)
|
||||
},
|
||||
} |
|
||||
{
|
||||
// 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.
|
||||
// the face id the sketch is on
|
||||
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,32 +98,25 @@ 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 tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: 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 name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "ToPoint",
|
||||
@ -305,12 +128,8 @@ const example = extrude(5, exampleSketch)
|
||||
center: [number, number],
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArcTo",
|
||||
@ -318,12 +137,8 @@ const example = extrude(5, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArc",
|
||||
@ -331,12 +146,8 @@ const example = extrude(5, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Horizontal",
|
||||
@ -346,12 +157,8 @@ const example = extrude(5, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "AngledLineTo",
|
||||
@ -363,32 +170,41 @@ const example = extrude(5, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: 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,
|
||||
}
|
||||
```
|
||||
* `tag`: `String` (OPTIONAL)
|
||||
|
||||
### 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).
|
||||
@ -424,184 +240,12 @@ const example = extrude(5, exampleSketch)
|
||||
},
|
||||
} |
|
||||
{
|
||||
// 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.
|
||||
// the face id the sketch is on
|
||||
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,
|
||||
@ -624,32 +268,25 @@ 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 tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: 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 name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "ToPoint",
|
||||
@ -661,12 +298,8 @@ const example = extrude(5, exampleSketch)
|
||||
center: [number, number],
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArcTo",
|
||||
@ -674,12 +307,8 @@ const example = extrude(5, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArc",
|
||||
@ -687,12 +316,8 @@ const example = extrude(5, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Horizontal",
|
||||
@ -702,12 +327,8 @@ const example = extrude(5, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "AngledLineTo",
|
||||
@ -719,16 +340,30 @@ const example = extrude(5, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: 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_set: SketchGroupSet) -> [SketchGroup]
|
||||
patternCircular2d(data: CircularPattern2dData, sketch_group: SketchGroup) -> [SketchGroup]
|
||||
```
|
||||
|
||||
### Examples
|
||||
@ -48,9 +48,11 @@ const example = extrude(1, exampleSketch)
|
||||
rotateDuplicates: string,
|
||||
}
|
||||
```
|
||||
* `sketch_group_set`: `SketchGroupSet` - A sketch group or a group of sketch groups. (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).
|
||||
@ -86,184 +88,12 @@ const example = extrude(1, exampleSketch)
|
||||
},
|
||||
} |
|
||||
{
|
||||
// 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.
|
||||
// the face id the sketch is on
|
||||
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,
|
||||
@ -286,33 +116,25 @@ 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 tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: 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 tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "ToPoint",
|
||||
@ -324,12 +146,8 @@ const example = extrude(1, exampleSketch)
|
||||
center: [number, number],
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArcTo",
|
||||
@ -337,12 +155,8 @@ const example = extrude(1, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArc",
|
||||
@ -350,12 +164,8 @@ const example = extrude(1, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Horizontal",
|
||||
@ -365,12 +175,8 @@ const example = extrude(1, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "AngledLineTo",
|
||||
@ -382,19 +188,30 @@ const example = extrude(1, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Base",
|
||||
}],
|
||||
} |
|
||||
{
|
||||
type: "sketchGroups",
|
||||
// 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 3D model.
|
||||
|
||||
|
||||
```js
|
||||
patternCircular3d(data: CircularPattern3dData, extrude_group_set: ExtrudeGroupSet) -> [ExtrudeGroup]
|
||||
patternCircular3d(data: CircularPattern3dData, extrude_group: ExtrudeGroup) -> [ExtrudeGroup]
|
||||
```
|
||||
|
||||
### Examples
|
||||
@ -47,190 +47,25 @@ const example = extrude(-5, exampleSketch)
|
||||
rotateDuplicates: string,
|
||||
}
|
||||
```
|
||||
* `extrude_group_set`: `ExtrudeGroupSet` - A extrude group or a group of extrude groups. (REQUIRED)
|
||||
* `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 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 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 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 name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "ToPoint",
|
||||
@ -242,12 +77,8 @@ const example = extrude(-5, exampleSketch)
|
||||
center: [number, number],
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArcTo",
|
||||
@ -255,12 +86,8 @@ const example = extrude(-5, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArc",
|
||||
@ -268,12 +95,8 @@ const example = extrude(-5, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Horizontal",
|
||||
@ -283,12 +106,8 @@ const example = extrude(-5, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "AngledLineTo",
|
||||
@ -300,34 +119,28 @@ const example = extrude(-5, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: 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",
|
||||
} |
|
||||
{
|
||||
@ -335,19 +148,34 @@ 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",
|
||||
}],
|
||||
} |
|
||||
{
|
||||
type: "extrudeGroups",
|
||||
// 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,
|
||||
},
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
@ -44,6 +44,8 @@ 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).
|
||||
@ -79,184 +81,12 @@ const example = extrude(1, exampleSketch)
|
||||
},
|
||||
} |
|
||||
{
|
||||
// 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.
|
||||
// the face id the sketch is on
|
||||
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,
|
||||
@ -279,33 +109,26 @@ 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 tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: 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 tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "ToPoint",
|
||||
@ -317,12 +140,8 @@ const example = extrude(1, exampleSketch)
|
||||
center: [number, number],
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArcTo",
|
||||
@ -330,12 +149,8 @@ const example = extrude(1, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArc",
|
||||
@ -343,12 +158,8 @@ const example = extrude(1, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Horizontal",
|
||||
@ -358,12 +169,8 @@ const example = extrude(1, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "AngledLineTo",
|
||||
@ -375,16 +182,30 @@ const example = extrude(1, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: 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_set: ExtrudeGroupSet) -> [ExtrudeGroup]
|
||||
patternLinear3d(data: LinearPattern3dData, extrude_group: ExtrudeGroup) -> [ExtrudeGroup]
|
||||
```
|
||||
|
||||
### Examples
|
||||
@ -45,190 +45,25 @@ const example = extrude(1, exampleSketch)
|
||||
repetitions: number,
|
||||
}
|
||||
```
|
||||
* `extrude_group_set`: `ExtrudeGroupSet` - A extrude group or a group of extrude groups. (REQUIRED)
|
||||
* `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 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 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 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 name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "ToPoint",
|
||||
@ -240,12 +75,8 @@ const example = extrude(1, exampleSketch)
|
||||
center: [number, number],
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArcTo",
|
||||
@ -253,12 +84,8 @@ const example = extrude(1, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArc",
|
||||
@ -266,12 +93,8 @@ const example = extrude(1, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Horizontal",
|
||||
@ -281,12 +104,8 @@ const example = extrude(1, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "AngledLineTo",
|
||||
@ -298,34 +117,28 @@ const example = extrude(1, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: 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",
|
||||
} |
|
||||
{
|
||||
@ -333,19 +146,34 @@ 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",
|
||||
}],
|
||||
} |
|
||||
{
|
||||
type: "extrudeGroups",
|
||||
// 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,
|
||||
},
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
@ -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,6 +34,8 @@ 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).
|
||||
@ -69,184 +71,12 @@ const sketch001 = startSketchOn('XY')
|
||||
},
|
||||
} |
|
||||
{
|
||||
// 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.
|
||||
// the face id the sketch is on
|
||||
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,32 +99,25 @@ 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 tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: 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 name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "ToPoint",
|
||||
@ -306,12 +129,8 @@ const sketch001 = startSketchOn('XY')
|
||||
center: [number, number],
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArcTo",
|
||||
@ -319,12 +138,8 @@ const sketch001 = startSketchOn('XY')
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArc",
|
||||
@ -332,12 +147,8 @@ const sketch001 = startSketchOn('XY')
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Horizontal",
|
||||
@ -347,12 +158,8 @@ const sketch001 = startSketchOn('XY')
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "AngledLineTo",
|
||||
@ -364,16 +171,30 @@ const sketch001 = startSketchOn('XY')
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: 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,6 +29,8 @@ 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).
|
||||
@ -64,184 +66,12 @@ const sketch001 = startSketchOn('XY')
|
||||
},
|
||||
} |
|
||||
{
|
||||
// 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.
|
||||
// the face id the sketch is on
|
||||
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,
|
||||
@ -264,32 +94,25 @@ 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 tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: 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 name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "ToPoint",
|
||||
@ -301,12 +124,8 @@ const sketch001 = startSketchOn('XY')
|
||||
center: [number, number],
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArcTo",
|
||||
@ -314,12 +133,8 @@ const sketch001 = startSketchOn('XY')
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArc",
|
||||
@ -327,12 +142,8 @@ const sketch001 = startSketchOn('XY')
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Horizontal",
|
||||
@ -342,12 +153,8 @@ const sketch001 = startSketchOn('XY')
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "AngledLineTo",
|
||||
@ -359,16 +166,30 @@ const sketch001 = startSketchOn('XY')
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: 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,6 +28,8 @@ 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).
|
||||
@ -63,184 +65,12 @@ const sketch001 = startSketchOn('XY')
|
||||
},
|
||||
} |
|
||||
{
|
||||
// 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.
|
||||
// the face id the sketch is on
|
||||
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,
|
||||
@ -263,32 +93,25 @@ 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 tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: 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 name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "ToPoint",
|
||||
@ -300,12 +123,8 @@ const sketch001 = startSketchOn('XY')
|
||||
center: [number, number],
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArcTo",
|
||||
@ -313,12 +132,8 @@ const sketch001 = startSketchOn('XY')
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArc",
|
||||
@ -326,12 +141,8 @@ const sketch001 = startSketchOn('XY')
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Horizontal",
|
||||
@ -341,12 +152,8 @@ const sketch001 = startSketchOn('XY')
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "AngledLineTo",
|
||||
@ -358,16 +165,30 @@ const sketch001 = startSketchOn('XY')
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: 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,
|
||||
},
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
@ -99,7 +99,7 @@ const box = startSketchOn('XY')
|
||||
|> startProfileAt([0, 0], %)
|
||||
|> line([0, 20], %)
|
||||
|> line([20, 0], %)
|
||||
|> line([0, -20], %, $revolveAxis)
|
||||
|> line([0, -20], %, 'revolveAxis')
|
||||
|> close(%)
|
||||
|> extrude(20, %)
|
||||
|
||||
@ -107,7 +107,7 @@ const sketch001 = startSketchOn(box, "END")
|
||||
|> circle([10, 10], 4, %)
|
||||
|> revolve({
|
||||
angle: 90,
|
||||
axis: getOppositeEdge(revolveAxis, box)
|
||||
axis: getOppositeEdge('revolveAxis', box)
|
||||
}, %)
|
||||
```
|
||||
|
||||
@ -156,14 +156,14 @@ const part001 = revolve({
|
||||
},
|
||||
} |
|
||||
uuid |
|
||||
{
|
||||
value: string,
|
||||
},
|
||||
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).
|
||||
@ -199,184 +199,12 @@ 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: 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.
|
||||
// the face id the sketch is on
|
||||
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,
|
||||
@ -399,32 +227,25 @@ uuid |
|
||||
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 tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: 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 name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "ToPoint",
|
||||
@ -436,12 +257,8 @@ uuid |
|
||||
center: [number, number],
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArcTo",
|
||||
@ -449,12 +266,8 @@ uuid |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArc",
|
||||
@ -462,12 +275,8 @@ uuid |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Horizontal",
|
||||
@ -477,12 +286,8 @@ uuid |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "AngledLineTo",
|
||||
@ -494,16 +299,30 @@ uuid |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: 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,
|
||||
},
|
||||
}
|
||||
```
|
||||
|
||||
@ -514,185 +333,20 @@ uuid |
|
||||
{
|
||||
// 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: {
|
||||
// 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 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 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 name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "ToPoint",
|
||||
@ -704,12 +358,8 @@ uuid |
|
||||
center: [number, number],
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArcTo",
|
||||
@ -717,12 +367,8 @@ uuid |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArc",
|
||||
@ -730,12 +376,8 @@ uuid |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Horizontal",
|
||||
@ -745,12 +387,8 @@ uuid |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "AngledLineTo",
|
||||
@ -762,17 +400,12 @@ uuid |
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Base",
|
||||
}],
|
||||
},
|
||||
// The id of the extrusion start cap
|
||||
startCapId: uuid,
|
||||
// The extrude surfaces.
|
||||
@ -781,14 +414,14 @@ uuid |
|
||||
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",
|
||||
} |
|
||||
{
|
||||
@ -796,16 +429,34 @@ uuid |
|
||||
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 @@ Returns the angle of the segment.
|
||||
|
||||
|
||||
```js
|
||||
segAng(segment_name: TagIdentifier, sketch_group: SketchGroup) -> number
|
||||
segAng(segment_name: string, sketch_group: SketchGroup) -> number
|
||||
```
|
||||
|
||||
### Examples
|
||||
@ -18,11 +18,11 @@ segAng(segment_name: TagIdentifier, 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,15 +32,12 @@ const example = extrude(4, exampleSketch)
|
||||
|
||||
### Arguments
|
||||
|
||||
* `segment_name`: `TagIdentifier` (REQUIRED)
|
||||
```js
|
||||
{
|
||||
value: string,
|
||||
}
|
||||
```
|
||||
* `segment_name`: `string` (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).
|
||||
@ -76,184 +73,12 @@ const example = extrude(4, exampleSketch)
|
||||
},
|
||||
} |
|
||||
{
|
||||
// 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.
|
||||
// the face id the sketch is on
|
||||
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,32 +101,25 @@ 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 tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: 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 name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "ToPoint",
|
||||
@ -313,12 +131,8 @@ const example = extrude(4, exampleSketch)
|
||||
center: [number, number],
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArcTo",
|
||||
@ -326,12 +140,8 @@ const example = extrude(4, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArc",
|
||||
@ -339,12 +149,8 @@ const example = extrude(4, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Horizontal",
|
||||
@ -354,12 +160,8 @@ const example = extrude(4, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "AngledLineTo",
|
||||
@ -371,16 +173,30 @@ const example = extrude(4, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: 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: TagIdentifier, sketch_group: SketchGroup) -> number
|
||||
segEndX(segment_name: string, sketch_group: SketchGroup) -> number
|
||||
```
|
||||
|
||||
### Examples
|
||||
@ -17,9 +17,9 @@ segEndX(segment_name: TagIdentifier, 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,15 +30,12 @@ const example = extrude(5, exampleSketch)
|
||||
|
||||
### Arguments
|
||||
|
||||
* `segment_name`: `TagIdentifier` (REQUIRED)
|
||||
```js
|
||||
{
|
||||
value: string,
|
||||
}
|
||||
```
|
||||
* `segment_name`: `string` (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,184 +71,12 @@ const example = extrude(5, exampleSketch)
|
||||
},
|
||||
} |
|
||||
{
|
||||
// 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.
|
||||
// the face id the sketch is on
|
||||
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,
|
||||
@ -274,32 +99,25 @@ 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 tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: 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 name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "ToPoint",
|
||||
@ -311,12 +129,8 @@ const example = extrude(5, exampleSketch)
|
||||
center: [number, number],
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArcTo",
|
||||
@ -324,12 +138,8 @@ const example = extrude(5, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArc",
|
||||
@ -337,12 +147,8 @@ const example = extrude(5, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Horizontal",
|
||||
@ -352,12 +158,8 @@ const example = extrude(5, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "AngledLineTo",
|
||||
@ -369,16 +171,30 @@ const example = extrude(5, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: 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: TagIdentifier, sketch_group: SketchGroup) -> number
|
||||
segEndY(segment_name: string, sketch_group: SketchGroup) -> number
|
||||
```
|
||||
|
||||
### Examples
|
||||
@ -18,9 +18,9 @@ segEndY(segment_name: TagIdentifier, 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,15 +31,12 @@ const example = extrude(5, exampleSketch)
|
||||
|
||||
### Arguments
|
||||
|
||||
* `segment_name`: `TagIdentifier` (REQUIRED)
|
||||
```js
|
||||
{
|
||||
value: string,
|
||||
}
|
||||
```
|
||||
* `segment_name`: `string` (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).
|
||||
@ -75,184 +72,12 @@ const example = extrude(5, exampleSketch)
|
||||
},
|
||||
} |
|
||||
{
|
||||
// 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.
|
||||
// the face id the sketch is on
|
||||
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,
|
||||
@ -275,32 +100,25 @@ 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 tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: 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 name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "ToPoint",
|
||||
@ -312,12 +130,8 @@ const example = extrude(5, exampleSketch)
|
||||
center: [number, number],
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArcTo",
|
||||
@ -325,12 +139,8 @@ const example = extrude(5, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArc",
|
||||
@ -338,12 +148,8 @@ const example = extrude(5, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Horizontal",
|
||||
@ -353,12 +159,8 @@ const example = extrude(5, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "AngledLineTo",
|
||||
@ -370,16 +172,30 @@ const example = extrude(5, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: 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: TagIdentifier, sketch_group: SketchGroup) -> number
|
||||
segLen(segment_name: string, sketch_group: SketchGroup) -> number
|
||||
```
|
||||
|
||||
### Examples
|
||||
@ -17,9 +17,12 @@ segLen(segment_name: TagIdentifier, 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)
|
||||
@ -29,15 +32,12 @@ const example = extrude(5, exampleSketch)
|
||||
|
||||
### Arguments
|
||||
|
||||
* `segment_name`: `TagIdentifier` (REQUIRED)
|
||||
```js
|
||||
{
|
||||
value: string,
|
||||
}
|
||||
```
|
||||
* `segment_name`: `string` (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,184 +73,12 @@ const example = extrude(5, exampleSketch)
|
||||
},
|
||||
} |
|
||||
{
|
||||
// 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.
|
||||
// the face id the sketch is on
|
||||
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,
|
||||
@ -273,32 +101,25 @@ 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 tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: 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 name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "ToPoint",
|
||||
@ -310,12 +131,8 @@ const example = extrude(5, exampleSketch)
|
||||
center: [number, number],
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArcTo",
|
||||
@ -323,12 +140,8 @@ const example = extrude(5, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArc",
|
||||
@ -336,12 +149,8 @@ const example = extrude(5, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Horizontal",
|
||||
@ -351,12 +160,8 @@ const example = extrude(5, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "AngledLineTo",
|
||||
@ -368,16 +173,30 @@ const example = extrude(5, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: 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 profile at a given point.
|
||||
|
||||
|
||||
```js
|
||||
startProfileAt(to: [number], sketch_surface: SketchSurface, tag?: TagDeclarator) -> SketchGroup
|
||||
startProfileAt(to: [number], sketch_surface: SketchSurface, tag?: String) -> SketchGroup
|
||||
```
|
||||
|
||||
### Examples
|
||||
@ -90,241 +90,12 @@ const example = extrude(5, exampleSketch)
|
||||
},
|
||||
} |
|
||||
{
|
||||
// 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 face id the sketch is on
|
||||
faceId: uuid,
|
||||
// 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,
|
||||
@ -348,20 +119,15 @@ const example = extrude(5, exampleSketch)
|
||||
},
|
||||
}
|
||||
```
|
||||
* `tag`: `TagDeclarator` (OPTIONAL)
|
||||
```js
|
||||
{
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
}
|
||||
```
|
||||
* `tag`: `String` (OPTIONAL)
|
||||
|
||||
### 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).
|
||||
@ -397,184 +163,12 @@ const example = extrude(5, exampleSketch)
|
||||
},
|
||||
} |
|
||||
{
|
||||
// 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.
|
||||
// the face id the sketch is on
|
||||
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,
|
||||
@ -597,32 +191,25 @@ 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 tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: 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 name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "ToPoint",
|
||||
@ -634,12 +221,8 @@ const example = extrude(5, exampleSketch)
|
||||
center: [number, number],
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArcTo",
|
||||
@ -647,12 +230,8 @@ const example = extrude(5, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArc",
|
||||
@ -660,12 +239,8 @@ const example = extrude(5, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Horizontal",
|
||||
@ -675,12 +250,8 @@ const example = extrude(5, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "AngledLineTo",
|
||||
@ -692,16 +263,30 @@ const example = extrude(5, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: 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,
|
||||
},
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
@ -59,6 +59,8 @@ 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).
|
||||
@ -94,184 +96,12 @@ const example = extrude(5, exampleSketch)
|
||||
},
|
||||
} |
|
||||
{
|
||||
// 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.
|
||||
// the face id the sketch is on
|
||||
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,
|
||||
@ -294,32 +124,25 @@ 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 tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: 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 name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "ToPoint",
|
||||
@ -331,12 +154,8 @@ const example = extrude(5, exampleSketch)
|
||||
center: [number, number],
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArcTo",
|
||||
@ -344,12 +163,8 @@ const example = extrude(5, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArc",
|
||||
@ -357,12 +172,8 @@ const example = extrude(5, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Horizontal",
|
||||
@ -372,12 +183,8 @@ const example = extrude(5, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "AngledLineTo",
|
||||
@ -389,16 +196,30 @@ const example = extrude(5, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: 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?: FaceTag) -> SketchSurface
|
||||
startSketchOn(data: SketchData, tag?: SketchOnFaceTag) -> 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,121 +163,20 @@ 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 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 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 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 name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "ToPoint",
|
||||
@ -289,12 +188,8 @@ const a1 = startSketchOn({
|
||||
center: [number, number],
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArcTo",
|
||||
@ -302,12 +197,8 @@ const a1 = startSketchOn({
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArc",
|
||||
@ -315,12 +206,8 @@ const a1 = startSketchOn({
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Horizontal",
|
||||
@ -330,12 +217,8 @@ const a1 = startSketchOn({
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "AngledLineTo",
|
||||
@ -347,17 +230,12 @@ const a1 = startSketchOn({
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Base",
|
||||
}],
|
||||
},
|
||||
// The id of the extrusion start cap
|
||||
startCapId: uuid,
|
||||
// The extrude surfaces.
|
||||
@ -366,14 +244,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",
|
||||
} |
|
||||
{
|
||||
@ -381,24 +259,40 @@ 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`: `FaceTag` - A tag for a face. (OPTIONAL)
|
||||
* `tag`: `SketchOnFaceTag` - A tag for sketch on face. (OPTIONAL)
|
||||
```js
|
||||
"start" | "end" |
|
||||
{
|
||||
value: string,
|
||||
}
|
||||
string
|
||||
```
|
||||
|
||||
### Returns
|
||||
@ -437,241 +331,12 @@ const a1 = startSketchOn({
|
||||
},
|
||||
} |
|
||||
{
|
||||
// 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 face id the sketch is on
|
||||
faceId: uuid,
|
||||
// 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,
|
||||
|
||||
140689
docs/kcl/std.json
@ -9,7 +9,7 @@ Draw an arc.
|
||||
|
||||
|
||||
```js
|
||||
tangentialArc(data: TangentialArcData, sketch_group: SketchGroup, tag?: TagDeclarator) -> SketchGroup
|
||||
tangentialArc(data: TangentialArcData, sketch_group: SketchGroup, tag?: String) -> SketchGroup
|
||||
```
|
||||
|
||||
### Examples
|
||||
@ -42,6 +42,8 @@ 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).
|
||||
@ -77,184 +79,12 @@ const example = extrude(10, exampleSketch)
|
||||
},
|
||||
} |
|
||||
{
|
||||
// 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.
|
||||
// the face id the sketch is on
|
||||
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,32 +107,25 @@ 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 tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: 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 name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "ToPoint",
|
||||
@ -314,12 +137,8 @@ const example = extrude(10, exampleSketch)
|
||||
center: [number, number],
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArcTo",
|
||||
@ -327,12 +146,8 @@ const example = extrude(10, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArc",
|
||||
@ -340,12 +155,8 @@ const example = extrude(10, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Horizontal",
|
||||
@ -355,12 +166,8 @@ const example = extrude(10, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "AngledLineTo",
|
||||
@ -372,32 +179,41 @@ const example = extrude(10, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: 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,
|
||||
}
|
||||
```
|
||||
* `tag`: `String` (OPTIONAL)
|
||||
|
||||
### 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).
|
||||
@ -433,184 +249,12 @@ const example = extrude(10, exampleSketch)
|
||||
},
|
||||
} |
|
||||
{
|
||||
// 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.
|
||||
// the face id the sketch is on
|
||||
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,
|
||||
@ -633,32 +277,25 @@ 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 tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: 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 name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "ToPoint",
|
||||
@ -670,12 +307,8 @@ const example = extrude(10, exampleSketch)
|
||||
center: [number, number],
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArcTo",
|
||||
@ -683,12 +316,8 @@ const example = extrude(10, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArc",
|
||||
@ -696,12 +325,8 @@ const example = extrude(10, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Horizontal",
|
||||
@ -711,12 +336,8 @@ const example = extrude(10, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "AngledLineTo",
|
||||
@ -728,16 +349,30 @@ const example = extrude(10, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: 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?: TagDeclarator) -> SketchGroup
|
||||
tangentialArcTo(to: [number], sketch_group: SketchGroup, tag?: String) -> SketchGroup
|
||||
```
|
||||
|
||||
### Examples
|
||||
@ -33,6 +33,8 @@ 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).
|
||||
@ -68,184 +70,12 @@ const example = extrude(10, exampleSketch)
|
||||
},
|
||||
} |
|
||||
{
|
||||
// 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.
|
||||
// the face id the sketch is on
|
||||
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,32 +98,25 @@ 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 tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: 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 name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "ToPoint",
|
||||
@ -305,12 +128,8 @@ const example = extrude(10, exampleSketch)
|
||||
center: [number, number],
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArcTo",
|
||||
@ -318,12 +137,8 @@ const example = extrude(10, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArc",
|
||||
@ -331,12 +146,8 @@ const example = extrude(10, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Horizontal",
|
||||
@ -346,12 +157,8 @@ const example = extrude(10, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "AngledLineTo",
|
||||
@ -363,32 +170,41 @@ const example = extrude(10, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: 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,
|
||||
}
|
||||
```
|
||||
* `tag`: `String` (OPTIONAL)
|
||||
|
||||
### 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).
|
||||
@ -424,184 +240,12 @@ const example = extrude(10, exampleSketch)
|
||||
},
|
||||
} |
|
||||
{
|
||||
// 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.
|
||||
// the face id the sketch is on
|
||||
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,
|
||||
@ -624,32 +268,25 @@ 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 tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: 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 name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "ToPoint",
|
||||
@ -661,12 +298,8 @@ const example = extrude(10, exampleSketch)
|
||||
center: [number, number],
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArcTo",
|
||||
@ -674,12 +307,8 @@ const example = extrude(10, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArc",
|
||||
@ -687,12 +316,8 @@ const example = extrude(10, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Horizontal",
|
||||
@ -702,12 +327,8 @@ const example = extrude(10, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "AngledLineTo",
|
||||
@ -719,16 +340,30 @@ const example = extrude(10, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: 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,107 +74,6 @@ You can nest expressions in parenthesis as well:
|
||||
let myMathExpression = 3 + (1 * 2 / (3 - 7))
|
||||
```
|
||||
|
||||
## 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 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?: TagDeclarator) -> SketchGroup
|
||||
xLine(length: number, sketch_group: SketchGroup, tag?: String) -> SketchGroup
|
||||
```
|
||||
|
||||
### Examples
|
||||
@ -36,6 +36,8 @@ 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,184 +73,12 @@ const example = extrude(10, exampleSketch)
|
||||
},
|
||||
} |
|
||||
{
|
||||
// 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.
|
||||
// the face id the sketch is on
|
||||
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,32 +101,25 @@ 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 tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: 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 name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "ToPoint",
|
||||
@ -308,12 +131,8 @@ const example = extrude(10, exampleSketch)
|
||||
center: [number, number],
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArcTo",
|
||||
@ -321,12 +140,8 @@ const example = extrude(10, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArc",
|
||||
@ -334,12 +149,8 @@ const example = extrude(10, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Horizontal",
|
||||
@ -349,12 +160,8 @@ const example = extrude(10, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "AngledLineTo",
|
||||
@ -366,32 +173,41 @@ const example = extrude(10, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: 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,
|
||||
}
|
||||
```
|
||||
* `tag`: `String` (OPTIONAL)
|
||||
|
||||
### 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).
|
||||
@ -427,184 +243,12 @@ const example = extrude(10, exampleSketch)
|
||||
},
|
||||
} |
|
||||
{
|
||||
// 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.
|
||||
// the face id the sketch is on
|
||||
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,
|
||||
@ -627,32 +271,25 @@ 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 tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: 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 name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "ToPoint",
|
||||
@ -664,12 +301,8 @@ const example = extrude(10, exampleSketch)
|
||||
center: [number, number],
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArcTo",
|
||||
@ -677,12 +310,8 @@ const example = extrude(10, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArc",
|
||||
@ -690,12 +319,8 @@ const example = extrude(10, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Horizontal",
|
||||
@ -705,12 +330,8 @@ const example = extrude(10, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "AngledLineTo",
|
||||
@ -722,16 +343,30 @@ const example = extrude(10, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: 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?: TagDeclarator) -> SketchGroup
|
||||
xLineTo(to: number, sketch_group: SketchGroup, tag?: String) -> SketchGroup
|
||||
```
|
||||
|
||||
### Examples
|
||||
@ -36,6 +36,8 @@ 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,184 +73,12 @@ const example = extrude(10, exampleSketch)
|
||||
},
|
||||
} |
|
||||
{
|
||||
// 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.
|
||||
// the face id the sketch is on
|
||||
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,32 +101,25 @@ 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 tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: 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 name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "ToPoint",
|
||||
@ -308,12 +131,8 @@ const example = extrude(10, exampleSketch)
|
||||
center: [number, number],
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArcTo",
|
||||
@ -321,12 +140,8 @@ const example = extrude(10, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArc",
|
||||
@ -334,12 +149,8 @@ const example = extrude(10, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Horizontal",
|
||||
@ -349,12 +160,8 @@ const example = extrude(10, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "AngledLineTo",
|
||||
@ -366,32 +173,41 @@ const example = extrude(10, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: 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,
|
||||
}
|
||||
```
|
||||
* `tag`: `String` (OPTIONAL)
|
||||
|
||||
### 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).
|
||||
@ -427,184 +243,12 @@ const example = extrude(10, exampleSketch)
|
||||
},
|
||||
} |
|
||||
{
|
||||
// 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.
|
||||
// the face id the sketch is on
|
||||
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,
|
||||
@ -627,32 +271,25 @@ 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 tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: 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 name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "ToPoint",
|
||||
@ -664,12 +301,8 @@ const example = extrude(10, exampleSketch)
|
||||
center: [number, number],
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArcTo",
|
||||
@ -677,12 +310,8 @@ const example = extrude(10, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArc",
|
||||
@ -690,12 +319,8 @@ const example = extrude(10, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Horizontal",
|
||||
@ -705,12 +330,8 @@ const example = extrude(10, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "AngledLineTo",
|
||||
@ -722,16 +343,30 @@ const example = extrude(10, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: 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?: TagDeclarator) -> SketchGroup
|
||||
yLine(length: number, sketch_group: SketchGroup, tag?: String) -> SketchGroup
|
||||
```
|
||||
|
||||
### Examples
|
||||
@ -34,6 +34,8 @@ 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).
|
||||
@ -69,184 +71,12 @@ const example = extrude(10, exampleSketch)
|
||||
},
|
||||
} |
|
||||
{
|
||||
// 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.
|
||||
// the face id the sketch is on
|
||||
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,32 +99,25 @@ 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 tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: 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 name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "ToPoint",
|
||||
@ -306,12 +129,8 @@ const example = extrude(10, exampleSketch)
|
||||
center: [number, number],
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArcTo",
|
||||
@ -319,12 +138,8 @@ const example = extrude(10, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArc",
|
||||
@ -332,12 +147,8 @@ const example = extrude(10, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Horizontal",
|
||||
@ -347,12 +158,8 @@ const example = extrude(10, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "AngledLineTo",
|
||||
@ -364,32 +171,41 @@ const example = extrude(10, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: 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,
|
||||
}
|
||||
```
|
||||
* `tag`: `String` (OPTIONAL)
|
||||
|
||||
### 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).
|
||||
@ -425,184 +241,12 @@ const example = extrude(10, exampleSketch)
|
||||
},
|
||||
} |
|
||||
{
|
||||
// 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.
|
||||
// the face id the sketch is on
|
||||
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,
|
||||
@ -625,32 +269,25 @@ 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 tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: 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 name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "ToPoint",
|
||||
@ -662,12 +299,8 @@ const example = extrude(10, exampleSketch)
|
||||
center: [number, number],
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArcTo",
|
||||
@ -675,12 +308,8 @@ const example = extrude(10, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArc",
|
||||
@ -688,12 +317,8 @@ const example = extrude(10, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Horizontal",
|
||||
@ -703,12 +328,8 @@ const example = extrude(10, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "AngledLineTo",
|
||||
@ -720,16 +341,30 @@ const example = extrude(10, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: 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?: TagDeclarator) -> SketchGroup
|
||||
yLineTo(to: number, sketch_group: SketchGroup, tag?: String) -> SketchGroup
|
||||
```
|
||||
|
||||
### Examples
|
||||
@ -32,6 +32,8 @@ 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).
|
||||
@ -67,184 +69,12 @@ const example = extrude(5, exampleSketch)
|
||||
},
|
||||
} |
|
||||
{
|
||||
// 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.
|
||||
// the face id the sketch is on
|
||||
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,32 +97,25 @@ 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 tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: 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 name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "ToPoint",
|
||||
@ -304,12 +127,8 @@ const example = extrude(5, exampleSketch)
|
||||
center: [number, number],
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArcTo",
|
||||
@ -317,12 +136,8 @@ const example = extrude(5, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArc",
|
||||
@ -330,12 +145,8 @@ const example = extrude(5, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Horizontal",
|
||||
@ -345,12 +156,8 @@ const example = extrude(5, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "AngledLineTo",
|
||||
@ -362,32 +169,41 @@ const example = extrude(5, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: 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,
|
||||
}
|
||||
```
|
||||
* `tag`: `String` (OPTIONAL)
|
||||
|
||||
### 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).
|
||||
@ -423,184 +239,12 @@ const example = extrude(5, exampleSketch)
|
||||
},
|
||||
} |
|
||||
{
|
||||
// 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.
|
||||
// the face id the sketch is on
|
||||
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,
|
||||
@ -623,32 +267,25 @@ 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 tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: 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 name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "ToPoint",
|
||||
@ -660,12 +297,8 @@ const example = extrude(5, exampleSketch)
|
||||
center: [number, number],
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArcTo",
|
||||
@ -673,12 +306,8 @@ const example = extrude(5, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "TangentialArc",
|
||||
@ -686,12 +315,8 @@ const example = extrude(5, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "Horizontal",
|
||||
@ -701,12 +326,8 @@ const example = extrude(5, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: string,
|
||||
// The to point.
|
||||
to: [number, number],
|
||||
type: "AngledLineTo",
|
||||
@ -718,16 +339,30 @@ const example = extrude(5, exampleSketch)
|
||||
{
|
||||
// The from point.
|
||||
from: [number, number],
|
||||
// The tag of the path.
|
||||
tag: {
|
||||
end: number,
|
||||
start: number,
|
||||
value: string,
|
||||
},
|
||||
// The name of the path.
|
||||
name: 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,9 +91,8 @@ 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')
|
||||
@ -331,7 +330,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
|
||||
@ -387,8 +386,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(
|
||||
@ -406,16 +405,17 @@ test('Draft segments should look right', async ({ page, context }) => {
|
||||
// select a plane
|
||||
await page.mouse.click(700, 200)
|
||||
|
||||
let code = `const sketch001 = startSketchOn('XZ')`
|
||||
await expect(page.locator('.cm-content')).toHaveText(code)
|
||||
await expect(page.locator('.cm-content')).toHaveText(
|
||||
`const sketch001 = startSketchOn('XZ')`
|
||||
)
|
||||
|
||||
await page.waitForTimeout(700) // TODO detect animation ending, or disable animation
|
||||
await page.waitForTimeout(300) // TODO detect animation ending, or disable animation
|
||||
|
||||
const startXPx = 600
|
||||
await page.mouse.click(startXPx + PUR * 10, 500 - PUR * 10)
|
||||
code += `
|
||||
|> startProfileAt([7.19, -9.7], %)`
|
||||
await expect(page.locator('.cm-content')).toHaveText(code)
|
||||
await expect(page.locator('.cm-content'))
|
||||
.toHaveText(`const sketch001 = startSketchOn('XZ')
|
||||
|> startProfileAt([9.06, -12.22], %)`)
|
||||
await page.waitForTimeout(100)
|
||||
|
||||
await u.closeDebugPanel()
|
||||
@ -427,9 +427,10 @@ test('Draft segments should look right', async ({ page, context }) => {
|
||||
await page.mouse.click(startXPx + PUR * 20, 500 - PUR * 10)
|
||||
await page.waitForTimeout(100)
|
||||
|
||||
code += `
|
||||
|> line([7.25, 0], %)`
|
||||
await expect(page.locator('.cm-content')).toHaveText(code)
|
||||
await expect(page.locator('.cm-content'))
|
||||
.toHaveText(`const sketch001 = startSketchOn('XZ')
|
||||
|> startProfileAt([9.06, -12.22], %)
|
||||
|> line([9.14, 0], %)`)
|
||||
|
||||
await page.getByRole('button', { name: 'Tangential Arc' }).click()
|
||||
|
||||
@ -444,7 +445,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()
|
||||
|
||||
@ -491,7 +492,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()
|
||||
|
||||
@ -512,16 +513,17 @@ test.describe('Client side scene scale should match engine scale', () => {
|
||||
// select a plane
|
||||
await page.mouse.click(700, 200)
|
||||
|
||||
let code = `const sketch001 = startSketchOn('XZ')`
|
||||
await expect(page.locator('.cm-content')).toHaveText(code)
|
||||
await expect(page.locator('.cm-content')).toHaveText(
|
||||
`const sketch001 = startSketchOn('XZ')`
|
||||
)
|
||||
|
||||
await page.waitForTimeout(600) // TODO detect animation ending, or disable animation
|
||||
await page.waitForTimeout(300) // TODO detect animation ending, or disable animation
|
||||
|
||||
const startXPx = 600
|
||||
await page.mouse.click(startXPx + PUR * 10, 500 - PUR * 10)
|
||||
code += `
|
||||
|> startProfileAt([7.19, -9.7], %)`
|
||||
await expect(u.codeLocator).toHaveText(code)
|
||||
await expect(page.locator('.cm-content'))
|
||||
.toHaveText(`const sketch001 = startSketchOn('XZ')
|
||||
|> startProfileAt([9.06, -12.22], %)`)
|
||||
await page.waitForTimeout(100)
|
||||
|
||||
await u.closeDebugPanel()
|
||||
@ -529,18 +531,21 @@ test.describe('Client side scene scale should match engine scale', () => {
|
||||
await page.mouse.click(startXPx + PUR * 20, 500 - PUR * 10)
|
||||
await page.waitForTimeout(100)
|
||||
|
||||
code += `
|
||||
|> line([7.25, 0], %)`
|
||||
await expect(u.codeLocator).toHaveText(code)
|
||||
await expect(page.locator('.cm-content'))
|
||||
.toHaveText(`const sketch001 = startSketchOn('XZ')
|
||||
|> startProfileAt([9.06, -12.22], %)
|
||||
|> line([9.14, 0], %)`)
|
||||
|
||||
await page.getByRole('button', { name: 'Tangential Arc' }).click()
|
||||
await page.waitForTimeout(100)
|
||||
|
||||
await page.mouse.click(startXPx + PUR * 30, 500 - PUR * 20)
|
||||
|
||||
code += `
|
||||
|> tangentialArcTo([21.7, -2.44], %)`
|
||||
await expect(u.codeLocator).toHaveText(code)
|
||||
await expect(page.locator('.cm-content'))
|
||||
.toHaveText(`const sketch001 = startSketchOn('XZ')
|
||||
|> startProfileAt([9.06, -12.22], %)
|
||||
|> line([9.14, 0], %)
|
||||
|> tangentialArcTo([27.34, -3.08], %)`)
|
||||
|
||||
// click tangential arc tool again to unequip it
|
||||
await page.getByRole('button', { name: 'Tangential Arc' }).click()
|
||||
@ -590,7 +595,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()
|
||||
|
||||
@ -611,16 +616,17 @@ test.describe('Client side scene scale should match engine scale', () => {
|
||||
// select a plane
|
||||
await page.mouse.click(700, 200)
|
||||
|
||||
let code = `const sketch001 = startSketchOn('XZ')`
|
||||
await expect(u.codeLocator).toHaveText(code)
|
||||
await expect(page.locator('.cm-content')).toHaveText(
|
||||
`const sketch001 = startSketchOn('XZ')`
|
||||
)
|
||||
|
||||
await page.waitForTimeout(600) // TODO detect animation ending, or disable animation
|
||||
await page.waitForTimeout(300) // TODO detect animation ending, or disable animation
|
||||
|
||||
const startXPx = 600
|
||||
await page.mouse.click(startXPx + PUR * 10, 500 - PUR * 10)
|
||||
code += `
|
||||
|> startProfileAt([182.59, -246.32], %)`
|
||||
await expect(u.codeLocator).toHaveText(code)
|
||||
await expect(page.locator('.cm-content'))
|
||||
.toHaveText(`const sketch001 = startSketchOn('XZ')
|
||||
|> startProfileAt([230.03, -310.32], %)`)
|
||||
await page.waitForTimeout(100)
|
||||
|
||||
await u.closeDebugPanel()
|
||||
@ -628,18 +634,21 @@ test.describe('Client side scene scale should match engine scale', () => {
|
||||
await page.mouse.click(startXPx + PUR * 20, 500 - PUR * 10)
|
||||
await page.waitForTimeout(100)
|
||||
|
||||
code += `
|
||||
|> line([184.3, 0], %)`
|
||||
await expect(u.codeLocator).toHaveText(code)
|
||||
await expect(page.locator('.cm-content'))
|
||||
.toHaveText(`const sketch001 = startSketchOn('XZ')
|
||||
|> startProfileAt([230.03, -310.32], %)
|
||||
|> line([232.2, 0], %)`)
|
||||
|
||||
await page.getByRole('button', { name: 'Tangential Arc' }).click()
|
||||
await page.waitForTimeout(100)
|
||||
|
||||
await page.mouse.click(startXPx + PUR * 30, 500 - PUR * 20)
|
||||
|
||||
code += `
|
||||
|> tangentialArcTo([551.2, -62.01], %)`
|
||||
await expect(u.codeLocator).toHaveText(code)
|
||||
await expect(page.locator('.cm-content'))
|
||||
.toHaveText(`const sketch001 = startSketchOn('XZ')
|
||||
|> startProfileAt([230.03, -310.32], %)
|
||||
|> line([232.2, 0], %)
|
||||
|> tangentialArcTo([694.43, -78.12], %)`)
|
||||
|
||||
await page.getByRole('button', { name: 'Tangential Arc' }).click()
|
||||
await page.waitForTimeout(100)
|
||||
@ -690,7 +699,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()
|
||||
@ -740,7 +749,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()
|
||||
@ -777,7 +786,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()
|
||||
@ -796,83 +805,3 @@ 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: 42 KiB After Width: | Height: | Size: 41 KiB |
|
Before Width: | Height: | Size: 43 KiB After Width: | Height: | Size: 42 KiB |
|
Before Width: | Height: | Size: 49 KiB After Width: | Height: | Size: 47 KiB |
|
Before Width: | Height: | Size: 44 KiB After Width: | Height: | Size: 43 KiB |
|
Before Width: | Height: | Size: 32 KiB After Width: | Height: | Size: 28 KiB |
|
Before Width: | Height: | Size: 35 KiB After Width: | Height: | Size: 31 KiB |
|
Before Width: | Height: | Size: 38 KiB After Width: | Height: | Size: 34 KiB |
|
Before Width: | Height: | Size: 13 KiB |
|
Before Width: | Height: | Size: 29 KiB |
|
Before Width: | Height: | Size: 71 KiB After Width: | Height: | Size: 66 KiB |
|
Before Width: | Height: | Size: 43 KiB After Width: | Height: | Size: 71 KiB |
|
Before Width: | Height: | Size: 61 KiB After Width: | Height: | Size: 75 KiB |
|
Before Width: | Height: | Size: 29 KiB After Width: | Height: | Size: 43 KiB |
|
Before Width: | Height: | Size: 32 KiB After Width: | Height: | Size: 45 KiB |
|
Before Width: | Height: | Size: 32 KiB After Width: | Height: | Size: 43 KiB |
|
Before Width: | Height: | Size: 31 KiB After Width: | Height: | Size: 46 KiB |
|
Before Width: | Height: | Size: 35 KiB After Width: | Height: | Size: 47 KiB |
|
Before Width: | Height: | Size: 29 KiB After Width: | Height: | Size: 42 KiB |
@ -1,6 +1,5 @@
|
||||
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 = {
|
||||
@ -23,22 +22,9 @@ 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: onboardingPaths.EXPORT },
|
||||
} satisfies Partial<SaveSettingsPayload>
|
||||
|
||||
export const TEST_SETTINGS_ONBOARDING_PARAMETRIC_MODELING = {
|
||||
...TEST_SETTINGS,
|
||||
app: {
|
||||
...TEST_SETTINGS.app,
|
||||
onboardingStatus: onboardingPaths.PARAMETRIC_MODELING,
|
||||
},
|
||||
app: { ...TEST_SETTINGS.app, onboardingStatus: '/export' },
|
||||
} satisfies Partial<SaveSettingsPayload>
|
||||
|
||||
export const TEST_SETTINGS_ONBOARDING_START = {
|
||||
|
||||
@ -8,13 +8,6 @@ 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()
|
||||
@ -45,8 +38,8 @@ async function clearCommandLogs(page: Page) {
|
||||
await page.getByTestId('clear-commands').click()
|
||||
}
|
||||
|
||||
async function expectCmdLog(page: Page, locatorStr: string, timeout = 5000) {
|
||||
await expect(page.locator(locatorStr).last()).toBeVisible({ timeout })
|
||||
async function expectCmdLog(page: Page, locatorStr: string) {
|
||||
await expect(page.locator(locatorStr).last()).toBeVisible()
|
||||
}
|
||||
|
||||
async function waitForDefaultPlanesToBeVisible(page: Page) {
|
||||
@ -114,45 +107,19 @@ export const wiggleMove = async (
|
||||
dist: number,
|
||||
ang: number,
|
||||
amplitude: number,
|
||||
freq: number,
|
||||
locator?: string
|
||||
freq: number
|
||||
) => {
|
||||
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 })
|
||||
await page.mouse.move(x + xr, y + yr, { steps: 2 })
|
||||
}
|
||||
}
|
||||
|
||||
@ -165,8 +132,8 @@ export const getMovementUtils = (opts: any) => {
|
||||
// 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
|
||||
kcRound(x * 0.0854),
|
||||
kcRound(-y * 0.0854), // Y is inverted in our coordinate system
|
||||
]
|
||||
|
||||
// Turn the array into a string with specific formatting
|
||||
@ -177,11 +144,11 @@ export const getMovementUtils = (opts: any) => {
|
||||
|
||||
// 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 })
|
||||
opts.page.mouse.click(opts.center.x + x, opts.center.y + y)
|
||||
|
||||
// Relative clicker, must keep state
|
||||
let last = { x: 0, y: 0 }
|
||||
const click00r = async (x?: number, y?: number) => {
|
||||
const click00r = (x?: number, y?: number) => {
|
||||
// reset relative coordinates when anything is undefined
|
||||
if (x === undefined || y === undefined) {
|
||||
last.x = 0
|
||||
@ -189,41 +156,17 @@ export const getMovementUtils = (opts: any) => {
|
||||
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)
|
||||
const ret = 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 ret.then(() => [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()
|
||||
@ -231,8 +174,7 @@ export async function getUtils(page: Page) {
|
||||
browserType !== 'chromium' ? null : await page.context().newCDPSession(page)
|
||||
|
||||
return {
|
||||
waitForAuthSkipAppStart: () => waitForAuthAndLsp(page),
|
||||
waitForPageLoad: () => waitForPageLoad(page),
|
||||
waitForAuthSkipAppStart: () => waitForPageLoad(page),
|
||||
removeCurrentCode: () => removeCurrentCode(page),
|
||||
sendCustomCmd: (cmd: EngineCommand) => sendCustomCmd(page, cmd),
|
||||
updateCamPosition: async (xyz: [number, number, number]) => {
|
||||
@ -246,8 +188,7 @@ export async function getUtils(page: Page) {
|
||||
await fillInput('z', xyz[2])
|
||||
},
|
||||
clearCommandLogs: () => clearCommandLogs(page),
|
||||
expectCmdLog: (locatorStr: string, timeout = 5000) =>
|
||||
expectCmdLog(page, locatorStr, timeout),
|
||||
expectCmdLog: (locatorStr: string) => expectCmdLog(page, locatorStr),
|
||||
openKclCodePanel: () => openKclCodePanel(page),
|
||||
closeKclCodePanel: () => closeKclCodePanel(page),
|
||||
openDebugPanel: () => openDebugPanel(page),
|
||||
@ -285,7 +226,6 @@ export async function getUtils(page: Page) {
|
||||
.boundingBox()
|
||||
.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,
|
||||
@ -319,19 +259,11 @@ export async function getUtils(page: Page) {
|
||||
(screenshot.width * coords.y * pixMultiplier +
|
||||
coords.x * pixMultiplier) *
|
||||
4 // rbga is 4 channels
|
||||
const maxDiff = Math.max(
|
||||
return 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) => {
|
||||
|
||||
@ -2,7 +2,6 @@ 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')
|
||||
@ -16,8 +15,25 @@ const newProjectDir = path.join(documentsDir, 'a-different-directory')
|
||||
const tmp = process.env.TEMP || '/tmp'
|
||||
const userCodeDir = path.join(tmp, 'kittycad_user_code')
|
||||
|
||||
describe('ZMA sign in flow', () => {
|
||||
before(async () => {
|
||||
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 () => {
|
||||
// Clean up filesystem from previous tests
|
||||
await new Promise((resolve) => setTimeout(resolve, 100))
|
||||
await fs.rm(defaultProjectDir, { force: true, recursive: true })
|
||||
@ -26,9 +42,7 @@ describe('ZMA sign in flow', () => {
|
||||
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')
|
||||
|
||||
@ -68,10 +82,6 @@ describe('ZMA sign in flow', () => {
|
||||
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"]')
|
||||
@ -140,9 +150,7 @@ describe('ZMA authorized user flows', () => {
|
||||
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"]')
|
||||
@ -1,18 +0,0 @@
|
||||
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)
|
||||
}
|
||||
3
examples/addition.cado
Normal file
@ -0,0 +1,3 @@
|
||||
// comment
|
||||
|
||||
const hi = 5 + 4
|
||||
62
flake.lock
generated
@ -1,62 +0,0 @@
|
||||
{
|
||||
"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
@ -1,70 +0,0 @@
|
||||
{
|
||||
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";
|
||||
};
|
||||
});
|
||||
};
|
||||
}
|
||||
82
package.json
@ -1,43 +1,49 @@
|
||||
{
|
||||
"name": "untitled-app",
|
||||
"version": "0.23.1",
|
||||
"version": "0.22.1",
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"@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",
|
||||
"@codemirror/autocomplete": "^6.16.0",
|
||||
"@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.69",
|
||||
"@kittycad/lib": "^0.0.64",
|
||||
"@lezer/javascript": "^1.4.9",
|
||||
"@open-rpc/client-js": "^1.8.1",
|
||||
"@react-hook/resize-observer": "^2.0.1",
|
||||
"@replit/codemirror-interact": "^6.3.1",
|
||||
"@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",
|
||||
"@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",
|
||||
"@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",
|
||||
"codemirror": "^6.0.1",
|
||||
"crypto-js": "^4.2.0",
|
||||
"debounce-promise": "^3.1.2",
|
||||
"decamelize": "^6.0.0",
|
||||
"formik": "^2.4.6",
|
||||
"fuse.js": "^7.0.0",
|
||||
"html2canvas-pro": "^1.5.2",
|
||||
"html2canvas-pro": "^1.4.3",
|
||||
"http-server": "^14.1.1",
|
||||
"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",
|
||||
@ -48,15 +54,20 @@
|
||||
"react-modal-promise": "^1.0.2",
|
||||
"react-router-dom": "^6.23.1",
|
||||
"sketch-helpers": "^0.0.4",
|
||||
"three": "^0.166.1",
|
||||
"swr": "^2.2.5",
|
||||
"three": "^0.164.1",
|
||||
"ts-node": "^10.9.2",
|
||||
"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",
|
||||
"vscode-uri": "^3.0.8",
|
||||
"wasm-pack": "^0.12.1",
|
||||
"web-vitals": "^3.5.2",
|
||||
"xstate": "^4.38.2"
|
||||
"ws": "^8.17.0",
|
||||
"xstate": "^4.38.2",
|
||||
"zustand": "^4.5.2"
|
||||
},
|
||||
"scripts": {
|
||||
"start": "vite",
|
||||
@ -73,11 +84,11 @@
|
||||
"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 ./packages",
|
||||
"fmt-check": "prettier --check ./src *.ts *.json *.js ./e2e ./packages",
|
||||
"fmt": "prettier --write ./src *.ts *.json *.js ./e2e",
|
||||
"fmt-check": "prettier --check ./src *.ts *.json *.js ./e2e",
|
||||
"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 --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": "(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-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",
|
||||
@ -109,16 +120,13 @@
|
||||
"@babel/plugin-proposal-private-property-in-object": "^7.21.11",
|
||||
"@babel/preset-env": "^7.24.3",
|
||||
"@iarna/toml": "^2.2.5",
|
||||
"@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",
|
||||
"@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",
|
||||
"@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",
|
||||
@ -138,27 +146,21 @@
|
||||
"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.8",
|
||||
"prettier": "^2.8.0",
|
||||
"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
@ -1,6 +0,0 @@
|
||||
node_modules
|
||||
build
|
||||
dist
|
||||
tsconfig.tsbuildinfo
|
||||
*.d.ts
|
||||
*.js
|
||||
@ -1,35 +0,0 @@
|
||||
{
|
||||
"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,13 +0,0 @@
|
||||
import { Message } from 'vscode-languageserver-protocol'
|
||||
|
||||
export default class Tracer {
|
||||
static client(message: string): void {
|
||||
console.log('lsp client message', message)
|
||||
}
|
||||
|
||||
static server(input: string | Message): void {
|
||||
const message: string =
|
||||
typeof input === 'string' ? input : JSON.stringify(input)
|
||||
console.log('lsp server message', message)
|
||||
}
|
||||
}
|
||||
@ -1,57 +0,0 @@
|
||||
import { foldService } from '@codemirror/language'
|
||||
import { Extension, EditorState } from '@codemirror/state'
|
||||
import { ViewPlugin } from '@codemirror/view'
|
||||
|
||||
import {
|
||||
docPathFacet,
|
||||
LanguageServerPlugin,
|
||||
LanguageServerPluginSpec,
|
||||
languageId,
|
||||
workspaceFolders,
|
||||
LanguageServerOptions,
|
||||
} from './plugin/lsp'
|
||||
|
||||
export type { LanguageServerClientOptions } from './client'
|
||||
export { LanguageServerClient } from './client'
|
||||
export {
|
||||
Codec,
|
||||
FromServer,
|
||||
IntoServer,
|
||||
LspWorkerEventType,
|
||||
} from './client/codec'
|
||||
export type { LanguageServerOptions } from './plugin/lsp'
|
||||
export {
|
||||
LanguageServerPlugin,
|
||||
LanguageServerPluginSpec,
|
||||
docPathFacet,
|
||||
languageId,
|
||||
workspaceFolders,
|
||||
lspSemanticTokensEvent,
|
||||
lspDiagnosticsEvent,
|
||||
lspFormatCodeEvent,
|
||||
} from './plugin/lsp'
|
||||
export { posToOffset, offsetToPos } from './plugin/util'
|
||||
|
||||
export function lspPlugin(options: LanguageServerOptions): Extension {
|
||||
let plugin: LanguageServerPlugin | null = null
|
||||
const viewPlugin = ViewPlugin.define(
|
||||
(view) => (plugin = new LanguageServerPlugin(options, view)),
|
||||
new LanguageServerPluginSpec()
|
||||
)
|
||||
|
||||
let ext = [
|
||||
docPathFacet.of(options.documentUri),
|
||||
languageId.of('kcl'),
|
||||
workspaceFolders.of(options.workspaceFolders),
|
||||
viewPlugin,
|
||||
foldService.of((state: EditorState, lineStart: number, lineEnd: number) => {
|
||||
if (plugin == null) return null
|
||||
// Get the folding ranges from the language server.
|
||||
// Since this is async we directly need to update the folding ranges after.
|
||||
const range = plugin?.foldingRange(lineStart, lineEnd)
|
||||
return range
|
||||
}),
|
||||
]
|
||||
|
||||
return ext
|
||||
}
|
||||
@ -1,112 +0,0 @@
|
||||
import {
|
||||
acceptCompletion,
|
||||
autocompletion,
|
||||
clearSnippet,
|
||||
closeCompletion,
|
||||
hasNextSnippetField,
|
||||
moveCompletionSelection,
|
||||
nextSnippetField,
|
||||
prevSnippetField,
|
||||
startCompletion,
|
||||
} from '@codemirror/autocomplete'
|
||||
import { Prec, Extension } from '@codemirror/state'
|
||||
import { EditorView, keymap, KeyBinding, ViewPlugin } from '@codemirror/view'
|
||||
|
||||
import {
|
||||
CompletionItemKind,
|
||||
CompletionTriggerKind,
|
||||
} from 'vscode-languageserver-protocol'
|
||||
|
||||
import { LanguageServerPlugin } from './lsp'
|
||||
import { offsetToPos } from './util'
|
||||
import { syntaxTree } from '@codemirror/language'
|
||||
|
||||
export const CompletionItemKindMap = Object.fromEntries(
|
||||
Object.entries(CompletionItemKind).map(([key, value]) => [value, key])
|
||||
) as Record<CompletionItemKind, string>
|
||||
|
||||
const lspAutocompleteKeymap: readonly KeyBinding[] = [
|
||||
{ key: 'Ctrl-Space', run: startCompletion },
|
||||
{
|
||||
key: 'Escape',
|
||||
run: (view: EditorView): boolean => {
|
||||
if (clearSnippet(view)) return true
|
||||
|
||||
return closeCompletion(view)
|
||||
},
|
||||
},
|
||||
{ key: 'ArrowDown', run: moveCompletionSelection(true) },
|
||||
{ key: 'ArrowUp', run: moveCompletionSelection(false) },
|
||||
{ key: 'PageDown', run: moveCompletionSelection(true, 'page') },
|
||||
{ key: 'PageUp', run: moveCompletionSelection(false, 'page') },
|
||||
{ key: 'Enter', run: acceptCompletion },
|
||||
{
|
||||
key: 'Tab',
|
||||
run: (view: EditorView): boolean => {
|
||||
if (hasNextSnippetField(view.state)) {
|
||||
const result = nextSnippetField(view)
|
||||
return result
|
||||
}
|
||||
|
||||
return acceptCompletion(view)
|
||||
},
|
||||
shift: prevSnippetField,
|
||||
},
|
||||
]
|
||||
|
||||
const lspAutocompleteKeymapExt = Prec.highest(keymap.of(lspAutocompleteKeymap))
|
||||
|
||||
export default function lspAutocompleteExt(
|
||||
plugin: ViewPlugin<LanguageServerPlugin>
|
||||
): Extension {
|
||||
return [
|
||||
lspAutocompleteKeymapExt,
|
||||
autocompletion({
|
||||
defaultKeymap: false,
|
||||
override: [
|
||||
async (context) => {
|
||||
const { state, pos, explicit, view } = context
|
||||
let value = view?.plugin(plugin)
|
||||
if (!value) return null
|
||||
|
||||
let nodeBefore = syntaxTree(state).resolveInner(pos, -1)
|
||||
if (
|
||||
nodeBefore.name === 'BlockComment' ||
|
||||
nodeBefore.name === 'LineComment'
|
||||
)
|
||||
return null
|
||||
|
||||
const line = state.doc.lineAt(pos)
|
||||
let trigKind: CompletionTriggerKind = CompletionTriggerKind.Invoked
|
||||
let trigChar: string | undefined
|
||||
if (
|
||||
!explicit &&
|
||||
value.client
|
||||
.getServerCapabilities()
|
||||
.completionProvider?.triggerCharacters?.includes(
|
||||
line.text[pos - line.from - 1]
|
||||
)
|
||||
) {
|
||||
trigKind = CompletionTriggerKind.TriggerCharacter
|
||||
trigChar = line.text[pos - line.from - 1]
|
||||
}
|
||||
if (
|
||||
trigKind === CompletionTriggerKind.Invoked &&
|
||||
!context.matchBefore(/\w+$/)
|
||||
) {
|
||||
return null
|
||||
}
|
||||
|
||||
return await value.requestCompletion(
|
||||
context,
|
||||
offsetToPos(state.doc, pos),
|
||||
{
|
||||
triggerKind: trigKind,
|
||||
triggerCharacter: trigChar,
|
||||
}
|
||||
)
|
||||
},
|
||||
],
|
||||
}),
|
||||
]
|
||||
}
|
||||
@ -1,27 +0,0 @@
|
||||
import { Extension, Prec } from '@codemirror/state'
|
||||
import { EditorView, keymap, KeyBinding, ViewPlugin } from '@codemirror/view'
|
||||
|
||||
import { LanguageServerPlugin } from './lsp'
|
||||
|
||||
export default function lspFormatExt(
|
||||
plugin: ViewPlugin<LanguageServerPlugin>
|
||||
): Extension {
|
||||
const formatKeymap: readonly KeyBinding[] = [
|
||||
{
|
||||
key: 'Alt-Shift-f',
|
||||
run: (view: EditorView) => {
|
||||
let value = view.plugin(plugin)
|
||||
if (!value) return false
|
||||
value.requestFormatting()
|
||||
return true
|
||||
},
|
||||
},
|
||||
]
|
||||
|
||||
// Create an extension for the key mappings.
|
||||
const formatKeymapExt = Prec.highest(
|
||||
keymap.computeN([], () => [formatKeymap])
|
||||
)
|
||||
|
||||
return formatKeymapExt
|
||||
}
|
||||
@ -1,22 +0,0 @@
|
||||
import { Extension } from '@codemirror/state'
|
||||
import { hoverTooltip, tooltips, ViewPlugin } from '@codemirror/view'
|
||||
|
||||
import { LanguageServerPlugin } from './lsp'
|
||||
import { offsetToPos } from './util'
|
||||
|
||||
export default function lspHoverExt(
|
||||
plugin: ViewPlugin<LanguageServerPlugin>
|
||||
): Extension {
|
||||
return [
|
||||
hoverTooltip((view, pos) => {
|
||||
const value = view.plugin(plugin)
|
||||
return (
|
||||
value?.requestHoverTooltip(view, offsetToPos(view.state.doc, pos)) ??
|
||||
null
|
||||
)
|
||||
}),
|
||||
tooltips({
|
||||
position: 'absolute',
|
||||
}),
|
||||
]
|
||||
}
|
||||