Compare commits

...

36 Commits

Author SHA1 Message Date
2363010cbc updates
Signed-off-by: Jess Frazelle <github@jessfraz.com>
2024-06-26 11:38:59 -07:00
bd17bc98d5 cleanup
Signed-off-by: Jess Frazelle <github@jessfraz.com>
2024-06-26 10:47:07 -07:00
e7a2824cb2 u[dates
Signed-off-by: Jess Frazelle <github@jessfraz.com>
2024-06-26 10:40:07 -07:00
f77ed3d790 more
Signed-off-by: Jess Frazelle <github@jessfraz.com>
2024-06-26 05:33:28 -07:00
bc5fdbad43 updates
Signed-off-by: Jess Frazelle <github@jessfraz.com>
2024-06-26 05:03:35 -07:00
053bdffc45 more expressive semantic tokens (#2814)
* updates

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

* more semantic tokens

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

* cleanup

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

* updates

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

---------

Signed-off-by: Jess Frazelle <github@jessfraz.com>
2024-06-26 05:02:36 -07:00
9ffc08b84a add more tests for various scenarios (#2812)
* add more tests

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

* cleanups

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

* clippy

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

* even more tests

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

---------

Signed-off-by: Jess Frazelle <github@jessfraz.com>
2024-06-26 01:07:18 -07:00
47e8d3f4fc Bump serde_json from 1.0.117 to 1.0.118 in /src/wasm-lib (#2811)
Bumps [serde_json](https://github.com/serde-rs/json) from 1.0.117 to 1.0.118.
- [Release notes](https://github.com/serde-rs/json/releases)
- [Commits](https://github.com/serde-rs/json/compare/v1.0.117...v1.0.118)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-25 22:21:55 -07:00
53db421d97 Fix diagnostic fighting between wasm and typescript (closes #2755) (#2799)
* start to gut and seperate the kcl lint from execute

* fix type signature

* re-add old codepath when not wasm

* also lint in the mock

* fix syntax

* fix message
2024-06-25 21:04:52 -07:00
289ed291c4 Allow lifetime refs in KCL stdlib parameters (#2802)
Previously these functions could not be used with `#[stdlib]` proc-macro:

```rust
fn someFn(data: &'a str) {}
fn someFn<'a>(data: Foo<'a>) {}
```

But now they can.
2024-06-25 16:10:17 -05:00
39ceb83840 Test empty commit 2024-06-25 16:05:55 -05:00
af449ff6ca Update tauri Cargo.lock 2024-06-25 15:55:26 -05:00
e1bf55cc4a No more flakes and make us green again (#2771)
* No more flakes and see green

* remove extra id

* try again

* again

* again

* Fix Avatar test and make snap test more robust

* Remove extra attribute
2024-06-25 13:56:11 -04:00
8fe2d33063 tags are globals (#2795)
* tags are globals

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

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

* empty

* updates

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

---------

Signed-off-by: Jess Frazelle <github@jessfraz.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-06-25 17:35:48 +00:00
d7e36eed24 Hide grid (#2777)
* Hide grid

* Add small comment about origin of ids
2024-06-25 08:51:23 -07:00
6123ed6a82 Workaround to fix tauri tests (#2772)
* WIP Fix tauri tests

* WIP

* Change env var to app.exe or app
2024-06-25 06:42:06 -04:00
da6cd5cf9f tag as top level part 2 (#2773)
* updates

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

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

* updates

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

* fmt

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

* updates

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

* unit tests pass

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

* playwright

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

* updates

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

* format

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

* format

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

* updates

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

* more literals gone

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

* updates

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

* fixes

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

* remove console log

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

* fixes

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

* remove only

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

* fix some recast shit

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

* updates

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

* last

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

---------

Signed-off-by: Jess Frazelle <github@jessfraz.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-06-24 22:39:04 -07:00
ad5bfa1a29 clippy (#2793)
Signed-off-by: Jess Frazelle <github@jessfraz.com>
2024-06-24 21:51:29 -07:00
6358bdd7cd Bump uuid from 1.8.0 to 1.9.1 in /src/wasm-lib (#2787)
Bumps [uuid](https://github.com/uuid-rs/uuid) from 1.8.0 to 1.9.1.
- [Release notes](https://github.com/uuid-rs/uuid/releases)
- [Commits](https://github.com/uuid-rs/uuid/compare/1.8.0...1.9.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Jess Frazelle <jessfraz@users.noreply.github.com>
2024-06-24 21:38:27 -07:00
d6fe414b2e Bump pyo3 from 0.21.2 to 0.22.0 in /src/wasm-lib (#2788)
Bumps [pyo3](https://github.com/pyo3/pyo3) from 0.21.2 to 0.22.0.
- [Release notes](https://github.com/pyo3/pyo3/releases)
- [Changelog](https://github.com/PyO3/pyo3/blob/main/CHANGELOG.md)
- [Commits](https://github.com/pyo3/pyo3/compare/v0.21.2...v0.22.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Jess Frazelle <jessfraz@users.noreply.github.com>
2024-06-24 21:37:59 -07:00
25e7e8cb89 Bump dashmap from 5.5.3 to 6.0.1 in /src/wasm-lib (#2786)
Bumps [dashmap](https://github.com/xacrimon/dashmap) from 5.5.3 to 6.0.1.
- [Release notes](https://github.com/xacrimon/dashmap/releases)
- [Commits](https://github.com/xacrimon/dashmap/compare/v.5.5.3...v6.0.1)

---
updated-dependencies:
- dependency-name: dashmap
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Jess Frazelle <jessfraz@users.noreply.github.com>
2024-06-24 21:37:34 -07:00
a175870453 remove only from test (#2785)
remove only from tests
2024-06-25 14:16:44 +10:00
24516cdb2d Improve traverse (#2782)
improve travers
2024-06-25 12:46:40 +10:00
496398de52 fix some recast bugs (#2781)
fix some recast shit

Signed-off-by: Jess Frazelle <github@jessfraz.com>
2024-06-24 18:11:14 -07:00
3304a74064 Tag as top level construct (#2769)
* updates

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

* updates

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

* udpages

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

* fixes

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

* updates

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

* updates

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

* updates

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

* updates

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

* updates

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

* update

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

* better functions

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

* updates

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

* backwards compat everywhere

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

* updates

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

* update docs

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

* updates

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

* updates

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

* udpates

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

* fixes

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

* fixes

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

* add lsp symbols stuff;

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

* tests for dupes

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

* Revert "tests for dupes"

This reverts commit 6acaf5a9fa.

* updates

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

* initial test updates

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

* tests

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

* fixes

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

* test

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

* fixes

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

* fix tests

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

---------

Signed-off-by: Jess Frazelle <github@jessfraz.com>
2024-06-24 14:45:07 -07:00
f4877cb160 Stop throwing in frontend code (#2654)
Return error instead of throw
2024-06-24 11:45:40 -04:00
f7196e7eb0 Add sketch tool events to command bar (#2708)
* Add command configs for sketch tools

* Update Constrain dropdown to be noun

* Update Cargo.lock

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

* Update E2E test references to "Constraints" button

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-06-24 11:37:48 -04:00
5260bd6820 allow for sketching on the face of a chamfer in kcl (#2760)
* updates

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

* cleanup

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

* lots of cleanup

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

* lots more cleanup

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

* updates

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

* more cleaniup

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

* fix typos

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

* add to known issues

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

* fixes

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

* updates

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

---------

Signed-off-by: Jess Frazelle <github@jessfraz.com>
2024-06-24 06:04:32 +00:00
394653247a Bump syn from 2.0.67 to 2.0.68 in /src/wasm-lib (#2761)
Bumps [syn](https://github.com/dtolnay/syn) from 2.0.67 to 2.0.68.
- [Release notes](https://github.com/dtolnay/syn/releases)
- [Commits](https://github.com/dtolnay/syn/compare/2.0.67...2.0.68)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-23 22:03:02 -07:00
fbd22a2d17 Bump lazy_static from 1.4.0 to 1.5.0 in /src/wasm-lib (#2763)
Bumps [lazy_static](https://github.com/rust-lang-nursery/lazy-static.rs) from 1.4.0 to 1.5.0.
- [Release notes](https://github.com/rust-lang-nursery/lazy-static.rs/releases)
- [Commits](https://github.com/rust-lang-nursery/lazy-static.rs/compare/1.4.0...1.5.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-23 22:02:53 -07:00
7c568f68e5 Bump kittycad from 0.3.5 to 0.3.6 in /src/wasm-lib (#2762)
Bumps [kittycad](https://github.com/KittyCAD/kittycad.rs) from 0.3.5 to 0.3.6.
- [Release notes](https://github.com/KittyCAD/kittycad.rs/releases)
- [Commits](https://github.com/KittyCAD/kittycad.rs/compare/v0.3.5...v0.3.6)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-23 22:02:26 -07:00
31b0766754 execute chamfers and fillets early if in a pattern (#2759)
* updates

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

* updates

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

* updates

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

* bump kcl version

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

* fix others

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

---------

Signed-off-by: Jess Frazelle <github@jessfraz.com>
2024-06-24 02:19:24 +00:00
cd33b40c37 Cut release v0.22.6 (#2758) 2024-06-22 18:08:46 -07:00
3300772e3d fix source range for last command when engine error (#2757)
* fix source range for last command

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

* add known issues

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

* updates

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

* add a comment

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

* updates

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

---------

Signed-off-by: Jess Frazelle <github@jessfraz.com>
2024-06-22 16:22:32 -07:00
fa37752a41 playwright test for hover lsp functions (#2756)
Signed-off-by: Jess Frazelle <github@jessfraz.com>
2024-06-22 22:50:16 +00:00
34c5c153c8 save specific commands like fillet and chamfer for last (#2753)
* save specific commands like fillet and chamfer for last

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

* bump kcl-lib

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

* more tests

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

* more images

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

* updates

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

* updates

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

* updates

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

* updates

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

---------

Signed-off-by: Jess Frazelle <github@jessfraz.com>
2024-06-22 21:31:37 +00:00
206 changed files with 109442 additions and 11359 deletions

View File

@ -4,7 +4,8 @@
"project": "./tsconfig.json" "project": "./tsconfig.json"
}, },
"plugins": [ "plugins": [
"css-modules" "css-modules",
"suggest-no-throw",
], ],
"extends": [ "extends": [
"react-app", "react-app",
@ -17,6 +18,7 @@
"never" "never"
], ],
"react-hooks/exhaustive-deps": "off", "react-hooks/exhaustive-deps": "off",
"suggest-no-throw/suggest-no-throw": "warn",
}, },
"overrides": [ "overrides": [
{ {
@ -25,6 +27,12 @@
"@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

@ -367,7 +367,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' }}/zoo-modeling-app" E2E_APPLICATION: "./src-tauri/target/${{ env.BUILD_RELEASE == 'true' && 'release' || 'debug' }}/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 +376,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' }}\\Zoo Modeling App.exe" E2E_APPLICATION: ".\\src-tauri\\target\\${{ env.BUILD_RELEASE == 'true' && 'release' || 'debug' }}\\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

@ -90,26 +90,21 @@ 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
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
# remove test-results, messes with retry logic
rm -r test-results
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 }}
- uses: actions/upload-artifact@v3
if: always()
with:
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 then echo "modified=true" >> $GITHUB_OUTPUT
echo "::set-output name=modified::true" else echo "modified=false" >> $GITHUB_OUTPUT
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,17 +120,55 @@ 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
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
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@v3 - uses: actions/upload-artifact@v4
if: always()
with:
name: test-results-ubuntu
path: test-results/
retention-days: 30
overwrite: true
- uses: actions/upload-artifact@v4
if: always() if: always()
with: with:
name: playwright-report-ubuntu name: playwright-report-ubuntu
path: playwright-report/ path: playwright-report/
retention-days: 30 retention-days: 30
overwrite: true
playwright-macos: playwright-macos:
timeout-minutes: 60 timeout-minutes: 60
@ -194,16 +227,48 @@ 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
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@v3 - uses: actions/upload-artifact@v4
if: always() if: ${{ always() }}
with:
name: test-results-macos
path: test-results/
retention-days: 30
overwrite: true
- uses: actions/upload-artifact@v4
if: ${{ always() }}
with: with:
name: playwright-report-macos name: playwright-report-macos
path: playwright-report/ path: playwright-report/
retention-days: 30 retention-days: 30
overwrite: true

View File

@ -1,14 +1,17 @@
.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 dev: node_modules public/wasm_lib_bg.wasm $(XSTATE_TYPEGENS)
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 node_modules: package.json yarn.lock
package.json:
yarn install yarn install

View File

@ -89,25 +89,6 @@ enable third-party cookies. You can enable third-party cookies by clicking on
the eye with a slash through it in the URL bar, and clicking on "Enable 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
@ -195,7 +176,9 @@ $ 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).
### Playwright ## Tests
### Playwright tests
For a portable way to run Playwright you'll need Docker. For a portable way to run Playwright you'll need Docker.
@ -284,6 +267,37 @@ Where `./store` should look like this
However because much of our tests involve clicking in the stream at specific locations, it's code-gen looks `await page.locator('video').click();` when really we need to use a pixel coord, so I think it's of limited use. 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.

View File

@ -17,4 +17,13 @@ once fixed in engine will just start working here with no language changes.
currently move or transform the imported objects at all, once we have assemblies 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 cases work currently. - **Fillets**: Fillets cannot intersect, you will get an error. Only simple fillet
cases work currently.
- **Chamfers**: Chamfers cannot intersect, you will get an error. Only simple
chamfer cases work currently.
Sketching on the chamfered face does not currently work.
- **Shell**: Shell is only working for `end` faces, not for `side` or `start`
faces. We are tracking the engine side bug on this.

View File

@ -9,7 +9,7 @@ Returns the angle to match the given length for x.
```js ```js
angleToMatchLengthX(segment_name: string, to: number, sketch_group: SketchGroup) -> number angleToMatchLengthX(segment_name: TagIdentifier, to: number, sketch_group: SketchGroup) -> number
``` ```
### Examples ### Examples
@ -17,11 +17,8 @@ angleToMatchLengthX(segment_name: string, to: number, sketch_group: SketchGroup)
```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([ |> angledLineToX([-angleToMatchLengthX(seg01, 7, %), 10], %)
-angleToMatchLengthX('seg01', 7, %),
10
], %)
|> close(%) |> close(%)
const extrusion = extrude(5, sketch001) const extrusion = extrude(5, sketch001)
@ -31,7 +28,12 @@ const extrusion = extrude(5, sketch001)
### Arguments ### Arguments
* `segment_name`: `string` (REQUIRED) * `segment_name`: `TagIdentifier` (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
@ -71,10 +73,181 @@ const extrusion = extrude(5, sketch001)
}, },
} | } |
{ {
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: SketchSurface,
// The starting path.
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The paths 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,
@ -101,8 +274,12 @@ const extrusion = extrude(5, sketch001)
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -110,8 +287,12 @@ const extrusion = extrude(5, sketch001)
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -123,8 +304,12 @@ const extrusion = extrude(5, sketch001)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -132,8 +317,12 @@ const extrusion = extrude(5, sketch001)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -141,8 +330,12 @@ const extrusion = extrude(5, sketch001)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -152,8 +345,12 @@ const extrusion = extrude(5, sketch001)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -165,8 +362,12 @@ const extrusion = extrude(5, sketch001)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",

View File

@ -9,7 +9,7 @@ Returns the angle to match the given length for y.
```js ```js
angleToMatchLengthY(segment_name: string, to: number, sketch_group: SketchGroup) -> number angleToMatchLengthY(segment_name: TagIdentifier, to: number, sketch_group: SketchGroup) -> number
``` ```
### Examples ### Examples
@ -17,9 +17,9 @@ angleToMatchLengthY(segment_name: string, to: number, sketch_group: SketchGroup)
```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,7 +32,12 @@ const extrusion = extrude(5, sketch001)
### Arguments ### Arguments
* `segment_name`: `string` (REQUIRED) * `segment_name`: `TagIdentifier` (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
@ -72,10 +77,181 @@ const extrusion = extrude(5, sketch001)
}, },
} | } |
{ {
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: SketchSurface,
// The starting path.
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The paths 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,
@ -102,8 +278,12 @@ const extrusion = extrude(5, sketch001)
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -111,8 +291,12 @@ const extrusion = extrude(5, sketch001)
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -124,8 +308,12 @@ const extrusion = extrude(5, sketch001)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -133,8 +321,12 @@ const extrusion = extrude(5, sketch001)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -142,8 +334,12 @@ const extrusion = extrude(5, sketch001)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -153,8 +349,12 @@ const extrusion = extrude(5, sketch001)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -166,8 +366,12 @@ const extrusion = extrude(5, sketch001)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",

View File

@ -9,7 +9,7 @@ Draw an angled line.
```js ```js
angledLine(data: AngledLineData, sketch_group: SketchGroup, tag?: String) -> SketchGroup angledLine(data: AngledLineData, sketch_group: SketchGroup, tag?: TagDeclarator) -> SketchGroup
``` ```
### Examples ### Examples
@ -78,10 +78,181 @@ const example = extrude(10, exampleSketch)
}, },
} | } |
{ {
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: SketchSurface,
// The starting path.
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The paths 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,
@ -108,8 +279,12 @@ const example = extrude(10, exampleSketch)
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -117,8 +292,12 @@ const example = extrude(10, exampleSketch)
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -130,8 +309,12 @@ const example = extrude(10, exampleSketch)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -139,8 +322,12 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -148,8 +335,12 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -159,8 +350,12 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -172,15 +367,26 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",
}], }],
} }
``` ```
* `tag`: `String` (OPTIONAL) * `tag`: `TagDeclarator` (OPTIONAL)
```js
{
end: number,
start: number,
value: string,
}
```
### Returns ### Returns
@ -222,10 +428,181 @@ const example = extrude(10, exampleSketch)
}, },
} | } |
{ {
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: SketchSurface,
// The starting path.
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The paths 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,
@ -252,8 +629,12 @@ const example = extrude(10, exampleSketch)
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -261,8 +642,12 @@ const example = extrude(10, exampleSketch)
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -274,8 +659,12 @@ const example = extrude(10, exampleSketch)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -283,8 +672,12 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -292,8 +685,12 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -303,8 +700,12 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -316,8 +717,12 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",

View File

@ -9,7 +9,7 @@ Draw an angled line of a given x length.
```js ```js
angledLineOfXLength(data: AngledLineData, sketch_group: SketchGroup, tag?: String) -> SketchGroup angledLineOfXLength(data: AngledLineData, sketch_group: SketchGroup, tag?: TagDeclarator) -> SketchGroup
``` ```
### Examples ### Examples
@ -17,10 +17,10 @@ angledLineOfXLength(data: AngledLineData, sketch_group: SketchGroup, tag?: Strin
```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)
``` ```
@ -77,10 +77,181 @@ const extrusion = extrude(10, sketch001)
}, },
} | } |
{ {
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: SketchSurface,
// The starting path.
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The paths 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,
@ -107,8 +278,12 @@ const extrusion = extrude(10, sketch001)
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -116,8 +291,12 @@ const extrusion = extrude(10, sketch001)
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -129,8 +308,12 @@ const extrusion = extrude(10, sketch001)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -138,8 +321,12 @@ const extrusion = extrude(10, sketch001)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -147,8 +334,12 @@ const extrusion = extrude(10, sketch001)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -158,8 +349,12 @@ const extrusion = extrude(10, sketch001)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -171,15 +366,26 @@ const extrusion = extrude(10, sketch001)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",
}], }],
} }
``` ```
* `tag`: `String` (OPTIONAL) * `tag`: `TagDeclarator` (OPTIONAL)
```js
{
end: number,
start: number,
value: string,
}
```
### Returns ### Returns
@ -221,10 +427,181 @@ const extrusion = extrude(10, sketch001)
}, },
} | } |
{ {
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: SketchSurface,
// The starting path.
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The paths 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,
@ -251,8 +628,12 @@ const extrusion = extrude(10, sketch001)
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -260,8 +641,12 @@ const extrusion = extrude(10, sketch001)
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -273,8 +658,12 @@ const extrusion = extrude(10, sketch001)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -282,8 +671,12 @@ const extrusion = extrude(10, sketch001)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -291,8 +684,12 @@ const extrusion = extrude(10, sketch001)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -302,8 +699,12 @@ const extrusion = extrude(10, sketch001)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -315,8 +716,12 @@ const extrusion = extrude(10, sketch001)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",

View File

@ -9,7 +9,7 @@ Draw an angled line of a given y length.
```js ```js
angledLineOfYLength(data: AngledLineData, sketch_group: SketchGroup, tag?: String) -> SketchGroup angledLineOfYLength(data: AngledLineData, sketch_group: SketchGroup, tag?: TagDeclarator) -> SketchGroup
``` ```
### Examples ### Examples
@ -79,10 +79,181 @@ const example = extrude(10, exampleSketch)
}, },
} | } |
{ {
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: SketchSurface,
// The starting path.
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The paths 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,
@ -109,8 +280,12 @@ const example = extrude(10, exampleSketch)
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -118,8 +293,12 @@ const example = extrude(10, exampleSketch)
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -131,8 +310,12 @@ const example = extrude(10, exampleSketch)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -140,8 +323,12 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -149,8 +336,12 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -160,8 +351,12 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -173,15 +368,26 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",
}], }],
} }
``` ```
* `tag`: `String` (OPTIONAL) * `tag`: `TagDeclarator` (OPTIONAL)
```js
{
end: number,
start: number,
value: string,
}
```
### Returns ### Returns
@ -223,10 +429,181 @@ const example = extrude(10, exampleSketch)
}, },
} | } |
{ {
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: SketchSurface,
// The starting path.
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The paths 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,
@ -253,8 +630,12 @@ const example = extrude(10, exampleSketch)
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -262,8 +643,12 @@ const example = extrude(10, exampleSketch)
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -275,8 +660,12 @@ const example = extrude(10, exampleSketch)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -284,8 +673,12 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -293,8 +686,12 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -304,8 +701,12 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -317,8 +718,12 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",

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?: String) -> SketchGroup angledLineThatIntersects(data: AngledLineThatIntersectsData, sketch_group: SketchGroup, tag?: TagDeclarator) -> 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,7 +40,9 @@ 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: string, intersectTag: {
value: string,
},
// The offset from the intersecting line. // The offset from the intersecting line.
offset: number, offset: number,
} }
@ -83,10 +85,181 @@ const example = extrude(10, exampleSketch)
}, },
} | } |
{ {
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: SketchSurface,
// The starting path.
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The paths 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,
@ -113,8 +286,12 @@ const example = extrude(10, exampleSketch)
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -122,8 +299,12 @@ const example = extrude(10, exampleSketch)
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -135,8 +316,12 @@ const example = extrude(10, exampleSketch)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -144,8 +329,12 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -153,8 +342,12 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -164,8 +357,12 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -177,15 +374,26 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",
}], }],
} }
``` ```
* `tag`: `String` (OPTIONAL) * `tag`: `TagDeclarator` (OPTIONAL)
```js
{
end: number,
start: number,
value: string,
}
```
### Returns ### Returns
@ -227,10 +435,181 @@ const example = extrude(10, exampleSketch)
}, },
} | } |
{ {
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: SketchSurface,
// The starting path.
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The paths 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,
@ -257,8 +636,12 @@ const example = extrude(10, exampleSketch)
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -266,8 +649,12 @@ const example = extrude(10, exampleSketch)
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -279,8 +666,12 @@ const example = extrude(10, exampleSketch)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -288,8 +679,12 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -297,8 +692,12 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -308,8 +707,12 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -321,8 +724,12 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",

View File

@ -9,7 +9,7 @@ Draw an angled line to a given x coordinate.
```js ```js
angledLineToX(data: AngledLineToData, sketch_group: SketchGroup, tag?: String) -> SketchGroup angledLineToX(data: AngledLineToData, sketch_group: SketchGroup, tag?: TagDeclarator) -> SketchGroup
``` ```
### Examples ### Examples
@ -76,10 +76,181 @@ const example = extrude(10, exampleSketch)
}, },
} | } |
{ {
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: SketchSurface,
// The starting path.
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The paths 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,
@ -106,8 +277,12 @@ const example = extrude(10, exampleSketch)
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -115,8 +290,12 @@ const example = extrude(10, exampleSketch)
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -128,8 +307,12 @@ const example = extrude(10, exampleSketch)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -137,8 +320,12 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -146,8 +333,12 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -157,8 +348,12 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -170,15 +365,26 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",
}], }],
} }
``` ```
* `tag`: `String` (OPTIONAL) * `tag`: `TagDeclarator` (OPTIONAL)
```js
{
end: number,
start: number,
value: string,
}
```
### Returns ### Returns
@ -220,10 +426,181 @@ const example = extrude(10, exampleSketch)
}, },
} | } |
{ {
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: SketchSurface,
// The starting path.
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The paths 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,
@ -250,8 +627,12 @@ const example = extrude(10, exampleSketch)
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -259,8 +640,12 @@ const example = extrude(10, exampleSketch)
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -272,8 +657,12 @@ const example = extrude(10, exampleSketch)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -281,8 +670,12 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -290,8 +683,12 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -301,8 +698,12 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -314,8 +715,12 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",

View File

@ -9,7 +9,7 @@ Draw an angled line to a given y coordinate.
```js ```js
angledLineToY(data: AngledLineToData, sketch_group: SketchGroup, tag?: String) -> SketchGroup angledLineToY(data: AngledLineToData, sketch_group: SketchGroup, tag?: TagDeclarator) -> SketchGroup
``` ```
### Examples ### Examples
@ -76,10 +76,181 @@ const example = extrude(10, exampleSketch)
}, },
} | } |
{ {
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: SketchSurface,
// The starting path.
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The paths 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,
@ -106,8 +277,12 @@ const example = extrude(10, exampleSketch)
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -115,8 +290,12 @@ const example = extrude(10, exampleSketch)
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -128,8 +307,12 @@ const example = extrude(10, exampleSketch)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -137,8 +320,12 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -146,8 +333,12 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -157,8 +348,12 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -170,15 +365,26 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",
}], }],
} }
``` ```
* `tag`: `String` (OPTIONAL) * `tag`: `TagDeclarator` (OPTIONAL)
```js
{
end: number,
start: number,
value: string,
}
```
### Returns ### Returns
@ -220,10 +426,181 @@ const example = extrude(10, exampleSketch)
}, },
} | } |
{ {
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: SketchSurface,
// The starting path.
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The paths 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,
@ -250,8 +627,12 @@ const example = extrude(10, exampleSketch)
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -259,8 +640,12 @@ const example = extrude(10, exampleSketch)
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -272,8 +657,12 @@ const example = extrude(10, exampleSketch)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -281,8 +670,12 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -290,8 +683,12 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -301,8 +698,12 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -314,8 +715,12 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",

View File

@ -9,7 +9,7 @@ Draw an arc.
```js ```js
arc(data: ArcData, sketch_group: SketchGroup, tag?: String) -> SketchGroup arc(data: ArcData, sketch_group: SketchGroup, tag?: TagDeclarator) -> SketchGroup
``` ```
### Examples ### Examples
@ -87,10 +87,181 @@ const exampleSketch = startSketchOn('XZ')
}, },
} | } |
{ {
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: SketchSurface,
// The starting path.
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The paths 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,
@ -117,8 +288,12 @@ const exampleSketch = startSketchOn('XZ')
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -126,8 +301,12 @@ const exampleSketch = startSketchOn('XZ')
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -139,8 +318,12 @@ const exampleSketch = startSketchOn('XZ')
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -148,8 +331,12 @@ const exampleSketch = startSketchOn('XZ')
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -157,8 +344,12 @@ const exampleSketch = startSketchOn('XZ')
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -168,8 +359,12 @@ const exampleSketch = startSketchOn('XZ')
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -181,15 +376,26 @@ const exampleSketch = startSketchOn('XZ')
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",
}], }],
} }
``` ```
* `tag`: `String` (OPTIONAL) * `tag`: `TagDeclarator` (OPTIONAL)
```js
{
end: number,
start: number,
value: string,
}
```
### Returns ### Returns
@ -231,10 +437,181 @@ const exampleSketch = startSketchOn('XZ')
}, },
} | } |
{ {
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: SketchSurface,
// The starting path.
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The paths 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,
@ -261,8 +638,12 @@ const exampleSketch = startSketchOn('XZ')
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -270,8 +651,12 @@ const exampleSketch = startSketchOn('XZ')
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -283,8 +668,12 @@ const exampleSketch = startSketchOn('XZ')
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -292,8 +681,12 @@ const exampleSketch = startSketchOn('XZ')
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -301,8 +694,12 @@ const exampleSketch = startSketchOn('XZ')
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -312,8 +709,12 @@ const exampleSketch = startSketchOn('XZ')
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -325,8 +726,12 @@ const exampleSketch = startSketchOn('XZ')
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",

View File

@ -9,7 +9,7 @@ Draw a bezier curve.
```js ```js
bezierCurve(data: BezierData, sketch_group: SketchGroup, tag?: String) -> SketchGroup bezierCurve(data: BezierData, sketch_group: SketchGroup, tag?: TagDeclarator) -> SketchGroup
``` ```
### Examples ### Examples
@ -82,10 +82,181 @@ const example = extrude(10, exampleSketch)
}, },
} | } |
{ {
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: SketchSurface,
// The starting path.
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The paths 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,
@ -112,8 +283,12 @@ const example = extrude(10, exampleSketch)
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -121,8 +296,12 @@ const example = extrude(10, exampleSketch)
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -134,8 +313,12 @@ const example = extrude(10, exampleSketch)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -143,8 +326,12 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -152,8 +339,12 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -163,8 +354,12 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -176,15 +371,26 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",
}], }],
} }
``` ```
* `tag`: `String` (OPTIONAL) * `tag`: `TagDeclarator` (OPTIONAL)
```js
{
end: number,
start: number,
value: string,
}
```
### Returns ### Returns
@ -226,10 +432,181 @@ const example = extrude(10, exampleSketch)
}, },
} | } |
{ {
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: SketchSurface,
// The starting path.
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The paths 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,
@ -256,8 +633,12 @@ const example = extrude(10, exampleSketch)
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -265,8 +646,12 @@ const example = extrude(10, exampleSketch)
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -278,8 +663,12 @@ const example = extrude(10, exampleSketch)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -287,8 +676,12 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -296,8 +689,12 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -307,8 +704,12 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -320,8 +721,12 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",

View File

@ -9,7 +9,7 @@ Create chamfers on tagged paths.
```js ```js
chamfer(data: ChamferData, extrude_group: ExtrudeGroup) -> ExtrudeGroup chamfer(data: ChamferData, extrude_group: ExtrudeGroup, tag?: TagDeclarator) -> ExtrudeGroup
``` ```
### Examples ### Examples
@ -22,19 +22,19 @@ const chamferLength = 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)
|> chamfer({ |> chamfer({
length: chamferLength, length: chamferLength,
tags: [ tags: [
getNextAdjacentEdge('edge1', %), getNextAdjacentEdge(edge1, %),
getNextAdjacentEdge('edge2', %), getNextAdjacentEdge(edge2, %),
getNextAdjacentEdge('edge3', %), getNextAdjacentEdge(edge3, %),
getNextAdjacentEdge('edge4', %) getNextAdjacentEdge(edge4, %)
] ]
}, %) }, %)
``` ```
@ -50,7 +50,9 @@ const mountingPlate = extrude(thickness, mountingPlateSketch)
length: number, length: number,
// The tags of the paths you want to chamfer. // The tags of the paths you want to chamfer.
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)
@ -58,6 +60,28 @@ string],
{ {
// 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.
@ -99,10 +123,74 @@ string],
}, },
} | } |
{ {
// 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. // 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,
@ -129,8 +217,12 @@ string],
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -138,8 +230,12 @@ string],
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -151,8 +247,12 @@ string],
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -160,8 +260,12 @@ string],
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -169,8 +273,12 @@ string],
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -180,8 +288,12 @@ string],
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -193,8 +305,12 @@ string],
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",
@ -208,10 +324,14 @@ string],
faceId: uuid, faceId: uuid,
// The id of the geometry. // The id of the geometry.
id: uuid, id: uuid,
// The name.
name: string,
// 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",
} | } |
{ {
@ -219,14 +339,26 @@ string],
faceId: uuid, faceId: uuid,
// The id of the geometry. // The id of the geometry.
id: uuid, id: uuid,
// The name.
name: string,
// 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",
}], }],
} }
``` ```
* `tag`: `TagDeclarator` (OPTIONAL)
```js
{
end: number,
start: number,
value: string,
}
```
### Returns ### Returns
@ -235,6 +367,28 @@ string],
{ {
// 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.
@ -276,10 +430,74 @@ string],
}, },
} | } |
{ {
// 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. // 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,
@ -306,8 +524,12 @@ string],
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -315,8 +537,12 @@ string],
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -328,8 +554,12 @@ string],
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -337,8 +567,12 @@ string],
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -346,8 +580,12 @@ string],
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -357,8 +595,12 @@ string],
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -370,8 +612,12 @@ string],
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",
@ -385,10 +631,14 @@ string],
faceId: uuid, faceId: uuid,
// The id of the geometry. // The id of the geometry.
id: uuid, id: uuid,
// The name.
name: string,
// 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",
} | } |
{ {
@ -396,10 +646,14 @@ string],
faceId: uuid, faceId: uuid,
// The id of the geometry. // The id of the geometry.
id: uuid, id: uuid,
// The name.
name: string,
// 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",
}], }],
} }

View File

@ -9,7 +9,7 @@ Sketch a circle.
```js ```js
circle(center: [number], radius: number, tag?: String, sketch_surface_or_group: SketchSurfaceOrGroup) -> SketchGroup circle(center: [number], radius: number, sketch_surface_or_group: SketchSurfaceOrGroup, tag?: TagDeclarator) -> SketchGroup
``` ```
### Examples ### Examples
@ -41,7 +41,6 @@ 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
{ {
@ -76,10 +75,181 @@ const example = extrude(5, exampleSketch)
}, },
} | } |
{ {
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: SketchSurface,
// The starting path.
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The paths 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,
@ -138,10 +308,74 @@ const example = extrude(5, exampleSketch)
}, },
} | } |
{ {
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: SketchGroup,
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
value: [{
// The face id for the extrude plane.
faceId: 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,
@ -168,8 +402,12 @@ const example = extrude(5, exampleSketch)
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -177,8 +415,12 @@ const example = extrude(5, exampleSketch)
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -190,8 +432,12 @@ const example = extrude(5, exampleSketch)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -199,8 +445,12 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -208,8 +458,12 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -219,8 +473,12 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -232,14 +490,26 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",
}], }],
} }
``` ```
* `tag`: `TagDeclarator` (OPTIONAL)
```js
{
end: number,
start: number,
value: string,
}
```
### Returns ### Returns
@ -281,10 +551,181 @@ const example = extrude(5, exampleSketch)
}, },
} | } |
{ {
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: SketchSurface,
// The starting path.
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The paths 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,
@ -311,8 +752,12 @@ const example = extrude(5, exampleSketch)
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -320,8 +765,12 @@ const example = extrude(5, exampleSketch)
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -333,8 +782,12 @@ const example = extrude(5, exampleSketch)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -342,8 +795,12 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -351,8 +808,12 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -362,8 +823,12 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -375,8 +840,12 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",

View File

@ -9,7 +9,7 @@ Close the current sketch.
```js ```js
close(sketch_group: SketchGroup, tag?: String) -> SketchGroup close(sketch_group: SketchGroup, tag?: TagDeclarator) -> SketchGroup
``` ```
### Examples ### Examples
@ -77,10 +77,181 @@ const example = extrude(10, exampleSketch)
}, },
} | } |
{ {
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: SketchSurface,
// The starting path.
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The paths 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,
@ -107,8 +278,12 @@ const example = extrude(10, exampleSketch)
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -116,8 +291,12 @@ const example = extrude(10, exampleSketch)
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -129,8 +308,12 @@ const example = extrude(10, exampleSketch)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -138,8 +321,12 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -147,8 +334,12 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -158,8 +349,12 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -171,15 +366,26 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",
}], }],
} }
``` ```
* `tag`: `String` (OPTIONAL) * `tag`: `TagDeclarator` (OPTIONAL)
```js
{
end: number,
start: number,
value: string,
}
```
### Returns ### Returns
@ -221,10 +427,181 @@ const example = extrude(10, exampleSketch)
}, },
} | } |
{ {
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: SketchSurface,
// The starting path.
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The paths 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,
@ -251,8 +628,12 @@ const example = extrude(10, exampleSketch)
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -260,8 +641,12 @@ const example = extrude(10, exampleSketch)
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -273,8 +658,12 @@ const example = extrude(10, exampleSketch)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -282,8 +671,12 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -291,8 +684,12 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -302,8 +699,12 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -315,8 +716,12 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",

View File

@ -102,10 +102,181 @@ const example = extrude(10, exampleSketch)
}, },
} | } |
{ {
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: SketchSurface,
// The starting path.
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The paths 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,
@ -132,8 +303,12 @@ const example = extrude(10, exampleSketch)
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -142,8 +317,12 @@ const example = extrude(10, exampleSketch)
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -155,8 +334,12 @@ const example = extrude(10, exampleSketch)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -164,8 +347,12 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -173,8 +360,12 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -184,8 +375,12 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -197,8 +392,12 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",
@ -216,6 +415,28 @@ 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.
@ -257,10 +478,74 @@ const example = extrude(10, exampleSketch)
}, },
} | } |
{ {
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: 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. // 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,
@ -287,8 +572,12 @@ const example = extrude(10, exampleSketch)
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -296,8 +585,12 @@ const example = extrude(10, exampleSketch)
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -309,8 +602,12 @@ const example = extrude(10, exampleSketch)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -318,8 +615,12 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -327,8 +628,12 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -338,8 +643,12 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -351,8 +660,12 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",
@ -367,10 +680,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 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,10 +695,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 source range. // The source range.
sourceRange: [number, number], sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc", type: "extrudeArc",
}], }],
} | } |

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,7 +50,9 @@ 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)
@ -58,6 +60,28 @@ string],
{ {
// 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.
@ -99,10 +123,74 @@ string],
}, },
} | } |
{ {
// 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. // 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,
@ -129,8 +217,12 @@ string],
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -138,8 +230,12 @@ string],
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -151,8 +247,12 @@ string],
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -160,8 +260,12 @@ string],
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -169,8 +273,12 @@ string],
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -180,8 +288,12 @@ string],
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -193,8 +305,12 @@ string],
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",
@ -208,10 +324,14 @@ string],
faceId: uuid, faceId: uuid,
// The id of the geometry. // The id of the geometry.
id: uuid, id: uuid,
// The name.
name: string,
// 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",
} | } |
{ {
@ -219,10 +339,14 @@ string],
faceId: uuid, faceId: uuid,
// The id of the geometry. // The id of the geometry.
id: uuid, id: uuid,
// The name.
name: string,
// 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",
}], }],
} }
@ -235,6 +359,28 @@ string],
{ {
// 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.
@ -276,10 +422,74 @@ string],
}, },
} | } |
{ {
// 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. // 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,
@ -306,8 +516,12 @@ string],
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -315,8 +529,12 @@ string],
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -328,8 +546,12 @@ string],
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -337,8 +559,12 @@ string],
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -346,8 +572,12 @@ string],
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -357,8 +587,12 @@ string],
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -370,8 +604,12 @@ string],
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",
@ -385,10 +623,14 @@ string],
faceId: uuid, faceId: uuid,
// The id of the geometry. // The id of the geometry.
id: uuid, id: uuid,
// The name.
name: string,
// 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",
} | } |
{ {
@ -396,10 +638,14 @@ string],
faceId: uuid, faceId: uuid,
// The id of the geometry. // The id of the geometry.
id: uuid, id: uuid,
// The name.
name: string,
// 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",
}], }],
} }

View File

@ -9,7 +9,7 @@ Get an edge on a 3D solid.
```js ```js
getEdge(tag: String, extrude_group: ExtrudeGroup) -> Uuid getEdge(tag: TagIdentifier, extrude_group: ExtrudeGroup) -> Uuid
``` ```
### Examples ### Examples
@ -17,7 +17,7 @@ getEdge(tag: String, 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,12 +39,39 @@ const revolution = startSketchOn(box, "revolveAxis")
### Arguments ### Arguments
* `tag`: `String` (REQUIRED) * `tag`: `TagIdentifier` (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.
@ -86,10 +113,74 @@ const revolution = startSketchOn(box, "revolveAxis")
}, },
} | } |
{ {
// 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. // 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,
@ -116,8 +207,12 @@ const revolution = startSketchOn(box, "revolveAxis")
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -125,8 +220,12 @@ const revolution = startSketchOn(box, "revolveAxis")
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -138,8 +237,12 @@ const revolution = startSketchOn(box, "revolveAxis")
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -147,8 +250,12 @@ const revolution = startSketchOn(box, "revolveAxis")
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -156,8 +263,12 @@ const revolution = startSketchOn(box, "revolveAxis")
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -167,8 +278,12 @@ const revolution = startSketchOn(box, "revolveAxis")
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -180,8 +295,12 @@ const revolution = startSketchOn(box, "revolveAxis")
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",
@ -195,10 +314,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 source range. // The source range.
sourceRange: [number, number], sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane", type: "extrudePlane",
} | } |
{ {
@ -206,10 +329,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 source range. // The source range.
sourceRange: [number, number], sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc", type: "extrudeArc",
}], }],
} }

View File

@ -9,7 +9,7 @@ Get the next adjacent edge to the edge given.
```js ```js
getNextAdjacentEdge(tag: String, extrude_group: ExtrudeGroup) -> Uuid getNextAdjacentEdge(tag: TagIdentifier, extrude_group: ExtrudeGroup) -> Uuid
``` ```
### Examples ### Examples
@ -21,15 +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: [ tags: [getNextAdjacentEdge(referenceEdge, %)]
getNextAdjacentEdge("referenceEdge", %)
]
}, %) }, %)
``` ```
@ -37,12 +35,39 @@ const example = extrude(5, exampleSketch)
### Arguments ### Arguments
* `tag`: `String` (REQUIRED) * `tag`: `TagIdentifier` (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.
@ -84,10 +109,74 @@ const example = extrude(5, exampleSketch)
}, },
} | } |
{ {
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: SketchGroup,
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
value: [{
// The face id for the extrude plane.
faceId: 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,
@ -114,8 +203,12 @@ const example = extrude(5, exampleSketch)
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -123,8 +216,12 @@ const example = extrude(5, exampleSketch)
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -136,8 +233,12 @@ const example = extrude(5, exampleSketch)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -145,8 +246,12 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -154,8 +259,12 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -165,8 +274,12 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -178,8 +291,12 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",
@ -193,10 +310,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 source range. // The source range.
sourceRange: [number, number], sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane", type: "extrudePlane",
} | } |
{ {
@ -204,10 +325,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 source range. // The source range.
sourceRange: [number, number], sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc", type: "extrudeArc",
}], }],
} }

View File

@ -9,7 +9,7 @@ Get the opposite edge to the edge given.
```js ```js
getOppositeEdge(tag: String, extrude_group: ExtrudeGroup) -> Uuid getOppositeEdge(tag: TagIdentifier, 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,12 +35,39 @@ const example = extrude(5, exampleSketch)
### Arguments ### Arguments
* `tag`: `String` (REQUIRED) * `tag`: `TagIdentifier` (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.
@ -82,10 +109,74 @@ const example = extrude(5, exampleSketch)
}, },
} | } |
{ {
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: SketchGroup,
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
value: [{
// The face id for the extrude plane.
faceId: 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,
@ -112,8 +203,12 @@ const example = extrude(5, exampleSketch)
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -121,8 +216,12 @@ const example = extrude(5, exampleSketch)
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -134,8 +233,12 @@ const example = extrude(5, exampleSketch)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -143,8 +246,12 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -152,8 +259,12 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -163,8 +274,12 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -176,8 +291,12 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",
@ -191,10 +310,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 source range. // The source range.
sourceRange: [number, number], sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane", type: "extrudePlane",
} | } |
{ {
@ -202,10 +325,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 source range. // The source range.
sourceRange: [number, number], sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc", type: "extrudeArc",
}], }],
} }

View File

@ -9,7 +9,7 @@ Get the previous adjacent edge to the edge given.
```js ```js
getPreviousAdjacentEdge(tag: String, extrude_group: ExtrudeGroup) -> Uuid getPreviousAdjacentEdge(tag: TagIdentifier, 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,12 +37,39 @@ const example = extrude(5, exampleSketch)
### Arguments ### Arguments
* `tag`: `String` (REQUIRED) * `tag`: `TagIdentifier` (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.
@ -84,10 +111,74 @@ const example = extrude(5, exampleSketch)
}, },
} | } |
{ {
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: SketchGroup,
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
value: [{
// The face id for the extrude plane.
faceId: 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,
@ -114,8 +205,12 @@ const example = extrude(5, exampleSketch)
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -123,8 +218,12 @@ const example = extrude(5, exampleSketch)
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -136,8 +235,12 @@ const example = extrude(5, exampleSketch)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -145,8 +248,12 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -154,8 +261,12 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -165,8 +276,12 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -178,8 +293,12 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",
@ -193,10 +312,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 source range. // The source range.
sourceRange: [number, number], sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane", type: "extrudePlane",
} | } |
{ {
@ -204,10 +327,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 source range. // The source range.
sourceRange: [number, number], sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc", type: "extrudeArc",
}], }],
} }

View File

@ -48,6 +48,28 @@ 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.
@ -89,10 +111,74 @@ const part001 = startSketchOn('XY')
}, },
} | } |
{ {
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: 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. // 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,
@ -119,8 +205,12 @@ const part001 = startSketchOn('XY')
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -128,8 +218,12 @@ const part001 = startSketchOn('XY')
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -141,8 +235,12 @@ const part001 = startSketchOn('XY')
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -150,8 +248,12 @@ const part001 = startSketchOn('XY')
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -159,8 +261,12 @@ const part001 = startSketchOn('XY')
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -170,8 +276,12 @@ const part001 = startSketchOn('XY')
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -183,8 +293,12 @@ const part001 = startSketchOn('XY')
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",
@ -198,10 +312,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 source range. // The source range.
sourceRange: [number, number], sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane", type: "extrudePlane",
} | } |
{ {
@ -209,10 +327,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 source range. // The source range.
sourceRange: [number, number], sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc", type: "extrudeArc",
}], }],
} }
@ -225,6 +347,28 @@ 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.
@ -266,10 +410,74 @@ const part001 = startSketchOn('XY')
}, },
} | } |
{ {
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: 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. // 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,
@ -296,8 +504,12 @@ const part001 = startSketchOn('XY')
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -305,8 +517,12 @@ const part001 = startSketchOn('XY')
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -318,8 +534,12 @@ const part001 = startSketchOn('XY')
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -327,8 +547,12 @@ const part001 = startSketchOn('XY')
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -336,8 +560,12 @@ const part001 = startSketchOn('XY')
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -347,8 +575,12 @@ const part001 = startSketchOn('XY')
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -360,8 +592,12 @@ const part001 = startSketchOn('XY')
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",
@ -375,10 +611,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 source range. // The source range.
sourceRange: [number, number], sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane", type: "extrudePlane",
} | } |
{ {
@ -386,10 +626,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 source range. // The source range.
sourceRange: [number, number], sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc", type: "extrudeArc",
}], }],
} }

View File

@ -88,10 +88,181 @@ const example = extrude(1, exampleSketch)
}, },
} | } |
{ {
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: SketchSurface,
// The starting path.
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The paths 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,
@ -118,8 +289,12 @@ const example = extrude(1, exampleSketch)
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -128,8 +303,12 @@ const example = extrude(1, exampleSketch)
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -141,8 +320,12 @@ const example = extrude(1, exampleSketch)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -150,8 +333,12 @@ const example = extrude(1, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -159,8 +346,12 @@ const example = extrude(1, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -170,8 +361,12 @@ const example = extrude(1, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -183,8 +378,12 @@ const example = extrude(1, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",
@ -232,10 +431,181 @@ const example = extrude(1, exampleSketch)
}, },
} | } |
{ {
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: SketchSurface,
// The starting path.
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The paths 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,
@ -262,8 +632,12 @@ const example = extrude(1, exampleSketch)
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -271,8 +645,12 @@ const example = extrude(1, exampleSketch)
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -284,8 +662,12 @@ const example = extrude(1, exampleSketch)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -293,8 +675,12 @@ const example = extrude(1, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -302,8 +688,12 @@ const example = extrude(1, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -313,8 +703,12 @@ const example = extrude(1, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -326,8 +720,12 @@ const example = extrude(1, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",
@ -375,10 +773,181 @@ const example = extrude(1, exampleSketch)
}, },
} | } |
{ {
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: SketchSurface,
// The starting path.
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The paths 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,
@ -405,8 +974,12 @@ const example = extrude(1, exampleSketch)
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -414,8 +987,12 @@ const example = extrude(1, exampleSketch)
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -427,8 +1004,12 @@ const example = extrude(1, exampleSketch)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -436,8 +1017,12 @@ const example = extrude(1, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -445,8 +1030,12 @@ const example = extrude(1, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -456,8 +1045,12 @@ const example = extrude(1, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -469,8 +1062,12 @@ const example = extrude(1, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",

View File

@ -68,10 +68,181 @@ const example = extrude(5, exampleSketch)
}, },
} | } |
{ {
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: SketchSurface,
// The starting path.
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The paths 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,
@ -98,8 +269,12 @@ const example = extrude(5, exampleSketch)
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -107,8 +282,12 @@ const example = extrude(5, exampleSketch)
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -120,8 +299,12 @@ const example = extrude(5, exampleSketch)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -129,8 +312,12 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -138,8 +325,12 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -149,8 +340,12 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -162,8 +357,12 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",

View File

@ -68,10 +68,181 @@ const example = extrude(5, exampleSketch)
}, },
} | } |
{ {
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: SketchSurface,
// The starting path.
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The paths 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,
@ -98,8 +269,12 @@ const example = extrude(5, exampleSketch)
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -107,8 +282,12 @@ const example = extrude(5, exampleSketch)
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -120,8 +299,12 @@ const example = extrude(5, exampleSketch)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -129,8 +312,12 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -138,8 +325,12 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -149,8 +340,12 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -162,8 +357,12 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",

View File

@ -9,7 +9,7 @@ Draw a line.
```js ```js
line(delta: [number], sketch_group: SketchGroup, tag?: String) -> SketchGroup line(delta: [number], sketch_group: SketchGroup, tag?: TagDeclarator) -> SketchGroup
``` ```
### Examples ### Examples
@ -81,10 +81,181 @@ const example = extrude(5, exampleSketch)
}, },
} | } |
{ {
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: SketchSurface,
// The starting path.
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The paths 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,
@ -111,8 +282,12 @@ const example = extrude(5, exampleSketch)
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -120,8 +295,12 @@ const example = extrude(5, exampleSketch)
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -133,8 +312,12 @@ const example = extrude(5, exampleSketch)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -142,8 +325,12 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -151,8 +338,12 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -162,8 +353,12 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -175,15 +370,26 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",
}], }],
} }
``` ```
* `tag`: `String` (OPTIONAL) * `tag`: `TagDeclarator` (OPTIONAL)
```js
{
end: number,
start: number,
value: string,
}
```
### Returns ### Returns
@ -225,10 +431,181 @@ const example = extrude(5, exampleSketch)
}, },
} | } |
{ {
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: SketchSurface,
// The starting path.
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The paths 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,
@ -255,8 +632,12 @@ const example = extrude(5, exampleSketch)
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -264,8 +645,12 @@ const example = extrude(5, exampleSketch)
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -277,8 +662,12 @@ const example = extrude(5, exampleSketch)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -286,8 +675,12 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -295,8 +688,12 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -306,8 +703,12 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -319,8 +720,12 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",

View File

@ -9,7 +9,7 @@ Draw a line to a point.
```js ```js
lineTo(to: [number], sketch_group: SketchGroup, tag?: String) -> SketchGroup lineTo(to: [number], sketch_group: SketchGroup, tag?: TagDeclarator) -> SketchGroup
``` ```
### Examples ### Examples
@ -68,10 +68,181 @@ const example = extrude(5, exampleSketch)
}, },
} | } |
{ {
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: SketchSurface,
// The starting path.
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The paths 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,
@ -98,8 +269,12 @@ const example = extrude(5, exampleSketch)
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -107,8 +282,12 @@ const example = extrude(5, exampleSketch)
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -120,8 +299,12 @@ const example = extrude(5, exampleSketch)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -129,8 +312,12 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -138,8 +325,12 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -149,8 +340,12 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -162,15 +357,26 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",
}], }],
} }
``` ```
* `tag`: `String` (OPTIONAL) * `tag`: `TagDeclarator` (OPTIONAL)
```js
{
end: number,
start: number,
value: string,
}
```
### Returns ### Returns
@ -212,10 +418,181 @@ const example = extrude(5, exampleSketch)
}, },
} | } |
{ {
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: SketchSurface,
// The starting path.
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The paths 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,
@ -242,8 +619,12 @@ const example = extrude(5, exampleSketch)
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -251,8 +632,12 @@ const example = extrude(5, exampleSketch)
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -264,8 +649,12 @@ const example = extrude(5, exampleSketch)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -273,8 +662,12 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -282,8 +675,12 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -293,8 +690,12 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -306,8 +707,12 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",

View File

@ -86,10 +86,181 @@ const example = extrude(1, exampleSketch)
}, },
} | } |
{ {
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: SketchSurface,
// The starting path.
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The paths 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,
@ -116,8 +287,12 @@ const example = extrude(1, exampleSketch)
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -126,8 +301,12 @@ const example = extrude(1, exampleSketch)
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -139,8 +318,12 @@ const example = extrude(1, exampleSketch)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -148,8 +331,12 @@ const example = extrude(1, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -157,8 +344,12 @@ const example = extrude(1, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -168,8 +359,12 @@ const example = extrude(1, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -181,8 +376,12 @@ const example = extrude(1, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",

View File

@ -52,6 +52,28 @@ const example = extrude(-5, 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.
@ -93,10 +115,74 @@ const example = extrude(-5, exampleSketch)
}, },
} | } |
{ {
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: SketchGroup,
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
value: [{
// The face id for the extrude plane.
faceId: 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,
@ -123,8 +209,12 @@ const example = extrude(-5, exampleSketch)
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -132,8 +222,12 @@ const example = extrude(-5, exampleSketch)
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -145,8 +239,12 @@ const example = extrude(-5, exampleSketch)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -154,8 +252,12 @@ const example = extrude(-5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -163,8 +265,12 @@ const example = extrude(-5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -174,8 +280,12 @@ const example = extrude(-5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -187,8 +297,12 @@ const example = extrude(-5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",
@ -203,10 +317,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 source range. // The source range.
sourceRange: [number, number], sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane", type: "extrudePlane",
} | } |
{ {
@ -214,10 +332,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 source range. // The source range.
sourceRange: [number, number], sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc", type: "extrudeArc",
}], }],
} | } |

View File

@ -79,10 +79,181 @@ const example = extrude(1, exampleSketch)
}, },
} | } |
{ {
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: SketchSurface,
// The starting path.
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The paths 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,
@ -109,8 +280,12 @@ const example = extrude(1, exampleSketch)
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -119,8 +294,12 @@ const example = extrude(1, exampleSketch)
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -132,8 +311,12 @@ const example = extrude(1, exampleSketch)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -141,8 +324,12 @@ const example = extrude(1, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -150,8 +337,12 @@ const example = extrude(1, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -161,8 +352,12 @@ const example = extrude(1, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -174,8 +369,12 @@ const example = extrude(1, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",

View File

@ -50,6 +50,28 @@ const example = extrude(1, 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.
@ -91,10 +113,74 @@ const example = extrude(1, exampleSketch)
}, },
} | } |
{ {
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: 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. // 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,
@ -121,8 +207,12 @@ const example = extrude(1, exampleSketch)
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -130,8 +220,12 @@ const example = extrude(1, exampleSketch)
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -143,8 +237,12 @@ const example = extrude(1, exampleSketch)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -152,8 +250,12 @@ const example = extrude(1, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -161,8 +263,12 @@ const example = extrude(1, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -172,8 +278,12 @@ const example = extrude(1, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -185,8 +295,12 @@ const example = extrude(1, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",
@ -201,10 +315,14 @@ 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 source range. // The source range.
sourceRange: [number, number], sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane", type: "extrudePlane",
} | } |
{ {
@ -212,10 +330,14 @@ 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 source range. // The source range.
sourceRange: [number, number], sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc", type: "extrudeArc",
}], }],
} | } |

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(%), %)
@ -69,10 +69,181 @@ const sketch001 = startSketchOn('XY')
}, },
} | } |
{ {
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: SketchSurface,
// The starting path.
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The paths 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,
@ -99,8 +270,12 @@ const sketch001 = startSketchOn('XY')
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -108,8 +283,12 @@ const sketch001 = startSketchOn('XY')
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -121,8 +300,12 @@ const sketch001 = startSketchOn('XY')
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -130,8 +313,12 @@ const sketch001 = startSketchOn('XY')
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -139,8 +326,12 @@ const sketch001 = startSketchOn('XY')
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -150,8 +341,12 @@ const sketch001 = startSketchOn('XY')
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -163,8 +358,12 @@ const sketch001 = startSketchOn('XY')
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",

View File

@ -64,10 +64,181 @@ const sketch001 = startSketchOn('XY')
}, },
} | } |
{ {
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: SketchSurface,
// The starting path.
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The paths 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,
@ -94,8 +265,12 @@ const sketch001 = startSketchOn('XY')
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -103,8 +278,12 @@ const sketch001 = startSketchOn('XY')
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -116,8 +295,12 @@ const sketch001 = startSketchOn('XY')
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -125,8 +308,12 @@ const sketch001 = startSketchOn('XY')
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -134,8 +321,12 @@ const sketch001 = startSketchOn('XY')
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -145,8 +336,12 @@ const sketch001 = startSketchOn('XY')
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -158,8 +353,12 @@ const sketch001 = startSketchOn('XY')
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",

View File

@ -63,10 +63,181 @@ const sketch001 = startSketchOn('XY')
}, },
} | } |
{ {
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: SketchSurface,
// The starting path.
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The paths 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,
@ -93,8 +264,12 @@ const sketch001 = startSketchOn('XY')
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -102,8 +277,12 @@ const sketch001 = startSketchOn('XY')
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -115,8 +294,12 @@ const sketch001 = startSketchOn('XY')
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -124,8 +307,12 @@ const sketch001 = startSketchOn('XY')
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -133,8 +320,12 @@ const sketch001 = startSketchOn('XY')
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -144,8 +335,12 @@ const sketch001 = startSketchOn('XY')
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -157,8 +352,12 @@ const sketch001 = startSketchOn('XY')
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",

View File

@ -99,7 +99,7 @@ const box = startSketchOn('XY')
|> startProfileAt([0, 0], %) |> startProfileAt([0, 0], %)
|> line([0, 20], %) |> line([0, 20], %)
|> line([20, 0], %) |> line([20, 0], %)
|> line([0, -20], %, 'revolveAxis') |> line([0, -20], %, $revolveAxis)
|> close(%) |> close(%)
|> extrude(20, %) |> extrude(20, %)
@ -107,7 +107,7 @@ const sketch001 = startSketchOn(box, "END")
|> circle([10, 10], 4, %) |> circle([10, 10], 4, %)
|> revolve({ |> revolve({
angle: 90, angle: 90,
axis: getOppositeEdge('revolveAxis', box) axis: getOppositeEdge(revolveAxis, box)
}, %) }, %)
``` ```
@ -156,7 +156,9 @@ const part001 = revolve({
}, },
} | } |
uuid | uuid |
string, {
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)
@ -197,10 +199,181 @@ string,
}, },
} | } |
{ {
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: SketchSurface,
// The starting path.
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The paths 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,
@ -227,8 +400,12 @@ string,
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -236,8 +413,12 @@ string,
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -249,8 +430,12 @@ string,
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -258,8 +443,12 @@ string,
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -267,8 +456,12 @@ string,
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -278,8 +471,12 @@ string,
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -291,8 +488,12 @@ string,
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",
@ -307,6 +508,28 @@ string,
{ {
// 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.
@ -348,10 +571,74 @@ string,
}, },
} | } |
{ {
// 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. // 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,
@ -378,8 +665,12 @@ string,
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -387,8 +678,12 @@ string,
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -400,8 +695,12 @@ string,
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -409,8 +708,12 @@ string,
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -418,8 +721,12 @@ string,
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -429,8 +736,12 @@ string,
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -442,8 +753,12 @@ string,
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",
@ -457,10 +772,14 @@ string,
faceId: uuid, faceId: uuid,
// The id of the geometry. // The id of the geometry.
id: uuid, id: uuid,
// The name.
name: string,
// 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",
} | } |
{ {
@ -468,10 +787,14 @@ string,
faceId: uuid, faceId: uuid,
// The id of the geometry. // The id of the geometry.
id: uuid, id: uuid,
// The name.
name: string,
// 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",
}], }],
} }

View File

@ -9,7 +9,7 @@ Returns the angle of the segment.
```js ```js
segAng(segment_name: string, sketch_group: SketchGroup) -> number segAng(segment_name: TagIdentifier, sketch_group: SketchGroup) -> number
``` ```
### Examples ### Examples
@ -18,11 +18,11 @@ segAng(segment_name: string, 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,7 +32,12 @@ const example = extrude(4, exampleSketch)
### Arguments ### Arguments
* `segment_name`: `string` (REQUIRED) * `segment_name`: `TagIdentifier` (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
{ {
@ -71,10 +76,181 @@ const example = extrude(4, exampleSketch)
}, },
} | } |
{ {
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: SketchSurface,
// The starting path.
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The paths 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,
@ -101,8 +277,12 @@ const example = extrude(4, exampleSketch)
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -110,8 +290,12 @@ const example = extrude(4, exampleSketch)
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -123,8 +307,12 @@ const example = extrude(4, exampleSketch)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -132,8 +320,12 @@ const example = extrude(4, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -141,8 +333,12 @@ const example = extrude(4, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -152,8 +348,12 @@ const example = extrude(4, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -165,8 +365,12 @@ const example = extrude(4, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",

View File

@ -9,7 +9,7 @@ Returns the segment end of x.
```js ```js
segEndX(segment_name: string, sketch_group: SketchGroup) -> number segEndX(segment_name: TagIdentifier, sketch_group: SketchGroup) -> number
``` ```
### Examples ### Examples
@ -17,9 +17,9 @@ segEndX(segment_name: string, 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,7 +30,12 @@ const example = extrude(5, exampleSketch)
### Arguments ### Arguments
* `segment_name`: `string` (REQUIRED) * `segment_name`: `TagIdentifier` (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
{ {
@ -69,10 +74,181 @@ const example = extrude(5, exampleSketch)
}, },
} | } |
{ {
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: SketchSurface,
// The starting path.
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The paths 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,
@ -99,8 +275,12 @@ const example = extrude(5, exampleSketch)
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -108,8 +288,12 @@ const example = extrude(5, exampleSketch)
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -121,8 +305,12 @@ const example = extrude(5, exampleSketch)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -130,8 +318,12 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -139,8 +331,12 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -150,8 +346,12 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -163,8 +363,12 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",

View File

@ -9,7 +9,7 @@ Returns the segment end of y.
```js ```js
segEndY(segment_name: string, sketch_group: SketchGroup) -> number segEndY(segment_name: TagIdentifier, sketch_group: SketchGroup) -> number
``` ```
### Examples ### Examples
@ -18,9 +18,9 @@ segEndY(segment_name: string, 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,7 +31,12 @@ const example = extrude(5, exampleSketch)
### Arguments ### Arguments
* `segment_name`: `string` (REQUIRED) * `segment_name`: `TagIdentifier` (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
{ {
@ -70,10 +75,181 @@ const example = extrude(5, exampleSketch)
}, },
} | } |
{ {
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: SketchSurface,
// The starting path.
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The paths 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,
@ -100,8 +276,12 @@ const example = extrude(5, exampleSketch)
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -109,8 +289,12 @@ const example = extrude(5, exampleSketch)
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -122,8 +306,12 @@ const example = extrude(5, exampleSketch)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -131,8 +319,12 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -140,8 +332,12 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -151,8 +347,12 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -164,8 +364,12 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",

View File

@ -9,7 +9,7 @@ Returns the length of the segment.
```js ```js
segLen(segment_name: string, sketch_group: SketchGroup) -> number segLen(segment_name: TagIdentifier, sketch_group: SketchGroup) -> number
``` ```
### Examples ### Examples
@ -17,12 +17,9 @@ segLen(segment_name: string, 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({ |> angledLine({ angle: -60, length: segLen(thing, %) }, %)
angle: -60,
length: segLen("thing", %)
}, %)
|> close(%) |> close(%)
const example = extrude(5, exampleSketch) const example = extrude(5, exampleSketch)
@ -32,7 +29,12 @@ const example = extrude(5, exampleSketch)
### Arguments ### Arguments
* `segment_name`: `string` (REQUIRED) * `segment_name`: `TagIdentifier` (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
{ {
@ -71,10 +73,181 @@ const example = extrude(5, exampleSketch)
}, },
} | } |
{ {
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: SketchSurface,
// The starting path.
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The paths 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,
@ -101,8 +274,12 @@ const example = extrude(5, exampleSketch)
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -110,8 +287,12 @@ const example = extrude(5, exampleSketch)
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -123,8 +304,12 @@ const example = extrude(5, exampleSketch)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -132,8 +317,12 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -141,8 +330,12 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -152,8 +345,12 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -165,8 +362,12 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",

View File

@ -36,7 +36,9 @@ shell({ faces: ['end'], thickness: 0.25 }, firstSketch)
{ {
// The faces you want removed. // The faces you want removed.
faces: ["start" | "end" | faces: ["start" | "end" |
string], {
value: string,
}],
// The thickness of the shell. // The thickness of the shell.
thickness: number, thickness: number,
} }
@ -46,6 +48,28 @@ string],
{ {
// 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.
@ -87,10 +111,74 @@ string],
}, },
} | } |
{ {
// 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. // 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,
@ -117,8 +205,12 @@ string],
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -126,8 +218,12 @@ string],
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -139,8 +235,12 @@ string],
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -148,8 +248,12 @@ string],
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -157,8 +261,12 @@ string],
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -168,8 +276,12 @@ string],
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -181,8 +293,12 @@ string],
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",
@ -196,10 +312,14 @@ string],
faceId: uuid, faceId: uuid,
// The id of the geometry. // The id of the geometry.
id: uuid, id: uuid,
// The name.
name: string,
// 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",
} | } |
{ {
@ -207,10 +327,14 @@ string],
faceId: uuid, faceId: uuid,
// The id of the geometry. // The id of the geometry.
id: uuid, id: uuid,
// The name.
name: string,
// 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",
}], }],
} }
@ -223,6 +347,28 @@ string],
{ {
// 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.
@ -264,10 +410,74 @@ string],
}, },
} | } |
{ {
// 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. // 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,
@ -294,8 +504,12 @@ string],
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -303,8 +517,12 @@ string],
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -316,8 +534,12 @@ string],
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -325,8 +547,12 @@ string],
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -334,8 +560,12 @@ string],
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -345,8 +575,12 @@ string],
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -358,8 +592,12 @@ string],
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",
@ -373,10 +611,14 @@ string],
faceId: uuid, faceId: uuid,
// The id of the geometry. // The id of the geometry.
id: uuid, id: uuid,
// The name.
name: string,
// 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",
} | } |
{ {
@ -384,10 +626,14 @@ string],
faceId: uuid, faceId: uuid,
// The id of the geometry. // The id of the geometry.
id: uuid, id: uuid,
// The name.
name: string,
// 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",
}], }],
} }

View File

@ -9,7 +9,7 @@ Start a profile at a given point.
```js ```js
startProfileAt(to: [number], sketch_surface: SketchSurface, tag?: String) -> SketchGroup startProfileAt(to: [number], sketch_surface: SketchSurface, tag?: TagDeclarator) -> SketchGroup
``` ```
### Examples ### Examples
@ -90,10 +90,238 @@ const example = extrude(5, exampleSketch)
}, },
} | } |
{ {
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: {
// The id of the plane.
id: uuid,
// Origin of the plane.
origin: {
x: number,
y: number,
z: number,
},
type: "plane",
// Type for a plane.
value: "XY" | "XZ" | "YZ" | "Custom",
// What should the 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,
@ -117,7 +345,14 @@ const example = extrude(5, exampleSketch)
}, },
} }
``` ```
* `tag`: `String` (OPTIONAL) * `tag`: `TagDeclarator` (OPTIONAL)
```js
{
end: number,
start: number,
value: string,
}
```
### Returns ### Returns
@ -159,10 +394,181 @@ const example = extrude(5, exampleSketch)
}, },
} | } |
{ {
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: SketchSurface,
// The starting path.
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The paths 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,
@ -189,8 +595,12 @@ const example = extrude(5, exampleSketch)
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -198,8 +608,12 @@ const example = extrude(5, exampleSketch)
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -211,8 +625,12 @@ const example = extrude(5, exampleSketch)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -220,8 +638,12 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -229,8 +651,12 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -240,8 +666,12 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -253,8 +683,12 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",

View File

@ -94,10 +94,181 @@ const example = extrude(5, exampleSketch)
}, },
} | } |
{ {
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: SketchSurface,
// The starting path.
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The paths 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,
@ -124,8 +295,12 @@ const example = extrude(5, exampleSketch)
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -133,8 +308,12 @@ const example = extrude(5, exampleSketch)
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -146,8 +325,12 @@ const example = extrude(5, exampleSketch)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -155,8 +338,12 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -164,8 +351,12 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -175,8 +366,12 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -188,8 +383,12 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",

View File

@ -9,7 +9,7 @@ Start a sketch on a specific plane or face.
```js ```js
startSketchOn(data: SketchData, tag?: SketchOnFaceTag) -> SketchSurface startSketchOn(data: SketchData, tag?: FaceTag) -> 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,6 +163,28 @@ 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.
@ -204,10 +226,10 @@ const a1 = startSketchOn({
}, },
} | } |
{ {
// The extrude group the face is on.
extrudeGroup: ExtrudeGroup,
// 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,
@ -234,8 +256,12 @@ const a1 = startSketchOn({
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -243,8 +269,12 @@ const a1 = startSketchOn({
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -256,8 +286,12 @@ const a1 = startSketchOn({
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -265,8 +299,12 @@ const a1 = startSketchOn({
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -274,8 +312,12 @@ const a1 = startSketchOn({
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -285,8 +327,12 @@ const a1 = startSketchOn({
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -298,8 +344,12 @@ const a1 = startSketchOn({
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",
@ -313,10 +363,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 source range. // The source range.
sourceRange: [number, number], sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane", type: "extrudePlane",
} | } |
{ {
@ -324,18 +378,24 @@ 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 source range. // The source range.
sourceRange: [number, number], sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc", type: "extrudeArc",
}], }],
} }
``` ```
* `tag`: `SketchOnFaceTag` - A tag for sketch on face. (OPTIONAL) * `tag`: `FaceTag` - A tag for a face. (OPTIONAL)
```js ```js
"start" | "end" | "start" | "end" |
string {
value: string,
}
``` ```
### Returns ### Returns
@ -374,10 +434,238 @@ string
}, },
} | } |
{ {
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: {
// The id of the plane.
id: uuid,
// Origin of the plane.
origin: {
x: number,
y: number,
z: number,
},
type: "plane",
// Type for a plane.
value: "XY" | "XZ" | "YZ" | "Custom",
// What should the 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?: String) -> SketchGroup tangentialArc(data: TangentialArcData, sketch_group: SketchGroup, tag?: TagDeclarator) -> SketchGroup
``` ```
### Examples ### Examples
@ -77,10 +77,181 @@ const example = extrude(10, exampleSketch)
}, },
} | } |
{ {
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: SketchSurface,
// The starting path.
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The paths 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,
@ -107,8 +278,12 @@ const example = extrude(10, exampleSketch)
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -116,8 +291,12 @@ const example = extrude(10, exampleSketch)
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -129,8 +308,12 @@ const example = extrude(10, exampleSketch)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -138,8 +321,12 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -147,8 +334,12 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -158,8 +349,12 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -171,15 +366,26 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",
}], }],
} }
``` ```
* `tag`: `String` (OPTIONAL) * `tag`: `TagDeclarator` (OPTIONAL)
```js
{
end: number,
start: number,
value: string,
}
```
### Returns ### Returns
@ -221,10 +427,181 @@ const example = extrude(10, exampleSketch)
}, },
} | } |
{ {
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: SketchSurface,
// The starting path.
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The paths 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,
@ -251,8 +628,12 @@ const example = extrude(10, exampleSketch)
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -260,8 +641,12 @@ const example = extrude(10, exampleSketch)
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -273,8 +658,12 @@ const example = extrude(10, exampleSketch)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -282,8 +671,12 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -291,8 +684,12 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -302,8 +699,12 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -315,8 +716,12 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",

View File

@ -9,7 +9,7 @@ Draw an arc.
```js ```js
tangentialArcTo(to: [number], sketch_group: SketchGroup, tag?: String) -> SketchGroup tangentialArcTo(to: [number], sketch_group: SketchGroup, tag?: TagDeclarator) -> SketchGroup
``` ```
### Examples ### Examples
@ -68,10 +68,181 @@ const example = extrude(10, exampleSketch)
}, },
} | } |
{ {
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: SketchSurface,
// The starting path.
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The paths 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,
@ -98,8 +269,12 @@ const example = extrude(10, exampleSketch)
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -107,8 +282,12 @@ const example = extrude(10, exampleSketch)
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -120,8 +299,12 @@ const example = extrude(10, exampleSketch)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -129,8 +312,12 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -138,8 +325,12 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -149,8 +340,12 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -162,15 +357,26 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",
}], }],
} }
``` ```
* `tag`: `String` (OPTIONAL) * `tag`: `TagDeclarator` (OPTIONAL)
```js
{
end: number,
start: number,
value: string,
}
```
### Returns ### Returns
@ -212,10 +418,181 @@ const example = extrude(10, exampleSketch)
}, },
} | } |
{ {
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: SketchSurface,
// The starting path.
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The paths 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,
@ -242,8 +619,12 @@ const example = extrude(10, exampleSketch)
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -251,8 +632,12 @@ const example = extrude(10, exampleSketch)
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -264,8 +649,12 @@ const example = extrude(10, exampleSketch)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -273,8 +662,12 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -282,8 +675,12 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -293,8 +690,12 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -306,8 +707,12 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",

View File

@ -9,7 +9,7 @@ Draw a line on the x-axis.
```js ```js
xLine(length: number, sketch_group: SketchGroup, tag?: String) -> SketchGroup xLine(length: number, sketch_group: SketchGroup, tag?: TagDeclarator) -> SketchGroup
``` ```
### Examples ### Examples
@ -71,10 +71,181 @@ const example = extrude(10, exampleSketch)
}, },
} | } |
{ {
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: SketchSurface,
// The starting path.
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The paths 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,
@ -101,8 +272,12 @@ const example = extrude(10, exampleSketch)
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -110,8 +285,12 @@ const example = extrude(10, exampleSketch)
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -123,8 +302,12 @@ const example = extrude(10, exampleSketch)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -132,8 +315,12 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -141,8 +328,12 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -152,8 +343,12 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -165,15 +360,26 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",
}], }],
} }
``` ```
* `tag`: `String` (OPTIONAL) * `tag`: `TagDeclarator` (OPTIONAL)
```js
{
end: number,
start: number,
value: string,
}
```
### Returns ### Returns
@ -215,10 +421,181 @@ const example = extrude(10, exampleSketch)
}, },
} | } |
{ {
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: SketchSurface,
// The starting path.
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The paths 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,
@ -245,8 +622,12 @@ const example = extrude(10, exampleSketch)
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -254,8 +635,12 @@ const example = extrude(10, exampleSketch)
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -267,8 +652,12 @@ const example = extrude(10, exampleSketch)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -276,8 +665,12 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -285,8 +678,12 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -296,8 +693,12 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -309,8 +710,12 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",

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?: String) -> SketchGroup xLineTo(to: number, sketch_group: SketchGroup, tag?: TagDeclarator) -> SketchGroup
``` ```
### Examples ### Examples
@ -71,10 +71,181 @@ const example = extrude(10, exampleSketch)
}, },
} | } |
{ {
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: SketchSurface,
// The starting path.
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The paths 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,
@ -101,8 +272,12 @@ const example = extrude(10, exampleSketch)
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -110,8 +285,12 @@ const example = extrude(10, exampleSketch)
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -123,8 +302,12 @@ const example = extrude(10, exampleSketch)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -132,8 +315,12 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -141,8 +328,12 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -152,8 +343,12 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -165,15 +360,26 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",
}], }],
} }
``` ```
* `tag`: `String` (OPTIONAL) * `tag`: `TagDeclarator` (OPTIONAL)
```js
{
end: number,
start: number,
value: string,
}
```
### Returns ### Returns
@ -215,10 +421,181 @@ const example = extrude(10, exampleSketch)
}, },
} | } |
{ {
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: SketchSurface,
// The starting path.
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The paths 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,
@ -245,8 +622,12 @@ const example = extrude(10, exampleSketch)
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -254,8 +635,12 @@ const example = extrude(10, exampleSketch)
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -267,8 +652,12 @@ const example = extrude(10, exampleSketch)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -276,8 +665,12 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -285,8 +678,12 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -296,8 +693,12 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -309,8 +710,12 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",

View File

@ -9,7 +9,7 @@ Draw a line on the y-axis.
```js ```js
yLine(length: number, sketch_group: SketchGroup, tag?: String) -> SketchGroup yLine(length: number, sketch_group: SketchGroup, tag?: TagDeclarator) -> SketchGroup
``` ```
### Examples ### Examples
@ -69,10 +69,181 @@ const example = extrude(10, exampleSketch)
}, },
} | } |
{ {
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: SketchSurface,
// The starting path.
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The paths 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,
@ -99,8 +270,12 @@ const example = extrude(10, exampleSketch)
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -108,8 +283,12 @@ const example = extrude(10, exampleSketch)
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -121,8 +300,12 @@ const example = extrude(10, exampleSketch)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -130,8 +313,12 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -139,8 +326,12 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -150,8 +341,12 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -163,15 +358,26 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",
}], }],
} }
``` ```
* `tag`: `String` (OPTIONAL) * `tag`: `TagDeclarator` (OPTIONAL)
```js
{
end: number,
start: number,
value: string,
}
```
### Returns ### Returns
@ -213,10 +419,181 @@ const example = extrude(10, exampleSketch)
}, },
} | } |
{ {
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: SketchSurface,
// The starting path.
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The paths 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,
@ -243,8 +620,12 @@ const example = extrude(10, exampleSketch)
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -252,8 +633,12 @@ const example = extrude(10, exampleSketch)
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -265,8 +650,12 @@ const example = extrude(10, exampleSketch)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -274,8 +663,12 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -283,8 +676,12 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -294,8 +691,12 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -307,8 +708,12 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",

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?: String) -> SketchGroup yLineTo(to: number, sketch_group: SketchGroup, tag?: TagDeclarator) -> SketchGroup
``` ```
### Examples ### Examples
@ -67,10 +67,181 @@ const example = extrude(5, exampleSketch)
}, },
} | } |
{ {
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: SketchSurface,
// The starting path.
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The paths 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,
@ -97,8 +268,12 @@ const example = extrude(5, exampleSketch)
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -106,8 +281,12 @@ const example = extrude(5, exampleSketch)
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -119,8 +298,12 @@ const example = extrude(5, exampleSketch)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -128,8 +311,12 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -137,8 +324,12 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -148,8 +339,12 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -161,15 +356,26 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",
}], }],
} }
``` ```
* `tag`: `String` (OPTIONAL) * `tag`: `TagDeclarator` (OPTIONAL)
```js
{
end: number,
start: number,
value: string,
}
```
### Returns ### Returns
@ -211,10 +417,181 @@ const example = extrude(5, exampleSketch)
}, },
} | } |
{ {
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: SketchSurface,
// The starting path.
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The paths 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,
@ -241,8 +618,12 @@ const example = extrude(5, exampleSketch)
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -250,8 +631,12 @@ const example = extrude(5, exampleSketch)
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -263,8 +648,12 @@ const example = extrude(5, exampleSketch)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -272,8 +661,12 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -281,8 +674,12 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -292,8 +689,12 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -305,8 +706,12 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",

File diff suppressed because it is too large Load Diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 42 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: 49 KiB

After

Width:  |  Height:  |  Size: 47 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 44 KiB

After

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 66 KiB

After

Width:  |  Height:  |  Size: 69 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 71 KiB

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 75 KiB

After

Width:  |  Height:  |  Size: 60 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 44 KiB

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 46 KiB

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 44 KiB

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 44 KiB

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 47 KiB

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 43 KiB

After

Width:  |  Height:  |  Size: 27 KiB

View File

@ -114,19 +114,45 @@ export const wiggleMove = async (
dist: number, dist: number,
ang: number, ang: number,
amplitude: number, amplitude: number,
freq: number freq: number,
locator?: string
) => { ) => {
const tau = Math.PI * 2 const tau = Math.PI * 2
const deg = tau / 360 const deg = tau / 360
const step = dist / steps const step = dist / steps
for (let i = 0, j = 0; i < dist; i += step, j += 1) { 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 [x1, y1] = [0, Math.sin((tau / steps) * j * freq) * amplitude]
const [x2, y2] = [ const [x2, y2] = [
Math.cos(-ang * deg) * i - Math.sin(-ang * deg) * y1, Math.cos(-ang * deg) * i - Math.sin(-ang * deg) * y1,
Math.sin(-ang * deg) * i + Math.cos(-ang * deg) * y1, Math.sin(-ang * deg) * i + Math.cos(-ang * deg) * y1,
] ]
const [xr, yr] = [x2, y2] const [xr, yr] = [x2, y2]
await page.mouse.move(x + xr, y + yr, { steps: 2 }) await page.mouse.move(x + xr, y + yr, { steps: 5 })
}
}
export const circleMove = async (
page: any,
x: number,
y: number,
steps: number,
diameter: number,
locator?: string
) => {
const tau = Math.PI * 2
const step = tau / steps
for (let i = 0; i < tau; i += step) {
if (locator) {
const isElVis = await page.locator(locator).isVisible()
if (isElVis) return
}
const [x1, y1] = [Math.cos(i) * diameter, Math.sin(i) * diameter]
const [xr, yr] = [x1, y1]
await page.mouse.move(x + xr, y + yr, { steps: 5 })
} }
} }
@ -151,11 +177,11 @@ export const getMovementUtils = (opts: any) => {
// Make it easier to click around from center ("click [from] zero zero") // Make it easier to click around from center ("click [from] zero zero")
const click00 = (x: number, y: number) => const click00 = (x: number, y: number) =>
opts.page.mouse.click(opts.center.x + x, opts.center.y + y) opts.page.mouse.click(opts.center.x + x, opts.center.y + y, { delay: 100 })
// Relative clicker, must keep state // Relative clicker, must keep state
let last = { x: 0, y: 0 } let last = { x: 0, y: 0 }
const click00r = (x?: number, y?: number) => { const click00r = async (x?: number, y?: number) => {
// reset relative coordinates when anything is undefined // reset relative coordinates when anything is undefined
if (x === undefined || y === undefined) { if (x === undefined || y === undefined) {
last.x = 0 last.x = 0
@ -163,12 +189,19 @@ export const getMovementUtils = (opts: any) => {
return return
} }
const ret = click00(last.x + x, last.y + y) 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.x += x
last.y += y last.y += y
// Returns the new absolute coordinate if you need it. // Returns the new absolute coordinate if you need it.
return ret.then(() => [last.x, last.y]) return [last.x, last.y]
} }
return { toSU, click00r } return { toSU, click00r }

View File

@ -1,6 +1,6 @@
{ {
"name": "untitled-app", "name": "untitled-app",
"version": "0.22.5", "version": "0.22.6",
"private": true, "private": true,
"dependencies": { "dependencies": {
"@codemirror/autocomplete": "^6.16.0", "@codemirror/autocomplete": "^6.16.0",
@ -12,7 +12,6 @@
"@headlessui/tailwindcss": "^0.2.0", "@headlessui/tailwindcss": "^0.2.0",
"@kittycad/lib": "^0.0.67", "@kittycad/lib": "^0.0.67",
"@lezer/javascript": "^1.4.9", "@lezer/javascript": "^1.4.9",
"@open-rpc/client-js": "^1.8.1",
"@react-hook/resize-observer": "^2.0.1", "@react-hook/resize-observer": "^2.0.1",
"@replit/codemirror-interact": "^6.3.1", "@replit/codemirror-interact": "^6.3.1",
"@tauri-apps/api": "2.0.0-beta.12", "@tauri-apps/api": "2.0.0-beta.12",
@ -37,11 +36,12 @@
"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",
"http-server": "^14.1.1", "http-server": "^14.1.1",
"json-rpc-2.0": "^1.6.0", "json-rpc-2.0": "^1.7.0",
"jszip": "^3.10.1", "jszip": "^3.10.1",
"node-fetch": "^3.3.2", "node-fetch": "^3.3.2",
"re-resizable": "^6.9.11", "re-resizable": "^6.9.11",
@ -61,7 +61,8 @@
"ua-parser-js": "^1.0.37", "ua-parser-js": "^1.0.37",
"uuid": "^9.0.1", "uuid": "^9.0.1",
"vitest": "^1.6.0", "vitest": "^1.6.0",
"vscode-jsonrpc": "^8.2.1", "vscode-languageclient": "^9.0.1",
"vscode-languageserver": "^9.0.1",
"vscode-languageserver-protocol": "^3.17.5", "vscode-languageserver-protocol": "^3.17.5",
"wasm-pack": "^0.12.1", "wasm-pack": "^0.12.1",
"web-vitals": "^3.5.2", "web-vitals": "^3.5.2",
@ -120,7 +121,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.43.1", "@playwright/test": "^1.44.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

@ -12,13 +12,13 @@ import { defineConfig, devices } from '@playwright/test'
export default defineConfig({ export default defineConfig({
testDir: './e2e/playwright', testDir: './e2e/playwright',
/* Run tests in files in parallel */ /* Run tests in files in parallel */
fullyParallel: false, fullyParallel: true,
/* Fail the build on CI if you accidentally left test.only in the source code. */ /* Fail the build on CI if you accidentally left test.only in the source code. */
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. */ /* Different amount of parallelism on CI and local. */
workers: process.env.CI ? 1 : 1, workers: process.env.CI ? 4 : 4,
/* 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. */

BIN
public/cat.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 193 KiB

139
src-tauri/Cargo.lock generated
View File

@ -344,7 +344,7 @@ checksum = "3b43422f69d8ff38f95f1b2bb76517c91589a924d1559a0e935d7c8ce0274c11"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.67", "syn 2.0.68",
] ]
[[package]] [[package]]
@ -379,7 +379,7 @@ checksum = "c6fa2087f2753a7da8cc1c0dbfcf89579dd57458e36769de5ac750b4671737ca"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.67", "syn 2.0.68",
] ]
[[package]] [[package]]
@ -405,12 +405,6 @@ 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"
@ -425,7 +419,7 @@ checksum = "3c87f3f15e7794432337fc718554eaa4dc8f04c9677a950ffe366f20a162ae42"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.67", "syn 2.0.68",
] ]
[[package]] [[package]]
@ -574,7 +568,7 @@ dependencies = [
"proc-macro-crate 3.1.0", "proc-macro-crate 3.1.0",
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.67", "syn 2.0.68",
"syn_derive", "syn_derive",
] ]
@ -883,7 +877,7 @@ dependencies = [
"heck 0.5.0", "heck 0.5.0",
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.67", "syn 2.0.68",
] ]
[[package]] [[package]]
@ -1085,7 +1079,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "13b588ba4ac1a99f7f2964d24b3d896ddc6bf847ee3855dbd4366f058cfcd331" checksum = "13b588ba4ac1a99f7f2964d24b3d896ddc6bf847ee3855dbd4366f058cfcd331"
dependencies = [ dependencies = [
"quote", "quote",
"syn 2.0.67", "syn 2.0.68",
] ]
[[package]] [[package]]
@ -1095,7 +1089,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "edb49164822f3ee45b17acd4a208cfc1251410cf0cad9a833234c9890774dd9f" checksum = "edb49164822f3ee45b17acd4a208cfc1251410cf0cad9a833234c9890774dd9f"
dependencies = [ dependencies = [
"quote", "quote",
"syn 2.0.67", "syn 2.0.68",
] ]
[[package]] [[package]]
@ -1119,7 +1113,7 @@ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"strsim 0.10.0", "strsim 0.10.0",
"syn 2.0.67", "syn 2.0.68",
] ]
[[package]] [[package]]
@ -1130,7 +1124,7 @@ checksum = "a668eda54683121533a393014d8692171709ff57a7d61f187b6e782719f8933f"
dependencies = [ dependencies = [
"darling_core", "darling_core",
"quote", "quote",
"syn 2.0.67", "syn 2.0.68",
] ]
[[package]] [[package]]
@ -1146,6 +1140,20 @@ 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"
@ -1177,7 +1185,7 @@ checksum = "4078275de501a61ceb9e759d37bdd3d7210e654dbc167ac1a3678ef4435ed57b"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.67", "syn 2.0.68",
"synstructure", "synstructure",
] ]
@ -1214,7 +1222,7 @@ dependencies = [
"regex", "regex",
"serde", "serde",
"serde_tokenstream", "serde_tokenstream",
"syn 2.0.67", "syn 2.0.68",
] ]
[[package]] [[package]]
@ -1225,7 +1233,7 @@ checksum = "67e77553c4162a157adbf834ebae5b415acbecbeafc7a74b0e886657506a7611"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.67", "syn 2.0.68",
] ]
[[package]] [[package]]
@ -1287,7 +1295,7 @@ checksum = "487585f4d0c6655fe74905e2504d8ad6908e4db67f744eb140876906c2f3175d"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.67", "syn 2.0.68",
] ]
[[package]] [[package]]
@ -1319,7 +1327,7 @@ checksum = "f2b99bf03862d7f545ebc28ddd33a665b50865f4dfd84031a393823879bd4c54"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.67", "syn 2.0.68",
] ]
[[package]] [[package]]
@ -1417,7 +1425,7 @@ checksum = "5c785274071b1b420972453b306eeca06acf4633829db4223b58a2a8c5953bc4"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.67", "syn 2.0.68",
] ]
[[package]] [[package]]
@ -1568,7 +1576,7 @@ checksum = "1a5c6c585bc94aaf2c7b51dd4c2ba22680844aba4c687be581871a6f518c5742"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.67", "syn 2.0.68",
] ]
[[package]] [[package]]
@ -1684,7 +1692,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.67", "syn 2.0.68",
] ]
[[package]] [[package]]
@ -1960,7 +1968,7 @@ dependencies = [
"proc-macro-error", "proc-macro-error",
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.67", "syn 2.0.68",
] ]
[[package]] [[package]]
@ -1988,7 +1996,7 @@ dependencies = [
"inflections", "inflections",
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.67", "syn 2.0.68",
] ]
[[package]] [[package]]
@ -2063,7 +2071,7 @@ dependencies = [
"proc-macro-error", "proc-macro-error",
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.67", "syn 2.0.68",
] ]
[[package]] [[package]]
@ -2568,7 +2576,7 @@ dependencies = [
[[package]] [[package]]
name = "kcl-lib" name = "kcl-lib"
version = "0.1.62" version = "0.1.67"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"approx", "approx",
@ -2578,7 +2586,7 @@ dependencies = [
"bson", "bson",
"chrono", "chrono",
"clap", "clap",
"dashmap", "dashmap 6.0.1",
"databake", "databake",
"derive-docs", "derive-docs",
"form_urlencoded", "form_urlencoded",
@ -2625,9 +2633,9 @@ dependencies = [
[[package]] [[package]]
name = "kittycad" name = "kittycad"
version = "0.3.5" version = "0.3.6"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "df75feef10313fa1cb15b7cecd0f579877312ba3d42bb5b8b4c1d4b1d0fcabf0" checksum = "af3de9bb4b1441f198689a9f64a8163a518377e30b348a784680e738985b95eb"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"async-trait", "async-trait",
@ -2677,9 +2685,9 @@ dependencies = [
[[package]] [[package]]
name = "lazy_static" name = "lazy_static"
version = "1.4.0" version = "1.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe"
[[package]] [[package]]
name = "libappindicator" name = "libappindicator"
@ -3358,7 +3366,7 @@ dependencies = [
"regex", "regex",
"regex-syntax 0.8.3", "regex-syntax 0.8.3",
"structmeta", "structmeta",
"syn 2.0.67", "syn 2.0.68",
] ]
[[package]] [[package]]
@ -3500,7 +3508,7 @@ dependencies = [
"phf_shared 0.11.2", "phf_shared 0.11.2",
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.67", "syn 2.0.68",
] ]
[[package]] [[package]]
@ -3568,7 +3576,7 @@ checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.67", "syn 2.0.68",
] ]
[[package]] [[package]]
@ -4413,7 +4421,7 @@ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"serde_derive_internals", "serde_derive_internals",
"syn 2.0.67", "syn 2.0.68",
] ]
[[package]] [[package]]
@ -4522,7 +4530,7 @@ checksum = "500cbc0ebeb6f46627f50f3f5811ccf6bf00643be300b4c3eabc0ef55dc5b5ba"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.67", "syn 2.0.68",
] ]
[[package]] [[package]]
@ -4533,7 +4541,7 @@ checksum = "330f01ce65a3a5fe59a60c82f3c9a024b573b8a6e875bd233fe5f934e71d54e3"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.67", "syn 2.0.68",
] ]
[[package]] [[package]]
@ -4566,7 +4574,7 @@ checksum = "6c64451ba24fc7a6a2d60fc75dd9c83c90903b19028d4eff35e88fc1e86564e9"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.67", "syn 2.0.68",
] ]
[[package]] [[package]]
@ -4587,7 +4595,7 @@ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"serde", "serde",
"syn 2.0.67", "syn 2.0.68",
] ]
[[package]] [[package]]
@ -4629,7 +4637,7 @@ dependencies = [
"darling", "darling",
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.67", "syn 2.0.68",
] ]
[[package]] [[package]]
@ -4897,7 +4905,7 @@ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"structmeta-derive", "structmeta-derive",
"syn 2.0.67", "syn 2.0.68",
] ]
[[package]] [[package]]
@ -4908,7 +4916,7 @@ checksum = "152a0b65a590ff6c3da95cabe2353ee04e6167c896b28e3b14478c2636c922fc"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.67", "syn 2.0.68",
] ]
[[package]] [[package]]
@ -4930,7 +4938,7 @@ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"rustversion", "rustversion",
"syn 2.0.67", "syn 2.0.68",
] ]
[[package]] [[package]]
@ -4963,9 +4971,9 @@ dependencies = [
[[package]] [[package]]
name = "syn" name = "syn"
version = "2.0.67" version = "2.0.68"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ff8655ed1d86f3af4ee3fd3263786bc14245ad17c4c7e85ba7187fb3ae028c90" checksum = "901fa70d88b9d6c98022e23b4136f9f3e54e4662c3bc1bd1d84a42a9a0f0c1e9"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
@ -4981,7 +4989,7 @@ dependencies = [
"proc-macro-error", "proc-macro-error",
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.67", "syn 2.0.68",
] ]
[[package]] [[package]]
@ -4998,7 +5006,7 @@ checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.67", "syn 2.0.68",
] ]
[[package]] [[package]]
@ -5215,7 +5223,7 @@ dependencies = [
"serde", "serde",
"serde_json", "serde_json",
"sha2", "sha2",
"syn 2.0.67", "syn 2.0.68",
"tauri-utils", "tauri-utils",
"thiserror", "thiserror",
"time", "time",
@ -5233,7 +5241,7 @@ dependencies = [
"heck 0.4.1", "heck 0.4.1",
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.67", "syn 2.0.68",
"tauri-codegen", "tauri-codegen",
"tauri-utils", "tauri-utils",
] ]
@ -5599,7 +5607,7 @@ checksum = "46c3384250002a6d5af4d114f2845d37b57521033f30d5c3f46c4d70e1197533"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.67", "syn 2.0.68",
] ]
[[package]] [[package]]
@ -5688,7 +5696,7 @@ checksum = "5f5ae998a069d4b5aba8ee9dad856af7d520c3699e6159b185c2acd48155d39a"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.67", "syn 2.0.68",
] ]
[[package]] [[package]]
@ -5866,7 +5874,7 @@ dependencies = [
"async-trait", "async-trait",
"auto_impl", "auto_impl",
"bytes", "bytes",
"dashmap", "dashmap 5.5.3",
"futures", "futures",
"httparse", "httparse",
"lsp-types", "lsp-types",
@ -5888,7 +5896,7 @@ checksum = "84fd902d4e0b9a4b27f2f440108dc034e1758628a9b702f8ec61ad66355422fa"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.67", "syn 2.0.68",
] ]
[[package]] [[package]]
@ -5917,7 +5925,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.67", "syn 2.0.68",
] ]
[[package]] [[package]]
@ -6041,7 +6049,7 @@ checksum = "cbdee324e50a7402416d9c25270d3df4241ed528af5d36dda18b6f219551c577"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.67", "syn 2.0.68",
"termcolor", "termcolor",
] ]
@ -6216,11 +6224,10 @@ checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a"
[[package]] [[package]]
name = "uuid" name = "uuid"
version = "1.8.0" version = "1.9.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a183cf7feeba97b4dd1c0d46788634f6221d87fa961b305bed08c851829efcc0" checksum = "5de17fd2f7da591098415cff336e12965a28061ddace43b59cb3c430179c9439"
dependencies = [ dependencies = [
"atomic",
"getrandom 0.2.14", "getrandom 0.2.14",
"serde", "serde",
"wasm-bindgen", "wasm-bindgen",
@ -6253,7 +6260,7 @@ dependencies = [
"proc-macro-error", "proc-macro-error",
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.67", "syn 2.0.68",
] ]
[[package]] [[package]]
@ -6352,7 +6359,7 @@ dependencies = [
"once_cell", "once_cell",
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.67", "syn 2.0.68",
"wasm-bindgen-shared", "wasm-bindgen-shared",
] ]
@ -6386,7 +6393,7 @@ checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.67", "syn 2.0.68",
"wasm-bindgen-backend", "wasm-bindgen-backend",
"wasm-bindgen-shared", "wasm-bindgen-shared",
] ]
@ -6527,7 +6534,7 @@ checksum = "ac1345798ecd8122468840bcdf1b95e5dc6d2206c5e4b0eafa078d061f59c9bc"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.67", "syn 2.0.68",
] ]
[[package]] [[package]]
@ -6633,7 +6640,7 @@ checksum = "f6fc35f58ecd95a9b71c4f2329b911016e6bec66b3f2e6a4aad86bd2e99e2f9b"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.67", "syn 2.0.68",
] ]
[[package]] [[package]]
@ -6644,7 +6651,7 @@ checksum = "08990546bf4edef8f431fa6326e032865f27138718c587dc21bc0265bbcb57cc"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.67", "syn 2.0.68",
] ]
[[package]] [[package]]
@ -7086,7 +7093,7 @@ checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.67", "syn 2.0.68",
] ]
[[package]] [[package]]

View File

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

View File

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

View File

@ -44,6 +44,7 @@ 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)
@ -184,11 +185,14 @@ 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 callExpression = getNodeFromPath<CallExpression>( const _node1 = 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,
@ -219,6 +223,7 @@ 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={{
@ -227,6 +232,7 @@ 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(${
@ -352,7 +358,7 @@ export async function deleteSegment({
pathToNode: PathToNode pathToNode: PathToNode
sketchDetails: SketchDetails | null sketchDetails: SketchDetails | null
}) { }) {
let modifiedAst: Program = kclManager.ast let modifiedAst: Program | Error = kclManager.ast
const dependentRanges = findUsesOfTagInPipe(modifiedAst, pathToNode) const dependentRanges = findUsesOfTagInPipe(modifiedAst, pathToNode)
const shouldContinueSegDelete = dependentRanges.length const shouldContinueSegDelete = dependentRanges.length
@ -363,6 +369,7 @@ export async function deleteSegment({
: true : true
if (!shouldContinueSegDelete) return if (!shouldContinueSegDelete) return
modifiedAst = deleteSegmentFromPipeExpression( modifiedAst = deleteSegmentFromPipeExpression(
dependentRanges, dependentRanges,
modifiedAst, modifiedAst,
@ -370,9 +377,12 @@ 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,
@ -384,13 +394,15 @@ export async function deleteSegment({
} }
if (!sketchDetails) return if (!sketchDetails) return
sceneEntitiesManager.updateAstAndRejigSketch( await sceneEntitiesManager.updateAstAndRejigSketch(
sketchDetails.sketchPathToNode, pathToNode,
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 = ({
@ -535,10 +547,13 @@ 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).node, () => getNodeFromPath<Value>(kclManager.ast, pathToNode),
[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
@ -576,12 +591,17 @@ const ConstraintSymbol = ({
}) })
} else if (isConstrained) { } else if (isConstrained) {
try { try {
const shallowPath = getNodeFromPath<CallExpression>( const parsed = parse(recast(kclManager.ast))
parse(recast(kclManager.ast)), if (trap(parsed)) return Promise.reject(parsed)
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

View File

@ -101,6 +101,7 @@ import {
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'
@ -318,8 +319,14 @@ 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 } =
this.prepareTruncatedMemoryAndAst(sketchPathToNode || [], maybeModdedAst) prepared
const { programMemory } = await executeAst({ const { programMemory } = await executeAst({
ast: truncatedAst, ast: truncatedAst,
useFakeExecutor: true, useFakeExecutor: true,
@ -331,6 +338,8 @@ 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,
@ -406,11 +415,14 @@ export class SceneEntities {
) )
let seg let seg
const callExpName = getNodeFromPath<CallExpression>( const _node1 = 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],
@ -489,12 +501,14 @@ export class SceneEntities {
} }
updateAstAndRejigSketch = async ( updateAstAndRejigSketch = async (
sketchPathToNode: PathToNode, sketchPathToNode: PathToNode,
modifiedAst: Program, modifiedAst: Program | Error,
forward: [number, number, number], forward: [number, number, number],
up: [number, number, number], up: [number, number, number],
origin: [number, number, number] origin: [number, number, number]
) => { ) => {
await kclManager.updateAst(modifiedAst, false) if (err(modifiedAst)) return modifiedAst
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({
@ -502,7 +516,7 @@ export class SceneEntities {
forward, forward,
up, up,
position: origin, position: origin,
maybeModdedAst: kclManager.ast, maybeModdedAst: nextAst.newAst,
}) })
this.setupSketchIdleCallbacks({ this.setupSketchIdleCallbacks({
forward, forward,
@ -510,6 +524,7 @@ export class SceneEntities {
position: origin, position: origin,
pathToNode: sketchPathToNode, pathToNode: sketchPathToNode,
}) })
return nextAst
} }
setUpDraftSegment = async ( setUpDraftSegment = async (
sketchPathToNode: PathToNode, sketchPathToNode: PathToNode,
@ -521,12 +536,15 @@ export class SceneEntities {
) => { ) => {
const _ast = JSON.parse(JSON.stringify(kclManager.ast)) const _ast = JSON.parse(JSON.stringify(kclManager.ast))
const _node1 = getNodeFromPath<VariableDeclaration>(
_ast,
sketchPathToNode || [],
'VariableDeclaration'
)
if (trap(_node1)) return Promise.reject(_node1)
const variableDeclarationName = const variableDeclarationName =
getNodeFromPath<VariableDeclaration>( _node1.node?.declarations?.[0]?.id?.name || ''
_ast,
sketchPathToNode || [],
'VariableDeclaration'
)?.node?.declarations?.[0]?.id?.name || ''
const sg = kclManager.programMemory.root[ const sg = kclManager.programMemory.root[
variableDeclarationName variableDeclarationName
] as SketchGroup ] as SketchGroup
@ -542,7 +560,9 @@ 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 }
@ -593,14 +613,16 @@ 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]
modifiedAst = addNewSketchLn({ const tmp = addNewSketchLn({
node: kclManager.ast, node: kclManager.ast,
programMemory: kclManager.programMemory, programMemory: kclManager.programMemory,
to: [intersection2d.x, intersection2d.y], to: [intersection2d.x, intersection2d.y],
@ -610,7 +632,10 @@ 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
@ -669,12 +694,14 @@ export class SceneEntities {
) => { ) => {
let _ast = JSON.parse(JSON.stringify(kclManager.ast)) let _ast = JSON.parse(JSON.stringify(kclManager.ast))
const _node1 = getNodeFromPath<VariableDeclaration>(
_ast,
sketchPathToNode || [],
'VariableDeclaration'
)
if (trap(_node1)) return Promise.reject(_node1)
const variableDeclarationName = const variableDeclarationName =
getNodeFromPath<VariableDeclaration>( _node1.node?.declarations?.[0]?.id?.name || ''
_ast,
sketchPathToNode || [],
'VariableDeclaration'
)?.node?.declarations?.[0]?.id?.name || ''
const tags: [string, string, string] = [ const tags: [string, string, string] = [
findUniqueName(_ast, 'rectangleSegmentA'), findUniqueName(_ast, 'rectangleSegmentA'),
@ -682,11 +709,13 @@ export class SceneEntities {
findUniqueName(_ast, 'rectangleSegmentC'), findUniqueName(_ast, 'rectangleSegmentC'),
] ]
const startSketchOn = getNodeFromPath<VariableDeclaration>( const _node2 = 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([
@ -711,11 +740,13 @@ export class SceneEntities {
const pathToNodeTwo = JSON.parse(JSON.stringify(sketchPathToNode)) const pathToNodeTwo = JSON.parse(JSON.stringify(sketchPathToNode))
pathToNodeTwo[1][0] = 0 pathToNodeTwo[1][0] = 0
const sketchInit = getNodeFromPath<VariableDeclaration>( const _node = 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]
@ -757,11 +788,13 @@ 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 sketchInit = getNodeFromPath<VariableDeclaration>( const _node = 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])
@ -857,6 +890,7 @@ 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') {
@ -874,6 +908,8 @@ 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({
@ -982,17 +1018,22 @@ 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 | {
pathToNode: PathToNode modifiedAst: Program
} pathToNode: PathToNode
}
| Error
if (group.name === PROFILE_START) { if (group.name === PROFILE_START) {
modded = updateStartProfileAtArgs({ modded = updateStartProfileAtArgs({
node: modifiedAst, node: modifiedAst,
@ -1010,14 +1051,18 @@ 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 } =
draftInfo info
? 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
@ -1544,11 +1589,14 @@ export class SceneEntities {
]) ])
if (parent?.userData?.pathToNode) { if (parent?.userData?.pathToNode) {
const updatedAst = parse(recast(kclManager.ast)) const updatedAst = parse(recast(kclManager.ast))
const node = getNodeFromPath<CallExpression>( if (trap(updatedAst)) return
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)
@ -1663,20 +1711,23 @@ function prepareTruncatedMemoryAndAst(
ast: Program, ast: Program,
programMemory: ProgramMemory, programMemory: ProgramMemory,
draftSegment?: DraftSegment draftSegment?: DraftSegment
): { ):
truncatedAst: Program | {
programMemoryOverride: ProgramMemory truncatedAst: Program
variableDeclarationName: string programMemoryOverride: ProgramMemory
} { variableDeclarationName: string
}
| Error {
const bodyIndex = Number(sketchPathToNode?.[1]?.[0]) || 0 const bodyIndex = Number(sketchPathToNode?.[1]?.[0]) || 0
const _ast = JSON.parse(JSON.stringify(ast)) const _ast = JSON.parse(JSON.stringify(ast))
const variableDeclarationName = const _node = getNodeFromPath<VariableDeclaration>(
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]
@ -1704,6 +1755,8 @@ 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
@ -1727,7 +1780,34 @@ function prepareTruncatedMemoryAndAst(
..._ast, ..._ast,
body: [JSON.parse(JSON.stringify(_ast.body[bodyIndex]))], body: [JSON.parse(JSON.stringify(_ast.body[bodyIndex]))],
} }
const programMemoryOverride: ProgramMemory = programMemoryInit() const programMemoryOverride = 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] = JSON.parse(JSON.stringify(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') {
@ -1768,12 +1848,14 @@ export function sketchGroupFromPathToNode({
pathToNode: PathToNode pathToNode: PathToNode
ast: Program ast: Program
programMemory: ProgramMemory programMemory: ProgramMemory
}): SketchGroup { }): SketchGroup | Error {
const varDec = getNodeFromPath<VariableDeclarator>( const _varDec = getNodeFromPath<VariableDeclarator>(
kclManager.ast, kclManager.ast,
pathToNode, pathToNode,
'VariableDeclarator' 'VariableDeclarator'
).node )
if (err(_varDec)) return _varDec
const varDec = _varDec.node
const result = programMemory.root[varDec?.id?.name || ''] const result = programMemory.root[varDec?.id?.name || '']
if (result?.type === 'ExtrudeGroup') { if (result?.type === 'ExtrudeGroup') {
return result.sketchGroup return result.sketchGroup
@ -1808,13 +1890,15 @@ 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 { ): Quaternion | Error {
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?.on.zAxis || sketchNormalBackUp const zAxis = sketchGroup?.on.zAxis || sketchNormalBackUp
return getQuaternionFromZAxis(massageFormats(zAxis)) return getQuaternionFromZAxis(massageFormats(zAxis))
} }
export async function getSketchOrientationDetails( export async function getSketchOrientationDetails(
@ -1828,6 +1912,8 @@ 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?.on.zAxis
return { return {
@ -1845,11 +1931,12 @@ export async function getSketchOrientationDetails(
}, },
} }
} }
if (sketchGroup.on.type === 'face') { if (sketchGroup.on.type === 'face') {
const faceInfo = await getFaceDetails(sketchGroup.on.id) const faceInfo = await getFaceDetails(sketchGroup.on.id)
if (!faceInfo?.origin || !faceInfo?.z_axis || !faceInfo?.y_axis) if (!faceInfo?.origin || !faceInfo?.z_axis || !faceInfo?.y_axis)
throw new Error('faceInfo') return Promise.reject('face info')
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),
@ -1866,7 +1953,7 @@ export async function getSketchOrientationDetails(
}, },
} }
} }
throw new Error( return Promise.reject(
'sketchGroup.on.type not recognized, has a new type been added?' 'sketchGroup.on.type not recognized, has a new type been added?'
) )
} }

View File

@ -2,6 +2,7 @@ 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()
@ -10,9 +11,12 @@ 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="">

View File

@ -11,6 +11,7 @@ import { engineCommandManager, kclManager } from 'lib/singletons'
import { useKclContext } from 'lang/KclProvider' import { useKclContext } from 'lang/KclProvider'
import { useModelingContext } from 'hooks/useModelingContext' import { useModelingContext } from 'hooks/useModelingContext'
import { executeAst } from 'useStore' import { executeAst } from 'useStore'
import { trap } from 'lib/trap'
export const AvailableVars = ({ export const AvailableVars = ({
onVarClick, onVarClick,
@ -141,6 +142,7 @@ export function useCalc({
try { try {
const code = `const __result__ = ${value}` const code = `const __result__ = ${value}`
const ast = parse(code) const ast = parse(code)
if (trap(ast)) return
const _programMem: any = { root: {}, return: null } const _programMem: any = { root: {}, return: null }
availableVarInfo.variables.forEach(({ key, value }) => { availableVarInfo.variables.forEach(({ key, value }) => {
_programMem.root[key] = { type: 'userVal', value, __meta: [] } _programMem.root[key] = { type: 'userVal', value, __meta: [] }

View File

@ -24,7 +24,7 @@ export const CommandBar = () => {
}, [pathname]) }, [pathname])
// Hook up keyboard shortcuts // Hook up keyboard shortcuts
useHotkeyWrapper(['mod+k', 'mod+/'], () => { useHotkeyWrapper(['mod+k', 'ctrl+c'], () => {
if (commandBarState.context.commands.length === 0) return if (commandBarState.context.commands.length === 0) return
if (commandBarState.matches('Closed')) { if (commandBarState.matches('Closed')) {
commandBarSend({ type: 'Open' }) commandBarSend({ type: 'Open' })

View File

@ -1,8 +1,13 @@
import { LanguageServerClient } from 'editor/plugins/lsp' import { LanguageServerClient } from 'editor/plugins/lsp'
import type * as LSP from 'vscode-languageserver-protocol' import type * as LSP from 'vscode-languageserver-protocol'
import React, { createContext, useMemo, useEffect, useContext } from 'react' import React, {
import { FromServer, IntoServer } from 'editor/plugins/lsp/codec' createContext,
import Client from '../editor/plugins/lsp/client' useMemo,
useEffect,
useContext,
useState,
} from 'react'
import LspServerClient from '../editor/plugins/lsp/client'
import { TEST, VITE_KC_API_BASE_URL } from 'env' import { TEST, VITE_KC_API_BASE_URL } from 'env'
import kclLanguage from 'editor/plugins/lsp/kcl/language' import kclLanguage from 'editor/plugins/lsp/kcl/language'
import { copilotPlugin } from 'editor/plugins/lsp/copilot' import { copilotPlugin } from 'editor/plugins/lsp/copilot'
@ -13,9 +18,7 @@ import { LanguageSupport } from '@codemirror/language'
import { useNavigate } from 'react-router-dom' import { useNavigate } from 'react-router-dom'
import { paths } from 'lib/paths' import { paths } from 'lib/paths'
import { FileEntry } from 'lib/types' import { FileEntry } from 'lib/types'
import Worker from 'editor/plugins/lsp/worker.ts?worker'
import { import {
LspWorkerEventType,
KclWorkerOptions, KclWorkerOptions,
CopilotWorkerOptions, CopilotWorkerOptions,
LspWorker, LspWorker,
@ -76,6 +79,8 @@ export const LspProvider = ({ children }: { children: React.ReactNode }) => {
setIsCopilotLspServerReady: s.setIsCopilotLspServerReady, setIsCopilotLspServerReady: s.setIsCopilotLspServerReady,
isStreamReady: s.isStreamReady, isStreamReady: s.isStreamReady,
})) }))
const [isLspReady, setIsLspReady] = useState(false)
const [isCopilotReady, setIsCopilotReady] = useState(false)
const { const {
auth, auth,
@ -98,29 +103,23 @@ export const LspProvider = ({ children }: { children: React.ReactNode }) => {
return { lspClient: null } return { lspClient: null }
} }
const lspWorker = new Worker({ name: 'kcl' }) const options: KclWorkerOptions = {
const initEvent: KclWorkerOptions = {
wasmUrl: wasmUrl(),
token: token, token: token,
baseUnit: defaultUnit.current, baseUnit: defaultUnit.current,
apiBaseUrl: VITE_KC_API_BASE_URL, apiBaseUrl: VITE_KC_API_BASE_URL,
callback: () => {
setIsLspReady(true)
},
wasmUrl: wasmUrl(),
} }
lspWorker.postMessage({
worker: LspWorker.Kcl, const lsp = new LspServerClient({ worker: LspWorker.Kcl, options })
eventType: LspWorkerEventType.Init, lsp.startServer()
eventData: initEvent,
const lspClient = new LanguageServerClient({
client: lsp,
name: LspWorker.Kcl,
}) })
lspWorker.onmessage = function (e) {
fromServer.add(e.data)
}
const intoServer: IntoServer = new IntoServer(LspWorker.Kcl, lspWorker)
const fromServer: FromServer = FromServer.create()
const client = new Client(fromServer, intoServer)
setIsKclLspServerReady(true)
const lspClient = new LanguageServerClient({ client, name: LspWorker.Kcl })
return { lspClient } return { lspClient }
}, [ }, [
// We need a token for authenticating the server. // We need a token for authenticating the server.
@ -173,29 +172,19 @@ export const LspProvider = ({ children }: { children: React.ReactNode }) => {
return { lspClient: null } return { lspClient: null }
} }
const lspWorker = new Worker({ name: 'copilot' }) const options: CopilotWorkerOptions = {
const initEvent: CopilotWorkerOptions = {
wasmUrl: wasmUrl(),
token: token, token: token,
apiBaseUrl: VITE_KC_API_BASE_URL, apiBaseUrl: VITE_KC_API_BASE_URL,
callback: () => {
setIsCopilotReady(true)
},
wasmUrl: wasmUrl(),
} }
lspWorker.postMessage({ const lsp = new LspServerClient({ worker: LspWorker.Copilot, options })
worker: LspWorker.Copilot, lsp.startServer()
eventType: LspWorkerEventType.Init,
eventData: initEvent,
})
lspWorker.onmessage = function (e) {
fromServer.add(e.data)
}
const intoServer: IntoServer = new IntoServer(LspWorker.Copilot, lspWorker)
const fromServer: FromServer = FromServer.create()
const client = new Client(fromServer, intoServer)
setIsCopilotLspServerReady(true)
const lspClient = new LanguageServerClient({ const lspClient = new LanguageServerClient({
client, client: lsp,
name: LspWorker.Copilot, name: LspWorker.Copilot,
}) })
return { lspClient } return { lspClient }
@ -230,6 +219,13 @@ export const LspProvider = ({ children }: { children: React.ReactNode }) => {
lspClients.push(copilotLspClient) lspClients.push(copilotLspClient)
} }
useEffect(() => {
setIsKclLspServerReady(isLspReady)
}, [isLspReady])
useEffect(() => {
setIsCopilotLspServerReady(isCopilotReady)
}, [isCopilotReady])
const onProjectClose = ( const onProjectClose = (
file: FileEntry | null, file: FileEntry | null,
projectPath: string | null, projectPath: string | null,

View File

@ -29,7 +29,6 @@ import {
applyConstraintAngleBetween, applyConstraintAngleBetween,
} from './Toolbar/SetAngleBetween' } from './Toolbar/SetAngleBetween'
import { applyConstraintAngleLength } from './Toolbar/setAngleLength' import { applyConstraintAngleLength } from './Toolbar/setAngleLength'
import { pathMapToSelections } from 'lang/util'
import { useStore } from 'useStore' import { useStore } from 'useStore'
import { import {
Selections, Selections,
@ -37,6 +36,7 @@ import {
handleSelectionBatch, handleSelectionBatch,
isSelectionLastLine, isSelectionLastLine,
isSketchPipe, isSketchPipe,
updateSelections,
} from 'lib/selections' } from 'lib/selections'
import { applyConstraintIntersect } from './Toolbar/Intersect' import { applyConstraintIntersect } from './Toolbar/Intersect'
import { applyConstraintAbsDistance } from './Toolbar/SetAbsDistance' import { applyConstraintAbsDistance } from './Toolbar/SetAbsDistance'
@ -77,6 +77,7 @@ import { letEngineAnimateAndSyncCamAfter } from 'clientSideScene/CameraControls'
import { getVarNameModal } from 'hooks/useToolbarGuards' import { getVarNameModal } from 'hooks/useToolbarGuards'
import useHotkeyWrapper from 'lib/hotkeyWrapper' import useHotkeyWrapper from 'lib/hotkeyWrapper'
import { uuidv4 } from 'lib/utils' import { uuidv4 } from 'lib/utils'
import { err, trap } from 'lib/trap'
type MachineContext<T extends AnyStateMachine> = { type MachineContext<T extends AnyStateMachine> = {
state: StateFrom<T> state: StateFrom<T>
@ -459,12 +460,17 @@ export const ModelingMachineProvider = ({
return canExtrudeSelection(selectionRanges) return canExtrudeSelection(selectionRanges)
}, },
'Sketch is empty': ({ sketchDetails }) => 'Sketch is empty': ({ sketchDetails }) => {
getNodeFromPath<VariableDeclaration>( const node = getNodeFromPath<VariableDeclaration>(
kclManager.ast, kclManager.ast,
sketchDetails?.sketchPathToNode || [], sketchDetails?.sketchPathToNode || [],
'VariableDeclaration' 'VariableDeclaration'
)?.node?.declarations?.[0]?.init.type !== 'PipeExpression', )
// This should not be returning false, and it should be caught
// but we need to simulate old behavior to move on.
if (err(node)) return false
return node.node?.declarations?.[0]?.init.type !== 'PipeExpression'
},
'Selection is on face': ({ selectionRanges }, { data }) => { 'Selection is on face': ({ selectionRanges }, { data }) => {
if (data?.forceNewSketch) return false if (data?.forceNewSketch) return false
if (!isSingleCursorInPipe(selectionRanges, kclManager.ast)) if (!isSingleCursorInPipe(selectionRanges, kclManager.ast))
@ -507,14 +513,16 @@ export const ModelingMachineProvider = ({
}, },
'animate-to-face': async (_, { data }) => { 'animate-to-face': async (_, { data }) => {
if (data.type === 'extrudeFace') { if (data.type === 'extrudeFace') {
const { modifiedAst, pathToNode: pathToNewSketchNode } = const sketched = sketchOnExtrudedFace(
sketchOnExtrudedFace( kclManager.ast,
kclManager.ast, data.sketchPathToNode,
data.sketchPathToNode, data.extrudePathToNode,
data.extrudePathToNode, kclManager.programMemory,
kclManager.programMemory, data.cap
data.cap )
) if (trap(sketched)) return Promise.reject(sketched)
const { modifiedAst, pathToNode: pathToNewSketchNode } = sketched
await kclManager.executeAstMock(modifiedAst) await kclManager.executeAstMock(modifiedAst)
await letEngineAnimateAndSyncCamAfter( await letEngineAnimateAndSyncCamAfter(
@ -535,10 +543,12 @@ export const ModelingMachineProvider = ({
) )
await kclManager.updateAst(modifiedAst, false) await kclManager.updateAst(modifiedAst, false)
sceneInfra.camControls.syncDirection = 'clientToEngine' sceneInfra.camControls.syncDirection = 'clientToEngine'
await letEngineAnimateAndSyncCamAfter( await letEngineAnimateAndSyncCamAfter(
engineCommandManager, engineCommandManager,
data.planeId data.planeId
) )
return { return {
sketchPathToNode: pathToNode, sketchPathToNode: pathToNode,
zAxis: data.zAxis, zAxis: data.zAxis,
@ -576,25 +586,29 @@ export const ModelingMachineProvider = ({
selectionRanges, selectionRanges,
}) })
const _modifiedAst = parse(recast(modifiedAst)) const _modifiedAst = parse(recast(modifiedAst))
if (!sketchDetails) throw new Error('No sketch details') if (!sketchDetails)
return Promise.reject(new Error('No sketch details'))
const updatedPathToNode = updatePathToNodeFromMap( const updatedPathToNode = updatePathToNodeFromMap(
sketchDetails.sketchPathToNode, sketchDetails.sketchPathToNode,
pathToNodeMap pathToNodeMap
) )
await sceneEntitiesManager.updateAstAndRejigSketch( const updatedAst = await sceneEntitiesManager.updateAstAndRejigSketch(
updatedPathToNode, updatedPathToNode,
_modifiedAst, _modifiedAst,
sketchDetails.zAxis, sketchDetails.zAxis,
sketchDetails.yAxis, sketchDetails.yAxis,
sketchDetails.origin sketchDetails.origin
) )
if (err(updatedAst)) return Promise.reject(updatedAst)
const selection = updateSelections(
pathToNodeMap,
selectionRanges,
updatedAst.newAst
)
if (err(selection)) return Promise.reject(selection)
return { return {
selectionType: 'completeSelection', selectionType: 'completeSelection',
selection: pathMapToSelections( selection,
kclManager.ast,
selectionRanges,
pathToNodeMap
),
updatedPathToNode, updatedPathToNode,
} }
}, },
@ -608,25 +622,29 @@ export const ModelingMachineProvider = ({
selectionRanges, selectionRanges,
}) })
const _modifiedAst = parse(recast(modifiedAst)) const _modifiedAst = parse(recast(modifiedAst))
if (!sketchDetails) throw new Error('No sketch details') if (!sketchDetails)
return Promise.reject(new Error('No sketch details'))
const updatedPathToNode = updatePathToNodeFromMap( const updatedPathToNode = updatePathToNodeFromMap(
sketchDetails.sketchPathToNode, sketchDetails.sketchPathToNode,
pathToNodeMap pathToNodeMap
) )
await sceneEntitiesManager.updateAstAndRejigSketch( const updatedAst = await sceneEntitiesManager.updateAstAndRejigSketch(
updatedPathToNode, updatedPathToNode,
_modifiedAst, _modifiedAst,
sketchDetails.zAxis, sketchDetails.zAxis,
sketchDetails.yAxis, sketchDetails.yAxis,
sketchDetails.origin sketchDetails.origin
) )
if (err(updatedAst)) return Promise.reject(updatedAst)
const selection = updateSelections(
pathToNodeMap,
selectionRanges,
updatedAst.newAst
)
if (err(selection)) return Promise.reject(selection)
return { return {
selectionType: 'completeSelection', selectionType: 'completeSelection',
selection: pathMapToSelections( selection,
kclManager.ast,
selectionRanges,
pathToNodeMap
),
updatedPathToNode, updatedPathToNode,
} }
}, },
@ -634,9 +652,11 @@ export const ModelingMachineProvider = ({
selectionRanges, selectionRanges,
sketchDetails, sketchDetails,
}): Promise<SetSelections> => { }): Promise<SetSelections> => {
const { modifiedAst, pathToNodeMap } = await (angleBetweenInfo({ const info = angleBetweenInfo({
selectionRanges, selectionRanges,
}).enabled })
if (err(info)) return Promise.reject(info)
const { modifiedAst, pathToNodeMap } = await (info.enabled
? applyConstraintAngleBetween({ ? applyConstraintAngleBetween({
selectionRanges, selectionRanges,
}) })
@ -645,25 +665,31 @@ export const ModelingMachineProvider = ({
angleOrLength: 'setAngle', angleOrLength: 'setAngle',
})) }))
const _modifiedAst = parse(recast(modifiedAst)) const _modifiedAst = parse(recast(modifiedAst))
if (!sketchDetails) throw new Error('No sketch details') if (err(_modifiedAst)) return Promise.reject(_modifiedAst)
if (!sketchDetails)
return Promise.reject(new Error('No sketch details'))
const updatedPathToNode = updatePathToNodeFromMap( const updatedPathToNode = updatePathToNodeFromMap(
sketchDetails.sketchPathToNode, sketchDetails.sketchPathToNode,
pathToNodeMap pathToNodeMap
) )
await sceneEntitiesManager.updateAstAndRejigSketch( const updatedAst = await sceneEntitiesManager.updateAstAndRejigSketch(
updatedPathToNode, updatedPathToNode,
_modifiedAst, _modifiedAst,
sketchDetails.zAxis, sketchDetails.zAxis,
sketchDetails.yAxis, sketchDetails.yAxis,
sketchDetails.origin sketchDetails.origin
) )
if (err(updatedAst)) return Promise.reject(updatedAst)
const selection = updateSelections(
pathToNodeMap,
selectionRanges,
updatedAst.newAst
)
if (err(selection)) return Promise.reject(selection)
return { return {
selectionType: 'completeSelection', selectionType: 'completeSelection',
selection: pathMapToSelections( selection,
_modifiedAst,
selectionRanges,
pathToNodeMap
),
updatedPathToNode, updatedPathToNode,
} }
}, },
@ -674,25 +700,29 @@ export const ModelingMachineProvider = ({
const { modifiedAst, pathToNodeMap } = const { modifiedAst, pathToNodeMap } =
await applyConstraintAngleLength({ selectionRanges }) await applyConstraintAngleLength({ selectionRanges })
const _modifiedAst = parse(recast(modifiedAst)) const _modifiedAst = parse(recast(modifiedAst))
if (!sketchDetails) throw new Error('No sketch details') if (!sketchDetails)
return Promise.reject(new Error('No sketch details'))
const updatedPathToNode = updatePathToNodeFromMap( const updatedPathToNode = updatePathToNodeFromMap(
sketchDetails.sketchPathToNode, sketchDetails.sketchPathToNode,
pathToNodeMap pathToNodeMap
) )
await sceneEntitiesManager.updateAstAndRejigSketch( const updatedAst = await sceneEntitiesManager.updateAstAndRejigSketch(
updatedPathToNode, updatedPathToNode,
_modifiedAst, _modifiedAst,
sketchDetails.zAxis, sketchDetails.zAxis,
sketchDetails.yAxis, sketchDetails.yAxis,
sketchDetails.origin sketchDetails.origin
) )
if (err(updatedAst)) return Promise.reject(updatedAst)
const selection = updateSelections(
pathToNodeMap,
selectionRanges,
updatedAst.newAst
)
if (err(selection)) return Promise.reject(selection)
return { return {
selectionType: 'completeSelection', selectionType: 'completeSelection',
selection: pathMapToSelections( selection,
kclManager.ast,
selectionRanges,
pathToNodeMap
),
updatedPathToNode, updatedPathToNode,
} }
}, },
@ -706,25 +736,29 @@ export const ModelingMachineProvider = ({
} }
) )
const _modifiedAst = parse(recast(modifiedAst)) const _modifiedAst = parse(recast(modifiedAst))
if (!sketchDetails) throw new Error('No sketch details') if (!sketchDetails)
return Promise.reject(new Error('No sketch details'))
const updatedPathToNode = updatePathToNodeFromMap( const updatedPathToNode = updatePathToNodeFromMap(
sketchDetails.sketchPathToNode, sketchDetails.sketchPathToNode,
pathToNodeMap pathToNodeMap
) )
await sceneEntitiesManager.updateAstAndRejigSketch( const updatedAst = await sceneEntitiesManager.updateAstAndRejigSketch(
updatedPathToNode, updatedPathToNode,
_modifiedAst, _modifiedAst,
sketchDetails.zAxis, sketchDetails.zAxis,
sketchDetails.yAxis, sketchDetails.yAxis,
sketchDetails.origin sketchDetails.origin
) )
if (err(updatedAst)) return Promise.reject(updatedAst)
const selection = updateSelections(
pathToNodeMap,
selectionRanges,
updatedAst.newAst
)
if (err(selection)) return Promise.reject(selection)
return { return {
selectionType: 'completeSelection', selectionType: 'completeSelection',
selection: pathMapToSelections( selection,
kclManager.ast,
selectionRanges,
pathToNodeMap
),
updatedPathToNode, updatedPathToNode,
} }
}, },
@ -738,25 +772,29 @@ export const ModelingMachineProvider = ({
selectionRanges, selectionRanges,
}) })
const _modifiedAst = parse(recast(modifiedAst)) const _modifiedAst = parse(recast(modifiedAst))
if (!sketchDetails) throw new Error('No sketch details') if (!sketchDetails)
return Promise.reject(new Error('No sketch details'))
const updatedPathToNode = updatePathToNodeFromMap( const updatedPathToNode = updatePathToNodeFromMap(
sketchDetails.sketchPathToNode, sketchDetails.sketchPathToNode,
pathToNodeMap pathToNodeMap
) )
await sceneEntitiesManager.updateAstAndRejigSketch( const updatedAst = await sceneEntitiesManager.updateAstAndRejigSketch(
updatedPathToNode, updatedPathToNode,
_modifiedAst, _modifiedAst,
sketchDetails.zAxis, sketchDetails.zAxis,
sketchDetails.yAxis, sketchDetails.yAxis,
sketchDetails.origin sketchDetails.origin
) )
if (err(updatedAst)) return Promise.reject(updatedAst)
const selection = updateSelections(
pathToNodeMap,
selectionRanges,
updatedAst.newAst
)
if (err(selection)) return Promise.reject(selection)
return { return {
selectionType: 'completeSelection', selectionType: 'completeSelection',
selection: pathMapToSelections( selection,
kclManager.ast,
selectionRanges,
pathToNodeMap
),
updatedPathToNode, updatedPathToNode,
} }
}, },
@ -770,48 +808,77 @@ export const ModelingMachineProvider = ({
selectionRanges, selectionRanges,
}) })
const _modifiedAst = parse(recast(modifiedAst)) const _modifiedAst = parse(recast(modifiedAst))
if (!sketchDetails) throw new Error('No sketch details') if (!sketchDetails)
return Promise.reject(new Error('No sketch details'))
const updatedPathToNode = updatePathToNodeFromMap( const updatedPathToNode = updatePathToNodeFromMap(
sketchDetails.sketchPathToNode, sketchDetails.sketchPathToNode,
pathToNodeMap pathToNodeMap
) )
await sceneEntitiesManager.updateAstAndRejigSketch( const updatedAst = await sceneEntitiesManager.updateAstAndRejigSketch(
updatedPathToNode, updatedPathToNode,
_modifiedAst, _modifiedAst,
sketchDetails.zAxis, sketchDetails.zAxis,
sketchDetails.yAxis, sketchDetails.yAxis,
sketchDetails.origin sketchDetails.origin
) )
if (err(updatedAst)) return Promise.reject(updatedAst)
const selection = updateSelections(
pathToNodeMap,
selectionRanges,
updatedAst.newAst
)
if (err(selection)) return Promise.reject(selection)
return { return {
selectionType: 'completeSelection', selectionType: 'completeSelection',
selection: pathMapToSelections( selection,
kclManager.ast,
selectionRanges,
pathToNodeMap
),
updatedPathToNode, updatedPathToNode,
} }
}, },
'Get convert to variable info': async ({ sketchDetails }, { data }) => { 'Get convert to variable info': async (
if (!sketchDetails) return [] { sketchDetails, selectionRanges },
{ data }
): Promise<SetSelections> => {
if (!sketchDetails)
return Promise.reject(new Error('No sketch details'))
const { variableName } = await getVarNameModal({ const { variableName } = await getVarNameModal({
valueName: data.variableName || 'var', valueName: data.variableName || 'var',
}) })
let parsed = parse(recast(kclManager.ast))
if (trap(parsed)) return Promise.reject(parsed)
parsed = parsed as Program
const { modifiedAst: _modifiedAst, pathToReplacedNode } = const { modifiedAst: _modifiedAst, pathToReplacedNode } =
moveValueIntoNewVariablePath( moveValueIntoNewVariablePath(
parse(recast(kclManager.ast)), parsed,
kclManager.programMemory, kclManager.programMemory,
data.pathToNode, data.pathToNode,
variableName variableName
) )
await sceneEntitiesManager.updateAstAndRejigSketch( parsed = parse(recast(_modifiedAst))
if (trap(parsed)) return Promise.reject(parsed)
parsed = parsed as Program
if (!pathToReplacedNode)
return Promise.reject(new Error('No path to replaced node'))
const updatedAst = await sceneEntitiesManager.updateAstAndRejigSketch(
pathToReplacedNode || [], pathToReplacedNode || [],
parse(recast(_modifiedAst)), parsed,
sketchDetails.zAxis, sketchDetails.zAxis,
sketchDetails.yAxis, sketchDetails.yAxis,
sketchDetails.origin sketchDetails.origin
) )
return pathToReplacedNode || sketchDetails.sketchPathToNode if (err(updatedAst)) return Promise.reject(updatedAst)
const selection = updateSelections(
{ 0: pathToReplacedNode },
selectionRanges,
updatedAst.newAst
)
if (err(selection)) return Promise.reject(selection)
return {
selectionType: 'completeSelection',
selection,
updatedPathToNode: pathToReplacedNode,
}
}, },
}, },
devTools: true, devTools: true,

View File

@ -43,23 +43,23 @@ describe('processMemory', () => {
theExtrude: [ theExtrude: [
{ {
type: 'extrudePlane', type: 'extrudePlane',
name: '', tag: null,
id: expect.any(String), id: expect.any(String),
faceId: expect.any(String), faceId: expect.any(String),
sourceRange: [170, 194], sourceRange: [170, 194],
}, },
{ {
type: 'extrudePlane', type: 'extrudePlane',
name: '', tag: null,
id: expect.any(String), id: expect.any(String),
faceId: expect.any(String), faceId: expect.any(String),
sourceRange: [202, 230], sourceRange: [202, 230],
}, },
], ],
theSketch: [ theSketch: [
{ type: 'ToPoint', to: [-3.35, 0.17], from: [0, 0], name: '' }, { type: 'ToPoint', to: [-3.35, 0.17], from: [0, 0], tag: null },
{ type: 'ToPoint', to: [0.98, 5.16], from: [-3.35, 0.17], name: '' }, { type: 'ToPoint', to: [0.98, 5.16], from: [-3.35, 0.17], tag: null },
{ type: 'ToPoint', to: [2.15, 4.32], from: [0.98, 5.16], name: '' }, { type: 'ToPoint', to: [2.15, 4.32], from: [0.98, 5.16], tag: null },
], ],
}) })
}) })

View File

@ -1,10 +1,11 @@
import toast from 'react-hot-toast'
import ReactJson from 'react-json-view' import ReactJson from 'react-json-view'
import { useMemo } from 'react' import { useMemo } from 'react'
import { ProgramMemory, Path, ExtrudeSurface } from 'lang/wasm' import { ProgramMemory, Path, ExtrudeSurface } from 'lang/wasm'
import { useKclContext } from 'lang/KclProvider' import { useKclContext } from 'lang/KclProvider'
import { useResolvedTheme } from 'hooks/useResolvedTheme' import { useResolvedTheme } from 'hooks/useResolvedTheme'
import { ActionButton } from 'components/ActionButton' import { ActionButton } from 'components/ActionButton'
import toast from 'react-hot-toast' import { trap } from 'lib/trap'
import Tooltip from 'components/Tooltip' import Tooltip from 'components/Tooltip'
import { useModelingContext } from 'hooks/useModelingContext' import { useModelingContext } from 'hooks/useModelingContext'
@ -13,12 +14,12 @@ export const MemoryPaneMenu = () => {
function copyProgramMemoryToClipboard() { function copyProgramMemoryToClipboard() {
if (globalThis && 'navigator' in globalThis) { if (globalThis && 'navigator' in globalThis) {
try { navigator.clipboard
navigator.clipboard.writeText(JSON.stringify(programMemory)) .writeText(JSON.stringify(programMemory))
toast.success('Program memory copied to clipboard') .then(() => toast.success('Program memory copied to clipboard'))
} catch (e) { .catch((e) =>
toast.error('Failed to copy program memory to clipboard') trap(new Error('Failed to copy program memory to clipboard'))
} )
} }
} }

View File

@ -127,6 +127,7 @@ export const Stream = ({ className = '' }: { className?: string }) => {
return ( return (
<div <div
className="absolute inset-0 z-0" className="absolute inset-0 z-0"
id="stream"
data-testid="stream" data-testid="stream"
onMouseUp={handleMouseUp} onMouseUp={handleMouseUp}
onMouseDown={handleMouseDown} onMouseDown={handleMouseDown}

View File

@ -10,28 +10,46 @@ import {
transformSecondarySketchLinesTagFirst, transformSecondarySketchLinesTagFirst,
getTransformInfos, getTransformInfos,
PathToNodeMap, PathToNodeMap,
TransformInfo,
} from '../../lang/std/sketchcombos' } from '../../lang/std/sketchcombos'
import { kclManager } from 'lib/singletons' import { kclManager } from 'lib/singletons'
import { err } from 'lib/trap'
export function equalAngleInfo({ export function equalAngleInfo({
selectionRanges, selectionRanges,
}: { }: {
selectionRanges: Selections selectionRanges: Selections
}) { }):
| {
transforms: TransformInfo[]
enabled: boolean
}
| Error {
const paths = selectionRanges.codeBasedSelections.map(({ range }) => const paths = selectionRanges.codeBasedSelections.map(({ range }) =>
getNodePathFromSourceRange(kclManager.ast, range) getNodePathFromSourceRange(kclManager.ast, range)
) )
const nodes = paths.map( const _nodes = paths.map((pathToNode) => {
(pathToNode) => getNodeFromPath<Value>(kclManager.ast, pathToNode).node const tmp = getNodeFromPath<Value>(kclManager.ast, pathToNode)
) if (err(tmp)) return tmp
const varDecs = paths.map( return tmp.node
(pathToNode) => })
getNodeFromPath<VariableDeclarator>( const _err1 = _nodes.find(err)
kclManager.ast, if (err(_err1)) return _err1
pathToNode, const nodes = _nodes as Value[]
'VariableDeclarator'
)?.node const _varDecs = paths.map((pathToNode) => {
) const tmp = getNodeFromPath<VariableDeclarator>(
kclManager.ast,
pathToNode,
'VariableDeclarator'
)
if (err(tmp)) return tmp
return tmp.node
})
const _err2 = _varDecs.find(err)
if (err(_err2)) return _err2
const varDecs = _varDecs as VariableDeclarator[]
const primaryLine = varDecs[0] const primaryLine = varDecs[0]
const secondaryVarDecs = varDecs.slice(1) const secondaryVarDecs = varDecs.slice(1)
const isOthersLinkedToPrimary = secondaryVarDecs.every((secondary) => const isOthersLinkedToPrimary = secondaryVarDecs.every((secondary) =>
@ -51,6 +69,7 @@ export function equalAngleInfo({
kclManager.ast, kclManager.ast,
'equalAngle' 'equalAngle'
) )
if (err(transforms)) return transforms
const enabled = const enabled =
!!secondaryVarDecs.length && !!secondaryVarDecs.length &&
@ -64,16 +83,24 @@ export function applyConstraintEqualAngle({
selectionRanges, selectionRanges,
}: { }: {
selectionRanges: Selections selectionRanges: Selections
}): { }):
modifiedAst: Program | {
pathToNodeMap: PathToNodeMap modifiedAst: Program
} { pathToNodeMap: PathToNodeMap
const { transforms } = equalAngleInfo({ selectionRanges }) }
const { modifiedAst, pathToNodeMap } = transformSecondarySketchLinesTagFirst({ | Error {
const info = equalAngleInfo({ selectionRanges })
if (err(info)) return info
const { transforms } = info
const transform = transformSecondarySketchLinesTagFirst({
ast: kclManager.ast, ast: kclManager.ast,
selectionRanges, selectionRanges,
transformInfos: transforms, transformInfos: transforms,
programMemory: kclManager.programMemory, programMemory: kclManager.programMemory,
}) })
if (err(transform)) return transform
const { modifiedAst, pathToNodeMap } = transform
return { modifiedAst, pathToNodeMap } return { modifiedAst, pathToNodeMap }
} }

View File

@ -10,28 +10,46 @@ import {
transformSecondarySketchLinesTagFirst, transformSecondarySketchLinesTagFirst,
getTransformInfos, getTransformInfos,
PathToNodeMap, PathToNodeMap,
TransformInfo,
} from '../../lang/std/sketchcombos' } from '../../lang/std/sketchcombos'
import { kclManager } from 'lib/singletons' import { kclManager } from 'lib/singletons'
import { err } from 'lib/trap'
export function setEqualLengthInfo({ export function setEqualLengthInfo({
selectionRanges, selectionRanges,
}: { }: {
selectionRanges: Selections selectionRanges: Selections
}) { }):
| {
transforms: TransformInfo[]
enabled: boolean
}
| Error {
const paths = selectionRanges.codeBasedSelections.map(({ range }) => const paths = selectionRanges.codeBasedSelections.map(({ range }) =>
getNodePathFromSourceRange(kclManager.ast, range) getNodePathFromSourceRange(kclManager.ast, range)
) )
const nodes = paths.map( const _nodes = paths.map((pathToNode) => {
(pathToNode) => getNodeFromPath<Value>(kclManager.ast, pathToNode).node const tmp = getNodeFromPath<Value>(kclManager.ast, pathToNode)
) if (err(tmp)) return tmp
const varDecs = paths.map( return tmp.node
(pathToNode) => })
getNodeFromPath<VariableDeclarator>( const _err1 = _nodes.find(err)
kclManager.ast, if (err(_err1)) return _err1
pathToNode, const nodes = _nodes as Value[]
'VariableDeclarator'
)?.node const _varDecs = paths.map((pathToNode) => {
) const tmp = getNodeFromPath<VariableDeclarator>(
kclManager.ast,
pathToNode,
'VariableDeclarator'
)
if (err(tmp)) return tmp
return tmp.node
})
const _err2 = _varDecs.find(err)
if (err(_err2)) return _err2
const varDecs = _varDecs as VariableDeclarator[]
const primaryLine = varDecs[0] const primaryLine = varDecs[0]
const secondaryVarDecs = varDecs.slice(1) const secondaryVarDecs = varDecs.slice(1)
const isOthersLinkedToPrimary = secondaryVarDecs.every((secondary) => const isOthersLinkedToPrimary = secondaryVarDecs.every((secondary) =>
@ -51,6 +69,7 @@ export function setEqualLengthInfo({
kclManager.ast, kclManager.ast,
'equalLength' 'equalLength'
) )
if (err(transforms)) return transforms
const enabled = const enabled =
!!secondaryVarDecs.length && !!secondaryVarDecs.length &&
@ -65,16 +84,24 @@ export function applyConstraintEqualLength({
selectionRanges, selectionRanges,
}: { }: {
selectionRanges: Selections selectionRanges: Selections
}): { }):
modifiedAst: Program | {
pathToNodeMap: PathToNodeMap modifiedAst: Program
} { pathToNodeMap: PathToNodeMap
const { transforms } = setEqualLengthInfo({ selectionRanges }) }
const { modifiedAst, pathToNodeMap } = transformSecondarySketchLinesTagFirst({ | Error {
const info = setEqualLengthInfo({ selectionRanges })
if (err(info)) return info
const { transforms } = info
const transform = transformSecondarySketchLinesTagFirst({
ast: kclManager.ast, ast: kclManager.ast,
selectionRanges, selectionRanges,
transformInfos: transforms, transformInfos: transforms,
programMemory: kclManager.programMemory, programMemory: kclManager.programMemory,
}) })
if (err(transform)) return transform
const { modifiedAst, pathToNodeMap } = transform
return { modifiedAst, pathToNodeMap } return { modifiedAst, pathToNodeMap }
} }

View File

@ -9,19 +9,32 @@ import {
PathToNodeMap, PathToNodeMap,
getTransformInfos, getTransformInfos,
transformAstSketchLines, transformAstSketchLines,
TransformInfo,
} from '../../lang/std/sketchcombos' } from '../../lang/std/sketchcombos'
import { kclManager } from 'lib/singletons' import { kclManager } from 'lib/singletons'
import { err } from 'lib/trap'
export function horzVertInfo( export function horzVertInfo(
selectionRanges: Selections, selectionRanges: Selections,
horOrVert: 'vertical' | 'horizontal' horOrVert: 'vertical' | 'horizontal'
) { ):
| {
transforms: TransformInfo[]
enabled: boolean
}
| Error {
const paths = selectionRanges.codeBasedSelections.map(({ range }) => const paths = selectionRanges.codeBasedSelections.map(({ range }) =>
getNodePathFromSourceRange(kclManager.ast, range) getNodePathFromSourceRange(kclManager.ast, range)
) )
const nodes = paths.map( const _nodes = paths.map((pathToNode) => {
(pathToNode) => getNodeFromPath<Value>(kclManager.ast, pathToNode).node const tmp = getNodeFromPath<Value>(kclManager.ast, pathToNode)
) if (err(tmp)) return tmp
return tmp.node
})
const _err1 = _nodes.find(err)
if (err(_err1)) return _err1
const nodes = _nodes as Value[]
const isAllTooltips = nodes.every( const isAllTooltips = nodes.every(
(node) => (node) =>
node?.type === 'CallExpression' && node?.type === 'CallExpression' &&
@ -33,6 +46,8 @@ export function horzVertInfo(
kclManager.ast, kclManager.ast,
horOrVert horOrVert
) )
if (err(theTransforms)) return theTransforms
const _enableHorz = isAllTooltips && theTransforms.every(Boolean) const _enableHorz = isAllTooltips && theTransforms.every(Boolean)
return { enabled: _enableHorz, transforms: theTransforms } return { enabled: _enableHorz, transforms: theTransforms }
} }
@ -42,11 +57,16 @@ export function applyConstraintHorzVert(
horOrVert: 'vertical' | 'horizontal', horOrVert: 'vertical' | 'horizontal',
ast: Program, ast: Program,
programMemory: ProgramMemory programMemory: ProgramMemory
): { ):
modifiedAst: Program | {
pathToNodeMap: PathToNodeMap modifiedAst: Program
} { pathToNodeMap: PathToNodeMap
const transformInfos = horzVertInfo(selectionRanges, horOrVert).transforms }
| Error {
const info = horzVertInfo(selectionRanges, horOrVert)
if (err(info)) return info
const transformInfos = info.transforms
return transformAstSketchLines({ return transformAstSketchLines({
ast, ast,
selectionRanges, selectionRanges,

View File

@ -11,11 +11,13 @@ import {
transformSecondarySketchLinesTagFirst, transformSecondarySketchLinesTagFirst,
getTransformInfos, getTransformInfos,
PathToNodeMap, PathToNodeMap,
TransformInfo,
} from '../../lang/std/sketchcombos' } from '../../lang/std/sketchcombos'
import { GetInfoModal, createInfoModal } from '../SetHorVertDistanceModal' import { GetInfoModal, createInfoModal } from '../SetHorVertDistanceModal'
import { createVariableDeclaration } from '../../lang/modifyAst' import { createVariableDeclaration } from '../../lang/modifyAst'
import { removeDoubleNegatives } from '../AvailableVarsHelpers' import { removeDoubleNegatives } from '../AvailableVarsHelpers'
import { kclManager } from 'lib/singletons' import { kclManager } from 'lib/singletons'
import { err } from 'lib/trap'
const getModalInfo = createInfoModal(GetInfoModal) const getModalInfo = createInfoModal(GetInfoModal)
@ -23,7 +25,13 @@ export function intersectInfo({
selectionRanges, selectionRanges,
}: { }: {
selectionRanges: Selections selectionRanges: Selections
}) { }):
| {
transforms: TransformInfo[]
enabled: boolean
forcedSelectionRanges: Selections
}
| Error {
if (selectionRanges.codeBasedSelections.length < 2) { if (selectionRanges.codeBasedSelections.length < 2) {
return { return {
enabled: false, enabled: false,
@ -40,6 +48,8 @@ export function intersectInfo({
selectionRanges.codeBasedSelections[0], selectionRanges.codeBasedSelections[0],
selectionRanges.codeBasedSelections[1] selectionRanges.codeBasedSelections[1]
) )
if (err(previousSegment)) return previousSegment
const shouldUsePreviousSegment = const shouldUsePreviousSegment =
selectionRanges.codeBasedSelections?.[1]?.type !== 'line-end' && selectionRanges.codeBasedSelections?.[1]?.type !== 'line-end' &&
previousSegment && previousSegment &&
@ -61,17 +71,28 @@ export function intersectInfo({
const paths = _forcedSelectionRanges.codeBasedSelections.map(({ range }) => const paths = _forcedSelectionRanges.codeBasedSelections.map(({ range }) =>
getNodePathFromSourceRange(kclManager.ast, range) getNodePathFromSourceRange(kclManager.ast, range)
) )
const nodes = paths.map( const _nodes = paths.map((pathToNode) => {
(pathToNode) => getNodeFromPath<Value>(kclManager.ast, pathToNode).node const tmp = getNodeFromPath<Value>(kclManager.ast, pathToNode)
) if (err(tmp)) return tmp
const varDecs = paths.map( return tmp.node
(pathToNode) => })
getNodeFromPath<VariableDeclarator>( const _err1 = _nodes.find(err)
kclManager.ast, if (err(_err1)) return _err1
pathToNode, const nodes = _nodes as Value[]
'VariableDeclarator'
)?.node const _varDecs = paths.map((pathToNode) => {
) const tmp = getNodeFromPath<VariableDeclarator>(
kclManager.ast,
pathToNode,
'VariableDeclarator'
)
if (err(tmp)) return tmp
return tmp.node
})
const _err2 = _varDecs.find(err)
if (err(_err2)) return _err2
const varDecs = _varDecs as VariableDeclarator[]
const primaryLine = varDecs[0] const primaryLine = varDecs[0]
const secondaryVarDecs = varDecs.slice(1) const secondaryVarDecs = varDecs.slice(1)
const isOthersLinkedToPrimary = secondaryVarDecs.every((secondary) => const isOthersLinkedToPrimary = secondaryVarDecs.every((secondary) =>
@ -117,16 +138,22 @@ export async function applyConstraintIntersect({
modifiedAst: Program modifiedAst: Program
pathToNodeMap: PathToNodeMap pathToNodeMap: PathToNodeMap
}> { }> {
const { transforms, forcedSelectionRanges } = intersectInfo({ const info = intersectInfo({
selectionRanges, selectionRanges,
}) })
if (err(info)) return Promise.reject(info)
const { transforms, forcedSelectionRanges } = info
const transform1 = transformSecondarySketchLinesTagFirst({
ast: JSON.parse(JSON.stringify(kclManager.ast)),
selectionRanges: forcedSelectionRanges,
transformInfos: transforms,
programMemory: kclManager.programMemory,
})
if (err(transform1)) return Promise.reject(transform1)
const { modifiedAst, tagInfo, valueUsedInTransform, pathToNodeMap } = const { modifiedAst, tagInfo, valueUsedInTransform, pathToNodeMap } =
transformSecondarySketchLinesTagFirst({ transform1
ast: JSON.parse(JSON.stringify(kclManager.ast)),
selectionRanges: forcedSelectionRanges,
transformInfos: transforms,
programMemory: kclManager.programMemory,
})
const { const {
segName, segName,
value, value,
@ -156,15 +183,18 @@ export async function applyConstraintIntersect({
sign, sign,
variableName variableName
) )
const transform2 = transformSecondarySketchLinesTagFirst({
ast: kclManager.ast,
selectionRanges: forcedSelectionRanges,
transformInfos: transforms,
programMemory: kclManager.programMemory,
forceSegName: segName,
forceValueUsedInTransform: finalValue,
})
if (err(transform2)) return Promise.reject(transform2)
const { modifiedAst: _modifiedAst, pathToNodeMap: _pathToNodeMap } = const { modifiedAst: _modifiedAst, pathToNodeMap: _pathToNodeMap } =
transformSecondarySketchLinesTagFirst({ transform2
ast: kclManager.ast,
selectionRanges: forcedSelectionRanges,
transformInfos: transforms,
programMemory: kclManager.programMemory,
forceSegName: segName,
forceValueUsedInTransform: finalValue,
})
if (variableName) { if (variableName) {
const newBody = [..._modifiedAst.body] const newBody = [..._modifiedAst.body]
newBody.splice( newBody.splice(

View File

@ -9,8 +9,10 @@ import {
PathToNodeMap, PathToNodeMap,
getRemoveConstraintsTransforms, getRemoveConstraintsTransforms,
transformAstSketchLines, transformAstSketchLines,
TransformInfo,
} from '../../lang/std/sketchcombos' } from '../../lang/std/sketchcombos'
import { kclManager } from 'lib/singletons' import { kclManager } from 'lib/singletons'
import { err } from 'lib/trap'
export function removeConstrainingValuesInfo({ export function removeConstrainingValuesInfo({
selectionRanges, selectionRanges,
@ -18,15 +20,27 @@ export function removeConstrainingValuesInfo({
}: { }: {
selectionRanges: Selections selectionRanges: Selections
pathToNodes?: Array<PathToNode> pathToNodes?: Array<PathToNode>
}) { }):
| {
transforms: TransformInfo[]
enabled: boolean
updatedSelectionRanges: Selections
}
| Error {
const paths = const paths =
pathToNodes || pathToNodes ||
selectionRanges.codeBasedSelections.map(({ range }) => selectionRanges.codeBasedSelections.map(({ range }) =>
getNodePathFromSourceRange(kclManager.ast, range) getNodePathFromSourceRange(kclManager.ast, range)
) )
const nodes = paths.map( const _nodes = paths.map((pathToNode) => {
(pathToNode) => getNodeFromPath<Value>(kclManager.ast, pathToNode).node const tmp = getNodeFromPath<Value>(kclManager.ast, pathToNode)
) if (err(tmp)) return tmp
return tmp.node
})
const _err1 = _nodes.find(err)
if (err(_err1)) return _err1
const nodes = _nodes as Value[]
const updatedSelectionRanges = pathToNodes const updatedSelectionRanges = pathToNodes
? { ? {
otherSelections: [], otherSelections: [],
@ -44,19 +58,15 @@ export function removeConstrainingValuesInfo({
toolTips.includes(node.callee.name as any) toolTips.includes(node.callee.name as any)
) )
try { const transforms = getRemoveConstraintsTransforms(
const transforms = getRemoveConstraintsTransforms( updatedSelectionRanges,
updatedSelectionRanges, kclManager.ast,
kclManager.ast, 'removeConstrainingValues'
'removeConstrainingValues' )
) if (err(transforms)) return transforms
const enabled = isAllTooltips && transforms.every(Boolean) const enabled = isAllTooltips && transforms.every(Boolean)
return { enabled, transforms, updatedSelectionRanges } return { enabled, transforms, updatedSelectionRanges }
} catch (e) {
console.error(e)
return { enabled: false, transforms: [], updatedSelectionRanges }
}
} }
export function applyRemoveConstrainingValues({ export function applyRemoveConstrainingValues({
@ -65,14 +75,19 @@ export function applyRemoveConstrainingValues({
}: { }: {
selectionRanges: Selections selectionRanges: Selections
pathToNodes?: Array<PathToNode> pathToNodes?: Array<PathToNode>
}): { }):
modifiedAst: Program | {
pathToNodeMap: PathToNodeMap modifiedAst: Program
} { pathToNodeMap: PathToNodeMap
const { transforms, updatedSelectionRanges } = removeConstrainingValuesInfo({ }
| Error {
const constraint = removeConstrainingValuesInfo({
selectionRanges, selectionRanges,
pathToNodes, pathToNodes,
}) })
if (err(constraint)) return constraint
const { transforms, updatedSelectionRanges } = constraint
return transformAstSketchLines({ return transformAstSketchLines({
ast: kclManager.ast, ast: kclManager.ast,
selectionRanges: updatedSelectionRanges, selectionRanges: updatedSelectionRanges,

View File

@ -9,6 +9,7 @@ import {
getTransformInfos, getTransformInfos,
transformAstSketchLines, transformAstSketchLines,
PathToNodeMap, PathToNodeMap,
TransformInfo,
} from '../../lang/std/sketchcombos' } from '../../lang/std/sketchcombos'
import { import {
SetAngleLengthModal, SetAngleLengthModal,
@ -20,6 +21,7 @@ import {
} from '../../lang/modifyAst' } from '../../lang/modifyAst'
import { removeDoubleNegatives } from '../AvailableVarsHelpers' import { removeDoubleNegatives } from '../AvailableVarsHelpers'
import { kclManager } from 'lib/singletons' import { kclManager } from 'lib/singletons'
import { err } from 'lib/trap'
const getModalInfo = createSetAngleLengthModal(SetAngleLengthModal) const getModalInfo = createSetAngleLengthModal(SetAngleLengthModal)
@ -31,7 +33,12 @@ export function absDistanceInfo({
}: { }: {
selectionRanges: Selections selectionRanges: Selections
constraint: Constraint constraint: Constraint
}) { }):
| {
transforms: TransformInfo[]
enabled: boolean
}
| Error {
const disType = const disType =
constraint === 'xAbs' || constraint === 'yAbs' constraint === 'xAbs' || constraint === 'yAbs'
? constraint ? constraint
@ -41,10 +48,19 @@ export function absDistanceInfo({
const paths = selectionRanges.codeBasedSelections.map(({ range }) => const paths = selectionRanges.codeBasedSelections.map(({ range }) =>
getNodePathFromSourceRange(kclManager.ast, range) getNodePathFromSourceRange(kclManager.ast, range)
) )
const nodes = paths.map( const _nodes = paths.map((pathToNode) => {
(pathToNode) => const tmp = getNodeFromPath<Value>(
getNodeFromPath<Value>(kclManager.ast, pathToNode, 'CallExpression').node kclManager.ast,
) pathToNode,
'CallExpression'
)
if (err(tmp)) return tmp
return tmp.node
})
const _err1 = _nodes.find(err)
if (err(_err1)) return _err1
const nodes = _nodes as Value[]
const isAllTooltips = nodes.every( const isAllTooltips = nodes.every(
(node) => (node) =>
node?.type === 'CallExpression' && node?.type === 'CallExpression' &&
@ -52,6 +68,7 @@ export function absDistanceInfo({
) )
const transforms = getTransformInfos(selectionRanges, kclManager.ast, disType) const transforms = getTransformInfos(selectionRanges, kclManager.ast, disType)
if (err(transforms)) return transforms
const enableY = const enableY =
disType === 'yAbs' && disType === 'yAbs' &&
@ -81,17 +98,23 @@ export async function applyConstraintAbsDistance({
modifiedAst: Program modifiedAst: Program
pathToNodeMap: PathToNodeMap pathToNodeMap: PathToNodeMap
}> { }> {
const transformInfos = absDistanceInfo({ const info = absDistanceInfo({
selectionRanges, selectionRanges,
constraint, constraint,
}).transforms })
const { valueUsedInTransform } = transformAstSketchLines({ if (err(info)) return Promise.reject(info)
const transformInfos = info.transforms
const transform1 = transformAstSketchLines({
ast: JSON.parse(JSON.stringify(kclManager.ast)), ast: JSON.parse(JSON.stringify(kclManager.ast)),
selectionRanges: selectionRanges, selectionRanges: selectionRanges,
transformInfos, transformInfos,
programMemory: kclManager.programMemory, programMemory: kclManager.programMemory,
referenceSegName: '', referenceSegName: '',
}) })
if (err(transform1)) return Promise.reject(transform1)
const { valueUsedInTransform } = transform1
let forceVal = valueUsedInTransform || 0 let forceVal = valueUsedInTransform || 0
const { valueNode, variableName, newVariableInsertIndex, sign } = const { valueNode, variableName, newVariableInsertIndex, sign } =
await getModalInfo({ await getModalInfo({
@ -104,7 +127,7 @@ export async function applyConstraintAbsDistance({
variableName variableName
) )
const { modifiedAst: _modifiedAst, pathToNodeMap } = transformAstSketchLines({ const transform2 = transformAstSketchLines({
ast: JSON.parse(JSON.stringify(kclManager.ast)), ast: JSON.parse(JSON.stringify(kclManager.ast)),
selectionRanges: selectionRanges, selectionRanges: selectionRanges,
transformInfos, transformInfos,
@ -112,6 +135,9 @@ export async function applyConstraintAbsDistance({
referenceSegName: '', referenceSegName: '',
forceValueUsedInTransform: finalValue, forceValueUsedInTransform: finalValue,
}) })
if (err(transform2)) return Promise.reject(transform2)
const { modifiedAst: _modifiedAst, pathToNodeMap } = transform2
if (variableName) { if (variableName) {
const newBody = [..._modifiedAst.body] const newBody = [..._modifiedAst.body]
newBody.splice( newBody.splice(
@ -134,14 +160,18 @@ export function applyConstraintAxisAlign({
}: { }: {
selectionRanges: Selections selectionRanges: Selections
constraint: 'snapToYAxis' | 'snapToXAxis' constraint: 'snapToYAxis' | 'snapToXAxis'
}): { }):
modifiedAst: Program | {
pathToNodeMap: PathToNodeMap modifiedAst: Program
} { pathToNodeMap: PathToNodeMap
const transformInfos = absDistanceInfo({ }
| Error {
const info = absDistanceInfo({
selectionRanges, selectionRanges,
constraint, constraint,
}).transforms })
if (err(info)) return info
const transformInfos = info.transforms
let finalValue = createIdentifier('ZERO') let finalValue = createIdentifier('ZERO')

View File

@ -10,11 +10,13 @@ import {
transformSecondarySketchLinesTagFirst, transformSecondarySketchLinesTagFirst,
getTransformInfos, getTransformInfos,
PathToNodeMap, PathToNodeMap,
TransformInfo,
} from '../../lang/std/sketchcombos' } from '../../lang/std/sketchcombos'
import { GetInfoModal, createInfoModal } from '../SetHorVertDistanceModal' import { GetInfoModal, createInfoModal } from '../SetHorVertDistanceModal'
import { createVariableDeclaration } from '../../lang/modifyAst' import { createVariableDeclaration } from '../../lang/modifyAst'
import { removeDoubleNegatives } from '../AvailableVarsHelpers' import { removeDoubleNegatives } from '../AvailableVarsHelpers'
import { kclManager } from 'lib/singletons' import { kclManager } from 'lib/singletons'
import { err } from 'lib/trap'
const getModalInfo = createInfoModal(GetInfoModal) const getModalInfo = createInfoModal(GetInfoModal)
@ -22,22 +24,38 @@ export function angleBetweenInfo({
selectionRanges, selectionRanges,
}: { }: {
selectionRanges: Selections selectionRanges: Selections
}) { }):
| {
transforms: TransformInfo[]
enabled: boolean
}
| Error {
const paths = selectionRanges.codeBasedSelections.map(({ range }) => const paths = selectionRanges.codeBasedSelections.map(({ range }) =>
getNodePathFromSourceRange(kclManager.ast, range) getNodePathFromSourceRange(kclManager.ast, range)
) )
const nodes = paths.map( const _nodes = paths.map((pathToNode) => {
(pathToNode) => getNodeFromPath<Value>(kclManager.ast, pathToNode).node const tmp = getNodeFromPath<Value>(kclManager.ast, pathToNode)
) if (err(tmp)) return tmp
const varDecs = paths.map( return tmp.node
(pathToNode) => })
getNodeFromPath<VariableDeclarator>( const _err1 = _nodes.find(err)
kclManager.ast, if (err(_err1)) return _err1
pathToNode, const nodes = _nodes as Value[]
'VariableDeclarator'
)?.node const _varDecs = paths.map((pathToNode) => {
) const tmp = getNodeFromPath<VariableDeclarator>(
kclManager.ast,
pathToNode,
'VariableDeclarator'
)
if (err(tmp)) return tmp
return tmp.node
})
const _err2 = _varDecs.find(err)
if (err(_err2)) return _err2
const varDecs = _varDecs as VariableDeclarator[]
const primaryLine = varDecs[0] const primaryLine = varDecs[0]
const secondaryVarDecs = varDecs.slice(1) const secondaryVarDecs = varDecs.slice(1)
const isOthersLinkedToPrimary = secondaryVarDecs.every((secondary) => const isOthersLinkedToPrimary = secondaryVarDecs.every((secondary) =>
@ -77,14 +95,20 @@ export async function applyConstraintAngleBetween({
modifiedAst: Program modifiedAst: Program
pathToNodeMap: PathToNodeMap pathToNodeMap: PathToNodeMap
}> { }> {
const transformInfos = angleBetweenInfo({ selectionRanges }).transforms const info = angleBetweenInfo({ selectionRanges })
if (err(info)) return Promise.reject(info)
const transformInfos = info.transforms
const transformed1 = transformSecondarySketchLinesTagFirst({
ast: JSON.parse(JSON.stringify(kclManager.ast)),
selectionRanges,
transformInfos,
programMemory: kclManager.programMemory,
})
if (err(transformed1)) return Promise.reject(transformed1)
const { modifiedAst, tagInfo, valueUsedInTransform, pathToNodeMap } = const { modifiedAst, tagInfo, valueUsedInTransform, pathToNodeMap } =
transformSecondarySketchLinesTagFirst({ transformed1
ast: JSON.parse(JSON.stringify(kclManager.ast)),
selectionRanges,
transformInfos,
programMemory: kclManager.programMemory,
})
const { const {
segName, segName,
value, value,
@ -115,15 +139,18 @@ export async function applyConstraintAngleBetween({
variableName variableName
) )
// transform again but forcing certain values // transform again but forcing certain values
const transformed2 = transformSecondarySketchLinesTagFirst({
ast: kclManager.ast,
selectionRanges,
transformInfos,
programMemory: kclManager.programMemory,
forceSegName: segName,
forceValueUsedInTransform: finalValue,
})
if (err(transformed2)) return Promise.reject(transformed2)
const { modifiedAst: _modifiedAst, pathToNodeMap: _pathToNodeMap } = const { modifiedAst: _modifiedAst, pathToNodeMap: _pathToNodeMap } =
transformSecondarySketchLinesTagFirst({ transformed2
ast: kclManager.ast,
selectionRanges,
transformInfos,
programMemory: kclManager.programMemory,
forceSegName: segName,
forceValueUsedInTransform: finalValue,
})
if (variableName) { if (variableName) {
const newBody = [..._modifiedAst.body] const newBody = [..._modifiedAst.body]
newBody.splice( newBody.splice(

View File

@ -9,12 +9,14 @@ import {
transformSecondarySketchLinesTagFirst, transformSecondarySketchLinesTagFirst,
getTransformInfos, getTransformInfos,
PathToNodeMap, PathToNodeMap,
TransformInfo,
} from '../../lang/std/sketchcombos' } from '../../lang/std/sketchcombos'
import { GetInfoModal, createInfoModal } from '../SetHorVertDistanceModal' import { GetInfoModal, createInfoModal } from '../SetHorVertDistanceModal'
import { createLiteral, createVariableDeclaration } from '../../lang/modifyAst' import { createLiteral, createVariableDeclaration } from '../../lang/modifyAst'
import { removeDoubleNegatives } from '../AvailableVarsHelpers' import { removeDoubleNegatives } from '../AvailableVarsHelpers'
import { kclManager } from 'lib/singletons' import { kclManager } from 'lib/singletons'
import { Selections } from 'lib/selections' import { Selections } from 'lib/selections'
import { cleanErrs, err } from 'lib/trap'
const getModalInfo = createInfoModal(GetInfoModal) const getModalInfo = createInfoModal(GetInfoModal)
@ -24,21 +26,38 @@ export function horzVertDistanceInfo({
}: { }: {
selectionRanges: Selections selectionRanges: Selections
constraint: 'setHorzDistance' | 'setVertDistance' constraint: 'setHorzDistance' | 'setVertDistance'
}) { }):
| {
transforms: TransformInfo[]
enabled: boolean
}
| Error {
const paths = selectionRanges.codeBasedSelections.map(({ range }) => const paths = selectionRanges.codeBasedSelections.map(({ range }) =>
getNodePathFromSourceRange(kclManager.ast, range) getNodePathFromSourceRange(kclManager.ast, range)
) )
const nodes = paths.map( const _nodes = paths.map((pathToNode) => {
(pathToNode) => getNodeFromPath<Value>(kclManager.ast, pathToNode).node const tmp = getNodeFromPath<Value>(kclManager.ast, pathToNode)
) if (err(tmp)) return tmp
const varDecs = paths.map( return tmp.node
(pathToNode) => })
getNodeFromPath<VariableDeclarator>( const [hasErr, , nodesWErrs] = cleanErrs(_nodes)
kclManager.ast,
pathToNode, if (hasErr) return nodesWErrs[0]
'VariableDeclarator' const nodes = _nodes as Value[]
)?.node
) const _varDecs = paths.map((pathToNode) => {
const tmp = getNodeFromPath<VariableDeclarator>(
kclManager.ast,
pathToNode,
'VariableDeclarator'
)
if (err(tmp)) return tmp
return tmp.node
})
const _err2 = _varDecs.find(err)
if (err(_err2)) return _err2
const varDecs = _varDecs as VariableDeclarator[]
const primaryLine = varDecs[0] const primaryLine = varDecs[0]
const secondaryVarDecs = varDecs.slice(1) const secondaryVarDecs = varDecs.slice(1)
const isOthersLinkedToPrimary = secondaryVarDecs.every((secondary) => const isOthersLinkedToPrimary = secondaryVarDecs.every((secondary) =>
@ -82,17 +101,21 @@ export async function applyConstraintHorzVertDistance({
modifiedAst: Program modifiedAst: Program
pathToNodeMap: PathToNodeMap pathToNodeMap: PathToNodeMap
}> { }> {
const transformInfos = horzVertDistanceInfo({ const info = horzVertDistanceInfo({
selectionRanges, selectionRanges,
constraint, constraint,
}).transforms })
if (err(info)) return Promise.reject(info)
const transformInfos = info.transforms
const transformed = transformSecondarySketchLinesTagFirst({
ast: JSON.parse(JSON.stringify(kclManager.ast)),
selectionRanges,
transformInfos,
programMemory: kclManager.programMemory,
})
if (err(transformed)) return Promise.reject(transformed)
const { modifiedAst, tagInfo, valueUsedInTransform, pathToNodeMap } = const { modifiedAst, tagInfo, valueUsedInTransform, pathToNodeMap } =
transformSecondarySketchLinesTagFirst({ transformed
ast: JSON.parse(JSON.stringify(kclManager.ast)),
selectionRanges,
transformInfos,
programMemory: kclManager.programMemory,
})
const { const {
segName, segName,
value, value,
@ -120,15 +143,17 @@ export async function applyConstraintHorzVertDistance({
? createLiteral(0) ? createLiteral(0)
: removeDoubleNegatives(valueNode as BinaryPart, sign, variableName) : removeDoubleNegatives(valueNode as BinaryPart, sign, variableName)
// transform again but forcing certain values // transform again but forcing certain values
const { modifiedAst: _modifiedAst, pathToNodeMap } = const transformed = transformSecondarySketchLinesTagFirst({
transformSecondarySketchLinesTagFirst({ ast: kclManager.ast,
ast: kclManager.ast, selectionRanges,
selectionRanges, transformInfos,
transformInfos, programMemory: kclManager.programMemory,
programMemory: kclManager.programMemory, forceSegName: segName,
forceSegName: segName, forceValueUsedInTransform: finalValue,
forceValueUsedInTransform: finalValue, })
})
if (err(transformed)) return Promise.reject(transformed)
const { modifiedAst: _modifiedAst, pathToNodeMap } = transformed
if (variableName) { if (variableName) {
const newBody = [..._modifiedAst.body] const newBody = [..._modifiedAst.body]
newBody.splice( newBody.splice(
@ -155,22 +180,28 @@ export function applyConstraintHorzVertAlign({
}: { }: {
selectionRanges: Selections selectionRanges: Selections
constraint: 'setHorzDistance' | 'setVertDistance' constraint: 'setHorzDistance' | 'setVertDistance'
}): { }):
modifiedAst: Program | {
pathToNodeMap: PathToNodeMap modifiedAst: Program
} { pathToNodeMap: PathToNodeMap
const transformInfos = horzVertDistanceInfo({ }
| Error {
const info = horzVertDistanceInfo({
selectionRanges, selectionRanges,
constraint, constraint,
}).transforms })
if (err(info)) return info
const transformInfos = info.transforms
let finalValue = createLiteral(0) let finalValue = createLiteral(0)
const { modifiedAst, pathToNodeMap } = transformSecondarySketchLinesTagFirst({ const retval = transformSecondarySketchLinesTagFirst({
ast: kclManager.ast, ast: kclManager.ast,
selectionRanges, selectionRanges,
transformInfos, transformInfos,
programMemory: kclManager.programMemory, programMemory: kclManager.programMemory,
forceValueUsedInTransform: finalValue, forceValueUsedInTransform: finalValue,
}) })
if (err(retval)) return retval
const { modifiedAst, pathToNodeMap } = retval
return { return {
modifiedAst: modifiedAst, modifiedAst: modifiedAst,
pathToNodeMap, pathToNodeMap,

View File

@ -9,6 +9,7 @@ import {
PathToNodeMap, PathToNodeMap,
getTransformInfos, getTransformInfos,
transformAstSketchLines, transformAstSketchLines,
TransformInfo,
} from '../../lang/std/sketchcombos' } from '../../lang/std/sketchcombos'
import { import {
SetAngleLengthModal, SetAngleLengthModal,
@ -22,6 +23,7 @@ import {
import { removeDoubleNegatives } from '../AvailableVarsHelpers' import { removeDoubleNegatives } from '../AvailableVarsHelpers'
import { normaliseAngle } from '../../lib/utils' import { normaliseAngle } from '../../lib/utils'
import { kclManager } from 'lib/singletons' import { kclManager } from 'lib/singletons'
import { err } from 'lib/trap'
const getModalInfo = createSetAngleLengthModal(SetAngleLengthModal) const getModalInfo = createSetAngleLengthModal(SetAngleLengthModal)
@ -31,19 +33,29 @@ export function angleLengthInfo({
}: { }: {
selectionRanges: Selections selectionRanges: Selections
angleOrLength?: 'setLength' | 'setAngle' angleOrLength?: 'setLength' | 'setAngle'
}) { }):
| {
transforms: TransformInfo[]
enabled: boolean
}
| Error {
const paths = selectionRanges.codeBasedSelections.map(({ range }) => const paths = selectionRanges.codeBasedSelections.map(({ range }) =>
getNodePathFromSourceRange(kclManager.ast, range) getNodePathFromSourceRange(kclManager.ast, range)
) )
const nodes = paths.map(
(pathToNode) => const nodes = paths.map((pathToNode) =>
getNodeFromPath<Value>(kclManager.ast, pathToNode, 'CallExpression').node getNodeFromPath<Value>(kclManager.ast, pathToNode, 'CallExpression')
)
const isAllTooltips = nodes.every(
(node) =>
node?.type === 'CallExpression' &&
toolTips.includes(node.callee.name as any)
) )
const _err1 = nodes.find(err)
if (err(_err1)) return _err1
const isAllTooltips = nodes.every((meta) => {
if (err(meta)) return false
return (
meta.node?.type === 'CallExpression' &&
toolTips.includes(meta.node.callee.name as any)
)
})
const transforms = getTransformInfos( const transforms = getTransformInfos(
selectionRanges, selectionRanges,
@ -67,88 +79,91 @@ export async function applyConstraintAngleLength({
modifiedAst: Program modifiedAst: Program
pathToNodeMap: PathToNodeMap pathToNodeMap: PathToNodeMap
}> { }> {
const { transforms } = angleLengthInfo({ selectionRanges, angleOrLength }) const angleLength = angleLengthInfo({ selectionRanges, angleOrLength })
const { valueUsedInTransform } = transformAstSketchLines({ if (err(angleLength)) return Promise.reject(angleLength)
const { transforms } = angleLength
const sketched = transformAstSketchLines({
ast: JSON.parse(JSON.stringify(kclManager.ast)), ast: JSON.parse(JSON.stringify(kclManager.ast)),
selectionRanges, selectionRanges,
transformInfos: transforms, transformInfos: transforms,
programMemory: kclManager.programMemory, programMemory: kclManager.programMemory,
referenceSegName: '', referenceSegName: '',
}) })
try { if (err(sketched)) return Promise.reject(sketched)
const isReferencingYAxis = const { valueUsedInTransform } = sketched
selectionRanges.otherSelections.length === 1 &&
selectionRanges.otherSelections[0] === 'y-axis'
const isReferencingYAxisAngle =
isReferencingYAxis && angleOrLength === 'setAngle'
const isReferencingXAxis = const isReferencingYAxis =
selectionRanges.otherSelections.length === 1 && selectionRanges.otherSelections.length === 1 &&
selectionRanges.otherSelections[0] === 'x-axis' selectionRanges.otherSelections[0] === 'y-axis'
const isReferencingXAxisAngle = const isReferencingYAxisAngle =
isReferencingXAxis && angleOrLength === 'setAngle' isReferencingYAxis && angleOrLength === 'setAngle'
let forceVal = valueUsedInTransform || 0 const isReferencingXAxis =
let calcIdentifier = createIdentifier('ZERO') selectionRanges.otherSelections.length === 1 &&
if (isReferencingYAxisAngle) { selectionRanges.otherSelections[0] === 'x-axis'
calcIdentifier = createIdentifier( const isReferencingXAxisAngle =
forceVal < 0 ? 'THREE_QUARTER_TURN' : 'QUARTER_TURN' isReferencingXAxis && angleOrLength === 'setAngle'
)
forceVal = normaliseAngle(forceVal + (forceVal < 0 ? 90 : -90))
} else if (isReferencingXAxisAngle) {
calcIdentifier = createIdentifier(
Math.abs(forceVal) > 90 ? 'HALF_TURN' : 'ZERO'
)
forceVal =
Math.abs(forceVal) > 90 ? normaliseAngle(forceVal - 180) : forceVal
}
const { valueNode, variableName, newVariableInsertIndex, sign } =
await getModalInfo({
value: forceVal,
valueName: angleOrLength === 'setAngle' ? 'angle' : 'length',
shouldCreateVariable: true,
})
let finalValue = removeDoubleNegatives( let forceVal = valueUsedInTransform || 0
valueNode as BinaryPart, let calcIdentifier = createIdentifier('ZERO')
sign, if (isReferencingYAxisAngle) {
variableName calcIdentifier = createIdentifier(
forceVal < 0 ? 'THREE_QUARTER_TURN' : 'QUARTER_TURN'
) )
if ( forceVal = normaliseAngle(forceVal + (forceVal < 0 ? 90 : -90))
isReferencingYAxisAngle || } else if (isReferencingXAxisAngle) {
(isReferencingXAxisAngle && calcIdentifier.name !== 'ZERO') calcIdentifier = createIdentifier(
) { Math.abs(forceVal) > 90 ? 'HALF_TURN' : 'ZERO'
finalValue = createBinaryExpressionWithUnary([calcIdentifier, finalValue]) )
} forceVal =
Math.abs(forceVal) > 90 ? normaliseAngle(forceVal - 180) : forceVal
}
const { valueNode, variableName, newVariableInsertIndex, sign } =
await getModalInfo({
value: forceVal,
valueName: angleOrLength === 'setAngle' ? 'angle' : 'length',
shouldCreateVariable: true,
})
const { modifiedAst: _modifiedAst, pathToNodeMap } = let finalValue = removeDoubleNegatives(
transformAstSketchLines({ valueNode as BinaryPart,
ast: JSON.parse(JSON.stringify(kclManager.ast)), sign,
selectionRanges, variableName
transformInfos: transforms, )
programMemory: kclManager.programMemory, if (
referenceSegName: '', isReferencingYAxisAngle ||
forceValueUsedInTransform: finalValue, (isReferencingXAxisAngle && calcIdentifier.name !== 'ZERO')
}) ) {
if (variableName) { finalValue = createBinaryExpressionWithUnary([calcIdentifier, finalValue])
const newBody = [..._modifiedAst.body] }
newBody.splice(
newVariableInsertIndex, const retval = transformAstSketchLines({
0, ast: JSON.parse(JSON.stringify(kclManager.ast)),
createVariableDeclaration(variableName, valueNode) selectionRanges,
) transformInfos: transforms,
_modifiedAst.body = newBody programMemory: kclManager.programMemory,
Object.values(pathToNodeMap).forEach((pathToNode) => { referenceSegName: '',
const index = pathToNode.findIndex((a) => a[0] === 'body') + 1 forceValueUsedInTransform: finalValue,
pathToNode[index][0] = Number(pathToNode[index][0]) + 1 })
}) if (err(retval)) return Promise.reject(retval)
}
return { const { modifiedAst: _modifiedAst, pathToNodeMap } = retval
modifiedAst: _modifiedAst, if (variableName) {
pathToNodeMap, const newBody = [..._modifiedAst.body]
} newBody.splice(
} catch (e) { newVariableInsertIndex,
console.log('error', e) 0,
throw e createVariableDeclaration(variableName, valueNode)
)
_modifiedAst.body = newBody
Object.values(pathToNodeMap).forEach((pathToNode) => {
const index = pathToNode.findIndex((a) => a[0] === 'body') + 1
pathToNode[index][0] = Number(pathToNode[index][0]) + 1
})
}
return {
modifiedAst: _modifiedAst,
pathToNodeMap,
} }
} }

View File

@ -20,6 +20,12 @@ const UserSidebarMenu = ({ user }: { user?: User }) => {
const navigate = useNavigate() const navigate = useNavigate()
const send = useSettingsAuthContext()?.auth?.send const send = useSettingsAuthContext()?.auth?.send
// This image host goes down sometimes. We will instead rewrite the
// resource to be a local one.
if (user?.image === 'https://placekitten.com/200/200') {
user.image = '/cat.jpg'
}
// Fallback logic for displaying user's "name": // Fallback logic for displaying user's "name":
// 1. user.name // 1. user.name
// 2. user.first_name + ' ' + user.last_name // 2. user.first_name + ' ' + user.last_name

View File

@ -1,192 +1,54 @@
import * as jsrpc from 'json-rpc-2.0' import { LspContext, LspWorkerEventType } from './types'
import * as LSP from 'vscode-languageserver-protocol'
import { import {
registerServerCapability, LanguageClient,
unregisterServerCapability, LanguageClientOptions,
} from './server-capability-registration' } from 'vscode-languageclient/browser'
import { Codec, FromServer, IntoServer } from './codec' import Worker from 'editor/plugins/lsp/worker.ts?worker'
const client_capabilities: LSP.ClientCapabilities = { export default class LspServerClient {
textDocument: { context: LspContext
hover: { client: LanguageClient | null = null
dynamicRegistration: true, worker: Worker | null = null
contentFormat: ['plaintext', 'markdown'],
},
moniker: {},
synchronization: {
dynamicRegistration: true,
willSave: false,
didSave: false,
willSaveWaitUntil: false,
},
completion: {
dynamicRegistration: true,
completionItem: {
snippetSupport: false,
commitCharactersSupport: true,
documentationFormat: ['plaintext', 'markdown'],
deprecatedSupport: false,
preselectSupport: false,
},
contextSupport: false,
},
signatureHelp: {
dynamicRegistration: true,
signatureInformation: {
documentationFormat: ['plaintext', 'markdown'],
},
},
declaration: {
dynamicRegistration: true,
linkSupport: true,
},
definition: {
dynamicRegistration: true,
linkSupport: true,
},
typeDefinition: {
dynamicRegistration: true,
linkSupport: true,
},
implementation: {
dynamicRegistration: true,
linkSupport: true,
},
},
workspace: {
didChangeConfiguration: {
dynamicRegistration: true,
},
},
}
export default class Client extends jsrpc.JSONRPCServerAndClient { constructor(context: LspContext) {
afterInitializedHooks: (() => Promise<void>)[] = [] this.context = context
#fromServer: FromServer
private serverCapabilities: LSP.ServerCapabilities<any> = {}
private notifyFn: ((message: LSP.NotificationMessage) => void) | null = null
constructor(fromServer: FromServer, intoServer: IntoServer) {
super(
new jsrpc.JSONRPCServer(),
new jsrpc.JSONRPCClient(async (json: jsrpc.JSONRPCRequest) => {
const encoded = Codec.encode(json)
intoServer.enqueue(encoded)
if (null != json.id) {
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
const response = await fromServer.responses.get(json.id)
this.client.receive(response as jsrpc.JSONRPCResponse)
}
})
)
this.#fromServer = fromServer
} }
async start(): Promise<void> { async startServer() {
// process "window/logMessage": client <- server this.worker = new Worker({ name: this.context.worker })
this.addMethod(LSP.LogMessageNotification.type.method, (params) => { this.worker.postMessage({
const { type, message } = params as { worker: this.context.worker,
type: LSP.MessageType eventType: LspWorkerEventType.Init,
message: string eventData: this.context.options,
} })
let messageString = '' }
switch (type) {
case LSP.MessageType.Error: { async startClient() {
messageString += '[error] ' const clientOptions: LanguageClientOptions = {
break documentSelector: [{ language: 'kcl' }],
} diagnosticCollectionName: 'markers',
case LSP.MessageType.Warning: { }
messageString += ' [warn] '
break if (!this.worker) {
} console.error('Worker not initialized')
case LSP.MessageType.Info: {
messageString += ' [info] '
break
}
case LSP.MessageType.Log: {
messageString += ' [log] '
break
}
}
// eslint-disable-next-line @typescript-eslint/no-unused-vars
messageString += message
return return
}) }
// process "client/registerCapability": client <- server this.client = new LanguageClient(
this.addMethod(LSP.RegistrationRequest.type.method, (params) => { this.context.worker + 'LspClient',
// Register a server capability. this.context.worker + ' LSP Client',
params.registrations.forEach( clientOptions,
(capabilityRegistration: LSP.Registration) => { this.worker
this.serverCapabilities = registerServerCapability(
this.serverCapabilities,
capabilityRegistration
)
}
)
})
// process "client/unregisterCapability": client <- server
this.addMethod(LSP.UnregistrationRequest.type.method, (params) => {
// Unregister a server capability.
params.unregisterations.forEach(
(capabilityUnregistration: LSP.Unregistration) => {
this.serverCapabilities = unregisterServerCapability(
this.serverCapabilities,
capabilityUnregistration
)
}
)
})
// request "initialize": client <-> server
const { capabilities } = await this.request(
LSP.InitializeRequest.type.method,
{
processId: null,
clientInfo: {
name: 'kcl-language-client',
},
capabilities: client_capabilities,
rootUri: null,
} as LSP.InitializeParams
) )
this.serverCapabilities = capabilities try {
await this.client.start()
// notify "initialized": client --> server } catch (error) {
this.notify(LSP.InitializedNotification.type.method, {}) this.client.error(`Start failed`, error, 'force')
await Promise.all(
this.afterInitializedHooks.map((f: () => Promise<void>) => f())
)
await Promise.all([this.processNotifications(), this.processRequests()])
}
getServerCapabilities(): LSP.ServerCapabilities<any> {
return this.serverCapabilities
}
setNotifyFn(fn: (message: LSP.NotificationMessage) => void): void {
this.notifyFn = fn
}
async processNotifications(): Promise<void> {
for await (const notification of this.#fromServer.notifications) {
if (this.notifyFn) {
this.notifyFn(notification)
}
} }
} }
async processRequests(): Promise<void> { deactivate() {
for await (const request of this.#fromServer.requests) { return this.client?.stop()
await this.receiveAndSend(request)
}
}
pushAfterInitializeHook(...hooks: (() => Promise<void>)[]): void {
this.afterInitializedHooks.push(...hooks)
} }
} }

View File

@ -1,73 +0,0 @@
import * as jsrpc from 'json-rpc-2.0'
import * as vsrpc from 'vscode-jsonrpc'
import Bytes from './codec/bytes'
import StreamDemuxer from './codec/demuxer'
import Headers from './codec/headers'
import Queue from './codec/queue'
import Tracer from './tracer'
import { LspWorkerEventType, LspWorker } from './types'
export const encoder = new TextEncoder()
export const decoder = new TextDecoder()
export class Codec {
static encode(
json: jsrpc.JSONRPCRequest | jsrpc.JSONRPCResponse
): Uint8Array {
const message = JSON.stringify(json)
const delimited = Headers.add(message)
return Bytes.encode(delimited)
}
static decode<T>(data: Uint8Array): T {
const delimited = Bytes.decode(data)
const message = Headers.remove(delimited)
return JSON.parse(message) as T
}
}
// FIXME: tracing efficiency
export class IntoServer
extends Queue<Uint8Array>
implements AsyncGenerator<Uint8Array, never, void>
{
private worker: Worker | null = null
private type_: LspWorker | null = null
constructor(type_?: LspWorker, worker?: Worker) {
super()
if (worker && type_) {
this.worker = worker
this.type_ = type_
}
}
enqueue(item: Uint8Array): void {
Tracer.client(Headers.remove(decoder.decode(item)))
if (this.worker) {
this.worker.postMessage({
worker: this.type_,
eventType: LspWorkerEventType.Call,
eventData: item,
})
} else {
super.enqueue(item)
}
}
}
export interface FromServer extends WritableStream<Uint8Array> {
readonly responses: {
get(key: number | string): null | Promise<vsrpc.ResponseMessage>
}
readonly notifications: AsyncGenerator<vsrpc.NotificationMessage, never, void>
readonly requests: AsyncGenerator<vsrpc.RequestMessage, never, void>
add(item: Uint8Array): void
}
// eslint-disable-next-line @typescript-eslint/no-namespace
export namespace FromServer {
export function create(): FromServer {
return new StreamDemuxer()
}
}

View File

@ -1,27 +0,0 @@
import { encoder, decoder } from '../codec'
export default class Bytes {
static encode(input: string): Uint8Array {
return encoder.encode(input)
}
static decode(input: Uint8Array): string {
return decoder.decode(input)
}
static append<
T extends { length: number; set(arr: T, offset: number): void }
>(constructor: { new (length: number): T }, ...arrays: T[]) {
let totalLength = 0
for (const arr of arrays) {
totalLength += arr.length
}
const result = new constructor(totalLength)
let offset = 0
for (const arr of arrays) {
result.set(arr, offset)
offset += arr.length
}
return result
}
}

View File

@ -1,99 +0,0 @@
import * as vsrpc from 'vscode-jsonrpc'
import Bytes from './bytes'
import PromiseMap from './map'
import Queue from './queue'
import Tracer from '../tracer'
import { Codec } from '../codec'
export default class StreamDemuxer extends Queue<Uint8Array> {
readonly responses: PromiseMap<number | string, vsrpc.ResponseMessage> =
new PromiseMap()
readonly notifications: Queue<vsrpc.NotificationMessage> =
new Queue<vsrpc.NotificationMessage>()
readonly requests: Queue<vsrpc.RequestMessage> =
new Queue<vsrpc.RequestMessage>()
readonly #start: Promise<void>
constructor() {
super()
this.#start = this.start()
}
private async start(): Promise<void> {
let contentLength: null | number = null
let buffer = new Uint8Array()
for await (const bytes of this) {
buffer = Bytes.append(Uint8Array, buffer, bytes)
while (buffer.length > 0) {
// check if the content length is known
if (null == contentLength) {
// if not, try to match the prefixed headers
const match = Bytes.decode(buffer).match(
/^Content-Length:\s*(\d+)\s*/
)
if (null == match) continue
// try to parse the content-length from the headers
const length = parseInt(match[1])
if (isNaN(length)) throw new Error('invalid content length')
// slice the headers since we now have the content length
buffer = buffer.slice(match[0].length)
// set the content length
contentLength = length
}
// if the buffer doesn't contain a full message; await another iteration
if (buffer.length < contentLength) continue
// Get just the slice of the buffer that is our content length.
const slice = buffer.slice(0, contentLength)
// decode buffer to a string
const delimited = Bytes.decode(slice)
// reset the buffer
buffer = buffer.slice(contentLength)
// reset the contentLength
contentLength = null
const message = JSON.parse(delimited) as vsrpc.Message
Tracer.server(message)
// demux the message stream
if (vsrpc.Message.isResponse(message) && null != message.id) {
this.responses.set(message.id, message)
continue
}
if (vsrpc.Message.isNotification(message)) {
this.notifications.enqueue(message)
continue
}
if (vsrpc.Message.isRequest(message)) {
this.requests.enqueue(message)
continue
}
}
}
}
add(bytes: Uint8Array): void {
const message = Codec.decode(bytes) as vsrpc.Message
Tracer.server(message)
// demux the message stream
if (vsrpc.Message.isResponse(message) && null != message.id) {
this.responses.set(message.id, message)
}
if (vsrpc.Message.isNotification(message)) {
this.notifications.enqueue(message)
}
if (vsrpc.Message.isRequest(message)) {
this.requests.enqueue(message)
}
}
}

View File

@ -1,9 +0,0 @@
export default class Headers {
static add(message: string): string {
return `Content-Length: ${message.length}\r\n\r\n${message}`
}
static remove(delimited: string): string {
return delimited.replace(/^Content-Length:\s*\d+\s*/, '')
}
}

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