Compare commits

..

37 Commits

Author SHA1 Message Date
b090f9959b fix macos 2024-06-03 11:49:46 +10:00
37f0f7b568 refactor test utils into test-utils 2024-06-03 09:56:18 +10:00
08c1745be0 fmt 2024-05-31 12:25:47 -04:00
a157dfe6d7 fmt 2024-05-31 12:22:19 -04:00
80b6688d04 A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu) 2024-05-31 16:12:59 +00:00
b7b87a38c4 fmt 2024-05-31 12:10:11 -04:00
ab56a165a4 Bump to 2 workers 2024-05-31 12:06:18 -04:00
9bcc307f32 Fix flakiness in for segments tests 2024-05-31 10:17:59 -04:00
5a3c6a3858 Fix tests unrelated to this PR 2024-05-31 10:16:21 -04:00
280f08945c ci again 2024-05-31 10:15:17 -04:00
e9fb3f7256 A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu) 2024-05-31 10:15:15 -04:00
56f0c43e4e Correct a vitest 2024-05-31 10:14:49 -04:00
4f9e8cbe15 Please the Playwright. Praise the Playwright. 2024-05-31 10:14:49 -04:00
0f21ca90c8 Add new instructions on running Playwright anywhere 2024-05-31 10:14:49 -04:00
c0bed02d72 Remove unused variables 2024-05-31 10:14:49 -04:00
3ab33e3810 run ci pls again 2024-05-31 10:14:49 -04:00
27ba89f867 A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu) 2024-05-31 10:14:49 -04:00
c52e4dcbe6 run ci pls 2024-05-31 10:14:49 -04:00
791c0487ae run ci pls 2024-05-31 10:14:49 -04:00
bd9c02fde9 A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu) 2024-05-31 10:14:49 -04:00
cda70687f4 Incorporate ping health; yarn make:dev; faster video stream loss notice 2024-05-31 10:14:49 -04:00
a7d785ab88 Fix typing 2024-05-31 10:14:49 -04:00
16a64b55db fmt 2024-05-31 10:14:49 -04:00
343ed04f7d wip 2024-05-31 10:14:49 -04:00
66ddce1348 wip 2024-05-31 10:14:49 -04:00
fade3b3995 Fix tsc 2024-05-31 10:14:49 -04:00
8e7465a823 Revert awaiting on lsp failure 2024-05-31 10:14:49 -04:00
05521d3ef3 Fix up types 2024-05-31 10:14:49 -04:00
37df4c6fc9 Fix formatting 2024-05-31 10:14:49 -04:00
db08e67215 Show when authentication is bad (cookie header only) 2024-05-31 10:14:49 -04:00
32f2411394 Catch LSP errors on bad auth 2024-05-31 10:14:49 -04:00
cc0377bb00 Don't do any stream events if network is not ok 2024-05-31 10:14:49 -04:00
ff08cef9f8 Refactor to use Context API for network status 2024-05-31 10:14:49 -04:00
39a6d265f2 Remove unused variable 2024-05-31 10:14:49 -04:00
545e89f7aa Add new error states to network status notification 2024-05-31 10:14:49 -04:00
d6ae23d881 Fix build errors 2024-05-31 10:14:49 -04:00
25b599d3e7 Reapply "Add ping pong health, remove a timeout interval, fix up netwo… (#1771)
This reverts commit 1913519f68.
2024-05-31 10:14:49 -04:00
321 changed files with 41231 additions and 150612 deletions

View File

@ -1,3 +1,3 @@
[codespell] [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 skip: **/target,node_modules,build,**/Cargo.lock,./docs/kcl/*.md,./src-tauri/gen/schemas

1
.envrc
View File

@ -1 +0,0 @@
use flake .

View File

@ -4,8 +4,7 @@
"project": "./tsconfig.json" "project": "./tsconfig.json"
}, },
"plugins": [ "plugins": [
"css-modules", "css-modules"
"suggest-no-throw",
], ],
"extends": [ "extends": [
"react-app", "react-app",
@ -18,7 +17,6 @@
"never" "never"
], ],
"react-hooks/exhaustive-deps": "off", "react-hooks/exhaustive-deps": "off",
"suggest-no-throw/suggest-no-throw": "warn",
}, },
"overrides": [ "overrides": [
{ {
@ -27,12 +25,6 @@
"@typescript-eslint/no-floating-promises": "warn", "@typescript-eslint/no-floating-promises": "warn",
"testing-library/prefer-screen-queries": "off" "testing-library/prefer-screen-queries": "off"
} }
},
{
"files": ["src/**/*.test.ts"],
"rules": {
"suggest-no-throw/suggest-no-throw": "off",
}
} }
] ]
} }

View File

@ -38,7 +38,5 @@ jobs:
- name: Benchmark kcl library - name: Benchmark kcl library
shell: bash shell: bash
run: |- run: |-
cd src/wasm-lib/kcl; cargo bench --all-features -- iai cd src/wasm-lib/kcl; cargo bench -- iai
env:
KITTYCAD_API_TOKEN: ${{secrets.KITTYCAD_API_TOKEN}}

View File

@ -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

View File

@ -9,12 +9,6 @@ on:
- '**.rs' - '**.rs'
- .github/workflows/cargo-clippy.yml - .github/workflows/cargo-clippy.yml
pull_request: pull_request:
paths:
- '**/Cargo.toml'
- '**/Cargo.lock'
- '**/rust-toolchain.toml'
- '**.rs'
- .github/workflows/cargo-clippy.yml
concurrency: concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true cancel-in-progress: true
@ -60,8 +54,3 @@ jobs:
run: | run: |
cd "${{ matrix.dir }}" cd "${{ matrix.dir }}"
cargo clippy --all --tests --benches -- -D warnings 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"

View File

@ -180,7 +180,9 @@ jobs:
- name: Setup Rust - name: Setup Rust
uses: dtolnay/rust-toolchain@stable uses: dtolnay/rust-toolchain@stable
# TODO: re-enable for Windows builds, see https://github.com/tauri-apps/tauri/issues/9045
- name: Setup Rust cache - name: Setup Rust cache
if: matrix.os != 'windows-latest'
uses: swatinem/rust-cache@v2 uses: swatinem/rust-cache@v2
with: with:
workspaces: './src-tauri -> target' workspaces: './src-tauri -> target'
@ -367,7 +369,7 @@ jobs:
export VITE_KC_API_BASE_URL export VITE_KC_API_BASE_URL
xvfb-run yarn test:e2e:tauri xvfb-run yarn test:e2e:tauri
env: env:
E2E_APPLICATION: "./src-tauri/target/${{ env.BUILD_RELEASE == 'true' && 'release' || 'debug' }}/app" E2E_APPLICATION: "./src-tauri/target/${{ env.BUILD_RELEASE == 'true' && 'release' || 'debug' }}/zoo-modeling-app"
KITTYCAD_API_TOKEN: ${{ env.BUILD_RELEASE == 'true' && secrets.KITTYCAD_API_TOKEN || secrets.KITTYCAD_API_TOKEN_DEV }} KITTYCAD_API_TOKEN: ${{ env.BUILD_RELEASE == 'true' && secrets.KITTYCAD_API_TOKEN || secrets.KITTYCAD_API_TOKEN_DEV }}
- name: Run e2e tests (windows only) - name: Run e2e tests (windows only)
@ -376,7 +378,7 @@ jobs:
cargo install tauri-driver --force cargo install tauri-driver --force
yarn wdio run wdio.conf.ts yarn wdio run wdio.conf.ts
env: env:
E2E_APPLICATION: ".\\src-tauri\\target\\${{ env.BUILD_RELEASE == 'true' && 'release' || 'debug' }}\\app.exe" E2E_APPLICATION: ".\\src-tauri\\target\\${{ env.BUILD_RELEASE == 'true' && 'release' || 'debug' }}\\Zoo Modeling App.exe"
KITTYCAD_API_TOKEN: ${{ env.BUILD_RELEASE == 'true' && secrets.KITTYCAD_API_TOKEN || secrets.KITTYCAD_API_TOKEN_DEV }} KITTYCAD_API_TOKEN: ${{ env.BUILD_RELEASE == 'true' && secrets.KITTYCAD_API_TOKEN || secrets.KITTYCAD_API_TOKEN_DEV }}
VITE_KC_API_BASE_URL: ${{ env.BUILD_RELEASE == 'true' && 'https://api.zoo.dev' || 'https://api.dev.zoo.dev' }} VITE_KC_API_BASE_URL: ${{ env.BUILD_RELEASE == 'true' && 'https://api.zoo.dev' || 'https://api.dev.zoo.dev' }}
E2E_TAURI_ENABLED: true E2E_TAURI_ENABLED: true

View File

@ -38,8 +38,6 @@ jobs:
runs-on: ubuntu-latest-8-cores runs-on: ubuntu-latest-8-cores
needs: check-rust-changes needs: check-rust-changes
steps: steps:
- name: Tune GitHub-hosted runner network
uses: smorimoto/tune-github-hosted-runner-network@v1
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- uses: actions/setup-node@v4 - uses: actions/setup-node@v4
with: with:
@ -48,18 +46,12 @@ jobs:
- uses: KittyCAD/action-install-cli@main - uses: KittyCAD/action-install-cli@main
- name: Install dependencies - name: Install dependencies
run: yarn run: yarn
- name: Cache Playwright Browsers
uses: actions/cache@v4
with:
path: |
~/.cache/ms-playwright/
key: ${{ runner.os }}-playwright-${{ hashFiles('yarn.lock') }}
- name: Install Playwright Browsers - name: Install Playwright Browsers
run: yarn playwright install --with-deps run: yarn playwright install --with-deps
- name: Download Wasm Cache - name: Download Wasm Cache
id: download-wasm id: download-wasm
if: needs.check-rust-changes.outputs.rust-changed == 'false' if: needs.check-rust-changes.outputs.rust-changed == 'false'
uses: dawidd6/action-download-artifact@v6 uses: dawidd6/action-download-artifact@v3
continue-on-error: true continue-on-error: true
with: with:
github_token: ${{secrets.GITHUB_TOKEN}} github_token: ${{secrets.GITHUB_TOKEN}}
@ -92,24 +84,26 @@ jobs:
- name: build web - name: build web
run: yarn build:local run: yarn build:local
- name: Run ubuntu/chrome snapshots - 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: env:
CI: true CI: true
token: ${{ secrets.KITTYCAD_API_TOKEN_DEV }} token: ${{ secrets.KITTYCAD_API_TOKEN_DEV }}
snapshottoken: ${{ secrets.KITTYCAD_API_TOKEN }} snapshottoken: ${{ secrets.KITTYCAD_API_TOKEN }}
- name: Clean up test-results - uses: actions/upload-artifact@v3
if: always() if: always()
continue-on-error: true with:
run: rm -r test-results name: playwright-report
path: playwright-report/
retention-days: 30
- name: check for changes - name: check for changes
id: git-check id: git-check
run: | run: |
git add . git add .
if git status | grep -q "Changes to be committed" if git status | grep -q "Changes to be committed"
then echo "modified=true" >> $GITHUB_OUTPUT then
else echo "modified=false" >> $GITHUB_OUTPUT echo "::set-output name=modified::true"
else
echo "::set-output name=modified::false"
fi fi
- name: Commit changes, if any - name: Commit changes, if any
if: steps.git-check.outputs.modified == 'true' if: steps.git-check.outputs.modified == 'true'
@ -125,63 +119,23 @@ jobs:
git commit -am "A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu)" || true git commit -am "A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu)" || true
git push git push
git push origin ${{ github.head_ref }} 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 - name: Run ubuntu/chrome flow
if: steps.retry.outputs.retried == 'false'
run: yarn playwright test --project="Google Chrome" e2e/playwright/flow-tests.spec.ts run: yarn playwright test --project="Google Chrome" e2e/playwright/flow-tests.spec.ts
env: env:
CI: true CI: true
token: ${{ secrets.KITTYCAD_API_TOKEN_DEV }} token: ${{ secrets.KITTYCAD_API_TOKEN_DEV }}
- uses: actions/upload-artifact@v4 - uses: actions/upload-artifact@v3
if: always() if: always()
with: with:
name: test-results-ubuntu-${{ github.sha }} name: playwright-report
path: test-results/
retention-days: 30
overwrite: true
- uses: actions/upload-artifact@v4
if: always()
with:
name: playwright-report-ubuntu-${{ github.sha }}
path: playwright-report/ path: playwright-report/
retention-days: 30 retention-days: 30
overwrite: true
playwright-macos: playwright-macos:
timeout-minutes: 60 timeout-minutes: 60
runs-on: macos-14-large runs-on: macos-14
needs: check-rust-changes needs: check-rust-changes
steps: steps:
- name: Tune GitHub-hosted runner network
uses: smorimoto/tune-github-hosted-runner-network@v1
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- uses: actions/setup-node@v4 - uses: actions/setup-node@v4
with: with:
@ -189,20 +143,12 @@ jobs:
cache: 'yarn' cache: 'yarn'
- name: Install dependencies - name: Install dependencies
run: yarn run: yarn
- name: Cache Playwright Browsers
uses: actions/cache@v4
with:
path: |
~/.cache/ms-playwright
key: ${{ runner.os }}-playwright-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-playwright-
- name: Install Playwright Browsers - name: Install Playwright Browsers
run: yarn playwright install --with-deps run: yarn playwright install --with-deps
- name: Download Wasm Cache - name: Download Wasm Cache
id: download-wasm id: download-wasm
if: needs.check-rust-changes.outputs.rust-changed == 'false' if: needs.check-rust-changes.outputs.rust-changed == 'false'
uses: dawidd6/action-download-artifact@v6 uses: dawidd6/action-download-artifact@v3
continue-on-error: true continue-on-error: true
with: with:
github_token: ${{secrets.GITHUB_TOKEN}} github_token: ${{secrets.GITHUB_TOKEN}}
@ -234,48 +180,16 @@ jobs:
run: yarn build:wasm run: yarn build:wasm
- name: build web - name: build web
run: yarn build:local 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 - 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) # 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 # 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 run: yarn playwright test --project="webkit" e2e/playwright/flow-tests.spec.ts
env: env:
CI: true CI: true
token: ${{ secrets.KITTYCAD_API_TOKEN_DEV }} token: ${{ secrets.KITTYCAD_API_TOKEN_DEV }}
- uses: actions/upload-artifact@v4 - uses: actions/upload-artifact@v3
if: ${{ always() }} if: always()
with: with:
name: test-results-macos-${{ github.sha }} name: playwright-report
path: test-results/
retention-days: 30
overwrite: true
- uses: actions/upload-artifact@v4
if: ${{ always() }}
with:
name: playwright-report-macos-${{ github.sha }}
path: playwright-report/ path: playwright-report/
retention-days: 30 retention-days: 30
overwrite: true

1
.gitignore vendored
View File

@ -17,7 +17,6 @@
.env.development.local .env.development.local
.env.test.local .env.test.local
.env.production.local .env.production.local
.direnv
npm-debug.log* npm-debug.log*
yarn-debug.log* yarn-debug.log*

View File

@ -1,17 +1,14 @@
.PHONY: dev .PHONY: dev
WASM_LIB_FILES := $(wildcard src/wasm-lib/**/*.rs) 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 yarn start
$(XSTATE_TYPEGENS): $(TS_SRC)
yarn xstate typegen 'src/**/*.ts?(x)'
public/wasm_lib_bg.wasm: $(WASM_LIB_FILES) public/wasm_lib_bg.wasm: $(WASM_LIB_FILES)
yarn build:wasm-dev yarn build:wasm-dev
node_modules: package.json yarn.lock node_modules: package.json
package.json:
yarn install yarn install

View File

@ -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 the eye with a slash through it in the URL bar, and clicking on "Enable
Third-Party Cookies". 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 ## Tauri
To spin up up tauri dev, `yarn install` and `yarn build:wasm-dev` need to have been done before hand then To spin up up tauri dev, `yarn install` and `yarn build:wasm-dev` need to have been done before hand then
@ -176,9 +195,7 @@ $ cargo +nightly fuzz run parser
For more information on fuzzing you can check out For more information on fuzzing you can check out
[this guide](https://rust-fuzz.github.io/book/cargo-fuzz.html). [this guide](https://rust-fuzz.github.io/book/cargo-fuzz.html).
## Tests ### Playwright
### Playwright tests
For a portable way to run Playwright you'll need Docker. For a portable way to run Playwright you'll need Docker.
@ -267,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. 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 #### 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. 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.
@ -333,7 +319,7 @@ PS: for the debug panel, the following JSON is useful for snapping the camera
``` ```
yarn install yarn install
yarn build:wasm-dev yarn build:wasm
cp src/wasm-lib/pkg/wasm_lib_bg.wasm public cp src/wasm-lib/pkg/wasm_lib_bg.wasm public
yarn vite build --mode development yarn vite build --mode development
yarn tauri build --debug -b yarn tauri build --debug -b

View File

@ -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 currently move or transform the imported objects at all, once we have assemblies
this will work. this will work.
- **Fillets**: Fillets cannot intersect, you will get an error. Only simple fillet - **Fillets**: Fillets cannot intersect, you will get an error. Only simple fillet cases work currently.
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.

View File

@ -9,7 +9,7 @@ Returns the angle to match the given length for x.
```js ```js
angleToMatchLengthX(segment_name: TagIdentifier, to: number, sketch_group: SketchGroup) -> number angleToMatchLengthX(segment_name: string, to: number, sketch_group: SketchGroup) -> number
``` ```
### Examples ### Examples
@ -17,8 +17,11 @@ angleToMatchLengthX(segment_name: TagIdentifier, to: number, sketch_group: Sketc
```js ```js
const sketch001 = startSketchOn('XZ') const sketch001 = startSketchOn('XZ')
|> startProfileAt([0, 0], %) |> startProfileAt([0, 0], %)
|> line([2, 5], %, $seg01) |> line([2, 5], %, 'seg01')
|> angledLineToX([-angleToMatchLengthX(seg01, 7, %), 10], %) |> angledLineToX([
-angleToMatchLengthX('seg01', 7, %),
10
], %)
|> close(%) |> close(%)
const extrusion = extrude(5, sketch001) const extrusion = extrude(5, sketch001)
@ -28,16 +31,13 @@ const extrusion = extrude(5, sketch001)
### Arguments ### Arguments
* `segment_name`: `TagIdentifier` (REQUIRED) * `segment_name`: `string` (REQUIRED)
```js
{
value: string,
}
```
* `to`: `number` (REQUIRED) * `to`: `number` (REQUIRED)
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED) * `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
```js ```js
{ {
// The plane id or face id of the sketch group.
entityId: uuid,
// The id of the sketch group. // The id of the sketch group.
id: uuid, id: uuid,
// What the sketch is on (can be a plane or a face). // What the sketch is on (can be a plane or a face).
@ -73,181 +73,12 @@ const extrusion = extrude(5, sketch001)
}, },
} | } |
{ {
// The extrude group the face is on. // the face id the sketch 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],
},
// 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, faceId: 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. // The id of the face.
id: uuid, id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face", type: "face",
// The tag of the face. // The tag of the face.
value: string, value: string,
@ -270,16 +101,16 @@ const extrusion = extrude(5, sketch001)
z: number, 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. // The starting path.
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -287,12 +118,8 @@ const extrusion = extrude(5, sketch001)
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -304,12 +131,8 @@ const extrusion = extrude(5, sketch001)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -317,12 +140,8 @@ const extrusion = extrude(5, sketch001)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -330,12 +149,8 @@ const extrusion = extrude(5, sketch001)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -345,12 +160,8 @@ const extrusion = extrude(5, sketch001)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -362,16 +173,30 @@ const extrusion = extrude(5, sketch001)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", 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,
},
} }
``` ```

View File

@ -9,7 +9,7 @@ Returns the angle to match the given length for y.
```js ```js
angleToMatchLengthY(segment_name: TagIdentifier, to: number, sketch_group: SketchGroup) -> number angleToMatchLengthY(segment_name: string, to: number, sketch_group: SketchGroup) -> number
``` ```
### Examples ### Examples
@ -17,9 +17,9 @@ angleToMatchLengthY(segment_name: TagIdentifier, to: number, sketch_group: Sketc
```js ```js
const sketch001 = startSketchOn('XZ') const sketch001 = startSketchOn('XZ')
|> startProfileAt([0, 0], %) |> startProfileAt([0, 0], %)
|> line([1, 2], %, $seg01) |> line([1, 2], %, 'seg01')
|> angledLine({ |> angledLine({
angle: angleToMatchLengthY(seg01, 15, %), angle: angleToMatchLengthY('seg01', 15, %),
length: 5 length: 5
}, %) }, %)
|> yLineTo(0, %) |> yLineTo(0, %)
@ -32,16 +32,13 @@ const extrusion = extrude(5, sketch001)
### Arguments ### Arguments
* `segment_name`: `TagIdentifier` (REQUIRED) * `segment_name`: `string` (REQUIRED)
```js
{
value: string,
}
```
* `to`: `number` (REQUIRED) * `to`: `number` (REQUIRED)
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED) * `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
```js ```js
{ {
// The plane id or face id of the sketch group.
entityId: uuid,
// The id of the sketch group. // The id of the sketch group.
id: uuid, id: uuid,
// What the sketch is on (can be a plane or a face). // What the sketch is on (can be a plane or a face).
@ -77,181 +74,12 @@ const extrusion = extrude(5, sketch001)
}, },
} | } |
{ {
// The extrude group the face is on. // the face id the sketch 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],
},
// 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, faceId: 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. // The id of the face.
id: uuid, id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face", type: "face",
// The tag of the face. // The tag of the face.
value: string, value: string,
@ -274,16 +102,16 @@ const extrusion = extrude(5, sketch001)
z: number, 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. // The starting path.
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -291,12 +119,8 @@ const extrusion = extrude(5, sketch001)
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -308,12 +132,8 @@ const extrusion = extrude(5, sketch001)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -321,12 +141,8 @@ const extrusion = extrude(5, sketch001)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -334,12 +150,8 @@ const extrusion = extrude(5, sketch001)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -349,12 +161,8 @@ const extrusion = extrude(5, sketch001)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -366,16 +174,30 @@ const extrusion = extrude(5, sketch001)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", 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,
},
} }
``` ```

View File

@ -9,7 +9,7 @@ Draw an angled line.
```js ```js
angledLine(data: AngledLineData, sketch_group: SketchGroup, tag?: TagDeclarator) -> SketchGroup angledLine(data: AngledLineData, sketch_group: SketchGroup, tag?: String) -> SketchGroup
``` ```
### Examples ### Examples
@ -43,6 +43,8 @@ const example = extrude(10, exampleSketch)
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED) * `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
```js ```js
{ {
// The plane id or face id of the sketch group.
entityId: uuid,
// The id of the sketch group. // The id of the sketch group.
id: uuid, id: uuid,
// What the sketch is on (can be a plane or a face). // What the sketch is on (can be a plane or a face).
@ -78,181 +80,12 @@ const example = extrude(10, exampleSketch)
}, },
} | } |
{ {
// The extrude group the face is on. // the face id the sketch 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],
},
// 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, faceId: 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. // The id of the face.
id: uuid, id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face", type: "face",
// The tag of the face. // The tag of the face.
value: string, value: string,
@ -275,16 +108,16 @@ const example = extrude(10, exampleSketch)
z: number, 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. // The starting path.
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -292,12 +125,8 @@ const example = extrude(10, exampleSketch)
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -309,12 +138,8 @@ const example = extrude(10, exampleSketch)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -322,12 +147,8 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -335,12 +156,8 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -350,12 +167,8 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -367,32 +180,41 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", 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) * `tag`: `String` (OPTIONAL)
```js
{
end: number,
start: number,
value: string,
}
```
### Returns ### Returns
`SketchGroup` - A sketch group is a collection of paths. `SketchGroup` - A sketch group is a collection of paths.
```js ```js
{ {
// The plane id or face id of the sketch group.
entityId: uuid,
// The id of the sketch group. // The id of the sketch group.
id: uuid, id: uuid,
// What the sketch is on (can be a plane or a face). // What the sketch is on (can be a plane or a face).
@ -428,181 +250,12 @@ const example = extrude(10, exampleSketch)
}, },
} | } |
{ {
// The extrude group the face is on. // the face id the sketch 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],
},
// 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, faceId: 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. // The id of the face.
id: uuid, id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face", type: "face",
// The tag of the face. // The tag of the face.
value: string, value: string,
@ -625,16 +278,16 @@ const example = extrude(10, exampleSketch)
z: number, 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. // The starting path.
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -642,12 +295,8 @@ const example = extrude(10, exampleSketch)
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -659,12 +308,8 @@ const example = extrude(10, exampleSketch)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -672,12 +317,8 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -685,12 +326,8 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -700,12 +337,8 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -717,16 +350,30 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", 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,
},
} }
``` ```

View File

@ -9,7 +9,7 @@ Draw an angled line of a given x length.
```js ```js
angledLineOfXLength(data: AngledLineData, sketch_group: SketchGroup, tag?: TagDeclarator) -> SketchGroup angledLineOfXLength(data: AngledLineData, sketch_group: SketchGroup, tag?: String) -> SketchGroup
``` ```
### Examples ### Examples
@ -17,10 +17,10 @@ angledLineOfXLength(data: AngledLineData, sketch_group: SketchGroup, tag?: TagDe
```js ```js
const sketch001 = startSketchOn('XZ') const sketch001 = startSketchOn('XZ')
|> startProfileAt([0, 0], %) |> startProfileAt([0, 0], %)
|> angledLineOfXLength({ angle: 45, length: 10 }, %, $edge1) |> angledLineOfXLength({ angle: 45, length: 10 }, %, "edge1")
|> angledLineOfXLength({ angle: -15, length: 20 }, %, $edge2) |> angledLineOfXLength({ angle: -15, length: 20 }, %, "edge2")
|> line([0, -5], %) |> line([0, -5], %)
|> close(%, $edge3) |> close(%, "edge3")
const extrusion = extrude(10, sketch001) 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) * `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
```js ```js
{ {
// The plane id or face id of the sketch group.
entityId: uuid,
// The id of the sketch group. // The id of the sketch group.
id: uuid, id: uuid,
// What the sketch is on (can be a plane or a face). // What the sketch is on (can be a plane or a face).
@ -77,181 +79,12 @@ const extrusion = extrude(10, sketch001)
}, },
} | } |
{ {
// The extrude group the face is on. // the face id the sketch 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],
},
// 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, faceId: 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. // The id of the face.
id: uuid, id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face", type: "face",
// The tag of the face. // The tag of the face.
value: string, value: string,
@ -274,16 +107,16 @@ const extrusion = extrude(10, sketch001)
z: number, 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. // The starting path.
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -291,12 +124,8 @@ const extrusion = extrude(10, sketch001)
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -308,12 +137,8 @@ const extrusion = extrude(10, sketch001)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -321,12 +146,8 @@ const extrusion = extrude(10, sketch001)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -334,12 +155,8 @@ const extrusion = extrude(10, sketch001)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -349,12 +166,8 @@ const extrusion = extrude(10, sketch001)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -366,32 +179,41 @@ const extrusion = extrude(10, sketch001)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", 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) * `tag`: `String` (OPTIONAL)
```js
{
end: number,
start: number,
value: string,
}
```
### Returns ### Returns
`SketchGroup` - A sketch group is a collection of paths. `SketchGroup` - A sketch group is a collection of paths.
```js ```js
{ {
// The plane id or face id of the sketch group.
entityId: uuid,
// The id of the sketch group. // The id of the sketch group.
id: uuid, id: uuid,
// What the sketch is on (can be a plane or a face). // What the sketch is on (can be a plane or a face).
@ -427,181 +249,12 @@ const extrusion = extrude(10, sketch001)
}, },
} | } |
{ {
// The extrude group the face is on. // the face id the sketch 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],
},
// 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, faceId: 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. // The id of the face.
id: uuid, id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face", type: "face",
// The tag of the face. // The tag of the face.
value: string, value: string,
@ -624,16 +277,16 @@ const extrusion = extrude(10, sketch001)
z: number, 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. // The starting path.
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -641,12 +294,8 @@ const extrusion = extrude(10, sketch001)
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -658,12 +307,8 @@ const extrusion = extrude(10, sketch001)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -671,12 +316,8 @@ const extrusion = extrude(10, sketch001)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -684,12 +325,8 @@ const extrusion = extrude(10, sketch001)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -699,12 +336,8 @@ const extrusion = extrude(10, sketch001)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -716,16 +349,30 @@ const extrusion = extrude(10, sketch001)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", 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,
},
} }
``` ```

View File

@ -9,7 +9,7 @@ Draw an angled line of a given y length.
```js ```js
angledLineOfYLength(data: AngledLineData, sketch_group: SketchGroup, tag?: TagDeclarator) -> SketchGroup angledLineOfYLength(data: AngledLineData, sketch_group: SketchGroup, tag?: String) -> SketchGroup
``` ```
### Examples ### Examples
@ -44,6 +44,8 @@ const example = extrude(10, exampleSketch)
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED) * `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
```js ```js
{ {
// The plane id or face id of the sketch group.
entityId: uuid,
// The id of the sketch group. // The id of the sketch group.
id: uuid, id: uuid,
// What the sketch is on (can be a plane or a face). // What the sketch is on (can be a plane or a face).
@ -79,181 +81,12 @@ const example = extrude(10, exampleSketch)
}, },
} | } |
{ {
// The extrude group the face is on. // the face id the sketch 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],
},
// 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, faceId: 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. // The id of the face.
id: uuid, id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face", type: "face",
// The tag of the face. // The tag of the face.
value: string, value: string,
@ -276,16 +109,16 @@ const example = extrude(10, exampleSketch)
z: number, 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. // The starting path.
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -293,12 +126,8 @@ const example = extrude(10, exampleSketch)
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -310,12 +139,8 @@ const example = extrude(10, exampleSketch)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -323,12 +148,8 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -336,12 +157,8 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -351,12 +168,8 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -368,32 +181,41 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", 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) * `tag`: `String` (OPTIONAL)
```js
{
end: number,
start: number,
value: string,
}
```
### Returns ### Returns
`SketchGroup` - A sketch group is a collection of paths. `SketchGroup` - A sketch group is a collection of paths.
```js ```js
{ {
// The plane id or face id of the sketch group.
entityId: uuid,
// The id of the sketch group. // The id of the sketch group.
id: uuid, id: uuid,
// What the sketch is on (can be a plane or a face). // What the sketch is on (can be a plane or a face).
@ -429,181 +251,12 @@ const example = extrude(10, exampleSketch)
}, },
} | } |
{ {
// The extrude group the face is on. // the face id the sketch 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],
},
// 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, faceId: 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. // The id of the face.
id: uuid, id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face", type: "face",
// The tag of the face. // The tag of the face.
value: string, value: string,
@ -626,16 +279,16 @@ const example = extrude(10, exampleSketch)
z: number, 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. // The starting path.
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -643,12 +296,8 @@ const example = extrude(10, exampleSketch)
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -660,12 +309,8 @@ const example = extrude(10, exampleSketch)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -673,12 +318,8 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -686,12 +327,8 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -701,12 +338,8 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -718,16 +351,30 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", 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,
},
} }
``` ```

View File

@ -9,7 +9,7 @@ Draw an angled line that intersects with a given line.
```js ```js
angledLineThatIntersects(data: AngledLineThatIntersectsData, sketch_group: SketchGroup, tag?: TagDeclarator) -> SketchGroup angledLineThatIntersects(data: AngledLineThatIntersectsData, sketch_group: SketchGroup, tag?: String) -> SketchGroup
``` ```
### Examples ### Examples
@ -18,7 +18,7 @@ angledLineThatIntersects(data: AngledLineThatIntersectsData, sketch_group: Sketc
const exampleSketch = startSketchOn('XZ') const exampleSketch = startSketchOn('XZ')
|> startProfileAt([0, 0], %) |> startProfileAt([0, 0], %)
|> lineTo([5, 10], %) |> lineTo([5, 10], %)
|> lineTo([-10, 10], %, $lineToIntersect) |> lineTo([-10, 10], %, "lineToIntersect")
|> lineTo([0, 20], %) |> lineTo([0, 20], %)
|> angledLineThatIntersects({ |> angledLineThatIntersects({
angle: 80, angle: 80,
@ -40,9 +40,7 @@ const example = extrude(10, exampleSketch)
// The angle of the line. // The angle of the line.
angle: number, angle: number,
// The tag of the line to intersect with. // The tag of the line to intersect with.
intersectTag: { intersectTag: string,
value: string,
},
// The offset from the intersecting line. // The offset from the intersecting line.
offset: number, offset: number,
} }
@ -50,6 +48,8 @@ const example = extrude(10, exampleSketch)
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED) * `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
```js ```js
{ {
// The plane id or face id of the sketch group.
entityId: uuid,
// The id of the sketch group. // The id of the sketch group.
id: uuid, id: uuid,
// What the sketch is on (can be a plane or a face). // What the sketch is on (can be a plane or a face).
@ -85,181 +85,12 @@ const example = extrude(10, exampleSketch)
}, },
} | } |
{ {
// The extrude group the face is on. // the face id the sketch 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],
},
// 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, faceId: 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. // The id of the face.
id: uuid, id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face", type: "face",
// The tag of the face. // The tag of the face.
value: string, value: string,
@ -282,16 +113,16 @@ const example = extrude(10, exampleSketch)
z: number, 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. // The starting path.
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -299,12 +130,8 @@ const example = extrude(10, exampleSketch)
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -316,12 +143,8 @@ const example = extrude(10, exampleSketch)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -329,12 +152,8 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -342,12 +161,8 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -357,12 +172,8 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -374,32 +185,41 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", 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) * `tag`: `String` (OPTIONAL)
```js
{
end: number,
start: number,
value: string,
}
```
### Returns ### Returns
`SketchGroup` - A sketch group is a collection of paths. `SketchGroup` - A sketch group is a collection of paths.
```js ```js
{ {
// The plane id or face id of the sketch group.
entityId: uuid,
// The id of the sketch group. // The id of the sketch group.
id: uuid, id: uuid,
// What the sketch is on (can be a plane or a face). // What the sketch is on (can be a plane or a face).
@ -435,181 +255,12 @@ const example = extrude(10, exampleSketch)
}, },
} | } |
{ {
// The extrude group the face is on. // the face id the sketch 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],
},
// 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, faceId: 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. // The id of the face.
id: uuid, id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face", type: "face",
// The tag of the face. // The tag of the face.
value: string, value: string,
@ -632,16 +283,16 @@ const example = extrude(10, exampleSketch)
z: number, 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. // The starting path.
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -649,12 +300,8 @@ const example = extrude(10, exampleSketch)
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -666,12 +313,8 @@ const example = extrude(10, exampleSketch)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -679,12 +322,8 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -692,12 +331,8 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -707,12 +342,8 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -724,16 +355,30 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", 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,
},
} }
``` ```

View File

@ -9,7 +9,7 @@ Draw an angled line to a given x coordinate.
```js ```js
angledLineToX(data: AngledLineToData, sketch_group: SketchGroup, tag?: TagDeclarator) -> SketchGroup angledLineToX(data: AngledLineToData, sketch_group: SketchGroup, tag?: String) -> SketchGroup
``` ```
### Examples ### Examples
@ -41,6 +41,8 @@ const example = extrude(10, exampleSketch)
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED) * `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
```js ```js
{ {
// The plane id or face id of the sketch group.
entityId: uuid,
// The id of the sketch group. // The id of the sketch group.
id: uuid, id: uuid,
// What the sketch is on (can be a plane or a face). // What the sketch is on (can be a plane or a face).
@ -76,181 +78,12 @@ const example = extrude(10, exampleSketch)
}, },
} | } |
{ {
// The extrude group the face is on. // the face id the sketch 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],
},
// 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, faceId: 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. // The id of the face.
id: uuid, id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face", type: "face",
// The tag of the face. // The tag of the face.
value: string, value: string,
@ -273,16 +106,16 @@ const example = extrude(10, exampleSketch)
z: number, 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. // The starting path.
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -290,12 +123,8 @@ const example = extrude(10, exampleSketch)
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -307,12 +136,8 @@ const example = extrude(10, exampleSketch)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -320,12 +145,8 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -333,12 +154,8 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -348,12 +165,8 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -365,32 +178,41 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", 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) * `tag`: `String` (OPTIONAL)
```js
{
end: number,
start: number,
value: string,
}
```
### Returns ### Returns
`SketchGroup` - A sketch group is a collection of paths. `SketchGroup` - A sketch group is a collection of paths.
```js ```js
{ {
// The plane id or face id of the sketch group.
entityId: uuid,
// The id of the sketch group. // The id of the sketch group.
id: uuid, id: uuid,
// What the sketch is on (can be a plane or a face). // What the sketch is on (can be a plane or a face).
@ -426,181 +248,12 @@ const example = extrude(10, exampleSketch)
}, },
} | } |
{ {
// The extrude group the face is on. // the face id the sketch 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],
},
// 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, faceId: 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. // The id of the face.
id: uuid, id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face", type: "face",
// The tag of the face. // The tag of the face.
value: string, value: string,
@ -623,16 +276,16 @@ const example = extrude(10, exampleSketch)
z: number, 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. // The starting path.
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -640,12 +293,8 @@ const example = extrude(10, exampleSketch)
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -657,12 +306,8 @@ const example = extrude(10, exampleSketch)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -670,12 +315,8 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -683,12 +324,8 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -698,12 +335,8 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -715,16 +348,30 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", 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,
},
} }
``` ```

View File

@ -9,7 +9,7 @@ Draw an angled line to a given y coordinate.
```js ```js
angledLineToY(data: AngledLineToData, sketch_group: SketchGroup, tag?: TagDeclarator) -> SketchGroup angledLineToY(data: AngledLineToData, sketch_group: SketchGroup, tag?: String) -> SketchGroup
``` ```
### Examples ### Examples
@ -41,6 +41,8 @@ const example = extrude(10, exampleSketch)
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED) * `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
```js ```js
{ {
// The plane id or face id of the sketch group.
entityId: uuid,
// The id of the sketch group. // The id of the sketch group.
id: uuid, id: uuid,
// What the sketch is on (can be a plane or a face). // What the sketch is on (can be a plane or a face).
@ -76,181 +78,12 @@ const example = extrude(10, exampleSketch)
}, },
} | } |
{ {
// The extrude group the face is on. // the face id the sketch 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],
},
// 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, faceId: 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. // The id of the face.
id: uuid, id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face", type: "face",
// The tag of the face. // The tag of the face.
value: string, value: string,
@ -273,16 +106,16 @@ const example = extrude(10, exampleSketch)
z: number, 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. // The starting path.
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -290,12 +123,8 @@ const example = extrude(10, exampleSketch)
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -307,12 +136,8 @@ const example = extrude(10, exampleSketch)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -320,12 +145,8 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -333,12 +154,8 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -348,12 +165,8 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -365,32 +178,41 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", 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) * `tag`: `String` (OPTIONAL)
```js
{
end: number,
start: number,
value: string,
}
```
### Returns ### Returns
`SketchGroup` - A sketch group is a collection of paths. `SketchGroup` - A sketch group is a collection of paths.
```js ```js
{ {
// The plane id or face id of the sketch group.
entityId: uuid,
// The id of the sketch group. // The id of the sketch group.
id: uuid, id: uuid,
// What the sketch is on (can be a plane or a face). // What the sketch is on (can be a plane or a face).
@ -426,181 +248,12 @@ const example = extrude(10, exampleSketch)
}, },
} | } |
{ {
// The extrude group the face is on. // the face id the sketch 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],
},
// 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, faceId: 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. // The id of the face.
id: uuid, id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face", type: "face",
// The tag of the face. // The tag of the face.
value: string, value: string,
@ -623,16 +276,16 @@ const example = extrude(10, exampleSketch)
z: number, 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. // The starting path.
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -640,12 +293,8 @@ const example = extrude(10, exampleSketch)
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -657,12 +306,8 @@ const example = extrude(10, exampleSketch)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -670,12 +315,8 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -683,12 +324,8 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -698,12 +335,8 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -715,16 +348,30 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", 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,
},
} }
``` ```

View File

@ -9,7 +9,7 @@ Draw an arc.
```js ```js
arc(data: ArcData, sketch_group: SketchGroup, tag?: TagDeclarator) -> SketchGroup arc(data: ArcData, sketch_group: SketchGroup, tag?: String) -> SketchGroup
``` ```
### Examples ### Examples
@ -52,6 +52,8 @@ const exampleSketch = startSketchOn('XZ')
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED) * `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
```js ```js
{ {
// The plane id or face id of the sketch group.
entityId: uuid,
// The id of the sketch group. // The id of the sketch group.
id: uuid, id: uuid,
// What the sketch is on (can be a plane or a face). // What the sketch is on (can be a plane or a face).
@ -87,181 +89,12 @@ const exampleSketch = startSketchOn('XZ')
}, },
} | } |
{ {
// The extrude group the face is on. // the face id the sketch 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],
},
// 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, faceId: 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. // The id of the face.
id: uuid, id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face", type: "face",
// The tag of the face. // The tag of the face.
value: string, value: string,
@ -284,16 +117,16 @@ const exampleSketch = startSketchOn('XZ')
z: number, 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. // The starting path.
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -301,12 +134,8 @@ const exampleSketch = startSketchOn('XZ')
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -318,12 +147,8 @@ const exampleSketch = startSketchOn('XZ')
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -331,12 +156,8 @@ const exampleSketch = startSketchOn('XZ')
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -344,12 +165,8 @@ const exampleSketch = startSketchOn('XZ')
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -359,12 +176,8 @@ const exampleSketch = startSketchOn('XZ')
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -376,32 +189,41 @@ const exampleSketch = startSketchOn('XZ')
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", 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) * `tag`: `String` (OPTIONAL)
```js
{
end: number,
start: number,
value: string,
}
```
### Returns ### Returns
`SketchGroup` - A sketch group is a collection of paths. `SketchGroup` - A sketch group is a collection of paths.
```js ```js
{ {
// The plane id or face id of the sketch group.
entityId: uuid,
// The id of the sketch group. // The id of the sketch group.
id: uuid, id: uuid,
// What the sketch is on (can be a plane or a face). // What the sketch is on (can be a plane or a face).
@ -437,181 +259,12 @@ const exampleSketch = startSketchOn('XZ')
}, },
} | } |
{ {
// The extrude group the face is on. // the face id the sketch 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],
},
// 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, faceId: 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. // The id of the face.
id: uuid, id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face", type: "face",
// The tag of the face. // The tag of the face.
value: string, value: string,
@ -634,16 +287,16 @@ const exampleSketch = startSketchOn('XZ')
z: number, 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. // The starting path.
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -651,12 +304,8 @@ const exampleSketch = startSketchOn('XZ')
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -668,12 +317,8 @@ const exampleSketch = startSketchOn('XZ')
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -681,12 +326,8 @@ const exampleSketch = startSketchOn('XZ')
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -694,12 +335,8 @@ const exampleSketch = startSketchOn('XZ')
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -709,12 +346,8 @@ const exampleSketch = startSketchOn('XZ')
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -726,16 +359,30 @@ const exampleSketch = startSketchOn('XZ')
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", 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,
},
} }
``` ```

View File

@ -9,7 +9,7 @@ Draw a bezier curve.
```js ```js
bezierCurve(data: BezierData, sketch_group: SketchGroup, tag?: TagDeclarator) -> SketchGroup bezierCurve(data: BezierData, sketch_group: SketchGroup, tag?: String) -> SketchGroup
``` ```
### Examples ### Examples
@ -47,6 +47,8 @@ const example = extrude(10, exampleSketch)
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED) * `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
```js ```js
{ {
// The plane id or face id of the sketch group.
entityId: uuid,
// The id of the sketch group. // The id of the sketch group.
id: uuid, id: uuid,
// What the sketch is on (can be a plane or a face). // What the sketch is on (can be a plane or a face).
@ -82,181 +84,12 @@ const example = extrude(10, exampleSketch)
}, },
} | } |
{ {
// The extrude group the face is on. // the face id the sketch 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],
},
// 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, faceId: 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. // The id of the face.
id: uuid, id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face", type: "face",
// The tag of the face. // The tag of the face.
value: string, value: string,
@ -279,16 +112,16 @@ const example = extrude(10, exampleSketch)
z: number, 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. // The starting path.
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -296,12 +129,8 @@ const example = extrude(10, exampleSketch)
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -313,12 +142,8 @@ const example = extrude(10, exampleSketch)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -326,12 +151,8 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -339,12 +160,8 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -354,12 +171,8 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -371,32 +184,41 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", 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) * `tag`: `String` (OPTIONAL)
```js
{
end: number,
start: number,
value: string,
}
```
### Returns ### Returns
`SketchGroup` - A sketch group is a collection of paths. `SketchGroup` - A sketch group is a collection of paths.
```js ```js
{ {
// The plane id or face id of the sketch group.
entityId: uuid,
// The id of the sketch group. // The id of the sketch group.
id: uuid, id: uuid,
// What the sketch is on (can be a plane or a face). // What the sketch is on (can be a plane or a face).
@ -432,181 +254,12 @@ const example = extrude(10, exampleSketch)
}, },
} | } |
{ {
// The extrude group the face is on. // the face id the sketch 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],
},
// 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, faceId: 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. // The id of the face.
id: uuid, id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face", type: "face",
// The tag of the face. // The tag of the face.
value: string, value: string,
@ -629,16 +282,16 @@ const example = extrude(10, exampleSketch)
z: number, 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. // The starting path.
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -646,12 +299,8 @@ const example = extrude(10, exampleSketch)
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -663,12 +312,8 @@ const example = extrude(10, exampleSketch)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -676,12 +321,8 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -689,12 +330,8 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -704,12 +341,8 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -721,16 +354,30 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", 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,
},
} }
``` ```

File diff suppressed because one or more lines are too long

View File

@ -9,7 +9,7 @@ Sketch a circle.
```js ```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 ### Examples
@ -41,6 +41,7 @@ const example = extrude(5, exampleSketch)
* `center`: `[number]` (REQUIRED) * `center`: `[number]` (REQUIRED)
* `radius`: `number` (REQUIRED) * `radius`: `number` (REQUIRED)
* `tag`: `String` (OPTIONAL)
* `sketch_surface_or_group`: `SketchSurfaceOrGroup` - A sketch surface or a sketch group. (REQUIRED) * `sketch_surface_or_group`: `SketchSurfaceOrGroup` - A sketch surface or a sketch group. (REQUIRED)
```js ```js
{ {
@ -75,181 +76,12 @@ const example = extrude(5, exampleSketch)
}, },
} | } |
{ {
// The extrude group the face is on. // the face id the sketch 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],
},
// 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, faceId: 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. // The id of the face.
id: uuid, id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face", type: "face",
// The tag of the face. // The tag of the face.
value: string, value: string,
@ -273,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. // The id of the sketch group.
id: uuid, id: uuid,
// What the sketch is on (can be a plane or a face). // What the sketch is on (can be a plane or a face).
@ -308,74 +142,12 @@ const example = extrude(5, exampleSketch)
}, },
} | } |
{ {
// The extrude group the face is on. // the face id the sketch 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, faceId: 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. // The id of the face.
id: uuid, id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face", type: "face",
// The tag of the face. // The tag of the face.
value: string, value: string,
@ -398,16 +170,16 @@ const example = extrude(5, exampleSketch)
z: number, 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. // The starting path.
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -415,12 +187,8 @@ const example = extrude(5, exampleSketch)
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -432,12 +200,8 @@ const example = extrude(5, exampleSketch)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -445,12 +209,8 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -458,12 +218,8 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -473,12 +229,8 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -490,24 +242,30 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",
}], }],
} // The x-axis of the sketch group base plane in the 3D space
``` xAxis: {
* `tag`: `TagDeclarator` (OPTIONAL) x: number,
```js y: number,
{ z: number,
end: number, },
start: number, // The y-axis of the sketch group base plane in the 3D space
value: string, 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,
},
} }
``` ```
@ -516,6 +274,8 @@ const example = extrude(5, exampleSketch)
`SketchGroup` - A sketch group is a collection of paths. `SketchGroup` - A sketch group is a collection of paths.
```js ```js
{ {
// The plane id or face id of the sketch group.
entityId: uuid,
// The id of the sketch group. // The id of the sketch group.
id: uuid, id: uuid,
// What the sketch is on (can be a plane or a face). // What the sketch is on (can be a plane or a face).
@ -551,181 +311,12 @@ const example = extrude(5, exampleSketch)
}, },
} | } |
{ {
// The extrude group the face is on. // the face id the sketch 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],
},
// 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, faceId: 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. // The id of the face.
id: uuid, id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face", type: "face",
// The tag of the face. // The tag of the face.
value: string, value: string,
@ -748,16 +339,16 @@ const example = extrude(5, exampleSketch)
z: number, 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. // The starting path.
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -765,12 +356,8 @@ const example = extrude(5, exampleSketch)
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -782,12 +369,8 @@ const example = extrude(5, exampleSketch)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -795,12 +378,8 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -808,12 +387,8 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -823,12 +398,8 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -840,16 +411,30 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", 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,
},
} }
``` ```

View File

@ -9,7 +9,7 @@ Close the current sketch.
```js ```js
close(sketch_group: SketchGroup, tag?: TagDeclarator) -> SketchGroup close(sketch_group: SketchGroup, tag?: String) -> SketchGroup
``` ```
### Examples ### Examples
@ -42,6 +42,8 @@ const example = extrude(10, exampleSketch)
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED) * `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
```js ```js
{ {
// The plane id or face id of the sketch group.
entityId: uuid,
// The id of the sketch group. // The id of the sketch group.
id: uuid, id: uuid,
// What the sketch is on (can be a plane or a face). // What the sketch is on (can be a plane or a face).
@ -77,181 +79,12 @@ const example = extrude(10, exampleSketch)
}, },
} | } |
{ {
// The extrude group the face is on. // the face id the sketch 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],
},
// 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, faceId: 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. // The id of the face.
id: uuid, id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face", type: "face",
// The tag of the face. // The tag of the face.
value: string, value: string,
@ -274,16 +107,16 @@ const example = extrude(10, exampleSketch)
z: number, 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. // The starting path.
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -291,12 +124,8 @@ const example = extrude(10, exampleSketch)
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -308,12 +137,8 @@ const example = extrude(10, exampleSketch)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -321,12 +146,8 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -334,12 +155,8 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -349,12 +166,8 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -366,32 +179,41 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", 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) * `tag`: `String` (OPTIONAL)
```js
{
end: number,
start: number,
value: string,
}
```
### Returns ### Returns
`SketchGroup` - A sketch group is a collection of paths. `SketchGroup` - A sketch group is a collection of paths.
```js ```js
{ {
// The plane id or face id of the sketch group.
entityId: uuid,
// The id of the sketch group. // The id of the sketch group.
id: uuid, id: uuid,
// What the sketch is on (can be a plane or a face). // What the sketch is on (can be a plane or a face).
@ -427,181 +249,12 @@ const example = extrude(10, exampleSketch)
}, },
} | } |
{ {
// The extrude group the face is on. // the face id the sketch 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],
},
// 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, faceId: 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. // The id of the face.
id: uuid, id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face", type: "face",
// The tag of the face. // The tag of the face.
value: string, value: string,
@ -624,16 +277,16 @@ const example = extrude(10, exampleSketch)
z: number, 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. // The starting path.
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -641,12 +294,8 @@ const example = extrude(10, exampleSketch)
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -658,12 +307,8 @@ const example = extrude(10, exampleSketch)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -671,12 +316,8 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -684,12 +325,8 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -699,12 +336,8 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -716,16 +349,30 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", 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,
},
} }
``` ```

View File

@ -67,6 +67,8 @@ const example = extrude(10, exampleSketch)
* `sketch_group_set`: `SketchGroupSet` - A sketch group or a group of sketch groups. (REQUIRED) * `sketch_group_set`: `SketchGroupSet` - A sketch group or a group of sketch groups. (REQUIRED)
```js ```js
{ {
// The plane id or face id of the sketch group.
entityId: uuid,
// The id of the sketch group. // The id of the sketch group.
id: uuid, id: uuid,
// What the sketch is on (can be a plane or a face). // What the sketch is on (can be a plane or a face).
@ -102,181 +104,12 @@ const example = extrude(10, exampleSketch)
}, },
} | } |
{ {
// The extrude group the face is on. // the face id the sketch 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],
},
// 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, faceId: 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. // The id of the face.
id: uuid, id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face", type: "face",
// The tag of the face. // The tag of the face.
value: string, value: string,
@ -299,16 +132,16 @@ const example = extrude(10, exampleSketch)
z: number, 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. // The starting path.
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -317,12 +150,8 @@ const example = extrude(10, exampleSketch)
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -334,12 +163,8 @@ const example = extrude(10, exampleSketch)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -347,12 +172,8 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -360,12 +181,8 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -375,12 +192,8 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -392,16 +205,30 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", 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", type: "sketchGroups",
@ -415,182 +242,20 @@ const example = extrude(10, exampleSketch)
{ {
// The id of the extrusion end cap // The id of the extrusion end cap
endCapId: uuid, 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. // The height of the extrude group.
height: number, height: number,
// The id of the extrude group. // The id of the extrude group.
id: uuid, id: uuid,
// The sketch group. // The position of the extrude group.
sketchGroup: { position: [number, number, number],
// The id of the sketch group. // The rotation of the extrude group.
id: uuid, rotation: [number, number, number, number],
// What the sketch is on (can be a plane or a face). // The sketch group paths.
on: { sketchGroupValues: [{
// 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 planes X axis be?
xAxis: {
x: number,
y: number,
z: number,
},
// What should the planes 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 faces X axis be?
xAxis: {
x: number,
y: number,
z: number,
},
// What should the faces 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. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// 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. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -602,12 +267,8 @@ const example = extrude(10, exampleSketch)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -615,12 +276,8 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -628,12 +285,8 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -643,12 +296,8 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -660,17 +309,12 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",
}], }],
},
// The id of the extrusion start cap // The id of the extrusion start cap
startCapId: uuid, startCapId: uuid,
type: "extrudeGroup", type: "extrudeGroup",
@ -680,14 +324,14 @@ const example = extrude(10, exampleSketch)
faceId: uuid, faceId: uuid,
// The id of the geometry. // The id of the geometry.
id: uuid, id: uuid,
// The name.
name: string,
// The position.
position: [number, number, number],
// The rotation.
rotation: [number, number, number, number],
// The source range. // The source range.
sourceRange: [number, number], sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane", type: "extrudePlane",
} | } |
{ {
@ -695,16 +339,34 @@ const example = extrude(10, exampleSketch)
faceId: uuid, faceId: uuid,
// The id of the geometry. // The id of the geometry.
id: uuid, id: uuid,
// The name.
name: string,
// The position.
position: [number, number, number],
// The rotation.
rotation: [number, number, number, number],
// The source range. // The source range.
sourceRange: [number, number], sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc", 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", type: "extrudeGroups",

View File

@ -22,19 +22,19 @@ const filletRadius = 2
const mountingPlateSketch = startSketchOn("XY") const mountingPlateSketch = startSketchOn("XY")
|> startProfileAt([-width / 2, -length / 2], %) |> startProfileAt([-width / 2, -length / 2], %)
|> lineTo([width / 2, -length / 2], %, $edge1) |> lineTo([width / 2, -length / 2], %, 'edge1')
|> lineTo([width / 2, length / 2], %, $edge2) |> lineTo([width / 2, length / 2], %, 'edge2')
|> lineTo([-width / 2, length / 2], %, $edge3) |> lineTo([-width / 2, length / 2], %, 'edge3')
|> close(%, $edge4) |> close(%, 'edge4')
const mountingPlate = extrude(thickness, mountingPlateSketch) const mountingPlate = extrude(thickness, mountingPlateSketch)
|> fillet({ |> fillet({
radius: filletRadius, radius: filletRadius,
tags: [ tags: [
getNextAdjacentEdge(edge1, %), getNextAdjacentEdge('edge1', %),
getNextAdjacentEdge(edge2, %), getNextAdjacentEdge('edge2', %),
getNextAdjacentEdge(edge3, %), getNextAdjacentEdge('edge3', %),
getNextAdjacentEdge(edge4, %) getNextAdjacentEdge('edge4', %)
] ]
}, %) }, %)
``` ```
@ -50,9 +50,7 @@ const mountingPlate = extrude(thickness, mountingPlateSketch)
radius: number, radius: number,
// The tags of the paths you want to fillet. // The tags of the paths you want to fillet.
tags: [uuid | tags: [uuid |
{ string],
value: string,
}],
} }
``` ```
* `extrude_group`: `ExtrudeGroup` - An extrude group is a collection of extrude surfaces. (REQUIRED) * `extrude_group`: `ExtrudeGroup` - An extrude group is a collection of extrude surfaces. (REQUIRED)
@ -60,182 +58,20 @@ const mountingPlate = extrude(thickness, mountingPlateSketch)
{ {
// The id of the extrusion end cap // The id of the extrusion end cap
endCapId: uuid, 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. // The height of the extrude group.
height: number, height: number,
// The id of the extrude group. // The id of the extrude group.
id: uuid, id: uuid,
// The sketch group. // The position of the extrude group.
sketchGroup: { position: [number, number, number],
// The id of the sketch group. // The rotation of the extrude group.
id: uuid, rotation: [number, number, number, number],
// What the sketch is on (can be a plane or a face). // The sketch group paths.
on: { sketchGroupValues: [{
// 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 planes X axis be?
xAxis: {
x: number,
y: number,
z: number,
},
// What should the planes 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 faces X axis be?
xAxis: {
x: number,
y: number,
z: number,
},
// What should the faces 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. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// 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. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -247,12 +83,8 @@ const mountingPlate = extrude(thickness, mountingPlateSketch)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -260,12 +92,8 @@ const mountingPlate = extrude(thickness, mountingPlateSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -273,12 +101,8 @@ const mountingPlate = extrude(thickness, mountingPlateSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -288,12 +112,8 @@ const mountingPlate = extrude(thickness, mountingPlateSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -305,17 +125,12 @@ const mountingPlate = extrude(thickness, mountingPlateSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",
}], }],
},
// The id of the extrusion start cap // The id of the extrusion start cap
startCapId: uuid, startCapId: uuid,
// The extrude surfaces. // The extrude surfaces.
@ -324,14 +139,14 @@ const mountingPlate = extrude(thickness, mountingPlateSketch)
faceId: uuid, faceId: uuid,
// The id of the geometry. // The id of the geometry.
id: uuid, id: uuid,
// The name.
name: string,
// The position.
position: [number, number, number],
// The rotation.
rotation: [number, number, number, number],
// The source range. // The source range.
sourceRange: [number, number], sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane", type: "extrudePlane",
} | } |
{ {
@ -339,16 +154,34 @@ const mountingPlate = extrude(thickness, mountingPlateSketch)
faceId: uuid, faceId: uuid,
// The id of the geometry. // The id of the geometry.
id: uuid, id: uuid,
// The name.
name: string,
// The position.
position: [number, number, number],
// The rotation.
rotation: [number, number, number, number],
// The source range. // The source range.
sourceRange: [number, number], sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc", 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,
},
} }
``` ```
@ -359,182 +192,20 @@ const mountingPlate = extrude(thickness, mountingPlateSketch)
{ {
// The id of the extrusion end cap // The id of the extrusion end cap
endCapId: uuid, 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. // The height of the extrude group.
height: number, height: number,
// The id of the extrude group. // The id of the extrude group.
id: uuid, id: uuid,
// The sketch group. // The position of the extrude group.
sketchGroup: { position: [number, number, number],
// The id of the sketch group. // The rotation of the extrude group.
id: uuid, rotation: [number, number, number, number],
// What the sketch is on (can be a plane or a face). // The sketch group paths.
on: { sketchGroupValues: [{
// 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 planes X axis be?
xAxis: {
x: number,
y: number,
z: number,
},
// What should the planes 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 faces X axis be?
xAxis: {
x: number,
y: number,
z: number,
},
// What should the faces 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. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// 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. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -546,12 +217,8 @@ const mountingPlate = extrude(thickness, mountingPlateSketch)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -559,12 +226,8 @@ const mountingPlate = extrude(thickness, mountingPlateSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -572,12 +235,8 @@ const mountingPlate = extrude(thickness, mountingPlateSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -587,12 +246,8 @@ const mountingPlate = extrude(thickness, mountingPlateSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -604,17 +259,12 @@ const mountingPlate = extrude(thickness, mountingPlateSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",
}], }],
},
// The id of the extrusion start cap // The id of the extrusion start cap
startCapId: uuid, startCapId: uuid,
// The extrude surfaces. // The extrude surfaces.
@ -623,14 +273,14 @@ const mountingPlate = extrude(thickness, mountingPlateSketch)
faceId: uuid, faceId: uuid,
// The id of the geometry. // The id of the geometry.
id: uuid, id: uuid,
// The name.
name: string,
// The position.
position: [number, number, number],
// The rotation.
rotation: [number, number, number, number],
// The source range. // The source range.
sourceRange: [number, number], sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane", type: "extrudePlane",
} | } |
{ {
@ -638,16 +288,34 @@ const mountingPlate = extrude(thickness, mountingPlateSketch)
faceId: uuid, faceId: uuid,
// The id of the geometry. // The id of the geometry.
id: uuid, id: uuid,
// The name.
name: string,
// The position.
position: [number, number, number],
// The rotation.
rotation: [number, number, number, number],
// The source range. // The source range.
sourceRange: [number, number], sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc", 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,
},
} }
``` ```

View File

@ -9,7 +9,7 @@ Get an edge on a 3D solid.
```js ```js
getEdge(tag: TagIdentifier, extrude_group: ExtrudeGroup) -> Uuid getEdge(tag: String, extrude_group: ExtrudeGroup) -> Uuid
``` ```
### Examples ### Examples
@ -17,7 +17,7 @@ getEdge(tag: TagIdentifier, extrude_group: ExtrudeGroup) -> Uuid
```js ```js
const box = startSketchOn('XZ') const box = startSketchOn('XZ')
|> startProfileAt([0, 0], %) |> startProfileAt([0, 0], %)
|> line([0, 10], %, $revolveAxis) |> line([0, 10], %, 'revolveAxis')
|> line([10, 0], %) |> line([10, 0], %)
|> line([0, -10], %) |> line([0, -10], %)
|> close(%) |> close(%)
@ -30,7 +30,7 @@ const revolution = startSketchOn(box, "revolveAxis")
|> line([0, -10], %) |> line([0, -10], %)
|> close(%) |> close(%)
|> revolve({ |> revolve({
axis: getEdge(revolveAxis, box), axis: getEdge('revolveAxis', box),
angle: 90 angle: 90
}, %) }, %)
``` ```
@ -39,193 +39,26 @@ const revolution = startSketchOn(box, "revolveAxis")
### Arguments ### Arguments
* `tag`: `TagIdentifier` (REQUIRED) * `tag`: `String` (REQUIRED)
```js
{
value: string,
}
```
* `extrude_group`: `ExtrudeGroup` - An extrude group is a collection of extrude surfaces. (REQUIRED) * `extrude_group`: `ExtrudeGroup` - An extrude group is a collection of extrude surfaces. (REQUIRED)
```js ```js
{ {
// The id of the extrusion end cap // The id of the extrusion end cap
endCapId: uuid, 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. // The height of the extrude group.
height: number, height: number,
// The id of the extrude group. // The id of the extrude group.
id: uuid, id: uuid,
// The sketch group. // The position of the extrude group.
sketchGroup: { position: [number, number, number],
// The id of the sketch group. // The rotation of the extrude group.
id: uuid, rotation: [number, number, number, number],
// What the sketch is on (can be a plane or a face). // The sketch group paths.
on: { sketchGroupValues: [{
// 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 planes X axis be?
xAxis: {
x: number,
y: number,
z: number,
},
// What should the planes 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 faces X axis be?
xAxis: {
x: number,
y: number,
z: number,
},
// What should the faces 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. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// 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. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -237,12 +70,8 @@ const revolution = startSketchOn(box, "revolveAxis")
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -250,12 +79,8 @@ const revolution = startSketchOn(box, "revolveAxis")
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -263,12 +88,8 @@ const revolution = startSketchOn(box, "revolveAxis")
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -278,12 +99,8 @@ const revolution = startSketchOn(box, "revolveAxis")
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -295,17 +112,12 @@ const revolution = startSketchOn(box, "revolveAxis")
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",
}], }],
},
// The id of the extrusion start cap // The id of the extrusion start cap
startCapId: uuid, startCapId: uuid,
// The extrude surfaces. // The extrude surfaces.
@ -314,14 +126,14 @@ const revolution = startSketchOn(box, "revolveAxis")
faceId: uuid, faceId: uuid,
// The id of the geometry. // The id of the geometry.
id: uuid, id: uuid,
// The name.
name: string,
// The position.
position: [number, number, number],
// The rotation.
rotation: [number, number, number, number],
// The source range. // The source range.
sourceRange: [number, number], sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane", type: "extrudePlane",
} | } |
{ {
@ -329,16 +141,34 @@ const revolution = startSketchOn(box, "revolveAxis")
faceId: uuid, faceId: uuid,
// The id of the geometry. // The id of the geometry.
id: uuid, id: uuid,
// The name.
name: string,
// The position.
position: [number, number, number],
// The rotation.
rotation: [number, number, number, number],
// The source range. // The source range.
sourceRange: [number, number], sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc", 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,
},
} }
``` ```

View File

@ -9,7 +9,7 @@ Get the next adjacent edge to the edge given.
```js ```js
getNextAdjacentEdge(tag: TagIdentifier, extrude_group: ExtrudeGroup) -> Uuid getNextAdjacentEdge(tag: String, extrude_group: ExtrudeGroup) -> Uuid
``` ```
### Examples ### Examples
@ -21,13 +21,15 @@ const exampleSketch = startSketchOn('XZ')
|> angledLine({ angle: 60, length: 10 }, %) |> angledLine({ angle: 60, length: 10 }, %)
|> angledLine({ angle: 120, length: 10 }, %) |> angledLine({ angle: 120, length: 10 }, %)
|> line([-10, 0], %) |> line([-10, 0], %)
|> angledLine({ angle: 240, length: 10 }, %, $referenceEdge) |> angledLine({ angle: 240, length: 10 }, %, 'referenceEdge')
|> close(%) |> close(%)
const example = extrude(5, exampleSketch) const example = extrude(5, exampleSketch)
|> fillet({ |> fillet({
radius: 3, radius: 3,
tags: [getNextAdjacentEdge(referenceEdge, %)] tags: [
getNextAdjacentEdge("referenceEdge", %)
]
}, %) }, %)
``` ```
@ -35,193 +37,26 @@ const example = extrude(5, exampleSketch)
### Arguments ### Arguments
* `tag`: `TagIdentifier` (REQUIRED) * `tag`: `String` (REQUIRED)
```js
{
value: string,
}
```
* `extrude_group`: `ExtrudeGroup` - An extrude group is a collection of extrude surfaces. (REQUIRED) * `extrude_group`: `ExtrudeGroup` - An extrude group is a collection of extrude surfaces. (REQUIRED)
```js ```js
{ {
// The id of the extrusion end cap // The id of the extrusion end cap
endCapId: uuid, 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. // The height of the extrude group.
height: number, height: number,
// The id of the extrude group. // The id of the extrude group.
id: uuid, id: uuid,
// The sketch group. // The position of the extrude group.
sketchGroup: { position: [number, number, number],
// The id of the sketch group. // The rotation of the extrude group.
id: uuid, rotation: [number, number, number, number],
// What the sketch is on (can be a plane or a face). // The sketch group paths.
on: { sketchGroupValues: [{
// 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 planes X axis be?
xAxis: {
x: number,
y: number,
z: number,
},
// What should the planes 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 faces X axis be?
xAxis: {
x: number,
y: number,
z: number,
},
// What should the faces 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. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// 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. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -233,12 +68,8 @@ const example = extrude(5, exampleSketch)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -246,12 +77,8 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -259,12 +86,8 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -274,12 +97,8 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -291,17 +110,12 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",
}], }],
},
// The id of the extrusion start cap // The id of the extrusion start cap
startCapId: uuid, startCapId: uuid,
// The extrude surfaces. // The extrude surfaces.
@ -310,14 +124,14 @@ const example = extrude(5, exampleSketch)
faceId: uuid, faceId: uuid,
// The id of the geometry. // The id of the geometry.
id: uuid, id: uuid,
// The name.
name: string,
// The position.
position: [number, number, number],
// The rotation.
rotation: [number, number, number, number],
// The source range. // The source range.
sourceRange: [number, number], sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane", type: "extrudePlane",
} | } |
{ {
@ -325,16 +139,34 @@ const example = extrude(5, exampleSketch)
faceId: uuid, faceId: uuid,
// The id of the geometry. // The id of the geometry.
id: uuid, id: uuid,
// The name.
name: string,
// The position.
position: [number, number, number],
// The rotation.
rotation: [number, number, number, number],
// The source range. // The source range.
sourceRange: [number, number], sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc", 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,
},
} }
``` ```

View File

@ -9,7 +9,7 @@ Get the opposite edge to the edge given.
```js ```js
getOppositeEdge(tag: TagIdentifier, extrude_group: ExtrudeGroup) -> Uuid getOppositeEdge(tag: String, extrude_group: ExtrudeGroup) -> Uuid
``` ```
### Examples ### Examples
@ -21,13 +21,13 @@ const exampleSketch = startSketchOn('XZ')
|> angledLine({ angle: 60, length: 10 }, %) |> angledLine({ angle: 60, length: 10 }, %)
|> angledLine({ angle: 120, length: 10 }, %) |> angledLine({ angle: 120, length: 10 }, %)
|> line([-10, 0], %) |> line([-10, 0], %)
|> angledLine({ angle: 240, length: 10 }, %, $referenceEdge) |> angledLine({ angle: 240, length: 10 }, %, 'referenceEdge')
|> close(%) |> close(%)
const example = extrude(5, exampleSketch) const example = extrude(5, exampleSketch)
|> fillet({ |> fillet({
radius: 3, radius: 3,
tags: [getOppositeEdge(referenceEdge, %)] tags: [getOppositeEdge("referenceEdge", %)]
}, %) }, %)
``` ```
@ -35,193 +35,26 @@ const example = extrude(5, exampleSketch)
### Arguments ### Arguments
* `tag`: `TagIdentifier` (REQUIRED) * `tag`: `String` (REQUIRED)
```js
{
value: string,
}
```
* `extrude_group`: `ExtrudeGroup` - An extrude group is a collection of extrude surfaces. (REQUIRED) * `extrude_group`: `ExtrudeGroup` - An extrude group is a collection of extrude surfaces. (REQUIRED)
```js ```js
{ {
// The id of the extrusion end cap // The id of the extrusion end cap
endCapId: uuid, 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. // The height of the extrude group.
height: number, height: number,
// The id of the extrude group. // The id of the extrude group.
id: uuid, id: uuid,
// The sketch group. // The position of the extrude group.
sketchGroup: { position: [number, number, number],
// The id of the sketch group. // The rotation of the extrude group.
id: uuid, rotation: [number, number, number, number],
// What the sketch is on (can be a plane or a face). // The sketch group paths.
on: { sketchGroupValues: [{
// 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 planes X axis be?
xAxis: {
x: number,
y: number,
z: number,
},
// What should the planes 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 faces X axis be?
xAxis: {
x: number,
y: number,
z: number,
},
// What should the faces 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. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// 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. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -233,12 +66,8 @@ const example = extrude(5, exampleSketch)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -246,12 +75,8 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -259,12 +84,8 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -274,12 +95,8 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -291,17 +108,12 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",
}], }],
},
// The id of the extrusion start cap // The id of the extrusion start cap
startCapId: uuid, startCapId: uuid,
// The extrude surfaces. // The extrude surfaces.
@ -310,14 +122,14 @@ const example = extrude(5, exampleSketch)
faceId: uuid, faceId: uuid,
// The id of the geometry. // The id of the geometry.
id: uuid, id: uuid,
// The name.
name: string,
// The position.
position: [number, number, number],
// The rotation.
rotation: [number, number, number, number],
// The source range. // The source range.
sourceRange: [number, number], sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane", type: "extrudePlane",
} | } |
{ {
@ -325,16 +137,34 @@ const example = extrude(5, exampleSketch)
faceId: uuid, faceId: uuid,
// The id of the geometry. // The id of the geometry.
id: uuid, id: uuid,
// The name.
name: string,
// The position.
position: [number, number, number],
// The rotation.
rotation: [number, number, number, number],
// The source range. // The source range.
sourceRange: [number, number], sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc", 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,
},
} }
``` ```

View File

@ -9,7 +9,7 @@ Get the previous adjacent edge to the edge given.
```js ```js
getPreviousAdjacentEdge(tag: TagIdentifier, extrude_group: ExtrudeGroup) -> Uuid getPreviousAdjacentEdge(tag: String, extrude_group: ExtrudeGroup) -> Uuid
``` ```
### Examples ### Examples
@ -21,14 +21,14 @@ const exampleSketch = startSketchOn('XZ')
|> angledLine({ angle: 60, length: 10 }, %) |> angledLine({ angle: 60, length: 10 }, %)
|> angledLine({ angle: 120, length: 10 }, %) |> angledLine({ angle: 120, length: 10 }, %)
|> line([-10, 0], %) |> line([-10, 0], %)
|> angledLine({ angle: 240, length: 10 }, %, $referenceEdge) |> angledLine({ angle: 240, length: 10 }, %, 'referenceEdge')
|> close(%) |> close(%)
const example = extrude(5, exampleSketch) const example = extrude(5, exampleSketch)
|> fillet({ |> fillet({
radius: 3, radius: 3,
tags: [ tags: [
getPreviousAdjacentEdge(referenceEdge, %) getPreviousAdjacentEdge("referenceEdge", %)
] ]
}, %) }, %)
``` ```
@ -37,193 +37,26 @@ const example = extrude(5, exampleSketch)
### Arguments ### Arguments
* `tag`: `TagIdentifier` (REQUIRED) * `tag`: `String` (REQUIRED)
```js
{
value: string,
}
```
* `extrude_group`: `ExtrudeGroup` - An extrude group is a collection of extrude surfaces. (REQUIRED) * `extrude_group`: `ExtrudeGroup` - An extrude group is a collection of extrude surfaces. (REQUIRED)
```js ```js
{ {
// The id of the extrusion end cap // The id of the extrusion end cap
endCapId: uuid, 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. // The height of the extrude group.
height: number, height: number,
// The id of the extrude group. // The id of the extrude group.
id: uuid, id: uuid,
// The sketch group. // The position of the extrude group.
sketchGroup: { position: [number, number, number],
// The id of the sketch group. // The rotation of the extrude group.
id: uuid, rotation: [number, number, number, number],
// What the sketch is on (can be a plane or a face). // The sketch group paths.
on: { sketchGroupValues: [{
// 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 planes X axis be?
xAxis: {
x: number,
y: number,
z: number,
},
// What should the planes 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 faces X axis be?
xAxis: {
x: number,
y: number,
z: number,
},
// What should the faces 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. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// 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. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -235,12 +68,8 @@ const example = extrude(5, exampleSketch)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -248,12 +77,8 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -261,12 +86,8 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -276,12 +97,8 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -293,17 +110,12 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",
}], }],
},
// The id of the extrusion start cap // The id of the extrusion start cap
startCapId: uuid, startCapId: uuid,
// The extrude surfaces. // The extrude surfaces.
@ -312,14 +124,14 @@ const example = extrude(5, exampleSketch)
faceId: uuid, faceId: uuid,
// The id of the geometry. // The id of the geometry.
id: uuid, id: uuid,
// The name.
name: string,
// The position.
position: [number, number, number],
// The rotation.
rotation: [number, number, number, number],
// The source range. // The source range.
sourceRange: [number, number], sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane", type: "extrudePlane",
} | } |
{ {
@ -327,16 +139,34 @@ const example = extrude(5, exampleSketch)
faceId: uuid, faceId: uuid,
// The id of the geometry. // The id of the geometry.
id: uuid, id: uuid,
// The name.
name: string,
// The position.
position: [number, number, number],
// The rotation.
rotation: [number, number, number, number],
// The source range. // The source range.
sourceRange: [number, number], sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc", 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,
},
} }
``` ```

View File

@ -48,182 +48,20 @@ const part001 = startSketchOn('XY')
{ {
// The id of the extrusion end cap // The id of the extrusion end cap
endCapId: uuid, 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. // The height of the extrude group.
height: number, height: number,
// The id of the extrude group. // The id of the extrude group.
id: uuid, id: uuid,
// The sketch group. // The position of the extrude group.
sketchGroup: { position: [number, number, number],
// The id of the sketch group. // The rotation of the extrude group.
id: uuid, rotation: [number, number, number, number],
// What the sketch is on (can be a plane or a face). // The sketch group paths.
on: { sketchGroupValues: [{
// 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 planes X axis be?
xAxis: {
x: number,
y: number,
z: number,
},
// What should the planes 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 faces X axis be?
xAxis: {
x: number,
y: number,
z: number,
},
// What should the faces 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. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// 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. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -235,12 +73,8 @@ const part001 = startSketchOn('XY')
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -248,12 +82,8 @@ const part001 = startSketchOn('XY')
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -261,12 +91,8 @@ const part001 = startSketchOn('XY')
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -276,12 +102,8 @@ const part001 = startSketchOn('XY')
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -293,17 +115,12 @@ const part001 = startSketchOn('XY')
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",
}], }],
},
// The id of the extrusion start cap // The id of the extrusion start cap
startCapId: uuid, startCapId: uuid,
// The extrude surfaces. // The extrude surfaces.
@ -312,14 +129,14 @@ const part001 = startSketchOn('XY')
faceId: uuid, faceId: uuid,
// The id of the geometry. // The id of the geometry.
id: uuid, id: uuid,
// The name.
name: string,
// The position.
position: [number, number, number],
// The rotation.
rotation: [number, number, number, number],
// The source range. // The source range.
sourceRange: [number, number], sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane", type: "extrudePlane",
} | } |
{ {
@ -327,16 +144,34 @@ const part001 = startSketchOn('XY')
faceId: uuid, faceId: uuid,
// The id of the geometry. // The id of the geometry.
id: uuid, id: uuid,
// The name.
name: string,
// The position.
position: [number, number, number],
// The rotation.
rotation: [number, number, number, number],
// The source range. // The source range.
sourceRange: [number, number], sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc", 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,
},
} }
``` ```
@ -347,182 +182,20 @@ const part001 = startSketchOn('XY')
{ {
// The id of the extrusion end cap // The id of the extrusion end cap
endCapId: uuid, 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. // The height of the extrude group.
height: number, height: number,
// The id of the extrude group. // The id of the extrude group.
id: uuid, id: uuid,
// The sketch group. // The position of the extrude group.
sketchGroup: { position: [number, number, number],
// The id of the sketch group. // The rotation of the extrude group.
id: uuid, rotation: [number, number, number, number],
// What the sketch is on (can be a plane or a face). // The sketch group paths.
on: { sketchGroupValues: [{
// 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 planes X axis be?
xAxis: {
x: number,
y: number,
z: number,
},
// What should the planes 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 faces X axis be?
xAxis: {
x: number,
y: number,
z: number,
},
// What should the faces 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. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// 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. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -534,12 +207,8 @@ const part001 = startSketchOn('XY')
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -547,12 +216,8 @@ const part001 = startSketchOn('XY')
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -560,12 +225,8 @@ const part001 = startSketchOn('XY')
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -575,12 +236,8 @@ const part001 = startSketchOn('XY')
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -592,17 +249,12 @@ const part001 = startSketchOn('XY')
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",
}], }],
},
// The id of the extrusion start cap // The id of the extrusion start cap
startCapId: uuid, startCapId: uuid,
// The extrude surfaces. // The extrude surfaces.
@ -611,14 +263,14 @@ const part001 = startSketchOn('XY')
faceId: uuid, faceId: uuid,
// The id of the geometry. // The id of the geometry.
id: uuid, id: uuid,
// The name.
name: string,
// The position.
position: [number, number, number],
// The rotation.
rotation: [number, number, number, number],
// The source range. // The source range.
sourceRange: [number, number], sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane", type: "extrudePlane",
} | } |
{ {
@ -626,16 +278,34 @@ const part001 = startSketchOn('XY')
faceId: uuid, faceId: uuid,
// The id of the geometry. // The id of the geometry.
id: uuid, id: uuid,
// The name.
name: string,
// The position.
position: [number, number, number],
// The rotation.
rotation: [number, number, number, number],
// The source range. // The source range.
sourceRange: [number, number], sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc", 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,
},
} }
``` ```

View File

@ -53,6 +53,8 @@ const example = extrude(1, exampleSketch)
* `hole_sketch_group`: `SketchGroupSet` - A sketch group or a group of sketch groups. (REQUIRED) * `hole_sketch_group`: `SketchGroupSet` - A sketch group or a group of sketch groups. (REQUIRED)
```js ```js
{ {
// The plane id or face id of the sketch group.
entityId: uuid,
// The id of the sketch group. // The id of the sketch group.
id: uuid, id: uuid,
// What the sketch is on (can be a plane or a face). // What the sketch is on (can be a plane or a face).
@ -88,181 +90,12 @@ const example = extrude(1, exampleSketch)
}, },
} | } |
{ {
// The extrude group the face is on. // the face id the sketch 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],
},
// 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, faceId: 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. // The id of the face.
id: uuid, id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face", type: "face",
// The tag of the face. // The tag of the face.
value: string, value: string,
@ -285,16 +118,16 @@ const example = extrude(1, exampleSketch)
z: number, 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. // The starting path.
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -303,12 +136,8 @@ const example = extrude(1, exampleSketch)
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -320,12 +149,8 @@ const example = extrude(1, exampleSketch)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -333,12 +158,8 @@ const example = extrude(1, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -346,12 +167,8 @@ const example = extrude(1, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -361,12 +178,8 @@ const example = extrude(1, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -378,16 +191,30 @@ const example = extrude(1, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", 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", type: "sketchGroups",
@ -396,6 +223,8 @@ const example = extrude(1, exampleSketch)
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED) * `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
```js ```js
{ {
// The plane id or face id of the sketch group.
entityId: uuid,
// The id of the sketch group. // The id of the sketch group.
id: uuid, id: uuid,
// What the sketch is on (can be a plane or a face). // What the sketch is on (can be a plane or a face).
@ -431,181 +260,12 @@ const example = extrude(1, exampleSketch)
}, },
} | } |
{ {
// The extrude group the face is on. // the face id the sketch 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],
},
// 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, faceId: 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. // The id of the face.
id: uuid, id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face", type: "face",
// The tag of the face. // The tag of the face.
value: string, value: string,
@ -628,16 +288,16 @@ const example = extrude(1, exampleSketch)
z: number, 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. // The starting path.
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -645,12 +305,8 @@ const example = extrude(1, exampleSketch)
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -662,12 +318,8 @@ const example = extrude(1, exampleSketch)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -675,12 +327,8 @@ const example = extrude(1, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -688,12 +336,8 @@ const example = extrude(1, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -703,12 +347,8 @@ const example = extrude(1, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -720,16 +360,30 @@ const example = extrude(1, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", 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,
},
} }
``` ```
@ -738,6 +392,8 @@ const example = extrude(1, exampleSketch)
`SketchGroup` - A sketch group is a collection of paths. `SketchGroup` - A sketch group is a collection of paths.
```js ```js
{ {
// The plane id or face id of the sketch group.
entityId: uuid,
// The id of the sketch group. // The id of the sketch group.
id: uuid, id: uuid,
// What the sketch is on (can be a plane or a face). // What the sketch is on (can be a plane or a face).
@ -773,181 +429,12 @@ const example = extrude(1, exampleSketch)
}, },
} | } |
{ {
// The extrude group the face is on. // the face id the sketch 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],
},
// 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, faceId: 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. // The id of the face.
id: uuid, id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face", type: "face",
// The tag of the face. // The tag of the face.
value: string, value: string,
@ -970,16 +457,16 @@ const example = extrude(1, exampleSketch)
z: number, 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. // The starting path.
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -987,12 +474,8 @@ const example = extrude(1, exampleSketch)
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -1004,12 +487,8 @@ const example = extrude(1, exampleSketch)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -1017,12 +496,8 @@ const example = extrude(1, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -1030,12 +505,8 @@ const example = extrude(1, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -1045,12 +516,8 @@ const example = extrude(1, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -1062,16 +529,30 @@ const example = extrude(1, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", 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,
},
} }
``` ```

View File

@ -23,7 +23,6 @@ layout: manual
* [`atan`](kcl/atan) * [`atan`](kcl/atan)
* [`bezierCurve`](kcl/bezierCurve) * [`bezierCurve`](kcl/bezierCurve)
* [`ceil`](kcl/ceil) * [`ceil`](kcl/ceil)
* [`chamfer`](kcl/chamfer)
* [`circle`](kcl/circle) * [`circle`](kcl/circle)
* [`close`](kcl/close) * [`close`](kcl/close)
* [`cos`](kcl/cos) * [`cos`](kcl/cos)
@ -55,7 +54,6 @@ layout: manual
* [`patternCircular3d`](kcl/patternCircular3d) * [`patternCircular3d`](kcl/patternCircular3d)
* [`patternLinear2d`](kcl/patternLinear2d) * [`patternLinear2d`](kcl/patternLinear2d)
* [`patternLinear3d`](kcl/patternLinear3d) * [`patternLinear3d`](kcl/patternLinear3d)
* [`patternTransform`](kcl/patternTransform)
* [`pi`](kcl/pi) * [`pi`](kcl/pi)
* [`pow`](kcl/pow) * [`pow`](kcl/pow)
* [`profileStart`](kcl/profileStart) * [`profileStart`](kcl/profileStart)
@ -66,7 +64,6 @@ layout: manual
* [`segEndX`](kcl/segEndX) * [`segEndX`](kcl/segEndX)
* [`segEndY`](kcl/segEndY) * [`segEndY`](kcl/segEndY)
* [`segLen`](kcl/segLen) * [`segLen`](kcl/segLen)
* [`shell`](kcl/shell)
* [`sin`](kcl/sin) * [`sin`](kcl/sin)
* [`sqrt`](kcl/sqrt) * [`sqrt`](kcl/sqrt)
* [`startProfileAt`](kcl/startProfileAt) * [`startProfileAt`](kcl/startProfileAt)

View File

@ -33,6 +33,8 @@ const example = extrude(5, exampleSketch)
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED) * `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
```js ```js
{ {
// The plane id or face id of the sketch group.
entityId: uuid,
// The id of the sketch group. // The id of the sketch group.
id: uuid, id: uuid,
// What the sketch is on (can be a plane or a face). // What the sketch is on (can be a plane or a face).
@ -68,181 +70,12 @@ const example = extrude(5, exampleSketch)
}, },
} | } |
{ {
// The extrude group the face is on. // the face id the sketch 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],
},
// 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, faceId: 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. // The id of the face.
id: uuid, id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face", type: "face",
// The tag of the face. // The tag of the face.
value: string, value: string,
@ -265,16 +98,16 @@ const example = extrude(5, exampleSketch)
z: number, 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. // The starting path.
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -282,12 +115,8 @@ const example = extrude(5, exampleSketch)
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -299,12 +128,8 @@ const example = extrude(5, exampleSketch)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -312,12 +137,8 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -325,12 +146,8 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -340,12 +157,8 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -357,16 +170,30 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", 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,
},
} }
``` ```

View File

@ -33,6 +33,8 @@ const example = extrude(5, exampleSketch)
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED) * `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
```js ```js
{ {
// The plane id or face id of the sketch group.
entityId: uuid,
// The id of the sketch group. // The id of the sketch group.
id: uuid, id: uuid,
// What the sketch is on (can be a plane or a face). // What the sketch is on (can be a plane or a face).
@ -68,181 +70,12 @@ const example = extrude(5, exampleSketch)
}, },
} | } |
{ {
// The extrude group the face is on. // the face id the sketch 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],
},
// 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, faceId: 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. // The id of the face.
id: uuid, id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face", type: "face",
// The tag of the face. // The tag of the face.
value: string, value: string,
@ -265,16 +98,16 @@ const example = extrude(5, exampleSketch)
z: number, 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. // The starting path.
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -282,12 +115,8 @@ const example = extrude(5, exampleSketch)
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -299,12 +128,8 @@ const example = extrude(5, exampleSketch)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -312,12 +137,8 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -325,12 +146,8 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -340,12 +157,8 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -357,16 +170,30 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", 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,
},
} }
``` ```

View File

@ -9,7 +9,7 @@ Draw a line.
```js ```js
line(delta: [number], sketch_group: SketchGroup, tag?: TagDeclarator) -> SketchGroup line(delta: [number], sketch_group: SketchGroup, tag?: String) -> SketchGroup
``` ```
### Examples ### Examples
@ -46,6 +46,8 @@ const example = extrude(5, exampleSketch)
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED) * `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
```js ```js
{ {
// The plane id or face id of the sketch group.
entityId: uuid,
// The id of the sketch group. // The id of the sketch group.
id: uuid, id: uuid,
// What the sketch is on (can be a plane or a face). // What the sketch is on (can be a plane or a face).
@ -81,181 +83,12 @@ const example = extrude(5, exampleSketch)
}, },
} | } |
{ {
// The extrude group the face is on. // the face id the sketch 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],
},
// 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, faceId: 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. // The id of the face.
id: uuid, id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face", type: "face",
// The tag of the face. // The tag of the face.
value: string, value: string,
@ -278,16 +111,16 @@ const example = extrude(5, exampleSketch)
z: number, 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. // The starting path.
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -295,12 +128,8 @@ const example = extrude(5, exampleSketch)
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -312,12 +141,8 @@ const example = extrude(5, exampleSketch)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -325,12 +150,8 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -338,12 +159,8 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -353,12 +170,8 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -370,32 +183,41 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", 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) * `tag`: `String` (OPTIONAL)
```js
{
end: number,
start: number,
value: string,
}
```
### Returns ### Returns
`SketchGroup` - A sketch group is a collection of paths. `SketchGroup` - A sketch group is a collection of paths.
```js ```js
{ {
// The plane id or face id of the sketch group.
entityId: uuid,
// The id of the sketch group. // The id of the sketch group.
id: uuid, id: uuid,
// What the sketch is on (can be a plane or a face). // What the sketch is on (can be a plane or a face).
@ -431,181 +253,12 @@ const example = extrude(5, exampleSketch)
}, },
} | } |
{ {
// The extrude group the face is on. // the face id the sketch 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],
},
// 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, faceId: 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. // The id of the face.
id: uuid, id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face", type: "face",
// The tag of the face. // The tag of the face.
value: string, value: string,
@ -628,16 +281,16 @@ const example = extrude(5, exampleSketch)
z: number, 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. // The starting path.
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -645,12 +298,8 @@ const example = extrude(5, exampleSketch)
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -662,12 +311,8 @@ const example = extrude(5, exampleSketch)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -675,12 +320,8 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -688,12 +329,8 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -703,12 +340,8 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -720,16 +353,30 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", 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,
},
} }
``` ```

View File

@ -9,7 +9,7 @@ Draw a line to a point.
```js ```js
lineTo(to: [number], sketch_group: SketchGroup, tag?: TagDeclarator) -> SketchGroup lineTo(to: [number], sketch_group: SketchGroup, tag?: String) -> SketchGroup
``` ```
### Examples ### Examples
@ -33,6 +33,8 @@ const example = extrude(5, exampleSketch)
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED) * `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
```js ```js
{ {
// The plane id or face id of the sketch group.
entityId: uuid,
// The id of the sketch group. // The id of the sketch group.
id: uuid, id: uuid,
// What the sketch is on (can be a plane or a face). // What the sketch is on (can be a plane or a face).
@ -68,181 +70,12 @@ const example = extrude(5, exampleSketch)
}, },
} | } |
{ {
// The extrude group the face is on. // the face id the sketch 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],
},
// 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, faceId: 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. // The id of the face.
id: uuid, id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face", type: "face",
// The tag of the face. // The tag of the face.
value: string, value: string,
@ -265,16 +98,16 @@ const example = extrude(5, exampleSketch)
z: number, 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. // The starting path.
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -282,12 +115,8 @@ const example = extrude(5, exampleSketch)
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -299,12 +128,8 @@ const example = extrude(5, exampleSketch)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -312,12 +137,8 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -325,12 +146,8 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -340,12 +157,8 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -357,32 +170,41 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", 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) * `tag`: `String` (OPTIONAL)
```js
{
end: number,
start: number,
value: string,
}
```
### Returns ### Returns
`SketchGroup` - A sketch group is a collection of paths. `SketchGroup` - A sketch group is a collection of paths.
```js ```js
{ {
// The plane id or face id of the sketch group.
entityId: uuid,
// The id of the sketch group. // The id of the sketch group.
id: uuid, id: uuid,
// What the sketch is on (can be a plane or a face). // What the sketch is on (can be a plane or a face).
@ -418,181 +240,12 @@ const example = extrude(5, exampleSketch)
}, },
} | } |
{ {
// The extrude group the face is on. // the face id the sketch 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],
},
// 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, faceId: 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. // The id of the face.
id: uuid, id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face", type: "face",
// The tag of the face. // The tag of the face.
value: string, value: string,
@ -615,16 +268,16 @@ const example = extrude(5, exampleSketch)
z: number, 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. // The starting path.
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -632,12 +285,8 @@ const example = extrude(5, exampleSketch)
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -649,12 +298,8 @@ const example = extrude(5, exampleSketch)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -662,12 +307,8 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -675,12 +316,8 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -690,12 +327,8 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -707,16 +340,30 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", 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,
},
} }
``` ```

View File

@ -9,7 +9,7 @@ A circular pattern on a 2D sketch.
```js ```js
patternCircular2d(data: CircularPattern2dData, sketch_group_set: SketchGroupSet) -> [SketchGroup] patternCircular2d(data: CircularPattern2dData, sketch_group: SketchGroup) -> [SketchGroup]
``` ```
### Examples ### Examples
@ -48,9 +48,11 @@ const example = extrude(1, exampleSketch)
rotateDuplicates: string, 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 ```js
{ {
// The plane id or face id of the sketch group.
entityId: uuid,
// The id of the sketch group. // The id of the sketch group.
id: uuid, id: uuid,
// What the sketch is on (can be a plane or a face). // What the sketch is on (can be a plane or a face).
@ -86,181 +88,12 @@ const example = extrude(1, exampleSketch)
}, },
} | } |
{ {
// The extrude group the face is on. // the face id the sketch 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],
},
// 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, faceId: 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. // The id of the face.
id: uuid, id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face", type: "face",
// The tag of the face. // The tag of the face.
value: string, value: string,
@ -283,30 +116,25 @@ const example = extrude(1, exampleSketch)
z: number, 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. // The starting path.
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
type: "sketchGroup",
// The paths in the sketch group. // The paths in the sketch group.
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -318,12 +146,8 @@ const example = extrude(1, exampleSketch)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -331,12 +155,8 @@ const example = extrude(1, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -344,12 +164,8 @@ const example = extrude(1, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -359,12 +175,8 @@ const example = extrude(1, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -376,19 +188,30 @@ const example = extrude(1, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",
}], }],
} | // The x-axis of the sketch group base plane in the 3D space
{ xAxis: {
type: "sketchGroups", 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,
},
} }
``` ```

View File

@ -9,7 +9,7 @@ A circular pattern on a 3D model.
```js ```js
patternCircular3d(data: CircularPattern3dData, extrude_group_set: ExtrudeGroupSet) -> [ExtrudeGroup] patternCircular3d(data: CircularPattern3dData, extrude_group: ExtrudeGroup) -> [ExtrudeGroup]
``` ```
### Examples ### Examples
@ -47,187 +47,25 @@ const example = extrude(-5, exampleSketch)
rotateDuplicates: string, 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 ```js
{ {
// The id of the extrusion end cap // The id of the extrusion end cap
endCapId: uuid, 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. // The height of the extrude group.
height: number, height: number,
// The id of the extrude group. // The id of the extrude group.
id: uuid, id: uuid,
// The sketch group. // The position of the extrude group.
sketchGroup: { position: [number, number, number],
// The id of the sketch group. // The rotation of the extrude group.
id: uuid, rotation: [number, number, number, number],
// What the sketch is on (can be a plane or a face). // The sketch group paths.
on: { sketchGroupValues: [{
// 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 planes X axis be?
xAxis: {
x: number,
y: number,
z: number,
},
// What should the planes 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 faces X axis be?
xAxis: {
x: number,
y: number,
z: number,
},
// What should the faces 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. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// 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. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -239,12 +77,8 @@ const example = extrude(-5, exampleSketch)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -252,12 +86,8 @@ const example = extrude(-5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -265,12 +95,8 @@ const example = extrude(-5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -280,12 +106,8 @@ const example = extrude(-5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -297,34 +119,28 @@ const example = extrude(-5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",
}], }],
},
// The id of the extrusion start cap // The id of the extrusion start cap
startCapId: uuid, startCapId: uuid,
type: "extrudeGroup",
// The extrude surfaces. // The extrude surfaces.
value: [{ value: [{
// The face id for the extrude plane. // The face id for the extrude plane.
faceId: uuid, faceId: uuid,
// The id of the geometry. // The id of the geometry.
id: uuid, id: uuid,
// The name.
name: string,
// The position.
position: [number, number, number],
// The rotation.
rotation: [number, number, number, number],
// The source range. // The source range.
sourceRange: [number, number], sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane", type: "extrudePlane",
} | } |
{ {
@ -332,19 +148,34 @@ const example = extrude(-5, exampleSketch)
faceId: uuid, faceId: uuid,
// The id of the geometry. // The id of the geometry.
id: uuid, id: uuid,
// The name.
name: string,
// The position.
position: [number, number, number],
// The rotation.
rotation: [number, number, number, number],
// The source range. // The source range.
sourceRange: [number, number], sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc", type: "extrudeArc",
}], }],
} | // The x-axis of the extrude group base plane in the 3D space
{ xAxis: {
type: "extrudeGroups", 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,
},
} }
``` ```

View File

@ -44,6 +44,8 @@ const example = extrude(1, exampleSketch)
* `sketch_group_set`: `SketchGroupSet` - A sketch group or a group of sketch groups. (REQUIRED) * `sketch_group_set`: `SketchGroupSet` - A sketch group or a group of sketch groups. (REQUIRED)
```js ```js
{ {
// The plane id or face id of the sketch group.
entityId: uuid,
// The id of the sketch group. // The id of the sketch group.
id: uuid, id: uuid,
// What the sketch is on (can be a plane or a face). // What the sketch is on (can be a plane or a face).
@ -79,181 +81,12 @@ const example = extrude(1, exampleSketch)
}, },
} | } |
{ {
// The extrude group the face is on. // the face id the sketch 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],
},
// 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, faceId: 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. // The id of the face.
id: uuid, id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face", type: "face",
// The tag of the face. // The tag of the face.
value: string, value: string,
@ -276,16 +109,16 @@ const example = extrude(1, exampleSketch)
z: number, 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. // The starting path.
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -294,12 +127,8 @@ const example = extrude(1, exampleSketch)
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -311,12 +140,8 @@ const example = extrude(1, exampleSketch)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -324,12 +149,8 @@ const example = extrude(1, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -337,12 +158,8 @@ const example = extrude(1, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -352,12 +169,8 @@ const example = extrude(1, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -369,16 +182,30 @@ const example = extrude(1, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", 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", type: "sketchGroups",

View File

@ -9,7 +9,7 @@ A linear pattern on a 3D model.
```js ```js
patternLinear3d(data: LinearPattern3dData, extrude_group_set: ExtrudeGroupSet) -> [ExtrudeGroup] patternLinear3d(data: LinearPattern3dData, extrude_group: ExtrudeGroup) -> [ExtrudeGroup]
``` ```
### Examples ### Examples
@ -45,187 +45,25 @@ const example = extrude(1, exampleSketch)
repetitions: number, 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 ```js
{ {
// The id of the extrusion end cap // The id of the extrusion end cap
endCapId: uuid, 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. // The height of the extrude group.
height: number, height: number,
// The id of the extrude group. // The id of the extrude group.
id: uuid, id: uuid,
// The sketch group. // The position of the extrude group.
sketchGroup: { position: [number, number, number],
// The id of the sketch group. // The rotation of the extrude group.
id: uuid, rotation: [number, number, number, number],
// What the sketch is on (can be a plane or a face). // The sketch group paths.
on: { sketchGroupValues: [{
// 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 planes X axis be?
xAxis: {
x: number,
y: number,
z: number,
},
// What should the planes 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 faces X axis be?
xAxis: {
x: number,
y: number,
z: number,
},
// What should the faces 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. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// 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. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -237,12 +75,8 @@ const example = extrude(1, exampleSketch)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -250,12 +84,8 @@ const example = extrude(1, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -263,12 +93,8 @@ const example = extrude(1, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -278,12 +104,8 @@ const example = extrude(1, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -295,34 +117,28 @@ const example = extrude(1, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",
}], }],
},
// The id of the extrusion start cap // The id of the extrusion start cap
startCapId: uuid, startCapId: uuid,
type: "extrudeGroup",
// The extrude surfaces. // The extrude surfaces.
value: [{ value: [{
// The face id for the extrude plane. // The face id for the extrude plane.
faceId: uuid, faceId: uuid,
// The id of the geometry. // The id of the geometry.
id: uuid, id: uuid,
// The name.
name: string,
// The position.
position: [number, number, number],
// The rotation.
rotation: [number, number, number, number],
// The source range. // The source range.
sourceRange: [number, number], sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane", type: "extrudePlane",
} | } |
{ {
@ -330,19 +146,34 @@ const example = extrude(1, exampleSketch)
faceId: uuid, faceId: uuid,
// The id of the geometry. // The id of the geometry.
id: uuid, id: uuid,
// The name.
name: string,
// The position.
position: [number, number, number],
// The rotation.
rotation: [number, number, number, number],
// The source range. // The source range.
sourceRange: [number, number], sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc", type: "extrudeArc",
}], }],
} | // The x-axis of the extrude group base plane in the 3D space
{ xAxis: {
type: "extrudeGroups", 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,
},
} }
``` ```

File diff suppressed because one or more lines are too long

View File

@ -17,9 +17,9 @@ profileStart(sketch_group: SketchGroup) -> [number]
```js ```js
const sketch001 = startSketchOn('XY') const sketch001 = startSketchOn('XY')
|> startProfileAt([5, 2], %) |> startProfileAt([5, 2], %)
|> angledLine({ angle: 120, length: 50 }, %, $seg01) |> angledLine({ angle: 120, length: 50 }, %, 'seg01')
|> angledLine({ |> angledLine({
angle: segAng(seg01, %) + 120, angle: segAng('seg01', %) + 120,
length: 50 length: 50
}, %) }, %)
|> lineTo(profileStart(%), %) |> lineTo(profileStart(%), %)
@ -34,6 +34,8 @@ const sketch001 = startSketchOn('XY')
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED) * `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
```js ```js
{ {
// The plane id or face id of the sketch group.
entityId: uuid,
// The id of the sketch group. // The id of the sketch group.
id: uuid, id: uuid,
// What the sketch is on (can be a plane or a face). // What the sketch is on (can be a plane or a face).
@ -69,181 +71,12 @@ const sketch001 = startSketchOn('XY')
}, },
} | } |
{ {
// The extrude group the face is on. // the face id the sketch 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],
},
// 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, faceId: 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. // The id of the face.
id: uuid, id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face", type: "face",
// The tag of the face. // The tag of the face.
value: string, value: string,
@ -266,16 +99,16 @@ const sketch001 = startSketchOn('XY')
z: number, 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. // The starting path.
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -283,12 +116,8 @@ const sketch001 = startSketchOn('XY')
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -300,12 +129,8 @@ const sketch001 = startSketchOn('XY')
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -313,12 +138,8 @@ const sketch001 = startSketchOn('XY')
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -326,12 +147,8 @@ const sketch001 = startSketchOn('XY')
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -341,12 +158,8 @@ const sketch001 = startSketchOn('XY')
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -358,16 +171,30 @@ const sketch001 = startSketchOn('XY')
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", 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,
},
} }
``` ```

View File

@ -29,6 +29,8 @@ const sketch001 = startSketchOn('XY')
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED) * `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
```js ```js
{ {
// The plane id or face id of the sketch group.
entityId: uuid,
// The id of the sketch group. // The id of the sketch group.
id: uuid, id: uuid,
// What the sketch is on (can be a plane or a face). // What the sketch is on (can be a plane or a face).
@ -64,181 +66,12 @@ const sketch001 = startSketchOn('XY')
}, },
} | } |
{ {
// The extrude group the face is on. // the face id the sketch 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],
},
// 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, faceId: 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. // The id of the face.
id: uuid, id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face", type: "face",
// The tag of the face. // The tag of the face.
value: string, value: string,
@ -261,16 +94,16 @@ const sketch001 = startSketchOn('XY')
z: number, 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. // The starting path.
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -278,12 +111,8 @@ const sketch001 = startSketchOn('XY')
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -295,12 +124,8 @@ const sketch001 = startSketchOn('XY')
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -308,12 +133,8 @@ const sketch001 = startSketchOn('XY')
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -321,12 +142,8 @@ const sketch001 = startSketchOn('XY')
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -336,12 +153,8 @@ const sketch001 = startSketchOn('XY')
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -353,16 +166,30 @@ const sketch001 = startSketchOn('XY')
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", 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,
},
} }
``` ```

View File

@ -28,6 +28,8 @@ const sketch001 = startSketchOn('XY')
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED) * `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
```js ```js
{ {
// The plane id or face id of the sketch group.
entityId: uuid,
// The id of the sketch group. // The id of the sketch group.
id: uuid, id: uuid,
// What the sketch is on (can be a plane or a face). // What the sketch is on (can be a plane or a face).
@ -63,181 +65,12 @@ const sketch001 = startSketchOn('XY')
}, },
} | } |
{ {
// The extrude group the face is on. // the face id the sketch 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],
},
// 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, faceId: 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. // The id of the face.
id: uuid, id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face", type: "face",
// The tag of the face. // The tag of the face.
value: string, value: string,
@ -260,16 +93,16 @@ const sketch001 = startSketchOn('XY')
z: number, 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. // The starting path.
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -277,12 +110,8 @@ const sketch001 = startSketchOn('XY')
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -294,12 +123,8 @@ const sketch001 = startSketchOn('XY')
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -307,12 +132,8 @@ const sketch001 = startSketchOn('XY')
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -320,12 +141,8 @@ const sketch001 = startSketchOn('XY')
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -335,12 +152,8 @@ const sketch001 = startSketchOn('XY')
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -352,16 +165,30 @@ const sketch001 = startSketchOn('XY')
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", 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,
},
} }
``` ```

File diff suppressed because one or more lines are too long

View File

@ -9,7 +9,7 @@ Returns the angle of the segment.
```js ```js
segAng(segment_name: TagIdentifier, sketch_group: SketchGroup) -> number segAng(segment_name: string, sketch_group: SketchGroup) -> number
``` ```
### Examples ### Examples
@ -18,11 +18,11 @@ segAng(segment_name: TagIdentifier, sketch_group: SketchGroup) -> number
const exampleSketch = startSketchOn('XZ') const exampleSketch = startSketchOn('XZ')
|> startProfileAt([0, 0], %) |> startProfileAt([0, 0], %)
|> line([10, 0], %) |> line([10, 0], %)
|> line([5, 10], %, $seg01) |> line([5, 10], %, 'seg01')
|> line([-10, 0], %) |> line([-10, 0], %)
|> angledLine([segAng(seg01, %), 10], %) |> angledLine([segAng('seg01', %), 10], %)
|> line([-10, 0], %) |> line([-10, 0], %)
|> angledLine([segAng(seg01, %), -15], %) |> angledLine([segAng('seg01', %), -15], %)
|> close(%) |> close(%)
const example = extrude(4, exampleSketch) const example = extrude(4, exampleSketch)
@ -32,15 +32,12 @@ const example = extrude(4, exampleSketch)
### Arguments ### Arguments
* `segment_name`: `TagIdentifier` (REQUIRED) * `segment_name`: `string` (REQUIRED)
```js
{
value: string,
}
```
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED) * `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
```js ```js
{ {
// The plane id or face id of the sketch group.
entityId: uuid,
// The id of the sketch group. // The id of the sketch group.
id: uuid, id: uuid,
// What the sketch is on (can be a plane or a face). // What the sketch is on (can be a plane or a face).
@ -76,181 +73,12 @@ const example = extrude(4, exampleSketch)
}, },
} | } |
{ {
// The extrude group the face is on. // the face id the sketch 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],
},
// 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, faceId: 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. // The id of the face.
id: uuid, id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face", type: "face",
// The tag of the face. // The tag of the face.
value: string, value: string,
@ -273,16 +101,16 @@ const example = extrude(4, exampleSketch)
z: number, 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. // The starting path.
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -290,12 +118,8 @@ const example = extrude(4, exampleSketch)
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -307,12 +131,8 @@ const example = extrude(4, exampleSketch)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -320,12 +140,8 @@ const example = extrude(4, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -333,12 +149,8 @@ const example = extrude(4, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -348,12 +160,8 @@ const example = extrude(4, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -365,16 +173,30 @@ const example = extrude(4, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", 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,
},
} }
``` ```

View File

@ -9,7 +9,7 @@ Returns the segment end of x.
```js ```js
segEndX(segment_name: TagIdentifier, sketch_group: SketchGroup) -> number segEndX(segment_name: string, sketch_group: SketchGroup) -> number
``` ```
### Examples ### Examples
@ -17,9 +17,9 @@ segEndX(segment_name: TagIdentifier, sketch_group: SketchGroup) -> number
```js ```js
const exampleSketch = startSketchOn('XZ') const exampleSketch = startSketchOn('XZ')
|> startProfileAt([0, 0], %) |> startProfileAt([0, 0], %)
|> line([20, 0], %, $thing) |> line([20, 0], %, "thing")
|> line([0, 5], %) |> line([0, 5], %)
|> line([segEndX(thing, %), 0], %) |> line([segEndX("thing", %), 0], %)
|> line([-20, 10], %) |> line([-20, 10], %)
|> close(%) |> close(%)
@ -30,15 +30,12 @@ const example = extrude(5, exampleSketch)
### Arguments ### Arguments
* `segment_name`: `TagIdentifier` (REQUIRED) * `segment_name`: `string` (REQUIRED)
```js
{
value: string,
}
```
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED) * `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
```js ```js
{ {
// The plane id or face id of the sketch group.
entityId: uuid,
// The id of the sketch group. // The id of the sketch group.
id: uuid, id: uuid,
// What the sketch is on (can be a plane or a face). // What the sketch is on (can be a plane or a face).
@ -74,181 +71,12 @@ const example = extrude(5, exampleSketch)
}, },
} | } |
{ {
// The extrude group the face is on. // the face id the sketch 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],
},
// 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, faceId: 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. // The id of the face.
id: uuid, id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face", type: "face",
// The tag of the face. // The tag of the face.
value: string, value: string,
@ -271,16 +99,16 @@ const example = extrude(5, exampleSketch)
z: number, 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. // The starting path.
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -288,12 +116,8 @@ const example = extrude(5, exampleSketch)
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -305,12 +129,8 @@ const example = extrude(5, exampleSketch)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -318,12 +138,8 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -331,12 +147,8 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -346,12 +158,8 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -363,16 +171,30 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", 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,
},
} }
``` ```

View File

@ -9,7 +9,7 @@ Returns the segment end of y.
```js ```js
segEndY(segment_name: TagIdentifier, sketch_group: SketchGroup) -> number segEndY(segment_name: string, sketch_group: SketchGroup) -> number
``` ```
### Examples ### Examples
@ -18,9 +18,9 @@ segEndY(segment_name: TagIdentifier, sketch_group: SketchGroup) -> number
const exampleSketch = startSketchOn('XZ') const exampleSketch = startSketchOn('XZ')
|> startProfileAt([0, 0], %) |> startProfileAt([0, 0], %)
|> line([20, 0], %) |> line([20, 0], %)
|> line([0, 3], %, $thing) |> line([0, 3], %, "thing")
|> line([-10, 0], %) |> line([-10, 0], %)
|> line([0, segEndY(thing, %)], %) |> line([0, segEndY("thing", %)], %)
|> line([-10, 0], %) |> line([-10, 0], %)
|> close(%) |> close(%)
@ -31,15 +31,12 @@ const example = extrude(5, exampleSketch)
### Arguments ### Arguments
* `segment_name`: `TagIdentifier` (REQUIRED) * `segment_name`: `string` (REQUIRED)
```js
{
value: string,
}
```
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED) * `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
```js ```js
{ {
// The plane id or face id of the sketch group.
entityId: uuid,
// The id of the sketch group. // The id of the sketch group.
id: uuid, id: uuid,
// What the sketch is on (can be a plane or a face). // What the sketch is on (can be a plane or a face).
@ -75,181 +72,12 @@ const example = extrude(5, exampleSketch)
}, },
} | } |
{ {
// The extrude group the face is on. // the face id the sketch 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],
},
// 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, faceId: 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. // The id of the face.
id: uuid, id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face", type: "face",
// The tag of the face. // The tag of the face.
value: string, value: string,
@ -272,16 +100,16 @@ const example = extrude(5, exampleSketch)
z: number, 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. // The starting path.
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -289,12 +117,8 @@ const example = extrude(5, exampleSketch)
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -306,12 +130,8 @@ const example = extrude(5, exampleSketch)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -319,12 +139,8 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -332,12 +148,8 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -347,12 +159,8 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -364,16 +172,30 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", 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,
},
} }
``` ```

View File

@ -9,7 +9,7 @@ Returns the length of the segment.
```js ```js
segLen(segment_name: TagIdentifier, sketch_group: SketchGroup) -> number segLen(segment_name: string, sketch_group: SketchGroup) -> number
``` ```
### Examples ### Examples
@ -17,9 +17,12 @@ segLen(segment_name: TagIdentifier, sketch_group: SketchGroup) -> number
```js ```js
const exampleSketch = startSketchOn("XZ") const exampleSketch = startSketchOn("XZ")
|> startProfileAt([0, 0], %) |> startProfileAt([0, 0], %)
|> angledLine({ angle: 60, length: 10 }, %, $thing) |> angledLine({ angle: 60, length: 10 }, %, "thing")
|> tangentialArc({ offset: -120, radius: 5 }, %) |> tangentialArc({ offset: -120, radius: 5 }, %)
|> angledLine({ angle: -60, length: segLen(thing, %) }, %) |> angledLine({
angle: -60,
length: segLen("thing", %)
}, %)
|> close(%) |> close(%)
const example = extrude(5, exampleSketch) const example = extrude(5, exampleSketch)
@ -29,15 +32,12 @@ const example = extrude(5, exampleSketch)
### Arguments ### Arguments
* `segment_name`: `TagIdentifier` (REQUIRED) * `segment_name`: `string` (REQUIRED)
```js
{
value: string,
}
```
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED) * `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
```js ```js
{ {
// The plane id or face id of the sketch group.
entityId: uuid,
// The id of the sketch group. // The id of the sketch group.
id: uuid, id: uuid,
// What the sketch is on (can be a plane or a face). // What the sketch is on (can be a plane or a face).
@ -73,181 +73,12 @@ const example = extrude(5, exampleSketch)
}, },
} | } |
{ {
// The extrude group the face is on. // the face id the sketch 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],
},
// 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, faceId: 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. // The id of the face.
id: uuid, id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face", type: "face",
// The tag of the face. // The tag of the face.
value: string, value: string,
@ -270,16 +101,16 @@ const example = extrude(5, exampleSketch)
z: number, 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. // The starting path.
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -287,12 +118,8 @@ const example = extrude(5, exampleSketch)
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -304,12 +131,8 @@ const example = extrude(5, exampleSketch)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -317,12 +140,8 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -330,12 +149,8 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -345,12 +160,8 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -362,16 +173,30 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", 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,
},
} }
``` ```

File diff suppressed because one or more lines are too long

View File

@ -9,7 +9,7 @@ Start a profile at a given point.
```js ```js
startProfileAt(to: [number], sketch_surface: SketchSurface, tag?: TagDeclarator) -> SketchGroup startProfileAt(to: [number], sketch_surface: SketchSurface, tag?: String) -> SketchGroup
``` ```
### Examples ### Examples
@ -90,238 +90,12 @@ const example = extrude(5, exampleSketch)
}, },
} | } |
{ {
// The extrude group the face is on. // the face id the sketch is on
extrudeGroup: { faceId: 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 planes X axis be?
xAxis: {
x: number,
y: number,
z: number,
},
// What should the planes 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 faces X axis be?
xAxis: {
x: number,
y: number,
z: number,
},
// What should the faces 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],
},
// The paths in the sketch group.
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
} |
{
// arc's direction
ccw: string,
// the arc's center
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
// The x coordinate.
x: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
// The x coordinate.
x: number,
// The y coordinate.
y: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
},
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
value: [{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
},
// The id of the face. // The id of the face.
id: uuid, id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face", type: "face",
// The tag of the face. // The tag of the face.
value: string, value: string,
@ -345,20 +119,15 @@ const example = extrude(5, exampleSketch)
}, },
} }
``` ```
* `tag`: `TagDeclarator` (OPTIONAL) * `tag`: `String` (OPTIONAL)
```js
{
end: number,
start: number,
value: string,
}
```
### Returns ### Returns
`SketchGroup` - A sketch group is a collection of paths. `SketchGroup` - A sketch group is a collection of paths.
```js ```js
{ {
// The plane id or face id of the sketch group.
entityId: uuid,
// The id of the sketch group. // The id of the sketch group.
id: uuid, id: uuid,
// What the sketch is on (can be a plane or a face). // What the sketch is on (can be a plane or a face).
@ -394,181 +163,12 @@ const example = extrude(5, exampleSketch)
}, },
} | } |
{ {
// The extrude group the face is on. // the face id the sketch 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],
},
// 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, faceId: 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. // The id of the face.
id: uuid, id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face", type: "face",
// The tag of the face. // The tag of the face.
value: string, value: string,
@ -591,16 +191,16 @@ const example = extrude(5, exampleSketch)
z: number, 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. // The starting path.
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -608,12 +208,8 @@ const example = extrude(5, exampleSketch)
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -625,12 +221,8 @@ const example = extrude(5, exampleSketch)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -638,12 +230,8 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -651,12 +239,8 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -666,12 +250,8 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -683,16 +263,30 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", 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,
},
} }
``` ```

View File

@ -59,6 +59,8 @@ const example = extrude(5, exampleSketch)
`SketchGroup` - A sketch group is a collection of paths. `SketchGroup` - A sketch group is a collection of paths.
```js ```js
{ {
// The plane id or face id of the sketch group.
entityId: uuid,
// The id of the sketch group. // The id of the sketch group.
id: uuid, id: uuid,
// What the sketch is on (can be a plane or a face). // What the sketch is on (can be a plane or a face).
@ -94,181 +96,12 @@ const example = extrude(5, exampleSketch)
}, },
} | } |
{ {
// The extrude group the face is on. // the face id the sketch 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],
},
// 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, faceId: 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. // The id of the face.
id: uuid, id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face", type: "face",
// The tag of the face. // The tag of the face.
value: string, value: string,
@ -291,16 +124,16 @@ const example = extrude(5, exampleSketch)
z: number, 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. // The starting path.
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -308,12 +141,8 @@ const example = extrude(5, exampleSketch)
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -325,12 +154,8 @@ const example = extrude(5, exampleSketch)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -338,12 +163,8 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -351,12 +172,8 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -366,12 +183,8 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -383,16 +196,30 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", 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,
},
} }
``` ```

View File

@ -9,7 +9,7 @@ Start a sketch on a specific plane or face.
```js ```js
startSketchOn(data: SketchData, tag?: FaceTag) -> SketchSurface startSketchOn(data: SketchData, tag?: SketchOnFaceTag) -> SketchSurface
``` ```
### Examples ### Examples
@ -49,7 +49,7 @@ const example003 = extrude(5, exampleSketch003)
const exampleSketch = startSketchOn("XY") const exampleSketch = startSketchOn("XY")
|> startProfileAt([0, 0], %) |> startProfileAt([0, 0], %)
|> line([10, 0], %) |> line([10, 0], %)
|> line([0, 10], %, $sketchingFace) |> line([0, 10], %, 'sketchingFace')
|> line([-10, 0], %) |> line([-10, 0], %)
|> close(%) |> close(%)
@ -60,7 +60,7 @@ const exampleSketch002 = startSketchOn(example, 'sketchingFace')
|> line([8, 0], %) |> line([8, 0], %)
|> line([0, 8], %) |> line([0, 8], %)
|> line([-8, 0], %) |> line([-8, 0], %)
|> close(%, $sketchingFace002) |> close(%, 'sketchingFace002')
const example002 = extrude(10, exampleSketch002) const example002 = extrude(10, exampleSketch002)
@ -163,118 +163,20 @@ const a1 = startSketchOn({
{ {
// The id of the extrusion end cap // The id of the extrusion end cap
endCapId: uuid, 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. // The height of the extrude group.
height: number, height: number,
// The id of the extrude group. // The id of the extrude group.
id: uuid, id: uuid,
// The sketch group. // The position of the extrude group.
sketchGroup: { position: [number, number, number],
// The id of the sketch group. // The rotation of the extrude group.
id: uuid, rotation: [number, number, number, number],
// What the sketch is on (can be a plane or a face). // The sketch group paths.
on: { sketchGroupValues: [{
// 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 planes X axis be?
xAxis: {
x: number,
y: number,
z: number,
},
// What should the planes 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 faces X axis be?
xAxis: {
x: number,
y: number,
z: number,
},
// What should the faces 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. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// 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. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -286,12 +188,8 @@ const a1 = startSketchOn({
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -299,12 +197,8 @@ const a1 = startSketchOn({
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -312,12 +206,8 @@ const a1 = startSketchOn({
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -327,12 +217,8 @@ const a1 = startSketchOn({
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -344,17 +230,12 @@ const a1 = startSketchOn({
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",
}], }],
},
// The id of the extrusion start cap // The id of the extrusion start cap
startCapId: uuid, startCapId: uuid,
// The extrude surfaces. // The extrude surfaces.
@ -363,14 +244,14 @@ const a1 = startSketchOn({
faceId: uuid, faceId: uuid,
// The id of the geometry. // The id of the geometry.
id: uuid, id: uuid,
// The name.
name: string,
// The position.
position: [number, number, number],
// The rotation.
rotation: [number, number, number, number],
// The source range. // The source range.
sourceRange: [number, number], sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane", type: "extrudePlane",
} | } |
{ {
@ -378,24 +259,40 @@ const a1 = startSketchOn({
faceId: uuid, faceId: uuid,
// The id of the geometry. // The id of the geometry.
id: uuid, id: uuid,
// The name.
name: string,
// The position.
position: [number, number, number],
// The rotation.
rotation: [number, number, number, number],
// The source range. // The source range.
sourceRange: [number, number], sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc", 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 ```js
"start" | "end" | "start" | "end" |
{ string
value: string,
}
``` ```
### Returns ### Returns
@ -434,238 +331,12 @@ const a1 = startSketchOn({
}, },
} | } |
{ {
// The extrude group the face is on. // the face id the sketch is on
extrudeGroup: { faceId: 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 planes X axis be?
xAxis: {
x: number,
y: number,
z: number,
},
// What should the planes 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 faces X axis be?
xAxis: {
x: number,
y: number,
z: number,
},
// What should the faces 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],
},
// The paths in the sketch group.
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
} |
{
// arc's direction
ccw: string,
// the arc's center
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
// The x coordinate.
x: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
// The x coordinate.
x: number,
// The y coordinate.
y: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
},
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
value: [{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
},
// The id of the face. // The id of the face.
id: uuid, id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face", type: "face",
// The tag of the face. // The tag of the face.
value: string, value: string,

File diff suppressed because it is too large Load Diff

View File

@ -9,7 +9,7 @@ Draw an arc.
```js ```js
tangentialArc(data: TangentialArcData, sketch_group: SketchGroup, tag?: TagDeclarator) -> SketchGroup tangentialArc(data: TangentialArcData, sketch_group: SketchGroup, tag?: String) -> SketchGroup
``` ```
### Examples ### Examples
@ -42,6 +42,8 @@ const example = extrude(10, exampleSketch)
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED) * `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
```js ```js
{ {
// The plane id or face id of the sketch group.
entityId: uuid,
// The id of the sketch group. // The id of the sketch group.
id: uuid, id: uuid,
// What the sketch is on (can be a plane or a face). // What the sketch is on (can be a plane or a face).
@ -77,181 +79,12 @@ const example = extrude(10, exampleSketch)
}, },
} | } |
{ {
// The extrude group the face is on. // the face id the sketch 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],
},
// 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, faceId: 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. // The id of the face.
id: uuid, id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face", type: "face",
// The tag of the face. // The tag of the face.
value: string, value: string,
@ -274,16 +107,16 @@ const example = extrude(10, exampleSketch)
z: number, 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. // The starting path.
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -291,12 +124,8 @@ const example = extrude(10, exampleSketch)
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -308,12 +137,8 @@ const example = extrude(10, exampleSketch)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -321,12 +146,8 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -334,12 +155,8 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -349,12 +166,8 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -366,32 +179,41 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", 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) * `tag`: `String` (OPTIONAL)
```js
{
end: number,
start: number,
value: string,
}
```
### Returns ### Returns
`SketchGroup` - A sketch group is a collection of paths. `SketchGroup` - A sketch group is a collection of paths.
```js ```js
{ {
// The plane id or face id of the sketch group.
entityId: uuid,
// The id of the sketch group. // The id of the sketch group.
id: uuid, id: uuid,
// What the sketch is on (can be a plane or a face). // What the sketch is on (can be a plane or a face).
@ -427,181 +249,12 @@ const example = extrude(10, exampleSketch)
}, },
} | } |
{ {
// The extrude group the face is on. // the face id the sketch 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],
},
// 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, faceId: 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. // The id of the face.
id: uuid, id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face", type: "face",
// The tag of the face. // The tag of the face.
value: string, value: string,
@ -624,16 +277,16 @@ const example = extrude(10, exampleSketch)
z: number, 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. // The starting path.
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -641,12 +294,8 @@ const example = extrude(10, exampleSketch)
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -658,12 +307,8 @@ const example = extrude(10, exampleSketch)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -671,12 +316,8 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -684,12 +325,8 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -699,12 +336,8 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -716,16 +349,30 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", 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,
},
} }
``` ```

View File

@ -9,7 +9,7 @@ Draw an arc.
```js ```js
tangentialArcTo(to: [number], sketch_group: SketchGroup, tag?: TagDeclarator) -> SketchGroup tangentialArcTo(to: [number], sketch_group: SketchGroup, tag?: String) -> SketchGroup
``` ```
### Examples ### Examples
@ -33,6 +33,8 @@ const example = extrude(10, exampleSketch)
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED) * `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
```js ```js
{ {
// The plane id or face id of the sketch group.
entityId: uuid,
// The id of the sketch group. // The id of the sketch group.
id: uuid, id: uuid,
// What the sketch is on (can be a plane or a face). // What the sketch is on (can be a plane or a face).
@ -68,181 +70,12 @@ const example = extrude(10, exampleSketch)
}, },
} | } |
{ {
// The extrude group the face is on. // the face id the sketch 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],
},
// 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, faceId: 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. // The id of the face.
id: uuid, id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face", type: "face",
// The tag of the face. // The tag of the face.
value: string, value: string,
@ -265,16 +98,16 @@ const example = extrude(10, exampleSketch)
z: number, 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. // The starting path.
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -282,12 +115,8 @@ const example = extrude(10, exampleSketch)
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -299,12 +128,8 @@ const example = extrude(10, exampleSketch)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -312,12 +137,8 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -325,12 +146,8 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -340,12 +157,8 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -357,32 +170,41 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", 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) * `tag`: `String` (OPTIONAL)
```js
{
end: number,
start: number,
value: string,
}
```
### Returns ### Returns
`SketchGroup` - A sketch group is a collection of paths. `SketchGroup` - A sketch group is a collection of paths.
```js ```js
{ {
// The plane id or face id of the sketch group.
entityId: uuid,
// The id of the sketch group. // The id of the sketch group.
id: uuid, id: uuid,
// What the sketch is on (can be a plane or a face). // What the sketch is on (can be a plane or a face).
@ -418,181 +240,12 @@ const example = extrude(10, exampleSketch)
}, },
} | } |
{ {
// The extrude group the face is on. // the face id the sketch 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],
},
// 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, faceId: 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. // The id of the face.
id: uuid, id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face", type: "face",
// The tag of the face. // The tag of the face.
value: string, value: string,
@ -615,16 +268,16 @@ const example = extrude(10, exampleSketch)
z: number, 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. // The starting path.
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -632,12 +285,8 @@ const example = extrude(10, exampleSketch)
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -649,12 +298,8 @@ const example = extrude(10, exampleSketch)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -662,12 +307,8 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -675,12 +316,8 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -690,12 +327,8 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -707,16 +340,30 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", 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,
},
} }
``` ```

View File

@ -9,7 +9,7 @@ Draw a line on the x-axis.
```js ```js
xLine(length: number, sketch_group: SketchGroup, tag?: TagDeclarator) -> SketchGroup xLine(length: number, sketch_group: SketchGroup, tag?: String) -> SketchGroup
``` ```
### Examples ### Examples
@ -36,6 +36,8 @@ const example = extrude(10, exampleSketch)
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED) * `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
```js ```js
{ {
// The plane id or face id of the sketch group.
entityId: uuid,
// The id of the sketch group. // The id of the sketch group.
id: uuid, id: uuid,
// What the sketch is on (can be a plane or a face). // What the sketch is on (can be a plane or a face).
@ -71,181 +73,12 @@ const example = extrude(10, exampleSketch)
}, },
} | } |
{ {
// The extrude group the face is on. // the face id the sketch 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],
},
// 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, faceId: 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. // The id of the face.
id: uuid, id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face", type: "face",
// The tag of the face. // The tag of the face.
value: string, value: string,
@ -268,16 +101,16 @@ const example = extrude(10, exampleSketch)
z: number, 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. // The starting path.
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -285,12 +118,8 @@ const example = extrude(10, exampleSketch)
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -302,12 +131,8 @@ const example = extrude(10, exampleSketch)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -315,12 +140,8 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -328,12 +149,8 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -343,12 +160,8 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -360,32 +173,41 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", 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) * `tag`: `String` (OPTIONAL)
```js
{
end: number,
start: number,
value: string,
}
```
### Returns ### Returns
`SketchGroup` - A sketch group is a collection of paths. `SketchGroup` - A sketch group is a collection of paths.
```js ```js
{ {
// The plane id or face id of the sketch group.
entityId: uuid,
// The id of the sketch group. // The id of the sketch group.
id: uuid, id: uuid,
// What the sketch is on (can be a plane or a face). // What the sketch is on (can be a plane or a face).
@ -421,181 +243,12 @@ const example = extrude(10, exampleSketch)
}, },
} | } |
{ {
// The extrude group the face is on. // the face id the sketch 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],
},
// 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, faceId: 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. // The id of the face.
id: uuid, id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face", type: "face",
// The tag of the face. // The tag of the face.
value: string, value: string,
@ -618,16 +271,16 @@ const example = extrude(10, exampleSketch)
z: number, 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. // The starting path.
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -635,12 +288,8 @@ const example = extrude(10, exampleSketch)
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -652,12 +301,8 @@ const example = extrude(10, exampleSketch)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -665,12 +310,8 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -678,12 +319,8 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -693,12 +330,8 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -710,16 +343,30 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", 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,
},
} }
``` ```

View File

@ -9,7 +9,7 @@ Draw a line to a point on the x-axis.
```js ```js
xLineTo(to: number, sketch_group: SketchGroup, tag?: TagDeclarator) -> SketchGroup xLineTo(to: number, sketch_group: SketchGroup, tag?: String) -> SketchGroup
``` ```
### Examples ### Examples
@ -36,6 +36,8 @@ const example = extrude(10, exampleSketch)
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED) * `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
```js ```js
{ {
// The plane id or face id of the sketch group.
entityId: uuid,
// The id of the sketch group. // The id of the sketch group.
id: uuid, id: uuid,
// What the sketch is on (can be a plane or a face). // What the sketch is on (can be a plane or a face).
@ -71,181 +73,12 @@ const example = extrude(10, exampleSketch)
}, },
} | } |
{ {
// The extrude group the face is on. // the face id the sketch 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],
},
// 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, faceId: 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. // The id of the face.
id: uuid, id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face", type: "face",
// The tag of the face. // The tag of the face.
value: string, value: string,
@ -268,16 +101,16 @@ const example = extrude(10, exampleSketch)
z: number, 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. // The starting path.
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -285,12 +118,8 @@ const example = extrude(10, exampleSketch)
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -302,12 +131,8 @@ const example = extrude(10, exampleSketch)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -315,12 +140,8 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -328,12 +149,8 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -343,12 +160,8 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -360,32 +173,41 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", 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) * `tag`: `String` (OPTIONAL)
```js
{
end: number,
start: number,
value: string,
}
```
### Returns ### Returns
`SketchGroup` - A sketch group is a collection of paths. `SketchGroup` - A sketch group is a collection of paths.
```js ```js
{ {
// The plane id or face id of the sketch group.
entityId: uuid,
// The id of the sketch group. // The id of the sketch group.
id: uuid, id: uuid,
// What the sketch is on (can be a plane or a face). // What the sketch is on (can be a plane or a face).
@ -421,181 +243,12 @@ const example = extrude(10, exampleSketch)
}, },
} | } |
{ {
// The extrude group the face is on. // the face id the sketch 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],
},
// 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, faceId: 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. // The id of the face.
id: uuid, id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face", type: "face",
// The tag of the face. // The tag of the face.
value: string, value: string,
@ -618,16 +271,16 @@ const example = extrude(10, exampleSketch)
z: number, 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. // The starting path.
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -635,12 +288,8 @@ const example = extrude(10, exampleSketch)
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -652,12 +301,8 @@ const example = extrude(10, exampleSketch)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -665,12 +310,8 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -678,12 +319,8 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -693,12 +330,8 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -710,16 +343,30 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", 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,
},
} }
``` ```

View File

@ -9,7 +9,7 @@ Draw a line on the y-axis.
```js ```js
yLine(length: number, sketch_group: SketchGroup, tag?: TagDeclarator) -> SketchGroup yLine(length: number, sketch_group: SketchGroup, tag?: String) -> SketchGroup
``` ```
### Examples ### Examples
@ -34,6 +34,8 @@ const example = extrude(10, exampleSketch)
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED) * `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
```js ```js
{ {
// The plane id or face id of the sketch group.
entityId: uuid,
// The id of the sketch group. // The id of the sketch group.
id: uuid, id: uuid,
// What the sketch is on (can be a plane or a face). // What the sketch is on (can be a plane or a face).
@ -69,181 +71,12 @@ const example = extrude(10, exampleSketch)
}, },
} | } |
{ {
// The extrude group the face is on. // the face id the sketch 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],
},
// 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, faceId: 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. // The id of the face.
id: uuid, id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face", type: "face",
// The tag of the face. // The tag of the face.
value: string, value: string,
@ -266,16 +99,16 @@ const example = extrude(10, exampleSketch)
z: number, 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. // The starting path.
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -283,12 +116,8 @@ const example = extrude(10, exampleSketch)
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -300,12 +129,8 @@ const example = extrude(10, exampleSketch)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -313,12 +138,8 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -326,12 +147,8 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -341,12 +158,8 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -358,32 +171,41 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", 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) * `tag`: `String` (OPTIONAL)
```js
{
end: number,
start: number,
value: string,
}
```
### Returns ### Returns
`SketchGroup` - A sketch group is a collection of paths. `SketchGroup` - A sketch group is a collection of paths.
```js ```js
{ {
// The plane id or face id of the sketch group.
entityId: uuid,
// The id of the sketch group. // The id of the sketch group.
id: uuid, id: uuid,
// What the sketch is on (can be a plane or a face). // What the sketch is on (can be a plane or a face).
@ -419,181 +241,12 @@ const example = extrude(10, exampleSketch)
}, },
} | } |
{ {
// The extrude group the face is on. // the face id the sketch 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],
},
// 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, faceId: 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. // The id of the face.
id: uuid, id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face", type: "face",
// The tag of the face. // The tag of the face.
value: string, value: string,
@ -616,16 +269,16 @@ const example = extrude(10, exampleSketch)
z: number, 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. // The starting path.
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -633,12 +286,8 @@ const example = extrude(10, exampleSketch)
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -650,12 +299,8 @@ const example = extrude(10, exampleSketch)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -663,12 +308,8 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -676,12 +317,8 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -691,12 +328,8 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -708,16 +341,30 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", 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,
},
} }
``` ```

View File

@ -9,7 +9,7 @@ Draw a line to a point on the y-axis.
```js ```js
yLineTo(to: number, sketch_group: SketchGroup, tag?: TagDeclarator) -> SketchGroup yLineTo(to: number, sketch_group: SketchGroup, tag?: String) -> SketchGroup
``` ```
### Examples ### Examples
@ -32,6 +32,8 @@ const example = extrude(5, exampleSketch)
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED) * `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
```js ```js
{ {
// The plane id or face id of the sketch group.
entityId: uuid,
// The id of the sketch group. // The id of the sketch group.
id: uuid, id: uuid,
// What the sketch is on (can be a plane or a face). // What the sketch is on (can be a plane or a face).
@ -67,181 +69,12 @@ const example = extrude(5, exampleSketch)
}, },
} | } |
{ {
// The extrude group the face is on. // the face id the sketch 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],
},
// 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, faceId: 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. // The id of the face.
id: uuid, id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face", type: "face",
// The tag of the face. // The tag of the face.
value: string, value: string,
@ -264,16 +97,16 @@ const example = extrude(5, exampleSketch)
z: number, 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. // The starting path.
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -281,12 +114,8 @@ const example = extrude(5, exampleSketch)
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -298,12 +127,8 @@ const example = extrude(5, exampleSketch)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -311,12 +136,8 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -324,12 +145,8 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -339,12 +156,8 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -356,32 +169,41 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", 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) * `tag`: `String` (OPTIONAL)
```js
{
end: number,
start: number,
value: string,
}
```
### Returns ### Returns
`SketchGroup` - A sketch group is a collection of paths. `SketchGroup` - A sketch group is a collection of paths.
```js ```js
{ {
// The plane id or face id of the sketch group.
entityId: uuid,
// The id of the sketch group. // The id of the sketch group.
id: uuid, id: uuid,
// What the sketch is on (can be a plane or a face). // What the sketch is on (can be a plane or a face).
@ -417,181 +239,12 @@ const example = extrude(5, exampleSketch)
}, },
} | } |
{ {
// The extrude group the face is on. // the face id the sketch 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],
},
// 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, faceId: 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. // The id of the face.
id: uuid, id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face", type: "face",
// The tag of the face. // The tag of the face.
value: string, value: string,
@ -614,16 +267,16 @@ const example = extrude(5, exampleSketch)
z: number, 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. // The starting path.
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -631,12 +284,8 @@ const example = extrude(5, exampleSketch)
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -648,12 +297,8 @@ const example = extrude(5, exampleSketch)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -661,12 +306,8 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -674,12 +315,8 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -689,12 +326,8 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -706,16 +339,30 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The name of the path.
tag: { name: string,
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", 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,
},
} }
``` ```

File diff suppressed because it is too large Load Diff

View File

@ -405,16 +405,17 @@ test('Draft segments should look right', async ({ page, context }) => {
// select a plane // select a plane
await page.mouse.click(700, 200) await page.mouse.click(700, 200)
let code = `const sketch001 = startSketchOn('XZ')` await expect(page.locator('.cm-content')).toHaveText(
await expect(page.locator('.cm-content')).toHaveText(code) `const part001 = 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 const startXPx = 600
await page.mouse.click(startXPx + PUR * 10, 500 - PUR * 10) await page.mouse.click(startXPx + PUR * 10, 500 - PUR * 10)
code += ` await expect(page.locator('.cm-content'))
|> startProfileAt([7.19, -9.7], %)` .toHaveText(`const part001 = startSketchOn('XZ')
await expect(page.locator('.cm-content')).toHaveText(code) |> startProfileAt([9.06, -12.22], %)`)
await page.waitForTimeout(100) await page.waitForTimeout(100)
await u.closeDebugPanel() await u.closeDebugPanel()
@ -426,9 +427,10 @@ test('Draft segments should look right', async ({ page, context }) => {
await page.mouse.click(startXPx + PUR * 20, 500 - PUR * 10) await page.mouse.click(startXPx + PUR * 20, 500 - PUR * 10)
await page.waitForTimeout(100) await page.waitForTimeout(100)
code += ` await expect(page.locator('.cm-content'))
|> line([7.25, 0], %)` .toHaveText(`const part001 = startSketchOn('XZ')
await expect(page.locator('.cm-content')).toHaveText(code) |> startProfileAt([9.06, -12.22], %)
|> line([9.14, 0], %)`)
await page.getByRole('button', { name: 'Tangential Arc' }).click() await page.getByRole('button', { name: 'Tangential Arc' }).click()
@ -463,7 +465,7 @@ test('Draft rectangles should look right', async ({ page, context }) => {
await page.mouse.click(700, 200) await page.mouse.click(700, 200)
await expect(page.locator('.cm-content')).toHaveText( await expect(page.locator('.cm-content')).toHaveText(
`const sketch001 = startSketchOn('XZ')` `const part001 = startSketchOn('XZ')`
) )
await page.waitForTimeout(500) // TODO detect animation ending, or disable animation await page.waitForTimeout(500) // TODO detect animation ending, or disable animation
@ -511,16 +513,17 @@ test.describe('Client side scene scale should match engine scale', () => {
// select a plane // select a plane
await page.mouse.click(700, 200) await page.mouse.click(700, 200)
let code = `const sketch001 = startSketchOn('XZ')` await expect(page.locator('.cm-content')).toHaveText(
await expect(page.locator('.cm-content')).toHaveText(code) `const part001 = 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 const startXPx = 600
await page.mouse.click(startXPx + PUR * 10, 500 - PUR * 10) await page.mouse.click(startXPx + PUR * 10, 500 - PUR * 10)
code += ` await expect(page.locator('.cm-content'))
|> startProfileAt([7.19, -9.7], %)` .toHaveText(`const part001 = startSketchOn('XZ')
await expect(u.codeLocator).toHaveText(code) |> startProfileAt([9.06, -12.22], %)`)
await page.waitForTimeout(100) await page.waitForTimeout(100)
await u.closeDebugPanel() await u.closeDebugPanel()
@ -528,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.mouse.click(startXPx + PUR * 20, 500 - PUR * 10)
await page.waitForTimeout(100) await page.waitForTimeout(100)
code += ` await expect(page.locator('.cm-content'))
|> line([7.25, 0], %)` .toHaveText(`const part001 = startSketchOn('XZ')
await expect(u.codeLocator).toHaveText(code) |> startProfileAt([9.06, -12.22], %)
|> line([9.14, 0], %)`)
await page.getByRole('button', { name: 'Tangential Arc' }).click() await page.getByRole('button', { name: 'Tangential Arc' }).click()
await page.waitForTimeout(100) await page.waitForTimeout(100)
await page.mouse.click(startXPx + PUR * 30, 500 - PUR * 20) await page.mouse.click(startXPx + PUR * 30, 500 - PUR * 20)
code += ` await expect(page.locator('.cm-content'))
|> tangentialArcTo([21.7, -2.44], %)` .toHaveText(`const part001 = startSketchOn('XZ')
await expect(u.codeLocator).toHaveText(code) |> startProfileAt([9.06, -12.22], %)
|> line([9.14, 0], %)
|> tangentialArcTo([27.34, -3.08], %)`)
// click tangential arc tool again to unequip it // click tangential arc tool again to unequip it
await page.getByRole('button', { name: 'Tangential Arc' }).click() await page.getByRole('button', { name: 'Tangential Arc' }).click()
@ -610,16 +616,17 @@ test.describe('Client side scene scale should match engine scale', () => {
// select a plane // select a plane
await page.mouse.click(700, 200) await page.mouse.click(700, 200)
let code = `const sketch001 = startSketchOn('XZ')` await expect(page.locator('.cm-content')).toHaveText(
await expect(u.codeLocator).toHaveText(code) `const part001 = 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 const startXPx = 600
await page.mouse.click(startXPx + PUR * 10, 500 - PUR * 10) await page.mouse.click(startXPx + PUR * 10, 500 - PUR * 10)
code += ` await expect(page.locator('.cm-content'))
|> startProfileAt([182.59, -246.32], %)` .toHaveText(`const part001 = startSketchOn('XZ')
await expect(u.codeLocator).toHaveText(code) |> startProfileAt([230.03, -310.32], %)`)
await page.waitForTimeout(100) await page.waitForTimeout(100)
await u.closeDebugPanel() await u.closeDebugPanel()
@ -627,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.mouse.click(startXPx + PUR * 20, 500 - PUR * 10)
await page.waitForTimeout(100) await page.waitForTimeout(100)
code += ` await expect(page.locator('.cm-content'))
|> line([184.3, 0], %)` .toHaveText(`const part001 = startSketchOn('XZ')
await expect(u.codeLocator).toHaveText(code) |> startProfileAt([230.03, -310.32], %)
|> line([232.2, 0], %)`)
await page.getByRole('button', { name: 'Tangential Arc' }).click() await page.getByRole('button', { name: 'Tangential Arc' }).click()
await page.waitForTimeout(100) await page.waitForTimeout(100)
await page.mouse.click(startXPx + PUR * 30, 500 - PUR * 20) await page.mouse.click(startXPx + PUR * 30, 500 - PUR * 20)
code += ` await expect(page.locator('.cm-content'))
|> tangentialArcTo([551.2, -62.01], %)` .toHaveText(`const part001 = startSketchOn('XZ')
await expect(u.codeLocator).toHaveText(code) |> startProfileAt([230.03, -310.32], %)
|> line([232.2, 0], %)
|> tangentialArcTo([694.43, -78.12], %)`)
await page.getByRole('button', { name: 'Tangential Arc' }).click() await page.getByRole('button', { name: 'Tangential Arc' }).click()
await page.waitForTimeout(100) await page.waitForTimeout(100)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 41 KiB

After

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 42 KiB

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 47 KiB

After

Width:  |  Height:  |  Size: 47 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 44 KiB

After

Width:  |  Height:  |  Size: 43 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 31 KiB

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 33 KiB

After

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 36 KiB

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 69 KiB

After

Width:  |  Height:  |  Size: 65 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 42 KiB

After

Width:  |  Height:  |  Size: 72 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 60 KiB

After

Width:  |  Height:  |  Size: 76 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

After

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 30 KiB

After

Width:  |  Height:  |  Size: 48 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 30 KiB

After

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 29 KiB

After

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 33 KiB

After

Width:  |  Height:  |  Size: 49 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 27 KiB

After

Width:  |  Height:  |  Size: 45 KiB

View File

@ -1,6 +1,5 @@
import { SaveSettingsPayload } from 'lib/settings/settingsTypes' import { SaveSettingsPayload } from 'lib/settings/settingsTypes'
import { Themes } from 'lib/theme' import { Themes } from 'lib/theme'
import { onboardingPaths } from 'routes/Onboarding/paths'
export const TEST_SETTINGS_KEY = '/settings.toml' export const TEST_SETTINGS_KEY = '/settings.toml'
export const TEST_SETTINGS = { export const TEST_SETTINGS = {
@ -23,22 +22,9 @@ export const TEST_SETTINGS = {
}, },
} satisfies Partial<SaveSettingsPayload> } 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 = { export const TEST_SETTINGS_ONBOARDING_EXPORT = {
...TEST_SETTINGS, ...TEST_SETTINGS,
app: { ...TEST_SETTINGS.app, onboardingStatus: onboardingPaths.EXPORT }, app: { ...TEST_SETTINGS.app, onboardingStatus: '/export' },
} satisfies Partial<SaveSettingsPayload>
export const TEST_SETTINGS_ONBOARDING_PARAMETRIC_MODELING = {
...TEST_SETTINGS,
app: {
...TEST_SETTINGS.app,
onboardingStatus: onboardingPaths.PARAMETRIC_MODELING,
},
} satisfies Partial<SaveSettingsPayload> } satisfies Partial<SaveSettingsPayload>
export const TEST_SETTINGS_ONBOARDING_START = { export const TEST_SETTINGS_ONBOARDING_START = {
@ -64,25 +50,3 @@ export const TEST_SETTINGS_CORRUPTED = {
textWrapping: true, textWrapping: true,
}, },
} satisfies Partial<SaveSettingsPayload> } satisfies Partial<SaveSettingsPayload>
export const TEST_CODE_GIZMO = `const part001 = startSketchOn('XZ')
|> startProfileAt([20, 0], %)
|> line([7.13, 4 + 0], %)
|> angledLine({ angle: 3 + 0, length: 3.14 + 0 }, %)
|> lineTo([20.14 + 0, -0.14 + 0], %)
|> xLineTo(29 + 0, %)
|> yLine(-3.14 + 0, %, 'a')
|> xLine(1.63, %)
|> angledLineOfXLength({ angle: 3 + 0, length: 3.14 }, %)
|> angledLineOfYLength({ angle: 30, length: 3 + 0 }, %)
|> angledLineToX({ angle: 22.14 + 0, to: 12 }, %)
|> angledLineToY({ angle: 30, to: 11.14 }, %)
|> angledLineThatIntersects({
angle: 3.14,
intersectTag: 'a',
offset: 0
}, %)
|> tangentialArcTo([13.14 + 0, 13.14], %)
|> close(%)
|> extrude(5 + 7, %)
`

View File

@ -1,6 +1,5 @@
import { test, expect, Page, Download } from '@playwright/test' import { test, expect, Page, Download } from '@playwright/test'
import { EngineCommand } from '../../src/lang/std/engineConnection' import { EngineCommand } from '../../src/lang/std/engineConnection'
import os from 'os'
import fsp from 'fs/promises' import fsp from 'fs/promises'
import pixelMatch from 'pixelmatch' import pixelMatch from 'pixelmatch'
import { PNG } from 'pngjs' import { PNG } from 'pngjs'
@ -8,27 +7,18 @@ import { Protocol } from 'playwright-core/types/protocol'
import type { Models } from '@kittycad/lib' import type { Models } from '@kittycad/lib'
import { APP_NAME } from 'lib/constants' 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) { async function waitForPageLoad(page: Page) {
// wait for 'Loading stream...' spinner // wait for 'Loading stream...' spinner
await page.getByTestId('loading-stream').waitFor() await page.getByTestId('loading-stream').waitFor()
// wait for all spinners to be gone // wait for all spinners to be gone
await page await page.getByTestId('loading').waitFor({ state: 'detached' })
.getByTestId('loading')
.waitFor({ state: 'detached', timeout: 20_000 })
await page.getByTestId('start-sketch').waitFor() await page.getByTestId('start-sketch').waitFor()
} }
async function removeCurrentCode(page: Page) { async function removeCurrentCode(page: Page) {
const hotkey = process.platform === 'darwin' ? 'Meta' : 'Control' const hotkey = process.platform === 'darwin' ? 'Meta' : 'Control'
await page.locator('.cm-content').click() await page.click('.cm-content')
await page.keyboard.down(hotkey) await page.keyboard.down(hotkey)
await page.keyboard.press('a') await page.keyboard.press('a')
await page.keyboard.up(hotkey) await page.keyboard.up(hotkey)
@ -37,16 +27,16 @@ async function removeCurrentCode(page: Page) {
} }
async function sendCustomCmd(page: Page, cmd: EngineCommand) { async function sendCustomCmd(page: Page, cmd: EngineCommand) {
await page.getByTestId('custom-cmd-input').fill(JSON.stringify(cmd)) await page.fill('[data-testid="custom-cmd-input"]', JSON.stringify(cmd))
await page.getByTestId('custom-cmd-send-button').click() await page.click('[data-testid="custom-cmd-send-button"]')
} }
async function clearCommandLogs(page: Page) { async function clearCommandLogs(page: Page) {
await page.getByTestId('clear-commands').click() await page.click('[data-testid="clear-commands"]')
} }
async function expectCmdLog(page: Page, locatorStr: string, timeout = 5000) { async function expectCmdLog(page: Page, locatorStr: string) {
await expect(page.locator(locatorStr).last()).toBeVisible({ timeout }) await expect(page.locator(locatorStr).last()).toBeVisible()
} }
async function waitForDefaultPlanesToBeVisible(page: Page) { async function waitForDefaultPlanesToBeVisible(page: Page) {
@ -106,57 +96,17 @@ async function waitForCmdReceive(page: Page, commandType: string) {
.waitFor() .waitFor()
} }
export const wiggleMove = async ( export async function getUtils(page: Page) {
page: any, // Chrome devtools protocol session only works in Chromium
x: number, const browserType = page.context().browser()?.browserType().name()
y: number, const cdpSession =
steps: number, browserType !== 'chromium' ? null : await page.context().newCDPSession(page)
dist: number,
ang: number,
amplitude: number,
freq: number,
locator?: string
) => {
const tau = Math.PI * 2
const deg = tau / 360
const step = dist / steps
for (let i = 0, j = 0; i < dist; i += step, j += 1) {
if (locator) {
const isElVis = await page.locator(locator).isVisible()
if (isElVis) return
}
const [x1, y1] = [0, Math.sin((tau / steps) * j * freq) * amplitude]
const [x2, y2] = [
Math.cos(-ang * deg) * i - Math.sin(-ang * deg) * y1,
Math.sin(-ang * deg) * i + Math.cos(-ang * deg) * y1,
]
const [xr, yr] = [x2, y2]
await page.mouse.move(x + xr, y + yr, { steps: 5 })
}
}
export const circleMove = async ( let click00rCenter = { x: 0, y: 0 }
page: any, const click00 = (x: number, y: number) =>
x: number, page.mouse.click(click00rCenter.x + x, click00rCenter.y + y)
y: number, let click00rLastPos = { x: 0, y: 0 }
steps: number,
diameter: number,
locator?: string
) => {
const tau = Math.PI * 2
const step = tau / steps
for (let i = 0; i < tau; i += step) {
if (locator) {
const isElVis = await page.locator(locator).isVisible()
if (isElVis) return
}
const [x1, y1] = [Math.cos(i) * diameter, Math.sin(i) * diameter]
const [xr, yr] = [x1, y1]
await page.mouse.move(x + xr, y + yr, { steps: 5 })
}
}
export const getMovementUtils = (opts: any) => {
// The way we truncate is kinda odd apparently, so we need this function // The way we truncate is kinda odd apparently, so we need this function
// "[k]itty[c]ad round" // "[k]itty[c]ad round"
const kcRound = (n: number) => Math.trunc(n * 100) / 100 const kcRound = (n: number) => Math.trunc(n * 100) / 100
@ -165,8 +115,8 @@ export const getMovementUtils = (opts: any) => {
// NOTE: these pretty much can't be perfect because of screen scaling. // NOTE: these pretty much can't be perfect because of screen scaling.
// Handle on a case-by-case. // Handle on a case-by-case.
const toU = (x: number, y: number) => [ const toU = (x: number, y: number) => [
kcRound(x * 0.0678), kcRound(x * 0.0854),
kcRound(-y * 0.0678), // Y is inverted in our coordinate system kcRound(-y * 0.0854), // Y is inverted in our coordinate system
] ]
// Turn the array into a string with specific formatting // Turn the array into a string with specific formatting
@ -175,44 +125,6 @@ export const getMovementUtils = (opts: any) => {
// Combine because used often // Combine because used often
const toSU = (xy: number[]) => fromUToString(toU(xy[0], xy[1])) const toSU = (xy: number[]) => fromUToString(toU(xy[0], xy[1]))
// Make it easier to click around from center ("click [from] zero zero")
const click00 = (x: number, y: number) =>
opts.page.mouse.click(opts.center.x + x, opts.center.y + y, { delay: 100 })
// Relative clicker, must keep state
let last = { x: 0, y: 0 }
const click00r = async (x?: number, y?: number) => {
// reset relative coordinates when anything is undefined
if (x === undefined || y === undefined) {
last.x = 0
last.y = 0
return
}
await circleMove(
opts.page,
opts.center.x + last.x + x,
opts.center.y + last.y + y,
10,
10
)
await click00(last.x + x, last.y + y)
last.x += x
last.y += y
// Returns the new absolute coordinate if you need it.
return [last.x, last.y]
}
return { toSU, click00r }
}
export async function getUtils(page: Page) {
// Chrome devtools protocol session only works in Chromium
const browserType = page.context().browser()?.browserType().name()
const cdpSession =
browserType !== 'chromium' ? null : await page.context().newCDPSession(page)
return { return {
waitForAuthSkipAppStart: () => waitForPageLoad(page), waitForAuthSkipAppStart: () => waitForPageLoad(page),
removeCurrentCode: () => removeCurrentCode(page), removeCurrentCode: () => removeCurrentCode(page),
@ -228,8 +140,7 @@ export async function getUtils(page: Page) {
await fillInput('z', xyz[2]) await fillInput('z', xyz[2])
}, },
clearCommandLogs: () => clearCommandLogs(page), clearCommandLogs: () => clearCommandLogs(page),
expectCmdLog: (locatorStr: string, timeout = 5000) => expectCmdLog: (locatorStr: string) => expectCmdLog(page, locatorStr),
expectCmdLog(page, locatorStr, timeout),
openKclCodePanel: () => openKclCodePanel(page), openKclCodePanel: () => openKclCodePanel(page),
closeKclCodePanel: () => closeKclCodePanel(page), closeKclCodePanel: () => closeKclCodePanel(page),
openDebugPanel: () => openDebugPanel(page), openDebugPanel: () => openDebugPanel(page),
@ -253,8 +164,8 @@ export async function getUtils(page: Page) {
const angleXOffset = Math.cos(((angle - 180) * Math.PI) / 180) * px const angleXOffset = Math.cos(((angle - 180) * Math.PI) / 180) * px
const angleYOffset = Math.sin(((angle - 180) * Math.PI) / 180) * px const angleYOffset = Math.sin(((angle - 180) * Math.PI) / 180) * px
return { return {
x: Math.round(bbox.x + angleXOffset), x: bbox.x + angleXOffset,
y: Math.round(bbox.y - angleYOffset), y: bbox.y - angleYOffset,
} }
}, },
getAngle: async (locator: string) => { getAngle: async (locator: string) => {
@ -266,8 +177,6 @@ export async function getUtils(page: Page) {
.locator(locator) .locator(locator)
.boundingBox() .boundingBox()
.then((box) => ({ ...box, x: box?.x || 0, y: box?.y || 0 })), .then((box) => ({ ...box, x: box?.x || 0, y: box?.y || 0 })),
codeLocator: page.locator('.cm-content'),
canvasLocator: page.getByTestId('client-side-scene'),
doAndWaitForCmd: async ( doAndWaitForCmd: async (
fn: () => Promise<void>, fn: () => Promise<void>,
commandType: string, commandType: string,
@ -283,38 +192,6 @@ export async function getUtils(page: Page) {
await closeDebugPanel(page) await closeDebugPanel(page)
} }
}, },
/**
* Given an expected RGB value, diff if the channel with the largest difference
*/
getGreatestPixDiff: async (
coords: { x: number; y: number },
expected: [number, number, number]
): Promise<number> => {
const buffer = await page.screenshot({
fullPage: true,
})
const screenshot = await PNG.sync.read(buffer)
// most likely related to pixel density but the screenshots for webkit are 2x the size
// there might be a more robust way of doing this.
const pixMultiplier = browserType === 'webkit' ? 2 : 1
const index =
(screenshot.width * coords.y * pixMultiplier +
coords.x * pixMultiplier) *
4 // rbga is 4 channels
const maxDiff = Math.max(
Math.abs(screenshot.data[index] - expected[0]),
Math.abs(screenshot.data[index + 1] - expected[1]),
Math.abs(screenshot.data[index + 2] - expected[2])
)
if (maxDiff > 4) {
console.log(
`Expected: ${expected} Actual: [${screenshot.data[index]}, ${
screenshot.data[index + 1]
}, ${screenshot.data[index + 2]}]`
)
}
return maxDiff
},
doAndWaitForImageDiff: (fn: () => Promise<any>, diffCount = 200) => doAndWaitForImageDiff: (fn: () => Promise<any>, diffCount = 200) =>
new Promise(async (resolve) => { new Promise(async (resolve) => {
await page.screenshot({ await page.screenshot({
@ -367,6 +244,51 @@ export async function getUtils(page: Page) {
cdpSession?.send('Network.emulateNetworkConditions', networkOptions) cdpSession?.send('Network.emulateNetworkConditions', networkOptions)
}, },
expectCodeToBe: async (str: string) => {
await expect(page.locator('.cm-content')).toHaveText(str)
await page.waitForTimeout(100)
},
click00rSetCenter: (x: number, y: number) => {
click00rCenter = { x, y }
},
click00r: (x?: number, y?: number) => {
// reset relative coordinates when anything is undefined
if (x === undefined || y === undefined) {
click00rLastPos.x = 0
click00rLastPos.y = 0
return
}
const ret = click00(click00rLastPos.x + x, click00rLastPos.y + y)
click00rLastPos.x += x
click00rLastPos.y += y
// Returns the new absolute coordinate if you need it.
return ret.then(() => [click00rLastPos.x, click00rLastPos.y])
},
toSU,
wiggleMove: async (
x: number,
y: number,
steps: number,
dist: number,
ang: number,
amplitude: number,
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) {
const y1 = 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: 2 })
}
},
} }
} }
@ -516,8 +438,3 @@ export const doExport = async (
outputType: output.type, outputType: output.type,
} }
} }
/**
* Gets the appropriate modifier key for the platform.
*/
export const metaModifier = os.platform() === 'darwin' ? 'Meta' : 'Control'

View File

@ -2,7 +2,6 @@ import { browser, $, expect } from '@wdio/globals'
import fs from 'fs/promises' import fs from 'fs/promises'
import path from 'path' import path from 'path'
import os from 'os' import os from 'os'
import { click, setDatasetValue } from '../utils'
const isWin32 = os.platform() === 'win32' const isWin32 = os.platform() === 'win32'
const documentsDir = path.join(os.homedir(), 'Documents') 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 tmp = process.env.TEMP || '/tmp'
const userCodeDir = path.join(tmp, 'kittycad_user_code') const userCodeDir = path.join(tmp, 'kittycad_user_code')
describe('ZMA sign in flow', () => { async function click(element: WebdriverIO.Element): Promise<void> {
before(async () => { // 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 // Clean up filesystem from previous tests
await new Promise((resolve) => setTimeout(resolve, 100)) await new Promise((resolve) => setTimeout(resolve, 100))
await fs.rm(defaultProjectDir, { force: true, recursive: true }) 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.rm(userSettingsDir, { force: true, recursive: true })
await fs.mkdir(defaultProjectDir, { recursive: true }) await fs.mkdir(defaultProjectDir, { recursive: true })
await fs.mkdir(newProjectDir, { 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"]') const signInButton = await $('[data-testid="sign-in-button"]')
expect(await signInButton.getText()).toEqual('Sign in') expect(await signInButton.getText()).toEqual('Sign in')
@ -68,10 +82,6 @@ describe('ZMA sign in flow', () => {
const newFileButton = await $('[data-testid="home-new-file"]') const newFileButton = await $('[data-testid="home-new-file"]')
expect(await newFileButton.getText()).toEqual('New project') 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 () => { it('opens the settings page, checks filesystem settings, and closes the settings page', async () => {
const menuButton = await $('[data-testid="user-sidebar-toggle"]') const menuButton = await $('[data-testid="user-sidebar-toggle"]')
@ -140,11 +150,8 @@ describe('ZMA authorized user flows', () => {
const base = isWin32 ? 'http://tauri.localhost' : 'tauri://localhost' const base = isWin32 ? 'http://tauri.localhost' : 'tauri://localhost'
await browser.execute(`window.location.href = "${base}/home"`) await browser.execute(`window.location.href = "${base}/home"`)
}) })
})
describe('ZMA sign out flow', () => {
it('signs out', async () => { it('signs out', async () => {
await new Promise((resolve) => setTimeout(resolve, 1000))
const menuButton = await $('[data-testid="user-sidebar-toggle"]') const menuButton = await $('[data-testid="user-sidebar-toggle"]')
await click(menuButton) await click(menuButton)
const signoutButton = await $('[data-testid="user-sidebar-sign-out"]') const signoutButton = await $('[data-testid="user-sidebar-sign-out"]')

View File

@ -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)
}

62
flake.lock generated
View File

@ -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
}

View File

@ -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";
};
});
};
}

View File

@ -1,6 +1,6 @@
{ {
"name": "untitled-app", "name": "untitled-app",
"version": "0.22.6", "version": "0.21.9",
"private": true, "private": true,
"dependencies": { "dependencies": {
"@codemirror/autocomplete": "^6.16.0", "@codemirror/autocomplete": "^6.16.0",
@ -10,7 +10,7 @@
"@fortawesome/react-fontawesome": "^0.2.0", "@fortawesome/react-fontawesome": "^0.2.0",
"@headlessui/react": "^1.7.19", "@headlessui/react": "^1.7.19",
"@headlessui/tailwindcss": "^0.2.0", "@headlessui/tailwindcss": "^0.2.0",
"@kittycad/lib": "^0.0.67", "@kittycad/lib": "^0.0.64",
"@lezer/javascript": "^1.4.9", "@lezer/javascript": "^1.4.9",
"@open-rpc/client-js": "^1.8.1", "@open-rpc/client-js": "^1.8.1",
"@react-hook/resize-observer": "^2.0.1", "@react-hook/resize-observer": "^2.0.1",
@ -37,7 +37,6 @@
"crypto-js": "^4.2.0", "crypto-js": "^4.2.0",
"debounce-promise": "^3.1.2", "debounce-promise": "^3.1.2",
"decamelize": "^6.0.0", "decamelize": "^6.0.0",
"eslint-plugin-suggest-no-throw": "^1.0.0",
"formik": "^2.4.6", "formik": "^2.4.6",
"fuse.js": "^7.0.0", "fuse.js": "^7.0.0",
"html2canvas-pro": "^1.4.3", "html2canvas-pro": "^1.4.3",
@ -89,7 +88,7 @@
"fmt-check": "prettier --check ./src *.ts *.json *.js ./e2e", "fmt-check": "prettier --check ./src *.ts *.json *.js ./e2e",
"fetch:wasm": "./get-latest-wasm-bundle.sh", "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-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", "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\"", "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", "wasm-prep": "rm -rf src/wasm-lib/pkg && mkdir src/wasm-lib/pkg && rm -rf src/wasm-lib/kcl/bindings",
@ -121,7 +120,7 @@
"@babel/plugin-proposal-private-property-in-object": "^7.21.11", "@babel/plugin-proposal-private-property-in-object": "^7.21.11",
"@babel/preset-env": "^7.24.3", "@babel/preset-env": "^7.24.3",
"@iarna/toml": "^2.2.5", "@iarna/toml": "^2.2.5",
"@playwright/test": "^1.44.1", "@playwright/test": "^1.43.1",
"@tauri-apps/cli": "^2.0.0-beta.13", "@tauri-apps/cli": "^2.0.0-beta.13",
"@types/crypto-js": "^4.2.2", "@types/crypto-js": "^4.2.2",
"@types/debounce-promise": "^3.1.9", "@types/debounce-promise": "^3.1.9",

View File

@ -17,8 +17,8 @@ export default defineConfig({
forbidOnly: !!process.env.CI, forbidOnly: !!process.env.CI,
/* Retry on CI only */ /* Retry on CI only */
retries: process.env.CI ? 3 : 0, retries: process.env.CI ? 3 : 0,
/* Different amount of parallelism on CI and local. */ /* Opt out of parallel tests on CI. */
workers: process.env.CI ? 4 : 4, workers: process.env.CI ? 2 : 1,
/* Reporter to use. See https://playwright.dev/docs/test-reporters */ /* Reporter to use. See https://playwright.dev/docs/test-reporters */
reporter: 'html', reporter: 'html',
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */ /* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
@ -34,14 +34,7 @@ export default defineConfig({
projects: [ projects: [
{ {
name: 'Google Chrome', name: 'Google Chrome',
use: { use: { ...devices['Desktop Chrome'], channel: 'chrome' }, // or 'chrome-beta'
...devices['Desktop Chrome'],
channel: 'chrome',
contextOptions: {
/* Chromium is the only one with these permission types */
permissions: ['clipboard-write', 'clipboard-read'],
},
}, // or 'chrome-beta'
}, },
{ {
name: 'webkit', name: 'webkit',

Binary file not shown.

Before

Width:  |  Height:  |  Size: 193 KiB

304
src-tauri/Cargo.lock generated
View File

@ -200,7 +200,7 @@ dependencies = [
"tauri-plugin-shell", "tauri-plugin-shell",
"tauri-plugin-updater", "tauri-plugin-updater",
"tokio", "tokio",
"toml 0.8.14", "toml 0.8.13",
"url", "url",
] ]
@ -344,7 +344,7 @@ checksum = "3b43422f69d8ff38f95f1b2bb76517c91589a924d1559a0e935d7c8ce0274c11"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.68", "syn 2.0.66",
] ]
[[package]] [[package]]
@ -379,7 +379,7 @@ checksum = "c6fa2087f2753a7da8cc1c0dbfcf89579dd57458e36769de5ac750b4671737ca"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.68", "syn 2.0.66",
] ]
[[package]] [[package]]
@ -405,6 +405,12 @@ dependencies = [
"system-deps", "system-deps",
] ]
[[package]]
name = "atomic"
version = "0.5.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c59bdb34bc650a32731b31bd8f0829cc15d24a708ee31559e0bb34f2bc320cba"
[[package]] [[package]]
name = "atomic-waker" name = "atomic-waker"
version = "1.1.2" version = "1.1.2"
@ -419,7 +425,7 @@ checksum = "3c87f3f15e7794432337fc718554eaa4dc8f04c9677a950ffe366f20a162ae42"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.68", "syn 2.0.66",
] ]
[[package]] [[package]]
@ -568,7 +574,7 @@ dependencies = [
"proc-macro-crate 3.1.0", "proc-macro-crate 3.1.0",
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.68", "syn 2.0.66",
"syn_derive", "syn_derive",
] ]
@ -595,9 +601,9 @@ dependencies = [
[[package]] [[package]]
name = "bson" name = "bson"
version = "2.11.0" version = "2.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d8a88e82b9106923b5c4d6edfca9e7db958d4e98a478ec115022e81b9b38e2c8" checksum = "4d43b38e074cc0de2957f10947e376a1d88b9c4dbab340b590800cc1b2e066b2"
dependencies = [ dependencies = [
"ahash 0.8.11", "ahash 0.8.11",
"base64 0.13.1", "base64 0.13.1",
@ -760,7 +766,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8a969e13a7589e9e3e4207e153bae624ade2b5622fb4684a4923b23ec3d57719" checksum = "8a969e13a7589e9e3e4207e153bae624ade2b5622fb4684a4923b23ec3d57719"
dependencies = [ dependencies = [
"serde", "serde",
"toml 0.8.14", "toml 0.8.13",
] ]
[[package]] [[package]]
@ -846,9 +852,9 @@ dependencies = [
[[package]] [[package]]
name = "clap" name = "clap"
version = "4.5.7" version = "4.5.4"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5db83dced34638ad474f39f250d7fea9598bdd239eaced1bdf45d597da0f433f" checksum = "90bc066a67923782aa8515dbaea16946c5bcc5addbd668bb80af688e53e548a0"
dependencies = [ dependencies = [
"clap_builder", "clap_builder",
"clap_derive", "clap_derive",
@ -856,9 +862,9 @@ dependencies = [
[[package]] [[package]]
name = "clap_builder" name = "clap_builder"
version = "4.5.7" version = "4.5.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f7e204572485eb3fbf28f871612191521df159bc3e15a9f5064c66dba3a8c05f" checksum = "ae129e2e766ae0ec03484e609954119f123cc1fe650337e155d03b022f24f7b4"
dependencies = [ dependencies = [
"anstream", "anstream",
"anstyle", "anstyle",
@ -870,14 +876,14 @@ dependencies = [
[[package]] [[package]]
name = "clap_derive" name = "clap_derive"
version = "4.5.5" version = "4.5.4"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c780290ccf4fb26629baa7a1081e68ced113f1d3ec302fa5948f1c381ebf06c6" checksum = "528131438037fd55894f62d6e9f068b8f45ac57ffa77517819645d10aed04f64"
dependencies = [ dependencies = [
"heck 0.5.0", "heck 0.5.0",
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.68", "syn 2.0.66",
] ]
[[package]] [[package]]
@ -1079,7 +1085,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "13b588ba4ac1a99f7f2964d24b3d896ddc6bf847ee3855dbd4366f058cfcd331" checksum = "13b588ba4ac1a99f7f2964d24b3d896ddc6bf847ee3855dbd4366f058cfcd331"
dependencies = [ dependencies = [
"quote", "quote",
"syn 2.0.68", "syn 2.0.66",
] ]
[[package]] [[package]]
@ -1089,7 +1095,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "edb49164822f3ee45b17acd4a208cfc1251410cf0cad9a833234c9890774dd9f" checksum = "edb49164822f3ee45b17acd4a208cfc1251410cf0cad9a833234c9890774dd9f"
dependencies = [ dependencies = [
"quote", "quote",
"syn 2.0.68", "syn 2.0.66",
] ]
[[package]] [[package]]
@ -1113,7 +1119,7 @@ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"strsim 0.10.0", "strsim 0.10.0",
"syn 2.0.68", "syn 2.0.66",
] ]
[[package]] [[package]]
@ -1124,7 +1130,7 @@ checksum = "a668eda54683121533a393014d8692171709ff57a7d61f187b6e782719f8933f"
dependencies = [ dependencies = [
"darling_core", "darling_core",
"quote", "quote",
"syn 2.0.68", "syn 2.0.66",
] ]
[[package]] [[package]]
@ -1140,20 +1146,6 @@ dependencies = [
"parking_lot_core 0.9.9", "parking_lot_core 0.9.9",
] ]
[[package]]
name = "dashmap"
version = "6.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "804c8821570c3f8b70230c2ba75ffa5c0f9a4189b9a432b6656c536712acae28"
dependencies = [
"cfg-if",
"crossbeam-utils",
"hashbrown 0.14.3",
"lock_api",
"once_cell",
"parking_lot_core 0.9.9",
]
[[package]] [[package]]
name = "data-encoding" name = "data-encoding"
version = "2.5.0" version = "2.5.0"
@ -1168,9 +1160,9 @@ checksum = "5c297a1c74b71ae29df00c3e22dd9534821d60eb9af5a0192823fa2acea70c2a"
[[package]] [[package]]
name = "databake" name = "databake"
version = "0.1.8" version = "0.1.7"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6a04fbfbecca8f0679c8c06fef907594adcc3e2052e11163a6d30535a1a5604d" checksum = "82175d72e69414ceafbe2b49686794d3a8bed846e0d50267355f83ea8fdd953a"
dependencies = [ dependencies = [
"databake-derive", "databake-derive",
"proc-macro2", "proc-macro2",
@ -1179,13 +1171,13 @@ dependencies = [
[[package]] [[package]]
name = "databake-derive" name = "databake-derive"
version = "0.1.8" version = "0.1.7"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4078275de501a61ceb9e759d37bdd3d7210e654dbc167ac1a3678ef4435ed57b" checksum = "377af281d8f23663862a7c84623bc5dcf7f8c44b13c7496a590bdc157f941a43"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.68", "syn 2.0.66",
"synstructure", "synstructure",
] ]
@ -1222,7 +1214,7 @@ dependencies = [
"regex", "regex",
"serde", "serde",
"serde_tokenstream", "serde_tokenstream",
"syn 2.0.68", "syn 2.0.66",
] ]
[[package]] [[package]]
@ -1233,7 +1225,7 @@ checksum = "67e77553c4162a157adbf834ebae5b415acbecbeafc7a74b0e886657506a7611"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.68", "syn 2.0.66",
] ]
[[package]] [[package]]
@ -1295,7 +1287,7 @@ checksum = "487585f4d0c6655fe74905e2504d8ad6908e4db67f744eb140876906c2f3175d"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.68", "syn 2.0.66",
] ]
[[package]] [[package]]
@ -1327,7 +1319,7 @@ checksum = "f2b99bf03862d7f545ebc28ddd33a665b50865f4dfd84031a393823879bd4c54"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.68", "syn 2.0.66",
] ]
[[package]] [[package]]
@ -1381,7 +1373,7 @@ dependencies = [
"cc", "cc",
"memchr", "memchr",
"rustc_version", "rustc_version",
"toml 0.8.14", "toml 0.8.13",
"vswhom", "vswhom",
"winreg 0.52.0", "winreg 0.52.0",
] ]
@ -1425,7 +1417,7 @@ checksum = "5c785274071b1b420972453b306eeca06acf4633829db4223b58a2a8c5953bc4"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.68", "syn 2.0.66",
] ]
[[package]] [[package]]
@ -1576,7 +1568,7 @@ checksum = "1a5c6c585bc94aaf2c7b51dd4c2ba22680844aba4c687be581871a6f518c5742"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.68", "syn 2.0.66",
] ]
[[package]] [[package]]
@ -1692,7 +1684,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.68", "syn 2.0.66",
] ]
[[package]] [[package]]
@ -1968,7 +1960,7 @@ dependencies = [
"proc-macro-error", "proc-macro-error",
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.68", "syn 2.0.66",
] ]
[[package]] [[package]]
@ -1996,7 +1988,7 @@ dependencies = [
"inflections", "inflections",
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.68", "syn 2.0.66",
] ]
[[package]] [[package]]
@ -2071,7 +2063,7 @@ dependencies = [
"proc-macro-error", "proc-macro-error",
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.68", "syn 2.0.66",
] ]
[[package]] [[package]]
@ -2478,15 +2470,6 @@ dependencies = [
"either", "either",
] ]
[[package]]
name = "itertools"
version = "0.13.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186"
dependencies = [
"either",
]
[[package]] [[package]]
name = "itoa" name = "itoa"
version = "0.4.8" version = "0.4.8"
@ -2576,7 +2559,7 @@ dependencies = [
[[package]] [[package]]
name = "kcl-lib" name = "kcl-lib"
version = "0.1.67" version = "0.1.58"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"approx", "approx",
@ -2586,7 +2569,7 @@ dependencies = [
"bson", "bson",
"chrono", "chrono",
"clap", "clap",
"dashmap 6.0.1", "dashmap",
"databake", "databake",
"derive-docs", "derive-docs",
"form_urlencoded", "form_urlencoded",
@ -2595,6 +2578,8 @@ dependencies = [
"gltf-json", "gltf-json",
"js-sys", "js-sys",
"kittycad", "kittycad",
"kittycad-execution-plan-macros",
"kittycad-execution-plan-traits",
"lazy_static", "lazy_static",
"mime_guess", "mime_guess",
"parse-display", "parse-display",
@ -2607,7 +2592,7 @@ dependencies = [
"thiserror", "thiserror",
"tokio", "tokio",
"tokio-tungstenite", "tokio-tungstenite",
"toml 0.8.14", "toml 0.8.13",
"tower-lsp", "tower-lsp",
"ts-rs", "ts-rs",
"url", "url",
@ -2633,9 +2618,9 @@ dependencies = [
[[package]] [[package]]
name = "kittycad" name = "kittycad"
version = "0.3.6" version = "0.3.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "af3de9bb4b1441f198689a9f64a8163a518377e30b348a784680e738985b95eb" checksum = "b0cbef813153197e60c0e96f59eea0b75f8418380f414b20250ee81b60e522c3"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"async-trait", "async-trait",
@ -2648,7 +2633,7 @@ dependencies = [
"format_serde_error", "format_serde_error",
"futures", "futures",
"http 0.2.12", "http 0.2.12",
"itertools 0.13.0", "itertools",
"log", "log",
"mime_guess", "mime_guess",
"parse-display", "parse-display",
@ -2670,6 +2655,28 @@ dependencies = [
"uuid", "uuid",
] ]
[[package]]
name = "kittycad-execution-plan-macros"
version = "0.1.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0611fc9b9786175da21d895ffa0f65039e19c9111e94a41b7af999e3b95f045f"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.66",
]
[[package]]
name = "kittycad-execution-plan-traits"
version = "0.1.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "123cb47e2780ea8ef3aa67b4db237a27b388d3d3b96db457e274aa4565723151"
dependencies = [
"serde",
"thiserror",
"uuid",
]
[[package]] [[package]]
name = "kuchikiki" name = "kuchikiki"
version = "0.8.2" version = "0.8.2"
@ -2685,9 +2692,9 @@ dependencies = [
[[package]] [[package]]
name = "lazy_static" name = "lazy_static"
version = "1.5.0" version = "1.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646"
[[package]] [[package]]
name = "libappindicator" name = "libappindicator"
@ -3346,9 +3353,9 @@ dependencies = [
[[package]] [[package]]
name = "parse-display" name = "parse-display"
version = "0.9.1" version = "0.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "914a1c2265c98e2446911282c6ac86d8524f495792c38c5bd884f80499c7538a" checksum = "06af5f9333eb47bd9ba8462d612e37a8328a5cb80b13f0af4de4c3b89f52dee5"
dependencies = [ dependencies = [
"parse-display-derive", "parse-display-derive",
"regex", "regex",
@ -3357,16 +3364,16 @@ dependencies = [
[[package]] [[package]]
name = "parse-display-derive" name = "parse-display-derive"
version = "0.9.1" version = "0.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2ae7800a4c974efd12df917266338e79a7a74415173caf7e70aa0a0707345281" checksum = "dc9252f259500ee570c75adcc4e317fa6f57a1e47747d622e0bf838002a7b790"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"regex", "regex",
"regex-syntax 0.8.3", "regex-syntax 0.8.3",
"structmeta", "structmeta",
"syn 2.0.68", "syn 2.0.66",
] ]
[[package]] [[package]]
@ -3508,7 +3515,7 @@ dependencies = [
"phf_shared 0.11.2", "phf_shared 0.11.2",
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.68", "syn 2.0.66",
] ]
[[package]] [[package]]
@ -3547,7 +3554,7 @@ dependencies = [
"bincode", "bincode",
"either", "either",
"fnv", "fnv",
"itertools 0.12.1", "itertools",
"lazy_static", "lazy_static",
"nom", "nom",
"quick-xml", "quick-xml",
@ -3576,7 +3583,7 @@ checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.68", "syn 2.0.66",
] ]
[[package]] [[package]]
@ -3728,9 +3735,9 @@ checksum = "dc375e1527247fe1a97d8b7156678dfe7c1af2fc075c9a4db3690ecd2a148068"
[[package]] [[package]]
name = "proc-macro2" name = "proc-macro2"
version = "1.0.85" version = "1.0.83"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "22244ce15aa966053a896d1accb3a6e68469b97c7f33f284b99f0d576879fc23" checksum = "0b33eb56c327dec362a9e55b3ad14f9d2f0904fb5a5b03b513ab5465399e9f43"
dependencies = [ dependencies = [
"unicode-ident", "unicode-ident",
] ]
@ -4292,19 +4299,6 @@ dependencies = [
"zeroize", "zeroize",
] ]
[[package]]
name = "rustls"
version = "0.23.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ebbbdb961df0ad3f2652da8f3fdc4b36122f568f968f45ad3316f26c025c677b"
dependencies = [
"once_cell",
"rustls-pki-types",
"rustls-webpki 0.102.3",
"subtle",
"zeroize",
]
[[package]] [[package]]
name = "rustls-native-certs" name = "rustls-native-certs"
version = "0.7.0" version = "0.7.0"
@ -4421,7 +4415,7 @@ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"serde_derive_internals", "serde_derive_internals",
"syn 2.0.68", "syn 2.0.66",
] ]
[[package]] [[package]]
@ -4530,7 +4524,7 @@ checksum = "500cbc0ebeb6f46627f50f3f5811ccf6bf00643be300b4c3eabc0ef55dc5b5ba"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.68", "syn 2.0.66",
] ]
[[package]] [[package]]
@ -4541,14 +4535,14 @@ checksum = "330f01ce65a3a5fe59a60c82f3c9a024b573b8a6e875bd233fe5f934e71d54e3"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.68", "syn 2.0.66",
] ]
[[package]] [[package]]
name = "serde_json" name = "serde_json"
version = "1.0.118" version = "1.0.116"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d947f6b3163d8857ea16c4fa0dd4840d52f3041039a85decd46867eb1abef2e4" checksum = "3e17db7126d17feb94eb3fad46bf1a96b034e8aacbc2e775fe81505f8b0b2813"
dependencies = [ dependencies = [
"indexmap 2.2.6", "indexmap 2.2.6",
"itoa 1.0.11", "itoa 1.0.11",
@ -4574,7 +4568,7 @@ checksum = "6c64451ba24fc7a6a2d60fc75dd9c83c90903b19028d4eff35e88fc1e86564e9"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.68", "syn 2.0.66",
] ]
[[package]] [[package]]
@ -4595,7 +4589,7 @@ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"serde", "serde",
"syn 2.0.68", "syn 2.0.66",
] ]
[[package]] [[package]]
@ -4637,7 +4631,7 @@ dependencies = [
"darling", "darling",
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.68", "syn 2.0.66",
] ]
[[package]] [[package]]
@ -4905,7 +4899,7 @@ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"structmeta-derive", "structmeta-derive",
"syn 2.0.68", "syn 2.0.66",
] ]
[[package]] [[package]]
@ -4916,7 +4910,7 @@ checksum = "152a0b65a590ff6c3da95cabe2353ee04e6167c896b28e3b14478c2636c922fc"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.68", "syn 2.0.66",
] ]
[[package]] [[package]]
@ -4938,7 +4932,7 @@ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"rustversion", "rustversion",
"syn 2.0.68", "syn 2.0.66",
] ]
[[package]] [[package]]
@ -4971,9 +4965,9 @@ dependencies = [
[[package]] [[package]]
name = "syn" name = "syn"
version = "2.0.68" version = "2.0.66"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "901fa70d88b9d6c98022e23b4136f9f3e54e4662c3bc1bd1d84a42a9a0f0c1e9" checksum = "c42f3f41a2de00b01c0aaad383c5a45241efc8b2d1eda5661812fda5f3cdcff5"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
@ -4989,7 +4983,7 @@ dependencies = [
"proc-macro-error", "proc-macro-error",
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.68", "syn 2.0.66",
] ]
[[package]] [[package]]
@ -5006,7 +5000,7 @@ checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.68", "syn 2.0.66",
] ]
[[package]] [[package]]
@ -5048,7 +5042,7 @@ dependencies = [
"cfg-expr", "cfg-expr",
"heck 0.5.0", "heck 0.5.0",
"pkg-config", "pkg-config",
"toml 0.8.14", "toml 0.8.13",
"version-compare", "version-compare",
] ]
@ -5201,7 +5195,7 @@ dependencies = [
"serde_json", "serde_json",
"tauri-utils", "tauri-utils",
"tauri-winres", "tauri-winres",
"toml 0.8.14", "toml 0.8.13",
"walkdir", "walkdir",
] ]
@ -5223,7 +5217,7 @@ dependencies = [
"serde", "serde",
"serde_json", "serde_json",
"sha2", "sha2",
"syn 2.0.68", "syn 2.0.66",
"tauri-utils", "tauri-utils",
"thiserror", "thiserror",
"time", "time",
@ -5241,7 +5235,7 @@ dependencies = [
"heck 0.4.1", "heck 0.4.1",
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.68", "syn 2.0.66",
"tauri-codegen", "tauri-codegen",
"tauri-utils", "tauri-utils",
] ]
@ -5259,7 +5253,7 @@ dependencies = [
"serde", "serde",
"serde_json", "serde_json",
"tauri-utils", "tauri-utils",
"toml 0.8.14", "toml 0.8.13",
"walkdir", "walkdir",
] ]
@ -5536,7 +5530,7 @@ dependencies = [
"serde_with", "serde_with",
"swift-rs", "swift-rs",
"thiserror", "thiserror",
"toml 0.8.14", "toml 0.8.13",
"url", "url",
"urlpattern", "urlpattern",
"walkdir", "walkdir",
@ -5607,7 +5601,7 @@ checksum = "46c3384250002a6d5af4d114f2845d37b57521033f30d5c3f46c4d70e1197533"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.68", "syn 2.0.66",
] ]
[[package]] [[package]]
@ -5670,9 +5664,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20"
[[package]] [[package]]
name = "tokio" name = "tokio"
version = "1.38.0" version = "1.37.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ba4f4a02a7a80d6f274636f0aa95c7e383b912d41fe721a31f29e29698585a4a" checksum = "1adbebffeca75fcfd058afa480fb6c0b81e165a0323f9c9d39c9697e37c46787"
dependencies = [ dependencies = [
"backtrace", "backtrace",
"bytes", "bytes",
@ -5690,13 +5684,13 @@ dependencies = [
[[package]] [[package]]
name = "tokio-macros" name = "tokio-macros"
version = "2.3.0" version = "2.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5f5ae998a069d4b5aba8ee9dad856af7d520c3699e6159b185c2acd48155d39a" checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.68", "syn 2.0.66",
] ]
[[package]] [[package]]
@ -5720,30 +5714,19 @@ dependencies = [
"tokio", "tokio",
] ]
[[package]]
name = "tokio-rustls"
version = "0.26.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0c7bc40d0e5a97695bb96e27995cd3a08538541b0a846f65bba7a359f36700d4"
dependencies = [
"rustls 0.23.7",
"rustls-pki-types",
"tokio",
]
[[package]] [[package]]
name = "tokio-tungstenite" name = "tokio-tungstenite"
version = "0.23.1" version = "0.21.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c6989540ced10490aaf14e6bad2e3d33728a2813310a0c71d1574304c49631cd" checksum = "c83b561d025642014097b66e6c1bb422783339e0909e4429cde4749d1990bc38"
dependencies = [ dependencies = [
"futures-util", "futures-util",
"log", "log",
"rustls 0.23.7", "rustls 0.22.4",
"rustls-native-certs", "rustls-native-certs",
"rustls-pki-types", "rustls-pki-types",
"tokio", "tokio",
"tokio-rustls 0.26.0", "tokio-rustls 0.25.0",
"tungstenite", "tungstenite",
] ]
@ -5775,14 +5758,14 @@ dependencies = [
[[package]] [[package]]
name = "toml" name = "toml"
version = "0.8.14" version = "0.8.13"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6f49eb2ab21d2f26bd6db7bf383edc527a7ebaee412d17af4d40fdccd442f335" checksum = "a4e43f8cc456c9704c851ae29c67e17ef65d2c30017c17a9765b89c382dc8bba"
dependencies = [ dependencies = [
"serde", "serde",
"serde_spanned", "serde_spanned",
"toml_datetime", "toml_datetime",
"toml_edit 0.22.14", "toml_edit 0.22.13",
] ]
[[package]] [[package]]
@ -5831,9 +5814,9 @@ dependencies = [
[[package]] [[package]]
name = "toml_edit" name = "toml_edit"
version = "0.22.14" version = "0.22.13"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f21c7aaf97f1bd9ca9d4f9e73b0a6c74bd5afef56f2bc931943a6e1c37e04e38" checksum = "c127785850e8c20836d49732ae6abfa47616e60bf9d9f57c43c250361a9db96c"
dependencies = [ dependencies = [
"indexmap 2.2.6", "indexmap 2.2.6",
"serde", "serde",
@ -5874,7 +5857,7 @@ dependencies = [
"async-trait", "async-trait",
"auto_impl", "auto_impl",
"bytes", "bytes",
"dashmap 5.5.3", "dashmap",
"futures", "futures",
"httparse", "httparse",
"lsp-types", "lsp-types",
@ -5896,7 +5879,7 @@ checksum = "84fd902d4e0b9a4b27f2f440108dc034e1758628a9b702f8ec61ad66355422fa"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.68", "syn 2.0.66",
] ]
[[package]] [[package]]
@ -5925,7 +5908,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.68", "syn 2.0.66",
] ]
[[package]] [[package]]
@ -6029,12 +6012,10 @@ checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b"
[[package]] [[package]]
name = "ts-rs" name = "ts-rs"
version = "9.0.0" version = "8.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "git+https://github.com/Aleph-Alpha/ts-rs#f898578d80d3e2a54080c1c046c45f9eaa2435c3"
checksum = "5e2dcf58e612adda9a83800731e8e4aba04d8a302b9029617b0b6e4b021d5357"
dependencies = [ dependencies = [
"chrono", "chrono",
"serde_json",
"thiserror", "thiserror",
"ts-rs-macros", "ts-rs-macros",
"url", "url",
@ -6043,21 +6024,20 @@ dependencies = [
[[package]] [[package]]
name = "ts-rs-macros" name = "ts-rs-macros"
version = "9.0.0" version = "8.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "git+https://github.com/Aleph-Alpha/ts-rs#f898578d80d3e2a54080c1c046c45f9eaa2435c3"
checksum = "cbdee324e50a7402416d9c25270d3df4241ed528af5d36dda18b6f219551c577"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.68", "syn 2.0.66",
"termcolor", "termcolor",
] ]
[[package]] [[package]]
name = "tungstenite" name = "tungstenite"
version = "0.23.0" version = "0.21.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6e2e2ce1e47ed2994fd43b04c8f618008d4cabdd5ee34027cf14f9d918edd9c8" checksum = "9ef1a641ea34f399a848dea702823bbecfb4c486f911735368f1f137cb8257e1"
dependencies = [ dependencies = [
"byteorder", "byteorder",
"bytes", "bytes",
@ -6066,10 +6046,11 @@ dependencies = [
"httparse", "httparse",
"log", "log",
"rand 0.8.5", "rand 0.8.5",
"rustls 0.23.7", "rustls 0.22.4",
"rustls-pki-types", "rustls-pki-types",
"sha1", "sha1",
"thiserror", "thiserror",
"url",
"utf-8", "utf-8",
] ]
@ -6181,9 +6162,9 @@ checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1"
[[package]] [[package]]
name = "url" name = "url"
version = "2.5.2" version = "2.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "22784dbdf76fdde8af1aeda5622b546b422b6fc585325248a2bf9f5e41e94d6c" checksum = "31e6302e3bb753d46e83516cae55ae196fc0c309407cf11ab35cc51a4c2a4633"
dependencies = [ dependencies = [
"form_urlencoded", "form_urlencoded",
"idna", "idna",
@ -6224,10 +6205,11 @@ checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a"
[[package]] [[package]]
name = "uuid" name = "uuid"
version = "1.9.1" version = "1.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5de17fd2f7da591098415cff336e12965a28061ddace43b59cb3c430179c9439" checksum = "a183cf7feeba97b4dd1c0d46788634f6221d87fa961b305bed08c851829efcc0"
dependencies = [ dependencies = [
"atomic",
"getrandom 0.2.14", "getrandom 0.2.14",
"serde", "serde",
"wasm-bindgen", "wasm-bindgen",
@ -6260,7 +6242,7 @@ dependencies = [
"proc-macro-error", "proc-macro-error",
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.68", "syn 2.0.66",
] ]
[[package]] [[package]]
@ -6359,7 +6341,7 @@ dependencies = [
"once_cell", "once_cell",
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.68", "syn 2.0.66",
"wasm-bindgen-shared", "wasm-bindgen-shared",
] ]
@ -6393,7 +6375,7 @@ checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.68", "syn 2.0.66",
"wasm-bindgen-backend", "wasm-bindgen-backend",
"wasm-bindgen-shared", "wasm-bindgen-shared",
] ]
@ -6534,7 +6516,7 @@ checksum = "ac1345798ecd8122468840bcdf1b95e5dc6d2206c5e4b0eafa078d061f59c9bc"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.68", "syn 2.0.66",
] ]
[[package]] [[package]]
@ -6640,7 +6622,7 @@ checksum = "f6fc35f58ecd95a9b71c4f2329b911016e6bec66b3f2e6a4aad86bd2e99e2f9b"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.68", "syn 2.0.66",
] ]
[[package]] [[package]]
@ -6651,7 +6633,7 @@ checksum = "08990546bf4edef8f431fa6326e032865f27138718c587dc21bc0265bbcb57cc"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.68", "syn 2.0.66",
] ]
[[package]] [[package]]
@ -7093,7 +7075,7 @@ checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.68", "syn 2.0.66",
] ]
[[package]] [[package]]

View File

@ -16,7 +16,7 @@ tauri-build = { version = "2.0.0-beta.13", features = [] }
[dependencies] [dependencies]
anyhow = "1" anyhow = "1"
kcl-lib = { version = "0.1.53", path = "../src/wasm-lib/kcl" } kcl-lib = { version = "0.1.53", path = "../src/wasm-lib/kcl" }
kittycad = "0.3.5" kittycad = "0.3.0"
log = "0.4.21" log = "0.4.21"
oauth2 = "4.4.2" oauth2 = "4.4.2"
serde_json = "1.0" serde_json = "1.0"

View File

@ -74,5 +74,5 @@
} }
}, },
"productName": "Zoo Modeling App", "productName": "Zoo Modeling App",
"version": "0.22.6" "version": "0.21.9"
} }

View File

@ -25,7 +25,6 @@ import { LowerRightControls } from 'components/LowerRightControls'
import ModalContainer from 'react-modal-promise' import ModalContainer from 'react-modal-promise'
import useHotkeyWrapper from 'lib/hotkeyWrapper' import useHotkeyWrapper from 'lib/hotkeyWrapper'
import Gizmo from 'components/Gizmo' import Gizmo from 'components/Gizmo'
import { CoreDumpManager } from 'lib/coredump'
export function App() { export function App() {
useRefreshSettings(paths.FILE + 'SETTINGS') useRefreshSettings(paths.FILE + 'SETTINGS')
@ -56,11 +55,7 @@ export function App() {
setHtmlRef(ref) setHtmlRef(ref)
}, [ref]) }, [ref])
const { auth, settings } = useSettingsAuthContext() const { settings } = useSettingsAuthContext()
const token = auth?.context?.token
const coreDumpManager = new CoreDumpManager(engineCommandManager, ref, token)
const { const {
app: { onboardingStatus }, app: { onboardingStatus },
} = settings.context } = settings.context
@ -132,9 +127,9 @@ export function App() {
/> />
<ModalContainer /> <ModalContainer />
<ModelingSidebar paneOpacity={paneOpacity} /> <ModelingSidebar paneOpacity={paneOpacity} />
<Stream /> <Stream className="absolute inset-0 z-0" />
{/* <CamToggle /> */} {/* <CamToggle /> */}
<LowerRightControls coreDumpManager={coreDumpManager}> <LowerRightControls>
<Gizmo /> <Gizmo />
</LowerRightControls> </LowerRightControls>
</div> </div>

View File

@ -160,7 +160,7 @@ export const Router = () => {
const networkStatus = useNetworkStatus() const networkStatus = useNetworkStatus()
return ( return (
<NetworkContext.Provider value={networkStatus}> <NetworkContext.Provider value={networkStatus as any}>
<RouterProvider router={router} /> <RouterProvider router={router} />
</NetworkContext.Provider> </NetworkContext.Provider>
) )

View File

@ -339,7 +339,7 @@ export function Toolbar({
bgClassName, bgClassName,
}} }}
> >
Constraints Constrain
</ActionButtonDropdown> </ActionButtonDropdown>
)} )}
{state.matches('idle') && ( {state.matches('idle') && (

View File

@ -48,14 +48,12 @@ export type ReactCameraProperties =
type: 'perspective' type: 'perspective'
fov?: number fov?: number
position: [number, number, number] position: [number, number, number]
target: [number, number, number]
quaternion: [number, number, number, number] quaternion: [number, number, number, number]
} }
| { | {
type: 'orthographic' type: 'orthographic'
zoom?: number zoom?: number
position: [number, number, number] position: [number, number, number]
target: [number, number, number]
quaternion: [number, number, number, number] quaternion: [number, number, number, number]
} }
@ -174,6 +172,41 @@ export class CameraControls {
} }
} }
throttledUpdateEngineFov = throttle(
(vals: {
position: Vector3
quaternion: Quaternion
zoom: number
fov: number
target: Vector3
}) => {
const cmd: EngineCommand = {
type: 'modeling_cmd_req',
cmd_id: uuidv4(),
cmd: {
type: 'default_camera_perspective_settings',
...convertThreeCamValuesToEngineCam({
...vals,
isPerspective: true,
}),
fov_y: vals.fov,
...calculateNearFarFromFOV(vals.fov),
},
}
this.engineCommandManager.sendSceneCommand(cmd)
this.lastPerspectiveCmd = cmd
this.lastPerspectiveCmdTime = Date.now()
if (this.lastPerspectiveCmdTimeoutId !== null) {
clearTimeout(this.lastPerspectiveCmdTimeoutId)
}
this.lastPerspectiveCmdTimeoutId = setTimeout(
this.sendLastPerspectiveReliableChannel,
lastCmdDelay
) as any as number
},
1000 / 30
)
constructor( constructor(
isOrtho = false, isOrtho = false,
domElement: HTMLCanvasElement, domElement: HTMLCanvasElement,
@ -409,7 +442,7 @@ export class CameraControls {
this.handleEnd() this.handleEnd()
return return
} }
this.engineCommandManager.sendSceneCommand({ this.throttledEngCmd({
type: 'modeling_cmd_req', type: 'modeling_cmd_req',
cmd: { cmd: {
type: 'default_camera_zoom', type: 'default_camera_zoom',
@ -421,11 +454,11 @@ export class CameraControls {
return return
} }
// Else "clientToEngine" (Sketch Mode) or forceUpdate const isTrackpad = Math.abs(event.deltaY) <= 1 || event.deltaY % 1 === 0
// From onMouseMove zoom handling which seems to be really smooth const zoomSpeed = isTrackpad ? 0.02 : 0.1 // Reduced zoom speed for trackpad
this.pendingZoom = this.pendingZoom ? this.pendingZoom : 1 this.pendingZoom = this.pendingZoom ? this.pendingZoom : 1
this.pendingZoom *= 1 + event.deltaY * 0.01 this.pendingZoom *= 1 + (event.deltaY > 0 ? zoomSpeed : -zoomSpeed)
this.handleEnd() this.handleEnd()
} }
@ -499,10 +532,9 @@ export class CameraControls {
direction.normalize() direction.normalize()
this.camera.position.copy(this.target).addScaledVector(direction, distance) this.camera.position.copy(this.target).addScaledVector(direction, distance)
} }
usePerspectiveCamera = async () => { usePerspectiveCamera = () => {
this._usePerspectiveCamera() this._usePerspectiveCamera()
if (this.syncDirection === 'clientToEngine') { this.engineCommandManager.sendSceneCommand({
await this.engineCommandManager.sendSceneCommand({
type: 'modeling_cmd_req', type: 'modeling_cmd_req',
cmd_id: uuidv4(), cmd_id: uuidv4(),
cmd: { cmd: {
@ -514,13 +546,12 @@ export class CameraControls {
}, },
}, },
}) })
}
this.onCameraChange() this.onCameraChange()
this.update() this.update()
return this.camera return this.camera
} }
dollyZoom = async (newFov: number, splitEngineCalls = false) => { dollyZoom = (newFov: number) => {
if (!(this.camera instanceof PerspectiveCamera)) { if (!(this.camera instanceof PerspectiveCamera)) {
console.warn('Dolly zoom is only applicable to perspective cameras.') console.warn('Dolly zoom is only applicable to perspective cameras.')
return return
@ -571,52 +602,13 @@ export class CameraControls {
this.camera.near = z_near this.camera.near = z_near
this.camera.far = z_far this.camera.far = z_far
if (splitEngineCalls) { this.throttledUpdateEngineFov({
await this.engineCommandManager.sendSceneCommand({ fov: newFov,
type: 'modeling_cmd_req',
cmd_id: uuidv4(),
cmd: {
type: 'default_camera_look_at',
...convertThreeCamValuesToEngineCam({
isPerspective: true,
position: newPosition, position: newPosition,
quaternion: this.camera.quaternion, quaternion: this.camera.quaternion,
zoom: this.camera.zoom, zoom: this.camera.zoom,
target: this.target, target: this.target,
}),
},
}) })
await this.engineCommandManager.sendSceneCommand({
type: 'modeling_cmd_req',
cmd_id: uuidv4(),
cmd: {
type: 'default_camera_set_perspective',
parameters: {
fov_y: newFov,
z_near: 0.01,
z_far: 1000,
},
},
})
} else {
await this.engineCommandManager.sendSceneCommand({
type: 'modeling_cmd_req',
cmd_id: uuidv4(),
cmd: {
type: 'default_camera_perspective_settings',
...convertThreeCamValuesToEngineCam({
isPerspective: true,
position: newPosition,
quaternion: this.camera.quaternion,
zoom: this.camera.zoom,
target: this.target,
}),
fov_y: newFov,
z_near: 0.01,
z_far: 1000,
},
})
}
} }
update = (forceUpdate = false) => { update = (forceUpdate = false) => {
@ -781,75 +773,6 @@ export class CameraControls {
}) })
} }
async updateCameraToAxis(
axis: 'x' | 'y' | 'z' | '-x' | '-y' | '-z'
): Promise<void> {
const distance = this.camera.position.distanceTo(this.target)
const vantage = this.target.clone()
let up = { x: 0, y: 0, z: 1 }
if (axis === 'x') {
vantage.x += distance
} else if (axis === 'y') {
vantage.y += distance
} else if (axis === 'z') {
vantage.z += distance
up = { x: -1, y: 0, z: 0 }
} else if (axis === '-x') {
vantage.x -= distance
} else if (axis === '-y') {
vantage.y -= distance
} else if (axis === '-z') {
vantage.z -= distance
up = { x: -1, y: 0, z: 0 }
}
await this.engineCommandManager.sendSceneCommand({
type: 'modeling_cmd_req',
cmd_id: uuidv4(),
cmd: {
type: 'default_camera_look_at',
center: this.target,
vantage: vantage,
up: up,
},
})
await this.engineCommandManager.sendSceneCommand({
type: 'modeling_cmd_req',
cmd_id: uuidv4(),
cmd: {
type: 'default_camera_get_settings',
},
})
}
async resetCameraPosition(): Promise<void> {
await this.engineCommandManager.sendSceneCommand({
type: 'modeling_cmd_req',
cmd_id: uuidv4(),
cmd: {
type: 'default_camera_look_at',
center: this.target,
vantage: {
x: this.target.x,
y: this.target.y - 128,
z: this.target.z + 64,
},
up: { x: 0, y: 0, z: 1 },
},
})
await this.engineCommandManager.sendSceneCommand({
type: 'modeling_cmd_req',
cmd_id: uuidv4(),
cmd: {
type: 'zoom_to_fit',
object_ids: [], // leave empty to zoom to all objects
padding: 0.2, // padding around the objects
},
})
}
async tweenCameraToQuaternion( async tweenCameraToQuaternion(
targetQuaternion: Quaternion, targetQuaternion: Quaternion,
targetPosition = new Vector3(), targetPosition = new Vector3(),
@ -1021,29 +944,6 @@ export class CameraControls {
.onComplete(onComplete) .onComplete(onComplete)
.start() .start()
}) })
snapToPerspectiveBeforeHandingBackControlToEngine = async (
targetCamUp = new Vector3(0, 0, 1)
) => {
if (this.syncDirection === 'engineToClient') {
console.warn(
'animate To Perspective not design to work with engineToClient syncDirection.'
)
}
this.isFovAnimationInProgress = true
const targetFov = this.fovBeforeOrtho // Target FOV for perspective
this.lastPerspectiveFov = 4
let currentFov = 4
const initialCameraUp = this.camera.up.clone()
this.usePerspectiveCamera()
const tempVec = new Vector3()
currentFov = this.lastPerspectiveFov + (targetFov - this.lastPerspectiveFov)
const currentUp = tempVec.lerpVectors(initialCameraUp, targetCamUp, 1)
this.camera.up.copy(currentUp)
await this.dollyZoom(currentFov, true)
this.isFovAnimationInProgress = false
}
get reactCameraProperties(): ReactCameraProperties { get reactCameraProperties(): ReactCameraProperties {
return { return {
@ -1057,11 +957,6 @@ export class CameraControls {
roundOff(this.camera.position.y, 2), roundOff(this.camera.position.y, 2),
roundOff(this.camera.position.z, 2), roundOff(this.camera.position.z, 2),
], ],
target: [
roundOff(this.target.x, 2),
roundOff(this.target.y, 2),
roundOff(this.target.z, 2),
],
quaternion: [ quaternion: [
roundOff(this.camera.quaternion.x, 2), roundOff(this.camera.quaternion.x, 2),
roundOff(this.camera.quaternion.y, 2), roundOff(this.camera.quaternion.y, 2),
@ -1116,7 +1011,7 @@ function calculateNearFarFromFOV(fov: number) {
// const nearFarRatio = (fov - 3) / (45 - 3) // const nearFarRatio = (fov - 3) / (45 - 3)
// const z_near = 0.1 + nearFarRatio * (5 - 0.1) // const z_near = 0.1 + nearFarRatio * (5 - 0.1)
// const z_far = 1000 + nearFarRatio * (100000 - 1000) // const z_far = 1000 + nearFarRatio * (100000 - 1000)
return { z_near: 0.01, z_far: 1000 } return { z_near: 0.1, z_far: 1000 }
} }
function convertThreeCamValuesToEngineCam({ function convertThreeCamValuesToEngineCam({
@ -1135,6 +1030,11 @@ function convertThreeCamValuesToEngineCam({
// leaving for now since it's working but maybe revisit later // leaving for now since it's working but maybe revisit later
const euler = new Euler().setFromQuaternion(quaternion, 'XYZ') const euler = new Euler().setFromQuaternion(quaternion, 'XYZ')
const lookAtVector = new Vector3(0, 0, -1)
.applyEuler(euler)
.normalize()
.add(position)
const upVector = new Vector3(0, 1, 0).applyEuler(euler).normalize() const upVector = new Vector3(0, 1, 0).applyEuler(euler).normalize()
if (isPerspective) { if (isPerspective) {
return { return {
@ -1143,10 +1043,6 @@ function convertThreeCamValuesToEngineCam({
vantage: position, vantage: position,
} }
} }
const lookAtVector = new Vector3(0, 0, -1)
.applyEuler(euler)
.normalize()
.add(position)
const fudgeFactor2 = zoom * 0.9979224466814468 - 0.03473692325839295 const fudgeFactor2 = zoom * 0.9979224466814468 - 0.03473692325839295
const zoomFactor = (-ZOOM_MAGIC_NUMBER + fudgeFactor2) / zoom const zoomFactor = (-ZOOM_MAGIC_NUMBER + fudgeFactor2) / zoom
const direction = lookAtVector.clone().sub(position).normalize() const direction = lookAtVector.clone().sub(position).normalize()

View File

@ -44,7 +44,6 @@ import {
removeSingleConstraintInfo, removeSingleConstraintInfo,
} from 'lang/modifyAst' } from 'lang/modifyAst'
import { ActionButton } from 'components/ActionButton' import { ActionButton } from 'components/ActionButton'
import { err, trap } from 'lib/trap'
function useShouldHideScene(): { hideClient: boolean; hideServer: boolean } { function useShouldHideScene(): { hideClient: boolean; hideServer: boolean } {
const [isCamMoving, setIsCamMoving] = useState(false) const [isCamMoving, setIsCamMoving] = useState(false)
@ -137,7 +136,6 @@ export const ClientSideScene = ({
<div <div
ref={canvasRef} ref={canvasRef}
style={{ cursor: cursor }} style={{ cursor: cursor }}
data-testid="client-side-scene"
className={`absolute inset-0 h-full w-full transition-all duration-300 ${ className={`absolute inset-0 h-full w-full transition-all duration-300 ${
hideClient ? 'opacity-0' : 'opacity-100' hideClient ? 'opacity-0' : 'opacity-100'
} ${hideServer ? 'bg-chalkboard-10 dark:bg-chalkboard-100' : ''} ${ } ${hideServer ? 'bg-chalkboard-10 dark:bg-chalkboard-100' : ''} ${
@ -185,14 +183,11 @@ const Overlay = ({
let xAlignment = overlay.angle < 0 ? '0%' : '-100%' let xAlignment = overlay.angle < 0 ? '0%' : '-100%'
let yAlignment = overlay.angle < -90 || overlay.angle >= 90 ? '0%' : '-100%' let yAlignment = overlay.angle < -90 || overlay.angle >= 90 ? '0%' : '-100%'
const _node1 = getNodeFromPath<CallExpression>( const callExpression = getNodeFromPath<CallExpression>(
kclManager.ast, kclManager.ast,
overlay.pathToNode, overlay.pathToNode,
'CallExpression' 'CallExpression'
) ).node
if (err(_node1)) return
const callExpression = _node1.node
const constraints = getConstraintInfo( const constraints = getConstraintInfo(
callExpression, callExpression,
codeManager.code, codeManager.code,
@ -223,7 +218,6 @@ const Overlay = ({
data-testid="segment-overlay" data-testid="segment-overlay"
data-path-to-node={pathToNodeString} data-path-to-node={pathToNodeString}
data-overlay-index={overlayIndex} data-overlay-index={overlayIndex}
data-overlay-visible={shouldShow}
data-overlay-angle={overlay.angle} data-overlay-angle={overlay.angle}
className="pointer-events-auto absolute w-0 h-0" className="pointer-events-auto absolute w-0 h-0"
style={{ style={{
@ -232,7 +226,6 @@ const Overlay = ({
></div> ></div>
{shouldShow && ( {shouldShow && (
<div <div
data-overlay-toolbar-index={overlayIndex}
className={`px-0 pointer-events-auto absolute flex gap-1`} className={`px-0 pointer-events-auto absolute flex gap-1`}
style={{ style={{
transform: `translate3d(calc(${ transform: `translate3d(calc(${
@ -358,7 +351,7 @@ export async function deleteSegment({
pathToNode: PathToNode pathToNode: PathToNode
sketchDetails: SketchDetails | null sketchDetails: SketchDetails | null
}) { }) {
let modifiedAst: Program | Error = kclManager.ast let modifiedAst: Program = kclManager.ast
const dependentRanges = findUsesOfTagInPipe(modifiedAst, pathToNode) const dependentRanges = findUsesOfTagInPipe(modifiedAst, pathToNode)
const shouldContinueSegDelete = dependentRanges.length const shouldContinueSegDelete = dependentRanges.length
@ -369,7 +362,6 @@ export async function deleteSegment({
: true : true
if (!shouldContinueSegDelete) return if (!shouldContinueSegDelete) return
modifiedAst = deleteSegmentFromPipeExpression( modifiedAst = deleteSegmentFromPipeExpression(
dependentRanges, dependentRanges,
modifiedAst, modifiedAst,
@ -377,12 +369,9 @@ export async function deleteSegment({
codeManager.code, codeManager.code,
pathToNode pathToNode
) )
if (err(modifiedAst)) return Promise.reject(modifiedAst)
const newCode = recast(modifiedAst) const newCode = recast(modifiedAst)
modifiedAst = parse(newCode) modifiedAst = parse(newCode)
if (err(modifiedAst)) return Promise.reject(modifiedAst)
const testExecute = await executeAst({ const testExecute = await executeAst({
ast: modifiedAst, ast: modifiedAst,
useFakeExecutor: true, useFakeExecutor: true,
@ -394,15 +383,13 @@ export async function deleteSegment({
} }
if (!sketchDetails) return if (!sketchDetails) return
await sceneEntitiesManager.updateAstAndRejigSketch( sceneEntitiesManager.updateAstAndRejigSketch(
pathToNode, sketchDetails.sketchPathToNode,
modifiedAst, modifiedAst,
sketchDetails.zAxis, sketchDetails.zAxis,
sketchDetails.yAxis, sketchDetails.yAxis,
sketchDetails.origin sketchDetails.origin
) )
// Now 'Set sketchDetails' is called with the modified pathToNode
} }
const SegmentMenu = ({ const SegmentMenu = ({
@ -433,16 +420,12 @@ const SegmentMenu = ({
verticalPosition === 'top' ? 'bottom-full' : 'top-full' verticalPosition === 'top' ? 'bottom-full' : 'top-full'
} z-10 w-36 flex flex-col gap-1 divide-y divide-chalkboard-20 dark:divide-chalkboard-70 align-stretch px-0 py-1 bg-chalkboard-10 dark:bg-chalkboard-100 rounded-sm shadow-lg border border-solid border-chalkboard-20/50 dark:border-chalkboard-80/50`} } z-10 w-36 flex flex-col gap-1 divide-y divide-chalkboard-20 dark:divide-chalkboard-70 align-stretch px-0 py-1 bg-chalkboard-10 dark:bg-chalkboard-100 rounded-sm shadow-lg border border-solid border-chalkboard-20/50 dark:border-chalkboard-80/50`}
> >
{/* <button className="hover:bg-white/80 bg-white/50 rounded p-1 text-nowrap">
Remove segment constraints
</button> */}
<button <button
className="!border-transparent rounded-sm text-left p-1 text-nowrap" className="!border-transparent rounded-sm text-left p-1 text-nowrap"
onClick={() => { // disabled={dependentSourceRanges.length > 0}
send({ type: 'Constrain remove constraints', data: pathToNode })
}}
>
Remove constraints
</button>
<button
className="!border-transparent rounded-sm text-left p-1 text-nowrap"
title={ title={
dependentSourceRanges.length > 0 dependentSourceRanges.length > 0
? `At least ${dependentSourceRanges.length} segment rely on this segment's tag.` ? `At least ${dependentSourceRanges.length} segment rely on this segment's tag.`
@ -547,13 +530,10 @@ const ConstraintSymbol = ({
const implicitDesc = const implicitDesc =
varNameMap[_type as LineInputsType]?.implicitConstraintDesc varNameMap[_type as LineInputsType]?.implicitConstraintDesc
const _node = useMemo( const node = useMemo(
() => getNodeFromPath<Value>(kclManager.ast, pathToNode), () => getNodeFromPath<Value>(kclManager.ast, pathToNode).node,
[kclManager.ast, pathToNode] [kclManager.ast, pathToNode]
) )
if (err(_node)) return
const node = _node.node
const range: SourceRange = node ? [node.start, node.end] : [0, 0] const range: SourceRange = node ? [node.start, node.end] : [0, 0]
if (_type === 'intersectionTag') return null if (_type === 'intersectionTag') return null
@ -591,17 +571,12 @@ const ConstraintSymbol = ({
}) })
} else if (isConstrained) { } else if (isConstrained) {
try { try {
const parsed = parse(recast(kclManager.ast)) const shallowPath = getNodeFromPath<CallExpression>(
if (trap(parsed)) return Promise.reject(parsed) parse(recast(kclManager.ast)),
const _node1 = getNodeFromPath<CallExpression>(
parsed,
pathToNode, pathToNode,
'CallExpression', 'CallExpression',
true true
) ).shallowPath
if (trap(_node1)) return Promise.reject(_node1)
const shallowPath = _node1.shallowPath
const input = makeRemoveSingleConstraintInput( const input = makeRemoveSingleConstraintInput(
argPosition, argPosition,
shallowPath shallowPath
@ -720,15 +695,6 @@ export const CamDebugSettings = () => {
} }
}} }}
/> />
<div>
<button
onClick={() => {
sceneInfra.camControls.resetCameraPosition()
}}
>
Reset Camera Position
</button>
</div>
{camSettings.type === 'perspective' && ( {camSettings.type === 'perspective' && (
<input <input
type="range" type="range"
@ -846,71 +812,6 @@ export const CamDebugSettings = () => {
</li> </li>
</ul> </ul>
</div> </div>
<div>
target
<ul className="flex">
<li>
<span className="pl-2 pr-1">x:</span>
<input
type="number"
step={5}
data-testid="cam-x-target"
value={camSettings.target[0]}
className="text-black w-16"
onChange={(e) => {
sceneInfra.camControls.setCam({
...camSettings,
target: [
parseFloat(e.target.value),
camSettings.target[1],
camSettings.target[2],
],
})
}}
/>
</li>
<li>
<span className="pl-2 pr-1">y:</span>
<input
type="number"
step={5}
data-testid="cam-y-target"
value={camSettings.target[1]}
className="text-black w-16"
onChange={(e) => {
sceneInfra.camControls.setCam({
...camSettings,
target: [
camSettings.target[0],
parseFloat(e.target.value),
camSettings.target[2],
],
})
}}
/>
</li>
<li>
<span className="pl-2 pr-1">z:</span>
<input
type="number"
step={5}
data-testid="cam-z-target"
value={camSettings.target[2]}
className="text-black w-16"
onChange={(e) => {
sceneInfra.camControls.setCam({
...camSettings,
target: [
camSettings.target[0],
camSettings.target[1],
parseFloat(e.target.value),
],
})
}}
/>
</li>
</ul>
</div>
</div> </div>
) )
} }

View File

@ -32,7 +32,9 @@ import {
SKETCH_GROUP_SEGMENTS, SKETCH_GROUP_SEGMENTS,
SKETCH_LAYER, SKETCH_LAYER,
X_AXIS, X_AXIS,
XZ_PLANE,
Y_AXIS, Y_AXIS,
YZ_PLANE,
} from './sceneInfra' } from './sceneInfra'
import { isQuaternionVertical, quaternionFromUpNForward } from './helpers' import { isQuaternionVertical, quaternionFromUpNForward } from './helpers'
import { import {
@ -73,7 +75,7 @@ import {
changeSketchArguments, changeSketchArguments,
updateStartProfileAtArgs, updateStartProfileAtArgs,
} from 'lang/std/sketch' } from 'lang/std/sketch'
import { isOverlap, normaliseAngle, roundOff, throttle } from 'lib/utils' import { normaliseAngle, roundOff, throttle } from 'lib/utils'
import { import {
createArrayExpression, createArrayExpression,
createCallExpressionStdLib, createCallExpressionStdLib,
@ -83,7 +85,6 @@ import {
findUniqueName, findUniqueName,
} from 'lang/modifyAst' } from 'lang/modifyAst'
import { import {
Selections,
getEventForSegmentSelection, getEventForSegmentSelection,
sendSelectEventToEngine, sendSelectEventToEngine,
} from 'lib/selections' } from 'lib/selections'
@ -92,16 +93,12 @@ import { createGridHelper, orthoScale, perspScale } from './helpers'
import { Models } from '@kittycad/lib' import { Models } from '@kittycad/lib'
import { uuidv4 } from 'lib/utils' import { uuidv4 } from 'lib/utils'
import { SegmentOverlayPayload, SketchDetails } from 'machines/modelingMachine' import { SegmentOverlayPayload, SketchDetails } from 'machines/modelingMachine'
import { import { EngineCommandManager } from 'lang/std/engineConnection'
ArtifactMapCommand,
EngineCommandManager,
} from 'lang/std/engineConnection'
import { import {
getRectangleCallExpressions, getRectangleCallExpressions,
updateRectangleSketch, updateRectangleSketch,
} from 'lib/rectangleTool' } from 'lib/rectangleTool'
import { getThemeColorForThreeJs } from 'lib/theme' import { getThemeColorForThreeJs } from 'lib/theme'
import { err, trap } from 'lib/trap'
type DraftSegment = 'line' | 'tangentialArcTo' type DraftSegment = 'line' | 'tangentialArcTo'
@ -302,7 +299,6 @@ export class SceneEntities {
position, position,
maybeModdedAst, maybeModdedAst,
draftExpressionsIndices, draftExpressionsIndices,
selectionRanges,
}: { }: {
sketchPathToNode: PathToNode sketchPathToNode: PathToNode
maybeModdedAst: Program maybeModdedAst: Program
@ -310,7 +306,6 @@ export class SceneEntities {
forward: [number, number, number] forward: [number, number, number]
up: [number, number, number] up: [number, number, number]
position?: [number, number, number] position?: [number, number, number]
selectionRanges?: Selections
}): Promise<{ }): Promise<{
truncatedAst: Program truncatedAst: Program
programMemoryOverride: ProgramMemory programMemoryOverride: ProgramMemory
@ -319,14 +314,8 @@ export class SceneEntities {
}> { }> {
this.createIntersectionPlane() this.createIntersectionPlane()
const prepared = this.prepareTruncatedMemoryAndAst(
sketchPathToNode || [],
maybeModdedAst
)
if (err(prepared)) return Promise.reject(prepared)
const { truncatedAst, programMemoryOverride, variableDeclarationName } = const { truncatedAst, programMemoryOverride, variableDeclarationName } =
prepared this.prepareTruncatedMemoryAndAst(sketchPathToNode || [], maybeModdedAst)
const { programMemory } = await executeAst({ const { programMemory } = await executeAst({
ast: truncatedAst, ast: truncatedAst,
useFakeExecutor: true, useFakeExecutor: true,
@ -338,8 +327,6 @@ export class SceneEntities {
ast: maybeModdedAst, ast: maybeModdedAst,
programMemory, programMemory,
}) })
if (err(sketchGroup)) return Promise.reject(sketchGroup)
if (!Array.isArray(sketchGroup?.value)) if (!Array.isArray(sketchGroup?.value))
return { return {
truncatedAst, truncatedAst,
@ -355,8 +342,11 @@ export class SceneEntities {
pathToNode: sketchPathToNode, pathToNode: sketchPathToNode,
} }
const dummy = new Mesh() const dummy = new Mesh()
// TODO: When we actually have sketch positions and rotations we can use them here. dummy.position.set(
dummy.position.set(0, 0, 0) sketchGroup.position[0],
sketchGroup.position[1],
sketchGroup.position[2]
)
const orthoFactor = orthoScale(sceneInfra.camControls.camera) const orthoFactor = orthoScale(sceneInfra.camControls.camera)
const factor = const factor =
(sceneInfra.camControls.camera instanceof OrthographicCamera (sceneInfra.camControls.camera instanceof OrthographicCamera
@ -408,21 +398,12 @@ export class SceneEntities {
draftExpressionsIndices && draftExpressionsIndices &&
index <= draftExpressionsIndices.end && index <= draftExpressionsIndices.end &&
index >= draftExpressionsIndices.start index >= draftExpressionsIndices.start
const isSelected = selectionRanges?.codeBasedSelections.some(
(selection) => {
return isOverlap(selection.range, segment.__geoMeta.sourceRange)
}
)
let seg let seg
const _node1 = getNodeFromPath<CallExpression>( const callExpName = getNodeFromPath<CallExpression>(
maybeModdedAst, maybeModdedAst,
segPathToNode, segPathToNode,
'CallExpression' 'CallExpression'
) )?.node?.callee?.name
if (err(_node1)) return
const callExpName = _node1.node?.callee?.name
if (segment.type === 'TangentialArcTo') { if (segment.type === 'TangentialArcTo') {
seg = tangentialArcToSegment({ seg = tangentialArcToSegment({
prevSegment: sketchGroup.value[index - 1], prevSegment: sketchGroup.value[index - 1],
@ -434,7 +415,6 @@ export class SceneEntities {
scale: factor, scale: factor,
texture: sceneInfra.extraSegmentTexture, texture: sceneInfra.extraSegmentTexture,
theme: sceneInfra._theme, theme: sceneInfra._theme,
isSelected,
}) })
callbacks.push( callbacks.push(
this.updateTangentialArcToSegment({ this.updateTangentialArcToSegment({
@ -456,7 +436,6 @@ export class SceneEntities {
callExpName, callExpName,
texture: sceneInfra.extraSegmentTexture, texture: sceneInfra.extraSegmentTexture,
theme: sceneInfra._theme, theme: sceneInfra._theme,
isSelected,
}) })
callbacks.push( callbacks.push(
this.updateStraightSegment({ this.updateStraightSegment({
@ -501,14 +480,12 @@ export class SceneEntities {
} }
updateAstAndRejigSketch = async ( updateAstAndRejigSketch = async (
sketchPathToNode: PathToNode, sketchPathToNode: PathToNode,
modifiedAst: Program | Error, modifiedAst: Program,
forward: [number, number, number], forward: [number, number, number],
up: [number, number, number], up: [number, number, number],
origin: [number, number, number] origin: [number, number, number]
) => { ) => {
if (err(modifiedAst)) return modifiedAst await kclManager.updateAst(modifiedAst, false)
const nextAst = await kclManager.updateAst(modifiedAst, false)
await this.tearDownSketch({ removeAxis: false }) await this.tearDownSketch({ removeAxis: false })
sceneInfra.resetMouseListeners() sceneInfra.resetMouseListeners()
await this.setupSketch({ await this.setupSketch({
@ -516,7 +493,7 @@ export class SceneEntities {
forward, forward,
up, up,
position: origin, position: origin,
maybeModdedAst: nextAst.newAst, maybeModdedAst: kclManager.ast,
}) })
this.setupSketchIdleCallbacks({ this.setupSketchIdleCallbacks({
forward, forward,
@ -524,7 +501,6 @@ export class SceneEntities {
position: origin, position: origin,
pathToNode: sketchPathToNode, pathToNode: sketchPathToNode,
}) })
return nextAst
} }
setUpDraftSegment = async ( setUpDraftSegment = async (
sketchPathToNode: PathToNode, sketchPathToNode: PathToNode,
@ -534,17 +510,14 @@ export class SceneEntities {
segmentName: 'line' | 'tangentialArcTo' = 'line', segmentName: 'line' | 'tangentialArcTo' = 'line',
shouldTearDown = true shouldTearDown = true
) => { ) => {
const _ast = kclManager.ast const _ast = JSON.parse(JSON.stringify(kclManager.ast))
const _node1 = getNodeFromPath<VariableDeclaration>( const variableDeclarationName =
getNodeFromPath<VariableDeclaration>(
_ast, _ast,
sketchPathToNode || [], sketchPathToNode || [],
'VariableDeclaration' 'VariableDeclaration'
) )?.node?.declarations?.[0]?.id?.name || ''
if (trap(_node1)) return Promise.reject(_node1)
const variableDeclarationName =
_node1.node?.declarations?.[0]?.id?.name || ''
const sg = kclManager.programMemory.root[ const sg = kclManager.programMemory.root[
variableDeclarationName variableDeclarationName
] as SketchGroup ] as SketchGroup
@ -560,9 +533,7 @@ export class SceneEntities {
fnName: segmentName, fnName: segmentName,
pathToNode: sketchPathToNode, pathToNode: sketchPathToNode,
}) })
if (trap(mod)) return Promise.reject(mod)
const modifiedAst = parse(recast(mod.modifiedAst)) const modifiedAst = parse(recast(mod.modifiedAst))
if (trap(modifiedAst)) return Promise.reject(modifiedAst)
const draftExpressionsIndices = { start: index, end: index } const draftExpressionsIndices = { start: index, end: index }
@ -613,16 +584,14 @@ export class SceneEntities {
), ),
], ],
}) })
if (trap(modifiedAst)) return Promise.reject(modifiedAst)
modifiedAst = addCloseToPipe({ modifiedAst = addCloseToPipe({
node: modifiedAst, node: modifiedAst,
programMemory: kclManager.programMemory, programMemory: kclManager.programMemory,
pathToNode: sketchPathToNode, pathToNode: sketchPathToNode,
}) })
if (trap(modifiedAst)) return Promise.reject(modifiedAst)
} else if (intersection2d) { } else if (intersection2d) {
const lastSegment = sketchGroup.value.slice(-1)[0] const lastSegment = sketchGroup.value.slice(-1)[0]
const tmp = addNewSketchLn({ modifiedAst = addNewSketchLn({
node: kclManager.ast, node: kclManager.ast,
programMemory: kclManager.programMemory, programMemory: kclManager.programMemory,
to: [intersection2d.x, intersection2d.y], to: [intersection2d.x, intersection2d.y],
@ -632,10 +601,7 @@ export class SceneEntities {
? 'tangentialArcTo' ? 'tangentialArcTo'
: 'line', : 'line',
pathToNode: sketchPathToNode, pathToNode: sketchPathToNode,
}) }).modifiedAst
if (trap(tmp)) return Promise.reject(tmp)
modifiedAst = tmp.modifiedAst
if (trap(modifiedAst)) return Promise.reject(modifiedAst)
} else { } else {
// return early as we didn't modify the ast // return early as we didn't modify the ast
return return
@ -692,16 +658,14 @@ export class SceneEntities {
sketchOrigin: [number, number, number], sketchOrigin: [number, number, number],
rectangleOrigin: [x: number, y: number] rectangleOrigin: [x: number, y: number]
) => { ) => {
let _ast = kclManager.ast let _ast = JSON.parse(JSON.stringify(kclManager.ast))
const _node1 = getNodeFromPath<VariableDeclaration>( const variableDeclarationName =
getNodeFromPath<VariableDeclaration>(
_ast, _ast,
sketchPathToNode || [], sketchPathToNode || [],
'VariableDeclaration' 'VariableDeclaration'
) )?.node?.declarations?.[0]?.id?.name || ''
if (trap(_node1)) return Promise.reject(_node1)
const variableDeclarationName =
_node1.node?.declarations?.[0]?.id?.name || ''
const tags: [string, string, string] = [ const tags: [string, string, string] = [
findUniqueName(_ast, 'rectangleSegmentA'), findUniqueName(_ast, 'rectangleSegmentA'),
@ -709,13 +673,11 @@ export class SceneEntities {
findUniqueName(_ast, 'rectangleSegmentC'), findUniqueName(_ast, 'rectangleSegmentC'),
] ]
const _node2 = getNodeFromPath<VariableDeclaration>( const startSketchOn = getNodeFromPath<VariableDeclaration>(
_ast, _ast,
sketchPathToNode || [], sketchPathToNode || [],
'VariableDeclaration' 'VariableDeclaration'
) )?.node?.declarations
if (trap(_node2)) return Promise.reject(_node2)
const startSketchOn = _node2.node?.declarations
const startSketchOnInit = startSketchOn?.[0]?.init const startSketchOnInit = startSketchOn?.[0]?.init
startSketchOn[0].init = createPipeExpression([ startSketchOn[0].init = createPipeExpression([
@ -723,9 +685,7 @@ export class SceneEntities {
...getRectangleCallExpressions(rectangleOrigin, tags), ...getRectangleCallExpressions(rectangleOrigin, tags),
]) ])
let result = parse(recast(_ast)) _ast = parse(recast(_ast))
if (trap(result)) return Promise.reject(result)
_ast = result
const { programMemoryOverride, truncatedAst } = await this.setupSketch({ const { programMemoryOverride, truncatedAst } = await this.setupSketch({
sketchPathToNode, sketchPathToNode,
@ -739,16 +699,14 @@ export class SceneEntities {
sceneInfra.setCallbacks({ sceneInfra.setCallbacks({
onMove: async (args) => { onMove: async (args) => {
// Update the width and height of the draft rectangle // Update the width and height of the draft rectangle
const pathToNodeTwo = sketchPathToNode const pathToNodeTwo = JSON.parse(JSON.stringify(sketchPathToNode))
pathToNodeTwo[1][0] = 0 pathToNodeTwo[1][0] = 0
const _node = getNodeFromPath<VariableDeclaration>( const sketchInit = getNodeFromPath<VariableDeclaration>(
truncatedAst, truncatedAst,
pathToNodeTwo || [], pathToNodeTwo || [],
'VariableDeclaration' 'VariableDeclaration'
) )?.node?.declarations?.[0]?.init
if (trap(_node)) return Promise.reject(_node)
const sketchInit = _node.node?.declarations?.[0]?.init
const x = (args.intersectionPoint.twoD.x || 0) - rectangleOrigin[0] const x = (args.intersectionPoint.twoD.x || 0) - rectangleOrigin[0]
const y = (args.intersectionPoint.twoD.y || 0) - rectangleOrigin[1] const y = (args.intersectionPoint.twoD.y || 0) - rectangleOrigin[1]
@ -790,20 +748,24 @@ export class SceneEntities {
const x = roundOff((cornerPoint.x || 0) - rectangleOrigin[0]) const x = roundOff((cornerPoint.x || 0) - rectangleOrigin[0])
const y = roundOff((cornerPoint.y || 0) - rectangleOrigin[1]) const y = roundOff((cornerPoint.y || 0) - rectangleOrigin[1])
const _node = getNodeFromPath<VariableDeclaration>( const sketchInit = getNodeFromPath<VariableDeclaration>(
_ast, _ast,
sketchPathToNode || [], sketchPathToNode || [],
'VariableDeclaration' 'VariableDeclaration'
) )?.node?.declarations?.[0]?.init
if (trap(_node)) return Promise.reject(_node)
const sketchInit = _node.node?.declarations?.[0]?.init
if (sketchInit.type === 'PipeExpression') { if (sketchInit.type === 'PipeExpression') {
updateRectangleSketch(sketchInit, x, y, tags[0]) updateRectangleSketch(sketchInit, x, y, tags[0])
let result = parse(recast(_ast)) _ast = parse(recast(_ast))
if (trap(result)) return Promise.reject(result)
_ast = result console.log('onClick', {
sketchInit: sketchInit,
_ast,
x,
y,
truncatedAst,
})
// Update the primary AST and unequip the rectangle tool // Update the primary AST and unequip the rectangle tool
await kclManager.executeAstMock(_ast) await kclManager.executeAstMock(_ast)
@ -894,7 +856,6 @@ export class SceneEntities {
ast: kclManager.ast, ast: kclManager.ast,
programMemory: kclManager.programMemory, programMemory: kclManager.programMemory,
}) })
if (trap(sketchGroup)) return
const pipeIndex = pathToNode[pathToNodeIndex + 1][0] as number const pipeIndex = pathToNode[pathToNodeIndex + 1][0] as number
if (addingNewSegmentStatus === 'nothing') { if (addingNewSegmentStatus === 'nothing') {
@ -912,8 +873,6 @@ export class SceneEntities {
spliceBetween: true, spliceBetween: true,
}) })
addingNewSegmentStatus = 'pending' addingNewSegmentStatus = 'pending'
if (trap(mod)) return
await kclManager.executeAstMock(mod.modifiedAst) await kclManager.executeAstMock(mod.modifiedAst)
await this.tearDownSketch({ removeAxis: false }) await this.tearDownSketch({ removeAxis: false })
this.setupSketch({ this.setupSketch({
@ -1007,8 +966,10 @@ export class SceneEntities {
PROFILE_START, PROFILE_START,
]) ])
if (!group) return if (!group) return
const pathToNode: PathToNode = group.userData.pathToNode const pathToNode: PathToNode = JSON.parse(
const varDecIndex: number = pathToNode[1][0] as number JSON.stringify(group.userData.pathToNode)
)
const varDecIndex = JSON.parse(JSON.stringify(pathToNode[1][0]))
if (draftInfo) { if (draftInfo) {
pathToNode[1][0] = 0 pathToNode[1][0] = 0
} }
@ -1020,22 +981,17 @@ export class SceneEntities {
const to: [number, number] = [intersection2d.x, intersection2d.y] const to: [number, number] = [intersection2d.x, intersection2d.y]
let modifiedAst = draftInfo ? draftInfo.truncatedAst : { ...kclManager.ast } let modifiedAst = draftInfo ? draftInfo.truncatedAst : { ...kclManager.ast }
const _node = getNodeFromPath<CallExpression>( const node = getNodeFromPath<CallExpression>(
modifiedAst, modifiedAst,
pathToNode, pathToNode,
'CallExpression' 'CallExpression'
) ).node
if (trap(_node)) return
const node = _node.node
if (node.type !== 'CallExpression') return if (node.type !== 'CallExpression') return
let modded: let modded: {
| {
modifiedAst: Program modifiedAst: Program
pathToNode: PathToNode pathToNode: PathToNode
} }
| Error
if (group.name === PROFILE_START) { if (group.name === PROFILE_START) {
modded = updateStartProfileAtArgs({ modded = updateStartProfileAtArgs({
node: modifiedAst, node: modifiedAst,
@ -1053,18 +1009,14 @@ export class SceneEntities {
from from
) )
} }
if (trap(modded)) return
modifiedAst = modded.modifiedAst modifiedAst = modded.modifiedAst
const info = draftInfo
? draftInfo
: this.prepareTruncatedMemoryAndAst(pathToNode || [])
if (trap(info, { suppress: true })) return
const { truncatedAst, programMemoryOverride, variableDeclarationName } = const { truncatedAst, programMemoryOverride, variableDeclarationName } =
info draftInfo
? draftInfo
: this.prepareTruncatedMemoryAndAst(sketchPathToNode || [])
;(async () => { ;(async () => {
const code = recast(modifiedAst) const code = recast(modifiedAst)
if (trap(code)) return
if (!draftInfo) if (!draftInfo)
// don't want to mod the user's code yet as they have't committed to the change yet // don't want to mod the user's code yet as they have't committed to the change yet
// plus this would be the truncated ast being recast, it would be wrong // plus this would be the truncated ast being recast, it would be wrong
@ -1382,6 +1334,13 @@ export class SceneEntities {
to, to,
}) })
} }
async animateAfterSketch() {
// if (isReducedMotion()) {
// sceneInfra.camControls.usePerspectiveCamera()
// return
// }
await sceneInfra.camControls.animateToPerspective()
}
removeSketchGrid() { removeSketchGrid() {
if (this.axisGroup) this.scene.remove(this.axisGroup) if (this.axisGroup) this.scene.remove(this.axisGroup)
} }
@ -1445,114 +1404,36 @@ export class SceneEntities {
selected.material.color = defaultPlaneColor(type) selected.material.color = defaultPlaneColor(type)
}, },
onClick: async (args) => { onClick: async (args) => {
const checkExtrudeFaceClick = async (): Promise<
['face' | 'plane' | 'other', string]
> => {
const { streamDimensions } = useStore.getState() const { streamDimensions } = useStore.getState()
const { entity_id } = await sendSelectEventToEngine( const { entity_id } = await sendSelectEventToEngine(
args?.mouseEvent, args?.mouseEvent,
document.getElementById('video-stream') as HTMLVideoElement, document.getElementById('video-stream') as HTMLVideoElement,
streamDimensions streamDimensions
) )
if (!entity_id) return ['other', '']
let _entity_id = entity_id
if (!_entity_id) return
if ( if (
engineCommandManager.defaultPlanes?.xy === _entity_id || engineCommandManager.defaultPlanes?.xy === entity_id ||
engineCommandManager.defaultPlanes?.xz === _entity_id || engineCommandManager.defaultPlanes?.xz === entity_id ||
engineCommandManager.defaultPlanes?.yz === _entity_id || engineCommandManager.defaultPlanes?.yz === entity_id
engineCommandManager.defaultPlanes?.negXy === _entity_id ||
engineCommandManager.defaultPlanes?.negXz === _entity_id ||
engineCommandManager.defaultPlanes?.negYz === _entity_id
) { ) {
const defaultPlaneStrMap: Record<string, DefaultPlaneStr> = { return ['plane', entity_id]
[engineCommandManager.defaultPlanes.xy]: 'XY',
[engineCommandManager.defaultPlanes.xz]: 'XZ',
[engineCommandManager.defaultPlanes.yz]: 'YZ',
[engineCommandManager.defaultPlanes.negXy]: '-XY',
[engineCommandManager.defaultPlanes.negXz]: '-XZ',
[engineCommandManager.defaultPlanes.negYz]: '-YZ',
} }
// TODO can we get this information from rust land when it creates the default planes? const artifact = this.engineCommandManager.artifactMap[entity_id]
// maybe returned from make_default_planes (src/wasm-lib/src/wasm.rs) if (artifact?.commandType !== 'solid3d_get_extrusion_face_info')
let zAxis: [number, number, number] = [0, 0, 1] return ['other', entity_id]
let yAxis: [number, number, number] = [0, 1, 0]
// get unit vector from camera position to target const faceInfo = await getFaceDetails(entity_id)
const camVector = sceneInfra.camControls.camera.position if (!faceInfo?.origin || !faceInfo?.z_axis || !faceInfo?.y_axis)
.clone() return ['other', entity_id]
.sub(sceneInfra.camControls.target)
if (engineCommandManager.defaultPlanes?.xy === _entity_id) {
zAxis = [0, 0, 1]
yAxis = [0, 1, 0]
if (camVector.z < 0) {
zAxis = [0, 0, -1]
_entity_id = engineCommandManager.defaultPlanes?.negXy || ''
}
} else if (engineCommandManager.defaultPlanes?.yz === _entity_id) {
zAxis = [1, 0, 0]
yAxis = [0, 0, 1]
if (camVector.x < 0) {
zAxis = [-1, 0, 0]
_entity_id = engineCommandManager.defaultPlanes?.negYz || ''
}
} else if (engineCommandManager.defaultPlanes?.xz === _entity_id) {
zAxis = [0, 1, 0]
yAxis = [0, 0, 1]
_entity_id = engineCommandManager.defaultPlanes?.negXz || ''
if (camVector.y < 0) {
zAxis = [0, -1, 0]
_entity_id = engineCommandManager.defaultPlanes?.xz || ''
}
}
sceneInfra.modelingSend({
type: 'Select default plane',
data: {
type: 'defaultPlane',
planeId: _entity_id,
plane: defaultPlaneStrMap[_entity_id],
zAxis,
yAxis,
},
})
return
}
const artifact = this.engineCommandManager.artifactMap[_entity_id]
// If we clicked on an extrude wall, we climb up the parent Id
// to get the sketch profile's face ID. If we clicked on an endcap,
// we already have it.
const targetId =
'additionalData' in artifact &&
artifact.additionalData?.type === 'cap'
? _entity_id
: artifact.parentId
// tsc cannot infer that target can have extrusions
// from the commandType (why?) so we need to cast it
const target = this.engineCommandManager.artifactMap?.[
targetId || ''
] as ArtifactMapCommand & { extrusions?: string[] }
// TODO: We get the first extrusion command ID,
// which is fine while backend systems only support one extrusion.
// but we need to more robustly handle resolving to the correct extrusion
// if there are multiple.
const extrusions =
this.engineCommandManager.artifactMap?.[target?.extrusions?.[0] || '']
if (artifact?.commandType !== 'solid3d_get_extrusion_face_info') return
const faceInfo = await getFaceDetails(_entity_id)
if (!faceInfo?.origin || !faceInfo?.z_axis || !faceInfo?.y_axis) return
const { z_axis, y_axis, origin } = faceInfo const { z_axis, y_axis, origin } = faceInfo
const sketchPathToNode = getNodePathFromSourceRange( const pathToNode = getNodePathFromSourceRange(
kclManager.ast, kclManager.ast,
artifact.range artifact.range
) )
const extrudePathToNode = extrusions?.range
? getNodePathFromSourceRange(kclManager.ast, extrusions.range)
: []
sceneInfra.modelingSend({ sceneInfra.modelingSend({
type: 'Select default plane', type: 'Select default plane',
data: { data: {
@ -1562,16 +1443,48 @@ export class SceneEntities {
position: [origin.x, origin.y, origin.z].map( position: [origin.x, origin.y, origin.z].map(
(num) => num / sceneInfra._baseUnitMultiplier (num) => num / sceneInfra._baseUnitMultiplier
) as [number, number, number], ) as [number, number, number],
sketchPathToNode, extrudeSegmentPathToNode: pathToNode,
extrudePathToNode,
cap: cap:
artifact?.additionalData?.type === 'cap' artifact?.additionalData?.type === 'cap'
? artifact.additionalData.info ? artifact.additionalData.info
: 'none', : 'none',
faceId: _entity_id, faceId: entity_id,
},
})
return ['face', entity_id]
}
const faceResult = await checkExtrudeFaceClick()
console.log('faceResult', faceResult)
if (faceResult[0] === 'face') return
if (!args || !args.intersects?.[0]) return
if (args.mouseEvent.which !== 1) return
const { intersects } = args
const type = intersects?.[0].object.name || ''
const posNorm = Number(intersects?.[0]?.normal?.z) > 0
let planeString: DefaultPlaneStr = posNorm ? 'XY' : '-XY'
let zAxis: [number, number, number] = posNorm ? [0, 0, 1] : [0, 0, -1]
let yAxis: [number, number, number] = [0, 1, 0]
if (type === YZ_PLANE) {
planeString = posNorm ? 'YZ' : '-YZ'
zAxis = posNorm ? [1, 0, 0] : [-1, 0, 0]
yAxis = [0, 0, 1]
} else if (type === XZ_PLANE) {
planeString = posNorm ? '-XZ' : 'XZ'
zAxis = posNorm ? [0, 1, 0] : [0, -1, 0]
yAxis = [0, 0, 1]
}
sceneInfra.modelingSend({
type: 'Select default plane',
data: {
type: 'defaultPlane',
plane: planeString,
zAxis,
yAxis,
planeId: faceResult[1],
}, },
}) })
return
}, },
}) })
} }
@ -1591,14 +1504,11 @@ export class SceneEntities {
]) ])
if (parent?.userData?.pathToNode) { if (parent?.userData?.pathToNode) {
const updatedAst = parse(recast(kclManager.ast)) const updatedAst = parse(recast(kclManager.ast))
if (trap(updatedAst)) return const node = getNodeFromPath<CallExpression>(
const _node = getNodeFromPath<CallExpression>(
updatedAst, updatedAst,
parent.userData.pathToNode, parent.userData.pathToNode,
'CallExpression' 'CallExpression'
) ).node
if (trap(_node, { suppress: true })) return
const node = _node.node
editorManager.setHighlightRange([node.start, node.end]) editorManager.setHighlightRange([node.start, node.end])
const yellow = 0xffff00 const yellow = 0xffff00
colorSegment(selected, yellow) colorSegment(selected, yellow)
@ -1713,23 +1623,20 @@ function prepareTruncatedMemoryAndAst(
ast: Program, ast: Program,
programMemory: ProgramMemory, programMemory: ProgramMemory,
draftSegment?: DraftSegment draftSegment?: DraftSegment
): ): {
| {
truncatedAst: Program truncatedAst: Program
programMemoryOverride: ProgramMemory programMemoryOverride: ProgramMemory
variableDeclarationName: string variableDeclarationName: string
} } {
| Error {
const bodyIndex = Number(sketchPathToNode?.[1]?.[0]) || 0 const bodyIndex = Number(sketchPathToNode?.[1]?.[0]) || 0
const _ast = ast const _ast = JSON.parse(JSON.stringify(ast))
const _node = getNodeFromPath<VariableDeclaration>( const variableDeclarationName =
getNodeFromPath<VariableDeclaration>(
_ast, _ast,
sketchPathToNode || [], sketchPathToNode || [],
'VariableDeclaration' 'VariableDeclaration'
) )?.node?.declarations?.[0]?.id?.name || ''
if (err(_node)) return _node
const variableDeclarationName = _node.node?.declarations?.[0]?.id?.name || ''
const lastSeg = ( const lastSeg = (
programMemory.root[variableDeclarationName] as SketchGroup programMemory.root[variableDeclarationName] as SketchGroup
).value.slice(-1)[0] ).value.slice(-1)[0]
@ -1757,8 +1664,6 @@ function prepareTruncatedMemoryAndAst(
// update source ranges to section we just added. // update source ranges to section we just added.
// hacks like this wouldn't be needed if the AST put pathToNode info in memory/sketchGroup segments // hacks like this wouldn't be needed if the AST put pathToNode info in memory/sketchGroup segments
const updatedSrcRangeAst = parse(recast(_ast)) // get source ranges correct since unfortunately we still rely on them const updatedSrcRangeAst = parse(recast(_ast)) // get source ranges correct since unfortunately we still rely on them
if (err(updatedSrcRangeAst)) return updatedSrcRangeAst
const lastPipeItem = ( const lastPipeItem = (
(updatedSrcRangeAst.body[bodyIndex] as VariableDeclaration) (updatedSrcRangeAst.body[bodyIndex] as VariableDeclaration)
.declarations[0].init as PipeExpression .declarations[0].init as PipeExpression
@ -1780,36 +1685,9 @@ function prepareTruncatedMemoryAndAst(
} }
const truncatedAst: Program = { const truncatedAst: Program = {
..._ast, ..._ast,
body: [_ast.body[bodyIndex]], body: [JSON.parse(JSON.stringify(_ast.body[bodyIndex]))],
} }
const programMemoryOverride = programMemoryInit() const programMemoryOverride: ProgramMemory = programMemoryInit()
if (err(programMemoryOverride)) return programMemoryOverride
// Grab all the TagDeclarators and TagIdentifiers from memory.
let start = _node.node.start
for (const key in programMemory.root) {
const value = programMemory.root[key]
if (!('__meta' in value)) {
continue
}
if (
value.__meta === undefined ||
value.__meta.length === 0 ||
value.__meta[0].sourceRange === undefined
) {
continue
}
if (value.__meta[0].sourceRange[0] >= start) {
// We only want things before our start point.
continue
}
if (value.type === 'TagIdentifier') {
programMemoryOverride.root[key] = value
}
}
for (let i = 0; i < bodyIndex; i++) { for (let i = 0; i < bodyIndex; i++) {
const node = _ast.body[i] const node = _ast.body[i]
if (node.type !== 'VariableDeclaration') { if (node.type !== 'VariableDeclaration') {
@ -1821,7 +1699,7 @@ function prepareTruncatedMemoryAndAst(
if (!memoryItem) { if (!memoryItem) {
continue continue
} }
programMemoryOverride.root[name] = memoryItem programMemoryOverride.root[name] = JSON.parse(JSON.stringify(memoryItem))
} }
return { return {
truncatedAst, truncatedAst,
@ -1850,19 +1728,13 @@ export function sketchGroupFromPathToNode({
pathToNode: PathToNode pathToNode: PathToNode
ast: Program ast: Program
programMemory: ProgramMemory programMemory: ProgramMemory
}): SketchGroup | Error { }): SketchGroup {
const _varDec = getNodeFromPath<VariableDeclarator>( const varDec = getNodeFromPath<VariableDeclarator>(
kclManager.ast, kclManager.ast,
pathToNode, pathToNode,
'VariableDeclarator' 'VariableDeclarator'
) ).node
if (err(_varDec)) return _varDec return programMemory.root[varDec?.id?.name || ''] as SketchGroup
const varDec = _varDec.node
const result = programMemory.root[varDec?.id?.name || '']
if (result?.type === 'ExtrudeGroup') {
return result.sketchGroup
}
return result as SketchGroup
} }
function colorSegment(object: any, color: number) { function colorSegment(object: any, color: number) {
@ -1892,15 +1764,13 @@ function colorSegment(object: any, color: number) {
export function getSketchQuaternion( export function getSketchQuaternion(
sketchPathToNode: PathToNode, sketchPathToNode: PathToNode,
sketchNormalBackUp: [number, number, number] | null sketchNormalBackUp: [number, number, number] | null
): Quaternion | Error { ): Quaternion {
const sketchGroup = sketchGroupFromPathToNode({ const sketchGroup = sketchGroupFromPathToNode({
pathToNode: sketchPathToNode, pathToNode: sketchPathToNode,
ast: kclManager.ast, ast: kclManager.ast,
programMemory: kclManager.programMemory, programMemory: kclManager.programMemory,
}) })
if (err(sketchGroup)) return sketchGroup const zAxis = sketchGroup?.zAxis || sketchNormalBackUp
const zAxis = sketchGroup?.on.zAxis || sketchNormalBackUp
return getQuaternionFromZAxis(massageFormats(zAxis)) return getQuaternionFromZAxis(massageFormats(zAxis))
} }
export async function getSketchOrientationDetails( export async function getSketchOrientationDetails(
@ -1914,31 +1784,24 @@ export async function getSketchOrientationDetails(
ast: kclManager.ast, ast: kclManager.ast,
programMemory: kclManager.programMemory, programMemory: kclManager.programMemory,
}) })
if (err(sketchGroup)) return Promise.reject(sketchGroup)
if (sketchGroup.on.type === 'plane') { if (sketchGroup.on.type === 'plane') {
const zAxis = sketchGroup?.on.zAxis const zAxis = sketchGroup?.zAxis
return { return {
quat: getQuaternionFromZAxis(massageFormats(zAxis)), quat: getQuaternionFromZAxis(massageFormats(zAxis)),
sketchDetails: { sketchDetails: {
sketchPathToNode, sketchPathToNode,
zAxis: [zAxis.x, zAxis.y, zAxis.z], zAxis: [zAxis.x, zAxis.y, zAxis.z],
yAxis: [ yAxis: [sketchGroup.yAxis.x, sketchGroup.yAxis.y, sketchGroup.yAxis.z],
sketchGroup.on.yAxis.x,
sketchGroup.on.yAxis.y,
sketchGroup.on.yAxis.z,
],
origin: [0, 0, 0], origin: [0, 0, 0],
faceId: sketchGroup.on.id, faceId: sketchGroup.on.id,
}, },
} }
} }
if (sketchGroup.on.type === 'face') { if (sketchGroup.on.type === 'face') {
const faceInfo = await getFaceDetails(sketchGroup.on.id) const faceInfo = await getFaceDetails(sketchGroup.on.faceId)
if (!faceInfo?.origin || !faceInfo?.z_axis || !faceInfo?.y_axis) if (!faceInfo?.origin || !faceInfo?.z_axis || !faceInfo?.y_axis)
return Promise.reject('face info') throw new Error('faceInfo')
const { z_axis, y_axis, origin } = faceInfo const { z_axis, y_axis, origin } = faceInfo
const quaternion = quaternionFromUpNForward( const quaternion = quaternionFromUpNForward(
new Vector3(y_axis.x, y_axis.y, y_axis.z), new Vector3(y_axis.x, y_axis.y, y_axis.z),
@ -1951,11 +1814,11 @@ export async function getSketchOrientationDetails(
zAxis: [z_axis.x, z_axis.y, z_axis.z], zAxis: [z_axis.x, z_axis.y, z_axis.z],
yAxis: [y_axis.x, y_axis.y, y_axis.z], yAxis: [y_axis.x, y_axis.y, y_axis.z],
origin: [origin.x, origin.y, origin.z], origin: [origin.x, origin.y, origin.z],
faceId: sketchGroup.on.id, faceId: sketchGroup.on.faceId,
}, },
} }
} }
return Promise.reject( throw new Error(
'sketchGroup.on.type not recognized, has a new type been added?' 'sketchGroup.on.type not recognized, has a new type been added?'
) )
} }
@ -1969,9 +1832,9 @@ export async function getSketchOrientationDetails(
* @param entityId - The ID of the entity for which orientation details are being fetched. * @param entityId - The ID of the entity for which orientation details are being fetched.
* @returns A promise that resolves with the orientation details of the face. * @returns A promise that resolves with the orientation details of the face.
*/ */
export async function getFaceDetails( async function getFaceDetails(
entityId: string entityId: string
): Promise<Models['GetSketchModePlane_type']> { ): Promise<Models['FaceIsPlanar_type']> {
// TODO mode engine connection to allow batching returns and batch the following // TODO mode engine connection to allow batching returns and batch the following
await engineCommandManager.sendSceneCommand({ await engineCommandManager.sendSceneCommand({
type: 'modeling_cmd_req', type: 'modeling_cmd_req',
@ -1984,7 +1847,8 @@ export async function getFaceDetails(
entity_id: entityId, entity_id: entityId,
}, },
}) })
const faceInfo: Models['GetSketchModePlane_type'] = ( // TODO change typing to get_sketch_mode_plane once lib is updated
const faceInfo: Models['FaceIsPlanar_type'] = (
await engineCommandManager.sendSceneCommand({ await engineCommandManager.sendSceneCommand({
type: 'modeling_cmd_req', type: 'modeling_cmd_req',
cmd_id: uuidv4(), cmd_id: uuidv4(),

View File

@ -45,21 +45,18 @@ export function profileStart({
pathToNode, pathToNode,
scale = 1, scale = 1,
theme, theme,
isSelected,
}: { }: {
from: Coords2d from: Coords2d
id: string id: string
pathToNode: PathToNode pathToNode: PathToNode
scale?: number scale?: number
theme: Themes theme: Themes
isSelected?: boolean
}) { }) {
const group = new Group() const group = new Group()
const geometry = new BoxGeometry(12, 12, 12) // in pixels scaled later const geometry = new BoxGeometry(12, 12, 12) // in pixels scaled later
const baseColor = getThemeColorForThreeJs(theme) const baseColor = getThemeColorForThreeJs(theme)
const color = isSelected ? 0x0000ff : baseColor const body = new MeshBasicMaterial({ color: baseColor })
const body = new MeshBasicMaterial({ color })
const mesh = new Mesh(geometry, body) const mesh = new Mesh(geometry, body)
group.add(mesh) group.add(mesh)
@ -69,8 +66,7 @@ export function profileStart({
id, id,
from, from,
pathToNode, pathToNode,
isSelected, isSelected: false,
baseColor,
} }
group.name = PROFILE_START group.name = PROFILE_START
group.position.set(from[0], from[1], 0) group.position.set(from[0], from[1], 0)
@ -88,7 +84,6 @@ export function straightSegment({
callExpName, callExpName,
texture, texture,
theme, theme,
isSelected = false,
}: { }: {
from: Coords2d from: Coords2d
to: Coords2d to: Coords2d
@ -99,7 +94,6 @@ export function straightSegment({
callExpName: string callExpName: string
texture: Texture texture: Texture
theme: Themes theme: Themes
isSelected?: boolean
}): Group { }): Group {
const group = new Group() const group = new Group()
@ -125,8 +119,7 @@ export function straightSegment({
const baseColor = const baseColor =
callExpName === 'close' ? 0x444444 : getThemeColorForThreeJs(theme) callExpName === 'close' ? 0x444444 : getThemeColorForThreeJs(theme)
const color = isSelected ? 0x0000ff : baseColor const body = new MeshBasicMaterial({ color: baseColor })
const body = new MeshBasicMaterial({ color })
const mesh = new Mesh(geometry, body) const mesh = new Mesh(geometry, body)
mesh.userData.type = isDraftSegment mesh.userData.type = isDraftSegment
? STRAIGHT_SEGMENT_DASH ? STRAIGHT_SEGMENT_DASH
@ -139,7 +132,7 @@ export function straightSegment({
from, from,
to, to,
pathToNode, pathToNode,
isSelected, isSelected: false,
callExpName, callExpName,
baseColor, baseColor,
} }
@ -148,7 +141,7 @@ export function straightSegment({
const length = Math.sqrt( const length = Math.sqrt(
Math.pow(to[0] - from[0], 2) + Math.pow(to[1] - from[1], 2) Math.pow(to[0] - from[0], 2) + Math.pow(to[1] - from[1], 2)
) )
const arrowGroup = createArrowhead(scale, theme, color) const arrowGroup = createArrowhead(scale, theme)
arrowGroup.position.set(to[0], to[1], 0) arrowGroup.position.set(to[0], to[1], 0)
const dir = new Vector3() const dir = new Vector3()
.subVectors(new Vector3(to[0], to[1], 0), new Vector3(from[0], from[1], 0)) .subVectors(new Vector3(to[0], to[1], 0), new Vector3(from[0], from[1], 0))
@ -176,10 +169,9 @@ export function straightSegment({
return group return group
} }
function createArrowhead(scale = 1, theme: Themes, color?: number): Group { function createArrowhead(scale = 1, theme: Themes): Group {
const baseColor = getThemeColorForThreeJs(theme)
const arrowMaterial = new MeshBasicMaterial({ const arrowMaterial = new MeshBasicMaterial({
color: color || baseColor, color: getThemeColorForThreeJs(theme),
}) })
// specify the size of the geometry in pixels (i.e. cone height = 20px, cone radius = 4.5px) // specify the size of the geometry in pixels (i.e. cone height = 20px, cone radius = 4.5px)
// we'll scale the group to the correct size later to match these sizes in screen space // we'll scale the group to the correct size later to match these sizes in screen space
@ -240,7 +232,6 @@ export function tangentialArcToSegment({
scale = 1, scale = 1,
texture, texture,
theme, theme,
isSelected,
}: { }: {
prevSegment: SketchGroup['value'][number] prevSegment: SketchGroup['value'][number]
from: Coords2d from: Coords2d
@ -251,7 +242,6 @@ export function tangentialArcToSegment({
scale?: number scale?: number
texture: Texture texture: Texture
theme: Themes theme: Themes
isSelected?: boolean
}): Group { }): Group {
const group = new Group() const group = new Group()
@ -283,8 +273,7 @@ export function tangentialArcToSegment({
}) })
const baseColor = getThemeColorForThreeJs(theme) const baseColor = getThemeColorForThreeJs(theme)
const color = isSelected ? 0x0000ff : baseColor const body = new MeshBasicMaterial({ color: baseColor })
const body = new MeshBasicMaterial({ color })
const mesh = new Mesh(geometry, body) const mesh = new Mesh(geometry, body)
mesh.userData.type = isDraftSegment mesh.userData.type = isDraftSegment
? TANGENTIAL_ARC_TO__SEGMENT_DASH ? TANGENTIAL_ARC_TO__SEGMENT_DASH
@ -297,12 +286,12 @@ export function tangentialArcToSegment({
to, to,
prevSegment, prevSegment,
pathToNode, pathToNode,
isSelected, isSelected: false,
baseColor, baseColor,
} }
group.name = TANGENTIAL_ARC_TO_SEGMENT group.name = TANGENTIAL_ARC_TO_SEGMENT
const arrowGroup = createArrowhead(scale, theme, color) const arrowGroup = createArrowhead(scale, theme)
arrowGroup.position.set(to[0], to[1], 0) arrowGroup.position.set(to[0], to[1], 0)
const arrowheadAngle = endAngle + (Math.PI / 2) * (ccw ? 1 : -1) const arrowheadAngle = endAngle + (Math.PI / 2) * (ccw ? 1 : -1)
arrowGroup.quaternion.setFromUnitVectors( arrowGroup.quaternion.setFromUnitVectors(

View File

@ -2,7 +2,6 @@ import { useModelingContext } from 'hooks/useModelingContext'
import { editorManager, kclManager } from 'lib/singletons' import { editorManager, kclManager } from 'lib/singletons'
import { getNodeFromPath, getNodePathFromSourceRange } from 'lang/queryAst' import { getNodeFromPath, getNodePathFromSourceRange } from 'lang/queryAst'
import { useEffect, useRef, useState } from 'react' import { useEffect, useRef, useState } from 'react'
import { trap } from 'lib/trap'
export function AstExplorer() { export function AstExplorer() {
const { context } = useModelingContext() const { context } = useModelingContext()
@ -11,12 +10,9 @@ export function AstExplorer() {
kclManager.ast, kclManager.ast,
context.selectionRanges.codeBasedSelections?.[0]?.range context.selectionRanges.codeBasedSelections?.[0]?.range
) )
const node = getNodeFromPath(kclManager.ast, pathToNode).node
const [filterKeys, setFilterKeys] = useState<string[]>(['start', 'end']) const [filterKeys, setFilterKeys] = useState<string[]>(['start', 'end'])
const _node = getNodeFromPath(kclManager.ast, pathToNode)
if (trap(_node)) return
const node = _node
return ( return (
<div id="ast-explorer" className="relative"> <div id="ast-explorer" className="relative">
<div className=""> <div className="">

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