Compare commits

...

18 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
171 changed files with 126152 additions and 21196 deletions

View File

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

View File

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

View File

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

View File

@ -89,25 +89,6 @@ enable third-party cookies. You can enable third-party cookies by clicking on
the eye with a slash through it in the URL bar, and clicking on "Enable the eye with a slash through it in the URL bar, and clicking on "Enable
Third-Party Cookies". Third-Party Cookies".
## Running tests
First, start the dev server following "Running a development build" above.
Then in another terminal tab, run:
```
yarn test
```
Which will run our suite of [Vitest unit](https://vitest.dev/) and [React Testing Library E2E](https://testing-library.com/docs/react-testing-library/intro/) tests, in interactive mode by default.
For running the rust (not tauri rust though) only, you can
```bash
cd src/wasm-lib
cargo test
```
## Tauri ## Tauri
To spin up up tauri dev, `yarn install` and `yarn build:wasm-dev` need to have been done before hand then To spin up up tauri dev, `yarn install` and `yarn build:wasm-dev` need to have been done before hand then
@ -195,7 +176,9 @@ $ cargo +nightly fuzz run parser
For more information on fuzzing you can check out For more information on fuzzing you can check out
[this guide](https://rust-fuzz.github.io/book/cargo-fuzz.html). [this guide](https://rust-fuzz.github.io/book/cargo-fuzz.html).
### Playwright ## Tests
### Playwright tests
For a portable way to run Playwright you'll need Docker. For a portable way to run Playwright you'll need Docker.
@ -284,6 +267,37 @@ Where `./store` should look like this
However because much of our tests involve clicking in the stream at specific locations, it's code-gen looks `await page.locator('video').click();` when really we need to use a pixel coord, so I think it's of limited use. However because much of our tests involve clicking in the stream at specific locations, it's code-gen looks `await page.locator('video').click();` when really we need to use a pixel coord, so I think it's of limited use.
### Unit and component tests
If you already haven't, run the following:
```
yarn
yarn build:wasm
yarn start
```
and finally:
```
yarn test:nowatch
```
For individual testing:
```
yarn test abstractSyntaxTree -t "unexpected closed curly brace" --silent=false
```
Which will run our suite of [Vitest unit](https://vitest.dev/) and [React Testing Library E2E](https://testing-library.com/docs/react-testing-library/intro/) tests, in interactive mode by default.
### Rust tests
```bash
cd src/wasm-lib
cargo test
```
#### Some notes on CI #### Some notes on CI
The tests are broken into snapshot tests and non-snapshot tests, and they run in that order, they automatically commit new snap shots, so if you see an image commit check it was an intended change. If we have non-determinism in the snapshots such that they are always committing new images, hopefully this annoyance makes us fix them asap, if you notice this happening let Kurt know. But for the odd occasion `git reset --hard HEAD~ && git push -f` is your friend. The tests are broken into snapshot tests and non-snapshot tests, and they run in that order, they automatically commit new snap shots, so if you see an image commit check it was an intended change. If we have non-determinism in the snapshots such that they are always committing new images, hopefully this annoyance makes us fix them asap, if you notice this happening let Kurt know. But for the odd occasion `git reset --hard HEAD~ && git push -f` is your friend.

View File

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

View File

@ -9,7 +9,7 @@ Returns the angle to match the given length for x.
```js ```js
angleToMatchLengthX(segment_name: string, to: number, sketch_group: SketchGroup) -> number angleToMatchLengthX(segment_name: TagIdentifier, to: number, sketch_group: SketchGroup) -> number
``` ```
### Examples ### Examples
@ -31,7 +31,12 @@ const extrusion = extrude(5, sketch001)
### Arguments ### Arguments
* `segment_name`: `string` (REQUIRED) * `segment_name`: `TagIdentifier` (REQUIRED)
```js
{
value: string,
}
```
* `to`: `number` (REQUIRED) * `to`: `number` (REQUIRED)
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED) * `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
```js ```js
@ -71,10 +76,181 @@ const extrusion = extrude(5, sketch001)
}, },
} | } |
{ {
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: SketchSurface,
// The starting path.
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The paths in the sketch group.
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
} |
{
// arc's direction
ccw: string,
// the arc's center
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
// The x coordinate.
x: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
// The x coordinate.
x: number,
// The y coordinate.
y: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
},
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
value: [{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
},
// The id of the face. // The id of the face.
id: uuid, id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face", type: "face",
// The tag of the face. // The tag of the face.
value: string, value: string,
@ -101,8 +277,12 @@ const extrusion = extrude(5, sketch001)
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -110,8 +290,12 @@ const extrusion = extrude(5, sketch001)
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -123,8 +307,12 @@ const extrusion = extrude(5, sketch001)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -132,8 +320,12 @@ const extrusion = extrude(5, sketch001)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -141,8 +333,12 @@ const extrusion = extrude(5, sketch001)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -152,8 +348,12 @@ const extrusion = extrude(5, sketch001)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -165,8 +365,12 @@ const extrusion = extrude(5, sketch001)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",

View File

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

View File

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

View File

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

View File

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

View File

@ -9,7 +9,7 @@ Draw an angled line that intersects with a given line.
```js ```js
angledLineThatIntersects(data: AngledLineThatIntersectsData, sketch_group: SketchGroup, tag?: String) -> SketchGroup angledLineThatIntersects(data: AngledLineThatIntersectsData, sketch_group: SketchGroup, tag?: TagDeclarator) -> SketchGroup
``` ```
### Examples ### Examples
@ -40,7 +40,9 @@ const example = extrude(10, exampleSketch)
// The angle of the line. // The angle of the line.
angle: number, angle: number,
// The tag of the line to intersect with. // The tag of the line to intersect with.
intersectTag: string, intersectTag: {
value: string,
},
// The offset from the intersecting line. // The offset from the intersecting line.
offset: number, offset: number,
} }
@ -83,10 +85,181 @@ const example = extrude(10, exampleSketch)
}, },
} | } |
{ {
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: SketchSurface,
// The starting path.
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The paths in the sketch group.
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
} |
{
// arc's direction
ccw: string,
// the arc's center
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
// The x coordinate.
x: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
// The x coordinate.
x: number,
// The y coordinate.
y: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
},
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
value: [{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
},
// The id of the face. // The id of the face.
id: uuid, id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face", type: "face",
// The tag of the face. // The tag of the face.
value: string, value: string,
@ -113,8 +286,12 @@ const example = extrude(10, exampleSketch)
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -122,8 +299,12 @@ const example = extrude(10, exampleSketch)
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -135,8 +316,12 @@ const example = extrude(10, exampleSketch)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -144,8 +329,12 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -153,8 +342,12 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -164,8 +357,12 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -177,15 +374,26 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",
}], }],
} }
``` ```
* `tag`: `String` (OPTIONAL) * `tag`: `TagDeclarator` (OPTIONAL)
```js
{
end: number,
start: number,
value: string,
}
```
### Returns ### Returns
@ -227,10 +435,181 @@ const example = extrude(10, exampleSketch)
}, },
} | } |
{ {
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: SketchSurface,
// The starting path.
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The paths in the sketch group.
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
} |
{
// arc's direction
ccw: string,
// the arc's center
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
// The x coordinate.
x: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
// The x coordinate.
x: number,
// The y coordinate.
y: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
},
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
value: [{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
},
// The id of the face. // The id of the face.
id: uuid, id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face", type: "face",
// The tag of the face. // The tag of the face.
value: string, value: string,
@ -257,8 +636,12 @@ const example = extrude(10, exampleSketch)
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -266,8 +649,12 @@ const example = extrude(10, exampleSketch)
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -279,8 +666,12 @@ const example = extrude(10, exampleSketch)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -288,8 +679,12 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -297,8 +692,12 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -308,8 +707,12 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -321,8 +724,12 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",

View File

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

View File

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

View File

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

View File

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

View File

@ -9,7 +9,7 @@ Create chamfers on tagged paths.
```js ```js
chamfer(data: ChamferData, extrude_group: ExtrudeGroup) -> ExtrudeGroup chamfer(data: ChamferData, extrude_group: ExtrudeGroup, tag?: TagDeclarator) -> ExtrudeGroup
``` ```
### Examples ### Examples
@ -50,7 +50,9 @@ const mountingPlate = extrude(thickness, mountingPlateSketch)
length: number, length: number,
// The tags of the paths you want to chamfer. // The tags of the paths you want to chamfer.
tags: [uuid | tags: [uuid |
string], {
value: string,
}],
} }
``` ```
* `extrude_group`: `ExtrudeGroup` - An extrude group is a collection of extrude surfaces. (REQUIRED) * `extrude_group`: `ExtrudeGroup` - An extrude group is a collection of extrude surfaces. (REQUIRED)
@ -58,16 +60,182 @@ string],
{ {
// The id of the extrusion end cap // The id of the extrusion end cap
endCapId: uuid, endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group. // The height of the extrude group.
height: number, height: number,
// The id of the extrude group. // The id of the extrude group.
id: uuid, id: uuid,
// The sketch group paths. // The sketch group.
sketchGroupValues: [{ 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. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, 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. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -79,8 +247,12 @@ string],
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -88,8 +260,12 @@ string],
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -97,8 +273,12 @@ string],
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -108,8 +288,12 @@ string],
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -121,12 +305,17 @@ string],
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",
}], }],
},
// The id of the extrusion start cap // The id of the extrusion start cap
startCapId: uuid, startCapId: uuid,
// The extrude surfaces. // The extrude surfaces.
@ -135,10 +324,14 @@ string],
faceId: uuid, faceId: uuid,
// The id of the geometry. // The id of the geometry.
id: uuid, id: uuid,
// The name.
name: string,
// The source range. // The source range.
sourceRange: [number, number], sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane", type: "extrudePlane",
} | } |
{ {
@ -146,30 +339,24 @@ string],
faceId: uuid, faceId: uuid,
// The id of the geometry. // The id of the geometry.
id: uuid, id: uuid,
// The name.
name: string,
// The source range. // The source range.
sourceRange: [number, number], sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc", type: "extrudeArc",
}], }],
// The x-axis of the extrude group base plane in the 3D space }
xAxis: { ```
x: number, * `tag`: `TagDeclarator` (OPTIONAL)
y: number, ```js
z: number, {
}, end: number,
// The y-axis of the extrude group base plane in the 3D space start: number,
yAxis: { value: string,
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,16 +367,182 @@ string],
{ {
// The id of the extrusion end cap // The id of the extrusion end cap
endCapId: uuid, endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group. // The height of the extrude group.
height: number, height: number,
// The id of the extrude group. // The id of the extrude group.
id: uuid, id: uuid,
// The sketch group paths. // The sketch group.
sketchGroupValues: [{ 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. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, 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. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -201,8 +554,12 @@ string],
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -210,8 +567,12 @@ string],
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -219,8 +580,12 @@ string],
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -230,8 +595,12 @@ string],
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -243,12 +612,17 @@ string],
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",
}], }],
},
// The id of the extrusion start cap // The id of the extrusion start cap
startCapId: uuid, startCapId: uuid,
// The extrude surfaces. // The extrude surfaces.
@ -257,10 +631,14 @@ string],
faceId: uuid, faceId: uuid,
// The id of the geometry. // The id of the geometry.
id: uuid, id: uuid,
// The name.
name: string,
// The source range. // The source range.
sourceRange: [number, number], sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane", type: "extrudePlane",
} | } |
{ {
@ -268,30 +646,16 @@ string],
faceId: uuid, faceId: uuid,
// The id of the geometry. // The id of the geometry.
id: uuid, id: uuid,
// The name.
name: string,
// The source range. // The source range.
sourceRange: [number, number], sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc", type: "extrudeArc",
}], }],
// 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 ```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 ### Examples
@ -41,7 +41,14 @@ const example = extrude(5, exampleSketch)
* `center`: `[number]` (REQUIRED) * `center`: `[number]` (REQUIRED)
* `radius`: `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) * `sketch_surface_or_group`: `SketchSurfaceOrGroup` - A sketch surface or a sketch group. (REQUIRED)
```js ```js
{ {
@ -76,10 +83,181 @@ const example = extrude(5, exampleSketch)
}, },
} | } |
{ {
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: SketchSurface,
// The starting path.
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The paths in the sketch group.
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
} |
{
// arc's direction
ccw: string,
// the arc's center
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
// The x coordinate.
x: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
// The x coordinate.
x: number,
// The y coordinate.
y: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
},
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
value: [{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
},
// The id of the face. // The id of the face.
id: uuid, id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face", type: "face",
// The tag of the face. // The tag of the face.
value: string, value: string,
@ -138,10 +316,74 @@ const example = extrude(5, exampleSketch)
}, },
} | } |
{ {
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: SketchGroup,
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
value: [{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
},
// The id of the face. // The id of the face.
id: uuid, id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face", type: "face",
// The tag of the face. // The tag of the face.
value: string, value: string,
@ -168,8 +410,12 @@ const example = extrude(5, exampleSketch)
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -177,8 +423,12 @@ const example = extrude(5, exampleSketch)
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -190,8 +440,12 @@ const example = extrude(5, exampleSketch)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -199,8 +453,12 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -208,8 +466,12 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -219,8 +481,12 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -232,8 +498,12 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",
@ -281,10 +551,181 @@ const example = extrude(5, exampleSketch)
}, },
} | } |
{ {
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: SketchSurface,
// The starting path.
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The paths in the sketch group.
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
} |
{
// arc's direction
ccw: string,
// the arc's center
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
// The x coordinate.
x: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
// The x coordinate.
x: number,
// The y coordinate.
y: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
},
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
value: [{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
},
// The id of the face. // The id of the face.
id: uuid, id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face", type: "face",
// The tag of the face. // The tag of the face.
value: string, value: string,
@ -311,8 +752,12 @@ const example = extrude(5, exampleSketch)
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -320,8 +765,12 @@ const example = extrude(5, exampleSketch)
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -333,8 +782,12 @@ const example = extrude(5, exampleSketch)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -342,8 +795,12 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -351,8 +808,12 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -362,8 +823,12 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -375,8 +840,12 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",

View File

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

View File

@ -102,10 +102,181 @@ const example = extrude(10, exampleSketch)
}, },
} | } |
{ {
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: SketchSurface,
// The starting path.
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The paths in the sketch group.
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
} |
{
// arc's direction
ccw: string,
// the arc's center
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
// The x coordinate.
x: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
// The x coordinate.
x: number,
// The y coordinate.
y: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
},
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
value: [{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
},
// The id of the face. // The id of the face.
id: uuid, id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face", type: "face",
// The tag of the face. // The tag of the face.
value: string, value: string,
@ -132,8 +303,12 @@ const example = extrude(10, exampleSketch)
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -142,8 +317,12 @@ const example = extrude(10, exampleSketch)
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -155,8 +334,12 @@ const example = extrude(10, exampleSketch)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -164,8 +347,12 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -173,8 +360,12 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -184,8 +375,12 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -197,8 +392,12 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",
@ -216,16 +415,182 @@ const example = extrude(10, exampleSketch)
{ {
// The id of the extrusion end cap // The id of the extrusion end cap
endCapId: uuid, endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group. // The height of the extrude group.
height: number, height: number,
// The id of the extrude group. // The id of the extrude group.
id: uuid, id: uuid,
// The sketch group paths. // The sketch group.
sketchGroupValues: [{ 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. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, 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. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -237,8 +602,12 @@ const example = extrude(10, exampleSketch)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -246,8 +615,12 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -255,8 +628,12 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -266,8 +643,12 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -279,12 +660,17 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",
}], }],
},
// The id of the extrusion start cap // The id of the extrusion start cap
startCapId: uuid, startCapId: uuid,
type: "extrudeGroup", type: "extrudeGroup",
@ -294,10 +680,14 @@ const example = extrude(10, exampleSketch)
faceId: uuid, faceId: uuid,
// The id of the geometry. // The id of the geometry.
id: uuid, id: uuid,
// The name.
name: string,
// The source range. // The source range.
sourceRange: [number, number], sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane", type: "extrudePlane",
} | } |
{ {
@ -305,30 +695,16 @@ const example = extrude(10, exampleSketch)
faceId: uuid, faceId: uuid,
// The id of the geometry. // The id of the geometry.
id: uuid, id: uuid,
// The name.
name: string,
// The source range. // The source range.
sourceRange: [number, number], sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc", type: "extrudeArc",
}], }],
// The x-axis of the extrude group base plane in the 3D space
xAxis: {
x: number,
y: number,
z: number,
},
// The y-axis of the extrude group base plane in the 3D space
yAxis: {
x: number,
y: number,
z: number,
},
// The z-axis of the extrude group base plane in the 3D space
zAxis: {
x: number,
y: number,
z: number,
},
} | } |
{ {
type: "extrudeGroups", type: "extrudeGroups",

View File

@ -50,7 +50,9 @@ const mountingPlate = extrude(thickness, mountingPlateSketch)
radius: number, radius: number,
// The tags of the paths you want to fillet. // The tags of the paths you want to fillet.
tags: [uuid | tags: [uuid |
string], {
value: string,
}],
} }
``` ```
* `extrude_group`: `ExtrudeGroup` - An extrude group is a collection of extrude surfaces. (REQUIRED) * `extrude_group`: `ExtrudeGroup` - An extrude group is a collection of extrude surfaces. (REQUIRED)
@ -58,16 +60,182 @@ string],
{ {
// The id of the extrusion end cap // The id of the extrusion end cap
endCapId: uuid, endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group. // The height of the extrude group.
height: number, height: number,
// The id of the extrude group. // The id of the extrude group.
id: uuid, id: uuid,
// The sketch group paths. // The sketch group.
sketchGroupValues: [{ 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. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, 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. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -79,8 +247,12 @@ string],
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -88,8 +260,12 @@ string],
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -97,8 +273,12 @@ string],
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -108,8 +288,12 @@ string],
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -121,12 +305,17 @@ string],
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",
}], }],
},
// The id of the extrusion start cap // The id of the extrusion start cap
startCapId: uuid, startCapId: uuid,
// The extrude surfaces. // The extrude surfaces.
@ -135,10 +324,14 @@ string],
faceId: uuid, faceId: uuid,
// The id of the geometry. // The id of the geometry.
id: uuid, id: uuid,
// The name.
name: string,
// The source range. // The source range.
sourceRange: [number, number], sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane", type: "extrudePlane",
} | } |
{ {
@ -146,30 +339,16 @@ string],
faceId: uuid, faceId: uuid,
// The id of the geometry. // The id of the geometry.
id: uuid, id: uuid,
// The name.
name: string,
// The source range. // The source range.
sourceRange: [number, number], sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc", type: "extrudeArc",
}], }],
// 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,16 +359,182 @@ string],
{ {
// The id of the extrusion end cap // The id of the extrusion end cap
endCapId: uuid, endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group. // The height of the extrude group.
height: number, height: number,
// The id of the extrude group. // The id of the extrude group.
id: uuid, id: uuid,
// The sketch group paths. // The sketch group.
sketchGroupValues: [{ 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. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, 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. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -201,8 +546,12 @@ string],
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -210,8 +559,12 @@ string],
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -219,8 +572,12 @@ string],
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -230,8 +587,12 @@ string],
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -243,12 +604,17 @@ string],
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",
}], }],
},
// The id of the extrusion start cap // The id of the extrusion start cap
startCapId: uuid, startCapId: uuid,
// The extrude surfaces. // The extrude surfaces.
@ -257,10 +623,14 @@ string],
faceId: uuid, faceId: uuid,
// The id of the geometry. // The id of the geometry.
id: uuid, id: uuid,
// The name.
name: string,
// The source range. // The source range.
sourceRange: [number, number], sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane", type: "extrudePlane",
} | } |
{ {
@ -268,30 +638,16 @@ string],
faceId: uuid, faceId: uuid,
// The id of the geometry. // The id of the geometry.
id: uuid, id: uuid,
// The name.
name: string,
// The source range. // The source range.
sourceRange: [number, number], sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc", type: "extrudeArc",
}], }],
// The x-axis of the extrude group base plane in the 3D space
xAxis: {
x: number,
y: number,
z: number,
},
// The y-axis of the extrude group base plane in the 3D space
yAxis: {
x: number,
y: number,
z: number,
},
// The z-axis of the extrude group base plane in the 3D space
zAxis: {
x: number,
y: number,
z: number,
},
} }
``` ```

View File

@ -9,7 +9,7 @@ Get an edge on a 3D solid.
```js ```js
getEdge(tag: String, extrude_group: ExtrudeGroup) -> Uuid getEdge(tag: TagIdentifier, extrude_group: ExtrudeGroup) -> Uuid
``` ```
### Examples ### Examples
@ -39,22 +39,193 @@ const revolution = startSketchOn(box, "revolveAxis")
### Arguments ### Arguments
* `tag`: `String` (REQUIRED) * `tag`: `TagIdentifier` (REQUIRED)
```js
{
value: string,
}
```
* `extrude_group`: `ExtrudeGroup` - An extrude group is a collection of extrude surfaces. (REQUIRED) * `extrude_group`: `ExtrudeGroup` - An extrude group is a collection of extrude surfaces. (REQUIRED)
```js ```js
{ {
// The id of the extrusion end cap // The id of the extrusion end cap
endCapId: uuid, endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group. // The height of the extrude group.
height: number, height: number,
// The id of the extrude group. // The id of the extrude group.
id: uuid, id: uuid,
// The sketch group paths. // The sketch group.
sketchGroupValues: [{ 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. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, 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. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -66,8 +237,12 @@ const revolution = startSketchOn(box, "revolveAxis")
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -75,8 +250,12 @@ const revolution = startSketchOn(box, "revolveAxis")
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -84,8 +263,12 @@ const revolution = startSketchOn(box, "revolveAxis")
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -95,8 +278,12 @@ const revolution = startSketchOn(box, "revolveAxis")
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -108,12 +295,17 @@ const revolution = startSketchOn(box, "revolveAxis")
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",
}], }],
},
// The id of the extrusion start cap // The id of the extrusion start cap
startCapId: uuid, startCapId: uuid,
// The extrude surfaces. // The extrude surfaces.
@ -122,10 +314,14 @@ const revolution = startSketchOn(box, "revolveAxis")
faceId: uuid, faceId: uuid,
// The id of the geometry. // The id of the geometry.
id: uuid, id: uuid,
// The name.
name: string,
// The source range. // The source range.
sourceRange: [number, number], sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane", type: "extrudePlane",
} | } |
{ {
@ -133,30 +329,16 @@ const revolution = startSketchOn(box, "revolveAxis")
faceId: uuid, faceId: uuid,
// The id of the geometry. // The id of the geometry.
id: uuid, id: uuid,
// The name.
name: string,
// The source range. // The source range.
sourceRange: [number, number], sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc", type: "extrudeArc",
}], }],
// The x-axis of the extrude group base plane in the 3D space
xAxis: {
x: number,
y: number,
z: number,
},
// The y-axis of the extrude group base plane in the 3D space
yAxis: {
x: number,
y: number,
z: number,
},
// The z-axis of the extrude group base plane in the 3D space
zAxis: {
x: number,
y: number,
z: number,
},
} }
``` ```

View File

@ -9,7 +9,7 @@ Get the next adjacent edge to the edge given.
```js ```js
getNextAdjacentEdge(tag: String, extrude_group: ExtrudeGroup) -> Uuid getNextAdjacentEdge(tag: TagIdentifier, extrude_group: ExtrudeGroup) -> Uuid
``` ```
### Examples ### Examples
@ -37,22 +37,193 @@ const example = extrude(5, exampleSketch)
### Arguments ### Arguments
* `tag`: `String` (REQUIRED) * `tag`: `TagIdentifier` (REQUIRED)
```js
{
value: string,
}
```
* `extrude_group`: `ExtrudeGroup` - An extrude group is a collection of extrude surfaces. (REQUIRED) * `extrude_group`: `ExtrudeGroup` - An extrude group is a collection of extrude surfaces. (REQUIRED)
```js ```js
{ {
// The id of the extrusion end cap // The id of the extrusion end cap
endCapId: uuid, endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group. // The height of the extrude group.
height: number, height: number,
// The id of the extrude group. // The id of the extrude group.
id: uuid, id: uuid,
// The sketch group paths. // The sketch group.
sketchGroupValues: [{ 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. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, 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. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -64,8 +235,12 @@ const example = extrude(5, exampleSketch)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -73,8 +248,12 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -82,8 +261,12 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -93,8 +276,12 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -106,12 +293,17 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",
}], }],
},
// The id of the extrusion start cap // The id of the extrusion start cap
startCapId: uuid, startCapId: uuid,
// The extrude surfaces. // The extrude surfaces.
@ -120,10 +312,14 @@ const example = extrude(5, exampleSketch)
faceId: uuid, faceId: uuid,
// The id of the geometry. // The id of the geometry.
id: uuid, id: uuid,
// The name.
name: string,
// The source range. // The source range.
sourceRange: [number, number], sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane", type: "extrudePlane",
} | } |
{ {
@ -131,30 +327,16 @@ const example = extrude(5, exampleSketch)
faceId: uuid, faceId: uuid,
// The id of the geometry. // The id of the geometry.
id: uuid, id: uuid,
// The name.
name: string,
// The source range. // The source range.
sourceRange: [number, number], sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc", type: "extrudeArc",
}], }],
// The x-axis of the extrude group base plane in the 3D space
xAxis: {
x: number,
y: number,
z: number,
},
// The y-axis of the extrude group base plane in the 3D space
yAxis: {
x: number,
y: number,
z: number,
},
// The z-axis of the extrude group base plane in the 3D space
zAxis: {
x: number,
y: number,
z: number,
},
} }
``` ```

View File

@ -9,7 +9,7 @@ Get the opposite edge to the edge given.
```js ```js
getOppositeEdge(tag: String, extrude_group: ExtrudeGroup) -> Uuid getOppositeEdge(tag: TagIdentifier, extrude_group: ExtrudeGroup) -> Uuid
``` ```
### Examples ### Examples
@ -35,22 +35,193 @@ const example = extrude(5, exampleSketch)
### Arguments ### Arguments
* `tag`: `String` (REQUIRED) * `tag`: `TagIdentifier` (REQUIRED)
```js
{
value: string,
}
```
* `extrude_group`: `ExtrudeGroup` - An extrude group is a collection of extrude surfaces. (REQUIRED) * `extrude_group`: `ExtrudeGroup` - An extrude group is a collection of extrude surfaces. (REQUIRED)
```js ```js
{ {
// The id of the extrusion end cap // The id of the extrusion end cap
endCapId: uuid, endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group. // The height of the extrude group.
height: number, height: number,
// The id of the extrude group. // The id of the extrude group.
id: uuid, id: uuid,
// The sketch group paths. // The sketch group.
sketchGroupValues: [{ 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. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, 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. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -62,8 +233,12 @@ const example = extrude(5, exampleSketch)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -71,8 +246,12 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -80,8 +259,12 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -91,8 +274,12 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -104,12 +291,17 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",
}], }],
},
// The id of the extrusion start cap // The id of the extrusion start cap
startCapId: uuid, startCapId: uuid,
// The extrude surfaces. // The extrude surfaces.
@ -118,10 +310,14 @@ const example = extrude(5, exampleSketch)
faceId: uuid, faceId: uuid,
// The id of the geometry. // The id of the geometry.
id: uuid, id: uuid,
// The name.
name: string,
// The source range. // The source range.
sourceRange: [number, number], sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane", type: "extrudePlane",
} | } |
{ {
@ -129,30 +325,16 @@ const example = extrude(5, exampleSketch)
faceId: uuid, faceId: uuid,
// The id of the geometry. // The id of the geometry.
id: uuid, id: uuid,
// The name.
name: string,
// The source range. // The source range.
sourceRange: [number, number], sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc", type: "extrudeArc",
}], }],
// The x-axis of the extrude group base plane in the 3D space
xAxis: {
x: number,
y: number,
z: number,
},
// The y-axis of the extrude group base plane in the 3D space
yAxis: {
x: number,
y: number,
z: number,
},
// The z-axis of the extrude group base plane in the 3D space
zAxis: {
x: number,
y: number,
z: number,
},
} }
``` ```

View File

@ -9,7 +9,7 @@ Get the previous adjacent edge to the edge given.
```js ```js
getPreviousAdjacentEdge(tag: String, extrude_group: ExtrudeGroup) -> Uuid getPreviousAdjacentEdge(tag: TagIdentifier, extrude_group: ExtrudeGroup) -> Uuid
``` ```
### Examples ### Examples
@ -37,22 +37,193 @@ const example = extrude(5, exampleSketch)
### Arguments ### Arguments
* `tag`: `String` (REQUIRED) * `tag`: `TagIdentifier` (REQUIRED)
```js
{
value: string,
}
```
* `extrude_group`: `ExtrudeGroup` - An extrude group is a collection of extrude surfaces. (REQUIRED) * `extrude_group`: `ExtrudeGroup` - An extrude group is a collection of extrude surfaces. (REQUIRED)
```js ```js
{ {
// The id of the extrusion end cap // The id of the extrusion end cap
endCapId: uuid, endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group. // The height of the extrude group.
height: number, height: number,
// The id of the extrude group. // The id of the extrude group.
id: uuid, id: uuid,
// The sketch group paths. // The sketch group.
sketchGroupValues: [{ 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. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, 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. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -64,8 +235,12 @@ const example = extrude(5, exampleSketch)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -73,8 +248,12 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -82,8 +261,12 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -93,8 +276,12 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -106,12 +293,17 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",
}], }],
},
// The id of the extrusion start cap // The id of the extrusion start cap
startCapId: uuid, startCapId: uuid,
// The extrude surfaces. // The extrude surfaces.
@ -120,10 +312,14 @@ const example = extrude(5, exampleSketch)
faceId: uuid, faceId: uuid,
// The id of the geometry. // The id of the geometry.
id: uuid, id: uuid,
// The name.
name: string,
// The source range. // The source range.
sourceRange: [number, number], sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane", type: "extrudePlane",
} | } |
{ {
@ -131,30 +327,16 @@ const example = extrude(5, exampleSketch)
faceId: uuid, faceId: uuid,
// The id of the geometry. // The id of the geometry.
id: uuid, id: uuid,
// The name.
name: string,
// The source range. // The source range.
sourceRange: [number, number], sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc", type: "extrudeArc",
}], }],
// 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,16 +48,182 @@ const part001 = startSketchOn('XY')
{ {
// The id of the extrusion end cap // The id of the extrusion end cap
endCapId: uuid, endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group. // The height of the extrude group.
height: number, height: number,
// The id of the extrude group. // The id of the extrude group.
id: uuid, id: uuid,
// The sketch group paths. // The sketch group.
sketchGroupValues: [{ 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. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, 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. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -69,8 +235,12 @@ const part001 = startSketchOn('XY')
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -78,8 +248,12 @@ const part001 = startSketchOn('XY')
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -87,8 +261,12 @@ const part001 = startSketchOn('XY')
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -98,8 +276,12 @@ const part001 = startSketchOn('XY')
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -111,12 +293,17 @@ const part001 = startSketchOn('XY')
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",
}], }],
},
// The id of the extrusion start cap // The id of the extrusion start cap
startCapId: uuid, startCapId: uuid,
// The extrude surfaces. // The extrude surfaces.
@ -125,10 +312,14 @@ const part001 = startSketchOn('XY')
faceId: uuid, faceId: uuid,
// The id of the geometry. // The id of the geometry.
id: uuid, id: uuid,
// The name.
name: string,
// The source range. // The source range.
sourceRange: [number, number], sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane", type: "extrudePlane",
} | } |
{ {
@ -136,30 +327,16 @@ const part001 = startSketchOn('XY')
faceId: uuid, faceId: uuid,
// The id of the geometry. // The id of the geometry.
id: uuid, id: uuid,
// The name.
name: string,
// The source range. // The source range.
sourceRange: [number, number], sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc", type: "extrudeArc",
}], }],
// 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,
},
} }
``` ```
@ -170,16 +347,182 @@ const part001 = startSketchOn('XY')
{ {
// The id of the extrusion end cap // The id of the extrusion end cap
endCapId: uuid, endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group. // The height of the extrude group.
height: number, height: number,
// The id of the extrude group. // The id of the extrude group.
id: uuid, id: uuid,
// The sketch group paths. // The sketch group.
sketchGroupValues: [{ 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. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, 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. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -191,8 +534,12 @@ const part001 = startSketchOn('XY')
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -200,8 +547,12 @@ const part001 = startSketchOn('XY')
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -209,8 +560,12 @@ const part001 = startSketchOn('XY')
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -220,8 +575,12 @@ const part001 = startSketchOn('XY')
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -233,12 +592,17 @@ const part001 = startSketchOn('XY')
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",
}], }],
},
// The id of the extrusion start cap // The id of the extrusion start cap
startCapId: uuid, startCapId: uuid,
// The extrude surfaces. // The extrude surfaces.
@ -247,10 +611,14 @@ const part001 = startSketchOn('XY')
faceId: uuid, faceId: uuid,
// The id of the geometry. // The id of the geometry.
id: uuid, id: uuid,
// The name.
name: string,
// The source range. // The source range.
sourceRange: [number, number], sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane", type: "extrudePlane",
} | } |
{ {
@ -258,30 +626,16 @@ const part001 = startSketchOn('XY')
faceId: uuid, faceId: uuid,
// The id of the geometry. // The id of the geometry.
id: uuid, id: uuid,
// The name.
name: string,
// The source range. // The source range.
sourceRange: [number, number], sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc", type: "extrudeArc",
}], }],
// 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

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

View File

@ -68,10 +68,181 @@ const example = extrude(5, exampleSketch)
}, },
} | } |
{ {
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: SketchSurface,
// The starting path.
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The paths in the sketch group.
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
} |
{
// arc's direction
ccw: string,
// the arc's center
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
// The x coordinate.
x: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
// The x coordinate.
x: number,
// The y coordinate.
y: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
},
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
value: [{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
},
// The id of the face. // The id of the face.
id: uuid, id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face", type: "face",
// The tag of the face. // The tag of the face.
value: string, value: string,
@ -98,8 +269,12 @@ const example = extrude(5, exampleSketch)
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -107,8 +282,12 @@ const example = extrude(5, exampleSketch)
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -120,8 +299,12 @@ const example = extrude(5, exampleSketch)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -129,8 +312,12 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -138,8 +325,12 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -149,8 +340,12 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -162,8 +357,12 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",

View File

@ -68,10 +68,181 @@ const example = extrude(5, exampleSketch)
}, },
} | } |
{ {
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: SketchSurface,
// The starting path.
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The paths in the sketch group.
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
} |
{
// arc's direction
ccw: string,
// the arc's center
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
// The x coordinate.
x: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
// The x coordinate.
x: number,
// The y coordinate.
y: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
},
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
value: [{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
},
// The id of the face. // The id of the face.
id: uuid, id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face", type: "face",
// The tag of the face. // The tag of the face.
value: string, value: string,
@ -98,8 +269,12 @@ const example = extrude(5, exampleSketch)
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -107,8 +282,12 @@ const example = extrude(5, exampleSketch)
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -120,8 +299,12 @@ const example = extrude(5, exampleSketch)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -129,8 +312,12 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -138,8 +325,12 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -149,8 +340,12 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -162,8 +357,12 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",

View File

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

View File

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

View File

@ -86,10 +86,181 @@ const example = extrude(1, exampleSketch)
}, },
} | } |
{ {
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: SketchSurface,
// The starting path.
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The paths in the sketch group.
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
} |
{
// arc's direction
ccw: string,
// the arc's center
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
// The x coordinate.
x: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
// The x coordinate.
x: number,
// The y coordinate.
y: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
},
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
value: [{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
},
// The id of the face. // The id of the face.
id: uuid, id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face", type: "face",
// The tag of the face. // The tag of the face.
value: string, value: string,
@ -116,8 +287,12 @@ const example = extrude(1, exampleSketch)
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -126,8 +301,12 @@ const example = extrude(1, exampleSketch)
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -139,8 +318,12 @@ const example = extrude(1, exampleSketch)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -148,8 +331,12 @@ const example = extrude(1, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -157,8 +344,12 @@ const example = extrude(1, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -168,8 +359,12 @@ const example = extrude(1, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -181,8 +376,12 @@ const example = extrude(1, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",

View File

@ -52,16 +52,182 @@ const example = extrude(-5, exampleSketch)
{ {
// The id of the extrusion end cap // The id of the extrusion end cap
endCapId: uuid, endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group. // The height of the extrude group.
height: number, height: number,
// The id of the extrude group. // The id of the extrude group.
id: uuid, id: uuid,
// The sketch group paths. // The sketch group.
sketchGroupValues: [{ 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. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, 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. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -73,8 +239,12 @@ const example = extrude(-5, exampleSketch)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -82,8 +252,12 @@ const example = extrude(-5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -91,8 +265,12 @@ const example = extrude(-5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -102,8 +280,12 @@ const example = extrude(-5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -115,12 +297,17 @@ const example = extrude(-5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",
}], }],
},
// The id of the extrusion start cap // The id of the extrusion start cap
startCapId: uuid, startCapId: uuid,
type: "extrudeGroup", type: "extrudeGroup",
@ -130,10 +317,14 @@ const example = extrude(-5, exampleSketch)
faceId: uuid, faceId: uuid,
// The id of the geometry. // The id of the geometry.
id: uuid, id: uuid,
// The name.
name: string,
// The source range. // The source range.
sourceRange: [number, number], sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane", type: "extrudePlane",
} | } |
{ {
@ -141,30 +332,16 @@ const example = extrude(-5, exampleSketch)
faceId: uuid, faceId: uuid,
// The id of the geometry. // The id of the geometry.
id: uuid, id: uuid,
// The name.
name: string,
// The source range. // The source range.
sourceRange: [number, number], sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc", type: "extrudeArc",
}], }],
// The x-axis of the extrude group base plane in the 3D space
xAxis: {
x: number,
y: number,
z: number,
},
// The y-axis of the extrude group base plane in the 3D space
yAxis: {
x: number,
y: number,
z: number,
},
// The z-axis of the extrude group base plane in the 3D space
zAxis: {
x: number,
y: number,
z: number,
},
} | } |
{ {
type: "extrudeGroups", type: "extrudeGroups",

View File

@ -79,10 +79,181 @@ const example = extrude(1, exampleSketch)
}, },
} | } |
{ {
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: SketchSurface,
// The starting path.
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The paths in the sketch group.
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
} |
{
// arc's direction
ccw: string,
// the arc's center
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
// The x coordinate.
x: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
// The x coordinate.
x: number,
// The y coordinate.
y: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
},
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
value: [{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
},
// The id of the face. // The id of the face.
id: uuid, id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face", type: "face",
// The tag of the face. // The tag of the face.
value: string, value: string,
@ -109,8 +280,12 @@ const example = extrude(1, exampleSketch)
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -119,8 +294,12 @@ const example = extrude(1, exampleSketch)
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -132,8 +311,12 @@ const example = extrude(1, exampleSketch)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -141,8 +324,12 @@ const example = extrude(1, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -150,8 +337,12 @@ const example = extrude(1, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -161,8 +352,12 @@ const example = extrude(1, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -174,8 +369,12 @@ const example = extrude(1, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",

View File

@ -50,16 +50,182 @@ const example = extrude(1, exampleSketch)
{ {
// The id of the extrusion end cap // The id of the extrusion end cap
endCapId: uuid, endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group. // The height of the extrude group.
height: number, height: number,
// The id of the extrude group. // The id of the extrude group.
id: uuid, id: uuid,
// The sketch group paths. // The sketch group.
sketchGroupValues: [{ 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. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, 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. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -71,8 +237,12 @@ const example = extrude(1, exampleSketch)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -80,8 +250,12 @@ const example = extrude(1, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -89,8 +263,12 @@ const example = extrude(1, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -100,8 +278,12 @@ const example = extrude(1, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -113,12 +295,17 @@ const example = extrude(1, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",
}], }],
},
// The id of the extrusion start cap // The id of the extrusion start cap
startCapId: uuid, startCapId: uuid,
type: "extrudeGroup", type: "extrudeGroup",
@ -128,10 +315,14 @@ const example = extrude(1, exampleSketch)
faceId: uuid, faceId: uuid,
// The id of the geometry. // The id of the geometry.
id: uuid, id: uuid,
// The name.
name: string,
// The source range. // The source range.
sourceRange: [number, number], sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane", type: "extrudePlane",
} | } |
{ {
@ -139,30 +330,16 @@ const example = extrude(1, exampleSketch)
faceId: uuid, faceId: uuid,
// The id of the geometry. // The id of the geometry.
id: uuid, id: uuid,
// The name.
name: string,
// The source range. // The source range.
sourceRange: [number, number], sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc", type: "extrudeArc",
}], }],
// The x-axis of the extrude group base plane in the 3D space
xAxis: {
x: number,
y: number,
z: number,
},
// The y-axis of the extrude group base plane in the 3D space
yAxis: {
x: number,
y: number,
z: number,
},
// The z-axis of the extrude group base plane in the 3D space
zAxis: {
x: number,
y: number,
z: number,
},
} | } |
{ {
type: "extrudeGroups", type: "extrudeGroups",

View File

@ -69,10 +69,181 @@ const sketch001 = startSketchOn('XY')
}, },
} | } |
{ {
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: SketchSurface,
// The starting path.
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The paths in the sketch group.
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
} |
{
// arc's direction
ccw: string,
// the arc's center
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
// The x coordinate.
x: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
// The x coordinate.
x: number,
// The y coordinate.
y: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
},
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
value: [{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
},
// The id of the face. // The id of the face.
id: uuid, id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face", type: "face",
// The tag of the face. // The tag of the face.
value: string, value: string,
@ -99,8 +270,12 @@ const sketch001 = startSketchOn('XY')
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -108,8 +283,12 @@ const sketch001 = startSketchOn('XY')
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -121,8 +300,12 @@ const sketch001 = startSketchOn('XY')
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -130,8 +313,12 @@ const sketch001 = startSketchOn('XY')
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -139,8 +326,12 @@ const sketch001 = startSketchOn('XY')
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -150,8 +341,12 @@ const sketch001 = startSketchOn('XY')
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -163,8 +358,12 @@ const sketch001 = startSketchOn('XY')
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",

View File

@ -64,10 +64,181 @@ const sketch001 = startSketchOn('XY')
}, },
} | } |
{ {
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: SketchSurface,
// The starting path.
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The paths in the sketch group.
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
} |
{
// arc's direction
ccw: string,
// the arc's center
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
// The x coordinate.
x: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
// The x coordinate.
x: number,
// The y coordinate.
y: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
},
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
value: [{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
},
// The id of the face. // The id of the face.
id: uuid, id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face", type: "face",
// The tag of the face. // The tag of the face.
value: string, value: string,
@ -94,8 +265,12 @@ const sketch001 = startSketchOn('XY')
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -103,8 +278,12 @@ const sketch001 = startSketchOn('XY')
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -116,8 +295,12 @@ const sketch001 = startSketchOn('XY')
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -125,8 +308,12 @@ const sketch001 = startSketchOn('XY')
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -134,8 +321,12 @@ const sketch001 = startSketchOn('XY')
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -145,8 +336,12 @@ const sketch001 = startSketchOn('XY')
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -158,8 +353,12 @@ const sketch001 = startSketchOn('XY')
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",

View File

@ -63,10 +63,181 @@ const sketch001 = startSketchOn('XY')
}, },
} | } |
{ {
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: SketchSurface,
// The starting path.
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The paths in the sketch group.
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
} |
{
// arc's direction
ccw: string,
// the arc's center
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
// The x coordinate.
x: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
// The x coordinate.
x: number,
// The y coordinate.
y: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
},
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
value: [{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
},
// The id of the face. // The id of the face.
id: uuid, id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face", type: "face",
// The tag of the face. // The tag of the face.
value: string, value: string,
@ -93,8 +264,12 @@ const sketch001 = startSketchOn('XY')
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -102,8 +277,12 @@ const sketch001 = startSketchOn('XY')
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -115,8 +294,12 @@ const sketch001 = startSketchOn('XY')
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -124,8 +307,12 @@ const sketch001 = startSketchOn('XY')
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -133,8 +320,12 @@ const sketch001 = startSketchOn('XY')
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -144,8 +335,12 @@ const sketch001 = startSketchOn('XY')
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -157,8 +352,12 @@ const sketch001 = startSketchOn('XY')
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",

View File

@ -156,7 +156,9 @@ const part001 = revolve({
}, },
} | } |
uuid | uuid |
string, {
value: string,
},
} }
``` ```
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED) * `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
@ -197,10 +199,181 @@ string,
}, },
} | } |
{ {
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: SketchSurface,
// The starting path.
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The paths in the sketch group.
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
} |
{
// arc's direction
ccw: string,
// the arc's center
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
// The x coordinate.
x: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
// The x coordinate.
x: number,
// The y coordinate.
y: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
},
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
value: [{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
},
// The id of the face. // The id of the face.
id: uuid, id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face", type: "face",
// The tag of the face. // The tag of the face.
value: string, value: string,
@ -227,8 +400,12 @@ string,
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -236,8 +413,12 @@ string,
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -249,8 +430,12 @@ string,
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -258,8 +443,12 @@ string,
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -267,8 +456,12 @@ string,
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -278,8 +471,12 @@ string,
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -291,8 +488,12 @@ string,
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",
@ -307,16 +508,182 @@ string,
{ {
// The id of the extrusion end cap // The id of the extrusion end cap
endCapId: uuid, endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group. // The height of the extrude group.
height: number, height: number,
// The id of the extrude group. // The id of the extrude group.
id: uuid, id: uuid,
// The sketch group paths. // The sketch group.
sketchGroupValues: [{ 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. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, 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. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -328,8 +695,12 @@ string,
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -337,8 +708,12 @@ string,
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -346,8 +721,12 @@ string,
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -357,8 +736,12 @@ string,
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -370,12 +753,17 @@ string,
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",
}], }],
},
// The id of the extrusion start cap // The id of the extrusion start cap
startCapId: uuid, startCapId: uuid,
// The extrude surfaces. // The extrude surfaces.
@ -384,10 +772,14 @@ string,
faceId: uuid, faceId: uuid,
// The id of the geometry. // The id of the geometry.
id: uuid, id: uuid,
// The name.
name: string,
// The source range. // The source range.
sourceRange: [number, number], sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane", type: "extrudePlane",
} | } |
{ {
@ -395,30 +787,16 @@ string,
faceId: uuid, faceId: uuid,
// The id of the geometry. // The id of the geometry.
id: uuid, id: uuid,
// The name.
name: string,
// The source range. // The source range.
sourceRange: [number, number], sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc", type: "extrudeArc",
}], }],
// 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 ```js
segAng(segment_name: string, sketch_group: SketchGroup) -> number segAng(segment_name: TagIdentifier, sketch_group: SketchGroup) -> number
``` ```
### Examples ### Examples
@ -32,7 +32,12 @@ const example = extrude(4, exampleSketch)
### Arguments ### Arguments
* `segment_name`: `string` (REQUIRED) * `segment_name`: `TagIdentifier` (REQUIRED)
```js
{
value: string,
}
```
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED) * `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
```js ```js
{ {
@ -71,10 +76,181 @@ const example = extrude(4, exampleSketch)
}, },
} | } |
{ {
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: SketchSurface,
// The starting path.
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The paths in the sketch group.
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
} |
{
// arc's direction
ccw: string,
// the arc's center
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
// The x coordinate.
x: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
// The x coordinate.
x: number,
// The y coordinate.
y: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
},
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
value: [{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
},
// The id of the face. // The id of the face.
id: uuid, id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face", type: "face",
// The tag of the face. // The tag of the face.
value: string, value: string,
@ -101,8 +277,12 @@ const example = extrude(4, exampleSketch)
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -110,8 +290,12 @@ const example = extrude(4, exampleSketch)
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -123,8 +307,12 @@ const example = extrude(4, exampleSketch)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -132,8 +320,12 @@ const example = extrude(4, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -141,8 +333,12 @@ const example = extrude(4, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -152,8 +348,12 @@ const example = extrude(4, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -165,8 +365,12 @@ const example = extrude(4, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",

View File

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

View File

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

View File

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

View File

@ -36,7 +36,9 @@ shell({ faces: ['end'], thickness: 0.25 }, firstSketch)
{ {
// The faces you want removed. // The faces you want removed.
faces: ["start" | "end" | faces: ["start" | "end" |
string], {
value: string,
}],
// The thickness of the shell. // The thickness of the shell.
thickness: number, thickness: number,
} }
@ -46,16 +48,182 @@ string],
{ {
// The id of the extrusion end cap // The id of the extrusion end cap
endCapId: uuid, endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group. // The height of the extrude group.
height: number, height: number,
// The id of the extrude group. // The id of the extrude group.
id: uuid, id: uuid,
// The sketch group paths. // The sketch group.
sketchGroupValues: [{ 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. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, 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. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -67,8 +235,12 @@ string],
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -76,8 +248,12 @@ string],
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -85,8 +261,12 @@ string],
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -96,8 +276,12 @@ string],
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -109,12 +293,17 @@ string],
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",
}], }],
},
// The id of the extrusion start cap // The id of the extrusion start cap
startCapId: uuid, startCapId: uuid,
// The extrude surfaces. // The extrude surfaces.
@ -123,10 +312,14 @@ string],
faceId: uuid, faceId: uuid,
// The id of the geometry. // The id of the geometry.
id: uuid, id: uuid,
// The name.
name: string,
// The source range. // The source range.
sourceRange: [number, number], sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane", type: "extrudePlane",
} | } |
{ {
@ -134,30 +327,16 @@ string],
faceId: uuid, faceId: uuid,
// The id of the geometry. // The id of the geometry.
id: uuid, id: uuid,
// The name.
name: string,
// The source range. // The source range.
sourceRange: [number, number], sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc", type: "extrudeArc",
}], }],
// 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,
},
} }
``` ```
@ -168,16 +347,182 @@ string],
{ {
// The id of the extrusion end cap // The id of the extrusion end cap
endCapId: uuid, endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group. // The height of the extrude group.
height: number, height: number,
// The id of the extrude group. // The id of the extrude group.
id: uuid, id: uuid,
// The sketch group paths. // The sketch group.
sketchGroupValues: [{ 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. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, 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. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -189,8 +534,12 @@ string],
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -198,8 +547,12 @@ string],
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -207,8 +560,12 @@ string],
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -218,8 +575,12 @@ string],
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -231,12 +592,17 @@ string],
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",
}], }],
},
// The id of the extrusion start cap // The id of the extrusion start cap
startCapId: uuid, startCapId: uuid,
// The extrude surfaces. // The extrude surfaces.
@ -245,10 +611,14 @@ string],
faceId: uuid, faceId: uuid,
// The id of the geometry. // The id of the geometry.
id: uuid, id: uuid,
// The name.
name: string,
// The source range. // The source range.
sourceRange: [number, number], sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane", type: "extrudePlane",
} | } |
{ {
@ -256,30 +626,16 @@ string],
faceId: uuid, faceId: uuid,
// The id of the geometry. // The id of the geometry.
id: uuid, id: uuid,
// The name.
name: string,
// The source range. // The source range.
sourceRange: [number, number], sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc", type: "extrudeArc",
}], }],
// 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 ```js
startProfileAt(to: [number], sketch_surface: SketchSurface, tag?: String) -> SketchGroup startProfileAt(to: [number], sketch_surface: SketchSurface, tag?: TagDeclarator) -> SketchGroup
``` ```
### Examples ### Examples
@ -90,10 +90,238 @@ const example = extrude(5, exampleSketch)
}, },
} | } |
{ {
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: {
// The id of the plane.
id: uuid,
// Origin of the plane.
origin: {
x: number,
y: number,
z: number,
},
type: "plane",
// Type for a plane.
value: "XY" | "XZ" | "YZ" | "Custom",
// What should the planes X axis be?
xAxis: {
x: number,
y: number,
z: number,
},
// What should the planes Y axis be?
yAxis: {
x: number,
y: number,
z: number,
},
// The z-axis (normal).
zAxis: {
x: number,
y: number,
z: number,
},
} |
{
// The extrude group the face is on.
extrudeGroup: ExtrudeGroup,
// The id of the face.
id: uuid,
type: "face",
// The tag of the face.
value: string,
// What should the faces X axis be?
xAxis: {
x: number,
y: number,
z: number,
},
// What should the faces Y axis be?
yAxis: {
x: number,
y: number,
z: number,
},
// The z-axis (normal).
zAxis: {
x: number,
y: number,
z: number,
},
},
// The starting path.
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The paths in the sketch group.
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
} |
{
// arc's direction
ccw: string,
// the arc's center
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
// The x coordinate.
x: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
// The x coordinate.
x: number,
// The y coordinate.
y: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
},
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
value: [{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
},
// The id of the face. // The id of the face.
id: uuid, id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face", type: "face",
// The tag of the face. // The tag of the face.
value: string, value: string,
@ -117,7 +345,14 @@ const example = extrude(5, exampleSketch)
}, },
} }
``` ```
* `tag`: `String` (OPTIONAL) * `tag`: `TagDeclarator` (OPTIONAL)
```js
{
end: number,
start: number,
value: string,
}
```
### Returns ### Returns
@ -159,10 +394,181 @@ const example = extrude(5, exampleSketch)
}, },
} | } |
{ {
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: SketchSurface,
// The starting path.
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The paths in the sketch group.
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
} |
{
// arc's direction
ccw: string,
// the arc's center
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
// The x coordinate.
x: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
// The x coordinate.
x: number,
// The y coordinate.
y: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
},
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
value: [{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
},
// The id of the face. // The id of the face.
id: uuid, id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face", type: "face",
// The tag of the face. // The tag of the face.
value: string, value: string,
@ -189,8 +595,12 @@ const example = extrude(5, exampleSketch)
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -198,8 +608,12 @@ const example = extrude(5, exampleSketch)
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -211,8 +625,12 @@ const example = extrude(5, exampleSketch)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -220,8 +638,12 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -229,8 +651,12 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -240,8 +666,12 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -253,8 +683,12 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",

View File

@ -94,10 +94,181 @@ const example = extrude(5, exampleSketch)
}, },
} | } |
{ {
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: SketchSurface,
// The starting path.
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The paths in the sketch group.
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
} |
{
// arc's direction
ccw: string,
// the arc's center
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
// The x coordinate.
x: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
// The x coordinate.
x: number,
// The y coordinate.
y: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
},
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
value: [{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
},
// The id of the face. // The id of the face.
id: uuid, id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face", type: "face",
// The tag of the face. // The tag of the face.
value: string, value: string,
@ -124,8 +295,12 @@ const example = extrude(5, exampleSketch)
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -133,8 +308,12 @@ const example = extrude(5, exampleSketch)
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -146,8 +325,12 @@ const example = extrude(5, exampleSketch)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -155,8 +338,12 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -164,8 +351,12 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -175,8 +366,12 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -188,8 +383,12 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",

View File

@ -9,7 +9,7 @@ Start a sketch on a specific plane or face.
```js ```js
startSketchOn(data: SketchData, tag?: SketchOnFaceTag) -> SketchSurface startSketchOn(data: SketchData, tag?: FaceTag) -> SketchSurface
``` ```
### Examples ### Examples
@ -163,16 +163,118 @@ const a1 = startSketchOn({
{ {
// The id of the extrusion end cap // The id of the extrusion end cap
endCapId: uuid, endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group. // The height of the extrude group.
height: number, height: number,
// The id of the extrude group. // The id of the extrude group.
id: uuid, id: uuid,
// The sketch group paths. // The sketch group.
sketchGroupValues: [{ 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. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, 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. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -184,8 +286,12 @@ const a1 = startSketchOn({
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -193,8 +299,12 @@ const a1 = startSketchOn({
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -202,8 +312,12 @@ const a1 = startSketchOn({
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -213,8 +327,12 @@ const a1 = startSketchOn({
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -226,12 +344,17 @@ const a1 = startSketchOn({
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",
}], }],
},
// The id of the extrusion start cap // The id of the extrusion start cap
startCapId: uuid, startCapId: uuid,
// The extrude surfaces. // The extrude surfaces.
@ -240,10 +363,14 @@ const a1 = startSketchOn({
faceId: uuid, faceId: uuid,
// The id of the geometry. // The id of the geometry.
id: uuid, id: uuid,
// The name.
name: string,
// The source range. // The source range.
sourceRange: [number, number], sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane", type: "extrudePlane",
} | } |
{ {
@ -251,36 +378,24 @@ const a1 = startSketchOn({
faceId: uuid, faceId: uuid,
// The id of the geometry. // The id of the geometry.
id: uuid, id: uuid,
// The name.
name: string,
// The source range. // The source range.
sourceRange: [number, number], sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc", type: "extrudeArc",
}], }],
// 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 ```js
"start" | "end" | "start" | "end" |
string {
value: string,
}
``` ```
### Returns ### Returns
@ -319,10 +434,238 @@ string
}, },
} | } |
{ {
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: {
// The id of the plane.
id: uuid,
// Origin of the plane.
origin: {
x: number,
y: number,
z: number,
},
type: "plane",
// Type for a plane.
value: "XY" | "XZ" | "YZ" | "Custom",
// What should the planes X axis be?
xAxis: {
x: number,
y: number,
z: number,
},
// What should the planes Y axis be?
yAxis: {
x: number,
y: number,
z: number,
},
// The z-axis (normal).
zAxis: {
x: number,
y: number,
z: number,
},
} |
{
// The extrude group the face is on.
extrudeGroup: ExtrudeGroup,
// The id of the face.
id: uuid,
type: "face",
// The tag of the face.
value: string,
// What should the faces X axis be?
xAxis: {
x: number,
y: number,
z: number,
},
// What should the faces Y axis be?
yAxis: {
x: number,
y: number,
z: number,
},
// The z-axis (normal).
zAxis: {
x: number,
y: number,
z: number,
},
},
// The starting path.
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The paths in the sketch group.
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
} |
{
// arc's direction
ccw: string,
// the arc's center
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
// The x coordinate.
x: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
// The x coordinate.
x: number,
// The y coordinate.
y: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
},
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
value: [{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
},
// The id of the face. // The id of the face.
id: uuid, id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face", type: "face",
// The tag of the face. // The tag of the face.
value: string, value: string,

File diff suppressed because it is too large Load Diff

View File

@ -9,7 +9,7 @@ Draw an arc.
```js ```js
tangentialArc(data: TangentialArcData, sketch_group: SketchGroup, tag?: String) -> SketchGroup tangentialArc(data: TangentialArcData, sketch_group: SketchGroup, tag?: TagDeclarator) -> SketchGroup
``` ```
### Examples ### Examples
@ -77,10 +77,181 @@ const example = extrude(10, exampleSketch)
}, },
} | } |
{ {
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: SketchSurface,
// The starting path.
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The paths in the sketch group.
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
} |
{
// arc's direction
ccw: string,
// the arc's center
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
// The x coordinate.
x: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
// The x coordinate.
x: number,
// The y coordinate.
y: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
},
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
value: [{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
},
// The id of the face. // The id of the face.
id: uuid, id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face", type: "face",
// The tag of the face. // The tag of the face.
value: string, value: string,
@ -107,8 +278,12 @@ const example = extrude(10, exampleSketch)
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -116,8 +291,12 @@ const example = extrude(10, exampleSketch)
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -129,8 +308,12 @@ const example = extrude(10, exampleSketch)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -138,8 +321,12 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -147,8 +334,12 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -158,8 +349,12 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -171,15 +366,26 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",
}], }],
} }
``` ```
* `tag`: `String` (OPTIONAL) * `tag`: `TagDeclarator` (OPTIONAL)
```js
{
end: number,
start: number,
value: string,
}
```
### Returns ### Returns
@ -221,10 +427,181 @@ const example = extrude(10, exampleSketch)
}, },
} | } |
{ {
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: SketchSurface,
// The starting path.
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The paths in the sketch group.
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
} |
{
// arc's direction
ccw: string,
// the arc's center
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
// The x coordinate.
x: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
// The x coordinate.
x: number,
// The y coordinate.
y: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
},
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
value: [{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
},
// The id of the face. // The id of the face.
id: uuid, id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face", type: "face",
// The tag of the face. // The tag of the face.
value: string, value: string,
@ -251,8 +628,12 @@ const example = extrude(10, exampleSketch)
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -260,8 +641,12 @@ const example = extrude(10, exampleSketch)
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -273,8 +658,12 @@ const example = extrude(10, exampleSketch)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -282,8 +671,12 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -291,8 +684,12 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -302,8 +699,12 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -315,8 +716,12 @@ const example = extrude(10, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",

View File

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

View File

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

View File

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

View File

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

View File

@ -9,7 +9,7 @@ Draw a line to a point on the y-axis.
```js ```js
yLineTo(to: number, sketch_group: SketchGroup, tag?: String) -> SketchGroup yLineTo(to: number, sketch_group: SketchGroup, tag?: TagDeclarator) -> SketchGroup
``` ```
### Examples ### Examples
@ -67,10 +67,181 @@ const example = extrude(5, exampleSketch)
}, },
} | } |
{ {
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: SketchSurface,
// The starting path.
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The paths in the sketch group.
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
} |
{
// arc's direction
ccw: string,
// the arc's center
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
// The x coordinate.
x: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
// The x coordinate.
x: number,
// The y coordinate.
y: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
},
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
value: [{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
},
// The id of the face. // The id of the face.
id: uuid, id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face", type: "face",
// The tag of the face. // The tag of the face.
value: string, value: string,
@ -97,8 +268,12 @@ const example = extrude(5, exampleSketch)
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -106,8 +281,12 @@ const example = extrude(5, exampleSketch)
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -119,8 +298,12 @@ const example = extrude(5, exampleSketch)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -128,8 +311,12 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -137,8 +324,12 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -148,8 +339,12 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -161,15 +356,26 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",
}], }],
} }
``` ```
* `tag`: `String` (OPTIONAL) * `tag`: `TagDeclarator` (OPTIONAL)
```js
{
end: number,
start: number,
value: string,
}
```
### Returns ### Returns
@ -211,10 +417,181 @@ const example = extrude(5, exampleSketch)
}, },
} | } |
{ {
// The extrude group the face is on.
extrudeGroup: {
// The id of the extrusion end cap
endCapId: uuid,
// Chamfers or fillets on this extrude group.
filletOrChamfers: [{
// The engine id of the edge to fillet.
edge_id: uuid,
// The id of the engine command that called this fillet.
id: uuid,
radius: number,
type: "fillet",
} |
{
// The engine id of the edge to chamfer.
edge_id: uuid,
// The id of the engine command that called this chamfer.
id: uuid,
length: number,
tag: {
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: SketchSurface,
// The starting path.
start: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The paths in the sketch group.
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
} |
{
// arc's direction
ccw: string,
// the arc's center
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
// The x coordinate.
x: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
// The x coordinate.
x: number,
// The y coordinate.
y: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
},
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
value: [{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
end: number,
start: number,
value: string,
},
type: "extrudeArc",
}],
},
// The id of the face. // The id of the face.
id: uuid, id: uuid,
// The original sketch group id of the object we are sketching on.
sketchGroupId: uuid,
type: "face", type: "face",
// The tag of the face. // The tag of the face.
value: string, value: string,
@ -241,8 +618,12 @@ const example = extrude(5, exampleSketch)
start: { start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
@ -250,8 +631,12 @@ const example = extrude(5, exampleSketch)
value: [{ value: [{
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "ToPoint", type: "ToPoint",
@ -263,8 +648,12 @@ const example = extrude(5, exampleSketch)
center: [number, number], center: [number, number],
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArcTo", type: "TangentialArcTo",
@ -272,8 +661,12 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "TangentialArc", type: "TangentialArc",
@ -281,8 +674,12 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Horizontal", type: "Horizontal",
@ -292,8 +689,12 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "AngledLineTo", type: "AngledLineTo",
@ -305,8 +706,12 @@ const example = extrude(5, exampleSketch)
{ {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The name of the path. // The tag of the path.
name: string, tag: {
end: number,
start: number,
value: string,
},
// The to point. // The to point.
to: [number, number], to: [number, number],
type: "Base", type: "Base",

File diff suppressed because it is too large Load Diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 42 KiB

After

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 49 KiB

After

Width:  |  Height:  |  Size: 47 KiB

View File

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

View File

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

View File

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

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" log = "0.4.21"
oauth2 = "4.4.2" oauth2 = "4.4.2"
serde_json = "1.0" 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-cli = { version = "2.0.0-beta.3" }
tauri-plugin-deep-link = { 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" } tauri-plugin-dialog = { version = "2.0.0-beta.6" }

View File

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

View File

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

View File

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

View File

@ -73,7 +73,7 @@ import {
changeSketchArguments, changeSketchArguments,
updateStartProfileAtArgs, updateStartProfileAtArgs,
} from 'lang/std/sketch' } from 'lang/std/sketch'
import { normaliseAngle, roundOff, throttle } from 'lib/utils' import { isOverlap, normaliseAngle, roundOff, throttle } from 'lib/utils'
import { import {
createArrayExpression, createArrayExpression,
createCallExpressionStdLib, createCallExpressionStdLib,
@ -83,6 +83,7 @@ import {
findUniqueName, findUniqueName,
} from 'lang/modifyAst' } from 'lang/modifyAst'
import { import {
Selections,
getEventForSegmentSelection, getEventForSegmentSelection,
sendSelectEventToEngine, sendSelectEventToEngine,
} from 'lib/selections' } from 'lib/selections'
@ -100,6 +101,7 @@ import {
updateRectangleSketch, updateRectangleSketch,
} from 'lib/rectangleTool' } from 'lib/rectangleTool'
import { getThemeColorForThreeJs } from 'lib/theme' import { getThemeColorForThreeJs } from 'lib/theme'
import { err, trap } from 'lib/trap'
type DraftSegment = 'line' | 'tangentialArcTo' type DraftSegment = 'line' | 'tangentialArcTo'
@ -300,6 +302,7 @@ export class SceneEntities {
position, position,
maybeModdedAst, maybeModdedAst,
draftExpressionsIndices, draftExpressionsIndices,
selectionRanges,
}: { }: {
sketchPathToNode: PathToNode sketchPathToNode: PathToNode
maybeModdedAst: Program maybeModdedAst: Program
@ -307,6 +310,7 @@ export class SceneEntities {
forward: [number, number, number] forward: [number, number, number]
up: [number, number, number] up: [number, number, number]
position?: [number, number, number] position?: [number, number, number]
selectionRanges?: Selections
}): Promise<{ }): Promise<{
truncatedAst: Program truncatedAst: Program
programMemoryOverride: ProgramMemory programMemoryOverride: ProgramMemory
@ -315,8 +319,14 @@ export class SceneEntities {
}> { }> {
this.createIntersectionPlane() this.createIntersectionPlane()
const prepared = this.prepareTruncatedMemoryAndAst(
sketchPathToNode || [],
maybeModdedAst
)
if (err(prepared)) return Promise.reject(prepared)
const { truncatedAst, programMemoryOverride, variableDeclarationName } = const { truncatedAst, programMemoryOverride, variableDeclarationName } =
this.prepareTruncatedMemoryAndAst(sketchPathToNode || [], maybeModdedAst) prepared
const { programMemory } = await executeAst({ const { programMemory } = await executeAst({
ast: truncatedAst, ast: truncatedAst,
useFakeExecutor: true, useFakeExecutor: true,
@ -328,6 +338,8 @@ export class SceneEntities {
ast: maybeModdedAst, ast: maybeModdedAst,
programMemory, programMemory,
}) })
if (err(sketchGroup)) return Promise.reject(sketchGroup)
if (!Array.isArray(sketchGroup?.value)) if (!Array.isArray(sketchGroup?.value))
return { return {
truncatedAst, truncatedAst,
@ -396,12 +408,21 @@ export class SceneEntities {
draftExpressionsIndices && draftExpressionsIndices &&
index <= draftExpressionsIndices.end && index <= draftExpressionsIndices.end &&
index >= draftExpressionsIndices.start index >= draftExpressionsIndices.start
const isSelected = selectionRanges?.codeBasedSelections.some(
(selection) => {
return isOverlap(selection.range, segment.__geoMeta.sourceRange)
}
)
let seg let seg
const callExpName = getNodeFromPath<CallExpression>( const _node1 = getNodeFromPath<CallExpression>(
maybeModdedAst, maybeModdedAst,
segPathToNode, segPathToNode,
'CallExpression' 'CallExpression'
)?.node?.callee?.name )
if (err(_node1)) return
const callExpName = _node1.node?.callee?.name
if (segment.type === 'TangentialArcTo') { if (segment.type === 'TangentialArcTo') {
seg = tangentialArcToSegment({ seg = tangentialArcToSegment({
prevSegment: sketchGroup.value[index - 1], prevSegment: sketchGroup.value[index - 1],
@ -413,6 +434,7 @@ export class SceneEntities {
scale: factor, scale: factor,
texture: sceneInfra.extraSegmentTexture, texture: sceneInfra.extraSegmentTexture,
theme: sceneInfra._theme, theme: sceneInfra._theme,
isSelected,
}) })
callbacks.push( callbacks.push(
this.updateTangentialArcToSegment({ this.updateTangentialArcToSegment({
@ -434,6 +456,7 @@ export class SceneEntities {
callExpName, callExpName,
texture: sceneInfra.extraSegmentTexture, texture: sceneInfra.extraSegmentTexture,
theme: sceneInfra._theme, theme: sceneInfra._theme,
isSelected,
}) })
callbacks.push( callbacks.push(
this.updateStraightSegment({ this.updateStraightSegment({
@ -478,12 +501,14 @@ export class SceneEntities {
} }
updateAstAndRejigSketch = async ( updateAstAndRejigSketch = async (
sketchPathToNode: PathToNode, sketchPathToNode: PathToNode,
modifiedAst: Program, modifiedAst: Program | Error,
forward: [number, number, number], forward: [number, number, number],
up: [number, number, number], up: [number, number, number],
origin: [number, number, number] origin: [number, number, number]
) => { ) => {
await kclManager.updateAst(modifiedAst, false) if (err(modifiedAst)) return modifiedAst
const nextAst = await kclManager.updateAst(modifiedAst, false)
await this.tearDownSketch({ removeAxis: false }) await this.tearDownSketch({ removeAxis: false })
sceneInfra.resetMouseListeners() sceneInfra.resetMouseListeners()
await this.setupSketch({ await this.setupSketch({
@ -491,7 +516,7 @@ export class SceneEntities {
forward, forward,
up, up,
position: origin, position: origin,
maybeModdedAst: kclManager.ast, maybeModdedAst: nextAst.newAst,
}) })
this.setupSketchIdleCallbacks({ this.setupSketchIdleCallbacks({
forward, forward,
@ -499,6 +524,7 @@ export class SceneEntities {
position: origin, position: origin,
pathToNode: sketchPathToNode, pathToNode: sketchPathToNode,
}) })
return nextAst
} }
setUpDraftSegment = async ( setUpDraftSegment = async (
sketchPathToNode: PathToNode, sketchPathToNode: PathToNode,
@ -510,12 +536,15 @@ export class SceneEntities {
) => { ) => {
const _ast = JSON.parse(JSON.stringify(kclManager.ast)) const _ast = JSON.parse(JSON.stringify(kclManager.ast))
const _node1 = getNodeFromPath<VariableDeclaration>(
_ast,
sketchPathToNode || [],
'VariableDeclaration'
)
if (trap(_node1)) return Promise.reject(_node1)
const variableDeclarationName = const variableDeclarationName =
getNodeFromPath<VariableDeclaration>( _node1.node?.declarations?.[0]?.id?.name || ''
_ast,
sketchPathToNode || [],
'VariableDeclaration'
)?.node?.declarations?.[0]?.id?.name || ''
const sg = kclManager.programMemory.root[ const sg = kclManager.programMemory.root[
variableDeclarationName variableDeclarationName
] as SketchGroup ] as SketchGroup
@ -531,7 +560,9 @@ export class SceneEntities {
fnName: segmentName, fnName: segmentName,
pathToNode: sketchPathToNode, pathToNode: sketchPathToNode,
}) })
if (trap(mod)) return Promise.reject(mod)
const modifiedAst = parse(recast(mod.modifiedAst)) const modifiedAst = parse(recast(mod.modifiedAst))
if (trap(modifiedAst)) return Promise.reject(modifiedAst)
const draftExpressionsIndices = { start: index, end: index } const draftExpressionsIndices = { start: index, end: index }
@ -582,14 +613,16 @@ export class SceneEntities {
), ),
], ],
}) })
if (trap(modifiedAst)) return Promise.reject(modifiedAst)
modifiedAst = addCloseToPipe({ modifiedAst = addCloseToPipe({
node: modifiedAst, node: modifiedAst,
programMemory: kclManager.programMemory, programMemory: kclManager.programMemory,
pathToNode: sketchPathToNode, pathToNode: sketchPathToNode,
}) })
if (trap(modifiedAst)) return Promise.reject(modifiedAst)
} else if (intersection2d) { } else if (intersection2d) {
const lastSegment = sketchGroup.value.slice(-1)[0] const lastSegment = sketchGroup.value.slice(-1)[0]
modifiedAst = addNewSketchLn({ const tmp = addNewSketchLn({
node: kclManager.ast, node: kclManager.ast,
programMemory: kclManager.programMemory, programMemory: kclManager.programMemory,
to: [intersection2d.x, intersection2d.y], to: [intersection2d.x, intersection2d.y],
@ -599,7 +632,10 @@ export class SceneEntities {
? 'tangentialArcTo' ? 'tangentialArcTo'
: 'line', : 'line',
pathToNode: sketchPathToNode, pathToNode: sketchPathToNode,
}).modifiedAst })
if (trap(tmp)) return Promise.reject(tmp)
modifiedAst = tmp.modifiedAst
if (trap(modifiedAst)) return Promise.reject(modifiedAst)
} else { } else {
// return early as we didn't modify the ast // return early as we didn't modify the ast
return return
@ -658,12 +694,14 @@ export class SceneEntities {
) => { ) => {
let _ast = JSON.parse(JSON.stringify(kclManager.ast)) let _ast = JSON.parse(JSON.stringify(kclManager.ast))
const _node1 = getNodeFromPath<VariableDeclaration>(
_ast,
sketchPathToNode || [],
'VariableDeclaration'
)
if (trap(_node1)) return Promise.reject(_node1)
const variableDeclarationName = const variableDeclarationName =
getNodeFromPath<VariableDeclaration>( _node1.node?.declarations?.[0]?.id?.name || ''
_ast,
sketchPathToNode || [],
'VariableDeclaration'
)?.node?.declarations?.[0]?.id?.name || ''
const tags: [string, string, string] = [ const tags: [string, string, string] = [
findUniqueName(_ast, 'rectangleSegmentA'), findUniqueName(_ast, 'rectangleSegmentA'),
@ -671,11 +709,13 @@ export class SceneEntities {
findUniqueName(_ast, 'rectangleSegmentC'), findUniqueName(_ast, 'rectangleSegmentC'),
] ]
const startSketchOn = getNodeFromPath<VariableDeclaration>( const _node2 = getNodeFromPath<VariableDeclaration>(
_ast, _ast,
sketchPathToNode || [], sketchPathToNode || [],
'VariableDeclaration' 'VariableDeclaration'
)?.node?.declarations )
if (trap(_node2)) return Promise.reject(_node2)
const startSketchOn = _node2.node?.declarations
const startSketchOnInit = startSketchOn?.[0]?.init const startSketchOnInit = startSketchOn?.[0]?.init
startSketchOn[0].init = createPipeExpression([ startSketchOn[0].init = createPipeExpression([
@ -700,11 +740,13 @@ export class SceneEntities {
const pathToNodeTwo = JSON.parse(JSON.stringify(sketchPathToNode)) const pathToNodeTwo = JSON.parse(JSON.stringify(sketchPathToNode))
pathToNodeTwo[1][0] = 0 pathToNodeTwo[1][0] = 0
const sketchInit = getNodeFromPath<VariableDeclaration>( const _node = getNodeFromPath<VariableDeclaration>(
truncatedAst, truncatedAst,
pathToNodeTwo || [], pathToNodeTwo || [],
'VariableDeclaration' 'VariableDeclaration'
)?.node?.declarations?.[0]?.init )
if (trap(_node)) return Promise.reject(_node)
const sketchInit = _node.node?.declarations?.[0]?.init
const x = (args.intersectionPoint.twoD.x || 0) - rectangleOrigin[0] const x = (args.intersectionPoint.twoD.x || 0) - rectangleOrigin[0]
const y = (args.intersectionPoint.twoD.y || 0) - rectangleOrigin[1] const y = (args.intersectionPoint.twoD.y || 0) - rectangleOrigin[1]
@ -746,11 +788,13 @@ export class SceneEntities {
const x = roundOff((cornerPoint.x || 0) - rectangleOrigin[0]) const x = roundOff((cornerPoint.x || 0) - rectangleOrigin[0])
const y = roundOff((cornerPoint.y || 0) - rectangleOrigin[1]) const y = roundOff((cornerPoint.y || 0) - rectangleOrigin[1])
const sketchInit = getNodeFromPath<VariableDeclaration>( const _node = getNodeFromPath<VariableDeclaration>(
_ast, _ast,
sketchPathToNode || [], sketchPathToNode || [],
'VariableDeclaration' 'VariableDeclaration'
)?.node?.declarations?.[0]?.init )
if (trap(_node)) return Promise.reject(_node)
const sketchInit = _node.node?.declarations?.[0]?.init
if (sketchInit.type === 'PipeExpression') { if (sketchInit.type === 'PipeExpression') {
updateRectangleSketch(sketchInit, x, y, tags[0]) updateRectangleSketch(sketchInit, x, y, tags[0])
@ -846,6 +890,7 @@ export class SceneEntities {
ast: kclManager.ast, ast: kclManager.ast,
programMemory: kclManager.programMemory, programMemory: kclManager.programMemory,
}) })
if (trap(sketchGroup)) return
const pipeIndex = pathToNode[pathToNodeIndex + 1][0] as number const pipeIndex = pathToNode[pathToNodeIndex + 1][0] as number
if (addingNewSegmentStatus === 'nothing') { if (addingNewSegmentStatus === 'nothing') {
@ -863,6 +908,8 @@ export class SceneEntities {
spliceBetween: true, spliceBetween: true,
}) })
addingNewSegmentStatus = 'pending' addingNewSegmentStatus = 'pending'
if (trap(mod)) return
await kclManager.executeAstMock(mod.modifiedAst) await kclManager.executeAstMock(mod.modifiedAst)
await this.tearDownSketch({ removeAxis: false }) await this.tearDownSketch({ removeAxis: false })
this.setupSketch({ this.setupSketch({
@ -971,17 +1018,22 @@ export class SceneEntities {
const to: [number, number] = [intersection2d.x, intersection2d.y] const to: [number, number] = [intersection2d.x, intersection2d.y]
let modifiedAst = draftInfo ? draftInfo.truncatedAst : { ...kclManager.ast } let modifiedAst = draftInfo ? draftInfo.truncatedAst : { ...kclManager.ast }
const node = getNodeFromPath<CallExpression>( const _node = getNodeFromPath<CallExpression>(
modifiedAst, modifiedAst,
pathToNode, pathToNode,
'CallExpression' 'CallExpression'
).node )
if (trap(_node)) return
const node = _node.node
if (node.type !== 'CallExpression') return if (node.type !== 'CallExpression') return
let modded: { let modded:
modifiedAst: Program | {
pathToNode: PathToNode modifiedAst: Program
} pathToNode: PathToNode
}
| Error
if (group.name === PROFILE_START) { if (group.name === PROFILE_START) {
modded = updateStartProfileAtArgs({ modded = updateStartProfileAtArgs({
node: modifiedAst, node: modifiedAst,
@ -999,14 +1051,18 @@ export class SceneEntities {
from from
) )
} }
if (trap(modded)) return
modifiedAst = modded.modifiedAst modifiedAst = modded.modifiedAst
const info = draftInfo
? draftInfo
: this.prepareTruncatedMemoryAndAst(pathToNode || [])
if (trap(info, { suppress: true })) return
const { truncatedAst, programMemoryOverride, variableDeclarationName } = const { truncatedAst, programMemoryOverride, variableDeclarationName } =
draftInfo info
? draftInfo
: this.prepareTruncatedMemoryAndAst(sketchPathToNode || [])
;(async () => { ;(async () => {
const code = recast(modifiedAst) const code = recast(modifiedAst)
if (trap(code)) return
if (!draftInfo) if (!draftInfo)
// don't want to mod the user's code yet as they have't committed to the change yet // don't want to mod the user's code yet as they have't committed to the change yet
// plus this would be the truncated ast being recast, it would be wrong // plus this would be the truncated ast being recast, it would be wrong
@ -1388,11 +1444,12 @@ export class SceneEntities {
}, },
onClick: async (args) => { onClick: async (args) => {
const { streamDimensions } = useStore.getState() const { streamDimensions } = useStore.getState()
const { entity_id, ...rest } = await sendSelectEventToEngine( const { entity_id } = await sendSelectEventToEngine(
args?.mouseEvent, args?.mouseEvent,
document.getElementById('video-stream') as HTMLVideoElement, document.getElementById('video-stream') as HTMLVideoElement,
streamDimensions streamDimensions
) )
let _entity_id = entity_id let _entity_id = entity_id
if (!_entity_id) return if (!_entity_id) return
if ( if (
@ -1532,11 +1589,14 @@ export class SceneEntities {
]) ])
if (parent?.userData?.pathToNode) { if (parent?.userData?.pathToNode) {
const updatedAst = parse(recast(kclManager.ast)) const updatedAst = parse(recast(kclManager.ast))
const node = getNodeFromPath<CallExpression>( if (trap(updatedAst)) return
const _node = getNodeFromPath<CallExpression>(
updatedAst, updatedAst,
parent.userData.pathToNode, parent.userData.pathToNode,
'CallExpression' 'CallExpression'
).node )
if (trap(_node, { suppress: true })) return
const node = _node.node
editorManager.setHighlightRange([node.start, node.end]) editorManager.setHighlightRange([node.start, node.end])
const yellow = 0xffff00 const yellow = 0xffff00
colorSegment(selected, yellow) colorSegment(selected, yellow)
@ -1651,20 +1711,23 @@ function prepareTruncatedMemoryAndAst(
ast: Program, ast: Program,
programMemory: ProgramMemory, programMemory: ProgramMemory,
draftSegment?: DraftSegment draftSegment?: DraftSegment
): { ):
truncatedAst: Program | {
programMemoryOverride: ProgramMemory truncatedAst: Program
variableDeclarationName: string programMemoryOverride: ProgramMemory
} { variableDeclarationName: string
}
| Error {
const bodyIndex = Number(sketchPathToNode?.[1]?.[0]) || 0 const bodyIndex = Number(sketchPathToNode?.[1]?.[0]) || 0
const _ast = JSON.parse(JSON.stringify(ast)) const _ast = JSON.parse(JSON.stringify(ast))
const variableDeclarationName = const _node = getNodeFromPath<VariableDeclaration>(
getNodeFromPath<VariableDeclaration>( _ast,
_ast, sketchPathToNode || [],
sketchPathToNode || [], 'VariableDeclaration'
'VariableDeclaration' )
)?.node?.declarations?.[0]?.id?.name || '' if (err(_node)) return _node
const variableDeclarationName = _node.node?.declarations?.[0]?.id?.name || ''
const lastSeg = ( const lastSeg = (
programMemory.root[variableDeclarationName] as SketchGroup programMemory.root[variableDeclarationName] as SketchGroup
).value.slice(-1)[0] ).value.slice(-1)[0]
@ -1692,6 +1755,8 @@ function prepareTruncatedMemoryAndAst(
// update source ranges to section we just added. // update source ranges to section we just added.
// hacks like this wouldn't be needed if the AST put pathToNode info in memory/sketchGroup segments // hacks like this wouldn't be needed if the AST put pathToNode info in memory/sketchGroup segments
const updatedSrcRangeAst = parse(recast(_ast)) // get source ranges correct since unfortunately we still rely on them const updatedSrcRangeAst = parse(recast(_ast)) // get source ranges correct since unfortunately we still rely on them
if (err(updatedSrcRangeAst)) return updatedSrcRangeAst
const lastPipeItem = ( const lastPipeItem = (
(updatedSrcRangeAst.body[bodyIndex] as VariableDeclaration) (updatedSrcRangeAst.body[bodyIndex] as VariableDeclaration)
.declarations[0].init as PipeExpression .declarations[0].init as PipeExpression
@ -1715,7 +1780,9 @@ function prepareTruncatedMemoryAndAst(
..._ast, ..._ast,
body: [JSON.parse(JSON.stringify(_ast.body[bodyIndex]))], body: [JSON.parse(JSON.stringify(_ast.body[bodyIndex]))],
} }
const programMemoryOverride: ProgramMemory = programMemoryInit() const programMemoryOverride = programMemoryInit()
if (err(programMemoryOverride)) return programMemoryOverride
for (let i = 0; i < bodyIndex; i++) { for (let i = 0; i < bodyIndex; i++) {
const node = _ast.body[i] const node = _ast.body[i]
if (node.type !== 'VariableDeclaration') { if (node.type !== 'VariableDeclaration') {
@ -1756,13 +1823,19 @@ export function sketchGroupFromPathToNode({
pathToNode: PathToNode pathToNode: PathToNode
ast: Program ast: Program
programMemory: ProgramMemory programMemory: ProgramMemory
}): SketchGroup { }): SketchGroup | Error {
const varDec = getNodeFromPath<VariableDeclarator>( const _varDec = getNodeFromPath<VariableDeclarator>(
kclManager.ast, kclManager.ast,
pathToNode, pathToNode,
'VariableDeclarator' 'VariableDeclarator'
).node )
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) { function colorSegment(object: any, color: number) {
@ -1792,13 +1865,15 @@ function colorSegment(object: any, color: number) {
export function getSketchQuaternion( export function getSketchQuaternion(
sketchPathToNode: PathToNode, sketchPathToNode: PathToNode,
sketchNormalBackUp: [number, number, number] | null sketchNormalBackUp: [number, number, number] | null
): Quaternion { ): Quaternion | Error {
const sketchGroup = sketchGroupFromPathToNode({ const sketchGroup = sketchGroupFromPathToNode({
pathToNode: sketchPathToNode, pathToNode: sketchPathToNode,
ast: kclManager.ast, ast: kclManager.ast,
programMemory: kclManager.programMemory, programMemory: kclManager.programMemory,
}) })
if (err(sketchGroup)) return sketchGroup
const zAxis = sketchGroup?.on.zAxis || sketchNormalBackUp const zAxis = sketchGroup?.on.zAxis || sketchNormalBackUp
return getQuaternionFromZAxis(massageFormats(zAxis)) return getQuaternionFromZAxis(massageFormats(zAxis))
} }
export async function getSketchOrientationDetails( export async function getSketchOrientationDetails(
@ -1812,6 +1887,8 @@ export async function getSketchOrientationDetails(
ast: kclManager.ast, ast: kclManager.ast,
programMemory: kclManager.programMemory, programMemory: kclManager.programMemory,
}) })
if (err(sketchGroup)) return Promise.reject(sketchGroup)
if (sketchGroup.on.type === 'plane') { if (sketchGroup.on.type === 'plane') {
const zAxis = sketchGroup?.on.zAxis const zAxis = sketchGroup?.on.zAxis
return { return {
@ -1829,11 +1906,12 @@ export async function getSketchOrientationDetails(
}, },
} }
} }
if (sketchGroup.on.type === 'face') { if (sketchGroup.on.type === 'face') {
const faceInfo = await getFaceDetails(sketchGroup.on.id) const faceInfo = await getFaceDetails(sketchGroup.on.id)
if (!faceInfo?.origin || !faceInfo?.z_axis || !faceInfo?.y_axis) if (!faceInfo?.origin || !faceInfo?.z_axis || !faceInfo?.y_axis)
throw new Error('faceInfo') return Promise.reject('face info')
const { z_axis, y_axis, origin } = faceInfo const { z_axis, y_axis, origin } = faceInfo
const quaternion = quaternionFromUpNForward( const quaternion = quaternionFromUpNForward(
new Vector3(y_axis.x, y_axis.y, y_axis.z), new Vector3(y_axis.x, y_axis.y, y_axis.z),
@ -1850,7 +1928,7 @@ export async function getSketchOrientationDetails(
}, },
} }
} }
throw new Error( return Promise.reject(
'sketchGroup.on.type not recognized, has a new type been added?' 'sketchGroup.on.type not recognized, has a new type been added?'
) )
} }

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -6,6 +6,7 @@ import {
unregisterServerCapability, unregisterServerCapability,
} from './server-capability-registration' } from './server-capability-registration'
import { Codec, FromServer, IntoServer } from './codec' import { Codec, FromServer, IntoServer } from './codec'
import { err } from 'lib/trap'
const client_capabilities: LSP.ClientCapabilities = { const client_capabilities: LSP.ClientCapabilities = {
textDocument: { textDocument: {
@ -119,10 +120,12 @@ export default class Client extends jsrpc.JSONRPCServerAndClient {
// Register a server capability. // Register a server capability.
params.registrations.forEach( params.registrations.forEach(
(capabilityRegistration: LSP.Registration) => { (capabilityRegistration: LSP.Registration) => {
this.serverCapabilities = registerServerCapability( const caps = registerServerCapability(
this.serverCapabilities, this.serverCapabilities,
capabilityRegistration 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. // Unregister a server capability.
params.unregisterations.forEach( params.unregisterations.forEach(
(capabilityUnregistration: LSP.Unregistration) => { (capabilityUnregistration: LSP.Unregistration) => {
this.serverCapabilities = unregisterServerCapability( const caps = unregisterServerCapability(
this.serverCapabilities, this.serverCapabilities,
capabilityUnregistration 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 // eslint-disable-next-line @typescript-eslint/no-namespace
export namespace FromServer { export namespace FromServer {
export function create(): FromServer { export function create(): FromServer | Error {
return new StreamDemuxer() // 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 // try to parse the content-length from the headers
const length = parseInt(match[1]) 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 // slice the headers since we now have the content length
buffer = buffer.slice(match[0].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, result.data,
this.getServerCapabilities().semanticTokensProvider this.getServerCapabilities().semanticTokensProvider
) )

View File

@ -22,16 +22,16 @@ export class SemanticToken {
} }
} }
export function deserializeTokens( export async function deserializeTokens(
data: number[], data: number[],
semanticTokensProvider?: LSP.SemanticTokensOptions semanticTokensProvider?: LSP.SemanticTokensOptions
): SemanticToken[] { ): Promise<SemanticToken[]> {
if (!semanticTokensProvider) { if (!semanticTokensProvider) {
return [] return []
} }
// Check if data length is divisible by 5 // Check if data length is divisible by 5
if (data.length % 5 !== 0) { 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 = [] const tokens = []

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -23,7 +23,7 @@ const mySketch001 = startSketchOn('XY')
start: { start: {
to: [0, 0], to: [0, 0],
from: [0, 0], from: [0, 0],
name: '', tag: null,
__geoMeta: { __geoMeta: {
id: expect.any(String), id: expect.any(String),
sourceRange: [46, 71], sourceRange: [46, 71],
@ -32,7 +32,7 @@ const mySketch001 = startSketchOn('XY')
value: [ value: [
{ {
type: 'ToPoint', type: 'ToPoint',
name: '', tag: null,
to: [-1.59, -1.54], to: [-1.59, -1.54],
from: [0, 0], from: [0, 0],
__geoMeta: { __geoMeta: {
@ -44,7 +44,7 @@ const mySketch001 = startSketchOn('XY')
type: 'ToPoint', type: 'ToPoint',
to: [0.46, -5.82], to: [0.46, -5.82],
from: [-1.59, -1.54], from: [-1.59, -1.54],
name: '', tag: null,
__geoMeta: { __geoMeta: {
sourceRange: [108, 132], sourceRange: [108, 132],
id: expect.any(String), id: expect.any(String),
@ -74,44 +74,48 @@ const mySketch001 = startSketchOn('XY')
{ {
type: 'extrudePlane', type: 'extrudePlane',
faceId: expect.any(String), faceId: expect.any(String),
name: '', tag: null,
id: expect.any(String), id: expect.any(String),
sourceRange: [77, 102], sourceRange: [77, 102],
}, },
{ {
type: 'extrudePlane', type: 'extrudePlane',
faceId: expect.any(String), faceId: expect.any(String),
name: '', tag: null,
id: expect.any(String), id: expect.any(String),
sourceRange: [108, 132], sourceRange: [108, 132],
}, },
], ],
sketchGroupValues: [ sketchGroup: {
{ id: expect.any(String),
type: 'ToPoint', __meta: expect.any(Array),
from: [0, 0], on: expect.any(Object),
to: [-1.59, -1.54], start: expect.any(Object),
name: '', type: 'SketchGroup',
__geoMeta: { value: [
id: expect.any(String), {
sourceRange: [77, 102], type: 'ToPoint',
from: [0, 0],
to: [-1.59, -1.54],
tag: null,
__geoMeta: {
id: expect.any(String),
sourceRange: [77, 102],
},
}, },
}, {
{ type: 'ToPoint',
type: 'ToPoint', from: [-1.59, -1.54],
from: [-1.59, -1.54], to: [0.46, -5.82],
to: [0.46, -5.82], tag: null,
name: '', __geoMeta: {
__geoMeta: { id: expect.any(String),
id: expect.any(String), sourceRange: [108, 132],
sourceRange: [108, 132], },
}, },
}, ],
], },
height: 2, height: 2,
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), startCapId: expect.any(String),
endCapId: expect.any(String), endCapId: expect.any(String),
__meta: [{ sourceRange: [46, 71] }], __meta: [{ sourceRange: [46, 71] }],
@ -151,61 +155,75 @@ const sk2 = startSketchOn('XY')
{ {
type: 'extrudePlane', type: 'extrudePlane',
faceId: expect.any(String), faceId: expect.any(String),
name: '', tag: null,
id: expect.any(String), id: expect.any(String),
sourceRange: [69, 89], sourceRange: [69, 89],
}, },
{ {
type: 'extrudePlane', type: 'extrudePlane',
faceId: expect.any(String), faceId: expect.any(String),
name: 'p', tag: {
end: 117,
start: 114,
type: 'TagDeclarator',
value: 'p',
},
id: expect.any(String), id: expect.any(String),
sourceRange: [95, 118], sourceRange: [95, 118],
}, },
{ {
type: 'extrudePlane', type: 'extrudePlane',
faceId: expect.any(String), faceId: expect.any(String),
name: '', tag: null,
id: expect.any(String), id: expect.any(String),
sourceRange: [124, 143], sourceRange: [124, 143],
}, },
], ],
sketchGroupValues: [ sketchGroup: {
{ id: expect.any(String),
type: 'ToPoint', __meta: expect.any(Array),
from: [0, 0], on: expect.any(Object),
to: [-2.5, 0], start: expect.any(Object),
name: '', type: 'SketchGroup',
__geoMeta: { value: [
id: expect.any(String), {
sourceRange: [69, 89], type: 'ToPoint',
from: [0, 0],
to: [-2.5, 0],
tag: null,
__geoMeta: {
id: expect.any(String),
sourceRange: [69, 89],
},
}, },
}, {
{ type: 'ToPoint',
type: 'ToPoint', from: [-2.5, 0],
from: [-2.5, 0], to: [0, 10],
to: [0, 10], tag: {
name: 'p', end: 117,
__geoMeta: { start: 114,
id: expect.any(String), type: 'TagDeclarator',
sourceRange: [95, 118], value: 'p',
},
__geoMeta: {
id: expect.any(String),
sourceRange: [95, 118],
},
}, },
}, {
{ type: 'ToPoint',
type: 'ToPoint', from: [0, 10],
from: [0, 10], to: [2.5, 0],
to: [2.5, 0], tag: null,
name: '', __geoMeta: {
__geoMeta: { id: expect.any(String),
id: expect.any(String), sourceRange: [124, 143],
sourceRange: [124, 143], },
}, },
}, ],
], },
height: 2, height: 2,
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), startCapId: expect.any(String),
endCapId: expect.any(String), endCapId: expect.any(String),
__meta: [{ sourceRange: [38, 63] }], __meta: [{ sourceRange: [38, 63] }],
@ -217,61 +235,75 @@ const sk2 = startSketchOn('XY')
{ {
type: 'extrudePlane', type: 'extrudePlane',
faceId: expect.any(String), faceId: expect.any(String),
name: '', tag: null,
id: expect.any(String), id: expect.any(String),
sourceRange: [374, 394], sourceRange: [374, 394],
}, },
{ {
type: 'extrudePlane', type: 'extrudePlane',
faceId: expect.any(String), faceId: expect.any(String),
name: 'p', tag: {
end: 421,
start: 418,
type: 'TagDeclarator',
value: 'p',
},
id: expect.any(String), id: expect.any(String),
sourceRange: [400, 422], sourceRange: [400, 422],
}, },
{ {
type: 'extrudePlane', type: 'extrudePlane',
faceId: expect.any(String), faceId: expect.any(String),
name: '', tag: null,
id: expect.any(String), id: expect.any(String),
sourceRange: [428, 447], sourceRange: [428, 447],
}, },
], ],
sketchGroupValues: [ sketchGroup: {
{ id: expect.any(String),
type: 'ToPoint', __meta: expect.any(Array),
from: [0, 0], on: expect.any(Object),
to: [-2.5, 0], start: expect.any(Object),
name: '', type: 'SketchGroup',
__geoMeta: { value: [
id: expect.any(String), {
sourceRange: [374, 394], type: 'ToPoint',
from: [0, 0],
to: [-2.5, 0],
tag: null,
__geoMeta: {
id: expect.any(String),
sourceRange: [374, 394],
},
}, },
}, {
{ type: 'ToPoint',
type: 'ToPoint', from: [-2.5, 0],
from: [-2.5, 0], to: [0, 3],
to: [0, 3], tag: {
name: 'p', end: 421,
__geoMeta: { start: 418,
id: expect.any(String), type: 'TagDeclarator',
sourceRange: [400, 422], value: 'p',
},
__geoMeta: {
id: expect.any(String),
sourceRange: [400, 422],
},
}, },
}, {
{ type: 'ToPoint',
type: 'ToPoint', from: [0, 3],
from: [0, 3], to: [2.5, 0],
to: [2.5, 0], tag: null,
name: '', __geoMeta: {
__geoMeta: { id: expect.any(String),
id: expect.any(String), sourceRange: [428, 447],
sourceRange: [428, 447], },
}, },
}, ],
], },
height: 2, height: 2,
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), startCapId: expect.any(String),
endCapId: expect.any(String), endCapId: expect.any(String),
__meta: [{ sourceRange: [343, 368] }], __meta: [{ sourceRange: [343, 368] }],

View File

@ -4,6 +4,8 @@ describe('test kclErrToDiagnostic', () => {
it('converts KCL errors to CodeMirror diagnostics', () => { it('converts KCL errors to CodeMirror diagnostics', () => {
const errors: KCLError[] = [ const errors: KCLError[] = [
{ {
name: '',
message: '',
kind: 'semantic', kind: 'semantic',
msg: 'Semantic error', msg: 'Semantic error',
sourceRanges: [ sourceRanges: [
@ -12,6 +14,8 @@ describe('test kclErrToDiagnostic', () => {
], ],
}, },
{ {
name: '',
message: '',
kind: 'type', kind: 'type',
msg: 'Type error', msg: 'Type error',
sourceRanges: [ sourceRanges: [

View File

@ -5,7 +5,7 @@ import { Diagnostic as LspDiagnostic } from 'vscode-languageserver-protocol'
import { Text } from '@codemirror/state' import { Text } from '@codemirror/state'
type ExtractKind<T> = T extends { kind: infer K } ? K : never type ExtractKind<T> = T extends { kind: infer K } ? K : never
export class KCLError { export class KCLError extends Error {
kind: ExtractKind<RustKclError> | 'name' kind: ExtractKind<RustKclError> | 'name'
sourceRanges: [number, number][] sourceRanges: [number, number][]
msg: string msg: string
@ -14,6 +14,7 @@ export class KCLError {
msg: string, msg: string,
sourceRanges: [number, number][] sourceRanges: [number, number][]
) { ) {
super()
this.kind = kind this.kind = kind
this.msg = msg this.msg = msg
this.sourceRanges = sourceRanges this.sourceRanges = sourceRanges

View File

@ -62,13 +62,18 @@ const newVar = myVar + 1`
sourceRange: [72, 98], sourceRange: [72, 98],
id: expect.any(String), id: expect.any(String),
}, },
name: 'myPath', tag: {
end: 97,
start: 89,
type: 'TagDeclarator',
value: 'myPath',
},
}, },
{ {
type: 'ToPoint', type: 'ToPoint',
to: [2, 3], to: [2, 3],
from: [0, 2], from: [0, 2],
name: '', tag: null,
__geoMeta: { __geoMeta: {
sourceRange: [104, 120], sourceRange: [104, 120],
id: expect.any(String), id: expect.any(String),
@ -82,7 +87,12 @@ const newVar = myVar + 1`
sourceRange: [126, 156], sourceRange: [126, 156],
id: expect.any(String), id: expect.any(String),
}, },
name: 'rightPath', tag: {
end: 155,
start: 144,
type: 'TagDeclarator',
value: 'rightPath',
},
}, },
]) ])
}) })
@ -139,7 +149,7 @@ const newVar = myVar + 1`
start: { start: {
to: [0, 0], to: [0, 0],
from: [0, 0], from: [0, 0],
name: '', tag: null,
__geoMeta: { __geoMeta: {
id: expect.any(String), id: expect.any(String),
sourceRange: [39, 63], sourceRange: [39, 63],
@ -150,7 +160,7 @@ const newVar = myVar + 1`
type: 'ToPoint', type: 'ToPoint',
to: [1, 1], to: [1, 1],
from: [0, 0], from: [0, 0],
name: '', tag: null,
__geoMeta: { __geoMeta: {
sourceRange: [69, 85], sourceRange: [69, 85],
id: expect.any(String), id: expect.any(String),
@ -164,13 +174,18 @@ const newVar = myVar + 1`
sourceRange: [91, 118], sourceRange: [91, 118],
id: expect.any(String), id: expect.any(String),
}, },
name: 'myPath', tag: {
end: 117,
start: 109,
type: 'TagDeclarator',
value: 'myPath',
},
}, },
{ {
type: 'ToPoint', type: 'ToPoint',
to: [1, 1], to: [1, 1],
from: [0, 1], from: [0, 1],
name: '', tag: null,
__geoMeta: { __geoMeta: {
sourceRange: [124, 140], sourceRange: [124, 140],
id: expect.any(String), id: expect.any(String),

View File

@ -1,5 +1,6 @@
import { getNodePathFromSourceRange, getNodeFromPath } from './queryAst' import { getNodePathFromSourceRange, getNodeFromPath } from './queryAst'
import { Identifier, parse, initPromise, Parameter } from './wasm' import { Identifier, parse, initPromise, Parameter } from './wasm'
import { err } from 'lib/trap'
beforeAll(async () => { beforeAll(async () => {
await initPromise await initPromise
@ -22,8 +23,11 @@ const sk3 = startSketchAt([0, 0])
] ]
const ast = parse(code) const ast = parse(code)
if (err(ast)) throw ast
const nodePath = getNodePathFromSourceRange(ast, sourceRange) const nodePath = getNodePathFromSourceRange(ast, sourceRange)
const { node } = getNodeFromPath<any>(ast, nodePath) const _node = getNodeFromPath<any>(ast, nodePath)
if (err(_node)) throw _node
const { node } = _node
expect([node.start, node.end]).toEqual(sourceRange) expect([node.start, node.end]).toEqual(sourceRange)
expect(node.type).toBe('CallExpression') expect(node.type).toBe('CallExpression')
@ -47,8 +51,11 @@ const b1 = cube([0,0], 10)`
] ]
const ast = parse(code) const ast = parse(code)
if (err(ast)) throw ast
const nodePath = getNodePathFromSourceRange(ast, sourceRange) const nodePath = getNodePathFromSourceRange(ast, sourceRange)
const node = getNodeFromPath<Parameter>(ast, nodePath).node const _node = getNodeFromPath<Parameter>(ast, nodePath)
if (err(_node)) throw _node
const node = _node.node
expect(nodePath).toEqual([ expect(nodePath).toEqual([
['body', ''], ['body', ''],
@ -81,8 +88,11 @@ const b1 = cube([0,0], 10)`
] ]
const ast = parse(code) const ast = parse(code)
if (err(ast)) throw ast
const nodePath = getNodePathFromSourceRange(ast, sourceRange) const nodePath = getNodePathFromSourceRange(ast, sourceRange)
const node = getNodeFromPath<Identifier>(ast, nodePath).node const _node = getNodeFromPath<Identifier>(ast, nodePath)
if (err(_node)) throw _node
const node = _node.node
expect(nodePath).toEqual([ expect(nodePath).toEqual([
['body', ''], ['body', ''],
[0, 'index'], [0, 'index'],

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