Compare commits

...

24 Commits

Author SHA1 Message Date
c6b7c7d9a6 failing test
Signed-off-by: Jess Frazelle <github@jessfraz.com>
2024-06-24 17:35:36 -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
3f343698a8 Cut release v0.22.5 (#2751) 2024-06-22 16:12:05 +00:00
0bd9f42e17 go back updater versions (#2746)
Signed-off-by: Jess Frazelle <github@jessfraz.com>
2024-06-22 09:24:45 +00:00
aad29fca9f fix point and click code pane closed from start (#2750)
tests

Signed-off-by: Jess Frazelle <github@jessfraz.com>
2024-06-22 09:21:13 +00:00
a8c1a14d48 Retain sketch selection segment color after adding a constraint to the segment (#2700)
* Start of basic test (not yet failing)

* Add a little logging to get the lay of the scene object land

* Move test colors to utility, test broken

* Get accurate test that is only broken with highlighted color behavior

* Working implementation but now initial segment color sticks around too long

* Make sure segment base color is always the theme color

* Remove console logs, refactor a couple lines to use if statements instead of inline booleans

* Fix new test

* Make origin color update like the other segment types

* fmt

* Fix issue where initially-selected segments lose highlight after hover

* Undo this tweaking of the selection logic, this is really only about the clientSideEntities

* Remove unused exports

* Remove unnecessary code change from ModelingMachineProvider

* Remove newline

* Update src/clientSideScene/sceneEntities.ts

Co-authored-by: Kurt Hutten <k.hutten@protonmail.ch>

---------

Co-authored-by: Kurt Hutten <k.hutten@protonmail.ch>
Co-authored-by: Jess Frazelle <jessfraz@users.noreply.github.com>
2024-06-22 08:49:31 +00:00
8194f8b70b allow for editing a sketch where extrude or revolve is in the same pipe (#2749)
* allow for editing a sketch where extrude or revolve is in the same pipe

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

* update tests

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

* add playwright test for extrude

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

* add test for revolve

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

* remove log

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

---------

Signed-off-by: Jess Frazelle <github@jessfraz.com>
2024-06-22 06:50:30 +00:00
03e4f457d4 Cut release v0.22.4 (#2748) 2024-06-21 22:55:34 -07:00
226ed37c5f fix sketch on face (#2745)
Signed-off-by: Jess Frazelle <github@jessfraz.com>
2024-06-21 21:49:12 -07:00
0f3f923019 Fix sharing a sketch surface between profiles (#2744)
* udpates

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

* dont call until startprofileAt

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

* add a comment

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

* bump version

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

* updates

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

* cleanup typescript code

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

* updates

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

* cleanup redundant data

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>

* cleanup position and rotation

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

* fix clippy

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

* updates

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

* upfates

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

* updates

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

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

* empty

* new images

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

* new docs

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>

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

* fixups

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-21 19:54:18 -07:00
bf8fb0d127 Allow passing a vec of sketches or extrudes thru a user value (#2743)
* 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-21 16:44:31 -07:00
4a275c2ff7 fix one out of bounds error (#2740)
* update out of bounds

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

* more

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

* be in charge of own fate for code mirror versions

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

* Revert "be in charge of own fate for code mirror versions"

This reverts commit 796ecfdd8f.

---------

Signed-off-by: Jess Frazelle <github@jessfraz.com>
2024-06-21 15:06:01 -07:00
baf5509f1d Bump syn from 2.0.66 to 2.0.67 in /src/wasm-lib (#2731)
Bumps [syn](https://github.com/dtolnay/syn) from 2.0.66 to 2.0.67.
- [Release notes](https://github.com/dtolnay/syn/releases)
- [Commits](https://github.com/dtolnay/syn/compare/2.0.66...2.0.67)

---
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-21 15:05:32 -07:00
178 changed files with 126822 additions and 31555 deletions

View File

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

View File

@ -95,21 +95,13 @@ jobs:
CI: true
token: ${{ secrets.KITTYCAD_API_TOKEN_DEV }}
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
id: git-check
run: |
git add .
if git status | grep -q "Changes to be committed"
then
echo "::set-output name=modified::true"
else
echo "::set-output name=modified::false"
then echo "modified=true" >> $GITHUB_OUTPUT
else echo "modified=false" >> $GITHUB_OUTPUT
fi
- name: Commit changes, if any
if: steps.git-check.outputs.modified == 'true'
@ -125,17 +117,53 @@ jobs:
git commit -am "A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu)" || true
git push
git push origin ${{ github.head_ref }}
# only upload artifacts if there's actually changes
- uses: actions/upload-artifact@v4
if: steps.git-check.outputs.modified == 'true'
with:
name: playwright-report
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
path: test-results/
- name: Run ubuntu/chrome flow retry failures
id: retry
if: always()
run: |
ls -1 "test-results"
if [[ $(ls -1 "test-results" | wc -l) == "0" ]];
then echo "retried=false" >> $GITHUB_OUTPUT; exit 0;
else echo "retried=true" >> $GITHUB_OUTPUT;
fi;
yarn playwright test --project="Google Chrome" --last-failed e2e/playwright/flow-tests.spec.ts
env:
CI: true
token: ${{ secrets.KITTYCAD_API_TOKEN_DEV }}
- name: Run ubuntu/chrome flow
if: steps.retry.outputs.retried == 'false'
run: yarn playwright test --project="Google Chrome" e2e/playwright/flow-tests.spec.ts
env:
CI: true
token: ${{ secrets.KITTYCAD_API_TOKEN_DEV }}
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
if: always()
with:
name: playwright-report-ubuntu
name: test-results
path: test-results/
retention-days: 30
overwrite: true
- uses: actions/upload-artifact@v4
if: always()
with:
name: playwright-report
path: playwright-report/
retention-days: 30
overwrite: true
playwright-macos:
timeout-minutes: 60
@ -194,16 +222,46 @@ jobs:
run: yarn build:wasm
- name: build web
run: yarn build:local
# if have previous run results, use them
- uses: actions/download-artifact@v4
if: ${{ always() }}
continue-on-error: true
with:
name: test-results
path: test-results/
- name: Run macos/safari flow retry failures
id: retry
continue-on-error: true
if: ${{ success() }}
run: |
if [ -d "test-results" ];
then echo "retried=true" >> $GITHUB_OUTPUT;
else echo "retried=false" >> $GITHUB_OUTPUT;
fi;
yarn playwright test --project="webkit" --last-failed e2e/playwright/flow-tests.spec.ts
env:
CI: true
token: ${{ secrets.KITTYCAD_API_TOKEN_DEV }}
- name: Run macos/safari flow
if: ${{ steps.retry.outputs.retried != 'true' }}
# webkit doesn't work on Ubuntu because of the same reason tauri doesn't (webRTC issues)
# TODO remove this and the matrix and run all tests on ubuntu when this is fixed
run: yarn playwright test --project="webkit" e2e/playwright/flow-tests.spec.ts
env:
CI: true
token: ${{ secrets.KITTYCAD_API_TOKEN_DEV }}
- uses: actions/upload-artifact@v3
if: always()
- uses: actions/upload-artifact@v4
if: ${{ always() }}
with:
name: playwright-report-macos
name: test-results
path: test-results/
retention-days: 30
overwrite: true
- uses: actions/upload-artifact@v4
if: ${{ always() }}
with:
name: playwright-report
path: playwright-report/
retention-days: 30
overwrite: true

View File

@ -1,14 +1,17 @@
.PHONY: dev
WASM_LIB_FILES := $(wildcard src/wasm-lib/**/*.rs)
TS_SRC := $(wildcard src/**/*.tsx) $(wildcard src/**/*.ts)
XSTATE_TYPEGENS := $(wildcard src/machines/*.typegen.ts)
dev: node_modules public/wasm_lib_bg.wasm
dev: node_modules public/wasm_lib_bg.wasm $(XSTATE_TYPEGENS)
yarn start
$(XSTATE_TYPEGENS): $(TS_SRC)
yarn xstate typegen 'src/**/*.ts?(x)'
public/wasm_lib_bg.wasm: $(WASM_LIB_FILES)
yarn build:wasm-dev
node_modules: package.json
package.json:
node_modules: package.json yarn.lock
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
Third-Party Cookies".
## Running tests
First, start the dev server following "Running a development build" above.
Then in another terminal tab, run:
```
yarn test
```
Which will run our suite of [Vitest unit](https://vitest.dev/) and [React Testing Library E2E](https://testing-library.com/docs/react-testing-library/intro/) tests, in interactive mode by default.
For running the rust (not tauri rust though) only, you can
```bash
cd src/wasm-lib
cargo test
```
## Tauri
To spin up up tauri dev, `yarn install` and `yarn build:wasm-dev` need to have been done before hand then
@ -195,7 +176,9 @@ $ cargo +nightly fuzz run parser
For more information on fuzzing you can check out
[this guide](https://rust-fuzz.github.io/book/cargo-fuzz.html).
### Playwright
## Tests
### Playwright tests
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.
### Unit and component tests
If you already haven't, run the following:
```
yarn
yarn build:wasm
yarn start
```
and finally:
```
yarn test:nowatch
```
For individual testing:
```
yarn test abstractSyntaxTree -t "unexpected closed curly brace" --silent=false
```
Which will run our suite of [Vitest unit](https://vitest.dev/) and [React Testing Library E2E](https://testing-library.com/docs/react-testing-library/intro/) tests, in interactive mode by default.
### Rust tests
```bash
cd src/wasm-lib
cargo test
```
#### Some notes on CI
The tests are broken into snapshot tests and non-snapshot tests, and they run in that order, they automatically commit new snap shots, so if you see an image commit check it was an intended change. If we have non-determinism in the snapshots such that they are always committing new images, hopefully this annoyance makes us fix them asap, if you notice this happening let Kurt know. But for the odd occasion `git reset --hard HEAD~ && git push -f` is your friend.

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
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
angleToMatchLengthX(segment_name: string, to: number, sketch_group: SketchGroup) -> number
angleToMatchLengthX(segment_name: TagIdentifier, to: number, sketch_group: SketchGroup) -> number
```
### Examples
@ -31,13 +31,16 @@ const extrusion = extrude(5, sketch001)
### Arguments
* `segment_name`: `string` (REQUIRED)
* `segment_name`: `TagIdentifier` (REQUIRED)
```js
{
value: string,
}
```
* `to`: `number` (REQUIRED)
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
```js
{
// The plane id or face id of the sketch group.
entityId: uuid,
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
@ -73,12 +76,181 @@ const extrusion = extrude(5, sketch001)
},
} |
{
// the face id the sketch is on
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: SketchSurface,
// The starting path.
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The paths in the sketch group.
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
} |
{
// arc's direction
ccw: string,
// the arc's center
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
// The x coordinate.
x: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
// The x coordinate.
x: number,
// The y coordinate.
y: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
},
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
value: [{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
},
// The id of the face.
id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face",
// The tag of the face.
value: string,
@ -101,16 +273,16 @@ const extrusion = extrude(5, sketch001)
z: number,
},
},
// The position of the sketch group.
position: [number, number, number],
// The rotation of the sketch group base plane.
rotation: [number, number, number, number],
// The starting path.
start: {
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
@ -118,8 +290,12 @@ const extrusion = extrude(5, sketch001)
value: [{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
@ -131,8 +307,12 @@ const extrusion = extrude(5, sketch001)
center: [number, number],
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
@ -140,8 +320,12 @@ const extrusion = extrude(5, sketch001)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
@ -149,8 +333,12 @@ const extrusion = extrude(5, sketch001)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
@ -160,8 +348,12 @@ const extrusion = extrude(5, sketch001)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
@ -173,30 +365,16 @@ const extrusion = extrude(5, sketch001)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
// The x-axis of the sketch group base plane in the 3D space
xAxis: {
x: number,
y: number,
z: number,
},
// The y-axis of the sketch group base plane in the 3D space
yAxis: {
x: number,
y: number,
z: number,
},
// The z-axis of the sketch group base plane in the 3D space
zAxis: {
x: number,
y: number,
z: number,
},
}
```

View File

@ -9,7 +9,7 @@ Returns the angle to match the given length for y.
```js
angleToMatchLengthY(segment_name: string, to: number, sketch_group: SketchGroup) -> number
angleToMatchLengthY(segment_name: TagIdentifier, to: number, sketch_group: SketchGroup) -> number
```
### Examples
@ -32,13 +32,16 @@ const extrusion = extrude(5, sketch001)
### Arguments
* `segment_name`: `string` (REQUIRED)
* `segment_name`: `TagIdentifier` (REQUIRED)
```js
{
value: string,
}
```
* `to`: `number` (REQUIRED)
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
```js
{
// The plane id or face id of the sketch group.
entityId: uuid,
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
@ -74,12 +77,181 @@ const extrusion = extrude(5, sketch001)
},
} |
{
// the face id the sketch is on
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: SketchSurface,
// The starting path.
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The paths in the sketch group.
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
} |
{
// arc's direction
ccw: string,
// the arc's center
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
// The x coordinate.
x: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
// The x coordinate.
x: number,
// The y coordinate.
y: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
},
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
value: [{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
},
// The id of the face.
id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face",
// The tag of the face.
value: string,
@ -102,16 +274,16 @@ const extrusion = extrude(5, sketch001)
z: number,
},
},
// The position of the sketch group.
position: [number, number, number],
// The rotation of the sketch group base plane.
rotation: [number, number, number, number],
// The starting path.
start: {
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
@ -119,8 +291,12 @@ const extrusion = extrude(5, sketch001)
value: [{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
@ -132,8 +308,12 @@ const extrusion = extrude(5, sketch001)
center: [number, number],
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
@ -141,8 +321,12 @@ const extrusion = extrude(5, sketch001)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
@ -150,8 +334,12 @@ const extrusion = extrude(5, sketch001)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
@ -161,8 +349,12 @@ const extrusion = extrude(5, sketch001)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
@ -174,30 +366,16 @@ const extrusion = extrude(5, sketch001)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
// The x-axis of the sketch group base plane in the 3D space
xAxis: {
x: number,
y: number,
z: number,
},
// The y-axis of the sketch group base plane in the 3D space
yAxis: {
x: number,
y: number,
z: number,
},
// The z-axis of the sketch group base plane in the 3D space
zAxis: {
x: number,
y: number,
z: number,
},
}
```

View File

@ -9,7 +9,7 @@ Draw an angled line.
```js
angledLine(data: AngledLineData, sketch_group: SketchGroup, tag?: String) -> SketchGroup
angledLine(data: AngledLineData, sketch_group: SketchGroup, tag?: TagDeclarator) -> SketchGroup
```
### Examples
@ -43,8 +43,6 @@ const example = extrude(10, exampleSketch)
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
```js
{
// The plane id or face id of the sketch group.
entityId: uuid,
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
@ -80,12 +78,181 @@ const example = extrude(10, exampleSketch)
},
} |
{
// the face id the sketch is on
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: SketchSurface,
// The starting path.
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The paths in the sketch group.
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
} |
{
// arc's direction
ccw: string,
// the arc's center
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
// The x coordinate.
x: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
// The x coordinate.
x: number,
// The y coordinate.
y: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
},
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
value: [{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
},
// The id of the face.
id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face",
// The tag of the face.
value: string,
@ -108,16 +275,16 @@ const example = extrude(10, exampleSketch)
z: number,
},
},
// The position of the sketch group.
position: [number, number, number],
// The rotation of the sketch group base plane.
rotation: [number, number, number, number],
// The starting path.
start: {
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
@ -125,8 +292,12 @@ const example = extrude(10, exampleSketch)
value: [{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
@ -138,8 +309,12 @@ const example = extrude(10, exampleSketch)
center: [number, number],
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
@ -147,8 +322,12 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
@ -156,8 +335,12 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
@ -167,8 +350,12 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
@ -180,41 +367,32 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
// The x-axis of the sketch group base plane in the 3D space
xAxis: {
x: number,
y: number,
z: number,
},
// The y-axis of the sketch group base plane in the 3D space
yAxis: {
x: number,
y: number,
z: number,
},
// The z-axis of the sketch group base plane in the 3D space
zAxis: {
x: number,
y: number,
z: number,
},
}
```
* `tag`: `String` (OPTIONAL)
* `tag`: `TagDeclarator` (OPTIONAL)
```js
{
end: number,
start: number,
value: string,
}
```
### Returns
`SketchGroup` - A sketch group is a collection of paths.
```js
{
// The plane id or face id of the sketch group.
entityId: uuid,
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
@ -250,12 +428,181 @@ const example = extrude(10, exampleSketch)
},
} |
{
// the face id the sketch is on
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: SketchSurface,
// The starting path.
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The paths in the sketch group.
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
} |
{
// arc's direction
ccw: string,
// the arc's center
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
// The x coordinate.
x: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
// The x coordinate.
x: number,
// The y coordinate.
y: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
},
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
value: [{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
},
// The id of the face.
id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face",
// The tag of the face.
value: string,
@ -278,16 +625,16 @@ const example = extrude(10, exampleSketch)
z: number,
},
},
// The position of the sketch group.
position: [number, number, number],
// The rotation of the sketch group base plane.
rotation: [number, number, number, number],
// The starting path.
start: {
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
@ -295,8 +642,12 @@ const example = extrude(10, exampleSketch)
value: [{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
@ -308,8 +659,12 @@ const example = extrude(10, exampleSketch)
center: [number, number],
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
@ -317,8 +672,12 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
@ -326,8 +685,12 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
@ -337,8 +700,12 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
@ -350,30 +717,16 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
// The x-axis of the sketch group base plane in the 3D space
xAxis: {
x: number,
y: number,
z: number,
},
// The y-axis of the sketch group base plane in the 3D space
yAxis: {
x: number,
y: number,
z: number,
},
// The z-axis of the sketch group base plane in the 3D space
zAxis: {
x: number,
y: number,
z: number,
},
}
```

View File

@ -9,7 +9,7 @@ Draw an angled line of a given x length.
```js
angledLineOfXLength(data: AngledLineData, sketch_group: SketchGroup, tag?: String) -> SketchGroup
angledLineOfXLength(data: AngledLineData, sketch_group: SketchGroup, tag?: TagDeclarator) -> SketchGroup
```
### Examples
@ -42,8 +42,6 @@ const extrusion = extrude(10, sketch001)
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
```js
{
// The plane id or face id of the sketch group.
entityId: uuid,
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
@ -79,12 +77,181 @@ const extrusion = extrude(10, sketch001)
},
} |
{
// the face id the sketch is on
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: SketchSurface,
// The starting path.
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The paths in the sketch group.
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
} |
{
// arc's direction
ccw: string,
// the arc's center
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
// The x coordinate.
x: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
// The x coordinate.
x: number,
// The y coordinate.
y: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
},
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
value: [{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
},
// The id of the face.
id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face",
// The tag of the face.
value: string,
@ -107,16 +274,16 @@ const extrusion = extrude(10, sketch001)
z: number,
},
},
// The position of the sketch group.
position: [number, number, number],
// The rotation of the sketch group base plane.
rotation: [number, number, number, number],
// The starting path.
start: {
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
@ -124,8 +291,12 @@ const extrusion = extrude(10, sketch001)
value: [{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
@ -137,8 +308,12 @@ const extrusion = extrude(10, sketch001)
center: [number, number],
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
@ -146,8 +321,12 @@ const extrusion = extrude(10, sketch001)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
@ -155,8 +334,12 @@ const extrusion = extrude(10, sketch001)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
@ -166,8 +349,12 @@ const extrusion = extrude(10, sketch001)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
@ -179,41 +366,32 @@ const extrusion = extrude(10, sketch001)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
// The x-axis of the sketch group base plane in the 3D space
xAxis: {
x: number,
y: number,
z: number,
},
// The y-axis of the sketch group base plane in the 3D space
yAxis: {
x: number,
y: number,
z: number,
},
// The z-axis of the sketch group base plane in the 3D space
zAxis: {
x: number,
y: number,
z: number,
},
}
```
* `tag`: `String` (OPTIONAL)
* `tag`: `TagDeclarator` (OPTIONAL)
```js
{
end: number,
start: number,
value: string,
}
```
### Returns
`SketchGroup` - A sketch group is a collection of paths.
```js
{
// The plane id or face id of the sketch group.
entityId: uuid,
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
@ -249,12 +427,181 @@ const extrusion = extrude(10, sketch001)
},
} |
{
// the face id the sketch is on
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: SketchSurface,
// The starting path.
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The paths in the sketch group.
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
} |
{
// arc's direction
ccw: string,
// the arc's center
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
// The x coordinate.
x: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
// The x coordinate.
x: number,
// The y coordinate.
y: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
},
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
value: [{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
},
// The id of the face.
id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face",
// The tag of the face.
value: string,
@ -277,16 +624,16 @@ const extrusion = extrude(10, sketch001)
z: number,
},
},
// The position of the sketch group.
position: [number, number, number],
// The rotation of the sketch group base plane.
rotation: [number, number, number, number],
// The starting path.
start: {
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
@ -294,8 +641,12 @@ const extrusion = extrude(10, sketch001)
value: [{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
@ -307,8 +658,12 @@ const extrusion = extrude(10, sketch001)
center: [number, number],
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
@ -316,8 +671,12 @@ const extrusion = extrude(10, sketch001)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
@ -325,8 +684,12 @@ const extrusion = extrude(10, sketch001)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
@ -336,8 +699,12 @@ const extrusion = extrude(10, sketch001)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
@ -349,30 +716,16 @@ const extrusion = extrude(10, sketch001)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
// The x-axis of the sketch group base plane in the 3D space
xAxis: {
x: number,
y: number,
z: number,
},
// The y-axis of the sketch group base plane in the 3D space
yAxis: {
x: number,
y: number,
z: number,
},
// The z-axis of the sketch group base plane in the 3D space
zAxis: {
x: number,
y: number,
z: number,
},
}
```

View File

@ -9,7 +9,7 @@ Draw an angled line of a given y length.
```js
angledLineOfYLength(data: AngledLineData, sketch_group: SketchGroup, tag?: String) -> SketchGroup
angledLineOfYLength(data: AngledLineData, sketch_group: SketchGroup, tag?: TagDeclarator) -> SketchGroup
```
### Examples
@ -44,8 +44,6 @@ const example = extrude(10, exampleSketch)
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
```js
{
// The plane id or face id of the sketch group.
entityId: uuid,
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
@ -81,12 +79,181 @@ const example = extrude(10, exampleSketch)
},
} |
{
// the face id the sketch is on
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: SketchSurface,
// The starting path.
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The paths in the sketch group.
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
} |
{
// arc's direction
ccw: string,
// the arc's center
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
// The x coordinate.
x: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
// The x coordinate.
x: number,
// The y coordinate.
y: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
},
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
value: [{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
},
// The id of the face.
id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face",
// The tag of the face.
value: string,
@ -109,16 +276,16 @@ const example = extrude(10, exampleSketch)
z: number,
},
},
// The position of the sketch group.
position: [number, number, number],
// The rotation of the sketch group base plane.
rotation: [number, number, number, number],
// The starting path.
start: {
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
@ -126,8 +293,12 @@ const example = extrude(10, exampleSketch)
value: [{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
@ -139,8 +310,12 @@ const example = extrude(10, exampleSketch)
center: [number, number],
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
@ -148,8 +323,12 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
@ -157,8 +336,12 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
@ -168,8 +351,12 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
@ -181,41 +368,32 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
// The x-axis of the sketch group base plane in the 3D space
xAxis: {
x: number,
y: number,
z: number,
},
// The y-axis of the sketch group base plane in the 3D space
yAxis: {
x: number,
y: number,
z: number,
},
// The z-axis of the sketch group base plane in the 3D space
zAxis: {
x: number,
y: number,
z: number,
},
}
```
* `tag`: `String` (OPTIONAL)
* `tag`: `TagDeclarator` (OPTIONAL)
```js
{
end: number,
start: number,
value: string,
}
```
### Returns
`SketchGroup` - A sketch group is a collection of paths.
```js
{
// The plane id or face id of the sketch group.
entityId: uuid,
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
@ -251,12 +429,181 @@ const example = extrude(10, exampleSketch)
},
} |
{
// the face id the sketch is on
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: SketchSurface,
// The starting path.
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The paths in the sketch group.
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
} |
{
// arc's direction
ccw: string,
// the arc's center
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
// The x coordinate.
x: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
// The x coordinate.
x: number,
// The y coordinate.
y: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
},
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
value: [{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
},
// The id of the face.
id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face",
// The tag of the face.
value: string,
@ -279,16 +626,16 @@ const example = extrude(10, exampleSketch)
z: number,
},
},
// The position of the sketch group.
position: [number, number, number],
// The rotation of the sketch group base plane.
rotation: [number, number, number, number],
// The starting path.
start: {
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
@ -296,8 +643,12 @@ const example = extrude(10, exampleSketch)
value: [{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
@ -309,8 +660,12 @@ const example = extrude(10, exampleSketch)
center: [number, number],
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
@ -318,8 +673,12 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
@ -327,8 +686,12 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
@ -338,8 +701,12 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
@ -351,30 +718,16 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
// The x-axis of the sketch group base plane in the 3D space
xAxis: {
x: number,
y: number,
z: number,
},
// The y-axis of the sketch group base plane in the 3D space
yAxis: {
x: number,
y: number,
z: number,
},
// The z-axis of the sketch group base plane in the 3D space
zAxis: {
x: number,
y: number,
z: number,
},
}
```

View File

@ -9,7 +9,7 @@ Draw an angled line that intersects with a given line.
```js
angledLineThatIntersects(data: AngledLineThatIntersectsData, sketch_group: SketchGroup, tag?: String) -> SketchGroup
angledLineThatIntersects(data: AngledLineThatIntersectsData, sketch_group: SketchGroup, tag?: TagDeclarator) -> SketchGroup
```
### Examples
@ -40,7 +40,9 @@ const example = extrude(10, exampleSketch)
// The angle of the line.
angle: number,
// The tag of the line to intersect with.
intersectTag: string,
intersectTag: {
value: string,
},
// The offset from the intersecting line.
offset: number,
}
@ -48,8 +50,6 @@ const example = extrude(10, exampleSketch)
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
```js
{
// The plane id or face id of the sketch group.
entityId: uuid,
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
@ -85,12 +85,181 @@ const example = extrude(10, exampleSketch)
},
} |
{
// the face id the sketch is on
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: SketchSurface,
// The starting path.
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The paths in the sketch group.
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
} |
{
// arc's direction
ccw: string,
// the arc's center
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
// The x coordinate.
x: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
// The x coordinate.
x: number,
// The y coordinate.
y: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
},
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
value: [{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
},
// The id of the face.
id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face",
// The tag of the face.
value: string,
@ -113,16 +282,16 @@ const example = extrude(10, exampleSketch)
z: number,
},
},
// The position of the sketch group.
position: [number, number, number],
// The rotation of the sketch group base plane.
rotation: [number, number, number, number],
// The starting path.
start: {
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
@ -130,8 +299,12 @@ const example = extrude(10, exampleSketch)
value: [{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
@ -143,8 +316,12 @@ const example = extrude(10, exampleSketch)
center: [number, number],
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
@ -152,8 +329,12 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
@ -161,8 +342,12 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
@ -172,8 +357,12 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
@ -185,41 +374,32 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
// The x-axis of the sketch group base plane in the 3D space
xAxis: {
x: number,
y: number,
z: number,
},
// The y-axis of the sketch group base plane in the 3D space
yAxis: {
x: number,
y: number,
z: number,
},
// The z-axis of the sketch group base plane in the 3D space
zAxis: {
x: number,
y: number,
z: number,
},
}
```
* `tag`: `String` (OPTIONAL)
* `tag`: `TagDeclarator` (OPTIONAL)
```js
{
end: number,
start: number,
value: string,
}
```
### Returns
`SketchGroup` - A sketch group is a collection of paths.
```js
{
// The plane id or face id of the sketch group.
entityId: uuid,
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
@ -255,12 +435,181 @@ const example = extrude(10, exampleSketch)
},
} |
{
// the face id the sketch is on
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: SketchSurface,
// The starting path.
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The paths in the sketch group.
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
} |
{
// arc's direction
ccw: string,
// the arc's center
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
// The x coordinate.
x: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
// The x coordinate.
x: number,
// The y coordinate.
y: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
},
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
value: [{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
},
// The id of the face.
id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face",
// The tag of the face.
value: string,
@ -283,16 +632,16 @@ const example = extrude(10, exampleSketch)
z: number,
},
},
// The position of the sketch group.
position: [number, number, number],
// The rotation of the sketch group base plane.
rotation: [number, number, number, number],
// The starting path.
start: {
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
@ -300,8 +649,12 @@ const example = extrude(10, exampleSketch)
value: [{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
@ -313,8 +666,12 @@ const example = extrude(10, exampleSketch)
center: [number, number],
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
@ -322,8 +679,12 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
@ -331,8 +692,12 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
@ -342,8 +707,12 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
@ -355,30 +724,16 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
// The x-axis of the sketch group base plane in the 3D space
xAxis: {
x: number,
y: number,
z: number,
},
// The y-axis of the sketch group base plane in the 3D space
yAxis: {
x: number,
y: number,
z: number,
},
// The z-axis of the sketch group base plane in the 3D space
zAxis: {
x: number,
y: number,
z: number,
},
}
```

View File

@ -9,7 +9,7 @@ Draw an angled line to a given x coordinate.
```js
angledLineToX(data: AngledLineToData, sketch_group: SketchGroup, tag?: String) -> SketchGroup
angledLineToX(data: AngledLineToData, sketch_group: SketchGroup, tag?: TagDeclarator) -> SketchGroup
```
### Examples
@ -41,8 +41,6 @@ const example = extrude(10, exampleSketch)
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
```js
{
// The plane id or face id of the sketch group.
entityId: uuid,
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
@ -78,12 +76,181 @@ const example = extrude(10, exampleSketch)
},
} |
{
// the face id the sketch is on
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: SketchSurface,
// The starting path.
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The paths in the sketch group.
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
} |
{
// arc's direction
ccw: string,
// the arc's center
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
// The x coordinate.
x: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
// The x coordinate.
x: number,
// The y coordinate.
y: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
},
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
value: [{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
},
// The id of the face.
id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face",
// The tag of the face.
value: string,
@ -106,16 +273,16 @@ const example = extrude(10, exampleSketch)
z: number,
},
},
// The position of the sketch group.
position: [number, number, number],
// The rotation of the sketch group base plane.
rotation: [number, number, number, number],
// The starting path.
start: {
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
@ -123,8 +290,12 @@ const example = extrude(10, exampleSketch)
value: [{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
@ -136,8 +307,12 @@ const example = extrude(10, exampleSketch)
center: [number, number],
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
@ -145,8 +320,12 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
@ -154,8 +333,12 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
@ -165,8 +348,12 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
@ -178,41 +365,32 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
// The x-axis of the sketch group base plane in the 3D space
xAxis: {
x: number,
y: number,
z: number,
},
// The y-axis of the sketch group base plane in the 3D space
yAxis: {
x: number,
y: number,
z: number,
},
// The z-axis of the sketch group base plane in the 3D space
zAxis: {
x: number,
y: number,
z: number,
},
}
```
* `tag`: `String` (OPTIONAL)
* `tag`: `TagDeclarator` (OPTIONAL)
```js
{
end: number,
start: number,
value: string,
}
```
### Returns
`SketchGroup` - A sketch group is a collection of paths.
```js
{
// The plane id or face id of the sketch group.
entityId: uuid,
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
@ -248,12 +426,181 @@ const example = extrude(10, exampleSketch)
},
} |
{
// the face id the sketch is on
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: SketchSurface,
// The starting path.
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The paths in the sketch group.
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
} |
{
// arc's direction
ccw: string,
// the arc's center
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
// The x coordinate.
x: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
// The x coordinate.
x: number,
// The y coordinate.
y: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
},
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
value: [{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
},
// The id of the face.
id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face",
// The tag of the face.
value: string,
@ -276,16 +623,16 @@ const example = extrude(10, exampleSketch)
z: number,
},
},
// The position of the sketch group.
position: [number, number, number],
// The rotation of the sketch group base plane.
rotation: [number, number, number, number],
// The starting path.
start: {
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
@ -293,8 +640,12 @@ const example = extrude(10, exampleSketch)
value: [{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
@ -306,8 +657,12 @@ const example = extrude(10, exampleSketch)
center: [number, number],
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
@ -315,8 +670,12 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
@ -324,8 +683,12 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
@ -335,8 +698,12 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
@ -348,30 +715,16 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
// The x-axis of the sketch group base plane in the 3D space
xAxis: {
x: number,
y: number,
z: number,
},
// The y-axis of the sketch group base plane in the 3D space
yAxis: {
x: number,
y: number,
z: number,
},
// The z-axis of the sketch group base plane in the 3D space
zAxis: {
x: number,
y: number,
z: number,
},
}
```

View File

@ -9,7 +9,7 @@ Draw an angled line to a given y coordinate.
```js
angledLineToY(data: AngledLineToData, sketch_group: SketchGroup, tag?: String) -> SketchGroup
angledLineToY(data: AngledLineToData, sketch_group: SketchGroup, tag?: TagDeclarator) -> SketchGroup
```
### Examples
@ -41,8 +41,6 @@ const example = extrude(10, exampleSketch)
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
```js
{
// The plane id or face id of the sketch group.
entityId: uuid,
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
@ -78,12 +76,181 @@ const example = extrude(10, exampleSketch)
},
} |
{
// the face id the sketch is on
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: SketchSurface,
// The starting path.
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The paths in the sketch group.
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
} |
{
// arc's direction
ccw: string,
// the arc's center
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
// The x coordinate.
x: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
// The x coordinate.
x: number,
// The y coordinate.
y: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
},
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
value: [{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
},
// The id of the face.
id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face",
// The tag of the face.
value: string,
@ -106,16 +273,16 @@ const example = extrude(10, exampleSketch)
z: number,
},
},
// The position of the sketch group.
position: [number, number, number],
// The rotation of the sketch group base plane.
rotation: [number, number, number, number],
// The starting path.
start: {
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
@ -123,8 +290,12 @@ const example = extrude(10, exampleSketch)
value: [{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
@ -136,8 +307,12 @@ const example = extrude(10, exampleSketch)
center: [number, number],
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
@ -145,8 +320,12 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
@ -154,8 +333,12 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
@ -165,8 +348,12 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
@ -178,41 +365,32 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
// The x-axis of the sketch group base plane in the 3D space
xAxis: {
x: number,
y: number,
z: number,
},
// The y-axis of the sketch group base plane in the 3D space
yAxis: {
x: number,
y: number,
z: number,
},
// The z-axis of the sketch group base plane in the 3D space
zAxis: {
x: number,
y: number,
z: number,
},
}
```
* `tag`: `String` (OPTIONAL)
* `tag`: `TagDeclarator` (OPTIONAL)
```js
{
end: number,
start: number,
value: string,
}
```
### Returns
`SketchGroup` - A sketch group is a collection of paths.
```js
{
// The plane id or face id of the sketch group.
entityId: uuid,
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
@ -248,12 +426,181 @@ const example = extrude(10, exampleSketch)
},
} |
{
// the face id the sketch is on
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: SketchSurface,
// The starting path.
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The paths in the sketch group.
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
} |
{
// arc's direction
ccw: string,
// the arc's center
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
// The x coordinate.
x: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
// The x coordinate.
x: number,
// The y coordinate.
y: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
},
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
value: [{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
},
// The id of the face.
id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face",
// The tag of the face.
value: string,
@ -276,16 +623,16 @@ const example = extrude(10, exampleSketch)
z: number,
},
},
// The position of the sketch group.
position: [number, number, number],
// The rotation of the sketch group base plane.
rotation: [number, number, number, number],
// The starting path.
start: {
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
@ -293,8 +640,12 @@ const example = extrude(10, exampleSketch)
value: [{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
@ -306,8 +657,12 @@ const example = extrude(10, exampleSketch)
center: [number, number],
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
@ -315,8 +670,12 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
@ -324,8 +683,12 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
@ -335,8 +698,12 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
@ -348,30 +715,16 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
// The x-axis of the sketch group base plane in the 3D space
xAxis: {
x: number,
y: number,
z: number,
},
// The y-axis of the sketch group base plane in the 3D space
yAxis: {
x: number,
y: number,
z: number,
},
// The z-axis of the sketch group base plane in the 3D space
zAxis: {
x: number,
y: number,
z: number,
},
}
```

View File

@ -9,7 +9,7 @@ Draw an arc.
```js
arc(data: ArcData, sketch_group: SketchGroup, tag?: String) -> SketchGroup
arc(data: ArcData, sketch_group: SketchGroup, tag?: TagDeclarator) -> SketchGroup
```
### Examples
@ -52,8 +52,6 @@ const exampleSketch = startSketchOn('XZ')
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
```js
{
// The plane id or face id of the sketch group.
entityId: uuid,
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
@ -89,12 +87,181 @@ const exampleSketch = startSketchOn('XZ')
},
} |
{
// the face id the sketch is on
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: SketchSurface,
// The starting path.
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The paths in the sketch group.
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
} |
{
// arc's direction
ccw: string,
// the arc's center
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
// The x coordinate.
x: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
// The x coordinate.
x: number,
// The y coordinate.
y: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
},
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
value: [{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
},
// The id of the face.
id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face",
// The tag of the face.
value: string,
@ -117,16 +284,16 @@ const exampleSketch = startSketchOn('XZ')
z: number,
},
},
// The position of the sketch group.
position: [number, number, number],
// The rotation of the sketch group base plane.
rotation: [number, number, number, number],
// The starting path.
start: {
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
@ -134,8 +301,12 @@ const exampleSketch = startSketchOn('XZ')
value: [{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
@ -147,8 +318,12 @@ const exampleSketch = startSketchOn('XZ')
center: [number, number],
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
@ -156,8 +331,12 @@ const exampleSketch = startSketchOn('XZ')
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
@ -165,8 +344,12 @@ const exampleSketch = startSketchOn('XZ')
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
@ -176,8 +359,12 @@ const exampleSketch = startSketchOn('XZ')
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
@ -189,41 +376,32 @@ const exampleSketch = startSketchOn('XZ')
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
// The x-axis of the sketch group base plane in the 3D space
xAxis: {
x: number,
y: number,
z: number,
},
// The y-axis of the sketch group base plane in the 3D space
yAxis: {
x: number,
y: number,
z: number,
},
// The z-axis of the sketch group base plane in the 3D space
zAxis: {
x: number,
y: number,
z: number,
},
}
```
* `tag`: `String` (OPTIONAL)
* `tag`: `TagDeclarator` (OPTIONAL)
```js
{
end: number,
start: number,
value: string,
}
```
### Returns
`SketchGroup` - A sketch group is a collection of paths.
```js
{
// The plane id or face id of the sketch group.
entityId: uuid,
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
@ -259,12 +437,181 @@ const exampleSketch = startSketchOn('XZ')
},
} |
{
// the face id the sketch is on
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: SketchSurface,
// The starting path.
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The paths in the sketch group.
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
} |
{
// arc's direction
ccw: string,
// the arc's center
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
// The x coordinate.
x: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
// The x coordinate.
x: number,
// The y coordinate.
y: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
},
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
value: [{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
},
// The id of the face.
id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face",
// The tag of the face.
value: string,
@ -287,16 +634,16 @@ const exampleSketch = startSketchOn('XZ')
z: number,
},
},
// The position of the sketch group.
position: [number, number, number],
// The rotation of the sketch group base plane.
rotation: [number, number, number, number],
// The starting path.
start: {
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
@ -304,8 +651,12 @@ const exampleSketch = startSketchOn('XZ')
value: [{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
@ -317,8 +668,12 @@ const exampleSketch = startSketchOn('XZ')
center: [number, number],
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
@ -326,8 +681,12 @@ const exampleSketch = startSketchOn('XZ')
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
@ -335,8 +694,12 @@ const exampleSketch = startSketchOn('XZ')
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
@ -346,8 +709,12 @@ const exampleSketch = startSketchOn('XZ')
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
@ -359,30 +726,16 @@ const exampleSketch = startSketchOn('XZ')
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
// The x-axis of the sketch group base plane in the 3D space
xAxis: {
x: number,
y: number,
z: number,
},
// The y-axis of the sketch group base plane in the 3D space
yAxis: {
x: number,
y: number,
z: number,
},
// The z-axis of the sketch group base plane in the 3D space
zAxis: {
x: number,
y: number,
z: number,
},
}
```

View File

@ -9,7 +9,7 @@ Draw a bezier curve.
```js
bezierCurve(data: BezierData, sketch_group: SketchGroup, tag?: String) -> SketchGroup
bezierCurve(data: BezierData, sketch_group: SketchGroup, tag?: TagDeclarator) -> SketchGroup
```
### Examples
@ -47,8 +47,6 @@ const example = extrude(10, exampleSketch)
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
```js
{
// The plane id or face id of the sketch group.
entityId: uuid,
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
@ -84,12 +82,181 @@ const example = extrude(10, exampleSketch)
},
} |
{
// the face id the sketch is on
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: SketchSurface,
// The starting path.
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The paths in the sketch group.
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
} |
{
// arc's direction
ccw: string,
// the arc's center
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
// The x coordinate.
x: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
// The x coordinate.
x: number,
// The y coordinate.
y: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
},
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
value: [{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
},
// The id of the face.
id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face",
// The tag of the face.
value: string,
@ -112,16 +279,16 @@ const example = extrude(10, exampleSketch)
z: number,
},
},
// The position of the sketch group.
position: [number, number, number],
// The rotation of the sketch group base plane.
rotation: [number, number, number, number],
// The starting path.
start: {
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
@ -129,8 +296,12 @@ const example = extrude(10, exampleSketch)
value: [{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
@ -142,8 +313,12 @@ const example = extrude(10, exampleSketch)
center: [number, number],
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
@ -151,8 +326,12 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
@ -160,8 +339,12 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
@ -171,8 +354,12 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
@ -184,41 +371,32 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
// The x-axis of the sketch group base plane in the 3D space
xAxis: {
x: number,
y: number,
z: number,
},
// The y-axis of the sketch group base plane in the 3D space
yAxis: {
x: number,
y: number,
z: number,
},
// The z-axis of the sketch group base plane in the 3D space
zAxis: {
x: number,
y: number,
z: number,
},
}
```
* `tag`: `String` (OPTIONAL)
* `tag`: `TagDeclarator` (OPTIONAL)
```js
{
end: number,
start: number,
value: string,
}
```
### Returns
`SketchGroup` - A sketch group is a collection of paths.
```js
{
// The plane id or face id of the sketch group.
entityId: uuid,
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
@ -254,12 +432,181 @@ const example = extrude(10, exampleSketch)
},
} |
{
// the face id the sketch is on
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: SketchSurface,
// The starting path.
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The paths in the sketch group.
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
} |
{
// arc's direction
ccw: string,
// the arc's center
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
// The x coordinate.
x: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
// The x coordinate.
x: number,
// The y coordinate.
y: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
},
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
value: [{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
},
// The id of the face.
id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face",
// The tag of the face.
value: string,
@ -282,16 +629,16 @@ const example = extrude(10, exampleSketch)
z: number,
},
},
// The position of the sketch group.
position: [number, number, number],
// The rotation of the sketch group base plane.
rotation: [number, number, number, number],
// The starting path.
start: {
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
@ -299,8 +646,12 @@ const example = extrude(10, exampleSketch)
value: [{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
@ -312,8 +663,12 @@ const example = extrude(10, exampleSketch)
center: [number, number],
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
@ -321,8 +676,12 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
@ -330,8 +689,12 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
@ -341,8 +704,12 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
@ -354,30 +721,16 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
// The x-axis of the sketch group base plane in the 3D space
xAxis: {
x: number,
y: number,
z: number,
},
// The y-axis of the sketch group base plane in the 3D space
yAxis: {
x: number,
y: number,
z: number,
},
// The z-axis of the sketch group base plane in the 3D space
zAxis: {
x: number,
y: number,
z: number,
},
}
```

View File

@ -9,7 +9,7 @@ Create chamfers on tagged paths.
```js
chamfer(data: ChamferData, extrude_group: ExtrudeGroup) -> ExtrudeGroup
chamfer(data: ChamferData, extrude_group: ExtrudeGroup, tag?: TagDeclarator) -> ExtrudeGroup
```
### Examples
@ -50,7 +50,9 @@ const mountingPlate = extrude(thickness, mountingPlateSketch)
length: number,
// The tags of the paths you want to chamfer.
tags: [uuid |
string],
{
value: string,
}],
}
```
* `extrude_group`: `ExtrudeGroup` - An extrude group is a collection of extrude surfaces. (REQUIRED)
@ -58,20 +60,182 @@ string],
{
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The position of the extrude group.
position: [number, number, number],
// The rotation of the extrude group.
rotation: [number, number, number, number],
// The sketch group paths.
sketchGroupValues: [{
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: {
// The id of the plane.
id: uuid,
// Origin of the plane.
origin: {
x: number,
y: number,
z: number,
},
type: "plane",
// Type for a plane.
value: "XY" | "XZ" | "YZ" | "Custom",
// What should the planes X axis be?
xAxis: {
x: number,
y: number,
z: number,
},
// What should the planes Y axis be?
yAxis: {
x: number,
y: number,
z: number,
},
// The z-axis (normal).
zAxis: {
x: number,
y: number,
z: number,
},
} |
{
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: SketchGroup,
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
value: [{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
},
// The id of the face.
id: uuid,
type: "face",
// The tag of the face.
value: string,
// What should the faces X axis be?
xAxis: {
x: number,
y: number,
z: number,
},
// What should the faces Y axis be?
yAxis: {
x: number,
y: number,
z: number,
},
// The z-axis (normal).
zAxis: {
x: number,
y: number,
z: number,
},
},
// The starting path.
start: {
// The from point.
from: [number, number],
// The name of the path.
name: string,
// 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",
@ -83,8 +247,12 @@ string],
center: [number, number],
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
@ -92,8 +260,12 @@ string],
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
@ -101,8 +273,12 @@ string],
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
@ -112,8 +288,12 @@ string],
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
@ -125,12 +305,17 @@ string],
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
},
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
@ -139,14 +324,14 @@ string],
faceId: uuid,
// The id of the geometry.
id: uuid,
// The name.
name: string,
// The position.
position: [number, number, number],
// The rotation.
rotation: [number, number, number, number],
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
@ -154,34 +339,24 @@ string],
faceId: uuid,
// The id of the geometry.
id: uuid,
// The name.
name: string,
// The position.
position: [number, number, number],
// The rotation.
rotation: [number, number, number, number],
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
// The x-axis of the extrude group base plane in the 3D space
xAxis: {
x: number,
y: number,
z: number,
},
// The y-axis of the extrude group base plane in the 3D space
yAxis: {
x: number,
y: number,
z: number,
},
// The z-axis of the extrude group base plane in the 3D space
zAxis: {
x: number,
y: number,
z: number,
},
}
```
* `tag`: `TagDeclarator` (OPTIONAL)
```js
{
end: number,
start: number,
value: string,
}
```
@ -192,20 +367,182 @@ string],
{
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The position of the extrude group.
position: [number, number, number],
// The rotation of the extrude group.
rotation: [number, number, number, number],
// The sketch group paths.
sketchGroupValues: [{
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: {
// The id of the plane.
id: uuid,
// Origin of the plane.
origin: {
x: number,
y: number,
z: number,
},
type: "plane",
// Type for a plane.
value: "XY" | "XZ" | "YZ" | "Custom",
// What should the planes X axis be?
xAxis: {
x: number,
y: number,
z: number,
},
// What should the planes Y axis be?
yAxis: {
x: number,
y: number,
z: number,
},
// The z-axis (normal).
zAxis: {
x: number,
y: number,
z: number,
},
} |
{
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: SketchGroup,
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
value: [{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
},
// The id of the face.
id: uuid,
type: "face",
// The tag of the face.
value: string,
// What should the faces X axis be?
xAxis: {
x: number,
y: number,
z: number,
},
// What should the faces Y axis be?
yAxis: {
x: number,
y: number,
z: number,
},
// The z-axis (normal).
zAxis: {
x: number,
y: number,
z: number,
},
},
// The starting path.
start: {
// The from point.
from: [number, number],
// The name of the path.
name: string,
// 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",
@ -217,8 +554,12 @@ string],
center: [number, number],
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
@ -226,8 +567,12 @@ string],
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
@ -235,8 +580,12 @@ string],
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
@ -246,8 +595,12 @@ string],
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
@ -259,12 +612,17 @@ string],
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
},
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
@ -273,14 +631,14 @@ string],
faceId: uuid,
// The id of the geometry.
id: uuid,
// The name.
name: string,
// The position.
position: [number, number, number],
// The rotation.
rotation: [number, number, number, number],
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
@ -288,34 +646,16 @@ string],
faceId: uuid,
// The id of the geometry.
id: uuid,
// The name.
name: string,
// The position.
position: [number, number, number],
// The rotation.
rotation: [number, number, number, number],
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
// The x-axis of the extrude group base plane in the 3D space
xAxis: {
x: number,
y: number,
z: number,
},
// The y-axis of the extrude group base plane in the 3D space
yAxis: {
x: number,
y: number,
z: number,
},
// The z-axis of the extrude group base plane in the 3D space
zAxis: {
x: number,
y: number,
z: number,
},
}
```

View File

@ -9,7 +9,7 @@ Sketch a circle.
```js
circle(center: [number], radius: number, tag?: String, sketch_surface_or_group: SketchSurfaceOrGroup) -> SketchGroup
circle(center: [number], radius: number, tag?: TagDeclarator, sketch_surface_or_group: SketchSurfaceOrGroup) -> SketchGroup
```
### Examples
@ -41,7 +41,14 @@ const example = extrude(5, exampleSketch)
* `center`: `[number]` (REQUIRED)
* `radius`: `number` (REQUIRED)
* `tag`: `String` (OPTIONAL)
* `tag`: `TagDeclarator` (OPTIONAL)
```js
{
end: number,
start: number,
value: string,
}
```
* `sketch_surface_or_group`: `SketchSurfaceOrGroup` - A sketch surface or a sketch group. (REQUIRED)
```js
{
@ -76,12 +83,181 @@ const example = extrude(5, exampleSketch)
},
} |
{
// the face id the sketch is on
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: SketchSurface,
// The starting path.
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The paths in the sketch group.
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
} |
{
// arc's direction
ccw: string,
// the arc's center
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
// The x coordinate.
x: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
// The x coordinate.
x: number,
// The y coordinate.
y: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
},
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
value: [{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
},
// The id of the face.
id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face",
// The tag of the face.
value: string,
@ -105,8 +281,6 @@ const example = extrude(5, exampleSketch)
},
} |
{
// The plane id or face id of the sketch group.
entityId: uuid,
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
@ -142,12 +316,74 @@ const example = extrude(5, exampleSketch)
},
} |
{
// the face id the sketch is on
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: SketchGroup,
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
value: [{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
},
// The id of the face.
id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face",
// The tag of the face.
value: string,
@ -170,16 +406,16 @@ const example = extrude(5, exampleSketch)
z: number,
},
},
// The position of the sketch group.
position: [number, number, number],
// The rotation of the sketch group base plane.
rotation: [number, number, number, number],
// The starting path.
start: {
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
@ -187,8 +423,12 @@ const example = extrude(5, exampleSketch)
value: [{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
@ -200,8 +440,12 @@ const example = extrude(5, exampleSketch)
center: [number, number],
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
@ -209,8 +453,12 @@ const example = extrude(5, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
@ -218,8 +466,12 @@ const example = extrude(5, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
@ -229,8 +481,12 @@ const example = extrude(5, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
@ -242,30 +498,16 @@ const example = extrude(5, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
// The x-axis of the sketch group base plane in the 3D space
xAxis: {
x: number,
y: number,
z: number,
},
// The y-axis of the sketch group base plane in the 3D space
yAxis: {
x: number,
y: number,
z: number,
},
// The z-axis of the sketch group base plane in the 3D space
zAxis: {
x: number,
y: number,
z: number,
},
}
```
@ -274,8 +516,6 @@ const example = extrude(5, exampleSketch)
`SketchGroup` - A sketch group is a collection of paths.
```js
{
// The plane id or face id of the sketch group.
entityId: uuid,
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
@ -311,12 +551,181 @@ const example = extrude(5, exampleSketch)
},
} |
{
// the face id the sketch is on
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: SketchSurface,
// The starting path.
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The paths in the sketch group.
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
} |
{
// arc's direction
ccw: string,
// the arc's center
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
// The x coordinate.
x: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
// The x coordinate.
x: number,
// The y coordinate.
y: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
},
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
value: [{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
},
// The id of the face.
id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face",
// The tag of the face.
value: string,
@ -339,16 +748,16 @@ const example = extrude(5, exampleSketch)
z: number,
},
},
// The position of the sketch group.
position: [number, number, number],
// The rotation of the sketch group base plane.
rotation: [number, number, number, number],
// The starting path.
start: {
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
@ -356,8 +765,12 @@ const example = extrude(5, exampleSketch)
value: [{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
@ -369,8 +782,12 @@ const example = extrude(5, exampleSketch)
center: [number, number],
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
@ -378,8 +795,12 @@ const example = extrude(5, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
@ -387,8 +808,12 @@ const example = extrude(5, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
@ -398,8 +823,12 @@ const example = extrude(5, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
@ -411,30 +840,16 @@ const example = extrude(5, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
// The x-axis of the sketch group base plane in the 3D space
xAxis: {
x: number,
y: number,
z: number,
},
// The y-axis of the sketch group base plane in the 3D space
yAxis: {
x: number,
y: number,
z: number,
},
// The z-axis of the sketch group base plane in the 3D space
zAxis: {
x: number,
y: number,
z: number,
},
}
```

View File

@ -9,7 +9,7 @@ Close the current sketch.
```js
close(sketch_group: SketchGroup, tag?: String) -> SketchGroup
close(sketch_group: SketchGroup, tag?: TagDeclarator) -> SketchGroup
```
### Examples
@ -42,8 +42,6 @@ const example = extrude(10, exampleSketch)
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
```js
{
// The plane id or face id of the sketch group.
entityId: uuid,
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
@ -79,12 +77,181 @@ const example = extrude(10, exampleSketch)
},
} |
{
// the face id the sketch is on
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: SketchSurface,
// The starting path.
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The paths in the sketch group.
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
} |
{
// arc's direction
ccw: string,
// the arc's center
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
// The x coordinate.
x: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
// The x coordinate.
x: number,
// The y coordinate.
y: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
},
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
value: [{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
},
// The id of the face.
id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face",
// The tag of the face.
value: string,
@ -107,16 +274,16 @@ const example = extrude(10, exampleSketch)
z: number,
},
},
// The position of the sketch group.
position: [number, number, number],
// The rotation of the sketch group base plane.
rotation: [number, number, number, number],
// The starting path.
start: {
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
@ -124,8 +291,12 @@ const example = extrude(10, exampleSketch)
value: [{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
@ -137,8 +308,12 @@ const example = extrude(10, exampleSketch)
center: [number, number],
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
@ -146,8 +321,12 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
@ -155,8 +334,12 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
@ -166,8 +349,12 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
@ -179,41 +366,32 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
// The x-axis of the sketch group base plane in the 3D space
xAxis: {
x: number,
y: number,
z: number,
},
// The y-axis of the sketch group base plane in the 3D space
yAxis: {
x: number,
y: number,
z: number,
},
// The z-axis of the sketch group base plane in the 3D space
zAxis: {
x: number,
y: number,
z: number,
},
}
```
* `tag`: `String` (OPTIONAL)
* `tag`: `TagDeclarator` (OPTIONAL)
```js
{
end: number,
start: number,
value: string,
}
```
### Returns
`SketchGroup` - A sketch group is a collection of paths.
```js
{
// The plane id or face id of the sketch group.
entityId: uuid,
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
@ -249,12 +427,181 @@ const example = extrude(10, exampleSketch)
},
} |
{
// the face id the sketch is on
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: SketchSurface,
// The starting path.
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The paths in the sketch group.
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
} |
{
// arc's direction
ccw: string,
// the arc's center
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
// The x coordinate.
x: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
// The x coordinate.
x: number,
// The y coordinate.
y: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
},
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
value: [{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
},
// The id of the face.
id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face",
// The tag of the face.
value: string,
@ -277,16 +624,16 @@ const example = extrude(10, exampleSketch)
z: number,
},
},
// The position of the sketch group.
position: [number, number, number],
// The rotation of the sketch group base plane.
rotation: [number, number, number, number],
// The starting path.
start: {
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
@ -294,8 +641,12 @@ const example = extrude(10, exampleSketch)
value: [{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
@ -307,8 +658,12 @@ const example = extrude(10, exampleSketch)
center: [number, number],
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
@ -316,8 +671,12 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
@ -325,8 +684,12 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
@ -336,8 +699,12 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
@ -349,30 +716,16 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
// The x-axis of the sketch group base plane in the 3D space
xAxis: {
x: number,
y: number,
z: number,
},
// The y-axis of the sketch group base plane in the 3D space
yAxis: {
x: number,
y: number,
z: number,
},
// The z-axis of the sketch group base plane in the 3D space
zAxis: {
x: number,
y: number,
z: number,
},
}
```

View File

@ -67,8 +67,6 @@ const example = extrude(10, exampleSketch)
* `sketch_group_set`: `SketchGroupSet` - A sketch group or a group of sketch groups. (REQUIRED)
```js
{
// The plane id or face id of the sketch group.
entityId: uuid,
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
@ -104,12 +102,181 @@ const example = extrude(10, exampleSketch)
},
} |
{
// the face id the sketch is on
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: SketchSurface,
// The starting path.
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The paths in the sketch group.
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
} |
{
// arc's direction
ccw: string,
// the arc's center
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
// The x coordinate.
x: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
// The x coordinate.
x: number,
// The y coordinate.
y: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
},
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
value: [{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
},
// The id of the face.
id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face",
// The tag of the face.
value: string,
@ -132,16 +299,16 @@ const example = extrude(10, exampleSketch)
z: number,
},
},
// The position of the sketch group.
position: [number, number, number],
// The rotation of the sketch group base plane.
rotation: [number, number, number, number],
// The starting path.
start: {
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
@ -150,8 +317,12 @@ const example = extrude(10, exampleSketch)
value: [{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
@ -163,8 +334,12 @@ const example = extrude(10, exampleSketch)
center: [number, number],
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
@ -172,8 +347,12 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
@ -181,8 +360,12 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
@ -192,8 +375,12 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
@ -205,30 +392,16 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
// The x-axis of the sketch group base plane in the 3D space
xAxis: {
x: number,
y: number,
z: number,
},
// The y-axis of the sketch group base plane in the 3D space
yAxis: {
x: number,
y: number,
z: number,
},
// The z-axis of the sketch group base plane in the 3D space
zAxis: {
x: number,
y: number,
z: number,
},
} |
{
type: "sketchGroups",
@ -242,20 +415,182 @@ const example = extrude(10, exampleSketch)
{
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The position of the extrude group.
position: [number, number, number],
// The rotation of the extrude group.
rotation: [number, number, number, number],
// The sketch group paths.
sketchGroupValues: [{
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: {
// The id of the plane.
id: uuid,
// Origin of the plane.
origin: {
x: number,
y: number,
z: number,
},
type: "plane",
// Type for a plane.
value: "XY" | "XZ" | "YZ" | "Custom",
// What should the planes X axis be?
xAxis: {
x: number,
y: number,
z: number,
},
// What should the planes Y axis be?
yAxis: {
x: number,
y: number,
z: number,
},
// The z-axis (normal).
zAxis: {
x: number,
y: number,
z: number,
},
} |
{
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: SketchGroup,
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
value: [{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
},
// The id of the face.
id: uuid,
type: "face",
// The tag of the face.
value: string,
// What should the faces X axis be?
xAxis: {
x: number,
y: number,
z: number,
},
// What should the faces Y axis be?
yAxis: {
x: number,
y: number,
z: number,
},
// The z-axis (normal).
zAxis: {
x: number,
y: number,
z: number,
},
},
// The starting path.
start: {
// The from point.
from: [number, number],
// The name of the path.
name: string,
// 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",
@ -267,8 +602,12 @@ const example = extrude(10, exampleSketch)
center: [number, number],
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
@ -276,8 +615,12 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
@ -285,8 +628,12 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
@ -296,8 +643,12 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
@ -309,12 +660,17 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
},
// The id of the extrusion start cap
startCapId: uuid,
type: "extrudeGroup",
@ -324,14 +680,14 @@ const example = extrude(10, exampleSketch)
faceId: uuid,
// The id of the geometry.
id: uuid,
// The name.
name: string,
// The position.
position: [number, number, number],
// The rotation.
rotation: [number, number, number, number],
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
@ -339,34 +695,16 @@ const example = extrude(10, exampleSketch)
faceId: uuid,
// The id of the geometry.
id: uuid,
// The name.
name: string,
// The position.
position: [number, number, number],
// The rotation.
rotation: [number, number, number, number],
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
// The x-axis of the extrude group base plane in the 3D space
xAxis: {
x: number,
y: number,
z: number,
},
// The y-axis of the extrude group base plane in the 3D space
yAxis: {
x: number,
y: number,
z: number,
},
// The z-axis of the extrude group base plane in the 3D space
zAxis: {
x: number,
y: number,
z: number,
},
} |
{
type: "extrudeGroups",

View File

@ -50,7 +50,9 @@ const mountingPlate = extrude(thickness, mountingPlateSketch)
radius: number,
// The tags of the paths you want to fillet.
tags: [uuid |
string],
{
value: string,
}],
}
```
* `extrude_group`: `ExtrudeGroup` - An extrude group is a collection of extrude surfaces. (REQUIRED)
@ -58,20 +60,182 @@ string],
{
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The position of the extrude group.
position: [number, number, number],
// The rotation of the extrude group.
rotation: [number, number, number, number],
// The sketch group paths.
sketchGroupValues: [{
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: {
// The id of the plane.
id: uuid,
// Origin of the plane.
origin: {
x: number,
y: number,
z: number,
},
type: "plane",
// Type for a plane.
value: "XY" | "XZ" | "YZ" | "Custom",
// What should the planes X axis be?
xAxis: {
x: number,
y: number,
z: number,
},
// What should the planes Y axis be?
yAxis: {
x: number,
y: number,
z: number,
},
// The z-axis (normal).
zAxis: {
x: number,
y: number,
z: number,
},
} |
{
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: SketchGroup,
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
value: [{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
},
// The id of the face.
id: uuid,
type: "face",
// The tag of the face.
value: string,
// What should the faces X axis be?
xAxis: {
x: number,
y: number,
z: number,
},
// What should the faces Y axis be?
yAxis: {
x: number,
y: number,
z: number,
},
// The z-axis (normal).
zAxis: {
x: number,
y: number,
z: number,
},
},
// The starting path.
start: {
// The from point.
from: [number, number],
// The name of the path.
name: string,
// 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",
@ -83,8 +247,12 @@ string],
center: [number, number],
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
@ -92,8 +260,12 @@ string],
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
@ -101,8 +273,12 @@ string],
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
@ -112,8 +288,12 @@ string],
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
@ -125,12 +305,17 @@ string],
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
},
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
@ -139,14 +324,14 @@ string],
faceId: uuid,
// The id of the geometry.
id: uuid,
// The name.
name: string,
// The position.
position: [number, number, number],
// The rotation.
rotation: [number, number, number, number],
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
@ -154,34 +339,16 @@ string],
faceId: uuid,
// The id of the geometry.
id: uuid,
// The name.
name: string,
// The position.
position: [number, number, number],
// The rotation.
rotation: [number, number, number, number],
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
// The x-axis of the extrude group base plane in the 3D space
xAxis: {
x: number,
y: number,
z: number,
},
// The y-axis of the extrude group base plane in the 3D space
yAxis: {
x: number,
y: number,
z: number,
},
// The z-axis of the extrude group base plane in the 3D space
zAxis: {
x: number,
y: number,
z: number,
},
}
```
@ -192,20 +359,182 @@ string],
{
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The position of the extrude group.
position: [number, number, number],
// The rotation of the extrude group.
rotation: [number, number, number, number],
// The sketch group paths.
sketchGroupValues: [{
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: {
// The id of the plane.
id: uuid,
// Origin of the plane.
origin: {
x: number,
y: number,
z: number,
},
type: "plane",
// Type for a plane.
value: "XY" | "XZ" | "YZ" | "Custom",
// What should the planes X axis be?
xAxis: {
x: number,
y: number,
z: number,
},
// What should the planes Y axis be?
yAxis: {
x: number,
y: number,
z: number,
},
// The z-axis (normal).
zAxis: {
x: number,
y: number,
z: number,
},
} |
{
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: SketchGroup,
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
value: [{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
},
// The id of the face.
id: uuid,
type: "face",
// The tag of the face.
value: string,
// What should the faces X axis be?
xAxis: {
x: number,
y: number,
z: number,
},
// What should the faces Y axis be?
yAxis: {
x: number,
y: number,
z: number,
},
// The z-axis (normal).
zAxis: {
x: number,
y: number,
z: number,
},
},
// The starting path.
start: {
// The from point.
from: [number, number],
// The name of the path.
name: string,
// 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",
@ -217,8 +546,12 @@ string],
center: [number, number],
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
@ -226,8 +559,12 @@ string],
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
@ -235,8 +572,12 @@ string],
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
@ -246,8 +587,12 @@ string],
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
@ -259,12 +604,17 @@ string],
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
},
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
@ -273,14 +623,14 @@ string],
faceId: uuid,
// The id of the geometry.
id: uuid,
// The name.
name: string,
// The position.
position: [number, number, number],
// The rotation.
rotation: [number, number, number, number],
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
@ -288,34 +638,16 @@ string],
faceId: uuid,
// The id of the geometry.
id: uuid,
// The name.
name: string,
// The position.
position: [number, number, number],
// The rotation.
rotation: [number, number, number, number],
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
// The x-axis of the extrude group base plane in the 3D space
xAxis: {
x: number,
y: number,
z: number,
},
// The y-axis of the extrude group base plane in the 3D space
yAxis: {
x: number,
y: number,
z: number,
},
// The z-axis of the extrude group base plane in the 3D space
zAxis: {
x: number,
y: number,
z: number,
},
}
```

View File

@ -9,7 +9,7 @@ Get an edge on a 3D solid.
```js
getEdge(tag: String, extrude_group: ExtrudeGroup) -> Uuid
getEdge(tag: TagIdentifier, extrude_group: ExtrudeGroup) -> Uuid
```
### Examples
@ -39,26 +39,193 @@ const revolution = startSketchOn(box, "revolveAxis")
### Arguments
* `tag`: `String` (REQUIRED)
* `tag`: `TagIdentifier` (REQUIRED)
```js
{
value: string,
}
```
* `extrude_group`: `ExtrudeGroup` - An extrude group is a collection of extrude surfaces. (REQUIRED)
```js
{
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The position of the extrude group.
position: [number, number, number],
// The rotation of the extrude group.
rotation: [number, number, number, number],
// The sketch group paths.
sketchGroupValues: [{
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: {
// The id of the plane.
id: uuid,
// Origin of the plane.
origin: {
x: number,
y: number,
z: number,
},
type: "plane",
// Type for a plane.
value: "XY" | "XZ" | "YZ" | "Custom",
// What should the planes X axis be?
xAxis: {
x: number,
y: number,
z: number,
},
// What should the planes Y axis be?
yAxis: {
x: number,
y: number,
z: number,
},
// The z-axis (normal).
zAxis: {
x: number,
y: number,
z: number,
},
} |
{
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: SketchGroup,
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
value: [{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
},
// The id of the face.
id: uuid,
type: "face",
// The tag of the face.
value: string,
// What should the faces X axis be?
xAxis: {
x: number,
y: number,
z: number,
},
// What should the faces Y axis be?
yAxis: {
x: number,
y: number,
z: number,
},
// The z-axis (normal).
zAxis: {
x: number,
y: number,
z: number,
},
},
// The starting path.
start: {
// The from point.
from: [number, number],
// The name of the path.
name: string,
// 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",
@ -70,8 +237,12 @@ const revolution = startSketchOn(box, "revolveAxis")
center: [number, number],
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
@ -79,8 +250,12 @@ const revolution = startSketchOn(box, "revolveAxis")
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
@ -88,8 +263,12 @@ const revolution = startSketchOn(box, "revolveAxis")
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
@ -99,8 +278,12 @@ const revolution = startSketchOn(box, "revolveAxis")
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
@ -112,12 +295,17 @@ const revolution = startSketchOn(box, "revolveAxis")
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
},
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
@ -126,14 +314,14 @@ const revolution = startSketchOn(box, "revolveAxis")
faceId: uuid,
// The id of the geometry.
id: uuid,
// The name.
name: string,
// The position.
position: [number, number, number],
// The rotation.
rotation: [number, number, number, number],
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
@ -141,34 +329,16 @@ const revolution = startSketchOn(box, "revolveAxis")
faceId: uuid,
// The id of the geometry.
id: uuid,
// The name.
name: string,
// The position.
position: [number, number, number],
// The rotation.
rotation: [number, number, number, number],
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
// The x-axis of the extrude group base plane in the 3D space
xAxis: {
x: number,
y: number,
z: number,
},
// The y-axis of the extrude group base plane in the 3D space
yAxis: {
x: number,
y: number,
z: number,
},
// The z-axis of the extrude group base plane in the 3D space
zAxis: {
x: number,
y: number,
z: number,
},
}
```

View File

@ -9,7 +9,7 @@ Get the next adjacent edge to the edge given.
```js
getNextAdjacentEdge(tag: String, extrude_group: ExtrudeGroup) -> Uuid
getNextAdjacentEdge(tag: TagIdentifier, extrude_group: ExtrudeGroup) -> Uuid
```
### Examples
@ -37,26 +37,193 @@ const example = extrude(5, exampleSketch)
### Arguments
* `tag`: `String` (REQUIRED)
* `tag`: `TagIdentifier` (REQUIRED)
```js
{
value: string,
}
```
* `extrude_group`: `ExtrudeGroup` - An extrude group is a collection of extrude surfaces. (REQUIRED)
```js
{
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The position of the extrude group.
position: [number, number, number],
// The rotation of the extrude group.
rotation: [number, number, number, number],
// The sketch group paths.
sketchGroupValues: [{
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: {
// The id of the plane.
id: uuid,
// Origin of the plane.
origin: {
x: number,
y: number,
z: number,
},
type: "plane",
// Type for a plane.
value: "XY" | "XZ" | "YZ" | "Custom",
// What should the planes X axis be?
xAxis: {
x: number,
y: number,
z: number,
},
// What should the planes Y axis be?
yAxis: {
x: number,
y: number,
z: number,
},
// The z-axis (normal).
zAxis: {
x: number,
y: number,
z: number,
},
} |
{
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: SketchGroup,
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
value: [{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
},
// The id of the face.
id: uuid,
type: "face",
// The tag of the face.
value: string,
// What should the faces X axis be?
xAxis: {
x: number,
y: number,
z: number,
},
// What should the faces Y axis be?
yAxis: {
x: number,
y: number,
z: number,
},
// The z-axis (normal).
zAxis: {
x: number,
y: number,
z: number,
},
},
// The starting path.
start: {
// The from point.
from: [number, number],
// The name of the path.
name: string,
// 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",
@ -68,8 +235,12 @@ const example = extrude(5, exampleSketch)
center: [number, number],
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
@ -77,8 +248,12 @@ const example = extrude(5, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
@ -86,8 +261,12 @@ const example = extrude(5, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
@ -97,8 +276,12 @@ const example = extrude(5, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
@ -110,12 +293,17 @@ const example = extrude(5, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
},
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
@ -124,14 +312,14 @@ const example = extrude(5, exampleSketch)
faceId: uuid,
// The id of the geometry.
id: uuid,
// The name.
name: string,
// The position.
position: [number, number, number],
// The rotation.
rotation: [number, number, number, number],
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
@ -139,34 +327,16 @@ const example = extrude(5, exampleSketch)
faceId: uuid,
// The id of the geometry.
id: uuid,
// The name.
name: string,
// The position.
position: [number, number, number],
// The rotation.
rotation: [number, number, number, number],
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
// The x-axis of the extrude group base plane in the 3D space
xAxis: {
x: number,
y: number,
z: number,
},
// The y-axis of the extrude group base plane in the 3D space
yAxis: {
x: number,
y: number,
z: number,
},
// The z-axis of the extrude group base plane in the 3D space
zAxis: {
x: number,
y: number,
z: number,
},
}
```

View File

@ -9,7 +9,7 @@ Get the opposite edge to the edge given.
```js
getOppositeEdge(tag: String, extrude_group: ExtrudeGroup) -> Uuid
getOppositeEdge(tag: TagIdentifier, extrude_group: ExtrudeGroup) -> Uuid
```
### Examples
@ -35,26 +35,193 @@ const example = extrude(5, exampleSketch)
### Arguments
* `tag`: `String` (REQUIRED)
* `tag`: `TagIdentifier` (REQUIRED)
```js
{
value: string,
}
```
* `extrude_group`: `ExtrudeGroup` - An extrude group is a collection of extrude surfaces. (REQUIRED)
```js
{
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The position of the extrude group.
position: [number, number, number],
// The rotation of the extrude group.
rotation: [number, number, number, number],
// The sketch group paths.
sketchGroupValues: [{
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: {
// The id of the plane.
id: uuid,
// Origin of the plane.
origin: {
x: number,
y: number,
z: number,
},
type: "plane",
// Type for a plane.
value: "XY" | "XZ" | "YZ" | "Custom",
// What should the planes X axis be?
xAxis: {
x: number,
y: number,
z: number,
},
// What should the planes Y axis be?
yAxis: {
x: number,
y: number,
z: number,
},
// The z-axis (normal).
zAxis: {
x: number,
y: number,
z: number,
},
} |
{
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: SketchGroup,
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
value: [{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
},
// The id of the face.
id: uuid,
type: "face",
// The tag of the face.
value: string,
// What should the faces X axis be?
xAxis: {
x: number,
y: number,
z: number,
},
// What should the faces Y axis be?
yAxis: {
x: number,
y: number,
z: number,
},
// The z-axis (normal).
zAxis: {
x: number,
y: number,
z: number,
},
},
// The starting path.
start: {
// The from point.
from: [number, number],
// The name of the path.
name: string,
// 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",
@ -66,8 +233,12 @@ const example = extrude(5, exampleSketch)
center: [number, number],
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
@ -75,8 +246,12 @@ const example = extrude(5, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
@ -84,8 +259,12 @@ const example = extrude(5, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
@ -95,8 +274,12 @@ const example = extrude(5, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
@ -108,12 +291,17 @@ const example = extrude(5, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
},
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
@ -122,14 +310,14 @@ const example = extrude(5, exampleSketch)
faceId: uuid,
// The id of the geometry.
id: uuid,
// The name.
name: string,
// The position.
position: [number, number, number],
// The rotation.
rotation: [number, number, number, number],
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
@ -137,34 +325,16 @@ const example = extrude(5, exampleSketch)
faceId: uuid,
// The id of the geometry.
id: uuid,
// The name.
name: string,
// The position.
position: [number, number, number],
// The rotation.
rotation: [number, number, number, number],
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
// The x-axis of the extrude group base plane in the 3D space
xAxis: {
x: number,
y: number,
z: number,
},
// The y-axis of the extrude group base plane in the 3D space
yAxis: {
x: number,
y: number,
z: number,
},
// The z-axis of the extrude group base plane in the 3D space
zAxis: {
x: number,
y: number,
z: number,
},
}
```

View File

@ -9,7 +9,7 @@ Get the previous adjacent edge to the edge given.
```js
getPreviousAdjacentEdge(tag: String, extrude_group: ExtrudeGroup) -> Uuid
getPreviousAdjacentEdge(tag: TagIdentifier, extrude_group: ExtrudeGroup) -> Uuid
```
### Examples
@ -37,26 +37,193 @@ const example = extrude(5, exampleSketch)
### Arguments
* `tag`: `String` (REQUIRED)
* `tag`: `TagIdentifier` (REQUIRED)
```js
{
value: string,
}
```
* `extrude_group`: `ExtrudeGroup` - An extrude group is a collection of extrude surfaces. (REQUIRED)
```js
{
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The position of the extrude group.
position: [number, number, number],
// The rotation of the extrude group.
rotation: [number, number, number, number],
// The sketch group paths.
sketchGroupValues: [{
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: {
// The id of the plane.
id: uuid,
// Origin of the plane.
origin: {
x: number,
y: number,
z: number,
},
type: "plane",
// Type for a plane.
value: "XY" | "XZ" | "YZ" | "Custom",
// What should the planes X axis be?
xAxis: {
x: number,
y: number,
z: number,
},
// What should the planes Y axis be?
yAxis: {
x: number,
y: number,
z: number,
},
// The z-axis (normal).
zAxis: {
x: number,
y: number,
z: number,
},
} |
{
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: SketchGroup,
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
value: [{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
},
// The id of the face.
id: uuid,
type: "face",
// The tag of the face.
value: string,
// What should the faces X axis be?
xAxis: {
x: number,
y: number,
z: number,
},
// What should the faces Y axis be?
yAxis: {
x: number,
y: number,
z: number,
},
// The z-axis (normal).
zAxis: {
x: number,
y: number,
z: number,
},
},
// The starting path.
start: {
// The from point.
from: [number, number],
// The name of the path.
name: string,
// 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",
@ -68,8 +235,12 @@ const example = extrude(5, exampleSketch)
center: [number, number],
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
@ -77,8 +248,12 @@ const example = extrude(5, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
@ -86,8 +261,12 @@ const example = extrude(5, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
@ -97,8 +276,12 @@ const example = extrude(5, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
@ -110,12 +293,17 @@ const example = extrude(5, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
},
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
@ -124,14 +312,14 @@ const example = extrude(5, exampleSketch)
faceId: uuid,
// The id of the geometry.
id: uuid,
// The name.
name: string,
// The position.
position: [number, number, number],
// The rotation.
rotation: [number, number, number, number],
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
@ -139,34 +327,16 @@ const example = extrude(5, exampleSketch)
faceId: uuid,
// The id of the geometry.
id: uuid,
// The name.
name: string,
// The position.
position: [number, number, number],
// The rotation.
rotation: [number, number, number, number],
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
// The x-axis of the extrude group base plane in the 3D space
xAxis: {
x: number,
y: number,
z: number,
},
// The y-axis of the extrude group base plane in the 3D space
yAxis: {
x: number,
y: number,
z: number,
},
// The z-axis of the extrude group base plane in the 3D space
zAxis: {
x: number,
y: number,
z: number,
},
}
```

View File

@ -48,20 +48,182 @@ const part001 = startSketchOn('XY')
{
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The position of the extrude group.
position: [number, number, number],
// The rotation of the extrude group.
rotation: [number, number, number, number],
// The sketch group paths.
sketchGroupValues: [{
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: {
// The id of the plane.
id: uuid,
// Origin of the plane.
origin: {
x: number,
y: number,
z: number,
},
type: "plane",
// Type for a plane.
value: "XY" | "XZ" | "YZ" | "Custom",
// What should the planes X axis be?
xAxis: {
x: number,
y: number,
z: number,
},
// What should the planes Y axis be?
yAxis: {
x: number,
y: number,
z: number,
},
// The z-axis (normal).
zAxis: {
x: number,
y: number,
z: number,
},
} |
{
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: SketchGroup,
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
value: [{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
},
// The id of the face.
id: uuid,
type: "face",
// The tag of the face.
value: string,
// What should the faces X axis be?
xAxis: {
x: number,
y: number,
z: number,
},
// What should the faces Y axis be?
yAxis: {
x: number,
y: number,
z: number,
},
// The z-axis (normal).
zAxis: {
x: number,
y: number,
z: number,
},
},
// The starting path.
start: {
// The from point.
from: [number, number],
// The name of the path.
name: string,
// 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",
@ -73,8 +235,12 @@ const part001 = startSketchOn('XY')
center: [number, number],
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
@ -82,8 +248,12 @@ const part001 = startSketchOn('XY')
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
@ -91,8 +261,12 @@ const part001 = startSketchOn('XY')
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
@ -102,8 +276,12 @@ const part001 = startSketchOn('XY')
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
@ -115,12 +293,17 @@ const part001 = startSketchOn('XY')
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
},
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
@ -129,14 +312,14 @@ const part001 = startSketchOn('XY')
faceId: uuid,
// The id of the geometry.
id: uuid,
// The name.
name: string,
// The position.
position: [number, number, number],
// The rotation.
rotation: [number, number, number, number],
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
@ -144,34 +327,16 @@ const part001 = startSketchOn('XY')
faceId: uuid,
// The id of the geometry.
id: uuid,
// The name.
name: string,
// The position.
position: [number, number, number],
// The rotation.
rotation: [number, number, number, number],
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
// The x-axis of the extrude group base plane in the 3D space
xAxis: {
x: number,
y: number,
z: number,
},
// The y-axis of the extrude group base plane in the 3D space
yAxis: {
x: number,
y: number,
z: number,
},
// The z-axis of the extrude group base plane in the 3D space
zAxis: {
x: number,
y: number,
z: number,
},
}
```
@ -182,20 +347,182 @@ const part001 = startSketchOn('XY')
{
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The position of the extrude group.
position: [number, number, number],
// The rotation of the extrude group.
rotation: [number, number, number, number],
// The sketch group paths.
sketchGroupValues: [{
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: {
// The id of the plane.
id: uuid,
// Origin of the plane.
origin: {
x: number,
y: number,
z: number,
},
type: "plane",
// Type for a plane.
value: "XY" | "XZ" | "YZ" | "Custom",
// What should the planes X axis be?
xAxis: {
x: number,
y: number,
z: number,
},
// What should the planes Y axis be?
yAxis: {
x: number,
y: number,
z: number,
},
// The z-axis (normal).
zAxis: {
x: number,
y: number,
z: number,
},
} |
{
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: SketchGroup,
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
value: [{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
},
// The id of the face.
id: uuid,
type: "face",
// The tag of the face.
value: string,
// What should the faces X axis be?
xAxis: {
x: number,
y: number,
z: number,
},
// What should the faces Y axis be?
yAxis: {
x: number,
y: number,
z: number,
},
// The z-axis (normal).
zAxis: {
x: number,
y: number,
z: number,
},
},
// The starting path.
start: {
// The from point.
from: [number, number],
// The name of the path.
name: string,
// 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",
@ -207,8 +534,12 @@ const part001 = startSketchOn('XY')
center: [number, number],
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
@ -216,8 +547,12 @@ const part001 = startSketchOn('XY')
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
@ -225,8 +560,12 @@ const part001 = startSketchOn('XY')
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
@ -236,8 +575,12 @@ const part001 = startSketchOn('XY')
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
@ -249,12 +592,17 @@ const part001 = startSketchOn('XY')
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
},
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
@ -263,14 +611,14 @@ const part001 = startSketchOn('XY')
faceId: uuid,
// The id of the geometry.
id: uuid,
// The name.
name: string,
// The position.
position: [number, number, number],
// The rotation.
rotation: [number, number, number, number],
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
@ -278,34 +626,16 @@ const part001 = startSketchOn('XY')
faceId: uuid,
// The id of the geometry.
id: uuid,
// The name.
name: string,
// The position.
position: [number, number, number],
// The rotation.
rotation: [number, number, number, number],
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
// The x-axis of the extrude group base plane in the 3D space
xAxis: {
x: number,
y: number,
z: number,
},
// The y-axis of the extrude group base plane in the 3D space
yAxis: {
x: number,
y: number,
z: number,
},
// The z-axis of the extrude group base plane in the 3D space
zAxis: {
x: number,
y: number,
z: number,
},
}
```

View File

@ -53,8 +53,6 @@ const example = extrude(1, exampleSketch)
* `hole_sketch_group`: `SketchGroupSet` - A sketch group or a group of sketch groups. (REQUIRED)
```js
{
// The plane id or face id of the sketch group.
entityId: uuid,
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
@ -90,12 +88,181 @@ const example = extrude(1, exampleSketch)
},
} |
{
// the face id the sketch is on
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: SketchSurface,
// The starting path.
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The paths in the sketch group.
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
} |
{
// arc's direction
ccw: string,
// the arc's center
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
// The x coordinate.
x: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
// The x coordinate.
x: number,
// The y coordinate.
y: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
},
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
value: [{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
},
// The id of the face.
id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face",
// The tag of the face.
value: string,
@ -118,16 +285,16 @@ const example = extrude(1, exampleSketch)
z: number,
},
},
// The position of the sketch group.
position: [number, number, number],
// The rotation of the sketch group base plane.
rotation: [number, number, number, number],
// The starting path.
start: {
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
@ -136,8 +303,12 @@ const example = extrude(1, exampleSketch)
value: [{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
@ -149,8 +320,12 @@ const example = extrude(1, exampleSketch)
center: [number, number],
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
@ -158,8 +333,12 @@ const example = extrude(1, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
@ -167,8 +346,12 @@ const example = extrude(1, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
@ -178,8 +361,12 @@ const example = extrude(1, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
@ -191,30 +378,16 @@ const example = extrude(1, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
// The x-axis of the sketch group base plane in the 3D space
xAxis: {
x: number,
y: number,
z: number,
},
// The y-axis of the sketch group base plane in the 3D space
yAxis: {
x: number,
y: number,
z: number,
},
// The z-axis of the sketch group base plane in the 3D space
zAxis: {
x: number,
y: number,
z: number,
},
} |
{
type: "sketchGroups",
@ -223,8 +396,6 @@ const example = extrude(1, exampleSketch)
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
```js
{
// The plane id or face id of the sketch group.
entityId: uuid,
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
@ -260,12 +431,181 @@ const example = extrude(1, exampleSketch)
},
} |
{
// the face id the sketch is on
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: SketchSurface,
// The starting path.
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The paths in the sketch group.
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
} |
{
// arc's direction
ccw: string,
// the arc's center
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
// The x coordinate.
x: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
// The x coordinate.
x: number,
// The y coordinate.
y: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
},
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
value: [{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
},
// The id of the face.
id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face",
// The tag of the face.
value: string,
@ -288,16 +628,16 @@ const example = extrude(1, exampleSketch)
z: number,
},
},
// The position of the sketch group.
position: [number, number, number],
// The rotation of the sketch group base plane.
rotation: [number, number, number, number],
// The starting path.
start: {
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
@ -305,8 +645,12 @@ const example = extrude(1, exampleSketch)
value: [{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
@ -318,8 +662,12 @@ const example = extrude(1, exampleSketch)
center: [number, number],
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
@ -327,8 +675,12 @@ const example = extrude(1, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
@ -336,8 +688,12 @@ const example = extrude(1, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
@ -347,8 +703,12 @@ const example = extrude(1, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
@ -360,30 +720,16 @@ const example = extrude(1, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
// The x-axis of the sketch group base plane in the 3D space
xAxis: {
x: number,
y: number,
z: number,
},
// The y-axis of the sketch group base plane in the 3D space
yAxis: {
x: number,
y: number,
z: number,
},
// The z-axis of the sketch group base plane in the 3D space
zAxis: {
x: number,
y: number,
z: number,
},
}
```
@ -392,8 +738,6 @@ const example = extrude(1, exampleSketch)
`SketchGroup` - A sketch group is a collection of paths.
```js
{
// The plane id or face id of the sketch group.
entityId: uuid,
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
@ -429,12 +773,181 @@ const example = extrude(1, exampleSketch)
},
} |
{
// the face id the sketch is on
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: SketchSurface,
// The starting path.
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The paths in the sketch group.
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
} |
{
// arc's direction
ccw: string,
// the arc's center
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
// The x coordinate.
x: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
// The x coordinate.
x: number,
// The y coordinate.
y: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
},
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
value: [{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
},
// The id of the face.
id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face",
// The tag of the face.
value: string,
@ -457,16 +970,16 @@ const example = extrude(1, exampleSketch)
z: number,
},
},
// The position of the sketch group.
position: [number, number, number],
// The rotation of the sketch group base plane.
rotation: [number, number, number, number],
// The starting path.
start: {
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
@ -474,8 +987,12 @@ const example = extrude(1, exampleSketch)
value: [{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
@ -487,8 +1004,12 @@ const example = extrude(1, exampleSketch)
center: [number, number],
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
@ -496,8 +1017,12 @@ const example = extrude(1, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
@ -505,8 +1030,12 @@ const example = extrude(1, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
@ -516,8 +1045,12 @@ const example = extrude(1, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
@ -529,30 +1062,16 @@ const example = extrude(1, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
// The x-axis of the sketch group base plane in the 3D space
xAxis: {
x: number,
y: number,
z: number,
},
// The y-axis of the sketch group base plane in the 3D space
yAxis: {
x: number,
y: number,
z: number,
},
// The z-axis of the sketch group base plane in the 3D space
zAxis: {
x: number,
y: number,
z: number,
},
}
```

View File

@ -33,8 +33,6 @@ const example = extrude(5, exampleSketch)
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
```js
{
// The plane id or face id of the sketch group.
entityId: uuid,
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
@ -70,12 +68,181 @@ const example = extrude(5, exampleSketch)
},
} |
{
// the face id the sketch is on
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: SketchSurface,
// The starting path.
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The paths in the sketch group.
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
} |
{
// arc's direction
ccw: string,
// the arc's center
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
// The x coordinate.
x: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
// The x coordinate.
x: number,
// The y coordinate.
y: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
},
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
value: [{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
},
// The id of the face.
id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face",
// The tag of the face.
value: string,
@ -98,16 +265,16 @@ const example = extrude(5, exampleSketch)
z: number,
},
},
// The position of the sketch group.
position: [number, number, number],
// The rotation of the sketch group base plane.
rotation: [number, number, number, number],
// The starting path.
start: {
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
@ -115,8 +282,12 @@ const example = extrude(5, exampleSketch)
value: [{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
@ -128,8 +299,12 @@ const example = extrude(5, exampleSketch)
center: [number, number],
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
@ -137,8 +312,12 @@ const example = extrude(5, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
@ -146,8 +325,12 @@ const example = extrude(5, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
@ -157,8 +340,12 @@ const example = extrude(5, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
@ -170,30 +357,16 @@ const example = extrude(5, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
// The x-axis of the sketch group base plane in the 3D space
xAxis: {
x: number,
y: number,
z: number,
},
// The y-axis of the sketch group base plane in the 3D space
yAxis: {
x: number,
y: number,
z: number,
},
// The z-axis of the sketch group base plane in the 3D space
zAxis: {
x: number,
y: number,
z: number,
},
}
```

View File

@ -33,8 +33,6 @@ const example = extrude(5, exampleSketch)
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
```js
{
// The plane id or face id of the sketch group.
entityId: uuid,
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
@ -70,12 +68,181 @@ const example = extrude(5, exampleSketch)
},
} |
{
// the face id the sketch is on
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: SketchSurface,
// The starting path.
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The paths in the sketch group.
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
} |
{
// arc's direction
ccw: string,
// the arc's center
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
// The x coordinate.
x: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
// The x coordinate.
x: number,
// The y coordinate.
y: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
},
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
value: [{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
},
// The id of the face.
id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face",
// The tag of the face.
value: string,
@ -98,16 +265,16 @@ const example = extrude(5, exampleSketch)
z: number,
},
},
// The position of the sketch group.
position: [number, number, number],
// The rotation of the sketch group base plane.
rotation: [number, number, number, number],
// The starting path.
start: {
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
@ -115,8 +282,12 @@ const example = extrude(5, exampleSketch)
value: [{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
@ -128,8 +299,12 @@ const example = extrude(5, exampleSketch)
center: [number, number],
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
@ -137,8 +312,12 @@ const example = extrude(5, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
@ -146,8 +325,12 @@ const example = extrude(5, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
@ -157,8 +340,12 @@ const example = extrude(5, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
@ -170,30 +357,16 @@ const example = extrude(5, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
// The x-axis of the sketch group base plane in the 3D space
xAxis: {
x: number,
y: number,
z: number,
},
// The y-axis of the sketch group base plane in the 3D space
yAxis: {
x: number,
y: number,
z: number,
},
// The z-axis of the sketch group base plane in the 3D space
zAxis: {
x: number,
y: number,
z: number,
},
}
```

View File

@ -9,7 +9,7 @@ Draw a line.
```js
line(delta: [number], sketch_group: SketchGroup, tag?: String) -> SketchGroup
line(delta: [number], sketch_group: SketchGroup, tag?: TagDeclarator) -> SketchGroup
```
### Examples
@ -46,8 +46,6 @@ const example = extrude(5, exampleSketch)
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
```js
{
// The plane id or face id of the sketch group.
entityId: uuid,
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
@ -83,12 +81,181 @@ const example = extrude(5, exampleSketch)
},
} |
{
// the face id the sketch is on
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: SketchSurface,
// The starting path.
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The paths in the sketch group.
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
} |
{
// arc's direction
ccw: string,
// the arc's center
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
// The x coordinate.
x: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
// The x coordinate.
x: number,
// The y coordinate.
y: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
},
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
value: [{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
},
// The id of the face.
id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face",
// The tag of the face.
value: string,
@ -111,16 +278,16 @@ const example = extrude(5, exampleSketch)
z: number,
},
},
// The position of the sketch group.
position: [number, number, number],
// The rotation of the sketch group base plane.
rotation: [number, number, number, number],
// The starting path.
start: {
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
@ -128,8 +295,12 @@ const example = extrude(5, exampleSketch)
value: [{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
@ -141,8 +312,12 @@ const example = extrude(5, exampleSketch)
center: [number, number],
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
@ -150,8 +325,12 @@ const example = extrude(5, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
@ -159,8 +338,12 @@ const example = extrude(5, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
@ -170,8 +353,12 @@ const example = extrude(5, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
@ -183,41 +370,32 @@ const example = extrude(5, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
// The x-axis of the sketch group base plane in the 3D space
xAxis: {
x: number,
y: number,
z: number,
},
// The y-axis of the sketch group base plane in the 3D space
yAxis: {
x: number,
y: number,
z: number,
},
// The z-axis of the sketch group base plane in the 3D space
zAxis: {
x: number,
y: number,
z: number,
},
}
```
* `tag`: `String` (OPTIONAL)
* `tag`: `TagDeclarator` (OPTIONAL)
```js
{
end: number,
start: number,
value: string,
}
```
### Returns
`SketchGroup` - A sketch group is a collection of paths.
```js
{
// The plane id or face id of the sketch group.
entityId: uuid,
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
@ -253,12 +431,181 @@ const example = extrude(5, exampleSketch)
},
} |
{
// the face id the sketch is on
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: SketchSurface,
// The starting path.
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The paths in the sketch group.
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
} |
{
// arc's direction
ccw: string,
// the arc's center
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
// The x coordinate.
x: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
// The x coordinate.
x: number,
// The y coordinate.
y: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
},
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
value: [{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
},
// The id of the face.
id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face",
// The tag of the face.
value: string,
@ -281,16 +628,16 @@ const example = extrude(5, exampleSketch)
z: number,
},
},
// The position of the sketch group.
position: [number, number, number],
// The rotation of the sketch group base plane.
rotation: [number, number, number, number],
// The starting path.
start: {
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
@ -298,8 +645,12 @@ const example = extrude(5, exampleSketch)
value: [{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
@ -311,8 +662,12 @@ const example = extrude(5, exampleSketch)
center: [number, number],
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
@ -320,8 +675,12 @@ const example = extrude(5, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
@ -329,8 +688,12 @@ const example = extrude(5, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
@ -340,8 +703,12 @@ const example = extrude(5, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
@ -353,30 +720,16 @@ const example = extrude(5, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
// The x-axis of the sketch group base plane in the 3D space
xAxis: {
x: number,
y: number,
z: number,
},
// The y-axis of the sketch group base plane in the 3D space
yAxis: {
x: number,
y: number,
z: number,
},
// The z-axis of the sketch group base plane in the 3D space
zAxis: {
x: number,
y: number,
z: number,
},
}
```

View File

@ -9,7 +9,7 @@ Draw a line to a point.
```js
lineTo(to: [number], sketch_group: SketchGroup, tag?: String) -> SketchGroup
lineTo(to: [number], sketch_group: SketchGroup, tag?: TagDeclarator) -> SketchGroup
```
### Examples
@ -33,8 +33,6 @@ const example = extrude(5, exampleSketch)
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
```js
{
// The plane id or face id of the sketch group.
entityId: uuid,
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
@ -70,12 +68,181 @@ const example = extrude(5, exampleSketch)
},
} |
{
// the face id the sketch is on
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: SketchSurface,
// The starting path.
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The paths in the sketch group.
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
} |
{
// arc's direction
ccw: string,
// the arc's center
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
// The x coordinate.
x: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
// The x coordinate.
x: number,
// The y coordinate.
y: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
},
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
value: [{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
},
// The id of the face.
id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face",
// The tag of the face.
value: string,
@ -98,16 +265,16 @@ const example = extrude(5, exampleSketch)
z: number,
},
},
// The position of the sketch group.
position: [number, number, number],
// The rotation of the sketch group base plane.
rotation: [number, number, number, number],
// The starting path.
start: {
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
@ -115,8 +282,12 @@ const example = extrude(5, exampleSketch)
value: [{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
@ -128,8 +299,12 @@ const example = extrude(5, exampleSketch)
center: [number, number],
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
@ -137,8 +312,12 @@ const example = extrude(5, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
@ -146,8 +325,12 @@ const example = extrude(5, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
@ -157,8 +340,12 @@ const example = extrude(5, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
@ -170,41 +357,32 @@ const example = extrude(5, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
// The x-axis of the sketch group base plane in the 3D space
xAxis: {
x: number,
y: number,
z: number,
},
// The y-axis of the sketch group base plane in the 3D space
yAxis: {
x: number,
y: number,
z: number,
},
// The z-axis of the sketch group base plane in the 3D space
zAxis: {
x: number,
y: number,
z: number,
},
}
```
* `tag`: `String` (OPTIONAL)
* `tag`: `TagDeclarator` (OPTIONAL)
```js
{
end: number,
start: number,
value: string,
}
```
### Returns
`SketchGroup` - A sketch group is a collection of paths.
```js
{
// The plane id or face id of the sketch group.
entityId: uuid,
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
@ -240,12 +418,181 @@ const example = extrude(5, exampleSketch)
},
} |
{
// the face id the sketch is on
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: SketchSurface,
// The starting path.
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The paths in the sketch group.
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
} |
{
// arc's direction
ccw: string,
// the arc's center
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
// The x coordinate.
x: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
// The x coordinate.
x: number,
// The y coordinate.
y: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
},
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
value: [{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
},
// The id of the face.
id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face",
// The tag of the face.
value: string,
@ -268,16 +615,16 @@ const example = extrude(5, exampleSketch)
z: number,
},
},
// The position of the sketch group.
position: [number, number, number],
// The rotation of the sketch group base plane.
rotation: [number, number, number, number],
// The starting path.
start: {
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
@ -285,8 +632,12 @@ const example = extrude(5, exampleSketch)
value: [{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
@ -298,8 +649,12 @@ const example = extrude(5, exampleSketch)
center: [number, number],
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
@ -307,8 +662,12 @@ const example = extrude(5, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
@ -316,8 +675,12 @@ const example = extrude(5, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
@ -327,8 +690,12 @@ const example = extrude(5, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
@ -340,30 +707,16 @@ const example = extrude(5, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
// The x-axis of the sketch group base plane in the 3D space
xAxis: {
x: number,
y: number,
z: number,
},
// The y-axis of the sketch group base plane in the 3D space
yAxis: {
x: number,
y: number,
z: number,
},
// The z-axis of the sketch group base plane in the 3D space
zAxis: {
x: number,
y: number,
z: number,
},
}
```

View File

@ -51,8 +51,6 @@ const example = extrude(1, exampleSketch)
* `sketch_group_set`: `SketchGroupSet` - A sketch group or a group of sketch groups. (REQUIRED)
```js
{
// The plane id or face id of the sketch group.
entityId: uuid,
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
@ -88,12 +86,181 @@ const example = extrude(1, exampleSketch)
},
} |
{
// the face id the sketch is on
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: SketchSurface,
// The starting path.
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The paths in the sketch group.
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
} |
{
// arc's direction
ccw: string,
// the arc's center
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
// The x coordinate.
x: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
// The x coordinate.
x: number,
// The y coordinate.
y: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
},
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
value: [{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
},
// The id of the face.
id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face",
// The tag of the face.
value: string,
@ -116,16 +283,16 @@ const example = extrude(1, exampleSketch)
z: number,
},
},
// The position of the sketch group.
position: [number, number, number],
// The rotation of the sketch group base plane.
rotation: [number, number, number, number],
// The starting path.
start: {
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
@ -134,8 +301,12 @@ const example = extrude(1, exampleSketch)
value: [{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
@ -147,8 +318,12 @@ const example = extrude(1, exampleSketch)
center: [number, number],
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
@ -156,8 +331,12 @@ const example = extrude(1, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
@ -165,8 +344,12 @@ const example = extrude(1, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
@ -176,8 +359,12 @@ const example = extrude(1, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
@ -189,30 +376,16 @@ const example = extrude(1, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
// The x-axis of the sketch group base plane in the 3D space
xAxis: {
x: number,
y: number,
z: number,
},
// The y-axis of the sketch group base plane in the 3D space
yAxis: {
x: number,
y: number,
z: number,
},
// The z-axis of the sketch group base plane in the 3D space
zAxis: {
x: number,
y: number,
z: number,
},
} |
{
type: "sketchGroups",

View File

@ -52,20 +52,182 @@ const example = extrude(-5, exampleSketch)
{
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The position of the extrude group.
position: [number, number, number],
// The rotation of the extrude group.
rotation: [number, number, number, number],
// The sketch group paths.
sketchGroupValues: [{
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: {
// The id of the plane.
id: uuid,
// Origin of the plane.
origin: {
x: number,
y: number,
z: number,
},
type: "plane",
// Type for a plane.
value: "XY" | "XZ" | "YZ" | "Custom",
// What should the planes X axis be?
xAxis: {
x: number,
y: number,
z: number,
},
// What should the planes Y axis be?
yAxis: {
x: number,
y: number,
z: number,
},
// The z-axis (normal).
zAxis: {
x: number,
y: number,
z: number,
},
} |
{
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: SketchGroup,
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
value: [{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
},
// The id of the face.
id: uuid,
type: "face",
// The tag of the face.
value: string,
// What should the faces X axis be?
xAxis: {
x: number,
y: number,
z: number,
},
// What should the faces Y axis be?
yAxis: {
x: number,
y: number,
z: number,
},
// The z-axis (normal).
zAxis: {
x: number,
y: number,
z: number,
},
},
// The starting path.
start: {
// The from point.
from: [number, number],
// The name of the path.
name: string,
// 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",
@ -77,8 +239,12 @@ const example = extrude(-5, exampleSketch)
center: [number, number],
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
@ -86,8 +252,12 @@ const example = extrude(-5, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
@ -95,8 +265,12 @@ const example = extrude(-5, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
@ -106,8 +280,12 @@ const example = extrude(-5, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
@ -119,12 +297,17 @@ const example = extrude(-5, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
},
// The id of the extrusion start cap
startCapId: uuid,
type: "extrudeGroup",
@ -134,14 +317,14 @@ const example = extrude(-5, exampleSketch)
faceId: uuid,
// The id of the geometry.
id: uuid,
// The name.
name: string,
// The position.
position: [number, number, number],
// The rotation.
rotation: [number, number, number, number],
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
@ -149,34 +332,16 @@ const example = extrude(-5, exampleSketch)
faceId: uuid,
// The id of the geometry.
id: uuid,
// The name.
name: string,
// The position.
position: [number, number, number],
// The rotation.
rotation: [number, number, number, number],
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
// The x-axis of the extrude group base plane in the 3D space
xAxis: {
x: number,
y: number,
z: number,
},
// The y-axis of the extrude group base plane in the 3D space
yAxis: {
x: number,
y: number,
z: number,
},
// The z-axis of the extrude group base plane in the 3D space
zAxis: {
x: number,
y: number,
z: number,
},
} |
{
type: "extrudeGroups",

View File

@ -44,8 +44,6 @@ const example = extrude(1, exampleSketch)
* `sketch_group_set`: `SketchGroupSet` - A sketch group or a group of sketch groups. (REQUIRED)
```js
{
// The plane id or face id of the sketch group.
entityId: uuid,
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
@ -81,12 +79,181 @@ const example = extrude(1, exampleSketch)
},
} |
{
// the face id the sketch is on
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: SketchSurface,
// The starting path.
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The paths in the sketch group.
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
} |
{
// arc's direction
ccw: string,
// the arc's center
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
// The x coordinate.
x: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
// The x coordinate.
x: number,
// The y coordinate.
y: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
},
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
value: [{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
},
// The id of the face.
id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face",
// The tag of the face.
value: string,
@ -109,16 +276,16 @@ const example = extrude(1, exampleSketch)
z: number,
},
},
// The position of the sketch group.
position: [number, number, number],
// The rotation of the sketch group base plane.
rotation: [number, number, number, number],
// The starting path.
start: {
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
@ -127,8 +294,12 @@ const example = extrude(1, exampleSketch)
value: [{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
@ -140,8 +311,12 @@ const example = extrude(1, exampleSketch)
center: [number, number],
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
@ -149,8 +324,12 @@ const example = extrude(1, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
@ -158,8 +337,12 @@ const example = extrude(1, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
@ -169,8 +352,12 @@ const example = extrude(1, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
@ -182,30 +369,16 @@ const example = extrude(1, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
// The x-axis of the sketch group base plane in the 3D space
xAxis: {
x: number,
y: number,
z: number,
},
// The y-axis of the sketch group base plane in the 3D space
yAxis: {
x: number,
y: number,
z: number,
},
// The z-axis of the sketch group base plane in the 3D space
zAxis: {
x: number,
y: number,
z: number,
},
} |
{
type: "sketchGroups",

View File

@ -50,20 +50,182 @@ const example = extrude(1, exampleSketch)
{
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The position of the extrude group.
position: [number, number, number],
// The rotation of the extrude group.
rotation: [number, number, number, number],
// The sketch group paths.
sketchGroupValues: [{
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: {
// The id of the plane.
id: uuid,
// Origin of the plane.
origin: {
x: number,
y: number,
z: number,
},
type: "plane",
// Type for a plane.
value: "XY" | "XZ" | "YZ" | "Custom",
// What should the planes X axis be?
xAxis: {
x: number,
y: number,
z: number,
},
// What should the planes Y axis be?
yAxis: {
x: number,
y: number,
z: number,
},
// The z-axis (normal).
zAxis: {
x: number,
y: number,
z: number,
},
} |
{
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: SketchGroup,
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
value: [{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
},
// The id of the face.
id: uuid,
type: "face",
// The tag of the face.
value: string,
// What should the faces X axis be?
xAxis: {
x: number,
y: number,
z: number,
},
// What should the faces Y axis be?
yAxis: {
x: number,
y: number,
z: number,
},
// The z-axis (normal).
zAxis: {
x: number,
y: number,
z: number,
},
},
// The starting path.
start: {
// The from point.
from: [number, number],
// The name of the path.
name: string,
// 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",
@ -75,8 +237,12 @@ const example = extrude(1, exampleSketch)
center: [number, number],
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
@ -84,8 +250,12 @@ const example = extrude(1, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
@ -93,8 +263,12 @@ const example = extrude(1, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
@ -104,8 +278,12 @@ const example = extrude(1, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
@ -117,12 +295,17 @@ const example = extrude(1, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
},
// The id of the extrusion start cap
startCapId: uuid,
type: "extrudeGroup",
@ -132,14 +315,14 @@ const example = extrude(1, exampleSketch)
faceId: uuid,
// The id of the geometry.
id: uuid,
// The name.
name: string,
// The position.
position: [number, number, number],
// The rotation.
rotation: [number, number, number, number],
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
@ -147,34 +330,16 @@ const example = extrude(1, exampleSketch)
faceId: uuid,
// The id of the geometry.
id: uuid,
// The name.
name: string,
// The position.
position: [number, number, number],
// The rotation.
rotation: [number, number, number, number],
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
// The x-axis of the extrude group base plane in the 3D space
xAxis: {
x: number,
y: number,
z: number,
},
// The y-axis of the extrude group base plane in the 3D space
yAxis: {
x: number,
y: number,
z: number,
},
// The z-axis of the extrude group base plane in the 3D space
zAxis: {
x: number,
y: number,
z: number,
},
} |
{
type: "extrudeGroups",

View File

@ -34,8 +34,6 @@ const sketch001 = startSketchOn('XY')
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
```js
{
// The plane id or face id of the sketch group.
entityId: uuid,
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
@ -71,12 +69,181 @@ const sketch001 = startSketchOn('XY')
},
} |
{
// the face id the sketch is on
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: SketchSurface,
// The starting path.
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The paths in the sketch group.
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
} |
{
// arc's direction
ccw: string,
// the arc's center
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
// The x coordinate.
x: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
// The x coordinate.
x: number,
// The y coordinate.
y: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
},
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
value: [{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
},
// The id of the face.
id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face",
// The tag of the face.
value: string,
@ -99,16 +266,16 @@ const sketch001 = startSketchOn('XY')
z: number,
},
},
// The position of the sketch group.
position: [number, number, number],
// The rotation of the sketch group base plane.
rotation: [number, number, number, number],
// The starting path.
start: {
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
@ -116,8 +283,12 @@ const sketch001 = startSketchOn('XY')
value: [{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
@ -129,8 +300,12 @@ const sketch001 = startSketchOn('XY')
center: [number, number],
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
@ -138,8 +313,12 @@ const sketch001 = startSketchOn('XY')
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
@ -147,8 +326,12 @@ const sketch001 = startSketchOn('XY')
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
@ -158,8 +341,12 @@ const sketch001 = startSketchOn('XY')
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
@ -171,30 +358,16 @@ const sketch001 = startSketchOn('XY')
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
// The x-axis of the sketch group base plane in the 3D space
xAxis: {
x: number,
y: number,
z: number,
},
// The y-axis of the sketch group base plane in the 3D space
yAxis: {
x: number,
y: number,
z: number,
},
// The z-axis of the sketch group base plane in the 3D space
zAxis: {
x: number,
y: number,
z: number,
},
}
```

View File

@ -29,8 +29,6 @@ const sketch001 = startSketchOn('XY')
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
```js
{
// The plane id or face id of the sketch group.
entityId: uuid,
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
@ -66,12 +64,181 @@ const sketch001 = startSketchOn('XY')
},
} |
{
// the face id the sketch is on
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: SketchSurface,
// The starting path.
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The paths in the sketch group.
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
} |
{
// arc's direction
ccw: string,
// the arc's center
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
// The x coordinate.
x: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
// The x coordinate.
x: number,
// The y coordinate.
y: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
},
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
value: [{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
},
// The id of the face.
id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face",
// The tag of the face.
value: string,
@ -94,16 +261,16 @@ const sketch001 = startSketchOn('XY')
z: number,
},
},
// The position of the sketch group.
position: [number, number, number],
// The rotation of the sketch group base plane.
rotation: [number, number, number, number],
// The starting path.
start: {
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
@ -111,8 +278,12 @@ const sketch001 = startSketchOn('XY')
value: [{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
@ -124,8 +295,12 @@ const sketch001 = startSketchOn('XY')
center: [number, number],
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
@ -133,8 +308,12 @@ const sketch001 = startSketchOn('XY')
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
@ -142,8 +321,12 @@ const sketch001 = startSketchOn('XY')
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
@ -153,8 +336,12 @@ const sketch001 = startSketchOn('XY')
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
@ -166,30 +353,16 @@ const sketch001 = startSketchOn('XY')
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
// The x-axis of the sketch group base plane in the 3D space
xAxis: {
x: number,
y: number,
z: number,
},
// The y-axis of the sketch group base plane in the 3D space
yAxis: {
x: number,
y: number,
z: number,
},
// The z-axis of the sketch group base plane in the 3D space
zAxis: {
x: number,
y: number,
z: number,
},
}
```

View File

@ -28,8 +28,6 @@ const sketch001 = startSketchOn('XY')
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
```js
{
// The plane id or face id of the sketch group.
entityId: uuid,
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
@ -65,12 +63,181 @@ const sketch001 = startSketchOn('XY')
},
} |
{
// the face id the sketch is on
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: SketchSurface,
// The starting path.
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The paths in the sketch group.
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
} |
{
// arc's direction
ccw: string,
// the arc's center
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
// The x coordinate.
x: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
// The x coordinate.
x: number,
// The y coordinate.
y: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
},
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
value: [{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
},
// The id of the face.
id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face",
// The tag of the face.
value: string,
@ -93,16 +260,16 @@ const sketch001 = startSketchOn('XY')
z: number,
},
},
// The position of the sketch group.
position: [number, number, number],
// The rotation of the sketch group base plane.
rotation: [number, number, number, number],
// The starting path.
start: {
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
@ -110,8 +277,12 @@ const sketch001 = startSketchOn('XY')
value: [{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
@ -123,8 +294,12 @@ const sketch001 = startSketchOn('XY')
center: [number, number],
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
@ -132,8 +307,12 @@ const sketch001 = startSketchOn('XY')
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
@ -141,8 +320,12 @@ const sketch001 = startSketchOn('XY')
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
@ -152,8 +335,12 @@ const sketch001 = startSketchOn('XY')
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
@ -165,30 +352,16 @@ const sketch001 = startSketchOn('XY')
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
// The x-axis of the sketch group base plane in the 3D space
xAxis: {
x: number,
y: number,
z: number,
},
// The y-axis of the sketch group base plane in the 3D space
yAxis: {
x: number,
y: number,
z: number,
},
// The z-axis of the sketch group base plane in the 3D space
zAxis: {
x: number,
y: number,
z: number,
},
}
```

View File

@ -156,14 +156,14 @@ const part001 = revolve({
},
} |
uuid |
string,
{
value: string,
},
}
```
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
```js
{
// The plane id or face id of the sketch group.
entityId: uuid,
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
@ -199,12 +199,181 @@ string,
},
} |
{
// the face id the sketch is on
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: SketchSurface,
// The starting path.
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The paths in the sketch group.
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
} |
{
// arc's direction
ccw: string,
// the arc's center
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
// The x coordinate.
x: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
// The x coordinate.
x: number,
// The y coordinate.
y: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
},
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
value: [{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
},
// The id of the face.
id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face",
// The tag of the face.
value: string,
@ -227,16 +396,16 @@ string,
z: number,
},
},
// The position of the sketch group.
position: [number, number, number],
// The rotation of the sketch group base plane.
rotation: [number, number, number, number],
// The starting path.
start: {
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
@ -244,8 +413,12 @@ string,
value: [{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
@ -257,8 +430,12 @@ string,
center: [number, number],
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
@ -266,8 +443,12 @@ string,
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
@ -275,8 +456,12 @@ string,
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
@ -286,8 +471,12 @@ string,
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
@ -299,30 +488,16 @@ string,
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
// The x-axis of the sketch group base plane in the 3D space
xAxis: {
x: number,
y: number,
z: number,
},
// The y-axis of the sketch group base plane in the 3D space
yAxis: {
x: number,
y: number,
z: number,
},
// The z-axis of the sketch group base plane in the 3D space
zAxis: {
x: number,
y: number,
z: number,
},
}
```
@ -333,20 +508,182 @@ string,
{
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The position of the extrude group.
position: [number, number, number],
// The rotation of the extrude group.
rotation: [number, number, number, number],
// The sketch group paths.
sketchGroupValues: [{
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: {
// The id of the plane.
id: uuid,
// Origin of the plane.
origin: {
x: number,
y: number,
z: number,
},
type: "plane",
// Type for a plane.
value: "XY" | "XZ" | "YZ" | "Custom",
// What should the planes X axis be?
xAxis: {
x: number,
y: number,
z: number,
},
// What should the planes Y axis be?
yAxis: {
x: number,
y: number,
z: number,
},
// The z-axis (normal).
zAxis: {
x: number,
y: number,
z: number,
},
} |
{
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: SketchGroup,
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
value: [{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
},
// The id of the face.
id: uuid,
type: "face",
// The tag of the face.
value: string,
// What should the faces X axis be?
xAxis: {
x: number,
y: number,
z: number,
},
// What should the faces Y axis be?
yAxis: {
x: number,
y: number,
z: number,
},
// The z-axis (normal).
zAxis: {
x: number,
y: number,
z: number,
},
},
// The starting path.
start: {
// The from point.
from: [number, number],
// The name of the path.
name: string,
// 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",
@ -358,8 +695,12 @@ string,
center: [number, number],
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
@ -367,8 +708,12 @@ string,
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
@ -376,8 +721,12 @@ string,
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
@ -387,8 +736,12 @@ string,
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
@ -400,12 +753,17 @@ string,
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
},
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
@ -414,14 +772,14 @@ string,
faceId: uuid,
// The id of the geometry.
id: uuid,
// The name.
name: string,
// The position.
position: [number, number, number],
// The rotation.
rotation: [number, number, number, number],
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
@ -429,34 +787,16 @@ string,
faceId: uuid,
// The id of the geometry.
id: uuid,
// The name.
name: string,
// The position.
position: [number, number, number],
// The rotation.
rotation: [number, number, number, number],
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
// The x-axis of the extrude group base plane in the 3D space
xAxis: {
x: number,
y: number,
z: number,
},
// The y-axis of the extrude group base plane in the 3D space
yAxis: {
x: number,
y: number,
z: number,
},
// The z-axis of the extrude group base plane in the 3D space
zAxis: {
x: number,
y: number,
z: number,
},
}
```

View File

@ -9,7 +9,7 @@ Returns the angle of the segment.
```js
segAng(segment_name: string, sketch_group: SketchGroup) -> number
segAng(segment_name: TagIdentifier, sketch_group: SketchGroup) -> number
```
### Examples
@ -32,12 +32,15 @@ const example = extrude(4, exampleSketch)
### Arguments
* `segment_name`: `string` (REQUIRED)
* `segment_name`: `TagIdentifier` (REQUIRED)
```js
{
value: string,
}
```
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
```js
{
// The plane id or face id of the sketch group.
entityId: uuid,
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
@ -73,12 +76,181 @@ const example = extrude(4, exampleSketch)
},
} |
{
// the face id the sketch is on
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: SketchSurface,
// The starting path.
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The paths in the sketch group.
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
} |
{
// arc's direction
ccw: string,
// the arc's center
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
// The x coordinate.
x: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
// The x coordinate.
x: number,
// The y coordinate.
y: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
},
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
value: [{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
},
// The id of the face.
id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face",
// The tag of the face.
value: string,
@ -101,16 +273,16 @@ const example = extrude(4, exampleSketch)
z: number,
},
},
// The position of the sketch group.
position: [number, number, number],
// The rotation of the sketch group base plane.
rotation: [number, number, number, number],
// The starting path.
start: {
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
@ -118,8 +290,12 @@ const example = extrude(4, exampleSketch)
value: [{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
@ -131,8 +307,12 @@ const example = extrude(4, exampleSketch)
center: [number, number],
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
@ -140,8 +320,12 @@ const example = extrude(4, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
@ -149,8 +333,12 @@ const example = extrude(4, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
@ -160,8 +348,12 @@ const example = extrude(4, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
@ -173,30 +365,16 @@ const example = extrude(4, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
// The x-axis of the sketch group base plane in the 3D space
xAxis: {
x: number,
y: number,
z: number,
},
// The y-axis of the sketch group base plane in the 3D space
yAxis: {
x: number,
y: number,
z: number,
},
// The z-axis of the sketch group base plane in the 3D space
zAxis: {
x: number,
y: number,
z: number,
},
}
```

View File

@ -9,7 +9,7 @@ Returns the segment end of x.
```js
segEndX(segment_name: string, sketch_group: SketchGroup) -> number
segEndX(segment_name: TagIdentifier, sketch_group: SketchGroup) -> number
```
### Examples
@ -30,12 +30,15 @@ const example = extrude(5, exampleSketch)
### Arguments
* `segment_name`: `string` (REQUIRED)
* `segment_name`: `TagIdentifier` (REQUIRED)
```js
{
value: string,
}
```
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
```js
{
// The plane id or face id of the sketch group.
entityId: uuid,
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
@ -71,12 +74,181 @@ const example = extrude(5, exampleSketch)
},
} |
{
// the face id the sketch is on
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: SketchSurface,
// The starting path.
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The paths in the sketch group.
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
} |
{
// arc's direction
ccw: string,
// the arc's center
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
// The x coordinate.
x: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
// The x coordinate.
x: number,
// The y coordinate.
y: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
},
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
value: [{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
},
// The id of the face.
id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face",
// The tag of the face.
value: string,
@ -99,16 +271,16 @@ const example = extrude(5, exampleSketch)
z: number,
},
},
// The position of the sketch group.
position: [number, number, number],
// The rotation of the sketch group base plane.
rotation: [number, number, number, number],
// The starting path.
start: {
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
@ -116,8 +288,12 @@ const example = extrude(5, exampleSketch)
value: [{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
@ -129,8 +305,12 @@ const example = extrude(5, exampleSketch)
center: [number, number],
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
@ -138,8 +318,12 @@ const example = extrude(5, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
@ -147,8 +331,12 @@ const example = extrude(5, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
@ -158,8 +346,12 @@ const example = extrude(5, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
@ -171,30 +363,16 @@ const example = extrude(5, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
// The x-axis of the sketch group base plane in the 3D space
xAxis: {
x: number,
y: number,
z: number,
},
// The y-axis of the sketch group base plane in the 3D space
yAxis: {
x: number,
y: number,
z: number,
},
// The z-axis of the sketch group base plane in the 3D space
zAxis: {
x: number,
y: number,
z: number,
},
}
```

View File

@ -9,7 +9,7 @@ Returns the segment end of y.
```js
segEndY(segment_name: string, sketch_group: SketchGroup) -> number
segEndY(segment_name: TagIdentifier, sketch_group: SketchGroup) -> number
```
### Examples
@ -31,12 +31,15 @@ const example = extrude(5, exampleSketch)
### Arguments
* `segment_name`: `string` (REQUIRED)
* `segment_name`: `TagIdentifier` (REQUIRED)
```js
{
value: string,
}
```
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
```js
{
// The plane id or face id of the sketch group.
entityId: uuid,
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
@ -72,12 +75,181 @@ const example = extrude(5, exampleSketch)
},
} |
{
// the face id the sketch is on
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: SketchSurface,
// The starting path.
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The paths in the sketch group.
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
} |
{
// arc's direction
ccw: string,
// the arc's center
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
// The x coordinate.
x: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
// The x coordinate.
x: number,
// The y coordinate.
y: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
},
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
value: [{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
},
// The id of the face.
id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face",
// The tag of the face.
value: string,
@ -100,16 +272,16 @@ const example = extrude(5, exampleSketch)
z: number,
},
},
// The position of the sketch group.
position: [number, number, number],
// The rotation of the sketch group base plane.
rotation: [number, number, number, number],
// The starting path.
start: {
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
@ -117,8 +289,12 @@ const example = extrude(5, exampleSketch)
value: [{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
@ -130,8 +306,12 @@ const example = extrude(5, exampleSketch)
center: [number, number],
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
@ -139,8 +319,12 @@ const example = extrude(5, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
@ -148,8 +332,12 @@ const example = extrude(5, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
@ -159,8 +347,12 @@ const example = extrude(5, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
@ -172,30 +364,16 @@ const example = extrude(5, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
// The x-axis of the sketch group base plane in the 3D space
xAxis: {
x: number,
y: number,
z: number,
},
// The y-axis of the sketch group base plane in the 3D space
yAxis: {
x: number,
y: number,
z: number,
},
// The z-axis of the sketch group base plane in the 3D space
zAxis: {
x: number,
y: number,
z: number,
},
}
```

View File

@ -9,7 +9,7 @@ Returns the length of the segment.
```js
segLen(segment_name: string, sketch_group: SketchGroup) -> number
segLen(segment_name: TagIdentifier, sketch_group: SketchGroup) -> number
```
### Examples
@ -32,12 +32,15 @@ const example = extrude(5, exampleSketch)
### Arguments
* `segment_name`: `string` (REQUIRED)
* `segment_name`: `TagIdentifier` (REQUIRED)
```js
{
value: string,
}
```
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
```js
{
// The plane id or face id of the sketch group.
entityId: uuid,
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
@ -73,12 +76,181 @@ const example = extrude(5, exampleSketch)
},
} |
{
// the face id the sketch is on
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: SketchSurface,
// The starting path.
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The paths in the sketch group.
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
} |
{
// arc's direction
ccw: string,
// the arc's center
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
// The x coordinate.
x: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
// The x coordinate.
x: number,
// The y coordinate.
y: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
},
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
value: [{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
},
// The id of the face.
id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face",
// The tag of the face.
value: string,
@ -101,16 +273,16 @@ const example = extrude(5, exampleSketch)
z: number,
},
},
// The position of the sketch group.
position: [number, number, number],
// The rotation of the sketch group base plane.
rotation: [number, number, number, number],
// The starting path.
start: {
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
@ -118,8 +290,12 @@ const example = extrude(5, exampleSketch)
value: [{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
@ -131,8 +307,12 @@ const example = extrude(5, exampleSketch)
center: [number, number],
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
@ -140,8 +320,12 @@ const example = extrude(5, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
@ -149,8 +333,12 @@ const example = extrude(5, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
@ -160,8 +348,12 @@ const example = extrude(5, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
@ -173,30 +365,16 @@ const example = extrude(5, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
// The x-axis of the sketch group base plane in the 3D space
xAxis: {
x: number,
y: number,
z: number,
},
// The y-axis of the sketch group base plane in the 3D space
yAxis: {
x: number,
y: number,
z: number,
},
// The z-axis of the sketch group base plane in the 3D space
zAxis: {
x: number,
y: number,
z: number,
},
}
```

View File

@ -36,7 +36,9 @@ shell({ faces: ['end'], thickness: 0.25 }, firstSketch)
{
// The faces you want removed.
faces: ["start" | "end" |
string],
{
value: string,
}],
// The thickness of the shell.
thickness: number,
}
@ -46,20 +48,182 @@ string],
{
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The position of the extrude group.
position: [number, number, number],
// The rotation of the extrude group.
rotation: [number, number, number, number],
// The sketch group paths.
sketchGroupValues: [{
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: {
// The id of the plane.
id: uuid,
// Origin of the plane.
origin: {
x: number,
y: number,
z: number,
},
type: "plane",
// Type for a plane.
value: "XY" | "XZ" | "YZ" | "Custom",
// What should the planes X axis be?
xAxis: {
x: number,
y: number,
z: number,
},
// What should the planes Y axis be?
yAxis: {
x: number,
y: number,
z: number,
},
// The z-axis (normal).
zAxis: {
x: number,
y: number,
z: number,
},
} |
{
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: SketchGroup,
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
value: [{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
},
// The id of the face.
id: uuid,
type: "face",
// The tag of the face.
value: string,
// What should the faces X axis be?
xAxis: {
x: number,
y: number,
z: number,
},
// What should the faces Y axis be?
yAxis: {
x: number,
y: number,
z: number,
},
// The z-axis (normal).
zAxis: {
x: number,
y: number,
z: number,
},
},
// The starting path.
start: {
// The from point.
from: [number, number],
// The name of the path.
name: string,
// 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",
@ -71,8 +235,12 @@ string],
center: [number, number],
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
@ -80,8 +248,12 @@ string],
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
@ -89,8 +261,12 @@ string],
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
@ -100,8 +276,12 @@ string],
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
@ -113,12 +293,17 @@ string],
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
},
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
@ -127,14 +312,14 @@ string],
faceId: uuid,
// The id of the geometry.
id: uuid,
// The name.
name: string,
// The position.
position: [number, number, number],
// The rotation.
rotation: [number, number, number, number],
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
@ -142,34 +327,16 @@ string],
faceId: uuid,
// The id of the geometry.
id: uuid,
// The name.
name: string,
// The position.
position: [number, number, number],
// The rotation.
rotation: [number, number, number, number],
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
// The x-axis of the extrude group base plane in the 3D space
xAxis: {
x: number,
y: number,
z: number,
},
// The y-axis of the extrude group base plane in the 3D space
yAxis: {
x: number,
y: number,
z: number,
},
// The z-axis of the extrude group base plane in the 3D space
zAxis: {
x: number,
y: number,
z: number,
},
}
```
@ -180,20 +347,182 @@ string],
{
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The position of the extrude group.
position: [number, number, number],
// The rotation of the extrude group.
rotation: [number, number, number, number],
// The sketch group paths.
sketchGroupValues: [{
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: {
// The id of the plane.
id: uuid,
// Origin of the plane.
origin: {
x: number,
y: number,
z: number,
},
type: "plane",
// Type for a plane.
value: "XY" | "XZ" | "YZ" | "Custom",
// What should the planes X axis be?
xAxis: {
x: number,
y: number,
z: number,
},
// What should the planes Y axis be?
yAxis: {
x: number,
y: number,
z: number,
},
// The z-axis (normal).
zAxis: {
x: number,
y: number,
z: number,
},
} |
{
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: SketchGroup,
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
value: [{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
},
// The id of the face.
id: uuid,
type: "face",
// The tag of the face.
value: string,
// What should the faces X axis be?
xAxis: {
x: number,
y: number,
z: number,
},
// What should the faces Y axis be?
yAxis: {
x: number,
y: number,
z: number,
},
// The z-axis (normal).
zAxis: {
x: number,
y: number,
z: number,
},
},
// The starting path.
start: {
// The from point.
from: [number, number],
// The name of the path.
name: string,
// 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",
@ -205,8 +534,12 @@ string],
center: [number, number],
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
@ -214,8 +547,12 @@ string],
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
@ -223,8 +560,12 @@ string],
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
@ -234,8 +575,12 @@ string],
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
@ -247,12 +592,17 @@ string],
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
},
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
@ -261,14 +611,14 @@ string],
faceId: uuid,
// The id of the geometry.
id: uuid,
// The name.
name: string,
// The position.
position: [number, number, number],
// The rotation.
rotation: [number, number, number, number],
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
@ -276,34 +626,16 @@ string],
faceId: uuid,
// The id of the geometry.
id: uuid,
// The name.
name: string,
// The position.
position: [number, number, number],
// The rotation.
rotation: [number, number, number, number],
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
// The x-axis of the extrude group base plane in the 3D space
xAxis: {
x: number,
y: number,
z: number,
},
// The y-axis of the extrude group base plane in the 3D space
yAxis: {
x: number,
y: number,
z: number,
},
// The z-axis of the extrude group base plane in the 3D space
zAxis: {
x: number,
y: number,
z: number,
},
}
```

View File

@ -9,7 +9,7 @@ Start a profile at a given point.
```js
startProfileAt(to: [number], sketch_surface: SketchSurface, tag?: String) -> SketchGroup
startProfileAt(to: [number], sketch_surface: SketchSurface, tag?: TagDeclarator) -> SketchGroup
```
### Examples
@ -90,44 +90,38 @@ const example = extrude(5, exampleSketch)
},
} |
{
// the face id the sketch is on
faceId: uuid,
// The id of the face.
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face",
// The tag of the face.
value: string,
// What should the 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,
},
}
```
* `tag`: `String` (OPTIONAL)
### Returns
`SketchGroup` - A sketch group is a collection of paths.
```js
radius: number,
type: "fillet",
} |
{
// The plane id or face id of the sketch group.
entityId: uuid,
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
@ -163,12 +157,10 @@ const example = extrude(5, exampleSketch)
},
} |
{
// the face id the sketch is on
faceId: uuid,
// The extrude group the face is on.
extrudeGroup: ExtrudeGroup,
// The id of the face.
id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face",
// The tag of the face.
value: string,
@ -191,16 +183,16 @@ const example = extrude(5, exampleSketch)
z: number,
},
},
// The position of the sketch group.
position: [number, number, number],
// The rotation of the sketch group base plane.
rotation: [number, number, number, number],
// The starting path.
start: {
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
@ -208,8 +200,12 @@ const example = extrude(5, exampleSketch)
value: [{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
@ -221,8 +217,12 @@ const example = extrude(5, exampleSketch)
center: [number, number],
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
@ -230,8 +230,12 @@ const example = extrude(5, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
@ -239,8 +243,12 @@ const example = extrude(5, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
@ -250,8 +258,12 @@ const example = extrude(5, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
@ -263,25 +275,69 @@ const example = extrude(5, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
// The x-axis of the sketch group base plane in the 3D space
},
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
value: [{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
},
// The id of the face.
id: uuid,
type: "face",
// The tag of the face.
value: string,
// What should the faces X axis be?
xAxis: {
x: number,
y: number,
z: number,
},
// The y-axis of the sketch group base plane in the 3D space
// What should the faces Y axis be?
yAxis: {
x: number,
y: number,
z: number,
},
// The z-axis of the sketch group base plane in the 3D space
// The z-axis (normal).
zAxis: {
x: number,
y: number,
@ -289,6 +345,356 @@ const example = extrude(5, exampleSketch)
},
}
```
* `tag`: `TagDeclarator` (OPTIONAL)
```js
{
end: number,
start: number,
value: string,
}
```
### Returns
`SketchGroup` - A sketch group is a collection of paths.
```js
{
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: {
// The id of the plane.
id: uuid,
// Origin of the plane.
origin: {
x: number,
y: number,
z: number,
},
type: "plane",
// Type for a plane.
value: "XY" | "XZ" | "YZ" | "Custom",
// What should the planes X axis be?
xAxis: {
x: number,
y: number,
z: number,
},
// What should the planes Y axis be?
yAxis: {
x: number,
y: number,
z: number,
},
// The z-axis (normal).
zAxis: {
x: number,
y: number,
z: number,
},
} |
{
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// 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.
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",
}],
}
```

View File

@ -59,8 +59,6 @@ const example = extrude(5, exampleSketch)
`SketchGroup` - A sketch group is a collection of paths.
```js
{
// The plane id or face id of the sketch group.
entityId: uuid,
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
@ -96,12 +94,181 @@ const example = extrude(5, exampleSketch)
},
} |
{
// the face id the sketch is on
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: SketchSurface,
// The starting path.
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The paths in the sketch group.
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
} |
{
// arc's direction
ccw: string,
// the arc's center
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
// The x coordinate.
x: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
// The x coordinate.
x: number,
// The y coordinate.
y: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
},
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
value: [{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
},
// The id of the face.
id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face",
// The tag of the face.
value: string,
@ -124,16 +291,16 @@ const example = extrude(5, exampleSketch)
z: number,
},
},
// The position of the sketch group.
position: [number, number, number],
// The rotation of the sketch group base plane.
rotation: [number, number, number, number],
// The starting path.
start: {
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
@ -141,8 +308,12 @@ const example = extrude(5, exampleSketch)
value: [{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
@ -154,8 +325,12 @@ const example = extrude(5, exampleSketch)
center: [number, number],
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
@ -163,8 +338,12 @@ const example = extrude(5, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
@ -172,8 +351,12 @@ const example = extrude(5, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
@ -183,8 +366,12 @@ const example = extrude(5, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
@ -196,30 +383,16 @@ const example = extrude(5, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
// The x-axis of the sketch group base plane in the 3D space
xAxis: {
x: number,
y: number,
z: number,
},
// The y-axis of the sketch group base plane in the 3D space
yAxis: {
x: number,
y: number,
z: number,
},
// The z-axis of the sketch group base plane in the 3D space
zAxis: {
x: number,
y: number,
z: number,
},
}
```

View File

@ -9,7 +9,7 @@ Start a sketch on a specific plane or face.
```js
startSketchOn(data: SketchData, tag?: SketchOnFaceTag) -> SketchSurface
startSketchOn(data: SketchData, tag?: FaceTag) -> SketchSurface
```
### Examples
@ -163,20 +163,118 @@ const a1 = startSketchOn({
{
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The position of the extrude group.
position: [number, number, number],
// The rotation of the extrude group.
rotation: [number, number, number, number],
// The sketch group paths.
sketchGroupValues: [{
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: {
// The id of the plane.
id: uuid,
// Origin of the plane.
origin: {
x: number,
y: number,
z: number,
},
type: "plane",
// Type for a plane.
value: "XY" | "XZ" | "YZ" | "Custom",
// What should the 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 name of the path.
name: string,
// 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",
@ -188,8 +286,12 @@ const a1 = startSketchOn({
center: [number, number],
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
@ -197,8 +299,12 @@ const a1 = startSketchOn({
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
@ -206,8 +312,12 @@ const a1 = startSketchOn({
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
@ -217,8 +327,12 @@ const a1 = startSketchOn({
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
@ -230,12 +344,17 @@ const a1 = startSketchOn({
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
},
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
@ -244,14 +363,14 @@ const a1 = startSketchOn({
faceId: uuid,
// The id of the geometry.
id: uuid,
// The name.
name: string,
// The position.
position: [number, number, number],
// The rotation.
rotation: [number, number, number, number],
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
@ -259,40 +378,24 @@ const a1 = startSketchOn({
faceId: uuid,
// The id of the geometry.
id: uuid,
// The name.
name: string,
// The position.
position: [number, number, number],
// The rotation.
rotation: [number, number, number, number],
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
// The x-axis of the extrude group base plane in the 3D space
xAxis: {
x: number,
y: number,
z: number,
},
// The y-axis of the extrude group base plane in the 3D space
yAxis: {
x: number,
y: number,
z: number,
},
// The z-axis of the extrude group base plane in the 3D space
zAxis: {
x: number,
y: number,
z: number,
},
}
```
* `tag`: `SketchOnFaceTag` - A tag for sketch on face. (OPTIONAL)
* `tag`: `FaceTag` - A tag for a face. (OPTIONAL)
```js
"start" | "end" |
string
{
value: string,
}
```
### Returns
@ -331,12 +434,238 @@ string
},
} |
{
// the face id the sketch is on
faceId: uuid,
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: {
// The id of the plane.
id: uuid,
// Origin of the plane.
origin: {
x: number,
y: number,
z: number,
},
type: "plane",
// Type for a plane.
value: "XY" | "XZ" | "YZ" | "Custom",
// What should the 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.
id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face",
// The tag of the face.
value: string,

File diff suppressed because it is too large Load Diff

View File

@ -9,7 +9,7 @@ Draw an arc.
```js
tangentialArc(data: TangentialArcData, sketch_group: SketchGroup, tag?: String) -> SketchGroup
tangentialArc(data: TangentialArcData, sketch_group: SketchGroup, tag?: TagDeclarator) -> SketchGroup
```
### Examples
@ -42,8 +42,6 @@ const example = extrude(10, exampleSketch)
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
```js
{
// The plane id or face id of the sketch group.
entityId: uuid,
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
@ -79,12 +77,181 @@ const example = extrude(10, exampleSketch)
},
} |
{
// the face id the sketch is on
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: SketchSurface,
// The starting path.
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The paths in the sketch group.
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
} |
{
// arc's direction
ccw: string,
// the arc's center
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
// The x coordinate.
x: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
// The x coordinate.
x: number,
// The y coordinate.
y: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
},
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
value: [{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
},
// The id of the face.
id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face",
// The tag of the face.
value: string,
@ -107,16 +274,16 @@ const example = extrude(10, exampleSketch)
z: number,
},
},
// The position of the sketch group.
position: [number, number, number],
// The rotation of the sketch group base plane.
rotation: [number, number, number, number],
// The starting path.
start: {
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
@ -124,8 +291,12 @@ const example = extrude(10, exampleSketch)
value: [{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
@ -137,8 +308,12 @@ const example = extrude(10, exampleSketch)
center: [number, number],
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
@ -146,8 +321,12 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
@ -155,8 +334,12 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
@ -166,8 +349,12 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
@ -179,41 +366,32 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
// The x-axis of the sketch group base plane in the 3D space
xAxis: {
x: number,
y: number,
z: number,
},
// The y-axis of the sketch group base plane in the 3D space
yAxis: {
x: number,
y: number,
z: number,
},
// The z-axis of the sketch group base plane in the 3D space
zAxis: {
x: number,
y: number,
z: number,
},
}
```
* `tag`: `String` (OPTIONAL)
* `tag`: `TagDeclarator` (OPTIONAL)
```js
{
end: number,
start: number,
value: string,
}
```
### Returns
`SketchGroup` - A sketch group is a collection of paths.
```js
{
// The plane id or face id of the sketch group.
entityId: uuid,
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
@ -249,12 +427,181 @@ const example = extrude(10, exampleSketch)
},
} |
{
// the face id the sketch is on
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: SketchSurface,
// The starting path.
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The paths in the sketch group.
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
} |
{
// arc's direction
ccw: string,
// the arc's center
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
// The x coordinate.
x: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
// The x coordinate.
x: number,
// The y coordinate.
y: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
},
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
value: [{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
},
// The id of the face.
id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face",
// The tag of the face.
value: string,
@ -277,16 +624,16 @@ const example = extrude(10, exampleSketch)
z: number,
},
},
// The position of the sketch group.
position: [number, number, number],
// The rotation of the sketch group base plane.
rotation: [number, number, number, number],
// The starting path.
start: {
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
@ -294,8 +641,12 @@ const example = extrude(10, exampleSketch)
value: [{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
@ -307,8 +658,12 @@ const example = extrude(10, exampleSketch)
center: [number, number],
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
@ -316,8 +671,12 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
@ -325,8 +684,12 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
@ -336,8 +699,12 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
@ -349,30 +716,16 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
// The x-axis of the sketch group base plane in the 3D space
xAxis: {
x: number,
y: number,
z: number,
},
// The y-axis of the sketch group base plane in the 3D space
yAxis: {
x: number,
y: number,
z: number,
},
// The z-axis of the sketch group base plane in the 3D space
zAxis: {
x: number,
y: number,
z: number,
},
}
```

View File

@ -9,7 +9,7 @@ Draw an arc.
```js
tangentialArcTo(to: [number], sketch_group: SketchGroup, tag?: String) -> SketchGroup
tangentialArcTo(to: [number], sketch_group: SketchGroup, tag?: TagDeclarator) -> SketchGroup
```
### Examples
@ -33,8 +33,6 @@ const example = extrude(10, exampleSketch)
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
```js
{
// The plane id or face id of the sketch group.
entityId: uuid,
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
@ -70,12 +68,181 @@ const example = extrude(10, exampleSketch)
},
} |
{
// the face id the sketch is on
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: SketchSurface,
// The starting path.
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The paths in the sketch group.
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
} |
{
// arc's direction
ccw: string,
// the arc's center
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
// The x coordinate.
x: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
// The x coordinate.
x: number,
// The y coordinate.
y: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
},
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
value: [{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
},
// The id of the face.
id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face",
// The tag of the face.
value: string,
@ -98,16 +265,16 @@ const example = extrude(10, exampleSketch)
z: number,
},
},
// The position of the sketch group.
position: [number, number, number],
// The rotation of the sketch group base plane.
rotation: [number, number, number, number],
// The starting path.
start: {
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
@ -115,8 +282,12 @@ const example = extrude(10, exampleSketch)
value: [{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
@ -128,8 +299,12 @@ const example = extrude(10, exampleSketch)
center: [number, number],
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
@ -137,8 +312,12 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
@ -146,8 +325,12 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
@ -157,8 +340,12 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
@ -170,41 +357,32 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
// The x-axis of the sketch group base plane in the 3D space
xAxis: {
x: number,
y: number,
z: number,
},
// The y-axis of the sketch group base plane in the 3D space
yAxis: {
x: number,
y: number,
z: number,
},
// The z-axis of the sketch group base plane in the 3D space
zAxis: {
x: number,
y: number,
z: number,
},
}
```
* `tag`: `String` (OPTIONAL)
* `tag`: `TagDeclarator` (OPTIONAL)
```js
{
end: number,
start: number,
value: string,
}
```
### Returns
`SketchGroup` - A sketch group is a collection of paths.
```js
{
// The plane id or face id of the sketch group.
entityId: uuid,
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
@ -240,12 +418,181 @@ const example = extrude(10, exampleSketch)
},
} |
{
// the face id the sketch is on
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: SketchSurface,
// The starting path.
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The paths in the sketch group.
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
} |
{
// arc's direction
ccw: string,
// the arc's center
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
// The x coordinate.
x: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
// The x coordinate.
x: number,
// The y coordinate.
y: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
},
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
value: [{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
},
// The id of the face.
id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face",
// The tag of the face.
value: string,
@ -268,16 +615,16 @@ const example = extrude(10, exampleSketch)
z: number,
},
},
// The position of the sketch group.
position: [number, number, number],
// The rotation of the sketch group base plane.
rotation: [number, number, number, number],
// The starting path.
start: {
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
@ -285,8 +632,12 @@ const example = extrude(10, exampleSketch)
value: [{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
@ -298,8 +649,12 @@ const example = extrude(10, exampleSketch)
center: [number, number],
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
@ -307,8 +662,12 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
@ -316,8 +675,12 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
@ -327,8 +690,12 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
@ -340,30 +707,16 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
// The x-axis of the sketch group base plane in the 3D space
xAxis: {
x: number,
y: number,
z: number,
},
// The y-axis of the sketch group base plane in the 3D space
yAxis: {
x: number,
y: number,
z: number,
},
// The z-axis of the sketch group base plane in the 3D space
zAxis: {
x: number,
y: number,
z: number,
},
}
```

View File

@ -9,7 +9,7 @@ Draw a line on the x-axis.
```js
xLine(length: number, sketch_group: SketchGroup, tag?: String) -> SketchGroup
xLine(length: number, sketch_group: SketchGroup, tag?: TagDeclarator) -> SketchGroup
```
### Examples
@ -36,8 +36,6 @@ const example = extrude(10, exampleSketch)
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
```js
{
// The plane id or face id of the sketch group.
entityId: uuid,
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
@ -73,12 +71,181 @@ const example = extrude(10, exampleSketch)
},
} |
{
// the face id the sketch is on
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: SketchSurface,
// The starting path.
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The paths in the sketch group.
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
} |
{
// arc's direction
ccw: string,
// the arc's center
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
// The x coordinate.
x: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
// The x coordinate.
x: number,
// The y coordinate.
y: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
},
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
value: [{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
},
// The id of the face.
id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face",
// The tag of the face.
value: string,
@ -101,16 +268,16 @@ const example = extrude(10, exampleSketch)
z: number,
},
},
// The position of the sketch group.
position: [number, number, number],
// The rotation of the sketch group base plane.
rotation: [number, number, number, number],
// The starting path.
start: {
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
@ -118,8 +285,12 @@ const example = extrude(10, exampleSketch)
value: [{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
@ -131,8 +302,12 @@ const example = extrude(10, exampleSketch)
center: [number, number],
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
@ -140,8 +315,12 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
@ -149,8 +328,12 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
@ -160,8 +343,12 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
@ -173,41 +360,32 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
// The x-axis of the sketch group base plane in the 3D space
xAxis: {
x: number,
y: number,
z: number,
},
// The y-axis of the sketch group base plane in the 3D space
yAxis: {
x: number,
y: number,
z: number,
},
// The z-axis of the sketch group base plane in the 3D space
zAxis: {
x: number,
y: number,
z: number,
},
}
```
* `tag`: `String` (OPTIONAL)
* `tag`: `TagDeclarator` (OPTIONAL)
```js
{
end: number,
start: number,
value: string,
}
```
### Returns
`SketchGroup` - A sketch group is a collection of paths.
```js
{
// The plane id or face id of the sketch group.
entityId: uuid,
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
@ -243,12 +421,181 @@ const example = extrude(10, exampleSketch)
},
} |
{
// the face id the sketch is on
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: SketchSurface,
// The starting path.
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The paths in the sketch group.
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
} |
{
// arc's direction
ccw: string,
// the arc's center
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
// The x coordinate.
x: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
// The x coordinate.
x: number,
// The y coordinate.
y: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
},
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
value: [{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
},
// The id of the face.
id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face",
// The tag of the face.
value: string,
@ -271,16 +618,16 @@ const example = extrude(10, exampleSketch)
z: number,
},
},
// The position of the sketch group.
position: [number, number, number],
// The rotation of the sketch group base plane.
rotation: [number, number, number, number],
// The starting path.
start: {
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
@ -288,8 +635,12 @@ const example = extrude(10, exampleSketch)
value: [{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
@ -301,8 +652,12 @@ const example = extrude(10, exampleSketch)
center: [number, number],
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
@ -310,8 +665,12 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
@ -319,8 +678,12 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
@ -330,8 +693,12 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
@ -343,30 +710,16 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
// The x-axis of the sketch group base plane in the 3D space
xAxis: {
x: number,
y: number,
z: number,
},
// The y-axis of the sketch group base plane in the 3D space
yAxis: {
x: number,
y: number,
z: number,
},
// The z-axis of the sketch group base plane in the 3D space
zAxis: {
x: number,
y: number,
z: number,
},
}
```

View File

@ -9,7 +9,7 @@ Draw a line to a point on the x-axis.
```js
xLineTo(to: number, sketch_group: SketchGroup, tag?: String) -> SketchGroup
xLineTo(to: number, sketch_group: SketchGroup, tag?: TagDeclarator) -> SketchGroup
```
### Examples
@ -36,8 +36,6 @@ const example = extrude(10, exampleSketch)
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
```js
{
// The plane id or face id of the sketch group.
entityId: uuid,
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
@ -73,12 +71,181 @@ const example = extrude(10, exampleSketch)
},
} |
{
// the face id the sketch is on
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: SketchSurface,
// The starting path.
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The paths in the sketch group.
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
} |
{
// arc's direction
ccw: string,
// the arc's center
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
// The x coordinate.
x: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
// The x coordinate.
x: number,
// The y coordinate.
y: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
},
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
value: [{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
},
// The id of the face.
id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face",
// The tag of the face.
value: string,
@ -101,16 +268,16 @@ const example = extrude(10, exampleSketch)
z: number,
},
},
// The position of the sketch group.
position: [number, number, number],
// The rotation of the sketch group base plane.
rotation: [number, number, number, number],
// The starting path.
start: {
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
@ -118,8 +285,12 @@ const example = extrude(10, exampleSketch)
value: [{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
@ -131,8 +302,12 @@ const example = extrude(10, exampleSketch)
center: [number, number],
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
@ -140,8 +315,12 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
@ -149,8 +328,12 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
@ -160,8 +343,12 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
@ -173,41 +360,32 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
// The x-axis of the sketch group base plane in the 3D space
xAxis: {
x: number,
y: number,
z: number,
},
// The y-axis of the sketch group base plane in the 3D space
yAxis: {
x: number,
y: number,
z: number,
},
// The z-axis of the sketch group base plane in the 3D space
zAxis: {
x: number,
y: number,
z: number,
},
}
```
* `tag`: `String` (OPTIONAL)
* `tag`: `TagDeclarator` (OPTIONAL)
```js
{
end: number,
start: number,
value: string,
}
```
### Returns
`SketchGroup` - A sketch group is a collection of paths.
```js
{
// The plane id or face id of the sketch group.
entityId: uuid,
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
@ -243,12 +421,181 @@ const example = extrude(10, exampleSketch)
},
} |
{
// the face id the sketch is on
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: SketchSurface,
// The starting path.
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The paths in the sketch group.
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
} |
{
// arc's direction
ccw: string,
// the arc's center
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
// The x coordinate.
x: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
// The x coordinate.
x: number,
// The y coordinate.
y: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
},
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
value: [{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
},
// The id of the face.
id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face",
// The tag of the face.
value: string,
@ -271,16 +618,16 @@ const example = extrude(10, exampleSketch)
z: number,
},
},
// The position of the sketch group.
position: [number, number, number],
// The rotation of the sketch group base plane.
rotation: [number, number, number, number],
// The starting path.
start: {
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
@ -288,8 +635,12 @@ const example = extrude(10, exampleSketch)
value: [{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
@ -301,8 +652,12 @@ const example = extrude(10, exampleSketch)
center: [number, number],
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
@ -310,8 +665,12 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
@ -319,8 +678,12 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
@ -330,8 +693,12 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
@ -343,30 +710,16 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
// The x-axis of the sketch group base plane in the 3D space
xAxis: {
x: number,
y: number,
z: number,
},
// The y-axis of the sketch group base plane in the 3D space
yAxis: {
x: number,
y: number,
z: number,
},
// The z-axis of the sketch group base plane in the 3D space
zAxis: {
x: number,
y: number,
z: number,
},
}
```

View File

@ -9,7 +9,7 @@ Draw a line on the y-axis.
```js
yLine(length: number, sketch_group: SketchGroup, tag?: String) -> SketchGroup
yLine(length: number, sketch_group: SketchGroup, tag?: TagDeclarator) -> SketchGroup
```
### Examples
@ -34,8 +34,6 @@ const example = extrude(10, exampleSketch)
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
```js
{
// The plane id or face id of the sketch group.
entityId: uuid,
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
@ -71,12 +69,181 @@ const example = extrude(10, exampleSketch)
},
} |
{
// the face id the sketch is on
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: SketchSurface,
// The starting path.
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The paths in the sketch group.
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
} |
{
// arc's direction
ccw: string,
// the arc's center
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
// The x coordinate.
x: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
// The x coordinate.
x: number,
// The y coordinate.
y: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
},
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
value: [{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
},
// The id of the face.
id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face",
// The tag of the face.
value: string,
@ -99,16 +266,16 @@ const example = extrude(10, exampleSketch)
z: number,
},
},
// The position of the sketch group.
position: [number, number, number],
// The rotation of the sketch group base plane.
rotation: [number, number, number, number],
// The starting path.
start: {
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
@ -116,8 +283,12 @@ const example = extrude(10, exampleSketch)
value: [{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
@ -129,8 +300,12 @@ const example = extrude(10, exampleSketch)
center: [number, number],
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
@ -138,8 +313,12 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
@ -147,8 +326,12 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
@ -158,8 +341,12 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
@ -171,41 +358,32 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
// The x-axis of the sketch group base plane in the 3D space
xAxis: {
x: number,
y: number,
z: number,
},
// The y-axis of the sketch group base plane in the 3D space
yAxis: {
x: number,
y: number,
z: number,
},
// The z-axis of the sketch group base plane in the 3D space
zAxis: {
x: number,
y: number,
z: number,
},
}
```
* `tag`: `String` (OPTIONAL)
* `tag`: `TagDeclarator` (OPTIONAL)
```js
{
end: number,
start: number,
value: string,
}
```
### Returns
`SketchGroup` - A sketch group is a collection of paths.
```js
{
// The plane id or face id of the sketch group.
entityId: uuid,
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
@ -241,12 +419,181 @@ const example = extrude(10, exampleSketch)
},
} |
{
// the face id the sketch is on
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: SketchSurface,
// The starting path.
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The paths in the sketch group.
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
} |
{
// arc's direction
ccw: string,
// the arc's center
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
// The x coordinate.
x: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
// The x coordinate.
x: number,
// The y coordinate.
y: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
},
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
value: [{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
},
// The id of the face.
id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face",
// The tag of the face.
value: string,
@ -269,16 +616,16 @@ const example = extrude(10, exampleSketch)
z: number,
},
},
// The position of the sketch group.
position: [number, number, number],
// The rotation of the sketch group base plane.
rotation: [number, number, number, number],
// The starting path.
start: {
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
@ -286,8 +633,12 @@ const example = extrude(10, exampleSketch)
value: [{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
@ -299,8 +650,12 @@ const example = extrude(10, exampleSketch)
center: [number, number],
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
@ -308,8 +663,12 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
@ -317,8 +676,12 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
@ -328,8 +691,12 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
@ -341,30 +708,16 @@ const example = extrude(10, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
// The x-axis of the sketch group base plane in the 3D space
xAxis: {
x: number,
y: number,
z: number,
},
// The y-axis of the sketch group base plane in the 3D space
yAxis: {
x: number,
y: number,
z: number,
},
// The z-axis of the sketch group base plane in the 3D space
zAxis: {
x: number,
y: number,
z: number,
},
}
```

View File

@ -9,7 +9,7 @@ Draw a line to a point on the y-axis.
```js
yLineTo(to: number, sketch_group: SketchGroup, tag?: String) -> SketchGroup
yLineTo(to: number, sketch_group: SketchGroup, tag?: TagDeclarator) -> SketchGroup
```
### Examples
@ -32,8 +32,6 @@ const example = extrude(5, exampleSketch)
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
```js
{
// The plane id or face id of the sketch group.
entityId: uuid,
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
@ -69,12 +67,181 @@ const example = extrude(5, exampleSketch)
},
} |
{
// the face id the sketch is on
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: SketchSurface,
// The starting path.
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The paths in the sketch group.
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
} |
{
// arc's direction
ccw: string,
// the arc's center
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
// The x coordinate.
x: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
// The x coordinate.
x: number,
// The y coordinate.
y: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
},
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
value: [{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
},
// The id of the face.
id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face",
// The tag of the face.
value: string,
@ -97,16 +264,16 @@ const example = extrude(5, exampleSketch)
z: number,
},
},
// The position of the sketch group.
position: [number, number, number],
// The rotation of the sketch group base plane.
rotation: [number, number, number, number],
// The starting path.
start: {
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
@ -114,8 +281,12 @@ const example = extrude(5, exampleSketch)
value: [{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
@ -127,8 +298,12 @@ const example = extrude(5, exampleSketch)
center: [number, number],
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
@ -136,8 +311,12 @@ const example = extrude(5, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
@ -145,8 +324,12 @@ const example = extrude(5, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
@ -156,8 +339,12 @@ const example = extrude(5, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
@ -169,41 +356,32 @@ const example = extrude(5, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
// The x-axis of the sketch group base plane in the 3D space
xAxis: {
x: number,
y: number,
z: number,
},
// The y-axis of the sketch group base plane in the 3D space
yAxis: {
x: number,
y: number,
z: number,
},
// The z-axis of the sketch group base plane in the 3D space
zAxis: {
x: number,
y: number,
z: number,
},
}
```
* `tag`: `String` (OPTIONAL)
* `tag`: `TagDeclarator` (OPTIONAL)
```js
{
end: number,
start: number,
value: string,
}
```
### Returns
`SketchGroup` - A sketch group is a collection of paths.
```js
{
// The plane id or face id of the sketch group.
entityId: uuid,
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
@ -239,12 +417,181 @@ const example = extrude(5, exampleSketch)
},
} |
{
// the face id the sketch is on
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: SketchSurface,
// The starting path.
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The paths in the sketch group.
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
} |
{
// arc's direction
ccw: string,
// the arc's center
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
// The x coordinate.
x: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
// The x coordinate.
x: number,
// The y coordinate.
y: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
},
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
value: [{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
},
// The id of the face.
id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face",
// The tag of the face.
value: string,
@ -267,16 +614,16 @@ const example = extrude(5, exampleSketch)
z: number,
},
},
// The position of the sketch group.
position: [number, number, number],
// The rotation of the sketch group base plane.
rotation: [number, number, number, number],
// The starting path.
start: {
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
@ -284,8 +631,12 @@ const example = extrude(5, exampleSketch)
value: [{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
@ -297,8 +648,12 @@ const example = extrude(5, exampleSketch)
center: [number, number],
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
@ -306,8 +661,12 @@ const example = extrude(5, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
@ -315,8 +674,12 @@ const example = extrude(5, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
@ -326,8 +689,12 @@ const example = extrude(5, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
@ -339,30 +706,16 @@ const example = extrude(5, exampleSketch)
{
// The from point.
from: [number, number],
// The name of the path.
name: string,
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
// The x-axis of the sketch group base plane in the 3D space
xAxis: {
x: number,
y: number,
z: number,
},
// The y-axis of the sketch group base plane in the 3D space
yAxis: {
x: number,
y: number,
z: number,
},
// The z-axis of the sketch group base plane in the 3D space
zAxis: {
x: number,
y: number,
z: number,
},
}
```

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: 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: 46 KiB

After

Width:  |  Height:  |  Size: 46 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: 45 KiB

After

Width:  |  Height:  |  Size: 43 KiB

View File

@ -8,6 +8,13 @@ import { Protocol } from 'playwright-core/types/protocol'
import type { Models } from '@kittycad/lib'
import { APP_NAME } from 'lib/constants'
type TestColor = [number, number, number]
export const TEST_COLORS = {
WHITE: [249, 249, 249] as TestColor,
YELLOW: [255, 255, 0] as TestColor,
BLUE: [0, 0, 255] as TestColor,
} as const
async function waitForPageLoad(page: Page) {
// wait for 'Loading stream...' spinner
await page.getByTestId('loading-stream').waitFor()
@ -107,19 +114,45 @@ export const wiggleMove = async (
dist: number,
ang: number,
amplitude: number,
freq: number
freq: number,
locator?: string
) => {
const tau = Math.PI * 2
const deg = tau / 360
const step = dist / steps
for (let i = 0, j = 0; i < dist; i += step, j += 1) {
if (locator) {
const isElVis = await page.locator(locator).isVisible()
if (isElVis) return
}
const [x1, y1] = [0, Math.sin((tau / steps) * j * freq) * amplitude]
const [x2, y2] = [
Math.cos(-ang * deg) * i - Math.sin(-ang * deg) * y1,
Math.sin(-ang * deg) * i + Math.cos(-ang * deg) * y1,
]
const [xr, yr] = [x2, y2]
await page.mouse.move(x + xr, y + yr, { steps: 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 })
}
}
@ -144,11 +177,11 @@ export const getMovementUtils = (opts: any) => {
// Make it easier to click around from center ("click [from] zero zero")
const click00 = (x: number, y: number) =>
opts.page.mouse.click(opts.center.x + x, opts.center.y + y)
opts.page.mouse.click(opts.center.x + x, opts.center.y + y, { delay: 100 })
// Relative clicker, must keep state
let last = { x: 0, y: 0 }
const click00r = (x?: number, y?: number) => {
const click00r = async (x?: number, y?: number) => {
// reset relative coordinates when anything is undefined
if (x === undefined || y === undefined) {
last.x = 0
@ -156,12 +189,19 @@ export const getMovementUtils = (opts: any) => {
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.y += y
// Returns the new absolute coordinate if you need it.
return ret.then(() => [last.x, last.y])
return [last.x, last.y]
}
return { toSU, click00r }

View File

@ -1,6 +1,6 @@
{
"name": "untitled-app",
"version": "0.22.3",
"version": "0.22.6",
"private": true,
"dependencies": {
"@codemirror/autocomplete": "^6.16.0",
@ -37,6 +37,7 @@
"crypto-js": "^4.2.0",
"debounce-promise": "^3.1.2",
"decamelize": "^6.0.0",
"eslint-plugin-suggest-no-throw": "^1.0.0",
"formik": "^2.4.6",
"fuse.js": "^7.0.0",
"html2canvas-pro": "^1.4.3",
@ -120,7 +121,7 @@
"@babel/plugin-proposal-private-property-in-object": "^7.21.11",
"@babel/preset-env": "^7.24.3",
"@iarna/toml": "^2.2.5",
"@playwright/test": "^1.43.1",
"@playwright/test": "^1.44.1",
"@tauri-apps/cli": "^2.0.0-beta.13",
"@types/crypto-js": "^4.2.2",
"@types/debounce-promise": "^3.1.9",

View File

@ -18,7 +18,7 @@ export default defineConfig({
/* Retry on CI only */
retries: process.env.CI ? 3 : 0,
/* Different amount of parallelism on CI and local. */
workers: process.env.CI ? 1 : 1,
workers: process.env.CI ? 1 : 4,
/* Reporter to use. See https://playwright.dev/docs/test-reporters */
reporter: 'html',
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */

1488
src-tauri/Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -20,7 +20,7 @@ kittycad = "0.3.5"
log = "0.4.21"
oauth2 = "4.4.2"
serde_json = "1.0"
tauri = { version = "2.0.0-beta.22", features = [ "devtools", "unstable"] }
tauri = { version = "2.0.0-beta.15", features = [ "devtools", "unstable"] }
tauri-plugin-cli = { version = "2.0.0-beta.3" }
tauri-plugin-deep-link = { version = "2.0.0-beta.3" }
tauri-plugin-dialog = { version = "2.0.0-beta.6" }

View File

@ -63,17 +63,16 @@
"subcommands": {}
},
"deep-link": {
"mobile": [],
"desktop": {
"schemes": [
"app.zoo.dev"
]
}
"domains": [
{
"host": "app.zoo.dev"
}
]
},
"shell": {
"open": true
}
},
"productName": "Zoo Modeling App",
"version": "0.22.3"
"version": "0.22.6"
}

View File

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

View File

@ -44,6 +44,7 @@ import {
removeSingleConstraintInfo,
} from 'lang/modifyAst'
import { ActionButton } from 'components/ActionButton'
import { err, trap } from 'lib/trap'
function useShouldHideScene(): { hideClient: boolean; hideServer: boolean } {
const [isCamMoving, setIsCamMoving] = useState(false)
@ -184,11 +185,14 @@ const Overlay = ({
let xAlignment = overlay.angle < 0 ? '0%' : '-100%'
let yAlignment = overlay.angle < -90 || overlay.angle >= 90 ? '0%' : '-100%'
const callExpression = getNodeFromPath<CallExpression>(
const _node1 = getNodeFromPath<CallExpression>(
kclManager.ast,
overlay.pathToNode,
'CallExpression'
).node
)
if (err(_node1)) return
const callExpression = _node1.node
const constraints = getConstraintInfo(
callExpression,
codeManager.code,
@ -219,6 +223,7 @@ const Overlay = ({
data-testid="segment-overlay"
data-path-to-node={pathToNodeString}
data-overlay-index={overlayIndex}
data-overlay-visible={shouldShow}
data-overlay-angle={overlay.angle}
className="pointer-events-auto absolute w-0 h-0"
style={{
@ -227,6 +232,7 @@ const Overlay = ({
></div>
{shouldShow && (
<div
data-overlay-toolbar-index={overlayIndex}
className={`px-0 pointer-events-auto absolute flex gap-1`}
style={{
transform: `translate3d(calc(${
@ -352,7 +358,7 @@ export async function deleteSegment({
pathToNode: PathToNode
sketchDetails: SketchDetails | null
}) {
let modifiedAst: Program = kclManager.ast
let modifiedAst: Program | Error = kclManager.ast
const dependentRanges = findUsesOfTagInPipe(modifiedAst, pathToNode)
const shouldContinueSegDelete = dependentRanges.length
@ -363,6 +369,7 @@ export async function deleteSegment({
: true
if (!shouldContinueSegDelete) return
modifiedAst = deleteSegmentFromPipeExpression(
dependentRanges,
modifiedAst,
@ -370,9 +377,12 @@ export async function deleteSegment({
codeManager.code,
pathToNode
)
if (err(modifiedAst)) return Promise.reject(modifiedAst)
const newCode = recast(modifiedAst)
modifiedAst = parse(newCode)
if (err(modifiedAst)) return Promise.reject(modifiedAst)
const testExecute = await executeAst({
ast: modifiedAst,
useFakeExecutor: true,
@ -384,13 +394,15 @@ export async function deleteSegment({
}
if (!sketchDetails) return
sceneEntitiesManager.updateAstAndRejigSketch(
sketchDetails.sketchPathToNode,
await sceneEntitiesManager.updateAstAndRejigSketch(
pathToNode,
modifiedAst,
sketchDetails.zAxis,
sketchDetails.yAxis,
sketchDetails.origin
)
// Now 'Set sketchDetails' is called with the modified pathToNode
}
const SegmentMenu = ({
@ -535,10 +547,13 @@ const ConstraintSymbol = ({
const implicitDesc =
varNameMap[_type as LineInputsType]?.implicitConstraintDesc
const node = useMemo(
() => getNodeFromPath<Value>(kclManager.ast, pathToNode).node,
const _node = useMemo(
() => getNodeFromPath<Value>(kclManager.ast, pathToNode),
[kclManager.ast, pathToNode]
)
if (err(_node)) return
const node = _node.node
const range: SourceRange = node ? [node.start, node.end] : [0, 0]
if (_type === 'intersectionTag') return null
@ -576,12 +591,17 @@ const ConstraintSymbol = ({
})
} else if (isConstrained) {
try {
const shallowPath = getNodeFromPath<CallExpression>(
parse(recast(kclManager.ast)),
const parsed = parse(recast(kclManager.ast))
if (trap(parsed)) return Promise.reject(parsed)
const _node1 = getNodeFromPath<CallExpression>(
parsed,
pathToNode,
'CallExpression',
true
).shallowPath
)
if (trap(_node1)) return Promise.reject(_node1)
const shallowPath = _node1.shallowPath
const input = makeRemoveSingleConstraintInput(
argPosition,
shallowPath

View File

@ -73,7 +73,7 @@ import {
changeSketchArguments,
updateStartProfileAtArgs,
} from 'lang/std/sketch'
import { normaliseAngle, roundOff, throttle } from 'lib/utils'
import { isOverlap, normaliseAngle, roundOff, throttle } from 'lib/utils'
import {
createArrayExpression,
createCallExpressionStdLib,
@ -83,6 +83,7 @@ import {
findUniqueName,
} from 'lang/modifyAst'
import {
Selections,
getEventForSegmentSelection,
sendSelectEventToEngine,
} from 'lib/selections'
@ -100,6 +101,7 @@ import {
updateRectangleSketch,
} from 'lib/rectangleTool'
import { getThemeColorForThreeJs } from 'lib/theme'
import { err, trap } from 'lib/trap'
type DraftSegment = 'line' | 'tangentialArcTo'
@ -300,6 +302,7 @@ export class SceneEntities {
position,
maybeModdedAst,
draftExpressionsIndices,
selectionRanges,
}: {
sketchPathToNode: PathToNode
maybeModdedAst: Program
@ -307,6 +310,7 @@ export class SceneEntities {
forward: [number, number, number]
up: [number, number, number]
position?: [number, number, number]
selectionRanges?: Selections
}): Promise<{
truncatedAst: Program
programMemoryOverride: ProgramMemory
@ -315,8 +319,14 @@ export class SceneEntities {
}> {
this.createIntersectionPlane()
const prepared = this.prepareTruncatedMemoryAndAst(
sketchPathToNode || [],
maybeModdedAst
)
if (err(prepared)) return Promise.reject(prepared)
const { truncatedAst, programMemoryOverride, variableDeclarationName } =
this.prepareTruncatedMemoryAndAst(sketchPathToNode || [], maybeModdedAst)
prepared
const { programMemory } = await executeAst({
ast: truncatedAst,
useFakeExecutor: true,
@ -328,6 +338,8 @@ export class SceneEntities {
ast: maybeModdedAst,
programMemory,
})
if (err(sketchGroup)) return Promise.reject(sketchGroup)
if (!Array.isArray(sketchGroup?.value))
return {
truncatedAst,
@ -343,11 +355,8 @@ export class SceneEntities {
pathToNode: sketchPathToNode,
}
const dummy = new Mesh()
dummy.position.set(
sketchGroup.position[0],
sketchGroup.position[1],
sketchGroup.position[2]
)
// TODO: When we actually have sketch positions and rotations we can use them here.
dummy.position.set(0, 0, 0)
const orthoFactor = orthoScale(sceneInfra.camControls.camera)
const factor =
(sceneInfra.camControls.camera instanceof OrthographicCamera
@ -399,12 +408,21 @@ export class SceneEntities {
draftExpressionsIndices &&
index <= draftExpressionsIndices.end &&
index >= draftExpressionsIndices.start
const isSelected = selectionRanges?.codeBasedSelections.some(
(selection) => {
return isOverlap(selection.range, segment.__geoMeta.sourceRange)
}
)
let seg
const callExpName = getNodeFromPath<CallExpression>(
const _node1 = getNodeFromPath<CallExpression>(
maybeModdedAst,
segPathToNode,
'CallExpression'
)?.node?.callee?.name
)
if (err(_node1)) return
const callExpName = _node1.node?.callee?.name
if (segment.type === 'TangentialArcTo') {
seg = tangentialArcToSegment({
prevSegment: sketchGroup.value[index - 1],
@ -416,6 +434,7 @@ export class SceneEntities {
scale: factor,
texture: sceneInfra.extraSegmentTexture,
theme: sceneInfra._theme,
isSelected,
})
callbacks.push(
this.updateTangentialArcToSegment({
@ -437,6 +456,7 @@ export class SceneEntities {
callExpName,
texture: sceneInfra.extraSegmentTexture,
theme: sceneInfra._theme,
isSelected,
})
callbacks.push(
this.updateStraightSegment({
@ -481,12 +501,14 @@ export class SceneEntities {
}
updateAstAndRejigSketch = async (
sketchPathToNode: PathToNode,
modifiedAst: Program,
modifiedAst: Program | Error,
forward: [number, number, number],
up: [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 })
sceneInfra.resetMouseListeners()
await this.setupSketch({
@ -494,7 +516,7 @@ export class SceneEntities {
forward,
up,
position: origin,
maybeModdedAst: kclManager.ast,
maybeModdedAst: nextAst.newAst,
})
this.setupSketchIdleCallbacks({
forward,
@ -502,6 +524,7 @@ export class SceneEntities {
position: origin,
pathToNode: sketchPathToNode,
})
return nextAst
}
setUpDraftSegment = async (
sketchPathToNode: PathToNode,
@ -513,12 +536,15 @@ export class SceneEntities {
) => {
const _ast = JSON.parse(JSON.stringify(kclManager.ast))
const _node1 = getNodeFromPath<VariableDeclaration>(
_ast,
sketchPathToNode || [],
'VariableDeclaration'
)
if (trap(_node1)) return Promise.reject(_node1)
const variableDeclarationName =
getNodeFromPath<VariableDeclaration>(
_ast,
sketchPathToNode || [],
'VariableDeclaration'
)?.node?.declarations?.[0]?.id?.name || ''
_node1.node?.declarations?.[0]?.id?.name || ''
const sg = kclManager.programMemory.root[
variableDeclarationName
] as SketchGroup
@ -534,7 +560,9 @@ export class SceneEntities {
fnName: segmentName,
pathToNode: sketchPathToNode,
})
if (trap(mod)) return Promise.reject(mod)
const modifiedAst = parse(recast(mod.modifiedAst))
if (trap(modifiedAst)) return Promise.reject(modifiedAst)
const draftExpressionsIndices = { start: index, end: index }
@ -585,14 +613,16 @@ export class SceneEntities {
),
],
})
if (trap(modifiedAst)) return Promise.reject(modifiedAst)
modifiedAst = addCloseToPipe({
node: modifiedAst,
programMemory: kclManager.programMemory,
pathToNode: sketchPathToNode,
})
if (trap(modifiedAst)) return Promise.reject(modifiedAst)
} else if (intersection2d) {
const lastSegment = sketchGroup.value.slice(-1)[0]
modifiedAst = addNewSketchLn({
const tmp = addNewSketchLn({
node: kclManager.ast,
programMemory: kclManager.programMemory,
to: [intersection2d.x, intersection2d.y],
@ -602,7 +632,10 @@ export class SceneEntities {
? 'tangentialArcTo'
: 'line',
pathToNode: sketchPathToNode,
}).modifiedAst
})
if (trap(tmp)) return Promise.reject(tmp)
modifiedAst = tmp.modifiedAst
if (trap(modifiedAst)) return Promise.reject(modifiedAst)
} else {
// return early as we didn't modify the ast
return
@ -661,12 +694,14 @@ export class SceneEntities {
) => {
let _ast = JSON.parse(JSON.stringify(kclManager.ast))
const _node1 = getNodeFromPath<VariableDeclaration>(
_ast,
sketchPathToNode || [],
'VariableDeclaration'
)
if (trap(_node1)) return Promise.reject(_node1)
const variableDeclarationName =
getNodeFromPath<VariableDeclaration>(
_ast,
sketchPathToNode || [],
'VariableDeclaration'
)?.node?.declarations?.[0]?.id?.name || ''
_node1.node?.declarations?.[0]?.id?.name || ''
const tags: [string, string, string] = [
findUniqueName(_ast, 'rectangleSegmentA'),
@ -674,11 +709,13 @@ export class SceneEntities {
findUniqueName(_ast, 'rectangleSegmentC'),
]
const startSketchOn = getNodeFromPath<VariableDeclaration>(
const _node2 = getNodeFromPath<VariableDeclaration>(
_ast,
sketchPathToNode || [],
'VariableDeclaration'
)?.node?.declarations
)
if (trap(_node2)) return Promise.reject(_node2)
const startSketchOn = _node2.node?.declarations
const startSketchOnInit = startSketchOn?.[0]?.init
startSketchOn[0].init = createPipeExpression([
@ -703,11 +740,13 @@ export class SceneEntities {
const pathToNodeTwo = JSON.parse(JSON.stringify(sketchPathToNode))
pathToNodeTwo[1][0] = 0
const sketchInit = getNodeFromPath<VariableDeclaration>(
const _node = getNodeFromPath<VariableDeclaration>(
truncatedAst,
pathToNodeTwo || [],
'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 y = (args.intersectionPoint.twoD.y || 0) - rectangleOrigin[1]
@ -749,11 +788,13 @@ export class SceneEntities {
const x = roundOff((cornerPoint.x || 0) - rectangleOrigin[0])
const y = roundOff((cornerPoint.y || 0) - rectangleOrigin[1])
const sketchInit = getNodeFromPath<VariableDeclaration>(
const _node = getNodeFromPath<VariableDeclaration>(
_ast,
sketchPathToNode || [],
'VariableDeclaration'
)?.node?.declarations?.[0]?.init
)
if (trap(_node)) return Promise.reject(_node)
const sketchInit = _node.node?.declarations?.[0]?.init
if (sketchInit.type === 'PipeExpression') {
updateRectangleSketch(sketchInit, x, y, tags[0])
@ -849,6 +890,7 @@ export class SceneEntities {
ast: kclManager.ast,
programMemory: kclManager.programMemory,
})
if (trap(sketchGroup)) return
const pipeIndex = pathToNode[pathToNodeIndex + 1][0] as number
if (addingNewSegmentStatus === 'nothing') {
@ -866,6 +908,8 @@ export class SceneEntities {
spliceBetween: true,
})
addingNewSegmentStatus = 'pending'
if (trap(mod)) return
await kclManager.executeAstMock(mod.modifiedAst)
await this.tearDownSketch({ removeAxis: false })
this.setupSketch({
@ -974,17 +1018,22 @@ export class SceneEntities {
const to: [number, number] = [intersection2d.x, intersection2d.y]
let modifiedAst = draftInfo ? draftInfo.truncatedAst : { ...kclManager.ast }
const node = getNodeFromPath<CallExpression>(
const _node = getNodeFromPath<CallExpression>(
modifiedAst,
pathToNode,
'CallExpression'
).node
)
if (trap(_node)) return
const node = _node.node
if (node.type !== 'CallExpression') return
let modded: {
modifiedAst: Program
pathToNode: PathToNode
}
let modded:
| {
modifiedAst: Program
pathToNode: PathToNode
}
| Error
if (group.name === PROFILE_START) {
modded = updateStartProfileAtArgs({
node: modifiedAst,
@ -1002,14 +1051,18 @@ export class SceneEntities {
from
)
}
if (trap(modded)) return
modifiedAst = modded.modifiedAst
const info = draftInfo
? draftInfo
: this.prepareTruncatedMemoryAndAst(pathToNode || [])
if (trap(info, { suppress: true })) return
const { truncatedAst, programMemoryOverride, variableDeclarationName } =
draftInfo
? draftInfo
: this.prepareTruncatedMemoryAndAst(sketchPathToNode || [])
info
;(async () => {
const code = recast(modifiedAst)
if (trap(code)) return
if (!draftInfo)
// 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
@ -1391,13 +1444,13 @@ export class SceneEntities {
},
onClick: async (args) => {
const { streamDimensions } = useStore.getState()
const { entity_id, ...rest } = await sendSelectEventToEngine(
const { entity_id } = await sendSelectEventToEngine(
args?.mouseEvent,
document.getElementById('video-stream') as HTMLVideoElement,
streamDimensions
)
let _entity_id = entity_id
console.log('things', _entity_id, rest)
if (!_entity_id) return
if (
engineCommandManager.defaultPlanes?.xy === _entity_id ||
@ -1426,7 +1479,6 @@ export class SceneEntities {
.sub(sceneInfra.camControls.target)
if (engineCommandManager.defaultPlanes?.xy === _entity_id) {
console.log('XY')
zAxis = [0, 0, 1]
yAxis = [0, 1, 0]
if (camVector.z < 0) {
@ -1434,7 +1486,6 @@ export class SceneEntities {
_entity_id = engineCommandManager.defaultPlanes?.negXy || ''
}
} else if (engineCommandManager.defaultPlanes?.yz === _entity_id) {
console.log('YZ')
zAxis = [1, 0, 0]
yAxis = [0, 0, 1]
if (camVector.x < 0) {
@ -1442,7 +1493,6 @@ export class SceneEntities {
_entity_id = engineCommandManager.defaultPlanes?.negYz || ''
}
} else if (engineCommandManager.defaultPlanes?.xz === _entity_id) {
console.log('XZ')
zAxis = [0, 1, 0]
yAxis = [0, 0, 1]
_entity_id = engineCommandManager.defaultPlanes?.negXz || ''
@ -1496,6 +1546,7 @@ export class SceneEntities {
kclManager.ast,
artifact.range
)
const extrudePathToNode = extrusions?.range
? getNodePathFromSourceRange(kclManager.ast, extrusions.range)
: []
@ -1538,11 +1589,14 @@ export class SceneEntities {
])
if (parent?.userData?.pathToNode) {
const updatedAst = parse(recast(kclManager.ast))
const node = getNodeFromPath<CallExpression>(
if (trap(updatedAst)) return
const _node = getNodeFromPath<CallExpression>(
updatedAst,
parent.userData.pathToNode,
'CallExpression'
).node
)
if (trap(_node, { suppress: true })) return
const node = _node.node
editorManager.setHighlightRange([node.start, node.end])
const yellow = 0xffff00
colorSegment(selected, yellow)
@ -1657,20 +1711,23 @@ function prepareTruncatedMemoryAndAst(
ast: Program,
programMemory: ProgramMemory,
draftSegment?: DraftSegment
): {
truncatedAst: Program
programMemoryOverride: ProgramMemory
variableDeclarationName: string
} {
):
| {
truncatedAst: Program
programMemoryOverride: ProgramMemory
variableDeclarationName: string
}
| Error {
const bodyIndex = Number(sketchPathToNode?.[1]?.[0]) || 0
const _ast = JSON.parse(JSON.stringify(ast))
const variableDeclarationName =
getNodeFromPath<VariableDeclaration>(
_ast,
sketchPathToNode || [],
'VariableDeclaration'
)?.node?.declarations?.[0]?.id?.name || ''
const _node = getNodeFromPath<VariableDeclaration>(
_ast,
sketchPathToNode || [],
'VariableDeclaration'
)
if (err(_node)) return _node
const variableDeclarationName = _node.node?.declarations?.[0]?.id?.name || ''
const lastSeg = (
programMemory.root[variableDeclarationName] as SketchGroup
).value.slice(-1)[0]
@ -1698,6 +1755,8 @@ function prepareTruncatedMemoryAndAst(
// 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
const updatedSrcRangeAst = parse(recast(_ast)) // get source ranges correct since unfortunately we still rely on them
if (err(updatedSrcRangeAst)) return updatedSrcRangeAst
const lastPipeItem = (
(updatedSrcRangeAst.body[bodyIndex] as VariableDeclaration)
.declarations[0].init as PipeExpression
@ -1721,7 +1780,9 @@ function prepareTruncatedMemoryAndAst(
..._ast,
body: [JSON.parse(JSON.stringify(_ast.body[bodyIndex]))],
}
const programMemoryOverride: ProgramMemory = programMemoryInit()
const programMemoryOverride = programMemoryInit()
if (err(programMemoryOverride)) return programMemoryOverride
for (let i = 0; i < bodyIndex; i++) {
const node = _ast.body[i]
if (node.type !== 'VariableDeclaration') {
@ -1762,13 +1823,19 @@ export function sketchGroupFromPathToNode({
pathToNode: PathToNode
ast: Program
programMemory: ProgramMemory
}): SketchGroup {
const varDec = getNodeFromPath<VariableDeclarator>(
}): SketchGroup | Error {
const _varDec = getNodeFromPath<VariableDeclarator>(
kclManager.ast,
pathToNode,
'VariableDeclarator'
).node
return programMemory.root[varDec?.id?.name || ''] as SketchGroup
)
if (err(_varDec)) return _varDec
const varDec = _varDec.node
const result = programMemory.root[varDec?.id?.name || '']
if (result?.type === 'ExtrudeGroup') {
return result.sketchGroup
}
return result as SketchGroup
}
function colorSegment(object: any, color: number) {
@ -1798,13 +1865,15 @@ function colorSegment(object: any, color: number) {
export function getSketchQuaternion(
sketchPathToNode: PathToNode,
sketchNormalBackUp: [number, number, number] | null
): Quaternion {
): Quaternion | Error {
const sketchGroup = sketchGroupFromPathToNode({
pathToNode: sketchPathToNode,
ast: kclManager.ast,
programMemory: kclManager.programMemory,
})
const zAxis = sketchGroup?.zAxis || sketchNormalBackUp
if (err(sketchGroup)) return sketchGroup
const zAxis = sketchGroup?.on.zAxis || sketchNormalBackUp
return getQuaternionFromZAxis(massageFormats(zAxis))
}
export async function getSketchOrientationDetails(
@ -1818,24 +1887,31 @@ export async function getSketchOrientationDetails(
ast: kclManager.ast,
programMemory: kclManager.programMemory,
})
if (err(sketchGroup)) return Promise.reject(sketchGroup)
if (sketchGroup.on.type === 'plane') {
const zAxis = sketchGroup?.zAxis
const zAxis = sketchGroup?.on.zAxis
return {
quat: getQuaternionFromZAxis(massageFormats(zAxis)),
sketchDetails: {
sketchPathToNode,
zAxis: [zAxis.x, zAxis.y, zAxis.z],
yAxis: [sketchGroup.yAxis.x, sketchGroup.yAxis.y, sketchGroup.yAxis.z],
yAxis: [
sketchGroup.on.yAxis.x,
sketchGroup.on.yAxis.y,
sketchGroup.on.yAxis.z,
],
origin: [0, 0, 0],
faceId: sketchGroup.on.id,
},
}
}
if (sketchGroup.on.type === 'face') {
const faceInfo = await getFaceDetails(sketchGroup.on.faceId)
const faceInfo = await getFaceDetails(sketchGroup.on.id)
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 quaternion = quaternionFromUpNForward(
new Vector3(y_axis.x, y_axis.y, y_axis.z),
@ -1848,11 +1924,11 @@ export async function getSketchOrientationDetails(
zAxis: [z_axis.x, z_axis.y, z_axis.z],
yAxis: [y_axis.x, y_axis.y, y_axis.z],
origin: [origin.x, origin.y, origin.z],
faceId: sketchGroup.on.faceId,
faceId: sketchGroup.on.id,
},
}
}
throw new Error(
return Promise.reject(
'sketchGroup.on.type not recognized, has a new type been added?'
)
}

View File

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

View File

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

View File

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

View File

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

View File

@ -1,6 +1,12 @@
import { LanguageServerClient } from 'editor/plugins/lsp'
import type * as LSP from 'vscode-languageserver-protocol'
import React, { createContext, useMemo, useEffect, useContext } from 'react'
import React, {
createContext,
useMemo,
useEffect,
useContext,
useState,
} from 'react'
import { FromServer, IntoServer } from 'editor/plugins/lsp/codec'
import Client from '../editor/plugins/lsp/client'
import { TEST, VITE_KC_API_BASE_URL } from 'env'
@ -24,6 +30,7 @@ import { wasmUrl } from 'lang/wasm'
import { PROJECT_ENTRYPOINT } from 'lib/constants'
import { useNetworkContext } from 'hooks/useNetworkContext'
import { NetworkHealthState } from 'hooks/useNetworkStatus'
import { err, trap } from 'lib/trap'
function getWorkspaceFolders(): LSP.WorkspaceFolder[] {
return []
@ -76,6 +83,8 @@ export const LspProvider = ({ children }: { children: React.ReactNode }) => {
setIsCopilotLspServerReady: s.setIsCopilotLspServerReady,
isStreamReady: s.isStreamReady,
}))
const [isLspReady, setIsLspReady] = useState(false)
const [isCopilotReady, setIsCopilotReady] = useState(false)
const {
auth,
@ -111,14 +120,17 @@ export const LspProvider = ({ children }: { children: React.ReactNode }) => {
eventData: initEvent,
})
lspWorker.onmessage = function (e) {
if (err(fromServer)) return
fromServer.add(e.data)
}
const intoServer: IntoServer = new IntoServer(LspWorker.Kcl, lspWorker)
const fromServer: FromServer = FromServer.create()
const fromServer: FromServer | Error = FromServer.create()
if (err(fromServer)) return { lspClient: null }
const client = new Client(fromServer, intoServer)
setIsKclLspServerReady(true)
setIsLspReady(true)
const lspClient = new LanguageServerClient({ client, name: LspWorker.Kcl })
return { lspClient }
@ -185,14 +197,17 @@ export const LspProvider = ({ children }: { children: React.ReactNode }) => {
eventData: initEvent,
})
lspWorker.onmessage = function (e) {
if (err(fromServer)) return
fromServer.add(e.data)
}
const intoServer: IntoServer = new IntoServer(LspWorker.Copilot, lspWorker)
const fromServer: FromServer = FromServer.create()
const fromServer: FromServer | Error = FromServer.create()
if (err(fromServer)) return { lspClient: null }
const client = new Client(fromServer, intoServer)
setIsCopilotLspServerReady(true)
setIsCopilotReady(true)
const lspClient = new LanguageServerClient({
client,
@ -230,6 +245,13 @@ export const LspProvider = ({ children }: { children: React.ReactNode }) => {
lspClients.push(copilotLspClient)
}
useEffect(() => {
setIsKclLspServerReady(isLspReady)
}, [isLspReady])
useEffect(() => {
setIsCopilotLspServerReady(isCopilotReady)
}, [isCopilotReady])
const onProjectClose = (
file: FileEntry | null,
projectPath: string | null,

View File

@ -29,7 +29,6 @@ import {
applyConstraintAngleBetween,
} from './Toolbar/SetAngleBetween'
import { applyConstraintAngleLength } from './Toolbar/setAngleLength'
import { pathMapToSelections } from 'lang/util'
import { useStore } from 'useStore'
import {
Selections,
@ -37,6 +36,7 @@ import {
handleSelectionBatch,
isSelectionLastLine,
isSketchPipe,
updateSelections,
} from 'lib/selections'
import { applyConstraintIntersect } from './Toolbar/Intersect'
import { applyConstraintAbsDistance } from './Toolbar/SetAbsDistance'
@ -77,6 +77,7 @@ import { letEngineAnimateAndSyncCamAfter } from 'clientSideScene/CameraControls'
import { getVarNameModal } from 'hooks/useToolbarGuards'
import useHotkeyWrapper from 'lib/hotkeyWrapper'
import { uuidv4 } from 'lib/utils'
import { err, trap } from 'lib/trap'
type MachineContext<T extends AnyStateMachine> = {
state: StateFrom<T>
@ -275,9 +276,9 @@ export const ModelingMachineProvider = ({
),
'Set selection': assign(({ selectionRanges, sketchDetails }, event) => {
const setSelections = event.data as SetSelections // this was needed for ts after adding 'Set selection' action to on done modal events
if (!editorManager.editorView) return {}
const dispatchSelection = (selection?: EditorSelection) => {
if (!selection) return // TODO less of hack for the below please
if (!editorManager.editorView) return
editorManager.lastSelectionEvent = Date.now()
setTimeout(() => {
if (editorManager.editorView) {
@ -459,12 +460,17 @@ export const ModelingMachineProvider = ({
return canExtrudeSelection(selectionRanges)
},
'Sketch is empty': ({ sketchDetails }) =>
getNodeFromPath<VariableDeclaration>(
'Sketch is empty': ({ sketchDetails }) => {
const node = getNodeFromPath<VariableDeclaration>(
kclManager.ast,
sketchDetails?.sketchPathToNode || [],
'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 }) => {
if (data?.forceNewSketch) return false
if (!isSingleCursorInPipe(selectionRanges, kclManager.ast))
@ -507,14 +513,16 @@ export const ModelingMachineProvider = ({
},
'animate-to-face': async (_, { data }) => {
if (data.type === 'extrudeFace') {
const { modifiedAst, pathToNode: pathToNewSketchNode } =
sketchOnExtrudedFace(
kclManager.ast,
data.sketchPathToNode,
data.extrudePathToNode,
kclManager.programMemory,
data.cap
)
const sketched = sketchOnExtrudedFace(
kclManager.ast,
data.sketchPathToNode,
data.extrudePathToNode,
kclManager.programMemory,
data.cap
)
if (trap(sketched)) return Promise.reject(sketched)
const { modifiedAst, pathToNode: pathToNewSketchNode } = sketched
await kclManager.executeAstMock(modifiedAst)
await letEngineAnimateAndSyncCamAfter(
@ -535,10 +543,12 @@ export const ModelingMachineProvider = ({
)
await kclManager.updateAst(modifiedAst, false)
sceneInfra.camControls.syncDirection = 'clientToEngine'
await letEngineAnimateAndSyncCamAfter(
engineCommandManager,
data.planeId
)
return {
sketchPathToNode: pathToNode,
zAxis: data.zAxis,
@ -576,25 +586,29 @@ export const ModelingMachineProvider = ({
selectionRanges,
})
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(
sketchDetails.sketchPathToNode,
pathToNodeMap
)
await sceneEntitiesManager.updateAstAndRejigSketch(
const updatedAst = await sceneEntitiesManager.updateAstAndRejigSketch(
updatedPathToNode,
_modifiedAst,
sketchDetails.zAxis,
sketchDetails.yAxis,
sketchDetails.origin
)
if (err(updatedAst)) return Promise.reject(updatedAst)
const selection = updateSelections(
pathToNodeMap,
selectionRanges,
updatedAst.newAst
)
if (err(selection)) return Promise.reject(selection)
return {
selectionType: 'completeSelection',
selection: pathMapToSelections(
kclManager.ast,
selectionRanges,
pathToNodeMap
),
selection,
updatedPathToNode,
}
},
@ -608,25 +622,29 @@ export const ModelingMachineProvider = ({
selectionRanges,
})
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(
sketchDetails.sketchPathToNode,
pathToNodeMap
)
await sceneEntitiesManager.updateAstAndRejigSketch(
const updatedAst = await sceneEntitiesManager.updateAstAndRejigSketch(
updatedPathToNode,
_modifiedAst,
sketchDetails.zAxis,
sketchDetails.yAxis,
sketchDetails.origin
)
if (err(updatedAst)) return Promise.reject(updatedAst)
const selection = updateSelections(
pathToNodeMap,
selectionRanges,
updatedAst.newAst
)
if (err(selection)) return Promise.reject(selection)
return {
selectionType: 'completeSelection',
selection: pathMapToSelections(
kclManager.ast,
selectionRanges,
pathToNodeMap
),
selection,
updatedPathToNode,
}
},
@ -634,9 +652,11 @@ export const ModelingMachineProvider = ({
selectionRanges,
sketchDetails,
}): Promise<SetSelections> => {
const { modifiedAst, pathToNodeMap } = await (angleBetweenInfo({
const info = angleBetweenInfo({
selectionRanges,
}).enabled
})
if (err(info)) return Promise.reject(info)
const { modifiedAst, pathToNodeMap } = await (info.enabled
? applyConstraintAngleBetween({
selectionRanges,
})
@ -645,25 +665,31 @@ export const ModelingMachineProvider = ({
angleOrLength: 'setAngle',
}))
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(
sketchDetails.sketchPathToNode,
pathToNodeMap
)
await sceneEntitiesManager.updateAstAndRejigSketch(
const updatedAst = await sceneEntitiesManager.updateAstAndRejigSketch(
updatedPathToNode,
_modifiedAst,
sketchDetails.zAxis,
sketchDetails.yAxis,
sketchDetails.origin
)
if (err(updatedAst)) return Promise.reject(updatedAst)
const selection = updateSelections(
pathToNodeMap,
selectionRanges,
updatedAst.newAst
)
if (err(selection)) return Promise.reject(selection)
return {
selectionType: 'completeSelection',
selection: pathMapToSelections(
_modifiedAst,
selectionRanges,
pathToNodeMap
),
selection,
updatedPathToNode,
}
},
@ -674,25 +700,29 @@ export const ModelingMachineProvider = ({
const { modifiedAst, pathToNodeMap } =
await applyConstraintAngleLength({ selectionRanges })
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(
sketchDetails.sketchPathToNode,
pathToNodeMap
)
await sceneEntitiesManager.updateAstAndRejigSketch(
const updatedAst = await sceneEntitiesManager.updateAstAndRejigSketch(
updatedPathToNode,
_modifiedAst,
sketchDetails.zAxis,
sketchDetails.yAxis,
sketchDetails.origin
)
if (err(updatedAst)) return Promise.reject(updatedAst)
const selection = updateSelections(
pathToNodeMap,
selectionRanges,
updatedAst.newAst
)
if (err(selection)) return Promise.reject(selection)
return {
selectionType: 'completeSelection',
selection: pathMapToSelections(
kclManager.ast,
selectionRanges,
pathToNodeMap
),
selection,
updatedPathToNode,
}
},
@ -706,25 +736,29 @@ export const ModelingMachineProvider = ({
}
)
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(
sketchDetails.sketchPathToNode,
pathToNodeMap
)
await sceneEntitiesManager.updateAstAndRejigSketch(
const updatedAst = await sceneEntitiesManager.updateAstAndRejigSketch(
updatedPathToNode,
_modifiedAst,
sketchDetails.zAxis,
sketchDetails.yAxis,
sketchDetails.origin
)
if (err(updatedAst)) return Promise.reject(updatedAst)
const selection = updateSelections(
pathToNodeMap,
selectionRanges,
updatedAst.newAst
)
if (err(selection)) return Promise.reject(selection)
return {
selectionType: 'completeSelection',
selection: pathMapToSelections(
kclManager.ast,
selectionRanges,
pathToNodeMap
),
selection,
updatedPathToNode,
}
},
@ -738,25 +772,29 @@ export const ModelingMachineProvider = ({
selectionRanges,
})
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(
sketchDetails.sketchPathToNode,
pathToNodeMap
)
await sceneEntitiesManager.updateAstAndRejigSketch(
const updatedAst = await sceneEntitiesManager.updateAstAndRejigSketch(
updatedPathToNode,
_modifiedAst,
sketchDetails.zAxis,
sketchDetails.yAxis,
sketchDetails.origin
)
if (err(updatedAst)) return Promise.reject(updatedAst)
const selection = updateSelections(
pathToNodeMap,
selectionRanges,
updatedAst.newAst
)
if (err(selection)) return Promise.reject(selection)
return {
selectionType: 'completeSelection',
selection: pathMapToSelections(
kclManager.ast,
selectionRanges,
pathToNodeMap
),
selection,
updatedPathToNode,
}
},
@ -770,48 +808,77 @@ export const ModelingMachineProvider = ({
selectionRanges,
})
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(
sketchDetails.sketchPathToNode,
pathToNodeMap
)
await sceneEntitiesManager.updateAstAndRejigSketch(
const updatedAst = await sceneEntitiesManager.updateAstAndRejigSketch(
updatedPathToNode,
_modifiedAst,
sketchDetails.zAxis,
sketchDetails.yAxis,
sketchDetails.origin
)
if (err(updatedAst)) return Promise.reject(updatedAst)
const selection = updateSelections(
pathToNodeMap,
selectionRanges,
updatedAst.newAst
)
if (err(selection)) return Promise.reject(selection)
return {
selectionType: 'completeSelection',
selection: pathMapToSelections(
kclManager.ast,
selectionRanges,
pathToNodeMap
),
selection,
updatedPathToNode,
}
},
'Get convert to variable info': async ({ sketchDetails }, { data }) => {
if (!sketchDetails) return []
'Get convert to variable info': async (
{ sketchDetails, selectionRanges },
{ data }
): Promise<SetSelections> => {
if (!sketchDetails)
return Promise.reject(new Error('No sketch details'))
const { variableName } = await getVarNameModal({
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 } =
moveValueIntoNewVariablePath(
parse(recast(kclManager.ast)),
parsed,
kclManager.programMemory,
data.pathToNode,
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 || [],
parse(recast(_modifiedAst)),
parsed,
sketchDetails.zAxis,
sketchDetails.yAxis,
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,

View File

@ -43,27 +43,23 @@ describe('processMemory', () => {
theExtrude: [
{
type: 'extrudePlane',
position: [0, 0, 0],
rotation: [0, 0, 0, 1],
faceId: expect.any(String),
name: '',
tag: null,
id: expect.any(String),
faceId: expect.any(String),
sourceRange: [170, 194],
},
{
type: 'extrudePlane',
position: [0, 0, 0],
rotation: [0, 0, 0, 1],
faceId: expect.any(String),
name: '',
tag: null,
id: expect.any(String),
faceId: expect.any(String),
sourceRange: [202, 230],
},
],
theSketch: [
{ type: 'ToPoint', to: [-3.35, 0.17], from: [0, 0], name: '' },
{ type: 'ToPoint', to: [0.98, 5.16], from: [-3.35, 0.17], name: '' },
{ type: 'ToPoint', to: [2.15, 4.32], from: [0.98, 5.16], 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], tag: null },
{ 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 { useMemo } from 'react'
import { ProgramMemory, Path, ExtrudeSurface } from 'lang/wasm'
import { useKclContext } from 'lang/KclProvider'
import { useResolvedTheme } from 'hooks/useResolvedTheme'
import { ActionButton } from 'components/ActionButton'
import toast from 'react-hot-toast'
import { trap } from 'lib/trap'
import Tooltip from 'components/Tooltip'
import { useModelingContext } from 'hooks/useModelingContext'
@ -13,12 +14,12 @@ export const MemoryPaneMenu = () => {
function copyProgramMemoryToClipboard() {
if (globalThis && 'navigator' in globalThis) {
try {
navigator.clipboard.writeText(JSON.stringify(programMemory))
toast.success('Program memory copied to clipboard')
} catch (e) {
toast.error('Failed to copy program memory to clipboard')
}
navigator.clipboard
.writeText(JSON.stringify(programMemory))
.then(() => toast.success('Program memory copied to clipboard'))
.catch((e) =>
trap(new Error('Failed to copy program memory to clipboard'))
)
}
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -10,11 +10,13 @@ import {
transformSecondarySketchLinesTagFirst,
getTransformInfos,
PathToNodeMap,
TransformInfo,
} from '../../lang/std/sketchcombos'
import { GetInfoModal, createInfoModal } from '../SetHorVertDistanceModal'
import { createVariableDeclaration } from '../../lang/modifyAst'
import { removeDoubleNegatives } from '../AvailableVarsHelpers'
import { kclManager } from 'lib/singletons'
import { err } from 'lib/trap'
const getModalInfo = createInfoModal(GetInfoModal)
@ -22,22 +24,38 @@ export function angleBetweenInfo({
selectionRanges,
}: {
selectionRanges: Selections
}) {
}):
| {
transforms: TransformInfo[]
enabled: boolean
}
| Error {
const paths = selectionRanges.codeBasedSelections.map(({ range }) =>
getNodePathFromSourceRange(kclManager.ast, range)
)
const nodes = paths.map(
(pathToNode) => getNodeFromPath<Value>(kclManager.ast, pathToNode).node
)
const varDecs = paths.map(
(pathToNode) =>
getNodeFromPath<VariableDeclarator>(
kclManager.ast,
pathToNode,
'VariableDeclarator'
)?.node
)
const _nodes = paths.map((pathToNode) => {
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 _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 secondaryVarDecs = varDecs.slice(1)
const isOthersLinkedToPrimary = secondaryVarDecs.every((secondary) =>
@ -77,14 +95,20 @@ export async function applyConstraintAngleBetween({
modifiedAst: Program
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 } =
transformSecondarySketchLinesTagFirst({
ast: JSON.parse(JSON.stringify(kclManager.ast)),
selectionRanges,
transformInfos,
programMemory: kclManager.programMemory,
})
transformed1
const {
segName,
value,
@ -115,15 +139,18 @@ export async function applyConstraintAngleBetween({
variableName
)
// 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 } =
transformSecondarySketchLinesTagFirst({
ast: kclManager.ast,
selectionRanges,
transformInfos,
programMemory: kclManager.programMemory,
forceSegName: segName,
forceValueUsedInTransform: finalValue,
})
transformed2
if (variableName) {
const newBody = [..._modifiedAst.body]
newBody.splice(

View File

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

View File

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

@ -160,9 +160,6 @@ export default class EditorManager {
if (selections.codeBasedSelections.length === 0) {
return
}
if (!this.editorView) {
return
}
let codeBasedSelections = []
for (const selection of selections.codeBasedSelections) {
codeBasedSelections.push(
@ -177,6 +174,9 @@ export default class EditorManager {
].range[1]
)
)
if (!this.editorView) {
return
}
this.editorView.dispatch({
selection: EditorSelection.create(codeBasedSelections, 1),
})

View File

@ -6,6 +6,7 @@ import {
unregisterServerCapability,
} from './server-capability-registration'
import { Codec, FromServer, IntoServer } from './codec'
import { err } from 'lib/trap'
const client_capabilities: LSP.ClientCapabilities = {
textDocument: {
@ -119,10 +120,12 @@ export default class Client extends jsrpc.JSONRPCServerAndClient {
// Register a server capability.
params.registrations.forEach(
(capabilityRegistration: LSP.Registration) => {
this.serverCapabilities = registerServerCapability(
const caps = registerServerCapability(
this.serverCapabilities,
capabilityRegistration
)
if (err(caps)) return (this.serverCapabilities = {})
this.serverCapabilities = caps
}
)
})
@ -132,10 +135,12 @@ export default class Client extends jsrpc.JSONRPCServerAndClient {
// Unregister a server capability.
params.unregisterations.forEach(
(capabilityUnregistration: LSP.Unregistration) => {
this.serverCapabilities = unregisterServerCapability(
const caps = unregisterServerCapability(
this.serverCapabilities,
capabilityUnregistration
)
if (err(caps)) return (this.serverCapabilities = {})
this.serverCapabilities = caps
}
)
})

View File

@ -67,7 +67,13 @@ export interface FromServer extends WritableStream<Uint8Array> {
// eslint-disable-next-line @typescript-eslint/no-namespace
export namespace FromServer {
export function create(): FromServer {
return new StreamDemuxer()
export function create(): FromServer | Error {
// Calls private method .start() which can throw.
// This is an odd one of the bunch but try/catch seems most suitable here.
try {
return new StreamDemuxer()
} catch (e: any) {
return e
}
}
}

View File

@ -38,7 +38,9 @@ export default class StreamDemuxer extends Queue<Uint8Array> {
// try to parse the content-length from the headers
const length = parseInt(match[1])
if (isNaN(length)) throw new Error('invalid content length')
if (isNaN(length))
return Promise.reject(new Error('invalid content length'))
// slice the headers since we now have the content length
buffer = buffer.slice(match[0].length)

View File

@ -176,7 +176,7 @@ export class LanguageServerClient {
},
})
this.semanticTokens = deserializeTokens(
this.semanticTokens = await deserializeTokens(
result.data,
this.getServerCapabilities().semanticTokensProvider
)

View File

@ -22,16 +22,16 @@ export class SemanticToken {
}
}
export function deserializeTokens(
export async function deserializeTokens(
data: number[],
semanticTokensProvider?: LSP.SemanticTokensOptions
): SemanticToken[] {
): Promise<SemanticToken[]> {
if (!semanticTokensProvider) {
return []
}
// Check if data length is divisible by 5
if (data.length % 5 !== 0) {
throw new Error('Length is not divisible by 5')
return Promise.reject(new Error('Length is not divisible by 5'))
}
const tokens = []

View File

@ -167,6 +167,7 @@ export class LanguageServerPlugin implements PluginValue {
if (pos === null) return null
const dom = document.createElement('div')
dom.classList.add('documentation')
dom.classList.add('hover-tooltip')
dom.style.zIndex = '99999999'
if (this.allowHTMLContent) dom.innerHTML = formatContents(contents)
else dom.textContent = formatContents(contents)

View File

@ -41,7 +41,7 @@ const ServerCapabilitiesProviders: IMethodServerCapabilityProviderDictionary = {
function registerServerCapability(
serverCapabilities: ServerCapabilities,
registration: Registration
): ServerCapabilities {
): ServerCapabilities | Error {
const serverCapabilitiesCopy = JSON.parse(
JSON.stringify(serverCapabilities)
) as IFlexibleServerCapabilities
@ -58,7 +58,7 @@ function registerServerCapability(
)
}
} else {
throw new Error('Could not register server capability.')
return new Error('Could not register server capability.')
}
return serverCapabilitiesCopy

View File

@ -14,9 +14,10 @@ import {
CopilotWorkerOptions,
} from 'editor/plugins/lsp/types'
import { EngineCommandManager } from 'lang/std/engineConnection'
import { err } from 'lib/trap'
const intoServer: IntoServer = new IntoServer()
const fromServer: FromServer = FromServer.create()
const fromServer: FromServer | Error = FromServer.create()
// Initialise the wasm module.
const initialise = async (wasmUrl: string) => {
@ -56,6 +57,7 @@ export async function kclLspRun(
}
onmessage = function (event) {
if (err(fromServer)) return
const { worker, eventType, eventData }: LspWorkerEvent = event.data
switch (eventType) {
@ -111,6 +113,7 @@ onmessage = function (event) {
}
new Promise<void>(async (resolve) => {
if (err(fromServer)) return
for await (const requests of fromServer.requests) {
const encoded = Codec.encode(requests as jsrpc.JSONRPCRequest)
postMessage(encoded)
@ -118,6 +121,7 @@ new Promise<void>(async (resolve) => {
})
new Promise<void>(async (resolve) => {
if (err(fromServer)) return
for await (const notification of fromServer.notifications) {
const encoded = Codec.encode(notification as jsrpc.JSONRPCRequest)
postMessage(encoded)

View File

@ -15,6 +15,8 @@ export function useRefreshSettings(routeId: string = paths.INDEX) {
const routeData = useRouteLoaderData(routeId) as typeof settings
if (!ctx) {
// Intended to stop the world
// eslint-disable-next-line
throw new Error(
'useRefreshSettings must be used within a SettingsAuthProvider'
)

View File

@ -3,6 +3,7 @@ import {
createSetVarNameModal,
} from 'components/SetVarNameModal'
import { editorManager, kclManager } from 'lib/singletons'
import { trap } from 'lib/trap'
import { moveValueIntoNewVariable } from 'lang/modifyAst'
import { isNodeSafeToReplace } from 'lang/queryAst'
import { useEffect, useState } from 'react'
@ -22,10 +23,16 @@ export function useConvertToVariable(range?: SourceRange) {
}, [enable])
useEffect(() => {
const { isSafe, value } = isNodeSafeToReplace(
parse(recast(ast)),
const parsed = parse(recast(ast))
if (trap(parsed)) return
const meta = isNodeSafeToReplace(
parsed,
range || context.selectionRanges.codeBasedSelections?.[0]?.range || []
)
if (trap(meta)) return
const { isSafe, value } = meta
const canReplace = isSafe && value.type !== 'Identifier'
const isOnlyOneSelection =
!!range || context.selectionRanges.codeBasedSelections.length === 1

View File

@ -3,6 +3,7 @@ import { Selections } from 'lib/selections'
import { KCLError, kclErrorsToDiagnostics } from './errors'
import { uuidv4 } from 'lib/utils'
import { EngineCommandManager } from './std/engineConnection'
import { err } from 'lib/trap'
import { deferExecution } from 'lib/utils'
import {
@ -161,18 +162,17 @@ export class KclManager {
}
safeParse(code: string): Program | null {
try {
const ast = parse(code)
this.kclErrors = []
return ast
} catch (e) {
console.error('error parsing code', e)
if (e instanceof KCLError) {
this.kclErrors = [e]
if (e.msg === 'file is empty') this.engineCommandManager?.endSession()
}
return null
}
const ast = parse(code)
this.kclErrors = []
if (!err(ast)) return ast
const kclerror: KCLError = ast as KCLError
console.error('error parsing code', kclerror)
this.kclErrors = [kclerror]
// TODO: re-eval if session should end?
if (kclerror.msg === 'file is empty')
this.engineCommandManager?.endSession()
return null
}
async ensureWasmInit() {
@ -256,6 +256,10 @@ export class KclManager {
await this.ensureWasmInit()
const newCode = recast(ast)
if (err(newCode)) {
console.error(newCode)
return
}
const newAst = this.safeParse(newCode)
if (!newAst) return
codeManager.updateCodeEditor(newCode)
@ -281,11 +285,13 @@ export class KclManager {
Object.entries(this.engineCommandManager.artifactMap).forEach(
([commandId, artifact]) => {
if (!artifact.pathToNode) return
const node = getNodeFromPath<CallExpression>(
const _node1 = getNodeFromPath<CallExpression>(
this.ast,
artifact.pathToNode,
'CallExpression'
).node
)
if (err(_node1)) return
const { node } = _node1
if (node.type !== 'CallExpression') return
const [oldStart, oldEnd] = artifact.range
if (oldStart === 0 && oldEnd === 0) return
@ -322,6 +328,10 @@ export class KclManager {
return
}
const code = recast(ast)
if (err(code)) {
console.error(code)
return
}
if (originalCode === code) return
// Update the code state and the editor.
@ -339,19 +349,31 @@ export class KclManager {
optionalParams?: {
focusPath?: PathToNode
}
): Promise<Selections | null> {
): Promise<{
newAst: Program
selections?: Selections
}> {
const newCode = recast(ast)
if (err(newCode)) return Promise.reject(newCode)
const astWithUpdatedSource = this.safeParse(newCode)
if (!astWithUpdatedSource) return null
let returnVal: Selections | null = null
if (!astWithUpdatedSource) return Promise.reject(new Error('bad ast'))
let returnVal: Selections | undefined = undefined
if (optionalParams?.focusPath) {
const { node } = getNodeFromPath<any>(
const _node1 = getNodeFromPath<any>(
astWithUpdatedSource,
optionalParams?.focusPath
)
if (err(_node1)) return Promise.reject(_node1)
const { node } = _node1
const { start, end } = node
if (!start || !end) return null
if (!start || !end)
return {
selections: undefined,
newAst: astWithUpdatedSource,
}
returnVal = {
codeBasedSelections: [
{
@ -377,7 +399,8 @@ export class KclManager {
// Execute ast mock will update the code state and editor.
await this.executeAstMock(astWithUpdatedSource)
}
return returnVal
return { selections: returnVal, newAst: astWithUpdatedSource }
}
get defaultPlanes() {

View File

@ -1,5 +1,6 @@
import { KCLError } from './errors'
import { initPromise, parse } from './wasm'
import { err } from 'lib/trap'
beforeAll(async () => {
await initPromise
@ -8,6 +9,7 @@ beforeAll(async () => {
describe('testing AST', () => {
test('5 + 6', () => {
const result = parse('5 +6')
if (err(result)) throw result
delete (result as any).nonCodeMeta
expect(result.body).toEqual([
{
@ -38,7 +40,9 @@ describe('testing AST', () => {
])
})
test('const myVar = 5', () => {
const { body } = parse('const myVar = 5')
const ast = parse('const myVar = 5')
if (err(ast)) throw ast
const { body } = ast
expect(body).toEqual([
{
type: 'VariableDeclaration',
@ -72,7 +76,9 @@ describe('testing AST', () => {
const code = `const myVar = 5
const newVar = myVar + 1
`
const { body } = parse(code)
const ast = parse(code)
if (err(ast)) throw ast
const { body } = ast
expect(body).toEqual([
{
type: 'VariableDeclaration',
@ -144,9 +150,11 @@ const newVar = myVar + 1
describe('testing function declaration', () => {
test('fn funcN = (a, b) => {return a + b}', () => {
const { body } = parse(
const ast = parse(
['fn funcN = (a, b) => {', ' return a + b', '}'].join('\n')
)
if (err(ast)) throw ast
const { body } = ast
delete (body[0] as any).declarations[0].init.body.nonCodeMeta
expect(body).toEqual([
{
@ -229,7 +237,9 @@ describe('testing function declaration', () => {
test('call expression assignment', () => {
const code = `fn funcN = (a, b) => { return a + b }
const myVar = funcN(1, 2)`
const { body } = parse(code)
const ast = parse(code)
if (err(ast)) throw ast
const { body } = ast
delete (body[0] as any).declarations[0].init.body.nonCodeMeta
expect(body).toEqual([
{
@ -366,7 +376,9 @@ describe('testing pipe operator special', () => {
|> lineTo([1, 1], %)
|> rx(45, %)
`
const { body } = parse(code)
const ast = parse(code)
if (err(ast)) throw ast
const { body } = ast
delete (body[0] as any).declarations[0].init.nonCodeMeta
expect(body).toEqual([
{
@ -566,7 +578,9 @@ describe('testing pipe operator special', () => {
})
test('pipe operator with binary expression', () => {
let code = `const myVar = 5 + 6 |> myFunc(45, %)`
const { body } = parse(code)
const ast = parse(code)
if (err(ast)) throw ast
const { body } = ast
delete (body as any)[0].declarations[0].init.nonCodeMeta
expect(body).toEqual([
{
@ -645,7 +659,9 @@ describe('testing pipe operator special', () => {
})
test('array expression', () => {
let code = `const yo = [1, '2', three, 4 + 5]`
const { body } = parse(code)
const ast = parse(code)
if (err(ast)) throw ast
const { body } = ast
expect(body).toEqual([
{
type: 'VariableDeclaration',
@ -720,7 +736,9 @@ describe('testing pipe operator special', () => {
'const three = 3',
"const yo = {aStr: 'str', anum: 2, identifier: three, binExp: 4 + 5}",
].join('\n')
const { body } = parse(code)
const ast = parse(code)
if (err(ast)) throw ast
const { body } = ast
expect(body).toEqual([
{
type: 'VariableDeclaration',
@ -864,7 +882,9 @@ describe('testing pipe operator special', () => {
const code = `const yo = {key: {
key2: 'value'
}}`
const { body } = parse(code)
const ast = parse(code)
if (err(ast)) throw ast
const { body } = ast
expect(body).toEqual([
{
type: 'VariableDeclaration',
@ -932,7 +952,9 @@ describe('testing pipe operator special', () => {
})
test('object expression with array ast', () => {
const code = `const yo = {key: [1, '2']}`
const { body } = parse(code)
const ast = parse(code)
if (err(ast)) throw ast
const { body } = ast
expect(body).toEqual([
{
type: 'VariableDeclaration',
@ -996,7 +1018,9 @@ describe('testing pipe operator special', () => {
})
test('object memberExpression simple', () => {
const code = `const prop = yo.one.two`
const { body } = parse(code)
const ast = parse(code)
if (err(ast)) throw ast
const { body } = ast
expect(body).toEqual([
{
type: 'VariableDeclaration',
@ -1051,7 +1075,9 @@ describe('testing pipe operator special', () => {
})
test('object memberExpression with square braces', () => {
const code = `const prop = yo.one["two"]`
const { body } = parse(code)
const ast = parse(code)
if (err(ast)) throw ast
const { body } = ast
expect(body).toEqual([
{
type: 'VariableDeclaration',
@ -1107,7 +1133,9 @@ describe('testing pipe operator special', () => {
})
test('object memberExpression with two square braces literal and identifier', () => {
const code = `const prop = yo["one"][two]`
const { body } = parse(code)
const ast = parse(code)
if (err(ast)) throw ast
const { body } = ast
expect(body).toEqual([
{
type: 'VariableDeclaration',
@ -1166,7 +1194,9 @@ describe('testing pipe operator special', () => {
describe('nests binary expressions correctly', () => {
it('works with the simple case', () => {
const code = `const yo = 1 + 2`
const { body } = parse(code)
const ast = parse(code)
if (err(ast)) throw ast
const { body } = ast
expect(body[0]).toEqual({
type: 'VariableDeclaration',
start: 0,
@ -1210,7 +1240,9 @@ describe('nests binary expressions correctly', () => {
it('should nest according to precedence with multiply first', () => {
// should be binExp { binExp { lit-1 * lit-2 } + lit}
const code = `const yo = 1 * 2 + 3`
const { body } = parse(code)
const ast = parse(code)
if (err(ast)) throw ast
const { body } = ast
expect(body[0]).toEqual({
type: 'VariableDeclaration',
start: 0,
@ -1267,7 +1299,9 @@ describe('nests binary expressions correctly', () => {
it('should nest according to precedence with sum first', () => {
// should be binExp { lit-1 + binExp { lit-2 * lit-3 } }
const code = `const yo = 1 + 2 * 3`
const { body } = parse(code)
const ast = parse(code)
if (err(ast)) throw ast
const { body } = ast
expect(body[0]).toEqual({
type: 'VariableDeclaration',
start: 0,
@ -1323,7 +1357,9 @@ describe('nests binary expressions correctly', () => {
})
it('should nest properly with two operators of equal precedence', () => {
const code = `const yo = 1 + 2 - 3`
const { body } = parse(code)
const ast = parse(code)
if (err(ast)) throw ast
const { body } = ast
expect((body[0] as any).declarations[0].init).toEqual({
type: 'BinaryExpression',
start: 11,
@ -1360,7 +1396,9 @@ describe('nests binary expressions correctly', () => {
})
it('should nest properly with two operators of equal (but higher) precedence', () => {
const code = `const yo = 1 * 2 / 3`
const { body } = parse(code)
const ast = parse(code)
if (err(ast)) throw ast
const { body } = ast
expect((body[0] as any).declarations[0].init).toEqual({
type: 'BinaryExpression',
start: 11,
@ -1397,7 +1435,9 @@ describe('nests binary expressions correctly', () => {
})
it('should nest properly with longer example', () => {
const code = `const yo = 1 + 2 * (3 - 4) / 5 + 6`
const { body } = parse(code)
const ast = parse(code)
if (err(ast)) throw ast
const { body } = ast
const init = (body[0] as any).declarations[0].init
expect(init).toEqual({
type: 'BinaryExpression',
@ -1460,12 +1500,16 @@ const key = 'c'`
value: 'this is a comment',
},
}
const { nonCodeMeta } = parse(code)
const ast = parse(code)
if (err(ast)) throw ast
const { nonCodeMeta } = ast
expect(nonCodeMeta.nonCodeNodes[0][0]).toEqual(nonCodeMetaInstance)
// extra whitespace won't change it's position (0) or value (NB the start end would have changed though)
const codeWithExtraStartWhitespace = '\n\n\n' + code
const { nonCodeMeta: nonCodeMeta2 } = parse(codeWithExtraStartWhitespace)
const ast2 = parse(codeWithExtraStartWhitespace)
if (err(ast2)) throw ast2
const { nonCodeMeta: nonCodeMeta2 } = ast2
expect(nonCodeMeta2.nonCodeNodes[0][0].value).toStrictEqual(
nonCodeMetaInstance.value
)
@ -1483,7 +1527,9 @@ const key = 'c'`
|> close(%)
`
const { body } = parse(code)
const ast = parse(code)
if (err(ast)) throw ast
const { body } = ast
const indexOfSecondLineToExpression = 2
const sketchNonCodeMeta = (body as any)[0].declarations[0].init.nonCodeMeta
.nonCodeNodes
@ -1508,7 +1554,9 @@ const key = 'c'`
' |> rx(90, %)',
].join('\n')
const { body } = parse(code)
const ast = parse(code)
if (err(ast)) throw ast
const { body } = ast
const sketchNonCodeMeta = (body[0] as any).declarations[0].init.nonCodeMeta
.nonCodeNodes[3][0]
expect(sketchNonCodeMeta).toEqual({
@ -1527,7 +1575,9 @@ const key = 'c'`
describe('test UnaryExpression', () => {
it('should parse a unary expression in simple var dec situation', () => {
const code = `const myVar = -min(4, 100)`
const { body } = parse(code)
const ast = parse(code)
if (err(ast)) throw ast
const { body } = ast
const myVarInit = (body?.[0] as any).declarations[0]?.init
expect(myVarInit).toEqual({
type: 'UnaryExpression',
@ -1552,7 +1602,9 @@ describe('test UnaryExpression', () => {
describe('testing nested call expressions', () => {
it('callExp in a binExp in a callExp', () => {
const code = 'const myVar = min(100, 1 + legLen(5, 3))'
const { body } = parse(code)
const ast = parse(code)
if (err(ast)) throw ast
const { body } = ast
const myVarInit = (body?.[0] as any).declarations[0]?.init
expect(myVarInit).toEqual({
type: 'CallExpression',
@ -1588,7 +1640,9 @@ describe('testing nested call expressions', () => {
describe('should recognise callExpresions in binaryExpressions', () => {
const code = "xLineTo(segEndX('seg02', %) + 1, %)"
it('should recognise the callExp', () => {
const { body } = parse(code)
const ast = parse(code)
if (err(ast)) throw ast
const { body } = ast
const callExpArgs = (body?.[0] as any).expression?.arguments
expect(callExpArgs).toEqual([
{
@ -1623,16 +1677,12 @@ describe('should recognise callExpresions in binaryExpressions', () => {
describe('parsing errors', () => {
it('should return an error when there is a unexpected closed curly brace', async () => {
const code = `const myVar = startSketchAt([}], %)`
const result = parse(code)
let _theError
try {
let _ = expect(parse(code))
} catch (e) {
_theError = e
}
const theError = _theError as any
expect(theError).toEqual(
new KCLError('syntax', 'Unexpected token', [[27, 28]])
)
expect(result).toBeInstanceOf(KCLError)
const error = result as KCLError
expect(error.kind).toBe('syntax')
expect(error.msg).toBe('Unexpected token')
expect(error.sourceRanges).toEqual([[27, 28]])
})
})

View File

@ -23,7 +23,7 @@ const mySketch001 = startSketchOn('XY')
start: {
to: [0, 0],
from: [0, 0],
name: '',
tag: null,
__geoMeta: {
id: expect.any(String),
sourceRange: [46, 71],
@ -32,7 +32,7 @@ const mySketch001 = startSketchOn('XY')
value: [
{
type: 'ToPoint',
name: '',
tag: null,
to: [-1.59, -1.54],
from: [0, 0],
__geoMeta: {
@ -44,20 +44,14 @@ const mySketch001 = startSketchOn('XY')
type: 'ToPoint',
to: [0.46, -5.82],
from: [-1.59, -1.54],
name: '',
tag: null,
__geoMeta: {
sourceRange: [108, 132],
id: expect.any(String),
},
},
],
position: [0, 0, 0],
rotation: [0, 0, 0, 1],
xAxis: { x: 1, y: 0, z: 0 },
yAxis: { x: 0, y: 1, z: 0 },
zAxis: { x: 0, y: 0, z: 1 },
id: expect.any(String),
entityId: expect.any(String),
__meta: [{ sourceRange: [46, 71] }],
})
})
@ -79,51 +73,49 @@ const mySketch001 = startSketchOn('XY')
value: [
{
type: 'extrudePlane',
position: [0, 0, 0],
rotation: [0, 0, 0, 1],
faceId: expect.any(String),
name: '',
tag: null,
id: expect.any(String),
sourceRange: [77, 102],
},
{
type: 'extrudePlane',
position: [0, 0, 0],
rotation: [0, 0, 0, 1],
faceId: expect.any(String),
name: '',
tag: null,
id: expect.any(String),
sourceRange: [108, 132],
},
],
sketchGroupValues: [
{
type: 'ToPoint',
from: [0, 0],
to: [-1.59, -1.54],
name: '',
__geoMeta: {
id: expect.any(String),
sourceRange: [77, 102],
sketchGroup: {
id: expect.any(String),
__meta: expect.any(Array),
on: expect.any(Object),
start: expect.any(Object),
type: 'SketchGroup',
value: [
{
type: 'ToPoint',
from: [0, 0],
to: [-1.59, -1.54],
tag: null,
__geoMeta: {
id: expect.any(String),
sourceRange: [77, 102],
},
},
},
{
type: 'ToPoint',
from: [-1.59, -1.54],
to: [0.46, -5.82],
name: '',
__geoMeta: {
id: expect.any(String),
sourceRange: [108, 132],
{
type: 'ToPoint',
from: [-1.59, -1.54],
to: [0.46, -5.82],
tag: null,
__geoMeta: {
id: expect.any(String),
sourceRange: [108, 132],
},
},
},
],
],
},
height: 2,
position: [0, 0, 0],
rotation: [0, 0, 0, 1],
xAxis: { x: 1, y: 0, z: 0 },
yAxis: { x: 0, y: 1, z: 0 },
zAxis: { x: 0, y: 0, z: 1 },
startCapId: expect.any(String),
endCapId: expect.any(String),
__meta: [{ sourceRange: [46, 71] }],
@ -162,70 +154,76 @@ const sk2 = startSketchOn('XY')
value: [
{
type: 'extrudePlane',
position: [0, 0, 0],
rotation: [0, 0, 0, 1],
faceId: expect.any(String),
name: '',
tag: null,
id: expect.any(String),
sourceRange: [69, 89],
},
{
type: 'extrudePlane',
position: [0, 0, 0],
rotation: [0, 0, 0, 1],
faceId: expect.any(String),
name: 'p',
tag: {
end: 117,
start: 114,
type: 'TagDeclarator',
value: 'p',
},
id: expect.any(String),
sourceRange: [95, 118],
},
{
type: 'extrudePlane',
position: [0, 0, 0],
rotation: [0, 0, 0, 1],
faceId: expect.any(String),
name: '',
tag: null,
id: expect.any(String),
sourceRange: [124, 143],
},
],
sketchGroupValues: [
{
type: 'ToPoint',
from: [0, 0],
to: [-2.5, 0],
name: '',
__geoMeta: {
id: expect.any(String),
sourceRange: [69, 89],
sketchGroup: {
id: expect.any(String),
__meta: expect.any(Array),
on: expect.any(Object),
start: expect.any(Object),
type: 'SketchGroup',
value: [
{
type: 'ToPoint',
from: [0, 0],
to: [-2.5, 0],
tag: null,
__geoMeta: {
id: expect.any(String),
sourceRange: [69, 89],
},
},
},
{
type: 'ToPoint',
from: [-2.5, 0],
to: [0, 10],
name: 'p',
__geoMeta: {
id: expect.any(String),
sourceRange: [95, 118],
{
type: 'ToPoint',
from: [-2.5, 0],
to: [0, 10],
tag: {
end: 117,
start: 114,
type: 'TagDeclarator',
value: 'p',
},
__geoMeta: {
id: expect.any(String),
sourceRange: [95, 118],
},
},
},
{
type: 'ToPoint',
from: [0, 10],
to: [2.5, 0],
name: '',
__geoMeta: {
id: expect.any(String),
sourceRange: [124, 143],
{
type: 'ToPoint',
from: [0, 10],
to: [2.5, 0],
tag: null,
__geoMeta: {
id: expect.any(String),
sourceRange: [124, 143],
},
},
},
],
],
},
height: 2,
position: [0, 0, 0],
rotation: [0, 0, 0, 1],
xAxis: { x: 1, y: 0, z: 0 },
yAxis: { x: 0, y: 1, z: 0 },
zAxis: { x: 0, y: 0, z: 1 },
startCapId: expect.any(String),
endCapId: expect.any(String),
__meta: [{ sourceRange: [38, 63] }],
@ -236,70 +234,76 @@ const sk2 = startSketchOn('XY')
value: [
{
type: 'extrudePlane',
position: [0, 0, 0],
rotation: [0, 0, 0, 1],
faceId: expect.any(String),
name: '',
tag: null,
id: expect.any(String),
sourceRange: [374, 394],
},
{
type: 'extrudePlane',
position: [0, 0, 0],
rotation: [0, 0, 0, 1],
faceId: expect.any(String),
name: 'p',
tag: {
end: 421,
start: 418,
type: 'TagDeclarator',
value: 'p',
},
id: expect.any(String),
sourceRange: [400, 422],
},
{
type: 'extrudePlane',
position: [0, 0, 0],
rotation: [0, 0, 0, 1],
faceId: expect.any(String),
name: '',
tag: null,
id: expect.any(String),
sourceRange: [428, 447],
},
],
sketchGroupValues: [
{
type: 'ToPoint',
from: [0, 0],
to: [-2.5, 0],
name: '',
__geoMeta: {
id: expect.any(String),
sourceRange: [374, 394],
sketchGroup: {
id: expect.any(String),
__meta: expect.any(Array),
on: expect.any(Object),
start: expect.any(Object),
type: 'SketchGroup',
value: [
{
type: 'ToPoint',
from: [0, 0],
to: [-2.5, 0],
tag: null,
__geoMeta: {
id: expect.any(String),
sourceRange: [374, 394],
},
},
},
{
type: 'ToPoint',
from: [-2.5, 0],
to: [0, 3],
name: 'p',
__geoMeta: {
id: expect.any(String),
sourceRange: [400, 422],
{
type: 'ToPoint',
from: [-2.5, 0],
to: [0, 3],
tag: {
end: 421,
start: 418,
type: 'TagDeclarator',
value: 'p',
},
__geoMeta: {
id: expect.any(String),
sourceRange: [400, 422],
},
},
},
{
type: 'ToPoint',
from: [0, 3],
to: [2.5, 0],
name: '',
__geoMeta: {
id: expect.any(String),
sourceRange: [428, 447],
{
type: 'ToPoint',
from: [0, 3],
to: [2.5, 0],
tag: null,
__geoMeta: {
id: expect.any(String),
sourceRange: [428, 447],
},
},
},
],
],
},
height: 2,
position: [0, 0, 0],
rotation: [0, 0, 0, 1],
xAxis: { x: 1, y: 0, z: 0 },
yAxis: { x: 0, y: 1, z: 0 },
zAxis: { x: 0, y: 0, z: 1 },
startCapId: expect.any(String),
endCapId: expect.any(String),
__meta: [{ sourceRange: [343, 368] }],

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