Compare commits

...

96 Commits

Author SHA1 Message Date
7b46656c0f Update docs 2024-08-02 21:07:41 -04:00
6c79b15adf Update existing tests 2024-08-02 21:07:41 -04:00
b45aa89d16 Require variable declaration for pipe expressions 2024-08-02 19:36:19 -04:00
834472e0a6 Update machine-api spec (#3244)
YOYO NEW API SPEC!

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-08-02 16:13:49 -07:00
bcdf6e314f Cut release v0.24.7 (#3243) 2024-08-02 18:12:58 -04:00
55e9845ade Update machine-api spec (#3242)
YOYO NEW API SPEC!

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-08-02 14:10:52 -07:00
d61cf882c1 show default planes on empty scene (#3237)
* show default planes on empty sceen

* fmt

* remove log

* fix silly click listener bug

* delete old stuff

* test tweak

* Revert "test tweak"

This reverts commit e9cb4ac4b5.

---------

Co-authored-by: Paul Tagliamonte <paul@zoo.dev>
2024-08-02 14:05:35 -07:00
874d19cbfd Re-get the openPanes from localStorage when navigating between projects (#3241)
* Re-get the openPanes from localStorage when navigating between projects

* fmt
2024-08-02 15:39:05 -04:00
9dcc955760 Regression fix: restarting onboarding in desktop app required two attempts (#3240)
* Fixed onboarding modal issue, revealed race

* Remove logs

* Make common reset onboarding code path
2024-08-02 15:38:39 -04:00
9b594efe53 Have links clickable within tooltips without clicking content below them (#3204)
* Have links clickable within tooltips without clicking content below them

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

* Re-run CI

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

* Re-run CI

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-08-02 12:25:57 -04:00
7b9f40c4cb Fix link to keybindings tab in help menu on Windows (#3236) 2024-08-02 10:25:42 -04:00
81b79da90f fix cryptic error (#3234)
* fix cryptic error

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

* Update types.rs

---------

Signed-off-by: Jess Frazelle <github@jessfraz.com>
2024-08-01 19:40:22 -07:00
2ad5a880fa rm error pane show badge on code (#3233)
* rm error pane show badge on code

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

* fix playwirght

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

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

* empty

---------

Signed-off-by: Jess Frazelle <github@jessfraz.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-08-01 19:40:16 -07:00
b57a9ba54c open file with url encoded space (#3231)
Signed-off-by: Jess Frazelle <github@jessfraz.com>
2024-08-01 17:53:42 -07:00
b32f5c1d4e add html report to playwright artifact (#3229)
add htlm report to playwright artifact
2024-08-01 22:09:40 +00:00
b6d4cc7a4e Update machine-api spec (#3226)
YOYO NEW API SPEC!

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-08-01 14:49:01 -07:00
43a34b191e Upgrade to clap 4.5.13 to fix build error (#3223) 2024-08-01 17:03:05 +00:00
19a93e8deb Cut release v0.24.6 (#3214) 2024-08-01 09:47:25 -04:00
b8c623e1ec sure up test (#3220) 2024-08-01 12:30:08 +00:00
4006c28479 make test fail fast (#3218) 2024-08-01 11:56:59 +00:00
8c932fdb8d unpause vid in next event loop (#3219)
* unpause vid in next event loop

* fmt
2024-08-01 10:53:44 +00:00
a74c715c01 fix 'Engine disconnect & reconnect in sketch mode' test (#3215)
* fix 'Engine disconnect & reconnect in sketch mode' test

* tweak

* tweak 2
2024-08-01 18:39:24 +10:00
1ac39d95f2 Bug fix: prevent KCL error due to colliding AST execution on project switch (#3205)
* Only run "Execute AST" action if defaultUnit setting changes

* A little more logging and catching anywhere we call video.play()
2024-08-01 05:40:14 +00:00
41b1ec94fa Bump clap from 4.5.11 to 4.5.13 in /src/wasm-lib (#3210)
Bumps [clap](https://github.com/clap-rs/clap) from 4.5.11 to 4.5.13.
- [Release notes](https://github.com/clap-rs/clap/releases)
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/clap-rs/clap/compare/clap_complete-v4.5.11...v4.5.13)

---
updated-dependencies:
- dependency-name: clap
  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-07-31 22:18:40 -07:00
525c803888 Bump toml from 0.8.17 to 0.8.19 in /src/wasm-lib (#3212)
Bumps [toml](https://github.com/toml-rs/toml) from 0.8.17 to 0.8.19.
- [Commits](https://github.com/toml-rs/toml/compare/toml-v0.8.17...toml-v0.8.19)

---
updated-dependencies:
- dependency-name: toml
  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-07-31 22:18:29 -07:00
2ee1c78aad Add a system for badges to appear on pane buttons (#3208) 2024-08-01 13:29:24 +10:00
dc21034b86 Move KCL programs into their own files (#3200)
* Move KCL programs into their own files

* Move even more
2024-07-31 15:07:56 -05:00
1684786659 Update machine-api spec (#3202)
YOYO NEW API SPEC!

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-07-31 11:19:36 -07:00
12505b4398 Bump toml from 0.8.16 to 0.8.17 in /src/wasm-lib (#3198)
Bumps [toml](https://github.com/toml-rs/toml) from 0.8.16 to 0.8.17.
- [Commits](https://github.com/toml-rs/toml/compare/toml-v0.8.16...toml-v0.8.17)

---
updated-dependencies:
- dependency-name: toml
  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-07-31 11:08:07 -07:00
115f2fdea2 Simplify the KCL stdlib test codegen (#3196)
This will ensure that the KCL snapshot tests all use the same logic, whether they're in `tests/executor/main.rs` or in the KCL stdlib modules.
2024-07-31 09:54:46 -05:00
0df28abc4b Update machine-api spec (#3197)
YOYO NEW API SPEC!

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-07-30 19:57:57 -07:00
1e07ea4986 Use better names for engine/KCL tests (#3193)
'serial_test' isn't actually accurate. Two of these tests run in parallel
now. So I renamed it 'kcl_test' as that's what it's actually doing.

In the nextest config, I changed the label from 'serial-integration' to
'uses-engine' because the former isn't true, and also doesn't explain
_why_ it's being limited. The new name explains why we're limiting the
number of tests that can run in parallel.
2024-07-30 16:12:01 -05:00
f34c23d203 Cut release v0.24.5 (#3191) 2024-07-30 15:28:07 -04:00
5295f0ae7d Fix rectangle tool flakiness (#3190)
* Refactor line tool and rectangle tool to share same "no points" code path

* Remove console.log

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

* Re-run CI

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-07-30 18:16:53 +00:00
07a90b3171 Use kcl_input! macro (#3189)
* Use kcl_input! macro

These two lines are equivalent:
`kcl_input!("foo")`
`include_str!("inputs/foo.kcl")`

Simplifies the tests.

* Move more KCL test programs into their own files

* Move twenty-twenty asserts into their own function

* Move more asserts into 'assert_out'
2024-07-30 11:14:37 -05:00
54936f6932 actually fix lint styles (#3187)
Signed-off-by: Jess Frazelle <github@jessfraz.com>
2024-07-30 07:27:47 +00:00
6e296af507 initialize codemirror lint styles once (#3185)
* fix diagnostic styles

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

* fixes

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

* Revert "fixes"

This reverts commit e7b2411ebc.

* Revert "fix diagnostic styles"

This reverts commit 625099d9c8.

* actual fix

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

---------

Signed-off-by: Jess Frazelle <github@jessfraz.com>
2024-07-30 04:42:05 +00:00
60c152bf14 fix edge functions when after sketch on face/fn (#3184)
Signed-off-by: Jess Frazelle <github@jessfraz.com>
2024-07-30 04:30:25 +00:00
59de494125 Bump kittycad from 0.3.8 to 0.3.9 in /src/wasm-lib (#3183)
Bumps [kittycad](https://github.com/KittyCAD/kittycad.rs) from 0.3.8 to 0.3.9.
- [Release notes](https://github.com/KittyCAD/kittycad.rs/releases)
- [Commits](https://github.com/KittyCAD/kittycad.rs/compare/v0.3.8...v0.3.9)

---
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-07-29 20:49:39 -07:00
1c44b01d16 Fix lazy fillet (#3176)
* WIP: Fix lazy fillet

* cleanup

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

---------

Signed-off-by: Jess Frazelle <github@jessfraz.com>
Co-authored-by: Jess Frazelle <github@jessfraz.com>
Co-authored-by: Jess Frazelle <jessfraz@users.noreply.github.com>
2024-07-30 03:22:52 +00:00
789fb83a5d ensure we clear _before_ we execute when there is a race (#3177)
* updates

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

* comment

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

---------

Signed-off-by: Jess Frazelle <github@jessfraz.com>
2024-07-29 19:55:53 -07:00
63fc287742 bugfix: KCL Test Server should clear scene properly (#3174)
There was already a Reset Scene method which properly cleaned up the
3D modeling scene. I didn't know about it, so I wrote my own. But my own
one didn't call the necessary post-clear hooks, so it didn't recreate
the default planes.

This PR calls the right Reset Scene method, so the default planes get
recreated after the scene is cleared.
2024-07-29 20:40:07 -05:00
5e1b91b0e7 wrap with retry - wait on error in gutter (#3137)
* wrap with retry - wait on error in gutter

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

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

This reverts commit 2ca97f90a2.

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Kurt Hutten Irev-Dev <k.hutten@protonmail.ch>
2024-07-30 07:16:52 +10:00
a1c2e817a4 internal linter for making sure everything is camel case (#3172)
* updates

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

* add lint rule for object property key

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

* add linter to example shit

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

* fix samples

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

* fix lints

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

* updates

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

* generate docs

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

---------

Signed-off-by: Jess Frazelle <github@jessfraz.com>
2024-07-29 20:18:55 +00:00
6ed4e72e1d KCL execution server can use a local engine (#3171)
Allow the KCL execution server to choose a local engine, instead of just
the remote engine.

Technically this was already possible, via the $LOCAL_ENGINE_ADDR
environment variable. But it was hard to discover this.
2024-07-29 13:43:27 -05:00
6477011c0f Fix to not crash when there's no var declaration (#3168) 2024-07-29 13:09:12 -04:00
cd9dc3e6a5 Move KCL tests into files (#3169) 2024-07-29 12:05:31 -05:00
4b424de5a6 Add a test for onboarding code reset confirmation and persistence (#3167)
* Add a test for onboarding code reset confirmation and persistence

* Don't use PW's `context` it doesn't have our teardown code
2024-07-29 12:50:01 -04:00
0f1b94f8b9 remove suss linter ext we dont use (#3150)
remove suss linter ext we dont use

Signed-off-by: Jess Frazelle <github@jessfraz.com>
2024-07-29 15:41:02 +00:00
8879f488bb fix autocomplete for ints (#3166)
Signed-off-by: Jess Frazelle <github@jessfraz.com>
2024-07-29 08:16:18 +00:00
67d0fb76f6 make a space work parse in fn call, recast well (#3165)
Signed-off-by: Jess Frazelle <github@jessfraz.com>
2024-07-29 00:39:26 -07:00
fff3c58560 add a test for fn as operand (#3164)
Signed-off-by: Jess Frazelle <github@jessfraz.com>
2024-07-29 00:33:31 -07:00
8880df4fbb Bump @babel/preset-env from 7.24.7 to 7.25.0 (#3154)
Bumps [@babel/preset-env](https://github.com/babel/babel/tree/HEAD/packages/babel-preset-env) from 7.24.7 to 7.25.0.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.25.0/packages/babel-preset-env)

---
updated-dependencies:
- dependency-name: "@babel/preset-env"
  dependency-type: direct:development
  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-07-29 00:27:00 -07:00
d94017c5e3 fix source code ranges for function calls (#3163) 2024-07-28 23:49:28 -07:00
8fe91259fa add polar function (#3158)
* add polarCoords fn

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-07-28 22:45:40 -07:00
57d4204f47 Bump tokio from 1.38.1 to 1.39.2 in /src/wasm-lib (#3162)
Bumps [tokio](https://github.com/tokio-rs/tokio) from 1.38.1 to 1.39.2.
- [Release notes](https://github.com/tokio-rs/tokio/releases)
- [Commits](https://github.com/tokio-rs/tokio/compare/tokio-1.38.1...tokio-1.39.2)

---
updated-dependencies:
- dependency-name: tokio
  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-07-28 22:06:55 -07:00
ee601f93bf Bump syn from 2.0.71 to 2.0.72 in /src/wasm-lib (#3161)
Bumps [syn](https://github.com/dtolnay/syn) from 2.0.71 to 2.0.72.
- [Release notes](https://github.com/dtolnay/syn/releases)
- [Commits](https://github.com/dtolnay/syn/compare/2.0.71...2.0.72)

---
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-07-28 22:03:27 -07:00
b0b48a2e9f Make codemirror tooltips selectable. (#3149)
Co-authored-by: Paul Tagliamonte <paul@zoo.dev>
Co-authored-by: Jess Frazelle <jessfraz@users.noreply.github.com>
2024-07-28 21:34:58 -07:00
46f940ead5 Bump serde_json from 1.0.120 to 1.0.121 in /src/wasm-lib (#3160)
Bumps [serde_json](https://github.com/serde-rs/json) from 1.0.120 to 1.0.121.
- [Release notes](https://github.com/serde-rs/json/releases)
- [Commits](https://github.com/serde-rs/json/compare/v1.0.120...v1.0.121)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-28 21:21:55 -07:00
014cedb2cc Bump clap from 4.5.9 to 4.5.11 in /src/wasm-lib (#3159)
Bumps [clap](https://github.com/clap-rs/clap) from 4.5.9 to 4.5.11.
- [Release notes](https://github.com/clap-rs/clap/releases)
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/clap-rs/clap/compare/clap_complete-v4.5.9...clap_complete-v4.5.11)

---
updated-dependencies:
- dependency-name: clap
  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-07-28 21:21:18 -07:00
2375f900b9 fix errors for bad angles x/y constrained (#3152)
* fix errors for bad angles x/y constrained

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-07-28 20:36:18 -07:00
9fd4fd0dd8 Make onboarding code resets persist again, await confirmation to reset code (#3151) 2024-07-28 21:59:06 -04:00
ee5037bf35 fix arc error (#3148)
Signed-off-by: Jess Frazelle <github@jessfraz.com>
2024-07-28 23:09:54 +00:00
881745e131 Sketch on chamfer fix test for when fixed in engine (#3147)
* 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-07-28 07:30:04 +00:00
49fce9ed57 Fix spelling of glTF (#3123) 2024-07-27 23:59:38 -07:00
fb7b2be427 Tag enhancements (#3143)
* start

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>

* more

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

* enhancements

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

* updates

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

* fixes

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

* get plane data

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>

* updates

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

* updates

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

* cleanup

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

* fixes

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

* more

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>

* fmt

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>

* fixes

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

* updates

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

* fixes

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

* fixes

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

* add lint rule

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>

* fixes

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

---------

Signed-off-by: Jess Frazelle <github@jessfraz.com>
2024-07-28 05:56:46 +00:00
2ec68e3c73 Bump kittycad from 0.3.7 to 0.3.8 in /src/wasm-lib (#2992)
Bumps [kittycad](https://github.com/KittyCAD/kittycad.rs) from 0.3.7 to 0.3.8.
- [Release notes](https://github.com/KittyCAD/kittycad.rs/releases)
- [Commits](https://github.com/KittyCAD/kittycad.rs/compare/v0.3.7...v0.3.8)

---
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>
Co-authored-by: Jess Frazelle <jessfraz@users.noreply.github.com>
2024-07-27 21:27:00 -07:00
6e2dd53ee0 Bump thiserror from 1.0.62 to 1.0.63 in /src/wasm-lib (#3059)
Bumps [thiserror](https://github.com/dtolnay/thiserror) from 1.0.62 to 1.0.63.
- [Release notes](https://github.com/dtolnay/thiserror/releases)
- [Commits](https://github.com/dtolnay/thiserror/compare/1.0.62...1.0.63)

---
updated-dependencies:
- dependency-name: thiserror
  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-07-27 21:26:45 -07:00
f5c262206e Bump pyo3 from 0.22.1 to 0.22.2 in /src/wasm-lib (#3060)
Bumps [pyo3](https://github.com/pyo3/pyo3) from 0.22.1 to 0.22.2.
- [Release notes](https://github.com/pyo3/pyo3/releases)
- [Changelog](https://github.com/PyO3/pyo3/blob/v0.22.2/CHANGELOG.md)
- [Commits](https://github.com/pyo3/pyo3/compare/v0.22.1...v0.22.2)

---
updated-dependencies:
- dependency-name: pyo3
  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>
Co-authored-by: Jess Frazelle <jessfraz@users.noreply.github.com>
2024-07-27 21:26:36 -07:00
9c9b448705 Bump toml from 0.8.14 to 0.8.16 in /src/wasm-lib (#3129)
Bumps [toml](https://github.com/toml-rs/toml) from 0.8.14 to 0.8.16.
- [Commits](https://github.com/toml-rs/toml/compare/toml-v0.8.14...toml-v0.8.16)

---
updated-dependencies:
- dependency-name: toml
  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>
Co-authored-by: Jess Frazelle <jessfraz@users.noreply.github.com>
2024-07-27 18:03:52 -07:00
615b03aea5 Remove backwards compatibility tags (#3139)
* start removing backwards compat

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

* more

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

* add more

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

* fixups

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

* updates

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

* std

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

* fix one

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

* fixes

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

* cleanup other backwards compatible shit

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

* cargo.lock

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

* updates

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

* fixes

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

* update js tests

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

* fix playwright

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

---------

Signed-off-by: Jess Frazelle <github@jessfraz.com>
2024-07-27 17:59:41 -07:00
c3c435348d Make rust green again (#3138)
* 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>

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

* empty

---------

Signed-off-by: Jess Frazelle <github@jessfraz.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-07-26 21:15:54 -07:00
d13f7fd508 Add in an assert family of functions (#3132)
* Add in an `assert` family of functions

This will check values at runtime, allowing for users to ensure computed
values do not violate static constraints.

Signed-off-by: Paul R. Tagliamonte <paul@zoo.dev>
2024-07-26 15:14:51 -04:00
af842aeded fix tauri links (#3131) 2024-07-26 15:05:46 +10:00
0d4b7adf99 artifact map clean up (PART 2.1) (#3130)
* variable renaming

* fix fillet
2024-07-26 14:19:14 +10:00
e708b6ee6b reduce camera hacks (#3078)
* reduce camera hacks

* tweaks

* yarn fmt
2024-07-26 13:43:43 +10:00
4dd8a25fdd Add int() function to KCL stdlib (#3116) 2024-07-25 21:18:52 -04:00
029799215b Fix to preventDefault on all key bindings (#3075) 2024-07-26 00:18:11 +00:00
e3b8807d6f Fix to preserve types using structuredClone (#3113) 2024-07-26 00:11:46 +00:00
0e5d88df0b Fix build error on Rust 1.80.0 (#3128)
* Upgrade to time 0.3.36

* Fix clippy errors

* Fix warning about unexpected cfg

* Fix new clippy warning
2024-07-25 18:02:49 -04:00
95781143eb ArtifactMap should be processed at the end of an execution (PART 2) (#3121)
* seperate out artifactmap functions into seperate file, change types quiet a bit with e2e still passing

* more type changes

* another increment

* cull artifact map

* remove excessive parentIds

* rename props

* final clean up

* unused vars
2024-07-25 19:03:56 +10:00
c184a7d4d8 Cut release v0.24.4 (#3120) 2024-07-25 01:03:02 -04:00
c38e52fbb7 Toolbar rewrite: (mostly) fixed content, separate config, rich tooltips, and roadmapped tools (#3119)
* Basic implementation of rich tooltips

* Break out config to its own file, add a bunch of items

* Better lower right control tooltip sizing

* Add a bunch of sketch tools to the config

* Fix hotkey collisions and UX polish

* Get tests working again

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

* Re-run CI

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

* We updated how the sidebar buttons' test IDs are generated, fix it post-merge

* fmt

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

* Re-run CI

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

* Re-run CI

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

* Re-run CI

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-07-24 23:33:31 -04:00
ea0a3ac3ba Reunite split sidebar, add ability to register action buttons to it (#3100)
* Rework ribbon to support panes and actions

* Restore nice focus-within highlighting

* A better export icon

* Fix up some issues with tests due to sidebar and tooltip tweaks

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

* Re-run CI

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-07-24 22:02:16 -04:00
385589ddf9 Clear the diagnostics before processing (#3118)
clear diagnostics when we update the text

Signed-off-by: Paul R. Tagliamonte <paul@zoo.dev>
2024-07-24 16:11:56 -04:00
22df47fa96 remove _deffer (#3114)
* remove _deffer

Signed-off-by: Paul Tagliamonte <paul@zoo.dev>
2024-07-23 20:37:04 -04:00
a68748abcf Seperate pending messages from artifact map (#3084)
* start of seperating pending message from artifact map

* continue migration to sendCommandVersion2

* mostly massage types

* process artifact after the fact

* clean up
2024-07-23 17:13:23 +10:00
1b8688f274 Add lexical scope and redefining variables in functions (#3015)
* Fix to allow variable shadowing inside functions

* Implement closures

* Fix KCL test code to not reference future tag definition

* Remove tag declarator from function parameters

This is an example where the scoping change revealed a subtle issue
with TagDeclarators.  You cannot bind a new tag using a function
parameter.

The issue is that evaluating a TagDeclarator like $foo binds an
identifier to its corresponding TagIdentifier, but returns the
TagDeclarator.  If you have a TagDeclarator passed in as a parameter
to a function, you can never get its corresponding TagIdentifier.

This seems like a case where TagDeclarator evaluation needs to be
revisited, especially now that we have scoped tags.

* Fix to query return, functions, and tag declarator AST nodes correctly
2024-07-22 19:43:40 -04:00
397839da84 Fix syntax highlighting on code pane open/close (#3083) 2024-07-20 01:45:38 -07:00
ac120838e5 setIsLoading false earlier (#3072)
Signed-off-by: Jess Frazelle <github@jessfraz.com>
2024-07-19 22:18:31 -04:00
e6a2ac9c4a Typecheck KCL args via generics, not handwritten impls (#3025)
In KCL, arguments to functions are passed in the Args struct. This struct contains a list of args, but each arg could be any KCL type (they're stored in an enum of all possible types). To get args of the correct type, these enums are fallibly converted into the type expected for the matching parameter.

Until now, the fallible conversion was handwritten for nearly each function. This is unnecessary, I've replaced it with composable traits.
2024-07-19 20:30:13 -05:00
6e7e6e96cf Make engine reconnection test pass every time (#3066)
* Ensure that isFreezeFrame is reset by isFirstRender, because it can't be a freeze frame if it's the first render

* `restart`-type engine starts should count as first renders

* Ensure we don't see a loading spinner after network is reconnected in test

* Make `waitForPageLoad` robust against if the page has already loaded
and make it actually wait for the Start Sketch button to be enabled

---------

Co-authored-by: 49fl <ircsurfer33@gmail.com>
2024-07-18 16:16:17 -04:00
73e155d79b Fix JS error about fill-rule when opening user menu (#3069) 2024-07-18 20:13:40 +00:00
a782f26ec2 Use ..Default::default() with a struct constructor (#3068)
As @jtran pointed out - I had misunderstood the behavior of
Default::default(), we can instead rely on this syntax to do the same
thing. This won't use each field's default value -- rather, it'll use
the type's Default, and override each field. Neat!

Signed-off-by: Paul Tagliamonte <paul@zoo.dev>
2024-07-18 15:20:50 -04:00
01076c3aed Remove sidebar menus in favor of lil' popovers (#3046)
* Convert user menu to a popover from a sidebar

* Move the user menu over to the left menu cluster

* Replace project sidebar with popover-style menu

* Styling tweaks, give export button a proper tooltip when disabled

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

* Filter orphan breaks, tweak space to remove mouse gaps

* Unify with and without avatar image code

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

* Rerun CI

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

* Rerun CI

* Prepare to move UserSidebarMenu over to right

* Revert AppHeader tweaks

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

* Rerun CI

* Fix typo in README

* Fix export E2E tests that relied on button text

* Missed the data-testid we used to have on the data-testid we had on the settings button

* Dang I missed another testId

* Update snapshots

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

* Rerun CI

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-07-18 14:29:15 -04:00
fe512611ac Fix doc comment to match generated docs (#3067) 2024-07-18 18:00:06 +00:00
284 changed files with 94552 additions and 25775 deletions

View File

@ -9,7 +9,7 @@ Returns the angle to match the given length for x.
```js ```js
angleToMatchLengthX(segment_name: TagIdentifier, to: number, sketch_group: SketchGroup) -> number angleToMatchLengthX(tag: TagIdentifier, to: number, sketch_group: SketchGroup) -> number
``` ```
### Examples ### Examples
@ -28,9 +28,95 @@ const extrusion = extrude(5, sketch001)
### Arguments ### Arguments
* `segment_name`: `TagIdentifier` (REQUIRED) * `tag`: `TagIdentifier` (REQUIRED)
```js ```js
{ {
// Engine information for a tag.
info: {
// The id of the tagged object.
id: uuid,
// The path the tag is on.
path: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The sketch group the tag is on.
sketchGroup: uuid,
// The surface information for the tag.
surface: {
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "extrudeArc",
} |
{
// The id for the chamfer surface.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "chamfer",
} |
{
// The id for the fillet surface.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "fillet",
},
},
value: string, value: string,
} }
``` ```
@ -38,7 +124,7 @@ const extrusion = extrude(5, sketch001)
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED) * `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
```js ```js
{ {
// The id of the sketch group. // The id of the sketch group (this will change when the engine's reference to it changes.
id: uuid, id: uuid,
// What the sketch is on (can be a plane or a face). // What the sketch is on (can be a plane or a face).
on: { on: {
@ -80,15 +166,21 @@ const extrusion = extrude(5, sketch001)
// Chamfers or fillets on this extrude group. // Chamfers or fillets on this extrude group.
filletOrChamfers: [{ filletOrChamfers: [{
// The engine id of the edge to fillet. // The engine id of the edge to fillet.
edge_id: uuid, edgeId: uuid,
// The id of the engine command that called this fillet. // The id of the engine command that called this fillet.
id: uuid, id: uuid,
radius: number, radius: number,
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "fillet", type: "fillet",
} | } |
{ {
// The engine id of the edge to chamfer. // The engine id of the edge to chamfer.
edge_id: uuid, edgeId: uuid,
// The id of the engine command that called this chamfer. // The id of the engine command that called this chamfer.
id: uuid, id: uuid,
length: number, length: number,
@ -106,7 +198,7 @@ const extrusion = extrude(5, sketch001)
id: uuid, id: uuid,
// The sketch group. // The sketch group.
sketchGroup: { sketchGroup: {
// The id of the sketch group. // The id of the sketch group (this will change when the engine's reference to it changes.
id: uuid, id: uuid,
// What the sketch is on (can be a plane or a face). // What the sketch is on (can be a plane or a face).
on: SketchSurface, on: SketchSurface,
@ -257,6 +349,38 @@ const extrusion = extrude(5, sketch001)
value: string, value: string,
}, },
type: "extrudeArc", type: "extrudeArc",
} |
{
// The id for the chamfer surface.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "chamfer",
} |
{
// The id for the fillet surface.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "fillet",
}], }],
}, },
// The id of the face. // The id of the face.

View File

@ -9,7 +9,7 @@ Returns the angle to match the given length for y.
```js ```js
angleToMatchLengthY(segment_name: TagIdentifier, to: number, sketch_group: SketchGroup) -> number angleToMatchLengthY(tag: TagIdentifier, to: number, sketch_group: SketchGroup) -> number
``` ```
### Examples ### Examples
@ -32,9 +32,95 @@ const extrusion = extrude(5, sketch001)
### Arguments ### Arguments
* `segment_name`: `TagIdentifier` (REQUIRED) * `tag`: `TagIdentifier` (REQUIRED)
```js ```js
{ {
// Engine information for a tag.
info: {
// The id of the tagged object.
id: uuid,
// The path the tag is on.
path: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The sketch group the tag is on.
sketchGroup: uuid,
// The surface information for the tag.
surface: {
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "extrudeArc",
} |
{
// The id for the chamfer surface.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "chamfer",
} |
{
// The id for the fillet surface.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "fillet",
},
},
value: string, value: string,
} }
``` ```
@ -42,7 +128,7 @@ const extrusion = extrude(5, sketch001)
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED) * `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
```js ```js
{ {
// The id of the sketch group. // The id of the sketch group (this will change when the engine's reference to it changes.
id: uuid, id: uuid,
// What the sketch is on (can be a plane or a face). // What the sketch is on (can be a plane or a face).
on: { on: {
@ -84,15 +170,21 @@ const extrusion = extrude(5, sketch001)
// Chamfers or fillets on this extrude group. // Chamfers or fillets on this extrude group.
filletOrChamfers: [{ filletOrChamfers: [{
// The engine id of the edge to fillet. // The engine id of the edge to fillet.
edge_id: uuid, edgeId: uuid,
// The id of the engine command that called this fillet. // The id of the engine command that called this fillet.
id: uuid, id: uuid,
radius: number, radius: number,
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "fillet", type: "fillet",
} | } |
{ {
// The engine id of the edge to chamfer. // The engine id of the edge to chamfer.
edge_id: uuid, edgeId: uuid,
// The id of the engine command that called this chamfer. // The id of the engine command that called this chamfer.
id: uuid, id: uuid,
length: number, length: number,
@ -110,7 +202,7 @@ const extrusion = extrude(5, sketch001)
id: uuid, id: uuid,
// The sketch group. // The sketch group.
sketchGroup: { sketchGroup: {
// The id of the sketch group. // The id of the sketch group (this will change when the engine's reference to it changes.
id: uuid, id: uuid,
// What the sketch is on (can be a plane or a face). // What the sketch is on (can be a plane or a face).
on: SketchSurface, on: SketchSurface,
@ -261,6 +353,38 @@ const extrusion = extrude(5, sketch001)
value: string, value: string,
}, },
type: "extrudeArc", type: "extrudeArc",
} |
{
// The id for the chamfer surface.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "chamfer",
} |
{
// The id for the fillet surface.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "fillet",
}], }],
}, },
// The id of the face. // The id of the face.

View File

@ -33,7 +33,7 @@ const example = extrude(10, exampleSketch)
* `data`: `AngledLineData` - Data to draw an angled line. (REQUIRED) * `data`: `AngledLineData` - Data to draw an angled line. (REQUIRED)
```js ```js
{ {
// The angle of the line. // The angle of the line (in degrees).
angle: number, angle: number,
// The length of the line. // The length of the line.
length: number, length: number,
@ -43,7 +43,7 @@ const example = extrude(10, exampleSketch)
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED) * `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
```js ```js
{ {
// The id of the sketch group. // The id of the sketch group (this will change when the engine's reference to it changes.
id: uuid, id: uuid,
// What the sketch is on (can be a plane or a face). // What the sketch is on (can be a plane or a face).
on: { on: {
@ -85,15 +85,21 @@ const example = extrude(10, exampleSketch)
// Chamfers or fillets on this extrude group. // Chamfers or fillets on this extrude group.
filletOrChamfers: [{ filletOrChamfers: [{
// The engine id of the edge to fillet. // The engine id of the edge to fillet.
edge_id: uuid, edgeId: uuid,
// The id of the engine command that called this fillet. // The id of the engine command that called this fillet.
id: uuid, id: uuid,
radius: number, radius: number,
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "fillet", type: "fillet",
} | } |
{ {
// The engine id of the edge to chamfer. // The engine id of the edge to chamfer.
edge_id: uuid, edgeId: uuid,
// The id of the engine command that called this chamfer. // The id of the engine command that called this chamfer.
id: uuid, id: uuid,
length: number, length: number,
@ -111,7 +117,7 @@ const example = extrude(10, exampleSketch)
id: uuid, id: uuid,
// The sketch group. // The sketch group.
sketchGroup: { sketchGroup: {
// The id of the sketch group. // The id of the sketch group (this will change when the engine's reference to it changes.
id: uuid, id: uuid,
// What the sketch is on (can be a plane or a face). // What the sketch is on (can be a plane or a face).
on: SketchSurface, on: SketchSurface,
@ -262,6 +268,38 @@ const example = extrude(10, exampleSketch)
value: string, value: string,
}, },
type: "extrudeArc", type: "extrudeArc",
} |
{
// The id for the chamfer surface.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "chamfer",
} |
{
// The id for the fillet surface.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "fillet",
}], }],
}, },
// The id of the face. // The id of the face.
@ -417,7 +455,7 @@ const example = extrude(10, exampleSketch)
`SketchGroup` - A sketch group is a collection of paths. `SketchGroup` - A sketch group is a collection of paths.
```js ```js
{ {
// The id of the sketch group. // The id of the sketch group (this will change when the engine's reference to it changes.
id: uuid, id: uuid,
// What the sketch is on (can be a plane or a face). // What the sketch is on (can be a plane or a face).
on: { on: {
@ -459,15 +497,21 @@ const example = extrude(10, exampleSketch)
// Chamfers or fillets on this extrude group. // Chamfers or fillets on this extrude group.
filletOrChamfers: [{ filletOrChamfers: [{
// The engine id of the edge to fillet. // The engine id of the edge to fillet.
edge_id: uuid, edgeId: uuid,
// The id of the engine command that called this fillet. // The id of the engine command that called this fillet.
id: uuid, id: uuid,
radius: number, radius: number,
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "fillet", type: "fillet",
} | } |
{ {
// The engine id of the edge to chamfer. // The engine id of the edge to chamfer.
edge_id: uuid, edgeId: uuid,
// The id of the engine command that called this chamfer. // The id of the engine command that called this chamfer.
id: uuid, id: uuid,
length: number, length: number,
@ -485,7 +529,7 @@ const example = extrude(10, exampleSketch)
id: uuid, id: uuid,
// The sketch group. // The sketch group.
sketchGroup: { sketchGroup: {
// The id of the sketch group. // The id of the sketch group (this will change when the engine's reference to it changes.
id: uuid, id: uuid,
// What the sketch is on (can be a plane or a face). // What the sketch is on (can be a plane or a face).
on: SketchSurface, on: SketchSurface,
@ -636,6 +680,38 @@ const example = extrude(10, exampleSketch)
value: string, value: string,
}, },
type: "extrudeArc", type: "extrudeArc",
} |
{
// The id for the chamfer surface.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "chamfer",
} |
{
// The id for the fillet surface.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "fillet",
}], }],
}, },
// The id of the face. // The id of the face.

View File

@ -32,7 +32,7 @@ const extrusion = extrude(10, sketch001)
* `data`: `AngledLineData` - Data to draw an angled line. (REQUIRED) * `data`: `AngledLineData` - Data to draw an angled line. (REQUIRED)
```js ```js
{ {
// The angle of the line. // The angle of the line (in degrees).
angle: number, angle: number,
// The length of the line. // The length of the line.
length: number, length: number,
@ -42,7 +42,7 @@ const extrusion = extrude(10, sketch001)
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED) * `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
```js ```js
{ {
// The id of the sketch group. // The id of the sketch group (this will change when the engine's reference to it changes.
id: uuid, id: uuid,
// What the sketch is on (can be a plane or a face). // What the sketch is on (can be a plane or a face).
on: { on: {
@ -84,15 +84,21 @@ const extrusion = extrude(10, sketch001)
// Chamfers or fillets on this extrude group. // Chamfers or fillets on this extrude group.
filletOrChamfers: [{ filletOrChamfers: [{
// The engine id of the edge to fillet. // The engine id of the edge to fillet.
edge_id: uuid, edgeId: uuid,
// The id of the engine command that called this fillet. // The id of the engine command that called this fillet.
id: uuid, id: uuid,
radius: number, radius: number,
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "fillet", type: "fillet",
} | } |
{ {
// The engine id of the edge to chamfer. // The engine id of the edge to chamfer.
edge_id: uuid, edgeId: uuid,
// The id of the engine command that called this chamfer. // The id of the engine command that called this chamfer.
id: uuid, id: uuid,
length: number, length: number,
@ -110,7 +116,7 @@ const extrusion = extrude(10, sketch001)
id: uuid, id: uuid,
// The sketch group. // The sketch group.
sketchGroup: { sketchGroup: {
// The id of the sketch group. // The id of the sketch group (this will change when the engine's reference to it changes.
id: uuid, id: uuid,
// What the sketch is on (can be a plane or a face). // What the sketch is on (can be a plane or a face).
on: SketchSurface, on: SketchSurface,
@ -261,6 +267,38 @@ const extrusion = extrude(10, sketch001)
value: string, value: string,
}, },
type: "extrudeArc", type: "extrudeArc",
} |
{
// The id for the chamfer surface.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "chamfer",
} |
{
// The id for the fillet surface.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "fillet",
}], }],
}, },
// The id of the face. // The id of the face.
@ -416,7 +454,7 @@ const extrusion = extrude(10, sketch001)
`SketchGroup` - A sketch group is a collection of paths. `SketchGroup` - A sketch group is a collection of paths.
```js ```js
{ {
// The id of the sketch group. // The id of the sketch group (this will change when the engine's reference to it changes.
id: uuid, id: uuid,
// What the sketch is on (can be a plane or a face). // What the sketch is on (can be a plane or a face).
on: { on: {
@ -458,15 +496,21 @@ const extrusion = extrude(10, sketch001)
// Chamfers or fillets on this extrude group. // Chamfers or fillets on this extrude group.
filletOrChamfers: [{ filletOrChamfers: [{
// The engine id of the edge to fillet. // The engine id of the edge to fillet.
edge_id: uuid, edgeId: uuid,
// The id of the engine command that called this fillet. // The id of the engine command that called this fillet.
id: uuid, id: uuid,
radius: number, radius: number,
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "fillet", type: "fillet",
} | } |
{ {
// The engine id of the edge to chamfer. // The engine id of the edge to chamfer.
edge_id: uuid, edgeId: uuid,
// The id of the engine command that called this chamfer. // The id of the engine command that called this chamfer.
id: uuid, id: uuid,
length: number, length: number,
@ -484,7 +528,7 @@ const extrusion = extrude(10, sketch001)
id: uuid, id: uuid,
// The sketch group. // The sketch group.
sketchGroup: { sketchGroup: {
// The id of the sketch group. // The id of the sketch group (this will change when the engine's reference to it changes.
id: uuid, id: uuid,
// What the sketch is on (can be a plane or a face). // What the sketch is on (can be a plane or a face).
on: SketchSurface, on: SketchSurface,
@ -635,6 +679,38 @@ const extrusion = extrude(10, sketch001)
value: string, value: string,
}, },
type: "extrudeArc", type: "extrudeArc",
} |
{
// The id for the chamfer surface.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "chamfer",
} |
{
// The id for the fillet surface.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "fillet",
}], }],
}, },
// The id of the face. // The id of the face.

View File

@ -34,7 +34,7 @@ const example = extrude(10, exampleSketch)
* `data`: `AngledLineData` - Data to draw an angled line. (REQUIRED) * `data`: `AngledLineData` - Data to draw an angled line. (REQUIRED)
```js ```js
{ {
// The angle of the line. // The angle of the line (in degrees).
angle: number, angle: number,
// The length of the line. // The length of the line.
length: number, length: number,
@ -44,7 +44,7 @@ const example = extrude(10, exampleSketch)
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED) * `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
```js ```js
{ {
// The id of the sketch group. // The id of the sketch group (this will change when the engine's reference to it changes.
id: uuid, id: uuid,
// What the sketch is on (can be a plane or a face). // What the sketch is on (can be a plane or a face).
on: { on: {
@ -86,15 +86,21 @@ const example = extrude(10, exampleSketch)
// Chamfers or fillets on this extrude group. // Chamfers or fillets on this extrude group.
filletOrChamfers: [{ filletOrChamfers: [{
// The engine id of the edge to fillet. // The engine id of the edge to fillet.
edge_id: uuid, edgeId: uuid,
// The id of the engine command that called this fillet. // The id of the engine command that called this fillet.
id: uuid, id: uuid,
radius: number, radius: number,
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "fillet", type: "fillet",
} | } |
{ {
// The engine id of the edge to chamfer. // The engine id of the edge to chamfer.
edge_id: uuid, edgeId: uuid,
// The id of the engine command that called this chamfer. // The id of the engine command that called this chamfer.
id: uuid, id: uuid,
length: number, length: number,
@ -112,7 +118,7 @@ const example = extrude(10, exampleSketch)
id: uuid, id: uuid,
// The sketch group. // The sketch group.
sketchGroup: { sketchGroup: {
// The id of the sketch group. // The id of the sketch group (this will change when the engine's reference to it changes.
id: uuid, id: uuid,
// What the sketch is on (can be a plane or a face). // What the sketch is on (can be a plane or a face).
on: SketchSurface, on: SketchSurface,
@ -263,6 +269,38 @@ const example = extrude(10, exampleSketch)
value: string, value: string,
}, },
type: "extrudeArc", type: "extrudeArc",
} |
{
// The id for the chamfer surface.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "chamfer",
} |
{
// The id for the fillet surface.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "fillet",
}], }],
}, },
// The id of the face. // The id of the face.
@ -418,7 +456,7 @@ const example = extrude(10, exampleSketch)
`SketchGroup` - A sketch group is a collection of paths. `SketchGroup` - A sketch group is a collection of paths.
```js ```js
{ {
// The id of the sketch group. // The id of the sketch group (this will change when the engine's reference to it changes.
id: uuid, id: uuid,
// What the sketch is on (can be a plane or a face). // What the sketch is on (can be a plane or a face).
on: { on: {
@ -460,15 +498,21 @@ const example = extrude(10, exampleSketch)
// Chamfers or fillets on this extrude group. // Chamfers or fillets on this extrude group.
filletOrChamfers: [{ filletOrChamfers: [{
// The engine id of the edge to fillet. // The engine id of the edge to fillet.
edge_id: uuid, edgeId: uuid,
// The id of the engine command that called this fillet. // The id of the engine command that called this fillet.
id: uuid, id: uuid,
radius: number, radius: number,
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "fillet", type: "fillet",
} | } |
{ {
// The engine id of the edge to chamfer. // The engine id of the edge to chamfer.
edge_id: uuid, edgeId: uuid,
// The id of the engine command that called this chamfer. // The id of the engine command that called this chamfer.
id: uuid, id: uuid,
length: number, length: number,
@ -486,7 +530,7 @@ const example = extrude(10, exampleSketch)
id: uuid, id: uuid,
// The sketch group. // The sketch group.
sketchGroup: { sketchGroup: {
// The id of the sketch group. // The id of the sketch group (this will change when the engine's reference to it changes.
id: uuid, id: uuid,
// What the sketch is on (can be a plane or a face). // What the sketch is on (can be a plane or a face).
on: SketchSurface, on: SketchSurface,
@ -637,6 +681,38 @@ const example = extrude(10, exampleSketch)
value: string, value: string,
}, },
type: "extrudeArc", type: "extrudeArc",
} |
{
// The id for the chamfer surface.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "chamfer",
} |
{
// The id for the fillet surface.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "fillet",
}], }],
}, },
// The id of the face. // The id of the face.

View File

@ -22,7 +22,7 @@ const exampleSketch = startSketchOn('XZ')
|> lineTo([0, 20], %) |> lineTo([0, 20], %)
|> angledLineThatIntersects({ |> angledLineThatIntersects({
angle: 80, angle: 80,
intersectTag: 'lineToIntersect', intersectTag: lineToIntersect,
offset: 10 offset: 10
}, %) }, %)
|> close(%) |> close(%)
@ -41,6 +41,92 @@ const example = extrude(10, exampleSketch)
angle: number, angle: number,
// The tag of the line to intersect with. // The tag of the line to intersect with.
intersectTag: { intersectTag: {
// Engine information for a tag.
info: {
// The id of the tagged object.
id: uuid,
// The path the tag is on.
path: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The sketch group the tag is on.
sketchGroup: uuid,
// The surface information for the tag.
surface: {
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "extrudeArc",
} |
{
// The id for the chamfer surface.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "chamfer",
} |
{
// The id for the fillet surface.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "fillet",
},
},
value: string, value: string,
}, },
// The offset from the intersecting line. // The offset from the intersecting line.
@ -50,7 +136,7 @@ const example = extrude(10, exampleSketch)
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED) * `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
```js ```js
{ {
// The id of the sketch group. // The id of the sketch group (this will change when the engine's reference to it changes.
id: uuid, id: uuid,
// What the sketch is on (can be a plane or a face). // What the sketch is on (can be a plane or a face).
on: { on: {
@ -92,15 +178,21 @@ const example = extrude(10, exampleSketch)
// Chamfers or fillets on this extrude group. // Chamfers or fillets on this extrude group.
filletOrChamfers: [{ filletOrChamfers: [{
// The engine id of the edge to fillet. // The engine id of the edge to fillet.
edge_id: uuid, edgeId: uuid,
// The id of the engine command that called this fillet. // The id of the engine command that called this fillet.
id: uuid, id: uuid,
radius: number, radius: number,
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "fillet", type: "fillet",
} | } |
{ {
// The engine id of the edge to chamfer. // The engine id of the edge to chamfer.
edge_id: uuid, edgeId: uuid,
// The id of the engine command that called this chamfer. // The id of the engine command that called this chamfer.
id: uuid, id: uuid,
length: number, length: number,
@ -118,7 +210,7 @@ const example = extrude(10, exampleSketch)
id: uuid, id: uuid,
// The sketch group. // The sketch group.
sketchGroup: { sketchGroup: {
// The id of the sketch group. // The id of the sketch group (this will change when the engine's reference to it changes.
id: uuid, id: uuid,
// What the sketch is on (can be a plane or a face). // What the sketch is on (can be a plane or a face).
on: SketchSurface, on: SketchSurface,
@ -269,6 +361,38 @@ const example = extrude(10, exampleSketch)
value: string, value: string,
}, },
type: "extrudeArc", type: "extrudeArc",
} |
{
// The id for the chamfer surface.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "chamfer",
} |
{
// The id for the fillet surface.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "fillet",
}], }],
}, },
// The id of the face. // The id of the face.
@ -424,7 +548,7 @@ const example = extrude(10, exampleSketch)
`SketchGroup` - A sketch group is a collection of paths. `SketchGroup` - A sketch group is a collection of paths.
```js ```js
{ {
// The id of the sketch group. // The id of the sketch group (this will change when the engine's reference to it changes.
id: uuid, id: uuid,
// What the sketch is on (can be a plane or a face). // What the sketch is on (can be a plane or a face).
on: { on: {
@ -466,15 +590,21 @@ const example = extrude(10, exampleSketch)
// Chamfers or fillets on this extrude group. // Chamfers or fillets on this extrude group.
filletOrChamfers: [{ filletOrChamfers: [{
// The engine id of the edge to fillet. // The engine id of the edge to fillet.
edge_id: uuid, edgeId: uuid,
// The id of the engine command that called this fillet. // The id of the engine command that called this fillet.
id: uuid, id: uuid,
radius: number, radius: number,
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "fillet", type: "fillet",
} | } |
{ {
// The engine id of the edge to chamfer. // The engine id of the edge to chamfer.
edge_id: uuid, edgeId: uuid,
// The id of the engine command that called this chamfer. // The id of the engine command that called this chamfer.
id: uuid, id: uuid,
length: number, length: number,
@ -492,7 +622,7 @@ const example = extrude(10, exampleSketch)
id: uuid, id: uuid,
// The sketch group. // The sketch group.
sketchGroup: { sketchGroup: {
// The id of the sketch group. // The id of the sketch group (this will change when the engine's reference to it changes.
id: uuid, id: uuid,
// What the sketch is on (can be a plane or a face). // What the sketch is on (can be a plane or a face).
on: SketchSurface, on: SketchSurface,
@ -643,6 +773,38 @@ const example = extrude(10, exampleSketch)
value: string, value: string,
}, },
type: "extrudeArc", type: "extrudeArc",
} |
{
// The id for the chamfer surface.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "chamfer",
} |
{
// The id for the fillet surface.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "fillet",
}], }],
}, },
// The id of the face. // The id of the face.

View File

@ -41,7 +41,7 @@ const example = extrude(10, exampleSketch)
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED) * `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
```js ```js
{ {
// The id of the sketch group. // The id of the sketch group (this will change when the engine's reference to it changes.
id: uuid, id: uuid,
// What the sketch is on (can be a plane or a face). // What the sketch is on (can be a plane or a face).
on: { on: {
@ -83,15 +83,21 @@ const example = extrude(10, exampleSketch)
// Chamfers or fillets on this extrude group. // Chamfers or fillets on this extrude group.
filletOrChamfers: [{ filletOrChamfers: [{
// The engine id of the edge to fillet. // The engine id of the edge to fillet.
edge_id: uuid, edgeId: uuid,
// The id of the engine command that called this fillet. // The id of the engine command that called this fillet.
id: uuid, id: uuid,
radius: number, radius: number,
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "fillet", type: "fillet",
} | } |
{ {
// The engine id of the edge to chamfer. // The engine id of the edge to chamfer.
edge_id: uuid, edgeId: uuid,
// The id of the engine command that called this chamfer. // The id of the engine command that called this chamfer.
id: uuid, id: uuid,
length: number, length: number,
@ -109,7 +115,7 @@ const example = extrude(10, exampleSketch)
id: uuid, id: uuid,
// The sketch group. // The sketch group.
sketchGroup: { sketchGroup: {
// The id of the sketch group. // The id of the sketch group (this will change when the engine's reference to it changes.
id: uuid, id: uuid,
// What the sketch is on (can be a plane or a face). // What the sketch is on (can be a plane or a face).
on: SketchSurface, on: SketchSurface,
@ -260,6 +266,38 @@ const example = extrude(10, exampleSketch)
value: string, value: string,
}, },
type: "extrudeArc", type: "extrudeArc",
} |
{
// The id for the chamfer surface.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "chamfer",
} |
{
// The id for the fillet surface.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "fillet",
}], }],
}, },
// The id of the face. // The id of the face.
@ -415,7 +453,7 @@ const example = extrude(10, exampleSketch)
`SketchGroup` - A sketch group is a collection of paths. `SketchGroup` - A sketch group is a collection of paths.
```js ```js
{ {
// The id of the sketch group. // The id of the sketch group (this will change when the engine's reference to it changes.
id: uuid, id: uuid,
// What the sketch is on (can be a plane or a face). // What the sketch is on (can be a plane or a face).
on: { on: {
@ -457,15 +495,21 @@ const example = extrude(10, exampleSketch)
// Chamfers or fillets on this extrude group. // Chamfers or fillets on this extrude group.
filletOrChamfers: [{ filletOrChamfers: [{
// The engine id of the edge to fillet. // The engine id of the edge to fillet.
edge_id: uuid, edgeId: uuid,
// The id of the engine command that called this fillet. // The id of the engine command that called this fillet.
id: uuid, id: uuid,
radius: number, radius: number,
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "fillet", type: "fillet",
} | } |
{ {
// The engine id of the edge to chamfer. // The engine id of the edge to chamfer.
edge_id: uuid, edgeId: uuid,
// The id of the engine command that called this chamfer. // The id of the engine command that called this chamfer.
id: uuid, id: uuid,
length: number, length: number,
@ -483,7 +527,7 @@ const example = extrude(10, exampleSketch)
id: uuid, id: uuid,
// The sketch group. // The sketch group.
sketchGroup: { sketchGroup: {
// The id of the sketch group. // The id of the sketch group (this will change when the engine's reference to it changes.
id: uuid, id: uuid,
// What the sketch is on (can be a plane or a face). // What the sketch is on (can be a plane or a face).
on: SketchSurface, on: SketchSurface,
@ -634,6 +678,38 @@ const example = extrude(10, exampleSketch)
value: string, value: string,
}, },
type: "extrudeArc", type: "extrudeArc",
} |
{
// The id for the chamfer surface.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "chamfer",
} |
{
// The id for the fillet surface.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "fillet",
}], }],
}, },
// The id of the face. // The id of the face.

View File

@ -41,7 +41,7 @@ const example = extrude(10, exampleSketch)
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED) * `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
```js ```js
{ {
// The id of the sketch group. // The id of the sketch group (this will change when the engine's reference to it changes.
id: uuid, id: uuid,
// What the sketch is on (can be a plane or a face). // What the sketch is on (can be a plane or a face).
on: { on: {
@ -83,15 +83,21 @@ const example = extrude(10, exampleSketch)
// Chamfers or fillets on this extrude group. // Chamfers or fillets on this extrude group.
filletOrChamfers: [{ filletOrChamfers: [{
// The engine id of the edge to fillet. // The engine id of the edge to fillet.
edge_id: uuid, edgeId: uuid,
// The id of the engine command that called this fillet. // The id of the engine command that called this fillet.
id: uuid, id: uuid,
radius: number, radius: number,
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "fillet", type: "fillet",
} | } |
{ {
// The engine id of the edge to chamfer. // The engine id of the edge to chamfer.
edge_id: uuid, edgeId: uuid,
// The id of the engine command that called this chamfer. // The id of the engine command that called this chamfer.
id: uuid, id: uuid,
length: number, length: number,
@ -109,7 +115,7 @@ const example = extrude(10, exampleSketch)
id: uuid, id: uuid,
// The sketch group. // The sketch group.
sketchGroup: { sketchGroup: {
// The id of the sketch group. // The id of the sketch group (this will change when the engine's reference to it changes.
id: uuid, id: uuid,
// What the sketch is on (can be a plane or a face). // What the sketch is on (can be a plane or a face).
on: SketchSurface, on: SketchSurface,
@ -260,6 +266,38 @@ const example = extrude(10, exampleSketch)
value: string, value: string,
}, },
type: "extrudeArc", type: "extrudeArc",
} |
{
// The id for the chamfer surface.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "chamfer",
} |
{
// The id for the fillet surface.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "fillet",
}], }],
}, },
// The id of the face. // The id of the face.
@ -415,7 +453,7 @@ const example = extrude(10, exampleSketch)
`SketchGroup` - A sketch group is a collection of paths. `SketchGroup` - A sketch group is a collection of paths.
```js ```js
{ {
// The id of the sketch group. // The id of the sketch group (this will change when the engine's reference to it changes.
id: uuid, id: uuid,
// What the sketch is on (can be a plane or a face). // What the sketch is on (can be a plane or a face).
on: { on: {
@ -457,15 +495,21 @@ const example = extrude(10, exampleSketch)
// Chamfers or fillets on this extrude group. // Chamfers or fillets on this extrude group.
filletOrChamfers: [{ filletOrChamfers: [{
// The engine id of the edge to fillet. // The engine id of the edge to fillet.
edge_id: uuid, edgeId: uuid,
// The id of the engine command that called this fillet. // The id of the engine command that called this fillet.
id: uuid, id: uuid,
radius: number, radius: number,
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "fillet", type: "fillet",
} | } |
{ {
// The engine id of the edge to chamfer. // The engine id of the edge to chamfer.
edge_id: uuid, edgeId: uuid,
// The id of the engine command that called this chamfer. // The id of the engine command that called this chamfer.
id: uuid, id: uuid,
length: number, length: number,
@ -483,7 +527,7 @@ const example = extrude(10, exampleSketch)
id: uuid, id: uuid,
// The sketch group. // The sketch group.
sketchGroup: { sketchGroup: {
// The id of the sketch group. // The id of the sketch group (this will change when the engine's reference to it changes.
id: uuid, id: uuid,
// What the sketch is on (can be a plane or a face). // What the sketch is on (can be a plane or a face).
on: SketchSurface, on: SketchSurface,
@ -634,6 +678,38 @@ const example = extrude(10, exampleSketch)
value: string, value: string,
}, },
type: "extrudeArc", type: "extrudeArc",
} |
{
// The id for the chamfer surface.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "chamfer",
} |
{
// The id for the fillet surface.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "fillet",
}], }],
}, },
// The id of the face. // The id of the face.

View File

@ -19,8 +19,8 @@ const exampleSketch = startSketchOn('XZ')
|> startProfileAt([0, 0], %) |> startProfileAt([0, 0], %)
|> line([10, 0], %) |> line([10, 0], %)
|> arc({ |> arc({
angle_start: 0, angleStart: 0,
angle_end: 280, angleEnd: 280,
radius: 16 radius: 16
}, %) }, %)
|> close(%) |> close(%)
@ -34,9 +34,9 @@ const exampleSketch = startSketchOn('XZ')
```js ```js
{ {
// The end angle. // The end angle.
angle_end: number, angleEnd: number,
// The start angle. // The start angle.
angle_start: number, angleStart: number,
// The radius. // The radius.
radius: number, radius: number,
} | } |
@ -52,7 +52,7 @@ const exampleSketch = startSketchOn('XZ')
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED) * `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
```js ```js
{ {
// The id of the sketch group. // The id of the sketch group (this will change when the engine's reference to it changes.
id: uuid, id: uuid,
// What the sketch is on (can be a plane or a face). // What the sketch is on (can be a plane or a face).
on: { on: {
@ -94,15 +94,21 @@ const exampleSketch = startSketchOn('XZ')
// Chamfers or fillets on this extrude group. // Chamfers or fillets on this extrude group.
filletOrChamfers: [{ filletOrChamfers: [{
// The engine id of the edge to fillet. // The engine id of the edge to fillet.
edge_id: uuid, edgeId: uuid,
// The id of the engine command that called this fillet. // The id of the engine command that called this fillet.
id: uuid, id: uuid,
radius: number, radius: number,
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "fillet", type: "fillet",
} | } |
{ {
// The engine id of the edge to chamfer. // The engine id of the edge to chamfer.
edge_id: uuid, edgeId: uuid,
// The id of the engine command that called this chamfer. // The id of the engine command that called this chamfer.
id: uuid, id: uuid,
length: number, length: number,
@ -120,7 +126,7 @@ const exampleSketch = startSketchOn('XZ')
id: uuid, id: uuid,
// The sketch group. // The sketch group.
sketchGroup: { sketchGroup: {
// The id of the sketch group. // The id of the sketch group (this will change when the engine's reference to it changes.
id: uuid, id: uuid,
// What the sketch is on (can be a plane or a face). // What the sketch is on (can be a plane or a face).
on: SketchSurface, on: SketchSurface,
@ -271,6 +277,38 @@ const exampleSketch = startSketchOn('XZ')
value: string, value: string,
}, },
type: "extrudeArc", type: "extrudeArc",
} |
{
// The id for the chamfer surface.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "chamfer",
} |
{
// The id for the fillet surface.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "fillet",
}], }],
}, },
// The id of the face. // The id of the face.
@ -426,7 +464,7 @@ const exampleSketch = startSketchOn('XZ')
`SketchGroup` - A sketch group is a collection of paths. `SketchGroup` - A sketch group is a collection of paths.
```js ```js
{ {
// The id of the sketch group. // The id of the sketch group (this will change when the engine's reference to it changes.
id: uuid, id: uuid,
// What the sketch is on (can be a plane or a face). // What the sketch is on (can be a plane or a face).
on: { on: {
@ -468,15 +506,21 @@ const exampleSketch = startSketchOn('XZ')
// Chamfers or fillets on this extrude group. // Chamfers or fillets on this extrude group.
filletOrChamfers: [{ filletOrChamfers: [{
// The engine id of the edge to fillet. // The engine id of the edge to fillet.
edge_id: uuid, edgeId: uuid,
// The id of the engine command that called this fillet. // The id of the engine command that called this fillet.
id: uuid, id: uuid,
radius: number, radius: number,
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "fillet", type: "fillet",
} | } |
{ {
// The engine id of the edge to chamfer. // The engine id of the edge to chamfer.
edge_id: uuid, edgeId: uuid,
// The id of the engine command that called this chamfer. // The id of the engine command that called this chamfer.
id: uuid, id: uuid,
length: number, length: number,
@ -494,7 +538,7 @@ const exampleSketch = startSketchOn('XZ')
id: uuid, id: uuid,
// The sketch group. // The sketch group.
sketchGroup: { sketchGroup: {
// The id of the sketch group. // The id of the sketch group (this will change when the engine's reference to it changes.
id: uuid, id: uuid,
// What the sketch is on (can be a plane or a face). // What the sketch is on (can be a plane or a face).
on: SketchSurface, on: SketchSurface,
@ -645,6 +689,38 @@ const exampleSketch = startSketchOn('XZ')
value: string, value: string,
}, },
type: "extrudeArc", type: "extrudeArc",
} |
{
// The id for the chamfer surface.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "chamfer",
} |
{
// The id for the fillet surface.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "fillet",
}], }],
}, },
// The id of the face. // The id of the face.

34
docs/kcl/assert.md Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -47,7 +47,7 @@ const example = extrude(10, exampleSketch)
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED) * `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
```js ```js
{ {
// The id of the sketch group. // The id of the sketch group (this will change when the engine's reference to it changes.
id: uuid, id: uuid,
// What the sketch is on (can be a plane or a face). // What the sketch is on (can be a plane or a face).
on: { on: {
@ -89,15 +89,21 @@ const example = extrude(10, exampleSketch)
// Chamfers or fillets on this extrude group. // Chamfers or fillets on this extrude group.
filletOrChamfers: [{ filletOrChamfers: [{
// The engine id of the edge to fillet. // The engine id of the edge to fillet.
edge_id: uuid, edgeId: uuid,
// The id of the engine command that called this fillet. // The id of the engine command that called this fillet.
id: uuid, id: uuid,
radius: number, radius: number,
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "fillet", type: "fillet",
} | } |
{ {
// The engine id of the edge to chamfer. // The engine id of the edge to chamfer.
edge_id: uuid, edgeId: uuid,
// The id of the engine command that called this chamfer. // The id of the engine command that called this chamfer.
id: uuid, id: uuid,
length: number, length: number,
@ -115,7 +121,7 @@ const example = extrude(10, exampleSketch)
id: uuid, id: uuid,
// The sketch group. // The sketch group.
sketchGroup: { sketchGroup: {
// The id of the sketch group. // The id of the sketch group (this will change when the engine's reference to it changes.
id: uuid, id: uuid,
// What the sketch is on (can be a plane or a face). // What the sketch is on (can be a plane or a face).
on: SketchSurface, on: SketchSurface,
@ -266,6 +272,38 @@ const example = extrude(10, exampleSketch)
value: string, value: string,
}, },
type: "extrudeArc", type: "extrudeArc",
} |
{
// The id for the chamfer surface.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "chamfer",
} |
{
// The id for the fillet surface.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "fillet",
}], }],
}, },
// The id of the face. // The id of the face.
@ -421,7 +459,7 @@ const example = extrude(10, exampleSketch)
`SketchGroup` - A sketch group is a collection of paths. `SketchGroup` - A sketch group is a collection of paths.
```js ```js
{ {
// The id of the sketch group. // The id of the sketch group (this will change when the engine's reference to it changes.
id: uuid, id: uuid,
// What the sketch is on (can be a plane or a face). // What the sketch is on (can be a plane or a face).
on: { on: {
@ -463,15 +501,21 @@ const example = extrude(10, exampleSketch)
// Chamfers or fillets on this extrude group. // Chamfers or fillets on this extrude group.
filletOrChamfers: [{ filletOrChamfers: [{
// The engine id of the edge to fillet. // The engine id of the edge to fillet.
edge_id: uuid, edgeId: uuid,
// The id of the engine command that called this fillet. // The id of the engine command that called this fillet.
id: uuid, id: uuid,
radius: number, radius: number,
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "fillet", type: "fillet",
} | } |
{ {
// The engine id of the edge to chamfer. // The engine id of the edge to chamfer.
edge_id: uuid, edgeId: uuid,
// The id of the engine command that called this chamfer. // The id of the engine command that called this chamfer.
id: uuid, id: uuid,
length: number, length: number,
@ -489,7 +533,7 @@ const example = extrude(10, exampleSketch)
id: uuid, id: uuid,
// The sketch group. // The sketch group.
sketchGroup: { sketchGroup: {
// The id of the sketch group. // The id of the sketch group (this will change when the engine's reference to it changes.
id: uuid, id: uuid,
// What the sketch is on (can be a plane or a face). // What the sketch is on (can be a plane or a face).
on: SketchSurface, on: SketchSurface,
@ -640,6 +684,38 @@ const example = extrude(10, exampleSketch)
value: string, value: string,
}, },
type: "extrudeArc", type: "extrudeArc",
} |
{
// The id for the chamfer surface.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "chamfer",
} |
{
// The id for the fillet surface.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "fillet",
}], }],
}, },
// The id of the face. // The id of the face.

View File

@ -31,10 +31,10 @@ const mountingPlate = extrude(thickness, mountingPlateSketch)
|> chamfer({ |> chamfer({
length: chamferLength, length: chamferLength,
tags: [ tags: [
getNextAdjacentEdge(edge1, %), getNextAdjacentEdge(edge1),
getNextAdjacentEdge(edge2, %), getNextAdjacentEdge(edge2),
getNextAdjacentEdge(edge3, %), getNextAdjacentEdge(edge3),
getNextAdjacentEdge(edge4, %) getNextAdjacentEdge(edge4)
] ]
}, %) }, %)
``` ```
@ -51,6 +51,92 @@ const mountingPlate = extrude(thickness, mountingPlateSketch)
// The tags of the paths you want to chamfer. // The tags of the paths you want to chamfer.
tags: [uuid | tags: [uuid |
{ {
// Engine information for a tag.
info: {
// The id of the tagged object.
id: uuid,
// The path the tag is on.
path: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The sketch group the tag is on.
sketchGroup: uuid,
// The surface information for the tag.
surface: {
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "extrudeArc",
} |
{
// The id for the chamfer surface.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "chamfer",
} |
{
// The id for the fillet surface.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "fillet",
},
},
value: string, value: string,
}], }],
} }
@ -63,15 +149,21 @@ const mountingPlate = extrude(thickness, mountingPlateSketch)
// Chamfers or fillets on this extrude group. // Chamfers or fillets on this extrude group.
filletOrChamfers: [{ filletOrChamfers: [{
// The engine id of the edge to fillet. // The engine id of the edge to fillet.
edge_id: uuid, edgeId: uuid,
// The id of the engine command that called this fillet. // The id of the engine command that called this fillet.
id: uuid, id: uuid,
radius: number, radius: number,
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "fillet", type: "fillet",
} | } |
{ {
// The engine id of the edge to chamfer. // The engine id of the edge to chamfer.
edge_id: uuid, edgeId: uuid,
// The id of the engine command that called this chamfer. // The id of the engine command that called this chamfer.
id: uuid, id: uuid,
length: number, length: number,
@ -89,7 +181,7 @@ const mountingPlate = extrude(thickness, mountingPlateSketch)
id: uuid, id: uuid,
// The sketch group. // The sketch group.
sketchGroup: { sketchGroup: {
// The id of the sketch group. // The id of the sketch group (this will change when the engine's reference to it changes.
id: uuid, id: uuid,
// What the sketch is on (can be a plane or a face). // What the sketch is on (can be a plane or a face).
on: { on: {
@ -131,15 +223,21 @@ const mountingPlate = extrude(thickness, mountingPlateSketch)
// Chamfers or fillets on this extrude group. // Chamfers or fillets on this extrude group.
filletOrChamfers: [{ filletOrChamfers: [{
// The engine id of the edge to fillet. // The engine id of the edge to fillet.
edge_id: uuid, edgeId: uuid,
// The id of the engine command that called this fillet. // The id of the engine command that called this fillet.
id: uuid, id: uuid,
radius: number, radius: number,
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "fillet", type: "fillet",
} | } |
{ {
// The engine id of the edge to chamfer. // The engine id of the edge to chamfer.
edge_id: uuid, edgeId: uuid,
// The id of the engine command that called this chamfer. // The id of the engine command that called this chamfer.
id: uuid, id: uuid,
length: number, length: number,
@ -191,6 +289,38 @@ const mountingPlate = extrude(thickness, mountingPlateSketch)
value: string, value: string,
}, },
type: "extrudeArc", type: "extrudeArc",
} |
{
// The id for the chamfer surface.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "chamfer",
} |
{
// The id for the fillet surface.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "fillet",
}], }],
}, },
// The id of the face. // The id of the face.
@ -364,6 +494,38 @@ const mountingPlate = extrude(thickness, mountingPlateSketch)
value: string, value: string,
}, },
type: "extrudeArc", type: "extrudeArc",
} |
{
// The id for the chamfer surface.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "chamfer",
} |
{
// The id for the fillet surface.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "fillet",
}], }],
} }
``` ```
@ -387,15 +549,21 @@ const mountingPlate = extrude(thickness, mountingPlateSketch)
// Chamfers or fillets on this extrude group. // Chamfers or fillets on this extrude group.
filletOrChamfers: [{ filletOrChamfers: [{
// The engine id of the edge to fillet. // The engine id of the edge to fillet.
edge_id: uuid, edgeId: uuid,
// The id of the engine command that called this fillet. // The id of the engine command that called this fillet.
id: uuid, id: uuid,
radius: number, radius: number,
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "fillet", type: "fillet",
} | } |
{ {
// The engine id of the edge to chamfer. // The engine id of the edge to chamfer.
edge_id: uuid, edgeId: uuid,
// The id of the engine command that called this chamfer. // The id of the engine command that called this chamfer.
id: uuid, id: uuid,
length: number, length: number,
@ -413,7 +581,7 @@ const mountingPlate = extrude(thickness, mountingPlateSketch)
id: uuid, id: uuid,
// The sketch group. // The sketch group.
sketchGroup: { sketchGroup: {
// The id of the sketch group. // The id of the sketch group (this will change when the engine's reference to it changes.
id: uuid, id: uuid,
// What the sketch is on (can be a plane or a face). // What the sketch is on (can be a plane or a face).
on: { on: {
@ -455,15 +623,21 @@ const mountingPlate = extrude(thickness, mountingPlateSketch)
// Chamfers or fillets on this extrude group. // Chamfers or fillets on this extrude group.
filletOrChamfers: [{ filletOrChamfers: [{
// The engine id of the edge to fillet. // The engine id of the edge to fillet.
edge_id: uuid, edgeId: uuid,
// The id of the engine command that called this fillet. // The id of the engine command that called this fillet.
id: uuid, id: uuid,
radius: number, radius: number,
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "fillet", type: "fillet",
} | } |
{ {
// The engine id of the edge to chamfer. // The engine id of the edge to chamfer.
edge_id: uuid, edgeId: uuid,
// The id of the engine command that called this chamfer. // The id of the engine command that called this chamfer.
id: uuid, id: uuid,
length: number, length: number,
@ -515,6 +689,38 @@ const mountingPlate = extrude(thickness, mountingPlateSketch)
value: string, value: string,
}, },
type: "extrudeArc", type: "extrudeArc",
} |
{
// The id for the chamfer surface.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "chamfer",
} |
{
// The id for the fillet surface.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "fillet",
}], }],
}, },
// The id of the face. // The id of the face.
@ -688,6 +894,38 @@ const mountingPlate = extrude(thickness, mountingPlateSketch)
value: string, value: string,
}, },
type: "extrudeArc", type: "extrudeArc",
} |
{
// The id for the chamfer surface.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "chamfer",
} |
{
// The id for the fillet surface.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "fillet",
}], }],
} }
``` ```

View File

@ -82,15 +82,21 @@ const example = extrude(5, exampleSketch)
// Chamfers or fillets on this extrude group. // Chamfers or fillets on this extrude group.
filletOrChamfers: [{ filletOrChamfers: [{
// The engine id of the edge to fillet. // The engine id of the edge to fillet.
edge_id: uuid, edgeId: uuid,
// The id of the engine command that called this fillet. // The id of the engine command that called this fillet.
id: uuid, id: uuid,
radius: number, radius: number,
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "fillet", type: "fillet",
} | } |
{ {
// The engine id of the edge to chamfer. // The engine id of the edge to chamfer.
edge_id: uuid, edgeId: uuid,
// The id of the engine command that called this chamfer. // The id of the engine command that called this chamfer.
id: uuid, id: uuid,
length: number, length: number,
@ -108,7 +114,7 @@ const example = extrude(5, exampleSketch)
id: uuid, id: uuid,
// The sketch group. // The sketch group.
sketchGroup: { sketchGroup: {
// The id of the sketch group. // The id of the sketch group (this will change when the engine's reference to it changes.
id: uuid, id: uuid,
// What the sketch is on (can be a plane or a face). // What the sketch is on (can be a plane or a face).
on: SketchSurface, on: SketchSurface,
@ -259,6 +265,38 @@ const example = extrude(5, exampleSketch)
value: string, value: string,
}, },
type: "extrudeArc", type: "extrudeArc",
} |
{
// The id for the chamfer surface.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "chamfer",
} |
{
// The id for the fillet surface.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "fillet",
}], }],
}, },
// The id of the face. // The id of the face.
@ -286,7 +324,7 @@ const example = extrude(5, exampleSketch)
}, },
} | } |
{ {
// The id of the sketch group. // The id of the sketch group (this will change when the engine's reference to it changes.
id: uuid, id: uuid,
// What the sketch is on (can be a plane or a face). // What the sketch is on (can be a plane or a face).
on: { on: {
@ -328,15 +366,21 @@ const example = extrude(5, exampleSketch)
// Chamfers or fillets on this extrude group. // Chamfers or fillets on this extrude group.
filletOrChamfers: [{ filletOrChamfers: [{
// The engine id of the edge to fillet. // The engine id of the edge to fillet.
edge_id: uuid, edgeId: uuid,
// The id of the engine command that called this fillet. // The id of the engine command that called this fillet.
id: uuid, id: uuid,
radius: number, radius: number,
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "fillet", type: "fillet",
} | } |
{ {
// The engine id of the edge to chamfer. // The engine id of the edge to chamfer.
edge_id: uuid, edgeId: uuid,
// The id of the engine command that called this chamfer. // The id of the engine command that called this chamfer.
id: uuid, id: uuid,
length: number, length: number,
@ -388,6 +432,38 @@ const example = extrude(5, exampleSketch)
value: string, value: string,
}, },
type: "extrudeArc", type: "extrudeArc",
} |
{
// The id for the chamfer surface.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "chamfer",
} |
{
// The id for the fillet surface.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "fillet",
}], }],
}, },
// The id of the face. // The id of the face.
@ -543,7 +619,7 @@ const example = extrude(5, exampleSketch)
`SketchGroup` - A sketch group is a collection of paths. `SketchGroup` - A sketch group is a collection of paths.
```js ```js
{ {
// The id of the sketch group. // The id of the sketch group (this will change when the engine's reference to it changes.
id: uuid, id: uuid,
// What the sketch is on (can be a plane or a face). // What the sketch is on (can be a plane or a face).
on: { on: {
@ -585,15 +661,21 @@ const example = extrude(5, exampleSketch)
// Chamfers or fillets on this extrude group. // Chamfers or fillets on this extrude group.
filletOrChamfers: [{ filletOrChamfers: [{
// The engine id of the edge to fillet. // The engine id of the edge to fillet.
edge_id: uuid, edgeId: uuid,
// The id of the engine command that called this fillet. // The id of the engine command that called this fillet.
id: uuid, id: uuid,
radius: number, radius: number,
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "fillet", type: "fillet",
} | } |
{ {
// The engine id of the edge to chamfer. // The engine id of the edge to chamfer.
edge_id: uuid, edgeId: uuid,
// The id of the engine command that called this chamfer. // The id of the engine command that called this chamfer.
id: uuid, id: uuid,
length: number, length: number,
@ -611,7 +693,7 @@ const example = extrude(5, exampleSketch)
id: uuid, id: uuid,
// The sketch group. // The sketch group.
sketchGroup: { sketchGroup: {
// The id of the sketch group. // The id of the sketch group (this will change when the engine's reference to it changes.
id: uuid, id: uuid,
// What the sketch is on (can be a plane or a face). // What the sketch is on (can be a plane or a face).
on: SketchSurface, on: SketchSurface,
@ -762,6 +844,38 @@ const example = extrude(5, exampleSketch)
value: string, value: string,
}, },
type: "extrudeArc", type: "extrudeArc",
} |
{
// The id for the chamfer surface.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "chamfer",
} |
{
// The id for the fillet surface.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "fillet",
}], }],
}, },
// The id of the face. // The id of the face.

View File

@ -15,7 +15,7 @@ close(sketch_group: SketchGroup, tag?: TagDeclarator) -> SketchGroup
### Examples ### Examples
```js ```js
startSketchOn('XZ') const exampleSketch = startSketchOn('XZ')
|> startProfileAt([0, 0], %) |> startProfileAt([0, 0], %)
|> line([10, 10], %) |> line([10, 10], %)
|> line([10, 0], %) |> line([10, 0], %)
@ -42,7 +42,7 @@ const example = extrude(10, exampleSketch)
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED) * `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
```js ```js
{ {
// The id of the sketch group. // The id of the sketch group (this will change when the engine's reference to it changes.
id: uuid, id: uuid,
// What the sketch is on (can be a plane or a face). // What the sketch is on (can be a plane or a face).
on: { on: {
@ -84,15 +84,21 @@ const example = extrude(10, exampleSketch)
// Chamfers or fillets on this extrude group. // Chamfers or fillets on this extrude group.
filletOrChamfers: [{ filletOrChamfers: [{
// The engine id of the edge to fillet. // The engine id of the edge to fillet.
edge_id: uuid, edgeId: uuid,
// The id of the engine command that called this fillet. // The id of the engine command that called this fillet.
id: uuid, id: uuid,
radius: number, radius: number,
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "fillet", type: "fillet",
} | } |
{ {
// The engine id of the edge to chamfer. // The engine id of the edge to chamfer.
edge_id: uuid, edgeId: uuid,
// The id of the engine command that called this chamfer. // The id of the engine command that called this chamfer.
id: uuid, id: uuid,
length: number, length: number,
@ -110,7 +116,7 @@ const example = extrude(10, exampleSketch)
id: uuid, id: uuid,
// The sketch group. // The sketch group.
sketchGroup: { sketchGroup: {
// The id of the sketch group. // The id of the sketch group (this will change when the engine's reference to it changes.
id: uuid, id: uuid,
// What the sketch is on (can be a plane or a face). // What the sketch is on (can be a plane or a face).
on: SketchSurface, on: SketchSurface,
@ -261,6 +267,38 @@ const example = extrude(10, exampleSketch)
value: string, value: string,
}, },
type: "extrudeArc", type: "extrudeArc",
} |
{
// The id for the chamfer surface.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "chamfer",
} |
{
// The id for the fillet surface.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "fillet",
}], }],
}, },
// The id of the face. // The id of the face.
@ -416,7 +454,7 @@ const example = extrude(10, exampleSketch)
`SketchGroup` - A sketch group is a collection of paths. `SketchGroup` - A sketch group is a collection of paths.
```js ```js
{ {
// The id of the sketch group. // The id of the sketch group (this will change when the engine's reference to it changes.
id: uuid, id: uuid,
// What the sketch is on (can be a plane or a face). // What the sketch is on (can be a plane or a face).
on: { on: {
@ -458,15 +496,21 @@ const example = extrude(10, exampleSketch)
// Chamfers or fillets on this extrude group. // Chamfers or fillets on this extrude group.
filletOrChamfers: [{ filletOrChamfers: [{
// The engine id of the edge to fillet. // The engine id of the edge to fillet.
edge_id: uuid, edgeId: uuid,
// The id of the engine command that called this fillet. // The id of the engine command that called this fillet.
id: uuid, id: uuid,
radius: number, radius: number,
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "fillet", type: "fillet",
} | } |
{ {
// The engine id of the edge to chamfer. // The engine id of the edge to chamfer.
edge_id: uuid, edgeId: uuid,
// The id of the engine command that called this chamfer. // The id of the engine command that called this chamfer.
id: uuid, id: uuid,
length: number, length: number,
@ -484,7 +528,7 @@ const example = extrude(10, exampleSketch)
id: uuid, id: uuid,
// The sketch group. // The sketch group.
sketchGroup: { sketchGroup: {
// The id of the sketch group. // The id of the sketch group (this will change when the engine's reference to it changes.
id: uuid, id: uuid,
// What the sketch is on (can be a plane or a face). // What the sketch is on (can be a plane or a face).
on: SketchSurface, on: SketchSurface,
@ -635,6 +679,38 @@ const example = extrude(10, exampleSketch)
value: string, value: string,
}, },
type: "extrudeArc", type: "extrudeArc",
} |
{
// The id for the chamfer surface.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "chamfer",
} |
{
// The id for the fillet surface.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "fillet",
}], }],
}, },
// The id of the face. // The id of the face.

View File

@ -19,8 +19,8 @@ const example = startSketchOn('XZ')
|> startProfileAt([0, 0], %) |> startProfileAt([0, 0], %)
|> line([10, 0], %) |> line([10, 0], %)
|> arc({ |> arc({
angle_end: 0, angleStart: 120,
angle_start: 120, angleEnd: 0,
radius: 5 radius: 5
}, %) }, %)
|> line([5, 0], %) |> line([5, 0], %)
@ -41,8 +41,8 @@ const example = startSketchOn('XZ')
const exampleSketch = startSketchOn('XZ') const exampleSketch = startSketchOn('XZ')
|> startProfileAt([-10, 0], %) |> startProfileAt([-10, 0], %)
|> arc({ |> arc({
angle_end: -60, angleStart: 120,
angle_start: 120, angleEnd: -60,
radius: 5 radius: 5
}, %) }, %)
|> line([10, 0], %) |> line([10, 0], %)
@ -67,7 +67,7 @@ const example = extrude(10, exampleSketch)
* `sketch_group_set`: `SketchGroupSet` - A sketch group or a group of sketch groups. (REQUIRED) * `sketch_group_set`: `SketchGroupSet` - A sketch group or a group of sketch groups. (REQUIRED)
```js ```js
{ {
// The id of the sketch group. // The id of the sketch group (this will change when the engine's reference to it changes.
id: uuid, id: uuid,
// What the sketch is on (can be a plane or a face). // What the sketch is on (can be a plane or a face).
on: { on: {
@ -109,15 +109,21 @@ const example = extrude(10, exampleSketch)
// Chamfers or fillets on this extrude group. // Chamfers or fillets on this extrude group.
filletOrChamfers: [{ filletOrChamfers: [{
// The engine id of the edge to fillet. // The engine id of the edge to fillet.
edge_id: uuid, edgeId: uuid,
// The id of the engine command that called this fillet. // The id of the engine command that called this fillet.
id: uuid, id: uuid,
radius: number, radius: number,
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "fillet", type: "fillet",
} | } |
{ {
// The engine id of the edge to chamfer. // The engine id of the edge to chamfer.
edge_id: uuid, edgeId: uuid,
// The id of the engine command that called this chamfer. // The id of the engine command that called this chamfer.
id: uuid, id: uuid,
length: number, length: number,
@ -135,7 +141,7 @@ const example = extrude(10, exampleSketch)
id: uuid, id: uuid,
// The sketch group. // The sketch group.
sketchGroup: { sketchGroup: {
// The id of the sketch group. // The id of the sketch group (this will change when the engine's reference to it changes.
id: uuid, id: uuid,
// What the sketch is on (can be a plane or a face). // What the sketch is on (can be a plane or a face).
on: SketchSurface, on: SketchSurface,
@ -286,6 +292,38 @@ const example = extrude(10, exampleSketch)
value: string, value: string,
}, },
type: "extrudeArc", type: "extrudeArc",
} |
{
// The id for the chamfer surface.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "chamfer",
} |
{
// The id for the fillet surface.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "fillet",
}], }],
}, },
// The id of the face. // The id of the face.
@ -441,15 +479,21 @@ const example = extrude(10, exampleSketch)
// Chamfers or fillets on this extrude group. // Chamfers or fillets on this extrude group.
filletOrChamfers: [{ filletOrChamfers: [{
// The engine id of the edge to fillet. // The engine id of the edge to fillet.
edge_id: uuid, edgeId: uuid,
// The id of the engine command that called this fillet. // The id of the engine command that called this fillet.
id: uuid, id: uuid,
radius: number, radius: number,
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "fillet", type: "fillet",
} | } |
{ {
// The engine id of the edge to chamfer. // The engine id of the edge to chamfer.
edge_id: uuid, edgeId: uuid,
// The id of the engine command that called this chamfer. // The id of the engine command that called this chamfer.
id: uuid, id: uuid,
length: number, length: number,
@ -467,7 +511,7 @@ const example = extrude(10, exampleSketch)
id: uuid, id: uuid,
// The sketch group. // The sketch group.
sketchGroup: { sketchGroup: {
// The id of the sketch group. // The id of the sketch group (this will change when the engine's reference to it changes.
id: uuid, id: uuid,
// What the sketch is on (can be a plane or a face). // What the sketch is on (can be a plane or a face).
on: { on: {
@ -509,15 +553,21 @@ const example = extrude(10, exampleSketch)
// Chamfers or fillets on this extrude group. // Chamfers or fillets on this extrude group.
filletOrChamfers: [{ filletOrChamfers: [{
// The engine id of the edge to fillet. // The engine id of the edge to fillet.
edge_id: uuid, edgeId: uuid,
// The id of the engine command that called this fillet. // The id of the engine command that called this fillet.
id: uuid, id: uuid,
radius: number, radius: number,
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "fillet", type: "fillet",
} | } |
{ {
// The engine id of the edge to chamfer. // The engine id of the edge to chamfer.
edge_id: uuid, edgeId: uuid,
// The id of the engine command that called this chamfer. // The id of the engine command that called this chamfer.
id: uuid, id: uuid,
length: number, length: number,
@ -569,6 +619,38 @@ const example = extrude(10, exampleSketch)
value: string, value: string,
}, },
type: "extrudeArc", type: "extrudeArc",
} |
{
// The id for the chamfer surface.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "chamfer",
} |
{
// The id for the fillet surface.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "fillet",
}], }],
}, },
// The id of the face. // The id of the face.
@ -743,6 +825,38 @@ const example = extrude(10, exampleSketch)
value: string, value: string,
}, },
type: "extrudeArc", type: "extrudeArc",
} |
{
// The id for the chamfer surface.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "chamfer",
} |
{
// The id for the fillet surface.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "fillet",
}], }],
} | } |
{ {

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -19,10 +19,9 @@ const part001 = startSketchOn('XY')
|> circle([5, 5], 10, %) |> circle([5, 5], 10, %)
|> extrude(10, %) |> extrude(10, %)
|> helix({ |> helix({
angle_start: 0, angleStart: 0,
ccw: true, ccw: true,
revolutions: 16, revolutions: 16
angle_start: 0
}, %) }, %)
``` ```
@ -34,7 +33,7 @@ const part001 = startSketchOn('XY')
```js ```js
{ {
// Start angle (in degrees). // Start angle (in degrees).
angle_start: number, angleStart: number,
// Is the helix rotation counter clockwise? The default is `false`. // Is the helix rotation counter clockwise? The default is `false`.
ccw: string, ccw: string,
// Length of the helix. If this argument is not provided, the height of the extrude group is used. // Length of the helix. If this argument is not provided, the height of the extrude group is used.
@ -51,15 +50,21 @@ const part001 = startSketchOn('XY')
// Chamfers or fillets on this extrude group. // Chamfers or fillets on this extrude group.
filletOrChamfers: [{ filletOrChamfers: [{
// The engine id of the edge to fillet. // The engine id of the edge to fillet.
edge_id: uuid, edgeId: uuid,
// The id of the engine command that called this fillet. // The id of the engine command that called this fillet.
id: uuid, id: uuid,
radius: number, radius: number,
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "fillet", type: "fillet",
} | } |
{ {
// The engine id of the edge to chamfer. // The engine id of the edge to chamfer.
edge_id: uuid, edgeId: uuid,
// The id of the engine command that called this chamfer. // The id of the engine command that called this chamfer.
id: uuid, id: uuid,
length: number, length: number,
@ -77,7 +82,7 @@ const part001 = startSketchOn('XY')
id: uuid, id: uuid,
// The sketch group. // The sketch group.
sketchGroup: { sketchGroup: {
// The id of the sketch group. // The id of the sketch group (this will change when the engine's reference to it changes.
id: uuid, id: uuid,
// What the sketch is on (can be a plane or a face). // What the sketch is on (can be a plane or a face).
on: { on: {
@ -119,15 +124,21 @@ const part001 = startSketchOn('XY')
// Chamfers or fillets on this extrude group. // Chamfers or fillets on this extrude group.
filletOrChamfers: [{ filletOrChamfers: [{
// The engine id of the edge to fillet. // The engine id of the edge to fillet.
edge_id: uuid, edgeId: uuid,
// The id of the engine command that called this fillet. // The id of the engine command that called this fillet.
id: uuid, id: uuid,
radius: number, radius: number,
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "fillet", type: "fillet",
} | } |
{ {
// The engine id of the edge to chamfer. // The engine id of the edge to chamfer.
edge_id: uuid, edgeId: uuid,
// The id of the engine command that called this chamfer. // The id of the engine command that called this chamfer.
id: uuid, id: uuid,
length: number, length: number,
@ -179,6 +190,38 @@ const part001 = startSketchOn('XY')
value: string, value: string,
}, },
type: "extrudeArc", type: "extrudeArc",
} |
{
// The id for the chamfer surface.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "chamfer",
} |
{
// The id for the fillet surface.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "fillet",
}], }],
}, },
// The id of the face. // The id of the face.
@ -352,6 +395,38 @@ const part001 = startSketchOn('XY')
value: string, value: string,
}, },
type: "extrudeArc", type: "extrudeArc",
} |
{
// The id for the chamfer surface.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "chamfer",
} |
{
// The id for the fillet surface.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "fillet",
}], }],
} }
``` ```
@ -366,15 +441,21 @@ const part001 = startSketchOn('XY')
// Chamfers or fillets on this extrude group. // Chamfers or fillets on this extrude group.
filletOrChamfers: [{ filletOrChamfers: [{
// The engine id of the edge to fillet. // The engine id of the edge to fillet.
edge_id: uuid, edgeId: uuid,
// The id of the engine command that called this fillet. // The id of the engine command that called this fillet.
id: uuid, id: uuid,
radius: number, radius: number,
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "fillet", type: "fillet",
} | } |
{ {
// The engine id of the edge to chamfer. // The engine id of the edge to chamfer.
edge_id: uuid, edgeId: uuid,
// The id of the engine command that called this chamfer. // The id of the engine command that called this chamfer.
id: uuid, id: uuid,
length: number, length: number,
@ -392,7 +473,7 @@ const part001 = startSketchOn('XY')
id: uuid, id: uuid,
// The sketch group. // The sketch group.
sketchGroup: { sketchGroup: {
// The id of the sketch group. // The id of the sketch group (this will change when the engine's reference to it changes.
id: uuid, id: uuid,
// What the sketch is on (can be a plane or a face). // What the sketch is on (can be a plane or a face).
on: { on: {
@ -434,15 +515,21 @@ const part001 = startSketchOn('XY')
// Chamfers or fillets on this extrude group. // Chamfers or fillets on this extrude group.
filletOrChamfers: [{ filletOrChamfers: [{
// The engine id of the edge to fillet. // The engine id of the edge to fillet.
edge_id: uuid, edgeId: uuid,
// The id of the engine command that called this fillet. // The id of the engine command that called this fillet.
id: uuid, id: uuid,
radius: number, radius: number,
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "fillet", type: "fillet",
} | } |
{ {
// The engine id of the edge to chamfer. // The engine id of the edge to chamfer.
edge_id: uuid, edgeId: uuid,
// The id of the engine command that called this chamfer. // The id of the engine command that called this chamfer.
id: uuid, id: uuid,
length: number, length: number,
@ -494,6 +581,38 @@ const part001 = startSketchOn('XY')
value: string, value: string,
}, },
type: "extrudeArc", type: "extrudeArc",
} |
{
// The id for the chamfer surface.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "chamfer",
} |
{
// The id for the fillet surface.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "fillet",
}], }],
}, },
// The id of the face. // The id of the face.
@ -667,6 +786,38 @@ const part001 = startSketchOn('XY')
value: string, value: string,
}, },
type: "extrudeArc", type: "extrudeArc",
} |
{
// The id for the chamfer surface.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "chamfer",
} |
{
// The id for the fillet surface.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "fillet",
}], }],
} }
``` ```

View File

@ -53,7 +53,7 @@ const example = extrude(1, exampleSketch)
* `hole_sketch_group`: `SketchGroupSet` - A sketch group or a group of sketch groups. (REQUIRED) * `hole_sketch_group`: `SketchGroupSet` - A sketch group or a group of sketch groups. (REQUIRED)
```js ```js
{ {
// The id of the sketch group. // The id of the sketch group (this will change when the engine's reference to it changes.
id: uuid, id: uuid,
// What the sketch is on (can be a plane or a face). // What the sketch is on (can be a plane or a face).
on: { on: {
@ -95,15 +95,21 @@ const example = extrude(1, exampleSketch)
// Chamfers or fillets on this extrude group. // Chamfers or fillets on this extrude group.
filletOrChamfers: [{ filletOrChamfers: [{
// The engine id of the edge to fillet. // The engine id of the edge to fillet.
edge_id: uuid, edgeId: uuid,
// The id of the engine command that called this fillet. // The id of the engine command that called this fillet.
id: uuid, id: uuid,
radius: number, radius: number,
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "fillet", type: "fillet",
} | } |
{ {
// The engine id of the edge to chamfer. // The engine id of the edge to chamfer.
edge_id: uuid, edgeId: uuid,
// The id of the engine command that called this chamfer. // The id of the engine command that called this chamfer.
id: uuid, id: uuid,
length: number, length: number,
@ -121,7 +127,7 @@ const example = extrude(1, exampleSketch)
id: uuid, id: uuid,
// The sketch group. // The sketch group.
sketchGroup: { sketchGroup: {
// The id of the sketch group. // The id of the sketch group (this will change when the engine's reference to it changes.
id: uuid, id: uuid,
// What the sketch is on (can be a plane or a face). // What the sketch is on (can be a plane or a face).
on: SketchSurface, on: SketchSurface,
@ -272,6 +278,38 @@ const example = extrude(1, exampleSketch)
value: string, value: string,
}, },
type: "extrudeArc", type: "extrudeArc",
} |
{
// The id for the chamfer surface.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "chamfer",
} |
{
// The id for the fillet surface.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "fillet",
}], }],
}, },
// The id of the face. // The id of the face.
@ -419,7 +457,7 @@ const example = extrude(1, exampleSketch)
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED) * `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
```js ```js
{ {
// The id of the sketch group. // The id of the sketch group (this will change when the engine's reference to it changes.
id: uuid, id: uuid,
// What the sketch is on (can be a plane or a face). // What the sketch is on (can be a plane or a face).
on: { on: {
@ -461,15 +499,21 @@ const example = extrude(1, exampleSketch)
// Chamfers or fillets on this extrude group. // Chamfers or fillets on this extrude group.
filletOrChamfers: [{ filletOrChamfers: [{
// The engine id of the edge to fillet. // The engine id of the edge to fillet.
edge_id: uuid, edgeId: uuid,
// The id of the engine command that called this fillet. // The id of the engine command that called this fillet.
id: uuid, id: uuid,
radius: number, radius: number,
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "fillet", type: "fillet",
} | } |
{ {
// The engine id of the edge to chamfer. // The engine id of the edge to chamfer.
edge_id: uuid, edgeId: uuid,
// The id of the engine command that called this chamfer. // The id of the engine command that called this chamfer.
id: uuid, id: uuid,
length: number, length: number,
@ -487,7 +531,7 @@ const example = extrude(1, exampleSketch)
id: uuid, id: uuid,
// The sketch group. // The sketch group.
sketchGroup: { sketchGroup: {
// The id of the sketch group. // The id of the sketch group (this will change when the engine's reference to it changes.
id: uuid, id: uuid,
// What the sketch is on (can be a plane or a face). // What the sketch is on (can be a plane or a face).
on: SketchSurface, on: SketchSurface,
@ -638,6 +682,38 @@ const example = extrude(1, exampleSketch)
value: string, value: string,
}, },
type: "extrudeArc", type: "extrudeArc",
} |
{
// The id for the chamfer surface.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "chamfer",
} |
{
// The id for the fillet surface.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "fillet",
}], }],
}, },
// The id of the face. // The id of the face.
@ -784,7 +860,7 @@ const example = extrude(1, exampleSketch)
`SketchGroup` - A sketch group is a collection of paths. `SketchGroup` - A sketch group is a collection of paths.
```js ```js
{ {
// The id of the sketch group. // The id of the sketch group (this will change when the engine's reference to it changes.
id: uuid, id: uuid,
// What the sketch is on (can be a plane or a face). // What the sketch is on (can be a plane or a face).
on: { on: {
@ -826,15 +902,21 @@ const example = extrude(1, exampleSketch)
// Chamfers or fillets on this extrude group. // Chamfers or fillets on this extrude group.
filletOrChamfers: [{ filletOrChamfers: [{
// The engine id of the edge to fillet. // The engine id of the edge to fillet.
edge_id: uuid, edgeId: uuid,
// The id of the engine command that called this fillet. // The id of the engine command that called this fillet.
id: uuid, id: uuid,
radius: number, radius: number,
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "fillet", type: "fillet",
} | } |
{ {
// The engine id of the edge to chamfer. // The engine id of the edge to chamfer.
edge_id: uuid, edgeId: uuid,
// The id of the engine command that called this chamfer. // The id of the engine command that called this chamfer.
id: uuid, id: uuid,
length: number, length: number,
@ -852,7 +934,7 @@ const example = extrude(1, exampleSketch)
id: uuid, id: uuid,
// The sketch group. // The sketch group.
sketchGroup: { sketchGroup: {
// The id of the sketch group. // The id of the sketch group (this will change when the engine's reference to it changes.
id: uuid, id: uuid,
// What the sketch is on (can be a plane or a face). // What the sketch is on (can be a plane or a face).
on: SketchSurface, on: SketchSurface,
@ -1003,6 +1085,38 @@ const example = extrude(1, exampleSketch)
value: string, value: string,
}, },
type: "extrudeArc", type: "extrudeArc",
} |
{
// The id for the chamfer surface.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "chamfer",
} |
{
// The id for the fillet surface.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "fillet",
}], }],
}, },
// The id of the face. // The id of the face.

View File

@ -20,6 +20,11 @@ layout: manual
* [`angledLineToY`](kcl/angledLineToY) * [`angledLineToY`](kcl/angledLineToY)
* [`arc`](kcl/arc) * [`arc`](kcl/arc)
* [`asin`](kcl/asin) * [`asin`](kcl/asin)
* [`assert`](kcl/assert)
* [`assertGreaterThan`](kcl/assertGreaterThan)
* [`assertGreaterThanOrEq`](kcl/assertGreaterThanOrEq)
* [`assertLessThan`](kcl/assertLessThan)
* [`assertLessThanOrEq`](kcl/assertLessThanOrEq)
* [`atan`](kcl/atan) * [`atan`](kcl/atan)
* [`bezierCurve`](kcl/bezierCurve) * [`bezierCurve`](kcl/bezierCurve)
* [`ceil`](kcl/ceil) * [`ceil`](kcl/ceil)
@ -31,13 +36,13 @@ layout: manual
* [`extrude`](kcl/extrude) * [`extrude`](kcl/extrude)
* [`fillet`](kcl/fillet) * [`fillet`](kcl/fillet)
* [`floor`](kcl/floor) * [`floor`](kcl/floor)
* [`getEdge`](kcl/getEdge)
* [`getNextAdjacentEdge`](kcl/getNextAdjacentEdge) * [`getNextAdjacentEdge`](kcl/getNextAdjacentEdge)
* [`getOppositeEdge`](kcl/getOppositeEdge) * [`getOppositeEdge`](kcl/getOppositeEdge)
* [`getPreviousAdjacentEdge`](kcl/getPreviousAdjacentEdge) * [`getPreviousAdjacentEdge`](kcl/getPreviousAdjacentEdge)
* [`helix`](kcl/helix) * [`helix`](kcl/helix)
* [`hole`](kcl/hole) * [`hole`](kcl/hole)
* [`import`](kcl/import) * [`import`](kcl/import)
* [`int`](kcl/int)
* [`lastSegX`](kcl/lastSegX) * [`lastSegX`](kcl/lastSegX)
* [`lastSegY`](kcl/lastSegY) * [`lastSegY`](kcl/lastSegY)
* [`legAngX`](kcl/legAngX) * [`legAngX`](kcl/legAngX)
@ -57,6 +62,7 @@ layout: manual
* [`patternLinear3d`](kcl/patternLinear3d) * [`patternLinear3d`](kcl/patternLinear3d)
* [`patternTransform`](kcl/patternTransform) * [`patternTransform`](kcl/patternTransform)
* [`pi`](kcl/pi) * [`pi`](kcl/pi)
* [`polar`](kcl/polar)
* [`pow`](kcl/pow) * [`pow`](kcl/pow)
* [`profileStart`](kcl/profileStart) * [`profileStart`](kcl/profileStart)
* [`profileStartX`](kcl/profileStartX) * [`profileStartX`](kcl/profileStartX)

43
docs/kcl/int.md Normal file

File diff suppressed because one or more lines are too long

View File

@ -33,7 +33,7 @@ const example = extrude(5, exampleSketch)
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED) * `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
```js ```js
{ {
// The id of the sketch group. // The id of the sketch group (this will change when the engine's reference to it changes.
id: uuid, id: uuid,
// What the sketch is on (can be a plane or a face). // What the sketch is on (can be a plane or a face).
on: { on: {
@ -75,15 +75,21 @@ const example = extrude(5, exampleSketch)
// Chamfers or fillets on this extrude group. // Chamfers or fillets on this extrude group.
filletOrChamfers: [{ filletOrChamfers: [{
// The engine id of the edge to fillet. // The engine id of the edge to fillet.
edge_id: uuid, edgeId: uuid,
// The id of the engine command that called this fillet. // The id of the engine command that called this fillet.
id: uuid, id: uuid,
radius: number, radius: number,
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "fillet", type: "fillet",
} | } |
{ {
// The engine id of the edge to chamfer. // The engine id of the edge to chamfer.
edge_id: uuid, edgeId: uuid,
// The id of the engine command that called this chamfer. // The id of the engine command that called this chamfer.
id: uuid, id: uuid,
length: number, length: number,
@ -101,7 +107,7 @@ const example = extrude(5, exampleSketch)
id: uuid, id: uuid,
// The sketch group. // The sketch group.
sketchGroup: { sketchGroup: {
// The id of the sketch group. // The id of the sketch group (this will change when the engine's reference to it changes.
id: uuid, id: uuid,
// What the sketch is on (can be a plane or a face). // What the sketch is on (can be a plane or a face).
on: SketchSurface, on: SketchSurface,
@ -252,6 +258,38 @@ const example = extrude(5, exampleSketch)
value: string, value: string,
}, },
type: "extrudeArc", type: "extrudeArc",
} |
{
// The id for the chamfer surface.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "chamfer",
} |
{
// The id for the fillet surface.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "fillet",
}], }],
}, },
// The id of the face. // The id of the face.

View File

@ -33,7 +33,7 @@ const example = extrude(5, exampleSketch)
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED) * `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
```js ```js
{ {
// The id of the sketch group. // The id of the sketch group (this will change when the engine's reference to it changes.
id: uuid, id: uuid,
// What the sketch is on (can be a plane or a face). // What the sketch is on (can be a plane or a face).
on: { on: {
@ -75,15 +75,21 @@ const example = extrude(5, exampleSketch)
// Chamfers or fillets on this extrude group. // Chamfers or fillets on this extrude group.
filletOrChamfers: [{ filletOrChamfers: [{
// The engine id of the edge to fillet. // The engine id of the edge to fillet.
edge_id: uuid, edgeId: uuid,
// The id of the engine command that called this fillet. // The id of the engine command that called this fillet.
id: uuid, id: uuid,
radius: number, radius: number,
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "fillet", type: "fillet",
} | } |
{ {
// The engine id of the edge to chamfer. // The engine id of the edge to chamfer.
edge_id: uuid, edgeId: uuid,
// The id of the engine command that called this chamfer. // The id of the engine command that called this chamfer.
id: uuid, id: uuid,
length: number, length: number,
@ -101,7 +107,7 @@ const example = extrude(5, exampleSketch)
id: uuid, id: uuid,
// The sketch group. // The sketch group.
sketchGroup: { sketchGroup: {
// The id of the sketch group. // The id of the sketch group (this will change when the engine's reference to it changes.
id: uuid, id: uuid,
// What the sketch is on (can be a plane or a face). // What the sketch is on (can be a plane or a face).
on: SketchSurface, on: SketchSurface,
@ -252,6 +258,38 @@ const example = extrude(5, exampleSketch)
value: string, value: string,
}, },
type: "extrudeArc", type: "extrudeArc",
} |
{
// The id for the chamfer surface.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "chamfer",
} |
{
// The id for the fillet surface.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "fillet",
}], }],
}, },
// The id of the face. // The id of the face.

View File

@ -46,7 +46,7 @@ const example = extrude(5, exampleSketch)
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED) * `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
```js ```js
{ {
// The id of the sketch group. // The id of the sketch group (this will change when the engine's reference to it changes.
id: uuid, id: uuid,
// What the sketch is on (can be a plane or a face). // What the sketch is on (can be a plane or a face).
on: { on: {
@ -88,15 +88,21 @@ const example = extrude(5, exampleSketch)
// Chamfers or fillets on this extrude group. // Chamfers or fillets on this extrude group.
filletOrChamfers: [{ filletOrChamfers: [{
// The engine id of the edge to fillet. // The engine id of the edge to fillet.
edge_id: uuid, edgeId: uuid,
// The id of the engine command that called this fillet. // The id of the engine command that called this fillet.
id: uuid, id: uuid,
radius: number, radius: number,
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "fillet", type: "fillet",
} | } |
{ {
// The engine id of the edge to chamfer. // The engine id of the edge to chamfer.
edge_id: uuid, edgeId: uuid,
// The id of the engine command that called this chamfer. // The id of the engine command that called this chamfer.
id: uuid, id: uuid,
length: number, length: number,
@ -114,7 +120,7 @@ const example = extrude(5, exampleSketch)
id: uuid, id: uuid,
// The sketch group. // The sketch group.
sketchGroup: { sketchGroup: {
// The id of the sketch group. // The id of the sketch group (this will change when the engine's reference to it changes.
id: uuid, id: uuid,
// What the sketch is on (can be a plane or a face). // What the sketch is on (can be a plane or a face).
on: SketchSurface, on: SketchSurface,
@ -265,6 +271,38 @@ const example = extrude(5, exampleSketch)
value: string, value: string,
}, },
type: "extrudeArc", type: "extrudeArc",
} |
{
// The id for the chamfer surface.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "chamfer",
} |
{
// The id for the fillet surface.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "fillet",
}], }],
}, },
// The id of the face. // The id of the face.
@ -420,7 +458,7 @@ const example = extrude(5, exampleSketch)
`SketchGroup` - A sketch group is a collection of paths. `SketchGroup` - A sketch group is a collection of paths.
```js ```js
{ {
// The id of the sketch group. // The id of the sketch group (this will change when the engine's reference to it changes.
id: uuid, id: uuid,
// What the sketch is on (can be a plane or a face). // What the sketch is on (can be a plane or a face).
on: { on: {
@ -462,15 +500,21 @@ const example = extrude(5, exampleSketch)
// Chamfers or fillets on this extrude group. // Chamfers or fillets on this extrude group.
filletOrChamfers: [{ filletOrChamfers: [{
// The engine id of the edge to fillet. // The engine id of the edge to fillet.
edge_id: uuid, edgeId: uuid,
// The id of the engine command that called this fillet. // The id of the engine command that called this fillet.
id: uuid, id: uuid,
radius: number, radius: number,
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "fillet", type: "fillet",
} | } |
{ {
// The engine id of the edge to chamfer. // The engine id of the edge to chamfer.
edge_id: uuid, edgeId: uuid,
// The id of the engine command that called this chamfer. // The id of the engine command that called this chamfer.
id: uuid, id: uuid,
length: number, length: number,
@ -488,7 +532,7 @@ const example = extrude(5, exampleSketch)
id: uuid, id: uuid,
// The sketch group. // The sketch group.
sketchGroup: { sketchGroup: {
// The id of the sketch group. // The id of the sketch group (this will change when the engine's reference to it changes.
id: uuid, id: uuid,
// What the sketch is on (can be a plane or a face). // What the sketch is on (can be a plane or a face).
on: SketchSurface, on: SketchSurface,
@ -639,6 +683,38 @@ const example = extrude(5, exampleSketch)
value: string, value: string,
}, },
type: "extrudeArc", type: "extrudeArc",
} |
{
// The id for the chamfer surface.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "chamfer",
} |
{
// The id for the fillet surface.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "fillet",
}], }],
}, },
// The id of the face. // The id of the face.

View File

@ -33,7 +33,7 @@ const example = extrude(5, exampleSketch)
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED) * `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
```js ```js
{ {
// The id of the sketch group. // The id of the sketch group (this will change when the engine's reference to it changes.
id: uuid, id: uuid,
// What the sketch is on (can be a plane or a face). // What the sketch is on (can be a plane or a face).
on: { on: {
@ -75,15 +75,21 @@ const example = extrude(5, exampleSketch)
// Chamfers or fillets on this extrude group. // Chamfers or fillets on this extrude group.
filletOrChamfers: [{ filletOrChamfers: [{
// The engine id of the edge to fillet. // The engine id of the edge to fillet.
edge_id: uuid, edgeId: uuid,
// The id of the engine command that called this fillet. // The id of the engine command that called this fillet.
id: uuid, id: uuid,
radius: number, radius: number,
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "fillet", type: "fillet",
} | } |
{ {
// The engine id of the edge to chamfer. // The engine id of the edge to chamfer.
edge_id: uuid, edgeId: uuid,
// The id of the engine command that called this chamfer. // The id of the engine command that called this chamfer.
id: uuid, id: uuid,
length: number, length: number,
@ -101,7 +107,7 @@ const example = extrude(5, exampleSketch)
id: uuid, id: uuid,
// The sketch group. // The sketch group.
sketchGroup: { sketchGroup: {
// The id of the sketch group. // The id of the sketch group (this will change when the engine's reference to it changes.
id: uuid, id: uuid,
// What the sketch is on (can be a plane or a face). // What the sketch is on (can be a plane or a face).
on: SketchSurface, on: SketchSurface,
@ -252,6 +258,38 @@ const example = extrude(5, exampleSketch)
value: string, value: string,
}, },
type: "extrudeArc", type: "extrudeArc",
} |
{
// The id for the chamfer surface.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "chamfer",
} |
{
// The id for the fillet surface.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "fillet",
}], }],
}, },
// The id of the face. // The id of the face.
@ -407,7 +445,7 @@ const example = extrude(5, exampleSketch)
`SketchGroup` - A sketch group is a collection of paths. `SketchGroup` - A sketch group is a collection of paths.
```js ```js
{ {
// The id of the sketch group. // The id of the sketch group (this will change when the engine's reference to it changes.
id: uuid, id: uuid,
// What the sketch is on (can be a plane or a face). // What the sketch is on (can be a plane or a face).
on: { on: {
@ -449,15 +487,21 @@ const example = extrude(5, exampleSketch)
// Chamfers or fillets on this extrude group. // Chamfers or fillets on this extrude group.
filletOrChamfers: [{ filletOrChamfers: [{
// The engine id of the edge to fillet. // The engine id of the edge to fillet.
edge_id: uuid, edgeId: uuid,
// The id of the engine command that called this fillet. // The id of the engine command that called this fillet.
id: uuid, id: uuid,
radius: number, radius: number,
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "fillet", type: "fillet",
} | } |
{ {
// The engine id of the edge to chamfer. // The engine id of the edge to chamfer.
edge_id: uuid, edgeId: uuid,
// The id of the engine command that called this chamfer. // The id of the engine command that called this chamfer.
id: uuid, id: uuid,
length: number, length: number,
@ -475,7 +519,7 @@ const example = extrude(5, exampleSketch)
id: uuid, id: uuid,
// The sketch group. // The sketch group.
sketchGroup: { sketchGroup: {
// The id of the sketch group. // The id of the sketch group (this will change when the engine's reference to it changes.
id: uuid, id: uuid,
// What the sketch is on (can be a plane or a face). // What the sketch is on (can be a plane or a face).
on: SketchSurface, on: SketchSurface,
@ -626,6 +670,38 @@ const example = extrude(5, exampleSketch)
value: string, value: string,
}, },
type: "extrudeArc", type: "extrudeArc",
} |
{
// The id for the chamfer surface.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "chamfer",
} |
{
// The id for the fillet surface.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "fillet",
}], }],
}, },
// The id of the face. // The id of the face.

View File

@ -51,7 +51,7 @@ const example = extrude(1, exampleSketch)
* `sketch_group_set`: `SketchGroupSet` - A sketch group or a group of sketch groups. (REQUIRED) * `sketch_group_set`: `SketchGroupSet` - A sketch group or a group of sketch groups. (REQUIRED)
```js ```js
{ {
// The id of the sketch group. // The id of the sketch group (this will change when the engine's reference to it changes.
id: uuid, id: uuid,
// What the sketch is on (can be a plane or a face). // What the sketch is on (can be a plane or a face).
on: { on: {
@ -93,15 +93,21 @@ const example = extrude(1, exampleSketch)
// Chamfers or fillets on this extrude group. // Chamfers or fillets on this extrude group.
filletOrChamfers: [{ filletOrChamfers: [{
// The engine id of the edge to fillet. // The engine id of the edge to fillet.
edge_id: uuid, edgeId: uuid,
// The id of the engine command that called this fillet. // The id of the engine command that called this fillet.
id: uuid, id: uuid,
radius: number, radius: number,
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "fillet", type: "fillet",
} | } |
{ {
// The engine id of the edge to chamfer. // The engine id of the edge to chamfer.
edge_id: uuid, edgeId: uuid,
// The id of the engine command that called this chamfer. // The id of the engine command that called this chamfer.
id: uuid, id: uuid,
length: number, length: number,
@ -119,7 +125,7 @@ const example = extrude(1, exampleSketch)
id: uuid, id: uuid,
// The sketch group. // The sketch group.
sketchGroup: { sketchGroup: {
// The id of the sketch group. // The id of the sketch group (this will change when the engine's reference to it changes.
id: uuid, id: uuid,
// What the sketch is on (can be a plane or a face). // What the sketch is on (can be a plane or a face).
on: SketchSurface, on: SketchSurface,
@ -270,6 +276,38 @@ const example = extrude(1, exampleSketch)
value: string, value: string,
}, },
type: "extrudeArc", type: "extrudeArc",
} |
{
// The id for the chamfer surface.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "chamfer",
} |
{
// The id for the fillet surface.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "fillet",
}], }],
}, },
// The id of the face. // The id of the face.

View File

@ -55,15 +55,21 @@ const example = extrude(-5, exampleSketch)
// Chamfers or fillets on this extrude group. // Chamfers or fillets on this extrude group.
filletOrChamfers: [{ filletOrChamfers: [{
// The engine id of the edge to fillet. // The engine id of the edge to fillet.
edge_id: uuid, edgeId: uuid,
// The id of the engine command that called this fillet. // The id of the engine command that called this fillet.
id: uuid, id: uuid,
radius: number, radius: number,
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "fillet", type: "fillet",
} | } |
{ {
// The engine id of the edge to chamfer. // The engine id of the edge to chamfer.
edge_id: uuid, edgeId: uuid,
// The id of the engine command that called this chamfer. // The id of the engine command that called this chamfer.
id: uuid, id: uuid,
length: number, length: number,
@ -81,7 +87,7 @@ const example = extrude(-5, exampleSketch)
id: uuid, id: uuid,
// The sketch group. // The sketch group.
sketchGroup: { sketchGroup: {
// The id of the sketch group. // The id of the sketch group (this will change when the engine's reference to it changes.
id: uuid, id: uuid,
// What the sketch is on (can be a plane or a face). // What the sketch is on (can be a plane or a face).
on: { on: {
@ -123,15 +129,21 @@ const example = extrude(-5, exampleSketch)
// Chamfers or fillets on this extrude group. // Chamfers or fillets on this extrude group.
filletOrChamfers: [{ filletOrChamfers: [{
// The engine id of the edge to fillet. // The engine id of the edge to fillet.
edge_id: uuid, edgeId: uuid,
// The id of the engine command that called this fillet. // The id of the engine command that called this fillet.
id: uuid, id: uuid,
radius: number, radius: number,
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "fillet", type: "fillet",
} | } |
{ {
// The engine id of the edge to chamfer. // The engine id of the edge to chamfer.
edge_id: uuid, edgeId: uuid,
// The id of the engine command that called this chamfer. // The id of the engine command that called this chamfer.
id: uuid, id: uuid,
length: number, length: number,
@ -183,6 +195,38 @@ const example = extrude(-5, exampleSketch)
value: string, value: string,
}, },
type: "extrudeArc", type: "extrudeArc",
} |
{
// The id for the chamfer surface.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "chamfer",
} |
{
// The id for the fillet surface.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "fillet",
}], }],
}, },
// The id of the face. // The id of the face.
@ -357,6 +401,38 @@ const example = extrude(-5, exampleSketch)
value: string, value: string,
}, },
type: "extrudeArc", type: "extrudeArc",
} |
{
// The id for the chamfer surface.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "chamfer",
} |
{
// The id for the fillet surface.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "fillet",
}], }],
} | } |
{ {

View File

@ -44,7 +44,7 @@ const example = extrude(1, exampleSketch)
* `sketch_group_set`: `SketchGroupSet` - A sketch group or a group of sketch groups. (REQUIRED) * `sketch_group_set`: `SketchGroupSet` - A sketch group or a group of sketch groups. (REQUIRED)
```js ```js
{ {
// The id of the sketch group. // The id of the sketch group (this will change when the engine's reference to it changes.
id: uuid, id: uuid,
// What the sketch is on (can be a plane or a face). // What the sketch is on (can be a plane or a face).
on: { on: {
@ -86,15 +86,21 @@ const example = extrude(1, exampleSketch)
// Chamfers or fillets on this extrude group. // Chamfers or fillets on this extrude group.
filletOrChamfers: [{ filletOrChamfers: [{
// The engine id of the edge to fillet. // The engine id of the edge to fillet.
edge_id: uuid, edgeId: uuid,
// The id of the engine command that called this fillet. // The id of the engine command that called this fillet.
id: uuid, id: uuid,
radius: number, radius: number,
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "fillet", type: "fillet",
} | } |
{ {
// The engine id of the edge to chamfer. // The engine id of the edge to chamfer.
edge_id: uuid, edgeId: uuid,
// The id of the engine command that called this chamfer. // The id of the engine command that called this chamfer.
id: uuid, id: uuid,
length: number, length: number,
@ -112,7 +118,7 @@ const example = extrude(1, exampleSketch)
id: uuid, id: uuid,
// The sketch group. // The sketch group.
sketchGroup: { sketchGroup: {
// The id of the sketch group. // The id of the sketch group (this will change when the engine's reference to it changes.
id: uuid, id: uuid,
// What the sketch is on (can be a plane or a face). // What the sketch is on (can be a plane or a face).
on: SketchSurface, on: SketchSurface,
@ -263,6 +269,38 @@ const example = extrude(1, exampleSketch)
value: string, value: string,
}, },
type: "extrudeArc", type: "extrudeArc",
} |
{
// The id for the chamfer surface.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "chamfer",
} |
{
// The id for the fillet surface.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "fillet",
}], }],
}, },
// The id of the face. // The id of the face.

View File

@ -53,15 +53,21 @@ const example = extrude(1, exampleSketch)
// Chamfers or fillets on this extrude group. // Chamfers or fillets on this extrude group.
filletOrChamfers: [{ filletOrChamfers: [{
// The engine id of the edge to fillet. // The engine id of the edge to fillet.
edge_id: uuid, edgeId: uuid,
// The id of the engine command that called this fillet. // The id of the engine command that called this fillet.
id: uuid, id: uuid,
radius: number, radius: number,
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "fillet", type: "fillet",
} | } |
{ {
// The engine id of the edge to chamfer. // The engine id of the edge to chamfer.
edge_id: uuid, edgeId: uuid,
// The id of the engine command that called this chamfer. // The id of the engine command that called this chamfer.
id: uuid, id: uuid,
length: number, length: number,
@ -79,7 +85,7 @@ const example = extrude(1, exampleSketch)
id: uuid, id: uuid,
// The sketch group. // The sketch group.
sketchGroup: { sketchGroup: {
// The id of the sketch group. // The id of the sketch group (this will change when the engine's reference to it changes.
id: uuid, id: uuid,
// What the sketch is on (can be a plane or a face). // What the sketch is on (can be a plane or a face).
on: { on: {
@ -121,15 +127,21 @@ const example = extrude(1, exampleSketch)
// Chamfers or fillets on this extrude group. // Chamfers or fillets on this extrude group.
filletOrChamfers: [{ filletOrChamfers: [{
// The engine id of the edge to fillet. // The engine id of the edge to fillet.
edge_id: uuid, edgeId: uuid,
// The id of the engine command that called this fillet. // The id of the engine command that called this fillet.
id: uuid, id: uuid,
radius: number, radius: number,
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "fillet", type: "fillet",
} | } |
{ {
// The engine id of the edge to chamfer. // The engine id of the edge to chamfer.
edge_id: uuid, edgeId: uuid,
// The id of the engine command that called this chamfer. // The id of the engine command that called this chamfer.
id: uuid, id: uuid,
length: number, length: number,
@ -181,6 +193,38 @@ const example = extrude(1, exampleSketch)
value: string, value: string,
}, },
type: "extrudeArc", type: "extrudeArc",
} |
{
// The id for the chamfer surface.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "chamfer",
} |
{
// The id for the fillet surface.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "fillet",
}], }],
}, },
// The id of the face. // The id of the face.
@ -355,6 +399,38 @@ const example = extrude(1, exampleSketch)
value: string, value: string,
}, },
type: "extrudeArc", type: "extrudeArc",
} |
{
// The id for the chamfer surface.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "chamfer",
} |
{
// The id for the fillet surface.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "fillet",
}], }],
} | } |
{ {

View File

@ -55,15 +55,21 @@ let vase = layer()
// Chamfers or fillets on this extrude group. // Chamfers or fillets on this extrude group.
filletOrChamfers: [{ filletOrChamfers: [{
// The engine id of the edge to fillet. // The engine id of the edge to fillet.
edge_id: uuid, edgeId: uuid,
// The id of the engine command that called this fillet. // The id of the engine command that called this fillet.
id: uuid, id: uuid,
radius: number, radius: number,
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "fillet", type: "fillet",
} | } |
{ {
// The engine id of the edge to chamfer. // The engine id of the edge to chamfer.
edge_id: uuid, edgeId: uuid,
// The id of the engine command that called this chamfer. // The id of the engine command that called this chamfer.
id: uuid, id: uuid,
length: number, length: number,
@ -81,7 +87,7 @@ let vase = layer()
id: uuid, id: uuid,
// The sketch group. // The sketch group.
sketchGroup: { sketchGroup: {
// The id of the sketch group. // The id of the sketch group (this will change when the engine's reference to it changes.
id: uuid, id: uuid,
// What the sketch is on (can be a plane or a face). // What the sketch is on (can be a plane or a face).
on: { on: {
@ -123,15 +129,21 @@ let vase = layer()
// Chamfers or fillets on this extrude group. // Chamfers or fillets on this extrude group.
filletOrChamfers: [{ filletOrChamfers: [{
// The engine id of the edge to fillet. // The engine id of the edge to fillet.
edge_id: uuid, edgeId: uuid,
// The id of the engine command that called this fillet. // The id of the engine command that called this fillet.
id: uuid, id: uuid,
radius: number, radius: number,
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "fillet", type: "fillet",
} | } |
{ {
// The engine id of the edge to chamfer. // The engine id of the edge to chamfer.
edge_id: uuid, edgeId: uuid,
// The id of the engine command that called this chamfer. // The id of the engine command that called this chamfer.
id: uuid, id: uuid,
length: number, length: number,
@ -183,6 +195,38 @@ let vase = layer()
value: string, value: string,
}, },
type: "extrudeArc", type: "extrudeArc",
} |
{
// The id for the chamfer surface.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "chamfer",
} |
{
// The id for the fillet surface.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "fillet",
}], }],
}, },
// The id of the face. // The id of the face.
@ -357,6 +401,38 @@ let vase = layer()
value: string, value: string,
}, },
type: "extrudeArc", type: "extrudeArc",
} |
{
// The id for the chamfer surface.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "chamfer",
} |
{
// The id for the fillet surface.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "fillet",
}], }],
} | } |
{ {

48
docs/kcl/polar.md Normal file

File diff suppressed because one or more lines are too long

View File

@ -19,7 +19,7 @@ const sketch001 = startSketchOn('XY')
|> startProfileAt([5, 2], %) |> startProfileAt([5, 2], %)
|> angledLine({ angle: 120, length: 50 }, %, $seg01) |> angledLine({ angle: 120, length: 50 }, %, $seg01)
|> angledLine({ |> angledLine({
angle: segAng(seg01, %) + 120, angle: segAng(seg01) + 120,
length: 50 length: 50
}, %) }, %)
|> lineTo(profileStart(%), %) |> lineTo(profileStart(%), %)
@ -34,7 +34,7 @@ const sketch001 = startSketchOn('XY')
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED) * `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
```js ```js
{ {
// The id of the sketch group. // The id of the sketch group (this will change when the engine's reference to it changes.
id: uuid, id: uuid,
// What the sketch is on (can be a plane or a face). // What the sketch is on (can be a plane or a face).
on: { on: {
@ -76,15 +76,21 @@ const sketch001 = startSketchOn('XY')
// Chamfers or fillets on this extrude group. // Chamfers or fillets on this extrude group.
filletOrChamfers: [{ filletOrChamfers: [{
// The engine id of the edge to fillet. // The engine id of the edge to fillet.
edge_id: uuid, edgeId: uuid,
// The id of the engine command that called this fillet. // The id of the engine command that called this fillet.
id: uuid, id: uuid,
radius: number, radius: number,
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "fillet", type: "fillet",
} | } |
{ {
// The engine id of the edge to chamfer. // The engine id of the edge to chamfer.
edge_id: uuid, edgeId: uuid,
// The id of the engine command that called this chamfer. // The id of the engine command that called this chamfer.
id: uuid, id: uuid,
length: number, length: number,
@ -102,7 +108,7 @@ const sketch001 = startSketchOn('XY')
id: uuid, id: uuid,
// The sketch group. // The sketch group.
sketchGroup: { sketchGroup: {
// The id of the sketch group. // The id of the sketch group (this will change when the engine's reference to it changes.
id: uuid, id: uuid,
// What the sketch is on (can be a plane or a face). // What the sketch is on (can be a plane or a face).
on: SketchSurface, on: SketchSurface,
@ -253,6 +259,38 @@ const sketch001 = startSketchOn('XY')
value: string, value: string,
}, },
type: "extrudeArc", type: "extrudeArc",
} |
{
// The id for the chamfer surface.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "chamfer",
} |
{
// The id for the fillet surface.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "fillet",
}], }],
}, },
// The id of the face. // The id of the face.

View File

@ -29,7 +29,7 @@ const sketch001 = startSketchOn('XY')
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED) * `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
```js ```js
{ {
// The id of the sketch group. // The id of the sketch group (this will change when the engine's reference to it changes.
id: uuid, id: uuid,
// What the sketch is on (can be a plane or a face). // What the sketch is on (can be a plane or a face).
on: { on: {
@ -71,15 +71,21 @@ const sketch001 = startSketchOn('XY')
// Chamfers or fillets on this extrude group. // Chamfers or fillets on this extrude group.
filletOrChamfers: [{ filletOrChamfers: [{
// The engine id of the edge to fillet. // The engine id of the edge to fillet.
edge_id: uuid, edgeId: uuid,
// The id of the engine command that called this fillet. // The id of the engine command that called this fillet.
id: uuid, id: uuid,
radius: number, radius: number,
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "fillet", type: "fillet",
} | } |
{ {
// The engine id of the edge to chamfer. // The engine id of the edge to chamfer.
edge_id: uuid, edgeId: uuid,
// The id of the engine command that called this chamfer. // The id of the engine command that called this chamfer.
id: uuid, id: uuid,
length: number, length: number,
@ -97,7 +103,7 @@ const sketch001 = startSketchOn('XY')
id: uuid, id: uuid,
// The sketch group. // The sketch group.
sketchGroup: { sketchGroup: {
// The id of the sketch group. // The id of the sketch group (this will change when the engine's reference to it changes.
id: uuid, id: uuid,
// What the sketch is on (can be a plane or a face). // What the sketch is on (can be a plane or a face).
on: SketchSurface, on: SketchSurface,
@ -248,6 +254,38 @@ const sketch001 = startSketchOn('XY')
value: string, value: string,
}, },
type: "extrudeArc", type: "extrudeArc",
} |
{
// The id for the chamfer surface.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "chamfer",
} |
{
// The id for the fillet surface.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "fillet",
}], }],
}, },
// The id of the face. // The id of the face.

View File

@ -28,7 +28,7 @@ const sketch001 = startSketchOn('XY')
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED) * `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
```js ```js
{ {
// The id of the sketch group. // The id of the sketch group (this will change when the engine's reference to it changes.
id: uuid, id: uuid,
// What the sketch is on (can be a plane or a face). // What the sketch is on (can be a plane or a face).
on: { on: {
@ -70,15 +70,21 @@ const sketch001 = startSketchOn('XY')
// Chamfers or fillets on this extrude group. // Chamfers or fillets on this extrude group.
filletOrChamfers: [{ filletOrChamfers: [{
// The engine id of the edge to fillet. // The engine id of the edge to fillet.
edge_id: uuid, edgeId: uuid,
// The id of the engine command that called this fillet. // The id of the engine command that called this fillet.
id: uuid, id: uuid,
radius: number, radius: number,
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "fillet", type: "fillet",
} | } |
{ {
// The engine id of the edge to chamfer. // The engine id of the edge to chamfer.
edge_id: uuid, edgeId: uuid,
// The id of the engine command that called this chamfer. // The id of the engine command that called this chamfer.
id: uuid, id: uuid,
length: number, length: number,
@ -96,7 +102,7 @@ const sketch001 = startSketchOn('XY')
id: uuid, id: uuid,
// The sketch group. // The sketch group.
sketchGroup: { sketchGroup: {
// The id of the sketch group. // The id of the sketch group (this will change when the engine's reference to it changes.
id: uuid, id: uuid,
// What the sketch is on (can be a plane or a face). // What the sketch is on (can be a plane or a face).
on: SketchSurface, on: SketchSurface,
@ -247,6 +253,38 @@ const sketch001 = startSketchOn('XY')
value: string, value: string,
}, },
type: "extrudeArc", type: "extrudeArc",
} |
{
// The id for the chamfer surface.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "chamfer",
} |
{
// The id for the fillet surface.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "fillet",
}], }],
}, },
// The id of the face. // The id of the face.

View File

@ -107,7 +107,7 @@ const sketch001 = startSketchOn(box, "END")
|> circle([10, 10], 4, %) |> circle([10, 10], 4, %)
|> revolve({ |> revolve({
angle: 90, angle: 90,
axis: getOppositeEdge(revolveAxis, box) axis: getOppositeEdge(revolveAxis)
}, %) }, %)
``` ```
@ -157,6 +157,92 @@ const part001 = revolve({
} | } |
uuid | uuid |
{ {
// Engine information for a tag.
info: {
// The id of the tagged object.
id: uuid,
// The path the tag is on.
path: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The sketch group the tag is on.
sketchGroup: uuid,
// The surface information for the tag.
surface: {
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "extrudeArc",
} |
{
// The id for the chamfer surface.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "chamfer",
} |
{
// The id for the fillet surface.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "fillet",
},
},
value: string, value: string,
}, },
} }
@ -164,7 +250,7 @@ uuid |
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED) * `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
```js ```js
{ {
// The id of the sketch group. // The id of the sketch group (this will change when the engine's reference to it changes.
id: uuid, id: uuid,
// What the sketch is on (can be a plane or a face). // What the sketch is on (can be a plane or a face).
on: { on: {
@ -206,15 +292,21 @@ uuid |
// Chamfers or fillets on this extrude group. // Chamfers or fillets on this extrude group.
filletOrChamfers: [{ filletOrChamfers: [{
// The engine id of the edge to fillet. // The engine id of the edge to fillet.
edge_id: uuid, edgeId: uuid,
// The id of the engine command that called this fillet. // The id of the engine command that called this fillet.
id: uuid, id: uuid,
radius: number, radius: number,
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "fillet", type: "fillet",
} | } |
{ {
// The engine id of the edge to chamfer. // The engine id of the edge to chamfer.
edge_id: uuid, edgeId: uuid,
// The id of the engine command that called this chamfer. // The id of the engine command that called this chamfer.
id: uuid, id: uuid,
length: number, length: number,
@ -232,7 +324,7 @@ uuid |
id: uuid, id: uuid,
// The sketch group. // The sketch group.
sketchGroup: { sketchGroup: {
// The id of the sketch group. // The id of the sketch group (this will change when the engine's reference to it changes.
id: uuid, id: uuid,
// What the sketch is on (can be a plane or a face). // What the sketch is on (can be a plane or a face).
on: SketchSurface, on: SketchSurface,
@ -383,6 +475,38 @@ uuid |
value: string, value: string,
}, },
type: "extrudeArc", type: "extrudeArc",
} |
{
// The id for the chamfer surface.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "chamfer",
} |
{
// The id for the fillet surface.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "fillet",
}], }],
}, },
// The id of the face. // The id of the face.
@ -534,15 +658,21 @@ uuid |
// Chamfers or fillets on this extrude group. // Chamfers or fillets on this extrude group.
filletOrChamfers: [{ filletOrChamfers: [{
// The engine id of the edge to fillet. // The engine id of the edge to fillet.
edge_id: uuid, edgeId: uuid,
// The id of the engine command that called this fillet. // The id of the engine command that called this fillet.
id: uuid, id: uuid,
radius: number, radius: number,
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "fillet", type: "fillet",
} | } |
{ {
// The engine id of the edge to chamfer. // The engine id of the edge to chamfer.
edge_id: uuid, edgeId: uuid,
// The id of the engine command that called this chamfer. // The id of the engine command that called this chamfer.
id: uuid, id: uuid,
length: number, length: number,
@ -560,7 +690,7 @@ uuid |
id: uuid, id: uuid,
// The sketch group. // The sketch group.
sketchGroup: { sketchGroup: {
// The id of the sketch group. // The id of the sketch group (this will change when the engine's reference to it changes.
id: uuid, id: uuid,
// What the sketch is on (can be a plane or a face). // What the sketch is on (can be a plane or a face).
on: { on: {
@ -602,15 +732,21 @@ uuid |
// Chamfers or fillets on this extrude group. // Chamfers or fillets on this extrude group.
filletOrChamfers: [{ filletOrChamfers: [{
// The engine id of the edge to fillet. // The engine id of the edge to fillet.
edge_id: uuid, edgeId: uuid,
// The id of the engine command that called this fillet. // The id of the engine command that called this fillet.
id: uuid, id: uuid,
radius: number, radius: number,
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "fillet", type: "fillet",
} | } |
{ {
// The engine id of the edge to chamfer. // The engine id of the edge to chamfer.
edge_id: uuid, edgeId: uuid,
// The id of the engine command that called this chamfer. // The id of the engine command that called this chamfer.
id: uuid, id: uuid,
length: number, length: number,
@ -662,6 +798,38 @@ uuid |
value: string, value: string,
}, },
type: "extrudeArc", type: "extrudeArc",
} |
{
// The id for the chamfer surface.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "chamfer",
} |
{
// The id for the fillet surface.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "fillet",
}], }],
}, },
// The id of the face. // The id of the face.
@ -835,6 +1003,38 @@ uuid |
value: string, value: string,
}, },
type: "extrudeArc", type: "extrudeArc",
} |
{
// The id for the chamfer surface.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "chamfer",
} |
{
// The id for the fillet surface.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "fillet",
}], }],
} }
``` ```

View File

@ -9,7 +9,7 @@ Returns the angle of the segment.
```js ```js
segAng(segment_name: TagIdentifier, sketch_group: SketchGroup) -> number segAng(tag: TagIdentifier) -> number
``` ```
### Examples ### Examples
@ -20,9 +20,9 @@ const exampleSketch = startSketchOn('XZ')
|> line([10, 0], %) |> line([10, 0], %)
|> line([5, 10], %, $seg01) |> line([5, 10], %, $seg01)
|> line([-10, 0], %) |> line([-10, 0], %)
|> angledLine([segAng(seg01, %), 10], %) |> angledLine([segAng(seg01), 10], %)
|> line([-10, 0], %) |> line([-10, 0], %)
|> angledLine([segAng(seg01, %), -15], %) |> angledLine([segAng(seg01), -15], %)
|> close(%) |> close(%)
const example = extrude(4, exampleSketch) const example = extrude(4, exampleSketch)
@ -32,89 +32,15 @@ const example = extrude(4, exampleSketch)
### Arguments ### Arguments
* `segment_name`: `TagIdentifier` (REQUIRED) * `tag`: `TagIdentifier` (REQUIRED)
```js ```js
{ {
value: string, // Engine information for a tag.
} info: {
``` // The id of the tagged object.
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
```js
{
// The id of the sketch group.
id: uuid, id: uuid,
// What the sketch is on (can be a plane or a face). // The path the tag is on.
on: { path: {
// 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: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: SketchSurface,
// The starting path.
start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The tag of the path.
@ -127,109 +53,10 @@ const example = extrude(4, exampleSketch)
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
// Tag identifiers that have been declared in this sketch group. // The sketch group the tag is on.
tags: { sketchGroup: uuid,
}, // The surface information for the tag.
// The paths in the sketch group. surface: {
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
} |
{
// arc's direction
ccw: string,
// the arc's center
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
// The x coordinate.
x: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
// The x coordinate.
x: number,
// The y coordinate.
y: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
},
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
value: [{
// The face id for the extrude plane. // The face id for the extrude plane.
faceId: uuid, faceId: uuid,
// The id of the geometry. // The id of the geometry.
@ -260,144 +87,41 @@ const example = extrude(4, exampleSketch)
value: string, value: string,
}, },
type: "extrudeArc", type: "extrudeArc",
}], } |
}, {
// The id of the face. // The id for the chamfer surface.
faceId: uuid,
// The id of the geometry.
id: uuid, id: uuid,
type: "face", // The source range.
// The tag of the face. sourceRange: [number, number],
value: string, // The tag.
// 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: { tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number], digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number, end: number,
start: number, start: number,
value: string, value: string,
}, },
// The to point. type: "chamfer",
to: [number, number],
},
// Tag identifiers that have been declared in this sketch group.
tags: {
},
// The paths in the sketch group.
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
} | } |
{ {
// arc's direction // The id for the fillet surface.
ccw: string, faceId: uuid,
// the arc's center // The id of the geometry.
center: [number, number], id: uuid,
// The from point. // The source range.
from: [number, number], sourceRange: [number, number],
// The tag of the path. // The tag.
tag: { tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number], digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number, end: number,
start: number, start: number,
value: string, value: string,
}, },
// The to point. type: "fillet",
to: [number, number],
type: "TangentialArcTo",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
}, },
// The to point.
to: [number, number],
type: "TangentialArc",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
}, },
// The to point.
to: [number, number],
type: "Horizontal",
// The x coordinate.
x: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string, value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
// The x coordinate.
x: number,
// The y coordinate.
y: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
} }
``` ```

View File

@ -9,7 +9,7 @@ Returns the segment end of x.
```js ```js
segEndX(segment_name: TagIdentifier, sketch_group: SketchGroup) -> number segEndX(tag: TagIdentifier) -> number
``` ```
### Examples ### Examples
@ -19,7 +19,7 @@ const exampleSketch = startSketchOn('XZ')
|> startProfileAt([0, 0], %) |> startProfileAt([0, 0], %)
|> line([20, 0], %, $thing) |> line([20, 0], %, $thing)
|> line([0, 5], %) |> line([0, 5], %)
|> line([segEndX(thing, %), 0], %) |> line([segEndX(thing), 0], %)
|> line([-20, 10], %) |> line([-20, 10], %)
|> close(%) |> close(%)
@ -30,89 +30,15 @@ const example = extrude(5, exampleSketch)
### Arguments ### Arguments
* `segment_name`: `TagIdentifier` (REQUIRED) * `tag`: `TagIdentifier` (REQUIRED)
```js ```js
{ {
value: string, // Engine information for a tag.
} info: {
``` // The id of the tagged object.
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
```js
{
// The id of the sketch group.
id: uuid, id: uuid,
// What the sketch is on (can be a plane or a face). // The path the tag is on.
on: { path: {
// 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: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: SketchSurface,
// The starting path.
start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The tag of the path.
@ -125,109 +51,10 @@ const example = extrude(5, exampleSketch)
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
// Tag identifiers that have been declared in this sketch group. // The sketch group the tag is on.
tags: { sketchGroup: uuid,
}, // The surface information for the tag.
// The paths in the sketch group. surface: {
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
} |
{
// arc's direction
ccw: string,
// the arc's center
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
// The x coordinate.
x: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
// The x coordinate.
x: number,
// The y coordinate.
y: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
},
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
value: [{
// The face id for the extrude plane. // The face id for the extrude plane.
faceId: uuid, faceId: uuid,
// The id of the geometry. // The id of the geometry.
@ -258,144 +85,41 @@ const example = extrude(5, exampleSketch)
value: string, value: string,
}, },
type: "extrudeArc", type: "extrudeArc",
}], } |
}, {
// The id of the face. // The id for the chamfer surface.
faceId: uuid,
// The id of the geometry.
id: uuid, id: uuid,
type: "face", // The source range.
// The tag of the face. sourceRange: [number, number],
value: string, // The tag.
// 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: { tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number], digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number, end: number,
start: number, start: number,
value: string, value: string,
}, },
// The to point. type: "chamfer",
to: [number, number],
},
// Tag identifiers that have been declared in this sketch group.
tags: {
},
// The paths in the sketch group.
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
} | } |
{ {
// arc's direction // The id for the fillet surface.
ccw: string, faceId: uuid,
// the arc's center // The id of the geometry.
center: [number, number], id: uuid,
// The from point. // The source range.
from: [number, number], sourceRange: [number, number],
// The tag of the path. // The tag.
tag: { tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number], digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number, end: number,
start: number, start: number,
value: string, value: string,
}, },
// The to point. type: "fillet",
to: [number, number],
type: "TangentialArcTo",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
}, },
// The to point.
to: [number, number],
type: "TangentialArc",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
}, },
// The to point.
to: [number, number],
type: "Horizontal",
// The x coordinate.
x: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string, value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
// The x coordinate.
x: number,
// The y coordinate.
y: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
} }
``` ```

View File

@ -9,7 +9,7 @@ Returns the segment end of y.
```js ```js
segEndY(segment_name: TagIdentifier, sketch_group: SketchGroup) -> number segEndY(tag: TagIdentifier) -> number
``` ```
### Examples ### Examples
@ -20,7 +20,7 @@ const exampleSketch = startSketchOn('XZ')
|> line([20, 0], %) |> line([20, 0], %)
|> line([0, 3], %, $thing) |> line([0, 3], %, $thing)
|> line([-10, 0], %) |> line([-10, 0], %)
|> line([0, segEndY(thing, %)], %) |> line([0, segEndY(thing)], %)
|> line([-10, 0], %) |> line([-10, 0], %)
|> close(%) |> close(%)
@ -31,89 +31,15 @@ const example = extrude(5, exampleSketch)
### Arguments ### Arguments
* `segment_name`: `TagIdentifier` (REQUIRED) * `tag`: `TagIdentifier` (REQUIRED)
```js ```js
{ {
value: string, // Engine information for a tag.
} info: {
``` // The id of the tagged object.
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
```js
{
// The id of the sketch group.
id: uuid, id: uuid,
// What the sketch is on (can be a plane or a face). // The path the tag is on.
on: { path: {
// 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: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: SketchSurface,
// The starting path.
start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The tag of the path.
@ -126,109 +52,10 @@ const example = extrude(5, exampleSketch)
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
// Tag identifiers that have been declared in this sketch group. // The sketch group the tag is on.
tags: { sketchGroup: uuid,
}, // The surface information for the tag.
// The paths in the sketch group. surface: {
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
} |
{
// arc's direction
ccw: string,
// the arc's center
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
// The x coordinate.
x: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
// The x coordinate.
x: number,
// The y coordinate.
y: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
},
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
value: [{
// The face id for the extrude plane. // The face id for the extrude plane.
faceId: uuid, faceId: uuid,
// The id of the geometry. // The id of the geometry.
@ -259,144 +86,41 @@ const example = extrude(5, exampleSketch)
value: string, value: string,
}, },
type: "extrudeArc", type: "extrudeArc",
}], } |
}, {
// The id of the face. // The id for the chamfer surface.
faceId: uuid,
// The id of the geometry.
id: uuid, id: uuid,
type: "face", // The source range.
// The tag of the face. sourceRange: [number, number],
value: string, // The tag.
// 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: { tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number], digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number, end: number,
start: number, start: number,
value: string, value: string,
}, },
// The to point. type: "chamfer",
to: [number, number],
},
// Tag identifiers that have been declared in this sketch group.
tags: {
},
// The paths in the sketch group.
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
} | } |
{ {
// arc's direction // The id for the fillet surface.
ccw: string, faceId: uuid,
// the arc's center // The id of the geometry.
center: [number, number], id: uuid,
// The from point. // The source range.
from: [number, number], sourceRange: [number, number],
// The tag of the path. // The tag.
tag: { tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number], digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number, end: number,
start: number, start: number,
value: string, value: string,
}, },
// The to point. type: "fillet",
to: [number, number],
type: "TangentialArcTo",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
}, },
// The to point.
to: [number, number],
type: "TangentialArc",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
}, },
// The to point.
to: [number, number],
type: "Horizontal",
// The x coordinate.
x: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string, value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
// The x coordinate.
x: number,
// The y coordinate.
y: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
} }
``` ```

View File

@ -9,7 +9,7 @@ Returns the length of the segment.
```js ```js
segLen(segment_name: TagIdentifier, sketch_group: SketchGroup) -> number segLen(tag: TagIdentifier) -> number
``` ```
### Examples ### Examples
@ -19,7 +19,7 @@ const exampleSketch = startSketchOn("XZ")
|> startProfileAt([0, 0], %) |> startProfileAt([0, 0], %)
|> angledLine({ angle: 60, length: 10 }, %, $thing) |> angledLine({ angle: 60, length: 10 }, %, $thing)
|> tangentialArc({ offset: -120, radius: 5 }, %) |> tangentialArc({ offset: -120, radius: 5 }, %)
|> angledLine({ angle: -60, length: segLen(thing, %) }, %) |> angledLine({ angle: -60, length: segLen(thing) }, %)
|> close(%) |> close(%)
const example = extrude(5, exampleSketch) const example = extrude(5, exampleSketch)
@ -29,89 +29,15 @@ const example = extrude(5, exampleSketch)
### Arguments ### Arguments
* `segment_name`: `TagIdentifier` (REQUIRED) * `tag`: `TagIdentifier` (REQUIRED)
```js ```js
{ {
value: string, // Engine information for a tag.
} info: {
``` // The id of the tagged object.
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
```js
{
// The id of the sketch group.
id: uuid, id: uuid,
// What the sketch is on (can be a plane or a face). // The path the tag is on.
on: { path: {
// 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: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "chamfer",
}],
// The height of the extrude group.
height: number,
// The id of the extrude group.
id: uuid,
// The sketch group.
sketchGroup: {
// The id of the sketch group.
id: uuid,
// What the sketch is on (can be a plane or a face).
on: SketchSurface,
// The starting path.
start: {
// The from point. // The from point.
from: [number, number], from: [number, number],
// The tag of the path. // The tag of the path.
@ -124,109 +50,10 @@ const example = extrude(5, exampleSketch)
// The to point. // The to point.
to: [number, number], to: [number, number],
}, },
// Tag identifiers that have been declared in this sketch group. // The sketch group the tag is on.
tags: { sketchGroup: uuid,
}, // The surface information for the tag.
// The paths in the sketch group. surface: {
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
} |
{
// arc's direction
ccw: string,
// the arc's center
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArcTo",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "TangentialArc",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Horizontal",
// The x coordinate.
x: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
// The x coordinate.
x: number,
// The y coordinate.
y: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
},
// The id of the extrusion start cap
startCapId: uuid,
// The extrude surfaces.
value: [{
// The face id for the extrude plane. // The face id for the extrude plane.
faceId: uuid, faceId: uuid,
// The id of the geometry. // The id of the geometry.
@ -257,144 +84,41 @@ const example = extrude(5, exampleSketch)
value: string, value: string,
}, },
type: "extrudeArc", type: "extrudeArc",
}], } |
}, {
// The id of the face. // The id for the chamfer surface.
faceId: uuid,
// The id of the geometry.
id: uuid, id: uuid,
type: "face", // The source range.
// The tag of the face. sourceRange: [number, number],
value: string, // The tag.
// 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: { tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number], digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number, end: number,
start: number, start: number,
value: string, value: string,
}, },
// The to point. type: "chamfer",
to: [number, number],
},
// Tag identifiers that have been declared in this sketch group.
tags: {
},
// The paths in the sketch group.
value: [{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "ToPoint",
} | } |
{ {
// arc's direction // The id for the fillet surface.
ccw: string, faceId: uuid,
// the arc's center // The id of the geometry.
center: [number, number], id: uuid,
// The from point. // The source range.
from: [number, number], sourceRange: [number, number],
// The tag of the path. // The tag.
tag: { tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number], digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number, end: number,
start: number, start: number,
value: string, value: string,
}, },
// The to point. type: "fillet",
to: [number, number],
type: "TangentialArcTo",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
}, },
// The to point.
to: [number, number],
type: "TangentialArc",
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
}, },
// The to point.
to: [number, number],
type: "Horizontal",
// The x coordinate.
x: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string, value: string,
},
// The to point.
to: [number, number],
type: "AngledLineTo",
// The x coordinate.
x: number,
// The y coordinate.
y: number,
} |
{
// The from point.
from: [number, number],
// The tag of the path.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
type: "Base",
}],
} }
``` ```

View File

@ -37,6 +37,92 @@ shell({ faces: ['end'], thickness: 0.25 }, firstSketch)
// The faces you want removed. // The faces you want removed.
faces: ["start" | "end" | faces: ["start" | "end" |
{ {
// Engine information for a tag.
info: {
// The id of the tagged object.
id: uuid,
// The path the tag is on.
path: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The sketch group the tag is on.
sketchGroup: uuid,
// The surface information for the tag.
surface: {
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "extrudeArc",
} |
{
// The id for the chamfer surface.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "chamfer",
} |
{
// The id for the fillet surface.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "fillet",
},
},
value: string, value: string,
}], }],
// The thickness of the shell. // The thickness of the shell.
@ -51,15 +137,21 @@ shell({ faces: ['end'], thickness: 0.25 }, firstSketch)
// Chamfers or fillets on this extrude group. // Chamfers or fillets on this extrude group.
filletOrChamfers: [{ filletOrChamfers: [{
// The engine id of the edge to fillet. // The engine id of the edge to fillet.
edge_id: uuid, edgeId: uuid,
// The id of the engine command that called this fillet. // The id of the engine command that called this fillet.
id: uuid, id: uuid,
radius: number, radius: number,
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "fillet", type: "fillet",
} | } |
{ {
// The engine id of the edge to chamfer. // The engine id of the edge to chamfer.
edge_id: uuid, edgeId: uuid,
// The id of the engine command that called this chamfer. // The id of the engine command that called this chamfer.
id: uuid, id: uuid,
length: number, length: number,
@ -77,7 +169,7 @@ shell({ faces: ['end'], thickness: 0.25 }, firstSketch)
id: uuid, id: uuid,
// The sketch group. // The sketch group.
sketchGroup: { sketchGroup: {
// The id of the sketch group. // The id of the sketch group (this will change when the engine's reference to it changes.
id: uuid, id: uuid,
// What the sketch is on (can be a plane or a face). // What the sketch is on (can be a plane or a face).
on: { on: {
@ -119,15 +211,21 @@ shell({ faces: ['end'], thickness: 0.25 }, firstSketch)
// Chamfers or fillets on this extrude group. // Chamfers or fillets on this extrude group.
filletOrChamfers: [{ filletOrChamfers: [{
// The engine id of the edge to fillet. // The engine id of the edge to fillet.
edge_id: uuid, edgeId: uuid,
// The id of the engine command that called this fillet. // The id of the engine command that called this fillet.
id: uuid, id: uuid,
radius: number, radius: number,
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "fillet", type: "fillet",
} | } |
{ {
// The engine id of the edge to chamfer. // The engine id of the edge to chamfer.
edge_id: uuid, edgeId: uuid,
// The id of the engine command that called this chamfer. // The id of the engine command that called this chamfer.
id: uuid, id: uuid,
length: number, length: number,
@ -179,6 +277,38 @@ shell({ faces: ['end'], thickness: 0.25 }, firstSketch)
value: string, value: string,
}, },
type: "extrudeArc", type: "extrudeArc",
} |
{
// The id for the chamfer surface.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "chamfer",
} |
{
// The id for the fillet surface.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "fillet",
}], }],
}, },
// The id of the face. // The id of the face.
@ -352,6 +482,38 @@ shell({ faces: ['end'], thickness: 0.25 }, firstSketch)
value: string, value: string,
}, },
type: "extrudeArc", type: "extrudeArc",
} |
{
// The id for the chamfer surface.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "chamfer",
} |
{
// The id for the fillet surface.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "fillet",
}], }],
} }
``` ```
@ -366,15 +528,21 @@ shell({ faces: ['end'], thickness: 0.25 }, firstSketch)
// Chamfers or fillets on this extrude group. // Chamfers or fillets on this extrude group.
filletOrChamfers: [{ filletOrChamfers: [{
// The engine id of the edge to fillet. // The engine id of the edge to fillet.
edge_id: uuid, edgeId: uuid,
// The id of the engine command that called this fillet. // The id of the engine command that called this fillet.
id: uuid, id: uuid,
radius: number, radius: number,
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "fillet", type: "fillet",
} | } |
{ {
// The engine id of the edge to chamfer. // The engine id of the edge to chamfer.
edge_id: uuid, edgeId: uuid,
// The id of the engine command that called this chamfer. // The id of the engine command that called this chamfer.
id: uuid, id: uuid,
length: number, length: number,
@ -392,7 +560,7 @@ shell({ faces: ['end'], thickness: 0.25 }, firstSketch)
id: uuid, id: uuid,
// The sketch group. // The sketch group.
sketchGroup: { sketchGroup: {
// The id of the sketch group. // The id of the sketch group (this will change when the engine's reference to it changes.
id: uuid, id: uuid,
// What the sketch is on (can be a plane or a face). // What the sketch is on (can be a plane or a face).
on: { on: {
@ -434,15 +602,21 @@ shell({ faces: ['end'], thickness: 0.25 }, firstSketch)
// Chamfers or fillets on this extrude group. // Chamfers or fillets on this extrude group.
filletOrChamfers: [{ filletOrChamfers: [{
// The engine id of the edge to fillet. // The engine id of the edge to fillet.
edge_id: uuid, edgeId: uuid,
// The id of the engine command that called this fillet. // The id of the engine command that called this fillet.
id: uuid, id: uuid,
radius: number, radius: number,
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "fillet", type: "fillet",
} | } |
{ {
// The engine id of the edge to chamfer. // The engine id of the edge to chamfer.
edge_id: uuid, edgeId: uuid,
// The id of the engine command that called this chamfer. // The id of the engine command that called this chamfer.
id: uuid, id: uuid,
length: number, length: number,
@ -494,6 +668,38 @@ shell({ faces: ['end'], thickness: 0.25 }, firstSketch)
value: string, value: string,
}, },
type: "extrudeArc", type: "extrudeArc",
} |
{
// The id for the chamfer surface.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "chamfer",
} |
{
// The id for the fillet surface.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "fillet",
}], }],
}, },
// The id of the face. // The id of the face.
@ -667,6 +873,38 @@ shell({ faces: ['end'], thickness: 0.25 }, firstSketch)
value: string, value: string,
}, },
type: "extrudeArc", type: "extrudeArc",
} |
{
// The id for the chamfer surface.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "chamfer",
} |
{
// The id for the fillet surface.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "fillet",
}], }],
} }
``` ```

View File

@ -97,15 +97,21 @@ const example = extrude(5, exampleSketch)
// Chamfers or fillets on this extrude group. // Chamfers or fillets on this extrude group.
filletOrChamfers: [{ filletOrChamfers: [{
// The engine id of the edge to fillet. // The engine id of the edge to fillet.
edge_id: uuid, edgeId: uuid,
// The id of the engine command that called this fillet. // The id of the engine command that called this fillet.
id: uuid, id: uuid,
radius: number, radius: number,
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "fillet", type: "fillet",
} | } |
{ {
// The engine id of the edge to chamfer. // The engine id of the edge to chamfer.
edge_id: uuid, edgeId: uuid,
// The id of the engine command that called this chamfer. // The id of the engine command that called this chamfer.
id: uuid, id: uuid,
length: number, length: number,
@ -123,7 +129,7 @@ const example = extrude(5, exampleSketch)
id: uuid, id: uuid,
// The sketch group. // The sketch group.
sketchGroup: { sketchGroup: {
// The id of the sketch group. // The id of the sketch group (this will change when the engine's reference to it changes.
id: uuid, id: uuid,
// What the sketch is on (can be a plane or a face). // What the sketch is on (can be a plane or a face).
on: { on: {
@ -331,6 +337,38 @@ const example = extrude(5, exampleSketch)
value: string, value: string,
}, },
type: "extrudeArc", type: "extrudeArc",
} |
{
// The id for the chamfer surface.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "chamfer",
} |
{
// The id for the fillet surface.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "fillet",
}], }],
}, },
// The id of the face. // The id of the face.
@ -373,7 +411,7 @@ const example = extrude(5, exampleSketch)
`SketchGroup` - A sketch group is a collection of paths. `SketchGroup` - A sketch group is a collection of paths.
```js ```js
{ {
// The id of the sketch group. // The id of the sketch group (this will change when the engine's reference to it changes.
id: uuid, id: uuid,
// What the sketch is on (can be a plane or a face). // What the sketch is on (can be a plane or a face).
on: { on: {
@ -415,15 +453,21 @@ const example = extrude(5, exampleSketch)
// Chamfers or fillets on this extrude group. // Chamfers or fillets on this extrude group.
filletOrChamfers: [{ filletOrChamfers: [{
// The engine id of the edge to fillet. // The engine id of the edge to fillet.
edge_id: uuid, edgeId: uuid,
// The id of the engine command that called this fillet. // The id of the engine command that called this fillet.
id: uuid, id: uuid,
radius: number, radius: number,
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "fillet", type: "fillet",
} | } |
{ {
// The engine id of the edge to chamfer. // The engine id of the edge to chamfer.
edge_id: uuid, edgeId: uuid,
// The id of the engine command that called this chamfer. // The id of the engine command that called this chamfer.
id: uuid, id: uuid,
length: number, length: number,
@ -441,7 +485,7 @@ const example = extrude(5, exampleSketch)
id: uuid, id: uuid,
// The sketch group. // The sketch group.
sketchGroup: { sketchGroup: {
// The id of the sketch group. // The id of the sketch group (this will change when the engine's reference to it changes.
id: uuid, id: uuid,
// What the sketch is on (can be a plane or a face). // What the sketch is on (can be a plane or a face).
on: SketchSurface, on: SketchSurface,
@ -592,6 +636,38 @@ const example = extrude(5, exampleSketch)
value: string, value: string,
}, },
type: "extrudeArc", type: "extrudeArc",
} |
{
// The id for the chamfer surface.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "chamfer",
} |
{
// The id for the fillet surface.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "fillet",
}], }],
}, },
// The id of the face. // The id of the face.

View File

@ -59,7 +59,7 @@ const example = extrude(5, exampleSketch)
`SketchGroup` - A sketch group is a collection of paths. `SketchGroup` - A sketch group is a collection of paths.
```js ```js
{ {
// The id of the sketch group. // The id of the sketch group (this will change when the engine's reference to it changes.
id: uuid, id: uuid,
// What the sketch is on (can be a plane or a face). // What the sketch is on (can be a plane or a face).
on: { on: {
@ -101,15 +101,21 @@ const example = extrude(5, exampleSketch)
// Chamfers or fillets on this extrude group. // Chamfers or fillets on this extrude group.
filletOrChamfers: [{ filletOrChamfers: [{
// The engine id of the edge to fillet. // The engine id of the edge to fillet.
edge_id: uuid, edgeId: uuid,
// The id of the engine command that called this fillet. // The id of the engine command that called this fillet.
id: uuid, id: uuid,
radius: number, radius: number,
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "fillet", type: "fillet",
} | } |
{ {
// The engine id of the edge to chamfer. // The engine id of the edge to chamfer.
edge_id: uuid, edgeId: uuid,
// The id of the engine command that called this chamfer. // The id of the engine command that called this chamfer.
id: uuid, id: uuid,
length: number, length: number,
@ -127,7 +133,7 @@ const example = extrude(5, exampleSketch)
id: uuid, id: uuid,
// The sketch group. // The sketch group.
sketchGroup: { sketchGroup: {
// The id of the sketch group. // The id of the sketch group (this will change when the engine's reference to it changes.
id: uuid, id: uuid,
// What the sketch is on (can be a plane or a face). // What the sketch is on (can be a plane or a face).
on: SketchSurface, on: SketchSurface,
@ -278,6 +284,38 @@ const example = extrude(5, exampleSketch)
value: string, value: string,
}, },
type: "extrudeArc", type: "extrudeArc",
} |
{
// The id for the chamfer surface.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "chamfer",
} |
{
// The id for the fillet surface.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "fillet",
}], }],
}, },
// The id of the face. // The id of the face.

View File

@ -55,7 +55,7 @@ const exampleSketch = startSketchOn("XY")
const example = extrude(10, exampleSketch) const example = extrude(10, exampleSketch)
const exampleSketch002 = startSketchOn(example, 'sketchingFace') const exampleSketch002 = startSketchOn(example, sketchingFace)
|> startProfileAt([1, 1], %) |> startProfileAt([1, 1], %)
|> line([8, 0], %) |> line([8, 0], %)
|> line([0, 8], %) |> line([0, 8], %)
@ -64,7 +64,7 @@ const exampleSketch002 = startSketchOn(example, 'sketchingFace')
const example002 = extrude(10, exampleSketch002) const example002 = extrude(10, exampleSketch002)
const exampleSketch003 = startSketchOn(example002, 'sketchingFace002') const exampleSketch003 = startSketchOn(example002, sketchingFace002)
|> startProfileAt([-8, 12], %) |> startProfileAt([-8, 12], %)
|> line([0, 6], %) |> line([0, 6], %)
|> line([6, 0], %) |> line([6, 0], %)
@ -106,9 +106,9 @@ const example002 = extrude(5, exampleSketch002)
const a1 = startSketchOn({ const a1 = startSketchOn({
plane: { plane: {
origin: { x: 0, y: 0, z: 0 }, origin: { x: 0, y: 0, z: 0 },
x_axis: { x: 1, y: 0, z: 0 }, xAxis: { x: 1, y: 0, z: 0 },
y_axis: { x: 0, y: 1, z: 0 }, yAxis: { x: 0, y: 1, z: 0 },
z_axis: { x: 0, y: 0, z: 1 } zAxis: { x: 0, y: 0, z: 1 }
} }
}) })
|> startProfileAt([0, 0], %) |> startProfileAt([0, 0], %)
@ -141,19 +141,19 @@ const a1 = startSketchOn({
z: number, z: number,
}, },
// What should the planes X axis be? // What should the planes X axis be?
x_axis: { xAxis: {
x: number, x: number,
y: number, y: number,
z: number, z: number,
}, },
// What should the planes Y axis be? // What should the planes Y axis be?
y_axis: { yAxis: {
x: number, x: number,
y: number, y: number,
z: number, z: number,
}, },
// The z-axis (normal). // The z-axis (normal).
z_axis: { zAxis: {
x: number, x: number,
y: number, y: number,
z: number, z: number,
@ -166,15 +166,21 @@ const a1 = startSketchOn({
// Chamfers or fillets on this extrude group. // Chamfers or fillets on this extrude group.
filletOrChamfers: [{ filletOrChamfers: [{
// The engine id of the edge to fillet. // The engine id of the edge to fillet.
edge_id: uuid, edgeId: uuid,
// The id of the engine command that called this fillet. // The id of the engine command that called this fillet.
id: uuid, id: uuid,
radius: number, radius: number,
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "fillet", type: "fillet",
} | } |
{ {
// The engine id of the edge to chamfer. // The engine id of the edge to chamfer.
edge_id: uuid, edgeId: uuid,
// The id of the engine command that called this chamfer. // The id of the engine command that called this chamfer.
id: uuid, id: uuid,
length: number, length: number,
@ -192,7 +198,7 @@ const a1 = startSketchOn({
id: uuid, id: uuid,
// The sketch group. // The sketch group.
sketchGroup: { sketchGroup: {
// The id of the sketch group. // The id of the sketch group (this will change when the engine's reference to it changes.
id: uuid, id: uuid,
// What the sketch is on (can be a plane or a face). // What the sketch is on (can be a plane or a face).
on: { on: {
@ -400,6 +406,38 @@ const a1 = startSketchOn({
value: string, value: string,
}, },
type: "extrudeArc", type: "extrudeArc",
} |
{
// The id for the chamfer surface.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "chamfer",
} |
{
// The id for the fillet surface.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "fillet",
}], }],
} }
``` ```
@ -407,6 +445,92 @@ const a1 = startSketchOn({
```js ```js
"start" | "end" | "start" | "end" |
{ {
// Engine information for a tag.
info: {
// The id of the tagged object.
id: uuid,
// The path the tag is on.
path: {
// The from point.
from: [number, number],
// The tag of the path.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
// The to point.
to: [number, number],
},
// The sketch group the tag is on.
sketchGroup: uuid,
// The surface information for the tag.
surface: {
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "extrudePlane",
} |
{
// The face id for the extrude plane.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "extrudeArc",
} |
{
// The id for the chamfer surface.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "chamfer",
} |
{
// The id for the fillet surface.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "fillet",
},
},
value: string, value: string,
} }
``` ```
@ -454,15 +578,21 @@ const a1 = startSketchOn({
// Chamfers or fillets on this extrude group. // Chamfers or fillets on this extrude group.
filletOrChamfers: [{ filletOrChamfers: [{
// The engine id of the edge to fillet. // The engine id of the edge to fillet.
edge_id: uuid, edgeId: uuid,
// The id of the engine command that called this fillet. // The id of the engine command that called this fillet.
id: uuid, id: uuid,
radius: number, radius: number,
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "fillet", type: "fillet",
} | } |
{ {
// The engine id of the edge to chamfer. // The engine id of the edge to chamfer.
edge_id: uuid, edgeId: uuid,
// The id of the engine command that called this chamfer. // The id of the engine command that called this chamfer.
id: uuid, id: uuid,
length: number, length: number,
@ -480,7 +610,7 @@ const a1 = startSketchOn({
id: uuid, id: uuid,
// The sketch group. // The sketch group.
sketchGroup: { sketchGroup: {
// The id of the sketch group. // The id of the sketch group (this will change when the engine's reference to it changes.
id: uuid, id: uuid,
// What the sketch is on (can be a plane or a face). // What the sketch is on (can be a plane or a face).
on: { on: {
@ -688,6 +818,38 @@ const a1 = startSketchOn({
value: string, value: string,
}, },
type: "extrudeArc", type: "extrudeArc",
} |
{
// The id for the chamfer surface.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "chamfer",
} |
{
// The id for the fillet surface.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "fillet",
}], }],
}, },
// The id of the face. // The id of the face.

File diff suppressed because it is too large Load Diff

View File

@ -42,7 +42,7 @@ const example = extrude(10, exampleSketch)
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED) * `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
```js ```js
{ {
// The id of the sketch group. // The id of the sketch group (this will change when the engine's reference to it changes.
id: uuid, id: uuid,
// What the sketch is on (can be a plane or a face). // What the sketch is on (can be a plane or a face).
on: { on: {
@ -84,15 +84,21 @@ const example = extrude(10, exampleSketch)
// Chamfers or fillets on this extrude group. // Chamfers or fillets on this extrude group.
filletOrChamfers: [{ filletOrChamfers: [{
// The engine id of the edge to fillet. // The engine id of the edge to fillet.
edge_id: uuid, edgeId: uuid,
// The id of the engine command that called this fillet. // The id of the engine command that called this fillet.
id: uuid, id: uuid,
radius: number, radius: number,
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "fillet", type: "fillet",
} | } |
{ {
// The engine id of the edge to chamfer. // The engine id of the edge to chamfer.
edge_id: uuid, edgeId: uuid,
// The id of the engine command that called this chamfer. // The id of the engine command that called this chamfer.
id: uuid, id: uuid,
length: number, length: number,
@ -110,7 +116,7 @@ const example = extrude(10, exampleSketch)
id: uuid, id: uuid,
// The sketch group. // The sketch group.
sketchGroup: { sketchGroup: {
// The id of the sketch group. // The id of the sketch group (this will change when the engine's reference to it changes.
id: uuid, id: uuid,
// What the sketch is on (can be a plane or a face). // What the sketch is on (can be a plane or a face).
on: SketchSurface, on: SketchSurface,
@ -261,6 +267,38 @@ const example = extrude(10, exampleSketch)
value: string, value: string,
}, },
type: "extrudeArc", type: "extrudeArc",
} |
{
// The id for the chamfer surface.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "chamfer",
} |
{
// The id for the fillet surface.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "fillet",
}], }],
}, },
// The id of the face. // The id of the face.
@ -416,7 +454,7 @@ const example = extrude(10, exampleSketch)
`SketchGroup` - A sketch group is a collection of paths. `SketchGroup` - A sketch group is a collection of paths.
```js ```js
{ {
// The id of the sketch group. // The id of the sketch group (this will change when the engine's reference to it changes.
id: uuid, id: uuid,
// What the sketch is on (can be a plane or a face). // What the sketch is on (can be a plane or a face).
on: { on: {
@ -458,15 +496,21 @@ const example = extrude(10, exampleSketch)
// Chamfers or fillets on this extrude group. // Chamfers or fillets on this extrude group.
filletOrChamfers: [{ filletOrChamfers: [{
// The engine id of the edge to fillet. // The engine id of the edge to fillet.
edge_id: uuid, edgeId: uuid,
// The id of the engine command that called this fillet. // The id of the engine command that called this fillet.
id: uuid, id: uuid,
radius: number, radius: number,
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "fillet", type: "fillet",
} | } |
{ {
// The engine id of the edge to chamfer. // The engine id of the edge to chamfer.
edge_id: uuid, edgeId: uuid,
// The id of the engine command that called this chamfer. // The id of the engine command that called this chamfer.
id: uuid, id: uuid,
length: number, length: number,
@ -484,7 +528,7 @@ const example = extrude(10, exampleSketch)
id: uuid, id: uuid,
// The sketch group. // The sketch group.
sketchGroup: { sketchGroup: {
// The id of the sketch group. // The id of the sketch group (this will change when the engine's reference to it changes.
id: uuid, id: uuid,
// What the sketch is on (can be a plane or a face). // What the sketch is on (can be a plane or a face).
on: SketchSurface, on: SketchSurface,
@ -635,6 +679,38 @@ const example = extrude(10, exampleSketch)
value: string, value: string,
}, },
type: "extrudeArc", type: "extrudeArc",
} |
{
// The id for the chamfer surface.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "chamfer",
} |
{
// The id for the fillet surface.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "fillet",
}], }],
}, },
// The id of the face. // The id of the face.

View File

@ -33,7 +33,7 @@ const example = extrude(10, exampleSketch)
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED) * `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
```js ```js
{ {
// The id of the sketch group. // The id of the sketch group (this will change when the engine's reference to it changes.
id: uuid, id: uuid,
// What the sketch is on (can be a plane or a face). // What the sketch is on (can be a plane or a face).
on: { on: {
@ -75,15 +75,21 @@ const example = extrude(10, exampleSketch)
// Chamfers or fillets on this extrude group. // Chamfers or fillets on this extrude group.
filletOrChamfers: [{ filletOrChamfers: [{
// The engine id of the edge to fillet. // The engine id of the edge to fillet.
edge_id: uuid, edgeId: uuid,
// The id of the engine command that called this fillet. // The id of the engine command that called this fillet.
id: uuid, id: uuid,
radius: number, radius: number,
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "fillet", type: "fillet",
} | } |
{ {
// The engine id of the edge to chamfer. // The engine id of the edge to chamfer.
edge_id: uuid, edgeId: uuid,
// The id of the engine command that called this chamfer. // The id of the engine command that called this chamfer.
id: uuid, id: uuid,
length: number, length: number,
@ -101,7 +107,7 @@ const example = extrude(10, exampleSketch)
id: uuid, id: uuid,
// The sketch group. // The sketch group.
sketchGroup: { sketchGroup: {
// The id of the sketch group. // The id of the sketch group (this will change when the engine's reference to it changes.
id: uuid, id: uuid,
// What the sketch is on (can be a plane or a face). // What the sketch is on (can be a plane or a face).
on: SketchSurface, on: SketchSurface,
@ -252,6 +258,38 @@ const example = extrude(10, exampleSketch)
value: string, value: string,
}, },
type: "extrudeArc", type: "extrudeArc",
} |
{
// The id for the chamfer surface.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "chamfer",
} |
{
// The id for the fillet surface.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "fillet",
}], }],
}, },
// The id of the face. // The id of the face.
@ -407,7 +445,7 @@ const example = extrude(10, exampleSketch)
`SketchGroup` - A sketch group is a collection of paths. `SketchGroup` - A sketch group is a collection of paths.
```js ```js
{ {
// The id of the sketch group. // The id of the sketch group (this will change when the engine's reference to it changes.
id: uuid, id: uuid,
// What the sketch is on (can be a plane or a face). // What the sketch is on (can be a plane or a face).
on: { on: {
@ -449,15 +487,21 @@ const example = extrude(10, exampleSketch)
// Chamfers or fillets on this extrude group. // Chamfers or fillets on this extrude group.
filletOrChamfers: [{ filletOrChamfers: [{
// The engine id of the edge to fillet. // The engine id of the edge to fillet.
edge_id: uuid, edgeId: uuid,
// The id of the engine command that called this fillet. // The id of the engine command that called this fillet.
id: uuid, id: uuid,
radius: number, radius: number,
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "fillet", type: "fillet",
} | } |
{ {
// The engine id of the edge to chamfer. // The engine id of the edge to chamfer.
edge_id: uuid, edgeId: uuid,
// The id of the engine command that called this chamfer. // The id of the engine command that called this chamfer.
id: uuid, id: uuid,
length: number, length: number,
@ -475,7 +519,7 @@ const example = extrude(10, exampleSketch)
id: uuid, id: uuid,
// The sketch group. // The sketch group.
sketchGroup: { sketchGroup: {
// The id of the sketch group. // The id of the sketch group (this will change when the engine's reference to it changes.
id: uuid, id: uuid,
// What the sketch is on (can be a plane or a face). // What the sketch is on (can be a plane or a face).
on: SketchSurface, on: SketchSurface,
@ -626,6 +670,38 @@ const example = extrude(10, exampleSketch)
value: string, value: string,
}, },
type: "extrudeArc", type: "extrudeArc",
} |
{
// The id for the chamfer surface.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "chamfer",
} |
{
// The id for the fillet surface.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "fillet",
}], }],
}, },
// The id of the face. // The id of the face.

View File

@ -36,7 +36,7 @@ const example = extrude(10, exampleSketch)
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED) * `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
```js ```js
{ {
// The id of the sketch group. // The id of the sketch group (this will change when the engine's reference to it changes.
id: uuid, id: uuid,
// What the sketch is on (can be a plane or a face). // What the sketch is on (can be a plane or a face).
on: { on: {
@ -78,15 +78,21 @@ const example = extrude(10, exampleSketch)
// Chamfers or fillets on this extrude group. // Chamfers or fillets on this extrude group.
filletOrChamfers: [{ filletOrChamfers: [{
// The engine id of the edge to fillet. // The engine id of the edge to fillet.
edge_id: uuid, edgeId: uuid,
// The id of the engine command that called this fillet. // The id of the engine command that called this fillet.
id: uuid, id: uuid,
radius: number, radius: number,
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "fillet", type: "fillet",
} | } |
{ {
// The engine id of the edge to chamfer. // The engine id of the edge to chamfer.
edge_id: uuid, edgeId: uuid,
// The id of the engine command that called this chamfer. // The id of the engine command that called this chamfer.
id: uuid, id: uuid,
length: number, length: number,
@ -104,7 +110,7 @@ const example = extrude(10, exampleSketch)
id: uuid, id: uuid,
// The sketch group. // The sketch group.
sketchGroup: { sketchGroup: {
// The id of the sketch group. // The id of the sketch group (this will change when the engine's reference to it changes.
id: uuid, id: uuid,
// What the sketch is on (can be a plane or a face). // What the sketch is on (can be a plane or a face).
on: SketchSurface, on: SketchSurface,
@ -255,6 +261,38 @@ const example = extrude(10, exampleSketch)
value: string, value: string,
}, },
type: "extrudeArc", type: "extrudeArc",
} |
{
// The id for the chamfer surface.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "chamfer",
} |
{
// The id for the fillet surface.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "fillet",
}], }],
}, },
// The id of the face. // The id of the face.
@ -410,7 +448,7 @@ const example = extrude(10, exampleSketch)
`SketchGroup` - A sketch group is a collection of paths. `SketchGroup` - A sketch group is a collection of paths.
```js ```js
{ {
// The id of the sketch group. // The id of the sketch group (this will change when the engine's reference to it changes.
id: uuid, id: uuid,
// What the sketch is on (can be a plane or a face). // What the sketch is on (can be a plane or a face).
on: { on: {
@ -452,15 +490,21 @@ const example = extrude(10, exampleSketch)
// Chamfers or fillets on this extrude group. // Chamfers or fillets on this extrude group.
filletOrChamfers: [{ filletOrChamfers: [{
// The engine id of the edge to fillet. // The engine id of the edge to fillet.
edge_id: uuid, edgeId: uuid,
// The id of the engine command that called this fillet. // The id of the engine command that called this fillet.
id: uuid, id: uuid,
radius: number, radius: number,
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "fillet", type: "fillet",
} | } |
{ {
// The engine id of the edge to chamfer. // The engine id of the edge to chamfer.
edge_id: uuid, edgeId: uuid,
// The id of the engine command that called this chamfer. // The id of the engine command that called this chamfer.
id: uuid, id: uuid,
length: number, length: number,
@ -478,7 +522,7 @@ const example = extrude(10, exampleSketch)
id: uuid, id: uuid,
// The sketch group. // The sketch group.
sketchGroup: { sketchGroup: {
// The id of the sketch group. // The id of the sketch group (this will change when the engine's reference to it changes.
id: uuid, id: uuid,
// What the sketch is on (can be a plane or a face). // What the sketch is on (can be a plane or a face).
on: SketchSurface, on: SketchSurface,
@ -629,6 +673,38 @@ const example = extrude(10, exampleSketch)
value: string, value: string,
}, },
type: "extrudeArc", type: "extrudeArc",
} |
{
// The id for the chamfer surface.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "chamfer",
} |
{
// The id for the fillet surface.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "fillet",
}], }],
}, },
// The id of the face. // The id of the face.

View File

@ -36,7 +36,7 @@ const example = extrude(10, exampleSketch)
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED) * `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
```js ```js
{ {
// The id of the sketch group. // The id of the sketch group (this will change when the engine's reference to it changes.
id: uuid, id: uuid,
// What the sketch is on (can be a plane or a face). // What the sketch is on (can be a plane or a face).
on: { on: {
@ -78,15 +78,21 @@ const example = extrude(10, exampleSketch)
// Chamfers or fillets on this extrude group. // Chamfers or fillets on this extrude group.
filletOrChamfers: [{ filletOrChamfers: [{
// The engine id of the edge to fillet. // The engine id of the edge to fillet.
edge_id: uuid, edgeId: uuid,
// The id of the engine command that called this fillet. // The id of the engine command that called this fillet.
id: uuid, id: uuid,
radius: number, radius: number,
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "fillet", type: "fillet",
} | } |
{ {
// The engine id of the edge to chamfer. // The engine id of the edge to chamfer.
edge_id: uuid, edgeId: uuid,
// The id of the engine command that called this chamfer. // The id of the engine command that called this chamfer.
id: uuid, id: uuid,
length: number, length: number,
@ -104,7 +110,7 @@ const example = extrude(10, exampleSketch)
id: uuid, id: uuid,
// The sketch group. // The sketch group.
sketchGroup: { sketchGroup: {
// The id of the sketch group. // The id of the sketch group (this will change when the engine's reference to it changes.
id: uuid, id: uuid,
// What the sketch is on (can be a plane or a face). // What the sketch is on (can be a plane or a face).
on: SketchSurface, on: SketchSurface,
@ -255,6 +261,38 @@ const example = extrude(10, exampleSketch)
value: string, value: string,
}, },
type: "extrudeArc", type: "extrudeArc",
} |
{
// The id for the chamfer surface.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "chamfer",
} |
{
// The id for the fillet surface.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "fillet",
}], }],
}, },
// The id of the face. // The id of the face.
@ -410,7 +448,7 @@ const example = extrude(10, exampleSketch)
`SketchGroup` - A sketch group is a collection of paths. `SketchGroup` - A sketch group is a collection of paths.
```js ```js
{ {
// The id of the sketch group. // The id of the sketch group (this will change when the engine's reference to it changes.
id: uuid, id: uuid,
// What the sketch is on (can be a plane or a face). // What the sketch is on (can be a plane or a face).
on: { on: {
@ -452,15 +490,21 @@ const example = extrude(10, exampleSketch)
// Chamfers or fillets on this extrude group. // Chamfers or fillets on this extrude group.
filletOrChamfers: [{ filletOrChamfers: [{
// The engine id of the edge to fillet. // The engine id of the edge to fillet.
edge_id: uuid, edgeId: uuid,
// The id of the engine command that called this fillet. // The id of the engine command that called this fillet.
id: uuid, id: uuid,
radius: number, radius: number,
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "fillet", type: "fillet",
} | } |
{ {
// The engine id of the edge to chamfer. // The engine id of the edge to chamfer.
edge_id: uuid, edgeId: uuid,
// The id of the engine command that called this chamfer. // The id of the engine command that called this chamfer.
id: uuid, id: uuid,
length: number, length: number,
@ -478,7 +522,7 @@ const example = extrude(10, exampleSketch)
id: uuid, id: uuid,
// The sketch group. // The sketch group.
sketchGroup: { sketchGroup: {
// The id of the sketch group. // The id of the sketch group (this will change when the engine's reference to it changes.
id: uuid, id: uuid,
// What the sketch is on (can be a plane or a face). // What the sketch is on (can be a plane or a face).
on: SketchSurface, on: SketchSurface,
@ -629,6 +673,38 @@ const example = extrude(10, exampleSketch)
value: string, value: string,
}, },
type: "extrudeArc", type: "extrudeArc",
} |
{
// The id for the chamfer surface.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "chamfer",
} |
{
// The id for the fillet surface.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "fillet",
}], }],
}, },
// The id of the face. // The id of the face.

View File

@ -34,7 +34,7 @@ const example = extrude(10, exampleSketch)
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED) * `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
```js ```js
{ {
// The id of the sketch group. // The id of the sketch group (this will change when the engine's reference to it changes.
id: uuid, id: uuid,
// What the sketch is on (can be a plane or a face). // What the sketch is on (can be a plane or a face).
on: { on: {
@ -76,15 +76,21 @@ const example = extrude(10, exampleSketch)
// Chamfers or fillets on this extrude group. // Chamfers or fillets on this extrude group.
filletOrChamfers: [{ filletOrChamfers: [{
// The engine id of the edge to fillet. // The engine id of the edge to fillet.
edge_id: uuid, edgeId: uuid,
// The id of the engine command that called this fillet. // The id of the engine command that called this fillet.
id: uuid, id: uuid,
radius: number, radius: number,
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "fillet", type: "fillet",
} | } |
{ {
// The engine id of the edge to chamfer. // The engine id of the edge to chamfer.
edge_id: uuid, edgeId: uuid,
// The id of the engine command that called this chamfer. // The id of the engine command that called this chamfer.
id: uuid, id: uuid,
length: number, length: number,
@ -102,7 +108,7 @@ const example = extrude(10, exampleSketch)
id: uuid, id: uuid,
// The sketch group. // The sketch group.
sketchGroup: { sketchGroup: {
// The id of the sketch group. // The id of the sketch group (this will change when the engine's reference to it changes.
id: uuid, id: uuid,
// What the sketch is on (can be a plane or a face). // What the sketch is on (can be a plane or a face).
on: SketchSurface, on: SketchSurface,
@ -253,6 +259,38 @@ const example = extrude(10, exampleSketch)
value: string, value: string,
}, },
type: "extrudeArc", type: "extrudeArc",
} |
{
// The id for the chamfer surface.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "chamfer",
} |
{
// The id for the fillet surface.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "fillet",
}], }],
}, },
// The id of the face. // The id of the face.
@ -408,7 +446,7 @@ const example = extrude(10, exampleSketch)
`SketchGroup` - A sketch group is a collection of paths. `SketchGroup` - A sketch group is a collection of paths.
```js ```js
{ {
// The id of the sketch group. // The id of the sketch group (this will change when the engine's reference to it changes.
id: uuid, id: uuid,
// What the sketch is on (can be a plane or a face). // What the sketch is on (can be a plane or a face).
on: { on: {
@ -450,15 +488,21 @@ const example = extrude(10, exampleSketch)
// Chamfers or fillets on this extrude group. // Chamfers or fillets on this extrude group.
filletOrChamfers: [{ filletOrChamfers: [{
// The engine id of the edge to fillet. // The engine id of the edge to fillet.
edge_id: uuid, edgeId: uuid,
// The id of the engine command that called this fillet. // The id of the engine command that called this fillet.
id: uuid, id: uuid,
radius: number, radius: number,
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "fillet", type: "fillet",
} | } |
{ {
// The engine id of the edge to chamfer. // The engine id of the edge to chamfer.
edge_id: uuid, edgeId: uuid,
// The id of the engine command that called this chamfer. // The id of the engine command that called this chamfer.
id: uuid, id: uuid,
length: number, length: number,
@ -476,7 +520,7 @@ const example = extrude(10, exampleSketch)
id: uuid, id: uuid,
// The sketch group. // The sketch group.
sketchGroup: { sketchGroup: {
// The id of the sketch group. // The id of the sketch group (this will change when the engine's reference to it changes.
id: uuid, id: uuid,
// What the sketch is on (can be a plane or a face). // What the sketch is on (can be a plane or a face).
on: SketchSurface, on: SketchSurface,
@ -627,6 +671,38 @@ const example = extrude(10, exampleSketch)
value: string, value: string,
}, },
type: "extrudeArc", type: "extrudeArc",
} |
{
// The id for the chamfer surface.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "chamfer",
} |
{
// The id for the fillet surface.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "fillet",
}], }],
}, },
// The id of the face. // The id of the face.

View File

@ -32,7 +32,7 @@ const example = extrude(5, exampleSketch)
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED) * `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
```js ```js
{ {
// The id of the sketch group. // The id of the sketch group (this will change when the engine's reference to it changes.
id: uuid, id: uuid,
// What the sketch is on (can be a plane or a face). // What the sketch is on (can be a plane or a face).
on: { on: {
@ -74,15 +74,21 @@ const example = extrude(5, exampleSketch)
// Chamfers or fillets on this extrude group. // Chamfers or fillets on this extrude group.
filletOrChamfers: [{ filletOrChamfers: [{
// The engine id of the edge to fillet. // The engine id of the edge to fillet.
edge_id: uuid, edgeId: uuid,
// The id of the engine command that called this fillet. // The id of the engine command that called this fillet.
id: uuid, id: uuid,
radius: number, radius: number,
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "fillet", type: "fillet",
} | } |
{ {
// The engine id of the edge to chamfer. // The engine id of the edge to chamfer.
edge_id: uuid, edgeId: uuid,
// The id of the engine command that called this chamfer. // The id of the engine command that called this chamfer.
id: uuid, id: uuid,
length: number, length: number,
@ -100,7 +106,7 @@ const example = extrude(5, exampleSketch)
id: uuid, id: uuid,
// The sketch group. // The sketch group.
sketchGroup: { sketchGroup: {
// The id of the sketch group. // The id of the sketch group (this will change when the engine's reference to it changes.
id: uuid, id: uuid,
// What the sketch is on (can be a plane or a face). // What the sketch is on (can be a plane or a face).
on: SketchSurface, on: SketchSurface,
@ -251,6 +257,38 @@ const example = extrude(5, exampleSketch)
value: string, value: string,
}, },
type: "extrudeArc", type: "extrudeArc",
} |
{
// The id for the chamfer surface.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "chamfer",
} |
{
// The id for the fillet surface.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "fillet",
}], }],
}, },
// The id of the face. // The id of the face.
@ -406,7 +444,7 @@ const example = extrude(5, exampleSketch)
`SketchGroup` - A sketch group is a collection of paths. `SketchGroup` - A sketch group is a collection of paths.
```js ```js
{ {
// The id of the sketch group. // The id of the sketch group (this will change when the engine's reference to it changes.
id: uuid, id: uuid,
// What the sketch is on (can be a plane or a face). // What the sketch is on (can be a plane or a face).
on: { on: {
@ -448,15 +486,21 @@ const example = extrude(5, exampleSketch)
// Chamfers or fillets on this extrude group. // Chamfers or fillets on this extrude group.
filletOrChamfers: [{ filletOrChamfers: [{
// The engine id of the edge to fillet. // The engine id of the edge to fillet.
edge_id: uuid, edgeId: uuid,
// The id of the engine command that called this fillet. // The id of the engine command that called this fillet.
id: uuid, id: uuid,
radius: number, radius: number,
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "fillet", type: "fillet",
} | } |
{ {
// The engine id of the edge to chamfer. // The engine id of the edge to chamfer.
edge_id: uuid, edgeId: uuid,
// The id of the engine command that called this chamfer. // The id of the engine command that called this chamfer.
id: uuid, id: uuid,
length: number, length: number,
@ -474,7 +518,7 @@ const example = extrude(5, exampleSketch)
id: uuid, id: uuid,
// The sketch group. // The sketch group.
sketchGroup: { sketchGroup: {
// The id of the sketch group. // The id of the sketch group (this will change when the engine's reference to it changes.
id: uuid, id: uuid,
// What the sketch is on (can be a plane or a face). // What the sketch is on (can be a plane or a face).
on: SketchSurface, on: SketchSurface,
@ -625,6 +669,38 @@ const example = extrude(5, exampleSketch)
value: string, value: string,
}, },
type: "extrudeArc", type: "extrudeArc",
} |
{
// The id for the chamfer surface.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "chamfer",
} |
{
// The id for the fillet surface.
faceId: uuid,
// The id of the geometry.
id: uuid,
// The source range.
sourceRange: [number, number],
// The tag.
tag: {
digest: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number],
end: number,
start: number,
value: string,
},
type: "fillet",
}], }],
}, },
// The id of the face. // The id of the face.

View File

@ -26,7 +26,7 @@ import * as TOML from '@iarna/toml'
import { LineInputsType } from 'lang/std/sketchcombos' import { LineInputsType } from 'lang/std/sketchcombos'
import { Coords2d } from 'lang/std/sketch' import { Coords2d } from 'lang/std/sketch'
import { KCL_DEFAULT_LENGTH } from 'lib/constants' import { KCL_DEFAULT_LENGTH } from 'lib/constants'
import { EngineCommand } from 'lang/std/engineConnection' import { EngineCommand } from 'lang/std/artifactMap'
import { onboardingPaths } from 'routes/Onboarding/paths' import { onboardingPaths } from 'routes/Onboarding/paths'
import { bracket } from 'lib/exampleKcl' import { bracket } from 'lib/exampleKcl'
@ -48,8 +48,6 @@ const commonPoints = {
startAt: '[7.19, -9.7]', startAt: '[7.19, -9.7]',
num1: 7.25, num1: 7.25,
num2: 14.44, num2: 14.44,
// num1: 9.64,
// num2: 19.19,
} }
test.afterEach(async ({ context, page }, testInfo) => { test.afterEach(async ({ context, page }, testInfo) => {
@ -141,8 +139,9 @@ async function doBasicSketch(page: Page, openPanes: string[]) {
await expect(u.codeLocator) await expect(u.codeLocator)
.toHaveText(`const sketch001 = startSketchOn('XZ') .toHaveText(`const sketch001 = startSketchOn('XZ')
|> startProfileAt(${commonPoints.startAt}, %)`) |> startProfileAt(${commonPoints.startAt}, %)`)
} else {
await page.waitForTimeout(500)
} }
await page.waitForTimeout(500)
await page.mouse.click(startXPx + PUR * 20, 500 - PUR * 10) await page.mouse.click(startXPx + PUR * 20, 500 - PUR * 10)
await page.waitForTimeout(500) await page.waitForTimeout(500)
@ -152,8 +151,9 @@ async function doBasicSketch(page: Page, openPanes: string[]) {
.toHaveText(`const sketch001 = startSketchOn('XZ') .toHaveText(`const sketch001 = startSketchOn('XZ')
|> startProfileAt(${commonPoints.startAt}, %) |> startProfileAt(${commonPoints.startAt}, %)
|> line([${commonPoints.num1}, 0], %)`) |> line([${commonPoints.num1}, 0], %)`)
} else {
await page.waitForTimeout(500)
} }
await page.waitForTimeout(500)
await page.mouse.click(startXPx + PUR * 20, 500 - PUR * 20) await page.mouse.click(startXPx + PUR * 20, 500 - PUR * 20)
if (openPanes.includes('code')) { if (openPanes.includes('code')) {
@ -162,8 +162,9 @@ async function doBasicSketch(page: Page, openPanes: string[]) {
|> startProfileAt(${commonPoints.startAt}, %) |> startProfileAt(${commonPoints.startAt}, %)
|> line([${commonPoints.num1}, 0], %) |> line([${commonPoints.num1}, 0], %)
|> line([0, ${commonPoints.num1 + 0.01}], %)`) |> line([0, ${commonPoints.num1 + 0.01}], %)`)
} else {
await page.waitForTimeout(500)
} }
await page.waitForTimeout(500)
await page.mouse.click(startXPx, 500 - PUR * 20) await page.mouse.click(startXPx, 500 - PUR * 20)
if (openPanes.includes('code')) { if (openPanes.includes('code')) {
await expect(u.codeLocator) await expect(u.codeLocator)
@ -175,7 +176,7 @@ async function doBasicSketch(page: Page, openPanes: string[]) {
} }
// deselect line tool // deselect line tool
await page.getByRole('button', { name: 'Line' }).click() await page.getByRole('button', { name: 'Line', exact: true }).click()
await page.waitForTimeout(500) await page.waitForTimeout(500)
const line1 = await u.getSegmentBodyCoords(`[data-overlay-index="${0}"]`, 0) const line1 = await u.getSegmentBodyCoords(`[data-overlay-index="${0}"]`, 0)
@ -203,7 +204,7 @@ async function doBasicSketch(page: Page, openPanes: string[]) {
await expect(page.locator('.cm-cursor')).toHaveCount(2) await expect(page.locator('.cm-cursor')).toHaveCount(2)
} }
await page.getByRole('button', { name: 'Constraints' }).click() await page.getByRole('button', { name: 'Length: open menu' }).click()
await page.getByRole('button', { name: 'Equal Length' }).click() await page.getByRole('button', { name: 'Equal Length' }).click()
// Open the code pane. // Open the code pane.
@ -212,7 +213,7 @@ async function doBasicSketch(page: Page, openPanes: string[]) {
|> startProfileAt(${commonPoints.startAt}, %) |> startProfileAt(${commonPoints.startAt}, %)
|> line([${commonPoints.num1}, 0], %, $seg01) |> line([${commonPoints.num1}, 0], %, $seg01)
|> line([0, ${commonPoints.num1 + 0.01}], %) |> line([0, ${commonPoints.num1 + 0.01}], %)
|> angledLine([180, segLen(seg01, %)], %)`) |> angledLine([180, segLen(seg01)], %)`)
} }
test.describe('Basic sketch', () => { test.describe('Basic sketch', () => {
@ -452,7 +453,7 @@ test.describe('Testing Camera Movement', () => {
// await expect(u.codeLocator).toHaveText(code) // await expect(u.codeLocator).toHaveText(code)
// click the line button // click the line button
await page.getByRole('button', { name: 'Line' }).click() await page.getByRole('button', { name: 'Line', exact: true }).click()
const hoverOverNothing = async () => { const hoverOverNothing = async () => {
// await u.canvasLocator.hover({position: {x: 700, y: 325}}) // await u.canvasLocator.hover({position: {x: 700, y: 325}})
@ -924,10 +925,10 @@ test.describe('Editor tests', () => {
await expect(page.locator('.cm-lint-marker-error')).toBeVisible() await expect(page.locator('.cm-lint-marker-error')).toBeVisible()
await expect( await expect(
page.locator('.cm-lintRange.cm-lintRange-error').first() page.locator('.cm-lint-marker.cm-lint-marker-error')
).toBeVisible() ).toBeVisible()
await page.locator('.cm-lintRange.cm-lintRange-error').hover() await page.locator('.cm-lint-marker.cm-lint-marker-error').hover()
await expect(page.locator('.cm-diagnosticText').first()).toBeVisible() await expect(page.locator('.cm-diagnosticText').first()).toBeVisible()
await expect( await expect(
page.getByText('Cannot redefine `topAng`').first() page.getByText('Cannot redefine `topAng`').first()
@ -1015,18 +1016,18 @@ test.describe('Editor tests', () => {
|> startProfileAt([0, 0], %) |> startProfileAt([0, 0], %)
|> line([0, 10], %) |> line([0, 10], %)
|> line([10, 0], %) |> line([10, 0], %)
|> line([0, -10], %, 'revolveAxis') |> line([0, -10], %, $revolveAxis)
|> close(%) |> close(%)
|> extrude(10, %) |> extrude(10, %)
const sketch001 = startSketchOn(box, "revolveAxis") const sketch001 = startSketchOn(box, revolveAxis)
|> startProfileAt([5, 10], %) |> startProfileAt([5, 10], %)
|> line([0, -10], %) |> line([0, -10], %)
|> line([2, 0], %) |> line([2, 0], %)
|> line([0, -10], %) |> line([0, -10], %)
|> close(%) |> close(%)
|> revolve({ |> revolve({
axis: getEdge('revolveAxis', box), axis: revolveAxis,
angle: 90 angle: 90
}, %) }, %)
` `
@ -1044,7 +1045,7 @@ test.describe('Editor tests', () => {
await page.hover('.cm-lint-marker-error') await page.hover('.cm-lint-marker-error')
const searchText = const searchText =
'sketch profile must lie entirely on one side of the revolution axis' 'sketch profile must lie entirely on one side of the revolution axis'
await expect(page.getByText(searchText).first()).toBeVisible() await expect(page.getByText(searchText)).toBeVisible()
}) })
test.describe('Autocomplete works', () => { test.describe('Autocomplete works', () => {
test('with enter/click to accept the completion', async ({ page }) => { test('with enter/click to accept the completion', async ({ page }) => {
@ -1063,7 +1064,7 @@ test.describe('Editor tests', () => {
await page.keyboard.type('const sketch001 = start') await page.keyboard.type('const sketch001 = start')
// expect there to be six auto complete options // expect there to be six auto complete options
await expect(page.locator('.cm-completionLabel')).toHaveCount(6) await expect(page.locator('.cm-completionLabel')).toHaveCount(8)
// this makes sure we can accept a completion with click // this makes sure we can accept a completion with click
await page.getByText('startSketchOn').click() await page.getByText('startSketchOn').click()
await page.keyboard.type("'XZ'") await page.keyboard.type("'XZ'")
@ -1462,7 +1463,9 @@ test.describe('Can create sketches on all planes and their back sides', () => {
await page.mouse.click(clickCoords.x, clickCoords.y) await page.mouse.click(clickCoords.x, clickCoords.y)
await page.waitForTimeout(300) // wait for animation await page.waitForTimeout(300) // wait for animation
await expect(page.getByRole('button', { name: 'Line' })).toBeVisible() await expect(
page.getByRole('button', { name: 'Line', exact: true })
).toBeVisible()
// draw a line // draw a line
const startXPx = 600 const startXPx = 600
@ -1472,7 +1475,7 @@ test.describe('Can create sketches on all planes and their back sides', () => {
await expect(page.locator('.cm-content')).toHaveText(code) await expect(page.locator('.cm-content')).toHaveText(code)
await page.getByRole('button', { name: 'Line' }).click() await page.getByRole('button', { name: 'Line', exact: true }).click()
await u.openAndClearDebugPanel() await u.openAndClearDebugPanel()
await page.getByRole('button', { name: 'Exit Sketch' }).click() await page.getByRole('button', { name: 'Exit Sketch' }).click()
await u.expectCmdLog('[data-message-type="execution-done"]') await u.expectCmdLog('[data-message-type="execution-done"]')
@ -1511,6 +1514,8 @@ test.describe('Can create sketches on all planes and their back sides', () => {
}) })
test.describe('Copilot ghost text', () => { test.describe('Copilot ghost text', () => {
test.skip(true, 'Needs to get covered again')
test('completes code in empty file', async ({ page }) => { test('completes code in empty file', async ({ page }) => {
const u = await getUtils(page) const u = await getUtils(page)
// const PUR = 400 / 37.5 //pixeltoUnitRatio // const PUR = 400 / 37.5 //pixeltoUnitRatio
@ -1549,7 +1554,9 @@ test.describe('Copilot ghost text', () => {
await expect(page.locator('.cm-ghostText')).not.toBeVisible() await expect(page.locator('.cm-ghostText')).not.toBeVisible()
}) })
test('copilot disabled in sketch mode no select plane', async ({ page }) => { test.skip('copilot disabled in sketch mode no select plane', async ({
page,
}) => {
const u = await getUtils(page) const u = await getUtils(page)
// const PUR = 400 / 37.5 //pixeltoUnitRatio // const PUR = 400 / 37.5 //pixeltoUnitRatio
await page.setViewportSize({ width: 1200, height: 500 }) await page.setViewportSize({ width: 1200, height: 500 })
@ -2096,7 +2103,7 @@ test.describe('Testing settings', () => {
.hover() .hover()
await page await page
.getByRole('button', { .getByRole('button', {
name: 'Roll back theme ; Has tooltip: Roll back to match default', name: 'Roll back theme',
}) })
.click() .click()
await expect(page.locator('select[name="app-theme"]')).toHaveValue('system') await expect(page.locator('select[name="app-theme"]')).toHaveValue('system')
@ -2148,7 +2155,7 @@ test.describe('Testing settings', () => {
.hover() .hover()
await page await page
.getByRole('button', { .getByRole('button', {
name: 'Roll back theme ; Has tooltip: Roll back to match default', name: 'Roll back theme',
}) })
.click() .click()
await expect(page.locator('select[name="app-theme"]')).toHaveValue('system') await expect(page.locator('select[name="app-theme"]')).toHaveValue('system')
@ -2258,6 +2265,50 @@ test.describe('Onboarding tests', () => {
await expect(page.locator('.cm-content')).toContainText('// Shelf Bracket') await expect(page.locator('.cm-content')).toContainText('// Shelf Bracket')
}) })
test('Code resets after confirmation', async ({ page }) => {
const initialCode = `const sketch001 = startSketchOn('XZ')`
// Load the page up with some code so we see the confirmation warning
// when we go to replay onboarding
await page.addInitScript((code) => {
localStorage.setItem('persistCode', code)
}, initialCode)
const u = await getUtils(page)
await page.setViewportSize({ width: 1200, height: 500 })
await u.waitForAuthSkipAppStart()
// Replay the onboarding
await page.getByRole('link', { name: 'Settings' }).last().click()
const replayButton = page.getByRole('button', { name: 'Replay onboarding' })
await expect(replayButton).toBeVisible()
await replayButton.click()
// Ensure we see the warning, and that the code has not yet updated
await expect(
page.getByText('Replaying onboarding resets your code')
).toBeVisible()
await expect(page.locator('.cm-content')).toHaveText(initialCode)
const nextButton = page.getByTestId('onboarding-next')
await expect(nextButton).toBeVisible()
await nextButton.click()
// Ensure we see the introduction and that the code has been reset
await expect(page.getByText('Welcome to Modeling App!')).toBeVisible()
await expect(page.locator('.cm-content')).toContainText('// Shelf Bracket')
// Ensure we persisted the code to local storage.
// Playwright's addInitScript method unfortunately will reset
// this code if we try reloading the page as a test,
// so this is our best way to test persistence afaik.
expect(
await page.evaluate(() => {
return localStorage.getItem('persistCode')
})
).toContain('// Shelf Bracket')
})
test('Click through each onboarding step', async ({ page }) => { test('Click through each onboarding step', async ({ page }) => {
const u = await getUtils(page) const u = await getUtils(page)
@ -2562,7 +2613,7 @@ test.describe('Testing selections', () => {
|> line([-${commonPoints.num2}, 0], %)`) |> line([-${commonPoints.num2}, 0], %)`)
// deselect line tool // deselect line tool
await page.getByRole('button', { name: 'Line' }).click() await page.getByRole('button', { name: 'Line', exact: true }).click()
await u.closeDebugPanel() await u.closeDebugPanel()
const selectionSequence = async () => { const selectionSequence = async () => {
@ -2587,8 +2638,10 @@ test.describe('Testing selections', () => {
// click a segment hold shift and click an axis, see that a relevant constraint is enabled // click a segment hold shift and click an axis, see that a relevant constraint is enabled
await topHorzSegmentClick() await topHorzSegmentClick()
await page.keyboard.down('Shift') await page.keyboard.down('Shift')
const constrainButton = page.getByRole('button', { name: 'Constraints' }) const constrainButton = page.getByRole('button', {
const absYButton = page.getByRole('button', { name: 'ABS Y' }) name: 'Length: open menu',
})
const absYButton = page.getByRole('button', { name: 'Absolute Y' })
await constrainButton.click() await constrainButton.click()
await expect(absYButton).toBeDisabled() await expect(absYButton).toBeDisabled()
await page.waitForTimeout(100) await page.waitForTimeout(100)
@ -3160,7 +3213,7 @@ const extrude001 = extrude(10, sketch001)`
}, },
{ {
pos: [816, 244], pos: [816, 244],
expectedCode: 'angledLine([segAng(seg01, %), yo], %)', expectedCode: 'angledLine([segAng(seg01), yo], %)',
}, },
{ {
pos: [1107, 161], pos: [1107, 161],
@ -3412,21 +3465,6 @@ const extrude001 = extrude(50, sketch001)
await expect( await expect(
page.getByRole('button', { name: 'Edit Sketch' }) page.getByRole('button', { name: 'Edit Sketch' })
).not.toBeVisible() ).not.toBeVisible()
// selecting an editable sketch but clicking "start sketch" should start a new sketch and not edit the existing one
await page.getByText(selectionsSnippets.extrudeAndEditAllowed).click()
await page.getByRole('button', { name: 'Start Sketch' }).click()
await page.waitForTimeout(200)
await page.getByTestId('KCL Code').click()
await page.waitForTimeout(200)
await page.mouse.click(734, 134)
await page.waitForTimeout(100)
await page.getByTestId('KCL Code').click()
// expect main content to contain `sketch005` i.e. started a new sketch
await page.waitForTimeout(300)
await expect(page.locator('.cm-content')).toHaveText(
/sketch001 = startSketchOn\('XZ'\)/
)
}) })
test('Deselecting line tool should mean nothing happens on click', async ({ test('Deselecting line tool should mean nothing happens on click', async ({
@ -3463,7 +3501,7 @@ const extrude001 = extrude(50, sketch001)
let previousCodeContent = await page.locator('.cm-content').innerText() let previousCodeContent = await page.locator('.cm-content').innerText()
// deselect the line tool by clicking it // deselect the line tool by clicking it
await page.getByRole('button', { name: 'Line' }).click() await page.getByRole('button', { name: 'Line', exact: true }).click()
await page.mouse.click(700, 200) await page.mouse.click(700, 200)
await page.waitForTimeout(100) await page.waitForTimeout(100)
@ -3476,7 +3514,7 @@ const extrude001 = extrude(50, sketch001)
await expect(page.locator('.cm-content')).toHaveText(previousCodeContent) await expect(page.locator('.cm-content')).toHaveText(previousCodeContent)
// select line tool again // select line tool again
await page.getByRole('button', { name: 'Line' }).click() await page.getByRole('button', { name: 'Line', exact: true }).click()
await u.closeDebugPanel() await u.closeDebugPanel()
@ -3809,13 +3847,24 @@ const extrude001 = extrude(distance001, sketch001)`.replace(
const sketchButton = page.getByRole('button', { name: 'Start Sketch' }) const sketchButton = page.getByRole('button', { name: 'Start Sketch' })
const cmdBarButton = page.getByRole('button', { name: 'Commands' }) const cmdBarButton = page.getByRole('button', { name: 'Commands' })
const rectangleToolCommand = page.getByRole('option', { const rectangleToolCommand = page.getByRole('option', {
name: 'Rectangle', name: 'rectangle',
})
const rectangleToolButton = page.getByRole('button', {
name: 'Corner rectangle',
exact: true,
})
const lineToolCommand = page.getByRole('option', {
name: 'Line',
})
const lineToolButton = page.getByRole('button', {
name: 'Line',
exact: true,
}) })
const rectangleToolButton = page.getByRole('button', { name: 'Rectangle' })
const lineToolCommand = page.getByRole('option', { name: 'Line' })
const lineToolButton = page.getByRole('button', { name: 'Line' })
const arcToolCommand = page.getByRole('option', { name: 'Tangential Arc' }) const arcToolCommand = page.getByRole('option', { name: 'Tangential Arc' })
const arcToolButton = page.getByRole('button', { name: 'Tangential Arc' }) const arcToolButton = page.getByRole('button', {
name: 'Tangential Arc',
exact: true,
})
// Start a sketch // Start a sketch
await sketchButton.click() await sketchButton.click()
@ -3862,10 +3911,7 @@ test.describe('Regression tests', () => {
await u.waitForAuthSkipAppStart() await u.waitForAuthSkipAppStart()
// expand variables section // expand variables section
const variablesTabButton = page.getByRole('tab', { const variablesTabButton = page.getByTestId('variables-pane-button')
name: 'Variables',
exact: false,
})
await variablesTabButton.click() await variablesTabButton.click()
// can find sketch001 in the variables summary (pretty-json-container, makes sure we're not looking in the code editor) // can find sketch001 in the variables summary (pretty-json-container, makes sure we're not looking in the code editor)
@ -3890,10 +3936,7 @@ test.describe('Regression tests', () => {
await u.waitForAuthSkipAppStart() await u.waitForAuthSkipAppStart()
const variablesTabButton = page.getByRole('tab', { const variablesTabButton = page.getByTestId('variables-pane-button')
name: 'Variables',
exact: false,
})
await variablesTabButton.click() await variablesTabButton.click()
// expect to see "myVar:5" // expect to see "myVar:5"
await expect( await expect(
@ -3976,16 +4019,19 @@ test.describe('Regression tests', () => {
) )
}) })
await page.goto('/') await expect(async () => {
await u.waitForPageLoad() await page.goto('/')
await u.waitForPageLoad()
// error in guter // error in guter
await expect(page.locator('.cm-lint-marker-error')).toBeVisible() await expect(page.locator('.cm-lint-marker-error')).toBeVisible({
await page.waitForTimeout(200) timeout: 1_000,
// expect it still to be there (sometimes it just clears for a bit?) })
await expect(page.locator('.cm-lint-marker-error')).toBeVisible({ await page.waitForTimeout(200)
timeout: 10_000, // expect it still to be there (sometimes it just clears for a bit?)
}) await expect(page.locator('.cm-lint-marker-error')).toBeVisible({
timeout: 1_000,
})
}).toPass({ timeout: 40_000, intervals: [1_000] })
// error text on hover // error text on hover
await page.hover('.cm-lint-marker-error') await page.hover('.cm-lint-marker-error')
@ -4133,12 +4179,15 @@ test.describe('Sketch tests', () => {
await page.setViewportSize({ width: 1200, height: 500 }) await page.setViewportSize({ width: 1200, height: 500 })
await u.waitForAuthSkipAppStart() await u.waitForAuthSkipAppStart()
await page.getByText('tangentialArcTo([24.95, -5.38], %)').click()
await expect( await expect(async () => {
page.getByRole('button', { name: 'Edit Sketch' }) await page.mouse.click(700, 200)
).toBeEnabled() await page.getByText('tangentialArcTo([24.95, -5.38], %)').click()
await page.getByRole('button', { name: 'Edit Sketch' }).click() await expect(
page.getByRole('button', { name: 'Edit Sketch' })
).toBeEnabled({ timeout: 1000 })
await page.getByRole('button', { name: 'Edit Sketch' }).click()
}).toPass({ timeout: 40_000, intervals: [1_000] })
await page.waitForTimeout(600) // wait for animation await page.waitForTimeout(600) // wait for animation
@ -4154,7 +4203,7 @@ test.describe('Sketch tests', () => {
await u.expectCmdLog('[data-message-type="execution-done"]', 10_000) await u.expectCmdLog('[data-message-type="execution-done"]', 10_000)
await page.waitForTimeout(100) await page.waitForTimeout(100)
await page.getByRole('button', { name: 'Line' }).click() await page.getByRole('button', { name: 'Line', exact: true }).click()
await page.waitForTimeout(100) await page.waitForTimeout(100)
await page.mouse.click(700, 200) await page.mouse.click(700, 200)
@ -4181,9 +4230,7 @@ test.describe('Sketch tests', () => {
page.getByRole('button', { name: 'Exit Sketch' }) page.getByRole('button', { name: 'Exit Sketch' })
).toBeVisible() ).toBeVisible()
await expect( await expect(page.getByText('select a plane or face')).toBeVisible()
page.getByText('click plane or face to sketch on')
).toBeVisible()
await page.keyboard.press('Escape') await page.keyboard.press('Escape')
await expect( await expect(
@ -4734,7 +4781,7 @@ test.describe('Sketch tests', () => {
await expect(page.locator('.cm-content')).toHaveText(code) await expect(page.locator('.cm-content')).toHaveText(code)
// Assert the tool was unequipped // Assert the tool was unequipped
await expect( await expect(
page.getByRole('button', { name: 'Line' }) page.getByRole('button', { name: 'Line', exact: true })
).not.toHaveAttribute('aria-pressed', 'true') ).not.toHaveAttribute('aria-pressed', 'true')
// exit sketch // exit sketch
@ -4896,8 +4943,7 @@ test.describe('Testing constraints', () => {
await page.mouse.click(834, 244) await page.mouse.click(834, 244)
await page.keyboard.up('Shift') await page.keyboard.up('Shift')
await page.getByRole('button', { name: 'Constraints', exact: true }).click() await page.getByRole('button', { name: 'Length', exact: true }).click()
await page.getByRole('button', { name: 'length', exact: true }).click()
await page.getByText('Add constraining value').click() await page.getByText('Add constraining value').click()
await expect(page.locator('.cm-content')).toHaveText( await expect(page.locator('.cm-content')).toHaveText(
@ -4927,13 +4973,13 @@ const part001 = startSketchOn('XZ')
|> startProfileAt([-7.54, -26.74], %) |> startProfileAt([-7.54, -26.74], %)
|> line([74.36, 130.4], %, $seg01) |> line([74.36, 130.4], %, $seg01)
|> line([78.92, -120.11], %) |> line([78.92, -120.11], %)
|> angledLine([segAng(seg01, %), yo], %) |> angledLine([segAng(seg01), yo], %)
|> line([41.19, 28.97 + 5], %) |> line([41.19, 28.97 + 5], %)
const part002 = startSketchOn('XZ') const part002 = startSketchOn('XZ')
|> startProfileAt([299.05, 231.45], %) |> startProfileAt([299.05, 231.45], %)
|> xLine(-425.34, %, $seg_what) |> xLine(-425.34, %, $seg_what)
|> yLine(-264.06, %) |> yLine(-264.06, %)
|> xLine(segLen(seg_what, %), %) |> xLine(segLen(seg_what), %)
|> lineTo([profileStartX(%), profileStartY(%)], %)` |> lineTo([profileStartX(%), profileStartY(%)], %)`
) )
}) })
@ -4951,12 +4997,10 @@ const part002 = startSketchOn('XZ')
await page.waitForTimeout(100) // this wait is needed for webkit - not sure why await page.waitForTimeout(100) // this wait is needed for webkit - not sure why
await page await page
.getByRole('button', { .getByRole('button', {
name: 'Constraints', name: 'Length: open menu',
}) })
.click() .click()
await page await page.getByRole('button', { name: 'remove constraints' }).click()
.getByRole('button', { name: 'remove constraints', exact: true })
.click()
await page.getByText('line([39.13, 68.63], %)').click() await page.getByText('line([39.13, 68.63], %)').click()
const activeLinesContent = await page.locator('.cm-activeLine').all() const activeLinesContent = await page.locator('.cm-activeLine').all()
@ -4987,13 +5031,13 @@ const part001 = startSketchOn('XZ')
|> startProfileAt([-7.54, -26.74], %) |> startProfileAt([-7.54, -26.74], %)
|> line([74.36, 130.4], %, $seg01) |> line([74.36, 130.4], %, $seg01)
|> line([78.92, -120.11], %) |> line([78.92, -120.11], %)
|> angledLine([segAng(seg01, %), 78.33], %) |> angledLine([segAng(seg01), 78.33], %)
|> line([41.19, 28.97], %) |> line([41.19, 28.97], %)
const part002 = startSketchOn('XZ') const part002 = startSketchOn('XZ')
|> startProfileAt([299.05, 231.45], %) |> startProfileAt([299.05, 231.45], %)
|> xLine(-425.34, %, $seg_what) |> xLine(-425.34, %, $seg_what)
|> yLine(-264.06, %) |> yLine(-264.06, %)
|> xLine(segLen(seg_what, %), %) |> xLine(segLen(seg_what), %)
|> lineTo([profileStartX(%), profileStartY(%)], %)` |> lineTo([profileStartX(%), profileStartY(%)], %)`
) )
}) })
@ -5017,11 +5061,11 @@ const part002 = startSketchOn('XZ')
await page.keyboard.up('Shift') await page.keyboard.up('Shift')
await page await page
.getByRole('button', { .getByRole('button', {
name: 'Constraints', name: 'Length: open menu',
}) })
.click() .click()
await page await page
.getByRole('button', { name: 'perpendicular distance', exact: true }) .getByRole('button', { name: 'Perpendicular Distance' })
.click() .click()
const createNewVariableCheckbox = page.getByTestId( const createNewVariableCheckbox = page.getByTestId(
@ -5058,22 +5102,22 @@ const part002 = startSketchOn('XZ')
{ {
testName: 'Add variable', testName: 'Add variable',
constraint: 'horizontal distance', constraint: 'horizontal distance',
value: 'segEndX(seg01, %) + xDis001, 61.34', value: 'segEndX(seg01) + xDis001, 61.34',
}, },
{ {
testName: 'No variable', testName: 'No variable',
constraint: 'horizontal distance', constraint: 'horizontal distance',
value: 'segEndX(seg01, %) + 88.08, 61.34', value: 'segEndX(seg01) + 88.08, 61.34',
}, },
{ {
testName: 'Add variable', testName: 'Add variable',
constraint: 'vertical distance', constraint: 'vertical distance',
value: '154.9, segEndY(seg01, %) - yDis001', value: '154.9, segEndY(seg01) - yDis001',
}, },
{ {
testName: 'No variable', testName: 'No variable',
constraint: 'vertical distance', constraint: 'vertical distance',
value: '154.9, segEndY(seg01, %) - 42.32', value: '154.9, segEndY(seg01) - 42.32',
}, },
] as const ] as const
for (const { testName, value, constraint } of cases) { for (const { testName, value, constraint } of cases) {
@ -5092,7 +5136,7 @@ const part002 = startSketchOn('XZ')
|> startProfileAt([299.05, 231.45], %) |> startProfileAt([299.05, 231.45], %)
|> xLine(-425.34, %, $seg_what) |> xLine(-425.34, %, $seg_what)
|> yLine(-264.06, %) |> yLine(-264.06, %)
|> xLine(segLen(seg_what, %), %) |> xLine(segLen(seg_what), %)
|> lineTo([profileStartX(%), profileStartY(%)], %)` |> lineTo([profileStartX(%), profileStartY(%)], %)`
) )
}) })
@ -5116,12 +5160,10 @@ const part002 = startSketchOn('XZ')
await page.keyboard.up('Shift') await page.keyboard.up('Shift')
await page await page
.getByRole('button', { .getByRole('button', {
name: 'Constraints', name: 'Length: open menu',
}) })
.click() .click()
await page await page.getByRole('button', { name: constraint }).click()
.getByRole('button', { name: constraint, exact: true })
.click()
const createNewVariableCheckbox = page.getByTestId( const createNewVariableCheckbox = page.getByTestId(
'create-new-variable-checkbox' 'create-new-variable-checkbox'
@ -5162,25 +5204,25 @@ const part002 = startSketchOn('XZ')
{ {
testName: 'Add variable', testName: 'Add variable',
addVariable: true, addVariable: true,
constraint: 'ABS X', constraint: 'Absolute X',
value: 'xDis001, 61.34', value: 'xDis001, 61.34',
}, },
{ {
testName: 'No variable', testName: 'No variable',
addVariable: false, addVariable: false,
constraint: 'ABS X', constraint: 'Absolute X',
value: '154.9, 61.34', value: '154.9, 61.34',
}, },
{ {
testName: 'Add variable', testName: 'Add variable',
addVariable: true, addVariable: true,
constraint: 'ABS Y', constraint: 'Absolute Y',
value: '154.9, yDis001', value: '154.9, yDis001',
}, },
{ {
testName: 'No variable', testName: 'No variable',
addVariable: false, addVariable: false,
constraint: 'ABS Y', constraint: 'Absolute Y',
value: '154.9, 61.34', value: '154.9, 61.34',
}, },
] as const ] as const
@ -5200,7 +5242,7 @@ const part002 = startSketchOn('XZ')
|> startProfileAt([299.05, 231.45], %) |> startProfileAt([299.05, 231.45], %)
|> xLine(-425.34, %, $seg_what) |> xLine(-425.34, %, $seg_what)
|> yLine(-264.06, %) |> yLine(-264.06, %)
|> xLine(segLen(seg_what, %), %) |> xLine(segLen(seg_what), %)
|> lineTo([profileStartX(%), profileStartY(%)], %)` |> lineTo([profileStartX(%), profileStartY(%)], %)`
) )
}) })
@ -5216,7 +5258,7 @@ const part002 = startSketchOn('XZ')
u.getSegmentBodyCoords(`[data-overlay-index="${2}"]`), u.getSegmentBodyCoords(`[data-overlay-index="${2}"]`),
]) ])
if (constraint === 'ABS X') { if (constraint === 'Absolute X') {
await page.mouse.click(600, 130) await page.mouse.click(600, 130)
} else { } else {
await page.mouse.click(900, 250) await page.mouse.click(900, 250)
@ -5227,7 +5269,7 @@ const part002 = startSketchOn('XZ')
await page.keyboard.up('Shift') await page.keyboard.up('Shift')
await page await page
.getByRole('button', { .getByRole('button', {
name: 'Constraints', name: 'Length: open menu',
}) })
.click() .click()
await page await page
@ -5270,13 +5312,13 @@ const part002 = startSketchOn('XZ')
testName: 'Add variable', testName: 'Add variable',
addVariable: true, addVariable: true,
axisSelect: false, axisSelect: false,
value: 'segAng(seg01, %) + angle001', value: 'segAng(seg01) + angle001',
}, },
{ {
testName: 'No variable', testName: 'No variable',
addVariable: false, addVariable: false,
axisSelect: false, axisSelect: false,
value: 'segAng(seg01, %) + 22.69', value: 'segAng(seg01) + 22.69',
}, },
{ {
testName: 'Add variable, selecting axis', testName: 'Add variable, selecting axis',
@ -5307,7 +5349,7 @@ const part002 = startSketchOn('XZ')
|> startProfileAt([299.05, 231.45], %) |> startProfileAt([299.05, 231.45], %)
|> xLine(-425.34, %, $seg_what) |> xLine(-425.34, %, $seg_what)
|> yLine(-264.06, %) |> yLine(-264.06, %)
|> xLine(segLen(seg_what, %), %) |> xLine(segLen(seg_what), %)
|> lineTo([profileStartX(%), profileStartY(%)], %)` |> lineTo([profileStartX(%), profileStartY(%)], %)`
) )
}) })
@ -5335,10 +5377,10 @@ const part002 = startSketchOn('XZ')
await page.keyboard.up('Shift') await page.keyboard.up('Shift')
await page await page
.getByRole('button', { .getByRole('button', {
name: 'Constraints', name: 'Length: open menu',
}) })
.click() .click()
await page.getByTestId('angle').click() await page.getByTestId('dropdown-constraint-angle').click()
const createNewVariableCheckbox = page.getByTestId( const createNewVariableCheckbox = page.getByTestId(
'create-new-variable-checkbox' 'create-new-variable-checkbox'
@ -5417,7 +5459,7 @@ const part002 = startSketchOn('XZ')
|> startProfileAt([299.05, 231.45], %) |> startProfileAt([299.05, 231.45], %)
|> xLine(-425.34, %, $seg_what) |> xLine(-425.34, %, $seg_what)
|> yLine(-264.06, %) |> yLine(-264.06, %)
|> xLine(segLen(seg_what, %), %) |> xLine(segLen(seg_what), %)
|> lineTo([profileStartX(%), profileStartY(%)], %)` |> lineTo([profileStartX(%), profileStartY(%)], %)`
) )
}) })
@ -5436,10 +5478,10 @@ const part002 = startSketchOn('XZ')
await page.mouse.click(line3.x, line3.y) await page.mouse.click(line3.x, line3.y)
await page await page
.getByRole('button', { .getByRole('button', {
name: 'Constraints', name: 'Length: open menu',
}) })
.click() .click()
await page.getByTestId(constraint).click() await page.getByTestId('dropdown-constraint-' + constraint).click()
if (!addVariable) { if (!addVariable) {
await page.getByTestId('create-new-variable-checkbox').click() await page.getByTestId('create-new-variable-checkbox').click()
@ -5493,7 +5535,7 @@ const part002 = startSketchOn('XZ')
|> startProfileAt([299.05, 231.45], %) |> startProfileAt([299.05, 231.45], %)
|> xLine(-425.34, %, $seg_what) |> xLine(-425.34, %, $seg_what)
|> yLine(-264.06, %) |> yLine(-264.06, %)
|> xLine(segLen(seg_what, %), %) |> xLine(segLen(seg_what), %)
|> lineTo([profileStartX(%), profileStartY(%)], %)` |> lineTo([profileStartX(%), profileStartY(%)], %)`
) )
}) })
@ -5527,7 +5569,7 @@ const part002 = startSketchOn('XZ')
await expect(activeLinesContent).toHaveLength(codeAfter.length) await expect(activeLinesContent).toHaveLength(codeAfter.length)
const constraintMenuButton = page.getByRole('button', { const constraintMenuButton = page.getByRole('button', {
name: 'Constraints', name: 'Length: open menu',
}) })
const constraintButton = page const constraintButton = page
.getByRole('button', { .getByRole('button', {
@ -5558,19 +5600,19 @@ const part002 = startSketchOn('XZ')
test.describe('Two segment - no modal constraints', () => { test.describe('Two segment - no modal constraints', () => {
const cases = [ const cases = [
{ {
codeAfter: `|> angledLine([83, segLen(seg01, %)], %)`, codeAfter: `|> angledLine([83, segLen(seg01)], %)`,
constraintName: 'Equal Length', constraintName: 'Equal Length',
}, },
{ {
codeAfter: `|> angledLine([segAng(seg01, %), 78.33], %)`, codeAfter: `|> angledLine([segAng(seg01), 78.33], %)`,
constraintName: 'Parallel', constraintName: 'Parallel',
}, },
{ {
codeAfter: `|> lineTo([segEndX(seg01, %), 61.34], %)`, codeAfter: `|> lineTo([segEndX(seg01), 61.34], %)`,
constraintName: 'Vertically Align', constraintName: 'Vertically Align',
}, },
{ {
codeAfter: `|> lineTo([154.9, segEndY(seg01, %)], %)`, codeAfter: `|> lineTo([154.9, segEndY(seg01)], %)`,
constraintName: 'Horizontally Align', constraintName: 'Horizontally Align',
}, },
] as const ] as const
@ -5589,7 +5631,7 @@ const part002 = startSketchOn('XZ')
|> startProfileAt([299.05, 231.45], %) |> startProfileAt([299.05, 231.45], %)
|> xLine(-425.34, %, $seg_what) |> xLine(-425.34, %, $seg_what)
|> yLine(-264.06, %) |> yLine(-264.06, %)
|> xLine(segLen(seg_what, %), %) |> xLine(segLen(seg_what), %)
|> lineTo([profileStartX(%), profileStartY(%)], %)` |> lineTo([profileStartX(%), profileStartY(%)], %)`
) )
}) })
@ -5610,7 +5652,7 @@ const part002 = startSketchOn('XZ')
await page.mouse.click(line3.x - 3, line3.y + 20) await page.mouse.click(line3.x - 3, line3.y + 20)
await page.keyboard.up('Shift') await page.keyboard.up('Shift')
const constraintMenuButton = page.getByRole('button', { const constraintMenuButton = page.getByRole('button', {
name: 'Constraints', name: 'Length: open menu',
}) })
const constraintButton = page.getByRole('button', { const constraintButton = page.getByRole('button', {
name: constraintName, name: constraintName,
@ -5666,7 +5708,7 @@ const part002 = startSketchOn('XZ')
|> startProfileAt([299.05, 231.45], %) |> startProfileAt([299.05, 231.45], %)
|> xLine(-425.34, %, $seg_what) |> xLine(-425.34, %, $seg_what)
|> yLine(-264.06, %) |> yLine(-264.06, %)
|> xLine(segLen(seg_what, %), %) |> xLine(segLen(seg_what), %)
|> lineTo([profileStartX(%), profileStartY(%)], %)` |> lineTo([profileStartX(%), profileStartY(%)], %)`
) )
}) })
@ -5687,7 +5729,7 @@ const part002 = startSketchOn('XZ')
await page.mouse.click(axisClick.x, axisClick.y) await page.mouse.click(axisClick.x, axisClick.y)
await page.keyboard.up('Shift') await page.keyboard.up('Shift')
const constraintMenuButton = page.getByRole('button', { const constraintMenuButton = page.getByRole('button', {
name: 'Constraints', name: 'Length: open menu',
}) })
const constraintButton = page.getByRole('button', { const constraintButton = page.getByRole('button', {
name: constraintName, name: constraintName,
@ -5746,10 +5788,10 @@ const part002 = startSketchOn('XZ')
await page await page
.getByRole('button', { .getByRole('button', {
name: 'Constraints', name: 'Length: open menu',
}) })
.click() .click()
await page.getByRole('button', { name: 'horizontal', exact: true }).click() await page.getByRole('button', { name: 'Horizontal', exact: true }).click()
let activeLinesContent = await page.locator('.cm-activeLine').all() let activeLinesContent = await page.locator('.cm-activeLine').all()
await expect(activeLinesContent[0]).toHaveText(`|> xLine(3.13, %)`) await expect(activeLinesContent[0]).toHaveText(`|> xLine(3.13, %)`)
@ -5770,13 +5812,13 @@ const part002 = startSketchOn('XZ')
await page.waitForTimeout(300) await page.waitForTimeout(300)
await page await page
.getByRole('button', { .getByRole('button', {
name: 'Constraints', name: 'Length: open menu',
}) })
.click() .click()
// await expect(page.getByRole('button', { name: 'length', exact: true })).toBeVisible() // await expect(page.getByRole('button', { name: 'length', exact: true })).toBeVisible()
await page.waitForTimeout(200) await page.waitForTimeout(200)
// await page.getByRole('button', { name: 'length', exact: true }).click() // await page.getByRole('button', { name: 'length', exact: true }).click()
await page.locator('[data-testid="length"]').click() await page.getByTestId('dropdown-constraint-length').click()
await page.getByLabel('length Value').fill('10') await page.getByLabel('length Value').fill('10')
await page.getByRole('button', { name: 'Add constraining value' }).click() await page.getByRole('button', { name: 'Add constraining value' }).click()
@ -6834,8 +6876,8 @@ const part001 = startSketchOn('XZ')
|> startProfileAt([5, 6], %) |> startProfileAt([5, 6], %)
|> ${lineToBeDeleted} |> ${lineToBeDeleted}
|> line([-10, -15], %) |> line([-10, -15], %)
|> angledLine([-176, segLen(seg01, %)], %) |> angledLine([-176, segLen(seg01)], %)
${extraLine ? 'const myVar = segLen(seg01, part001)' : ''}` ${extraLine ? 'const myVar = segLen(seg01)' : ''}`
) )
}, },
{ {
@ -6994,7 +7036,7 @@ ${extraLine ? 'const myVar = segLen(seg01, part001)' : ''}`
|> startProfileAt([5, 6], %) |> startProfileAt([5, 6], %)
|> ${lineToBeDeleted} |> ${lineToBeDeleted}
|> line([-10, -15], %) |> line([-10, -15], %)
|> angledLine([-176, segLen(seg01, %)], %)` |> angledLine([-176, segLen(seg01)], %)`
) )
}, },
{ {
@ -7068,6 +7110,8 @@ test.describe('Test network and connection issues', () => {
await u.waitForAuthSkipAppStart() await u.waitForAuthSkipAppStart()
const networkToggle = page.getByTestId('network-toggle')
// This is how we wait until the stream is online // This is how we wait until the stream is online
await expect( await expect(
page.getByRole('button', { name: 'Start Sketch' }) page.getByRole('button', { name: 'Start Sketch' })
@ -7081,7 +7125,7 @@ test.describe('Test network and connection issues', () => {
await expect(networkPopover).not.toBeVisible() await expect(networkPopover).not.toBeVisible()
// (First check) Expect the network to be up // (First check) Expect the network to be up
await expect(page.getByText('Network Health (Connected)')).toBeVisible() await expect(networkToggle).toContainText('Connected')
// Click the network widget // Click the network widget
await networkWidget.click() await networkWidget.click()
@ -7103,7 +7147,7 @@ test.describe('Test network and connection issues', () => {
}) })
// Expect the network to be down // Expect the network to be down
await expect(page.getByText('Network Health (Offline)')).toBeVisible() await expect(networkToggle).toContainText('Offline')
// Click the network widget // Click the network widget
await networkWidget.click() await networkWidget.click()
@ -7129,7 +7173,7 @@ test.describe('Test network and connection issues', () => {
).not.toBeDisabled({ timeout: 15000 }) ).not.toBeDisabled({ timeout: 15000 })
// (Second check) expect the network to be up // (Second check) expect the network to be up
await expect(page.getByText('Network Health (Connected)')).toBeVisible() await expect(networkToggle).toContainText('Connected')
}) })
test('Engine disconnect & reconnect in sketch mode', async ({ test('Engine disconnect & reconnect in sketch mode', async ({
@ -7141,6 +7185,8 @@ test.describe('Test network and connection issues', () => {
browserName === 'webkit', browserName === 'webkit',
'Skip on Safari until `window.tearDown` is working there' 'Skip on Safari until `window.tearDown` is working there'
) )
const networkToggle = page.getByTestId('network-toggle')
const u = await getUtils(page) const u = await getUtils(page)
await page.setViewportSize({ width: 1200, height: 500 }) await page.setViewportSize({ width: 1200, height: 500 })
const PUR = 400 / 37.5 //pixeltoUnitRatio const PUR = 400 / 37.5 //pixeltoUnitRatio
@ -7183,7 +7229,7 @@ test.describe('Test network and connection issues', () => {
|> line([${commonPoints.num1}, 0], %)`) |> line([${commonPoints.num1}, 0], %)`)
// Expect the network to be up // Expect the network to be up
await expect(page.getByText('Network Health (Connected)')).toBeVisible() await expect(networkToggle).toContainText('Connected')
// simulate network down // simulate network down
await u.emulateNetworkConditions({ await u.emulateNetworkConditions({
@ -7195,7 +7241,7 @@ test.describe('Test network and connection issues', () => {
}) })
// Expect the network to be down // Expect the network to be down
await expect(page.getByText('Network Health (Offline)')).toBeVisible() await expect(networkToggle).toContainText('Offline')
// Ensure we are not in sketch mode // Ensure we are not in sketch mode
await expect( await expect(
@ -7220,7 +7266,8 @@ test.describe('Test network and connection issues', () => {
).not.toBeDisabled({ timeout: 15000 }) ).not.toBeDisabled({ timeout: 15000 })
// Expect the network to be up // Expect the network to be up
await expect(page.getByText('Network Health (Connected)')).toBeVisible() await expect(networkToggle).toContainText('Connected')
await expect(page.getByTestId('loading-stream')).not.toBeAttached()
// Click off the code pane. // Click off the code pane.
await page.mouse.click(100, 100) await page.mouse.click(100, 100)
@ -7236,7 +7283,7 @@ test.describe('Test network and connection issues', () => {
await page.waitForTimeout(150) await page.waitForTimeout(150)
// Click the line tool // Click the line tool
await page.getByRole('button', { name: 'Line' }).click() await page.getByRole('button', { name: 'Line', exact: true }).click()
await page.waitForTimeout(150) await page.waitForTimeout(150)
@ -7246,15 +7293,15 @@ test.describe('Test network and connection issues', () => {
.toHaveText(`const sketch001 = startSketchOn('XZ') .toHaveText(`const sketch001 = startSketchOn('XZ')
|> startProfileAt(${commonPoints.startAt}, %) |> startProfileAt(${commonPoints.startAt}, %)
|> line([${commonPoints.num1}, 0], %) |> line([${commonPoints.num1}, 0], %)
|> line([-9.16, 8.81], %)`) |> line([-8.84, 8.75], %)`)
await page.waitForTimeout(100) await page.waitForTimeout(100)
await page.mouse.click(startXPx, 500 - PUR * 20) await page.mouse.click(startXPx, 500 - PUR * 20)
await expect(page.locator('.cm-content')) await expect(page.locator('.cm-content'))
.toHaveText(`const sketch001 = startSketchOn('XZ') .toHaveText(`const sketch001 = startSketchOn('XZ')
|> startProfileAt(${commonPoints.startAt}, %) |> startProfileAt(${commonPoints.startAt}, %)
|> line([${commonPoints.num1}, 0], %) |> line([${commonPoints.num1}, 0], %)
|> line([-9.16, 8.81], %) |> line([-8.84, 8.75], %)
|> line([-5.28, 0], %)`) |> line([-5.6, 0], %)`)
// Unequip line tool // Unequip line tool
await page.keyboard.press('Escape') await page.keyboard.press('Escape')
@ -7263,7 +7310,7 @@ test.describe('Test network and connection issues', () => {
page.getByRole('button', { name: 'Exit Sketch' }) page.getByRole('button', { name: 'Exit Sketch' })
).toBeVisible() ).toBeVisible()
await expect( await expect(
page.getByRole('button', { name: 'Line' }) page.getByRole('button', { name: 'Line', exact: true })
).not.toHaveAttribute('aria-pressed', 'true') ).not.toHaveAttribute('aria-pressed', 'true')
// Exit sketch // Exit sketch
@ -7564,19 +7611,19 @@ const part001 = startSketchOn('-XZ')
offset: -armThick, offset: -armThick,
intersectTag: seg04 intersectTag: seg04
}, %) }, %)
|> angledLineToY([segAng(seg04, %) + 180, ZERO], %) |> angledLineToY([segAng(seg04) + 180, ZERO], %)
|> angledLineToY({ |> angledLineToY({
angle: -bottomAng, angle: -bottomAng,
to: -totalHeightHalf - armThick, to: -totalHeightHalf - armThick,
}, %, $seg02) }, %, $seg02)
|> xLineTo(segEndX(seg03, %) + 0, %) |> xLineTo(segEndX(seg03) + 0, %)
|> yLine(-segLen(seg01, %), %) |> yLine(-segLen(seg01), %)
|> angledLineThatIntersects({ |> angledLineThatIntersects({
angle: HALF_TURN, angle: HALF_TURN,
offset: -armThick, offset: -armThick,
intersectTag: seg02 intersectTag: seg02
}, %) }, %)
|> angledLineToY([segAng(seg02, %) + 180, -baseHeight], %) |> angledLineToY([segAng(seg02) + 180, -baseHeight], %)
|> xLineTo(ZERO, %) |> xLineTo(ZERO, %)
|> close(%) |> close(%)
|> extrude(4, %)` |> extrude(4, %)`
@ -7668,7 +7715,7 @@ test('Keyboard shortcuts can be viewed through the help menu', async ({
.waitFor({ state: 'visible' }) .waitFor({ state: 'visible' })
// Open the help menu // Open the help menu
await page.getByRole('button', { name: 'Help', exact: false }).click() await page.getByRole('button', { name: 'Help and resources' }).click()
// Open the keyboard shortcuts // Open the keyboard shortcuts
await page.getByRole('button', { name: 'Keyboard Shortcuts' }).click() await page.getByRole('button', { name: 'Keyboard Shortcuts' }).click()
@ -7692,8 +7739,11 @@ test('First escape in tool pops you out of tool, second exits sketch mode', asyn
await u.expectCmdLog('[data-message-type="execution-done"]') await u.expectCmdLog('[data-message-type="execution-done"]')
await u.closeDebugPanel() await u.closeDebugPanel()
const lineButton = page.getByRole('button', { name: 'Line' }) const lineButton = page.getByRole('button', { name: 'Line', exact: true })
const arcButton = page.getByRole('button', { name: 'Tangential Arc' }) const arcButton = page.getByRole('button', {
name: 'Tangential Arc',
exact: true,
})
// Test these hotkeys perform actions when // Test these hotkeys perform actions when
// focus is on the canvas // focus is on the canvas
@ -7705,6 +7755,7 @@ test('First escape in tool pops you out of tool, second exits sketch mode', asyn
await page.mouse.move(800, 300) await page.mouse.move(800, 300)
await page.mouse.click(800, 300) await page.mouse.click(800, 300)
await page.waitForTimeout(1000) await page.waitForTimeout(1000)
await expect(lineButton).toBeVisible()
await expect(lineButton).toHaveAttribute('aria-pressed', 'true') await expect(lineButton).toHaveAttribute('aria-pressed', 'true')
// Draw a line // Draw a line
@ -7774,9 +7825,12 @@ test('Basic default modeling and sketch hotkeys work', async ({ page }) => {
await u.closeDebugPanel() await u.closeDebugPanel()
const codePane = page.getByRole('textbox').locator('div') const codePane = page.getByRole('textbox').locator('div')
const codePaneButton = page.getByRole('tab', { name: 'KCL Code' }) const codePaneButton = page.getByTestId('code-pane-button')
const lineButton = page.getByRole('button', { name: 'Line' }) const lineButton = page.getByRole('button', { name: 'Line', exact: true })
const arcButton = page.getByRole('button', { name: 'Tangential Arc' }) const arcButton = page.getByRole('button', {
name: 'Tangential Arc',
exact: true,
})
const extrudeButton = page.getByRole('button', { name: 'Extrude' }) const extrudeButton = page.getByRole('button', { name: 'Extrude' })
// Test that the hotkeys do nothing when // Test that the hotkeys do nothing when
@ -7797,7 +7851,7 @@ test('Basic default modeling and sketch hotkeys work', async ({ page }) => {
await page.mouse.click(600, 250) await page.mouse.click(600, 250)
// work-around: to stop "keyboard.press('s')" from typing in the editor even when it should be blurred // work-around: to stop "keyboard.press('s')" from typing in the editor even when it should be blurred
await page.getByRole('button', { name: 'Commands ⌘K' }).click() await page.getByRole('button', { name: 'Commands' }).click()
await page.waitForTimeout(100) await page.waitForTimeout(100)
await page.keyboard.press('Escape') await page.keyboard.press('Escape')
await page.waitForTimeout(100) await page.waitForTimeout(100)
@ -8043,3 +8097,34 @@ test('Sketch on face', async ({ page }) => {
const sketch002 = extrude(${[5, 5]} + 7, sketch002)` const sketch002 = extrude(${[5, 5]} + 7, sketch002)`
await expect(page.locator('.cm-content')).toHaveText(result2.regExp) await expect(page.locator('.cm-content')).toHaveText(result2.regExp)
}) })
test('Typing KCL errors induces a badge on the error logs pane button', async ({
page,
}) => {
const u = await getUtils(page)
// Load the app with the working starter code
await page.addInitScript((code) => {
localStorage.setItem('persistCode', code)
}, bracket)
await page.setViewportSize({ width: 1200, height: 500 })
await u.waitForAuthSkipAppStart()
// wait for execution done
await u.openDebugPanel()
await u.expectCmdLog('[data-message-type="execution-done"]')
await u.closeDebugPanel()
// Ensure no badge is present
const errorLogsButton = page.getByRole('button', { name: 'KCL Code pane' })
await expect(errorLogsButton).not.toContainText('notification')
// Delete a character to break the KCL
await u.openKclCodePanel()
await page.getByText('extrude(').click()
await page.keyboard.press('Backspace')
// Ensure that a badge appears on the button
await expect(errorLogsButton).toContainText('notification')
})

View File

@ -64,27 +64,27 @@ const part001 = startSketchOn('-XZ')
|> angledLineToY({ |> angledLineToY({
angle: topAng, angle: topAng,
to: totalHeightHalf, to: totalHeightHalf,
}, %, 'seg04') }, %, $seg04)
|> xLineTo(totalLen, %, 'seg03') |> xLineTo(totalLen, %, $seg03')
|> yLine(-armThick, %, 'seg01') |> yLine(-armThick, %, $seg01)
|> angledLineThatIntersects({ |> angledLineThatIntersects({
angle: HALF_TURN, angle: HALF_TURN,
offset: -armThick, offset: -armThick,
intersectTag: 'seg04' intersectTag: seg04
}, %) }, %)
|> angledLineToY([segAng('seg04', %) + 180, ZERO], %) |> angledLineToY([segAng(seg04, %) + 180, ZERO], %)
|> angledLineToY({ |> angledLineToY({
angle: -bottomAng, angle: -bottomAng,
to: -totalHeightHalf - armThick, to: -totalHeightHalf - armThick,
}, %, 'seg02') }, %, $seg02)
|> xLineTo(segEndX('seg03', %) + 0, %) |> xLineTo(segEndX(seg03, %) + 0, %)
|> yLine(-segLen('seg01', %), %) |> yLine(-segLen(seg01, %), %)
|> angledLineThatIntersects({ |> angledLineThatIntersects({
angle: HALF_TURN, angle: HALF_TURN,
offset: -armThick, offset: -armThick,
intersectTag: 'seg02' intersectTag: seg02
}, %) }, %)
|> angledLineToY([segAng('seg02', %) + 180, -baseHeight], %) |> angledLineToY([segAng(seg02, %) + 180, -baseHeight], %)
|> xLineTo(ZERO, %) |> xLineTo(ZERO, %)
|> close(%) |> close(%)
|> extrude(4, %)` |> extrude(4, %)`
@ -431,7 +431,9 @@ test('Draft segments should look right', async ({ page, context }) => {
|> line([7.25, 0], %)` |> line([7.25, 0], %)`
await expect(page.locator('.cm-content')).toHaveText(code) await expect(page.locator('.cm-content')).toHaveText(code)
await page.getByRole('button', { name: 'Tangential Arc' }).click() await page
.getByRole('button', { name: 'Tangential Arc', exact: true })
.click()
await page.mouse.move(startXPx + PUR * 30, 500 - PUR * 20, { steps: 10 }) await page.mouse.move(startXPx + PUR * 30, 500 - PUR * 20, { steps: 10 })
@ -475,8 +477,10 @@ test('Draft rectangles should look right', async ({ page, context }) => {
const startXPx = 600 const startXPx = 600
// Equip the rectangle tool // Equip the rectangle tool
await page.getByRole('button', { name: 'Line' }).click() await page.getByRole('button', { name: 'Line', exact: true }).click()
await page.getByRole('button', { name: 'Rectangle' }).click() await page
.getByRole('button', { name: 'Corner rectangle', exact: true })
.click()
// Draw the rectangle // Draw the rectangle
await page.mouse.click(startXPx + PUR * 20, 500 - PUR * 30) await page.mouse.click(startXPx + PUR * 20, 500 - PUR * 30)
@ -535,7 +539,9 @@ test.describe('Client side scene scale should match engine scale', () => {
|> line([7.25, 0], %)` |> line([7.25, 0], %)`
await expect(u.codeLocator).toHaveText(code) await expect(u.codeLocator).toHaveText(code)
await page.getByRole('button', { name: 'Tangential Arc' }).click() await page
.getByRole('button', { name: 'Tangential Arc', exact: true })
.click()
await page.waitForTimeout(100) await page.waitForTimeout(100)
await page.mouse.click(startXPx + PUR * 30, 500 - PUR * 20) await page.mouse.click(startXPx + PUR * 30, 500 - PUR * 20)
@ -545,7 +551,9 @@ test.describe('Client side scene scale should match engine scale', () => {
await expect(u.codeLocator).toHaveText(code) await expect(u.codeLocator).toHaveText(code)
// click tangential arc tool again to unequip it // click tangential arc tool again to unequip it
await page.getByRole('button', { name: 'Tangential Arc' }).click() await page
.getByRole('button', { name: 'Tangential Arc', exact: true })
.click()
await page.waitForTimeout(100) await page.waitForTimeout(100)
// screen shot should show the sketch // screen shot should show the sketch
@ -634,7 +642,9 @@ test.describe('Client side scene scale should match engine scale', () => {
|> line([184.3, 0], %)` |> line([184.3, 0], %)`
await expect(u.codeLocator).toHaveText(code) await expect(u.codeLocator).toHaveText(code)
await page.getByRole('button', { name: 'Tangential Arc' }).click() await page
.getByRole('button', { name: 'Tangential Arc', exact: true })
.click()
await page.waitForTimeout(100) await page.waitForTimeout(100)
await page.mouse.click(startXPx + PUR * 30, 500 - PUR * 20) await page.mouse.click(startXPx + PUR * 30, 500 - PUR * 20)
@ -643,7 +653,9 @@ test.describe('Client side scene scale should match engine scale', () => {
|> tangentialArcTo([551.2, -62.01], %)` |> tangentialArcTo([551.2, -62.01], %)`
await expect(u.codeLocator).toHaveText(code) await expect(u.codeLocator).toHaveText(code)
await page.getByRole('button', { name: 'Tangential Arc' }).click() await page
.getByRole('button', { name: 'Tangential Arc', exact: true })
.click()
await page.waitForTimeout(100) await page.waitForTimeout(100)
// screen shot should show the sketch // screen shot should show the sketch

Binary file not shown.

Before

Width:  |  Height:  |  Size: 44 KiB

After

Width:  |  Height:  |  Size: 48 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 44 KiB

After

Width:  |  Height:  |  Size: 45 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 51 KiB

After

Width:  |  Height:  |  Size: 54 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 45 KiB

After

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 35 KiB

After

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 36 KiB

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 39 KiB

After

Width:  |  Height:  |  Size: 45 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 29 KiB

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 72 KiB

After

Width:  |  Height:  |  Size: 72 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 44 KiB

After

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 62 KiB

After

Width:  |  Height:  |  Size: 62 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 30 KiB

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 33 KiB

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 31 KiB

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 35 KiB

After

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 29 KiB

After

Width:  |  Height:  |  Size: 31 KiB

View File

@ -71,7 +71,7 @@ export const TEST_CODE_GIZMO = `const part001 = startSketchOn('XZ')
|> angledLine({ angle: 3 + 0, length: 3.14 + 0 }, %) |> angledLine({ angle: 3 + 0, length: 3.14 + 0 }, %)
|> lineTo([20.14 + 0, -0.14 + 0], %) |> lineTo([20.14 + 0, -0.14 + 0], %)
|> xLineTo(29 + 0, %) |> xLineTo(29 + 0, %)
|> yLine(-3.14 + 0, %, 'a') |> yLine(-3.14 + 0, %, $a)
|> xLine(1.63, %) |> xLine(1.63, %)
|> angledLineOfXLength({ angle: 3 + 0, length: 3.14 }, %) |> angledLineOfXLength({ angle: 3 + 0, length: 3.14 }, %)
|> angledLineOfYLength({ angle: 30, length: 3 + 0 }, %) |> angledLineOfYLength({ angle: 30, length: 3 + 0 }, %)
@ -79,7 +79,7 @@ export const TEST_CODE_GIZMO = `const part001 = startSketchOn('XZ')
|> angledLineToY({ angle: 30, to: 11.14 }, %) |> angledLineToY({ angle: 30, to: 11.14 }, %)
|> angledLineThatIntersects({ |> angledLineThatIntersects({
angle: 3.14, angle: 3.14,
intersectTag: 'a', intersectTag: a,
offset: 0 offset: 0
}, %) }, %)
|> tangentialArcTo([13.14 + 0, 13.14], %) |> tangentialArcTo([13.14 + 0, 13.14], %)

View File

@ -1,5 +1,5 @@
import { test, expect, Page, Download } from '@playwright/test' import { expect, Page, Download } from '@playwright/test'
import { EngineCommand } from '../../src/lang/std/engineConnection' import { EngineCommand } from 'lang/std/artifactMap'
import os from 'os' import os from 'os'
import fsp from 'fs/promises' import fsp from 'fs/promises'
import pixelMatch from 'pixelmatch' import pixelMatch from 'pixelmatch'
@ -16,14 +16,14 @@ export const TEST_COLORS = {
} as const } as const
async function waitForPageLoad(page: Page) { async function waitForPageLoad(page: Page) {
// wait for 'Loading stream...' spinner
await page.getByTestId('loading-stream').waitFor()
// wait for all spinners to be gone // wait for all spinners to be gone
await page await expect(page.getByTestId('loading')).not.toBeAttached({
.getByTestId('loading') timeout: 20_000,
.waitFor({ state: 'detached', timeout: 20_000 }) })
await page.getByTestId('start-sketch').waitFor() await expect(page.getByRole('button', { name: 'Start Sketch' })).toBeEnabled({
timeout: 20_000,
})
} }
async function removeCurrentCode(page: Page) { async function removeCurrentCode(page: Page) {
@ -58,44 +58,45 @@ async function waitForDefaultPlanesToBeVisible(page: Page) {
} }
async function openKclCodePanel(page: Page) { async function openKclCodePanel(page: Page) {
const paneLocator = page.getByRole('tab', { name: 'KCL Code', exact: false }) const paneLocator = page.getByTestId('code-pane-button')
const isOpen = (await paneLocator?.getAttribute('aria-selected')) === 'true' const ariaSelected = await paneLocator?.getAttribute('aria-pressed')
const isOpen = ariaSelected === 'true'
if (!isOpen) { if (!isOpen) {
await paneLocator.click() await paneLocator.click()
await paneLocator.and(page.locator('[aria-selected="true"]')).waitFor() await expect(paneLocator).toHaveAttribute('aria-pressed', 'true')
} }
} }
async function closeKclCodePanel(page: Page) { async function closeKclCodePanel(page: Page) {
const paneLocator = page.getByRole('tab', { name: 'KCL Code', exact: false }) const paneLocator = page.getByTestId('code-pane-button')
const isOpen = (await paneLocator?.getAttribute('aria-selected')) === 'true' const ariaSelected = await paneLocator?.getAttribute('aria-pressed')
const isOpen = ariaSelected === 'true'
if (isOpen) { if (isOpen) {
await paneLocator.click() await paneLocator.click()
await paneLocator await expect(paneLocator).not.toHaveAttribute('aria-pressed', 'true')
.and(page.locator(':not([aria-selected="true"])'))
.waitFor()
} }
} }
async function openDebugPanel(page: Page) { async function openDebugPanel(page: Page) {
const debugLocator = page.getByRole('tab', { name: 'Debug', exact: false }) const debugLocator = page.getByTestId('debug-pane-button')
const isOpen = (await debugLocator?.getAttribute('aria-selected')) === 'true' await expect(debugLocator).toBeVisible()
const isOpen = (await debugLocator?.getAttribute('aria-pressed')) === 'true'
if (!isOpen) { if (!isOpen) {
await debugLocator.click() await debugLocator.click()
await debugLocator.and(page.locator('[aria-selected="true"]')).waitFor() await expect(debugLocator).toHaveAttribute('aria-pressed', 'true')
} }
} }
async function closeDebugPanel(page: Page) { async function closeDebugPanel(page: Page) {
const debugLocator = page.getByRole('tab', { name: 'Debug', exact: false }) const debugLocator = page.getByTestId('debug-pane-button')
const isOpen = (await debugLocator?.getAttribute('aria-selected')) === 'true' await expect(debugLocator).toBeVisible()
const isOpen = (await debugLocator?.getAttribute('aria-pressed')) === 'true'
if (isOpen) { if (isOpen) {
await debugLocator.click() await debugLocator.click()
await debugLocator await expect(debugLocator).not.toHaveAttribute('aria-pressed', 'true')
.and(page.locator(':not([aria-selected="true"])'))
.waitFor()
} }
} }
@ -265,7 +266,7 @@ export async function getUtils(page: Page) {
getSegmentBodyCoords: async (locator: string, px = 30) => { getSegmentBodyCoords: async (locator: string, px = 30) => {
const overlay = page.locator(locator) const overlay = page.locator(locator)
const bbox = await overlay const bbox = await overlay
.boundingBox() .boundingBox({ timeout: 5000 })
.then((box) => ({ ...box, x: box?.x || 0, y: box?.y || 0 })) .then((box) => ({ ...box, x: box?.x || 0, y: box?.y || 0 }))
const angle = Number(await overlay.getAttribute('data-overlay-angle')) const angle = Number(await overlay.getAttribute('data-overlay-angle'))
const angleXOffset = Math.cos(((angle - 180) * Math.PI) / 180) * px const angleXOffset = Math.cos(((angle - 180) * Math.PI) / 180) * px
@ -471,8 +472,11 @@ export const doExport = async (
page: Page page: Page
): Promise<Paths> => { ): Promise<Paths> => {
await page.getByRole('button', { name: APP_NAME }).click() await page.getByRole('button', { name: APP_NAME }).click()
await expect(page.getByRole('button', { name: 'Export Part' })).toBeVisible() const exportMenuButton = page.getByRole('button', {
await page.getByRole('button', { name: 'Export Part' }).click() name: 'Export current part',
})
await expect(exportMenuButton).toBeVisible()
await exportMenuButton.click()
await expect(page.getByTestId('command-bar')).toBeVisible() await expect(page.getByTestId('command-bar')).toBeVisible()
// Go through export via command bar // Go through export via command bar

View File

@ -77,7 +77,7 @@ describe('ZMA authorized user flows', () => {
const menuButton = await $('[data-testid="user-sidebar-toggle"]') const menuButton = await $('[data-testid="user-sidebar-toggle"]')
await click(menuButton) await click(menuButton)
const settingsButton = await $('[data-testid="settings-button"]') const settingsButton = await $('[data-testid="user-settings"]')
await click(settingsButton) await click(settingsButton)
const projectDirInput = await $('[data-testid="project-directory-input"]') const projectDirInput = await $('[data-testid="project-directory-input"]')

1439
openapi/machine-api.json Normal file

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
{ {
"name": "untitled-app", "name": "untitled-app",
"version": "0.24.3", "version": "0.24.7",
"private": true, "private": true,
"dependencies": { "dependencies": {
"@codemirror/autocomplete": "^6.17.0", "@codemirror/autocomplete": "^6.17.0",
@ -109,7 +109,7 @@
}, },
"devDependencies": { "devDependencies": {
"@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.25.0",
"@iarna/toml": "^2.2.5", "@iarna/toml": "^2.2.5",
"@lezer/generator": "^1.7.1", "@lezer/generator": "^1.7.1",
"@playwright/test": "^1.45.1", "@playwright/test": "^1.45.1",

View File

@ -42,8 +42,8 @@ function registerServerCapability(
serverCapabilities: ServerCapabilities, serverCapabilities: ServerCapabilities,
registration: Registration registration: Registration
): ServerCapabilities | Error { ): ServerCapabilities | Error {
const serverCapabilitiesCopy = JSON.parse( const serverCapabilitiesCopy = structuredClone(
JSON.stringify(serverCapabilities) serverCapabilities
) as IFlexibleServerCapabilities ) as IFlexibleServerCapabilities
const { method, registerOptions } = registration const { method, registerOptions } = registration
const providerName = ServerCapabilitiesProviders[method] const providerName = ServerCapabilitiesProviders[method]
@ -54,7 +54,7 @@ function registerServerCapability(
} else { } else {
serverCapabilitiesCopy[providerName] = Object.assign( serverCapabilitiesCopy[providerName] = Object.assign(
{}, {},
JSON.parse(JSON.stringify(registerOptions)) structuredClone(registerOptions)
) )
} }
} else { } else {
@ -68,8 +68,8 @@ function unregisterServerCapability(
serverCapabilities: ServerCapabilities, serverCapabilities: ServerCapabilities,
unregistration: Unregistration unregistration: Unregistration
): ServerCapabilities { ): ServerCapabilities {
const serverCapabilitiesCopy = JSON.parse( const serverCapabilitiesCopy = structuredClone(
JSON.stringify(serverCapabilities) serverCapabilities
) as IFlexibleServerCapabilities ) as IFlexibleServerCapabilities
const { method } = unregistration const { method } = unregistration
const providerName = ServerCapabilitiesProviders[method] const providerName = ServerCapabilitiesProviders[method]

View File

@ -1,5 +1,10 @@
import { Extension } from '@codemirror/state' import { Extension } from '@codemirror/state'
import { hoverTooltip, tooltips, ViewPlugin } from '@codemirror/view' import {
hoverTooltip,
tooltips,
ViewPlugin,
EditorView,
} from '@codemirror/view'
import { LanguageServerPlugin } from './lsp' import { LanguageServerPlugin } from './lsp'
import { offsetToPos } from './util' import { offsetToPos } from './util'
@ -17,6 +22,13 @@ export default function lspHoverExt(
}), }),
tooltips({ tooltips({
position: 'absolute', position: 'absolute',
parent: document.body,
}),
EditorView.baseTheme({
'.cm-tooltip': {
fontSize: '12px',
maxWidth: '400px',
},
}), }),
] ]
} }

View File

@ -1,12 +0,0 @@
import { Extension } from '@codemirror/state'
import { linter, forEachDiagnostic, Diagnostic } from '@codemirror/lint'
export default function lspLintExt(): Extension {
return linter((view) => {
let diagnostics: Diagnostic[] = []
forEachDiagnostic(view.state, (d: Diagnostic, from: number, to: number) => {
diagnostics.push(d)
})
return diagnostics
})
}

View File

@ -18,6 +18,7 @@ import type {
ViewPlugin, ViewPlugin,
} from '@codemirror/view' } from '@codemirror/view'
import { EditorView, Tooltip } from '@codemirror/view' import { EditorView, Tooltip } from '@codemirror/view'
import { linter } from '@codemirror/lint'
import type { PublishDiagnosticsParams } from 'vscode-languageserver-protocol' import type { PublishDiagnosticsParams } from 'vscode-languageserver-protocol'
import type * as LSP from 'vscode-languageserver-protocol' import type * as LSP from 'vscode-languageserver-protocol'
@ -35,7 +36,6 @@ import lspAutocompleteExt from './autocomplete'
import lspHoverExt from './hover' import lspHoverExt from './hover'
import lspFormatExt from './format' import lspFormatExt from './format'
import lspIndentExt from './indent' import lspIndentExt from './indent'
import lspLintExt from './lint'
import lspSemanticTokensExt from './semantic-tokens' import lspSemanticTokensExt from './semantic-tokens'
const useLast = (values: readonly any[]) => values.reduce((_, v) => v, '') const useLast = (values: readonly any[]) => values.reduce((_, v) => v, '')
@ -214,6 +214,7 @@ export class LanguageServerPlugin implements PluginValue {
} }
if (!this.client.ready) return if (!this.client.ready) return
try { try {
// Update the state (not the editor) with the new code. // Update the state (not the editor) with the new code.
this.client.textDocumentDidChange({ this.client.textDocumentDidChange({
@ -571,8 +572,8 @@ export class LanguageServerPluginSpec
lspFormatExt(plugin), lspFormatExt(plugin),
lspHoverExt(plugin), lspHoverExt(plugin),
lspIndentExt(), lspIndentExt(),
lspLintExt(),
lspSemanticTokensExt(), lspSemanticTokensExt(),
linter(null),
] ]
} }
} }

View File

@ -23,6 +23,7 @@ export default defineConfig({
reporter: [ reporter: [
[process.env.CI ? 'dot' : 'list'], [process.env.CI ? 'dot' : 'list'],
['json', { outputFile: './test-results/report.json' }], ['json', { outputFile: './test-results/report.json' }],
['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. */
use: { use: {

232
src-tauri/Cargo.lock generated
View File

@ -188,7 +188,7 @@ dependencies = [
"tauri-plugin-shell", "tauri-plugin-shell",
"tauri-plugin-updater", "tauri-plugin-updater",
"tokio", "tokio",
"toml 0.8.14", "toml 0.8.19",
"url", "url",
] ]
@ -332,7 +332,7 @@ checksum = "3b43422f69d8ff38f95f1b2bb76517c91589a924d1559a0e935d7c8ce0274c11"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.70", "syn 2.0.72",
] ]
[[package]] [[package]]
@ -367,7 +367,7 @@ checksum = "6e0c28dcc82d7c8ead5cb13beb15405b57b8546e93215673ff8ca0349a028107"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.70", "syn 2.0.72",
] ]
[[package]] [[package]]
@ -407,7 +407,7 @@ checksum = "3c87f3f15e7794432337fc718554eaa4dc8f04c9677a950ffe366f20a162ae42"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.70", "syn 2.0.72",
] ]
[[package]] [[package]]
@ -550,7 +550,7 @@ dependencies = [
"proc-macro-crate 3.1.0", "proc-macro-crate 3.1.0",
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.70", "syn 2.0.72",
"syn_derive", "syn_derive",
] ]
@ -648,6 +648,12 @@ version = "1.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b"
[[package]]
name = "byteorder-lite"
version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8f1fe948ff07f4bd06c30984e69f5b4899c516a3ef74f34df92a2df2ab535495"
[[package]] [[package]]
name = "bytes" name = "bytes"
version = "1.6.0" version = "1.6.0"
@ -721,7 +727,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8a969e13a7589e9e3e4207e153bae624ade2b5622fb4684a4923b23ec3d57719" checksum = "8a969e13a7589e9e3e4207e153bae624ade2b5622fb4684a4923b23ec3d57719"
dependencies = [ dependencies = [
"serde", "serde",
"toml 0.8.14", "toml 0.8.19",
] ]
[[package]] [[package]]
@ -792,9 +798,9 @@ dependencies = [
[[package]] [[package]]
name = "clap" name = "clap"
version = "4.5.9" version = "4.5.13"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "64acc1846d54c1fe936a78dc189c34e28d3f5afc348403f28ecf53660b9b8462" checksum = "0fbb260a053428790f3de475e304ff84cdbc4face759ea7a3e64c1edd938a7fc"
dependencies = [ dependencies = [
"clap_builder", "clap_builder",
"clap_derive", "clap_derive",
@ -802,9 +808,9 @@ dependencies = [
[[package]] [[package]]
name = "clap_builder" name = "clap_builder"
version = "4.5.9" version = "4.5.13"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6fb8393d67ba2e7bfaf28a23458e4e2b543cc73a99595511eb207fdb8aede942" checksum = "64b17d7ea74e9f833c7dbf2cbe4fb12ff26783eda4782a8975b72f895c9b4d99"
dependencies = [ dependencies = [
"anstream", "anstream",
"anstyle", "anstyle",
@ -816,14 +822,14 @@ dependencies = [
[[package]] [[package]]
name = "clap_derive" name = "clap_derive"
version = "4.5.8" version = "4.5.13"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2bac35c6dafb060fd4d275d9a4ffae97917c13a6327903a8be2153cd964f7085" checksum = "501d359d5f3dcaf6ecdeee48833ae73ec6e42723a1e52419c79abf9507eec0a0"
dependencies = [ dependencies = [
"heck 0.5.0", "heck 0.5.0",
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.70", "syn 2.0.72",
] ]
[[package]] [[package]]
@ -1073,7 +1079,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "13b588ba4ac1a99f7f2964d24b3d896ddc6bf847ee3855dbd4366f058cfcd331" checksum = "13b588ba4ac1a99f7f2964d24b3d896ddc6bf847ee3855dbd4366f058cfcd331"
dependencies = [ dependencies = [
"quote", "quote",
"syn 2.0.70", "syn 2.0.72",
] ]
[[package]] [[package]]
@ -1083,7 +1089,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "edb49164822f3ee45b17acd4a208cfc1251410cf0cad9a833234c9890774dd9f" checksum = "edb49164822f3ee45b17acd4a208cfc1251410cf0cad9a833234c9890774dd9f"
dependencies = [ dependencies = [
"quote", "quote",
"syn 2.0.70", "syn 2.0.72",
] ]
[[package]] [[package]]
@ -1107,7 +1113,7 @@ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"strsim 0.10.0", "strsim 0.10.0",
"syn 2.0.70", "syn 2.0.72",
] ]
[[package]] [[package]]
@ -1118,7 +1124,7 @@ checksum = "a668eda54683121533a393014d8692171709ff57a7d61f187b6e782719f8933f"
dependencies = [ dependencies = [
"darling_core", "darling_core",
"quote", "quote",
"syn 2.0.70", "syn 2.0.72",
] ]
[[package]] [[package]]
@ -1179,7 +1185,7 @@ checksum = "4078275de501a61ceb9e759d37bdd3d7210e654dbc167ac1a3678ef4435ed57b"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.70", "syn 2.0.72",
"synstructure", "synstructure",
] ]
@ -1206,7 +1212,7 @@ dependencies = [
[[package]] [[package]]
name = "derive-docs" name = "derive-docs"
version = "0.1.20" version = "0.1.21"
dependencies = [ dependencies = [
"Inflector", "Inflector",
"convert_case 0.6.0", "convert_case 0.6.0",
@ -1216,7 +1222,7 @@ dependencies = [
"regex", "regex",
"serde", "serde",
"serde_tokenstream", "serde_tokenstream",
"syn 2.0.70", "syn 2.0.72",
] ]
[[package]] [[package]]
@ -1227,7 +1233,7 @@ checksum = "67e77553c4162a157adbf834ebae5b415acbecbeafc7a74b0e886657506a7611"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.70", "syn 2.0.72",
] ]
[[package]] [[package]]
@ -1288,7 +1294,7 @@ checksum = "487585f4d0c6655fe74905e2504d8ad6908e4db67f744eb140876906c2f3175d"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.70", "syn 2.0.72",
] ]
[[package]] [[package]]
@ -1320,7 +1326,7 @@ checksum = "f2b99bf03862d7f545ebc28ddd33a665b50865f4dfd84031a393823879bd4c54"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.70", "syn 2.0.72",
] ]
[[package]] [[package]]
@ -1383,7 +1389,7 @@ dependencies = [
"cc", "cc",
"memchr", "memchr",
"rustc_version", "rustc_version",
"toml 0.8.14", "toml 0.8.19",
"vswhom", "vswhom",
"winreg 0.52.0", "winreg 0.52.0",
] ]
@ -1427,7 +1433,7 @@ checksum = "5c785274071b1b420972453b306eeca06acf4633829db4223b58a2a8c5953bc4"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.70", "syn 2.0.72",
] ]
[[package]] [[package]]
@ -1588,7 +1594,7 @@ checksum = "1a5c6c585bc94aaf2c7b51dd4c2ba22680844aba4c687be581871a6f518c5742"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.70", "syn 2.0.72",
] ]
[[package]] [[package]]
@ -1704,7 +1710,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.70", "syn 2.0.72",
] ]
[[package]] [[package]]
@ -1980,7 +1986,7 @@ dependencies = [
"proc-macro-error", "proc-macro-error",
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.70", "syn 2.0.72",
] ]
[[package]] [[package]]
@ -2008,7 +2014,7 @@ dependencies = [
"inflections", "inflections",
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.70", "syn 2.0.72",
] ]
[[package]] [[package]]
@ -2083,7 +2089,7 @@ dependencies = [
"proc-macro-error", "proc-macro-error",
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.70", "syn 2.0.72",
] ]
[[package]] [[package]]
@ -2399,6 +2405,18 @@ dependencies = [
"unicode-normalization", "unicode-normalization",
] ]
[[package]]
name = "image"
version = "0.25.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "99314c8a2152b8ddb211f924cdae532d8c5e4c8bb54728e12fff1b0cd5963a10"
dependencies = [
"bytemuck",
"byteorder-lite",
"num-traits",
"png",
]
[[package]] [[package]]
name = "indexmap" name = "indexmap"
version = "1.9.3" version = "1.9.3"
@ -2571,7 +2589,7 @@ dependencies = [
[[package]] [[package]]
name = "kcl-lib" name = "kcl-lib"
version = "0.1.72" version = "0.2.3"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"approx", "approx",
@ -2581,6 +2599,7 @@ dependencies = [
"bson", "bson",
"chrono", "chrono",
"clap", "clap",
"convert_case 0.6.0",
"dashmap 6.0.1", "dashmap 6.0.1",
"databake", "databake",
"derive-docs", "derive-docs",
@ -2588,6 +2607,7 @@ dependencies = [
"futures", "futures",
"git_rev", "git_rev",
"gltf-json", "gltf-json",
"image",
"js-sys", "js-sys",
"kittycad", "kittycad",
"lazy_static", "lazy_static",
@ -2602,10 +2622,11 @@ dependencies = [
"thiserror", "thiserror",
"tokio", "tokio",
"tokio-tungstenite", "tokio-tungstenite",
"toml 0.8.14", "toml 0.8.19",
"tower-lsp", "tower-lsp",
"ts-rs", "ts-rs",
"url", "url",
"urlencoding",
"uuid", "uuid",
"validator", "validator",
"wasm-bindgen", "wasm-bindgen",
@ -2628,9 +2649,9 @@ dependencies = [
[[package]] [[package]]
name = "kittycad" name = "kittycad"
version = "0.3.7" version = "0.3.9"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e1777b503442fa4666564cc3ab237d456df853a09648a4b2bb09622d25d021a5" checksum = "36b87a9cca545825ba18005c1944b8525fac28867d99984178bf22c79fb5ec25"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"async-trait", "async-trait",
@ -2930,13 +2951,14 @@ dependencies = [
[[package]] [[package]]
name = "mio" name = "mio"
version = "0.8.11" version = "1.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a4a650543ca06a924e8b371db273b2756685faae30f8487da1b56505a8f78b0c" checksum = "4569e456d394deccd22ce1c1913e6ea0e54519f577285001215d33557431afe4"
dependencies = [ dependencies = [
"hermit-abi",
"libc", "libc",
"wasi 0.11.0+wasi-snapshot-preview1", "wasi 0.11.0+wasi-snapshot-preview1",
"windows-sys 0.48.0", "windows-sys 0.52.0",
] ]
[[package]] [[package]]
@ -3067,16 +3089,6 @@ dependencies = [
"autocfg", "autocfg",
] ]
[[package]]
name = "num_cpus"
version = "1.16.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43"
dependencies = [
"hermit-abi",
"libc",
]
[[package]] [[package]]
name = "num_enum" name = "num_enum"
version = "0.5.11" version = "0.5.11"
@ -3377,7 +3389,7 @@ dependencies = [
"regex", "regex",
"regex-syntax 0.8.3", "regex-syntax 0.8.3",
"structmeta", "structmeta",
"syn 2.0.70", "syn 2.0.72",
] ]
[[package]] [[package]]
@ -3496,7 +3508,7 @@ dependencies = [
"phf_shared 0.11.2", "phf_shared 0.11.2",
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.70", "syn 2.0.72",
] ]
[[package]] [[package]]
@ -3528,9 +3540,9 @@ dependencies = [
[[package]] [[package]]
name = "phonenumber" name = "phonenumber"
version = "0.3.5+8.13.36" version = "0.3.6+8.13.36"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f174c8db59b620032bd52b655fc97000458850fec0db35fcd4e802b668517ec0" checksum = "11756237b57b8cc5e97dc8b1e70ea436324d30e7075de63b14fd15073a8f692a"
dependencies = [ dependencies = [
"bincode", "bincode",
"either", "either",
@ -3564,7 +3576,7 @@ checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.70", "syn 2.0.72",
] ]
[[package]] [[package]]
@ -4438,7 +4450,7 @@ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"serde_derive_internals", "serde_derive_internals",
"syn 2.0.70", "syn 2.0.72",
] ]
[[package]] [[package]]
@ -4558,7 +4570,7 @@ checksum = "e0cd7e117be63d3c3678776753929474f3b04a43a080c744d6b0ae2a8c28e222"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.70", "syn 2.0.72",
] ]
[[package]] [[package]]
@ -4569,17 +4581,18 @@ checksum = "330f01ce65a3a5fe59a60c82f3c9a024b573b8a6e875bd233fe5f934e71d54e3"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.70", "syn 2.0.72",
] ]
[[package]] [[package]]
name = "serde_json" name = "serde_json"
version = "1.0.120" version = "1.0.121"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4e0d21c9a8cae1235ad58a00c11cb40d4b1e5c784f1ef2c537876ed6ffd8b7c5" checksum = "4ab380d7d9f22ef3f21ad3e6c1ebe8e4fc7a2000ccba2e4d71fc96f15b2cb609"
dependencies = [ dependencies = [
"indexmap 2.2.6", "indexmap 2.2.6",
"itoa 1.0.11", "itoa 1.0.11",
"memchr",
"ryu", "ryu",
"serde", "serde",
] ]
@ -4602,14 +4615,14 @@ checksum = "6c64451ba24fc7a6a2d60fc75dd9c83c90903b19028d4eff35e88fc1e86564e9"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.70", "syn 2.0.72",
] ]
[[package]] [[package]]
name = "serde_spanned" name = "serde_spanned"
version = "0.6.6" version = "0.6.7"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "79e674e01f999af37c49f70a6ede167a8a60b2503e56c5599532a65baa5969a0" checksum = "eb5b1b31579f3811bf615c144393417496f152e12ac8b7663bf664f4a815306d"
dependencies = [ dependencies = [
"serde", "serde",
] ]
@ -4623,7 +4636,7 @@ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"serde", "serde",
"syn 2.0.70", "syn 2.0.72",
] ]
[[package]] [[package]]
@ -4665,7 +4678,7 @@ dependencies = [
"darling", "darling",
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.70", "syn 2.0.72",
] ]
[[package]] [[package]]
@ -4933,7 +4946,7 @@ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"structmeta-derive", "structmeta-derive",
"syn 2.0.70", "syn 2.0.72",
] ]
[[package]] [[package]]
@ -4944,7 +4957,7 @@ checksum = "152a0b65a590ff6c3da95cabe2353ee04e6167c896b28e3b14478c2636c922fc"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.70", "syn 2.0.72",
] ]
[[package]] [[package]]
@ -4966,7 +4979,7 @@ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"rustversion", "rustversion",
"syn 2.0.70", "syn 2.0.72",
] ]
[[package]] [[package]]
@ -4999,9 +5012,9 @@ dependencies = [
[[package]] [[package]]
name = "syn" name = "syn"
version = "2.0.70" version = "2.0.72"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2f0209b68b3613b093e0ec905354eccaedcfe83b8cb37cbdeae64026c3064c16" checksum = "dc4b9b9bf2add8093d3f2c0204471e951b2285580335de42f9d2534f3ae7a8af"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
@ -5017,7 +5030,7 @@ dependencies = [
"proc-macro-error", "proc-macro-error",
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.70", "syn 2.0.72",
] ]
[[package]] [[package]]
@ -5034,7 +5047,7 @@ checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.70", "syn 2.0.72",
] ]
[[package]] [[package]]
@ -5076,7 +5089,7 @@ dependencies = [
"cfg-expr", "cfg-expr",
"heck 0.5.0", "heck 0.5.0",
"pkg-config", "pkg-config",
"toml 0.8.14", "toml 0.8.19",
"version-compare", "version-compare",
] ]
@ -5229,7 +5242,7 @@ dependencies = [
"serde_json", "serde_json",
"tauri-utils", "tauri-utils",
"tauri-winres", "tauri-winres",
"toml 0.8.14", "toml 0.8.19",
"walkdir", "walkdir",
] ]
@ -5251,7 +5264,7 @@ dependencies = [
"serde", "serde",
"serde_json", "serde_json",
"sha2", "sha2",
"syn 2.0.70", "syn 2.0.72",
"tauri-utils", "tauri-utils",
"thiserror", "thiserror",
"time", "time",
@ -5269,7 +5282,7 @@ dependencies = [
"heck 0.5.0", "heck 0.5.0",
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.70", "syn 2.0.72",
"tauri-codegen", "tauri-codegen",
"tauri-utils", "tauri-utils",
] ]
@ -5287,7 +5300,7 @@ dependencies = [
"serde", "serde",
"serde_json", "serde_json",
"tauri-utils", "tauri-utils",
"toml 0.8.14", "toml 0.8.19",
"walkdir", "walkdir",
] ]
@ -5571,7 +5584,7 @@ dependencies = [
"serde_with", "serde_with",
"swift-rs", "swift-rs",
"thiserror", "thiserror",
"toml 0.8.14", "toml 0.8.19",
"url", "url",
"urlpattern", "urlpattern",
"walkdir", "walkdir",
@ -5627,22 +5640,22 @@ checksum = "8eaa81235c7058867fa8c0e7314f33dcce9c215f535d1913822a2b3f5e289f3c"
[[package]] [[package]]
name = "thiserror" name = "thiserror"
version = "1.0.61" version = "1.0.63"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c546c80d6be4bc6a00c0f01730c08df82eaa7a7a61f11d656526506112cc1709" checksum = "c0342370b38b6a11b6cc11d6a805569958d54cfa061a29969c3b5ce2ea405724"
dependencies = [ dependencies = [
"thiserror-impl", "thiserror-impl",
] ]
[[package]] [[package]]
name = "thiserror-impl" name = "thiserror-impl"
version = "1.0.61" version = "1.0.63"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "46c3384250002a6d5af4d114f2845d37b57521033f30d5c3f46c4d70e1197533" checksum = "a4558b58466b9ad7ca0f102865eccc95938dca1a74a856f2b57b6629050da261"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.70", "syn 2.0.72",
] ]
[[package]] [[package]]
@ -5714,33 +5727,32 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20"
[[package]] [[package]]
name = "tokio" name = "tokio"
version = "1.38.0" version = "1.39.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ba4f4a02a7a80d6f274636f0aa95c7e383b912d41fe721a31f29e29698585a4a" checksum = "daa4fb1bc778bd6f04cbfc4bb2d06a7396a8f299dc33ea1900cedaa316f467b1"
dependencies = [ dependencies = [
"backtrace", "backtrace",
"bytes", "bytes",
"libc", "libc",
"mio", "mio",
"num_cpus",
"parking_lot 0.12.1", "parking_lot 0.12.1",
"pin-project-lite", "pin-project-lite",
"signal-hook-registry", "signal-hook-registry",
"socket2", "socket2",
"tokio-macros", "tokio-macros",
"tracing", "tracing",
"windows-sys 0.48.0", "windows-sys 0.52.0",
] ]
[[package]] [[package]]
name = "tokio-macros" name = "tokio-macros"
version = "2.3.0" version = "2.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5f5ae998a069d4b5aba8ee9dad856af7d520c3699e6159b185c2acd48155d39a" checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.70", "syn 2.0.72",
] ]
[[package]] [[package]]
@ -5819,21 +5831,21 @@ dependencies = [
[[package]] [[package]]
name = "toml" name = "toml"
version = "0.8.14" version = "0.8.19"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6f49eb2ab21d2f26bd6db7bf383edc527a7ebaee412d17af4d40fdccd442f335" checksum = "a1ed1f98e3fdc28d6d910e6737ae6ab1a93bf1985935a1193e68f93eeb68d24e"
dependencies = [ dependencies = [
"serde", "serde",
"serde_spanned", "serde_spanned",
"toml_datetime", "toml_datetime",
"toml_edit 0.22.14", "toml_edit 0.22.20",
] ]
[[package]] [[package]]
name = "toml_datetime" name = "toml_datetime"
version = "0.6.6" version = "0.6.8"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4badfd56924ae69bcc9039335b2e017639ce3f9b001c393c1b2d1ef846ce2cbf" checksum = "0dd7358ecb8fc2f8d014bf86f6f638ce72ba252a2c3a2572f2a795f1d23efb41"
dependencies = [ dependencies = [
"serde", "serde",
] ]
@ -5875,15 +5887,15 @@ dependencies = [
[[package]] [[package]]
name = "toml_edit" name = "toml_edit"
version = "0.22.14" version = "0.22.20"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f21c7aaf97f1bd9ca9d4f9e73b0a6c74bd5afef56f2bc931943a6e1c37e04e38" checksum = "583c44c02ad26b0c3f3066fe629275e50627026c51ac2e595cca4c230ce1ce1d"
dependencies = [ dependencies = [
"indexmap 2.2.6", "indexmap 2.2.6",
"serde", "serde",
"serde_spanned", "serde_spanned",
"toml_datetime", "toml_datetime",
"winnow 0.6.6", "winnow 0.6.18",
] ]
[[package]] [[package]]
@ -5940,7 +5952,7 @@ checksum = "84fd902d4e0b9a4b27f2f440108dc034e1758628a9b702f8ec61ad66355422fa"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.70", "syn 2.0.72",
] ]
[[package]] [[package]]
@ -5969,7 +5981,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.70", "syn 2.0.72",
] ]
[[package]] [[package]]
@ -6099,7 +6111,7 @@ checksum = "c88cc88fd23b5a04528f3a8436024f20010a16ec18eb23c164b1242f65860130"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.70", "syn 2.0.72",
"termcolor", "termcolor",
] ]
@ -6247,6 +6259,12 @@ dependencies = [
"serde", "serde",
] ]
[[package]]
name = "urlencoding"
version = "2.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "daf8dba3b7eb870caf1ddeed7bc9d2a049f3cfdfae7cb521b087cc33ae4c49da"
[[package]] [[package]]
name = "urlpattern" name = "urlpattern"
version = "0.2.0" version = "0.2.0"
@ -6316,7 +6334,7 @@ dependencies = [
"proc-macro-error", "proc-macro-error",
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.70", "syn 2.0.72",
] ]
[[package]] [[package]]
@ -6415,7 +6433,7 @@ dependencies = [
"once_cell", "once_cell",
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.70", "syn 2.0.72",
"wasm-bindgen-shared", "wasm-bindgen-shared",
] ]
@ -6449,7 +6467,7 @@ checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.70", "syn 2.0.72",
"wasm-bindgen-backend", "wasm-bindgen-backend",
"wasm-bindgen-shared", "wasm-bindgen-shared",
] ]
@ -6590,7 +6608,7 @@ checksum = "ac1345798ecd8122468840bcdf1b95e5dc6d2206c5e4b0eafa078d061f59c9bc"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.70", "syn 2.0.72",
] ]
[[package]] [[package]]
@ -6696,7 +6714,7 @@ checksum = "9107ddc059d5b6fbfbffdfa7a7fe3e22a226def0b2608f72e9d552763d3e1ad7"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.70", "syn 2.0.72",
] ]
[[package]] [[package]]
@ -6707,7 +6725,7 @@ checksum = "29bee4b38ea3cde66011baa44dba677c432a78593e202392d1e9070cf2a7fca7"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.70", "syn 2.0.72",
] ]
[[package]] [[package]]
@ -6954,9 +6972,9 @@ dependencies = [
[[package]] [[package]]
name = "winnow" name = "winnow"
version = "0.6.6" version = "0.6.18"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f0c976aaaa0e1f90dbb21e9587cdaf1d9679a1cde8875c0d6bd83ab96a208352" checksum = "68a9bda4691f099d435ad181000724da8e5899daa10713c2d432552b9ccd3a6f"
dependencies = [ dependencies = [
"memchr", "memchr",
] ]
@ -7159,7 +7177,7 @@ checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.70", "syn 2.0.72",
] ]
[[package]] [[package]]

View File

@ -15,7 +15,7 @@ tauri-build = { version = "2.0.0-beta.18", features = [] }
[dependencies] [dependencies]
anyhow = "1" anyhow = "1"
kcl-lib = { version = "0.1.53", path = "../src/wasm-lib/kcl" } kcl-lib = { version = "0.2", path = "../src/wasm-lib/kcl" }
kittycad = "0.3.7" kittycad = "0.3.7"
log = "0.4.21" log = "0.4.21"
oauth2 = "4.4.2" oauth2 = "4.4.2"

View File

@ -218,7 +218,7 @@ async fn parse_project_route(configuration: Configuration, route: &str) -> Resul
#[tauri::command] #[tauri::command]
async fn read_dir_recursive(path: &str) -> Result<FileEntry, InvokeError> { async fn read_dir_recursive(path: &str) -> Result<FileEntry, InvokeError> {
kcl_lib::settings::utils::walk_dir(&Path::new(path).to_path_buf()) kcl_lib::settings::utils::walk_dir(Path::new(path).to_path_buf())
.await .await
.map_err(InvokeError::from_anyhow) .map_err(InvokeError::from_anyhow)
} }

View File

@ -80,5 +80,5 @@
} }
}, },
"productName": "Zoo Modeling App", "productName": "Zoo Modeling App",
"version": "0.24.3" "version": "0.24.7"
} }

View File

@ -2,7 +2,7 @@ import { MouseEventHandler, useEffect, useMemo, useRef } from 'react'
import { uuidv4 } from 'lib/utils' import { uuidv4 } from 'lib/utils'
import { useHotKeyListener } from './hooks/useHotKeyListener' import { useHotKeyListener } from './hooks/useHotKeyListener'
import { Stream } from './components/Stream' import { Stream } from './components/Stream'
import { EngineCommand } from './lang/std/engineConnection' import { EngineCommand } from 'lang/std/artifactMap'
import { throttle } from './lib/utils' import { throttle } from './lib/utils'
import { AppHeader } from './components/AppHeader' import { AppHeader } from './components/AppHeader'
import { useHotkeys } from 'react-hotkeys-hook' import { useHotkeys } from 'react-hotkeys-hook'
@ -95,16 +95,16 @@ export function App() {
}) })
const newCmdId = uuidv4() const newCmdId = uuidv4()
if (context.store?.buttonDownInStream === undefined) { if (state.matches('idle.showPlanes')) return
debounceSocketSend({ if (context.store?.buttonDownInStream !== undefined) return
type: 'modeling_cmd_req', debounceSocketSend({
cmd: { type: 'modeling_cmd_req',
type: 'highlight_set_entity', cmd: {
selected_at_window: { x, y }, type: 'highlight_set_entity',
}, selected_at_window: { x, y },
cmd_id: newCmdId, },
}) cmd_id: newCmdId,
} })
} }
return ( return (

View File

@ -1,4 +1,4 @@
import { WheelEvent, useRef, useMemo } from 'react' import { useRef, useMemo, memo } from 'react'
import { isCursorInSketchCommandRange } from 'lang/util' import { isCursorInSketchCommandRange } from 'lang/util'
import { engineCommandManager, kclManager } from 'lib/singletons' import { engineCommandManager, kclManager } from 'lib/singletons'
import { useModelingContext } from 'hooks/useModelingContext' import { useModelingContext } from 'hooks/useModelingContext'
@ -12,11 +12,14 @@ import { ActionButtonDropdown } from 'components/ActionButtonDropdown'
import { useHotkeys } from 'react-hotkeys-hook' import { useHotkeys } from 'react-hotkeys-hook'
import Tooltip from 'components/Tooltip' import Tooltip from 'components/Tooltip'
import { useAppState } from 'AppState' import { useAppState } from 'AppState'
import { CustomIcon } from 'components/CustomIcon'
import { import {
canRectangleTool, toolbarConfig,
isEditingExistingSketch, ToolbarItem,
} from 'machines/modelingMachine' ToolbarItemCallbackProps,
import { DEV } from 'env' ToolbarItemResolved,
ToolbarModeName,
} from 'lib/toolbar'
export function Toolbar({ export function Toolbar({
className = '', className = '',
@ -25,12 +28,14 @@ export function Toolbar({
const { state, send, context } = useModelingContext() const { state, send, context } = useModelingContext()
const { commandBarSend } = useCommandsContext() const { commandBarSend } = useCommandsContext()
const iconClassName = const iconClassName =
'group-disabled:text-chalkboard-50 group-enabled:group-hover:!text-primary dark:group-enabled:group-hover:!text-inherit group-pressed:!text-chalkboard-10 group-ui-open:!text-chalkboard-10 dark:group-ui-open:!text-chalkboard-10' 'group-disabled:text-chalkboard-50 !text-inherit dark:group-enabled:group-hover:!text-inherit'
const bgClassName = const bgClassName = '!bg-transparent'
'group-disabled:!bg-transparent group-enabled:group-hover:bg-primary/10 dark:group-enabled:group-hover:bg-primary group-pressed:bg-primary group-ui-open:bg-primary' const buttonBgClassName =
const buttonClassName = 'bg-chalkboard-transparent dark:bg-transparent disabled:bg-transparent dark:disabled:bg-transparent enabled:hover:bg-chalkboard-10 dark:enabled:hover:bg-chalkboard-100 pressed:!bg-primary pressed:enabled:hover:!text-chalkboard-10'
'bg-chalkboard-10 dark:bg-chalkboard-100 enabled:hover:bg-chalkboard-10 dark:enabled:hover:bg-chalkboard-100 pressed:!border-primary ui-open:!border-primary' const buttonBorderClassName =
const pathId = useMemo(() => { '!border-transparent hover:!border-chalkboard-20 dark:enabled:hover:!border-primary pressed:!border-primary ui-open:!border-primary'
const sketchPathId = useMemo(() => {
if (!isSingleCursorInPipe(context.selectionRanges, kclManager.ast)) { if (!isSingleCursorInPipe(context.selectionRanges, kclManager.ast)) {
return false return false
} }
@ -51,401 +56,295 @@ export function Toolbar({
isExecuting || isExecuting ||
!isStreamReady !isStreamReady
const disableLineButton = const currentMode =
state.matches('Sketch.Rectangle tool.Awaiting second corner') || (Object.entries(toolbarConfig).find(([_, mode]) =>
disableAllButtons mode.check(state)
useHotkeys( )?.[0] as ToolbarModeName) || 'modeling'
'l',
() => /** These are the props that will be passed to the callbacks in the toolbar config
state.matches('Sketch.Line tool') * They are memoized to prevent unnecessary re-renders,
? send('CancelSketch') * but they still get a lot of churn from the state machine
: send({ * so I think there's a lot of room for improvement here
type: 'change tool', */
data: { tool: 'line' }, const configCallbackProps: ToolbarItemCallbackProps = useMemo(
}), () => ({
{ enabled: !disableLineButton, scopes: ['sketch'] } modelingStateMatches: state.matches,
) modelingSend: send,
const disableTangentialArc = commandBarSend,
(!isEditingExistingSketch(context) && sketchPathId,
!state.matches('Sketch.Tangential arc to')) || }),
disableAllButtons [state.matches, send, commandBarSend, sketchPathId]
useHotkeys(
'a',
() =>
state.matches('Sketch.Tangential arc to')
? send('CancelSketch')
: send({
type: 'change tool',
data: { tool: 'tangentialArc' },
}),
{ enabled: !disableTangentialArc, scopes: ['sketch'] }
)
const disableRectangle =
(!canRectangleTool(context) && !state.matches('Sketch.Rectangle tool')) ||
disableAllButtons
useHotkeys(
'r',
() =>
state.matches('Sketch.Rectangle tool')
? send('CancelSketch')
: send({
type: 'change tool',
data: { tool: 'rectangle' },
}),
{ enabled: !disableRectangle, scopes: ['sketch'] }
)
useHotkeys(
's',
() =>
state.nextEvents.includes('Enter sketch') && pathId
? send({ type: 'Enter sketch' })
: send({ type: 'Enter sketch', data: { forceNewSketch: true } }),
{ enabled: !disableAllButtons, scopes: ['modeling'] }
)
useHotkeys(
'esc',
() =>
['Sketch no face', 'Sketch.SketchIdle'].some(state.matches)
? send('Cancel')
: send('CancelSketch'),
{ enabled: !disableAllButtons, scopes: ['sketch'] }
)
useHotkeys(
'e',
() =>
commandBarSend({
type: 'Find and select command',
data: { name: 'Extrude', groupId: 'modeling' },
}),
{ enabled: !disableAllButtons, scopes: ['modeling'] }
)
const disableFillet = !state.can('Fillet') || disableAllButtons
useHotkeys(
'f',
() =>
commandBarSend({
type: 'Find and select command',
data: { name: 'Fillet', groupId: 'modeling' },
}),
{ enabled: !disableFillet, scopes: ['modeling'] }
) )
function handleToolbarButtonsWheelEvent(ev: WheelEvent<HTMLSpanElement>) { /**
const span = toolbarButtonsRef.current * Resolve all the callbacks and values for the current mode,
if (!span) { * so we don't need to worry about the other modes
return */
const currentModeItems: (
| ToolbarItemResolved
| ToolbarItemResolved[]
| 'break'
)[] = useMemo(() => {
return toolbarConfig[currentMode].items.map((maybeIconConfig) => {
if (maybeIconConfig === 'break') {
return 'break'
} else if (Array.isArray(maybeIconConfig)) {
return maybeIconConfig.map(resolveItemConfig)
} else {
return resolveItemConfig(maybeIconConfig)
}
})
function resolveItemConfig(
maybeIconConfig: ToolbarItem
): ToolbarItemResolved {
return {
...maybeIconConfig,
title:
typeof maybeIconConfig.title === 'string'
? maybeIconConfig.title
: maybeIconConfig.title(configCallbackProps),
description: maybeIconConfig.description,
links: maybeIconConfig.links || [],
isActive: maybeIconConfig.isActive?.(state),
hotkey:
typeof maybeIconConfig.hotkey === 'string'
? maybeIconConfig.hotkey
: maybeIconConfig.hotkey?.(state),
disabled:
disableAllButtons ||
maybeIconConfig.status !== 'available' ||
maybeIconConfig.disabled?.(state) === true,
disableHotkey: maybeIconConfig.disableHotkey?.(state),
status: maybeIconConfig.status,
}
} }
}, [currentMode, disableAllButtons, configCallbackProps])
span.scrollLeft = span.scrollLeft += ev.deltaY
}
const nextEvents = useMemo(() => state.nextEvents, [state.nextEvents])
const splitMenuItems = useMemo(
() =>
nextEvents
.filter(
(eventName) =>
eventName.includes('Make segment') ||
eventName.includes('Constrain')
)
.sort((a, b) => {
const aisEnabled = nextEvents
.filter((event) => state.can(event as any))
.includes(a)
const bIsEnabled = nextEvents
.filter((event) => state.can(event as any))
.includes(b)
if (aisEnabled && !bIsEnabled) {
return -1
}
if (!aisEnabled && bIsEnabled) {
return 1
}
return 0
})
.map((eventName) => ({
label: eventName
.replace('Make segment ', '')
.replace('Constrain ', ''),
onClick: () => send(eventName),
disabled:
!nextEvents
.filter((event) => state.can(event as any))
.includes(eventName) || disableAllButtons,
})),
[JSON.stringify(nextEvents), state]
)
return ( return (
<menu className="max-w-full whitespace-nowrap rounded px-1.5 py-0.5 backdrop-blur-sm bg-chalkboard-10/80 dark:bg-chalkboard-110/70 relative"> <menu className="max-w-full whitespace-nowrap rounded-b px-2 py-1 bg-chalkboard-10 dark:bg-chalkboard-90 relative border border-chalkboard-20 dark:border-chalkboard-80 border-t-0 shadow-sm">
<ul <ul
{...props} {...props}
ref={toolbarButtonsRef} ref={toolbarButtonsRef}
onWheel={handleToolbarButtonsWheelEvent} className={
className={'m-0 py-1 rounded-l-sm flex gap-2 items-center ' + className} 'has-[[aria-expanded=true]]:!pointer-events-none m-0 py-1 rounded-l-sm flex gap-1.5 items-center ' +
style={{ scrollbarWidth: 'thin' }} className
}
> >
{nextEvents.includes('Enter sketch') && ( {/* A menu item will either be a vertical line break, a button with a dropdown, or a single button */}
<li className="contents"> {currentModeItems.map((maybeIconConfig, i) => {
<ActionButton if (maybeIconConfig === 'break') {
className={buttonClassName} return (
Element="button" <div
onClick={() => key={'break-' + i}
send({ type: 'Enter sketch', data: { forceNewSketch: true } }) className="h-5 w-[1px] block bg-chalkboard-30 dark:bg-chalkboard-80"
} />
iconStart={{ )
icon: 'sketch', } else if (Array.isArray(maybeIconConfig)) {
iconClassName, return (
bgClassName, <ActionButtonDropdown
}}
disabled={disableAllButtons}
>
<span data-testid="start-sketch">Start Sketch</span>
<Tooltip
delay={1250}
position="bottom"
className="!px-2 !text-xs"
>
Shortcut: S
</Tooltip>
</ActionButton>
</li>
)}
{nextEvents.includes('Enter sketch') && pathId && (
<li className="contents">
<ActionButton
className={buttonClassName}
Element="button"
onClick={() => send({ type: 'Enter sketch' })}
iconStart={{
icon: 'sketch',
iconClassName,
bgClassName,
}}
disabled={disableAllButtons}
>
Edit Sketch
<Tooltip
delay={1250}
position="bottom"
className="!px-2 !text-xs"
>
Shortcut: S
</Tooltip>
</ActionButton>
</li>
)}
{nextEvents.includes('Cancel') && !state.matches('idle') && (
<li className="contents">
<ActionButton
className={buttonClassName}
Element="button"
onClick={() => send({ type: 'Cancel' })}
iconStart={{
icon: 'arrowLeft',
iconClassName,
bgClassName,
}}
disabled={disableAllButtons}
>
Exit Sketch
<Tooltip
delay={1250}
position="bottom"
className="!px-2 !text-xs"
>
Shortcut: Esc
</Tooltip>
</ActionButton>
</li>
)}
{state.matches('Sketch no face') && (
<li className="contents">
<div className="mx-2 text-sm">click plane or face to sketch on</div>
</li>
)}
{state.matches('Sketch') && !state.matches('idle') && (
<>
<li className="contents" key="line-button">
<ActionButton
className={buttonClassName}
Element="button" Element="button"
onClick={() => key={maybeIconConfig[0].id}
state?.matches('Sketch.Line tool') data-testid={maybeIconConfig[0].id + '-dropdown'}
? send('CancelSketch') id={maybeIconConfig[0].id + '-dropdown'}
: send({ name={maybeIconConfig[0].title}
type: 'change tool', className={
data: { tool: 'line' }, 'group/wrapper ' +
}) buttonBorderClassName +
' !bg-transparent relative group !gap-0'
} }
aria-pressed={state?.matches('Sketch.Line tool')} splitMenuItems={maybeIconConfig.map((itemConfig) => ({
iconStart={{ id: itemConfig.id,
icon: 'line', label: itemConfig.title,
iconClassName, hotkey: itemConfig.hotkey,
bgClassName, onClick: () => itemConfig.onClick(configCallbackProps),
}} disabled:
disabled={disableLineButton} disableAllButtons ||
itemConfig.status !== 'available' ||
itemConfig.disabled === true,
status: itemConfig.status,
}))}
> >
Line <ActionButton
<Tooltip Element="button"
delay={1250} id={maybeIconConfig[0].id}
position="bottom" data-testid={maybeIconConfig[0].id}
className="!px-2 !text-xs" iconStart={{
icon: maybeIconConfig[0].icon,
className: iconClassName,
bgClassName: bgClassName,
}}
className={
'!border-transparent !px-0 pressed:!text-chalkboard-10 pressed:enabled:hovered:!text-chalkboard-10 ' +
buttonBgClassName
}
aria-pressed={maybeIconConfig[0].isActive}
disabled={
disableAllButtons ||
maybeIconConfig[0].status !== 'available' ||
maybeIconConfig[0].disabled
}
name={maybeIconConfig[0].title}
aria-description={maybeIconConfig[0].description}
onClick={() =>
maybeIconConfig[0].onClick(configCallbackProps)
}
> >
Shortcut: L <span
</Tooltip> className={!maybeIconConfig[0].showTitle ? 'sr-only' : ''}
</ActionButton> >
</li> {maybeIconConfig[0].title}
<li className="contents" key="tangential-arc-button"> </span>
</ActionButton>
<ToolbarItemTooltip
itemConfig={maybeIconConfig[0]}
configCallbackProps={configCallbackProps}
/>
</ActionButtonDropdown>
)
}
const itemConfig = maybeIconConfig
return (
<div className="relative" key={itemConfig.id}>
<ActionButton <ActionButton
className={buttonClassName}
Element="button" Element="button"
onClick={() => key={itemConfig.id}
state.matches('Sketch.Tangential arc to') id={itemConfig.id}
? send('CancelSketch') data-testid={itemConfig.id}
: send({
type: 'change tool',
data: { tool: 'tangentialArc' },
})
}
aria-pressed={state.matches('Sketch.Tangential arc to')}
iconStart={{ iconStart={{
icon: 'arc', icon: itemConfig.icon,
iconClassName, className: iconClassName,
bgClassName, bgClassName: bgClassName,
}} }}
disabled={disableTangentialArc} className={
> 'pressed:!text-chalkboard-10 pressed:enabled:hovered:!text-chalkboard-10 ' +
Tangential Arc buttonBorderClassName +
<Tooltip ' ' +
delay={1250} buttonBgClassName +
position="bottom" (!itemConfig.showTitle ? ' !px-0' : '')
className="!px-2 !text-xs"
>
Shortcut: A
</Tooltip>
</ActionButton>
</li>
<li className="contents" key="rectangle-button">
<ActionButton
className={buttonClassName}
Element="button"
onClick={() =>
state.matches('Sketch.Rectangle tool')
? send('CancelSketch')
: send({
type: 'change tool',
data: { tool: 'rectangle' },
})
} }
aria-pressed={state.matches('Sketch.Rectangle tool')} name={itemConfig.title}
iconStart={{ aria-description={itemConfig.description}
icon: 'rectangle', aria-pressed={itemConfig.isActive}
iconClassName, disabled={
bgClassName, disableAllButtons ||
}} itemConfig.status !== 'available' ||
disabled={disableRectangle} itemConfig.disabled
title={
canRectangleTool(context)
? 'Rectangle'
: 'Can only be used when a sketch is empty currently'
} }
onClick={() => itemConfig.onClick(configCallbackProps)}
> >
Rectangle <span className={!itemConfig.showTitle ? 'sr-only' : ''}>
<Tooltip {itemConfig.title}
delay={1250} </span>
position="bottom"
className="!px-2 !text-xs"
>
Shortcut: R
</Tooltip>
</ActionButton> </ActionButton>
</li> <ToolbarItemTooltip
</> itemConfig={itemConfig}
)} configCallbackProps={configCallbackProps}
{state.matches('Sketch.SketchIdle') && />
nextEvents.filter( </div>
(eventName) => )
eventName.includes('Make segment') || })}
eventName.includes('Constrain')
).length > 0 && (
<ActionButtonDropdown
splitMenuItems={splitMenuItems}
className={buttonClassName}
Element="button"
iconStart={{
icon: 'dimension',
iconClassName,
bgClassName,
}}
>
Constraints
</ActionButtonDropdown>
)}
{state.matches('idle') && (
<li className="contents">
<ActionButton
className={buttonClassName}
Element="button"
onClick={() =>
commandBarSend({
type: 'Find and select command',
data: { name: 'Extrude', groupId: 'modeling' },
})
}
disabled={!state.can('Extrude') || disableAllButtons}
title={
state.can('Extrude')
? 'extrude'
: 'sketches need to be closed, or not already extruded'
}
iconStart={{
icon: 'extrude',
iconClassName,
bgClassName,
}}
>
Extrude
<Tooltip
delay={1250}
position="bottom"
className="!px-2 !text-xs"
>
Shortcut: E
</Tooltip>
</ActionButton>
</li>
)}
{state.matches('idle') && (DEV || (window as any)._enableFillet) && (
<li className="contents">
<ActionButton
className={buttonClassName}
Element="button"
onClick={() =>
commandBarSend({
type: 'Find and select command',
data: { name: 'Fillet', groupId: 'modeling' },
})
}
disabled={disableFillet}
title={disableFillet ? 'fillet' : "edge can't be filleted"}
iconStart={{
icon: 'fillet', // todo: add fillet icon
iconClassName,
bgClassName,
}}
>
Fillet
<Tooltip
delay={1250}
position="bottom"
className="!px-2 !text-xs"
>
Shortcut: F
</Tooltip>
</ActionButton>
</li>
)}
</ul> </ul>
{state.matches('Sketch no face') && (
<div className="absolute top-full left-1/2 -translate-x-1/2 mt-2 py-1 px-2 bg-chalkboard-10 dark:bg-chalkboard-90 border border-chalkboard-20 dark:border-chalkboard-80 rounded shadow-lg">
<p className="text-xs">Select a plane or face to start sketching</p>
</div>
)}
</menu> </menu>
) )
} }
/**
* The single button and dropdown button share content, so we extract it here
* It contains a tooltip with the title, description, and links
* and a hotkey listener
*/
const ToolbarItemTooltip = memo(function ToolbarItemContents({
itemConfig,
configCallbackProps,
}: {
itemConfig: ToolbarItemResolved
configCallbackProps: ToolbarItemCallbackProps
}) {
useHotkeys(
itemConfig.hotkey || '',
() => {
itemConfig.onClick(configCallbackProps)
},
{
enabled:
itemConfig.status === 'available' &&
!!itemConfig.hotkey &&
!itemConfig.disabled &&
!itemConfig.disableHotkey,
}
)
return (
<Tooltip
inert={false}
position="bottom"
wrapperClassName="!p-4 !pointer-events-auto"
contentClassName="!text-left text-wrap !text-xs !p-0 !pb-2 flex gap-2 !max-w-none !w-72 flex-col items-stretch"
>
<div className="rounded-top flex items-center gap-2 pt-3 pb-2 px-2 bg-chalkboard-20/50 dark:bg-chalkboard-80/50">
<span
className={`text-sm flex-1 ${
itemConfig.status !== 'available'
? 'text-chalkboard-70 dark:text-chalkboard-40'
: ''
}`}
>
{itemConfig.title}
</span>
{itemConfig.status === 'available' && itemConfig.hotkey ? (
<kbd className="flex-none hotkey">{itemConfig.hotkey}</kbd>
) : itemConfig.status === 'kcl-only' ? (
<>
<span className="text-wrap font-sans flex-0 text-chalkboard-70 dark:text-chalkboard-40">
KCL code only
</span>
<CustomIcon
name="code"
className="w-5 h-5 text-chalkboard-70 dark:text-chalkboard-40"
/>
</>
) : (
itemConfig.status === 'unavailable' && (
<>
<span className="text-wrap font-sans flex-0 text-chalkboard-70 dark:text-chalkboard-40">
In development
</span>
<CustomIcon
name="lockClosed"
className="w-5 h-5 text-chalkboard-70 dark:text-chalkboard-40"
/>
</>
)
)}
</div>
<p className="px-2 text-ch font-sans">{itemConfig.description}</p>
{itemConfig.links.length > 0 && (
<>
<hr className="border-chalkboard-20 dark:border-chalkboard-80" />
<ul className="p-0 px-1 m-0 flex flex-col">
{itemConfig.links.map((link) => (
<li key={link.label} className="contents">
<a
href={link.url}
target="_blank"
rel="noreferrer"
className="flex items-center rounded-sm p-1 no-underline text-inherit hover:bg-primary/10 hover:text-primary dark:hover:bg-chalkboard-70 dark:hover:text-inherit"
>
<span className="flex-1">Open {link.label}</span>
<CustomIcon name="link" className="w-4 h-4" />
</a>
</li>
))}
</ul>
</>
)}
</Tooltip>
)
})

View File

@ -17,11 +17,11 @@ import {
ZOOM_MAGIC_NUMBER, ZOOM_MAGIC_NUMBER,
} from './sceneInfra' } from './sceneInfra'
import { import {
EngineCommand,
Subscription, Subscription,
EngineCommandManager, EngineCommandManager,
UnreliableSubscription, UnreliableSubscription,
} from 'lang/std/engineConnection' } from 'lang/std/engineConnection'
import { EngineCommand } from 'lang/std/artifactMap'
import { uuidv4 } from 'lib/utils' import { uuidv4 } from 'lib/utils'
import { deg2Rad } from 'lib/utils2d' import { deg2Rad } from 'lib/utils2d'
import { isReducedMotion, roundOff, throttle } from 'lib/utils' import { isReducedMotion, roundOff, throttle } from 'lib/utils'
@ -585,10 +585,6 @@ export class CameraControls {
.add(direction.multiplyScalar(-distanceAfter)) .add(direction.multiplyScalar(-distanceAfter))
this.camera.position.copy(newPosition) this.camera.position.copy(newPosition)
const { z_near, z_far } = calculateNearFarFromFOV(this.lastPerspectiveFov)
this.camera.near = z_near
this.camera.far = z_far
if (splitEngineCalls) { if (splitEngineCalls) {
await this.engineCommandManager.sendSceneCommand({ await this.engineCommandManager.sendSceneCommand({
type: 'modeling_cmd_req', type: 'modeling_cmd_req',
@ -1144,9 +1140,6 @@ function convertThreeCamValuesToEngineCam({
up: Vector3 up: Vector3
vantage: Vector3 vantage: Vector3
} { } {
// Something to consider is that the orbit controls have a target,
// we're kind of deriving the target/lookAtVector here when it might not be needed
// leaving for now since it's working but maybe revisit later
const euler = new Euler().setFromQuaternion(quaternion, 'XYZ') const euler = new Euler().setFromQuaternion(quaternion, 'XYZ')
const upVector = new Vector3(0, 1, 0).applyEuler(euler).normalize() const upVector = new Vector3(0, 1, 0).applyEuler(euler).normalize()
@ -1157,18 +1150,50 @@ function convertThreeCamValuesToEngineCam({
vantage: position, vantage: position,
} }
} }
const lookAtVector = new Vector3(0, 0, -1)
.applyEuler(euler) // re-implementing stuff here, though this is a bunch of Mike's code
.normalize() // if we need to pull him in again, at least it will be familiar to him
.add(position) // and it's all simple functions.
const fudgeFactor2 = zoom * 0.9979224466814468 - 0.03473692325839295 interface Coord3d {
const zoomFactor = (-ZOOM_MAGIC_NUMBER + fudgeFactor2) / zoom x: number
const direction = lookAtVector.clone().sub(position).normalize() y: number
const newVantage = position.clone().add(direction.multiplyScalar(zoomFactor)) z: number
}
function buildLookAt(distance: number, center: Coord3d, eye: Coord3d) {
const eyeVector = normalized(sub(eye, center))
return { center: center, eye: add(center, mult(eyeVector, distance)) }
}
function mult(vecA: Coord3d, sc: number): Coord3d {
return { x: vecA.x * sc, y: vecA.y * sc, z: vecA.z * sc }
}
function add(vecA: Coord3d, vecB: Coord3d): Coord3d {
return { x: vecA.x + vecB.x, y: vecA.y + vecB.y, z: vecA.z + vecB.z }
}
function sub(vecA: Coord3d, vecB: Coord3d): Coord3d {
return { x: vecA.x - vecB.x, y: vecA.y - vecB.y, z: vecA.z - vecB.z }
}
function dot(vecA: Coord3d, vecB: Coord3d) {
return vecA.x * vecB.x + vecA.y * vecB.y + vecA.z * vecB.z
}
function length(vecA: Coord3d) {
return Math.sqrt(dot(vecA, vecA))
}
function normalized(vecA: Coord3d) {
return mult(vecA, 1.0 / length(vecA))
}
const lookAt = buildLookAt(64 / zoom, target, position)
return { return {
center: lookAtVector, center: new Vector3(lookAt.center.x, lookAt.center.y, lookAt.center.z),
up: upVector, up: new Vector3(0, 0, 1),
vantage: newVantage, vantage: new Vector3(lookAt.eye.x, lookAt.eye.y, lookAt.eye.z),
} }
} }
@ -1224,7 +1249,7 @@ export async function letEngineAnimateAndSyncCamAfter(
type: 'enable_sketch_mode', type: 'enable_sketch_mode',
adjust_camera: true, adjust_camera: true,
animated: !isReducedMotion(), animated: !isReducedMotion(),
ortho: false, ortho: true,
entity_id: entityId, entity_id: entityId,
}, },
}) })
@ -1241,25 +1266,4 @@ export async function letEngineAnimateAndSyncCamAfter(
type: 'default_camera_get_settings', type: 'default_camera_get_settings',
}, },
}) })
await engineCommandManager.sendSceneCommand({
type: 'modeling_cmd_req',
cmd_id: uuidv4(),
cmd: {
type: 'enable_sketch_mode',
adjust_camera: true,
animated: false,
ortho: true,
entity_id: entityId,
},
})
await new Promise((resolve) => setTimeout(resolve, 50))
await engineCommandManager.sendSceneCommand({
// CameraControls subscribes to default_camera_get_settings response events
// firing this at connection ensure the camera's are synced initially
type: 'modeling_cmd_req',
cmd_id: uuidv4(),
cmd: {
type: 'default_camera_get_settings',
},
})
} }

View File

@ -102,6 +102,7 @@ export const ClientSideScene = ({
canvas.addEventListener('mousedown', sceneInfra.onMouseDown, false) canvas.addEventListener('mousedown', sceneInfra.onMouseDown, false)
canvas.addEventListener('mouseup', sceneInfra.onMouseUp, false) canvas.addEventListener('mouseup', sceneInfra.onMouseUp, false)
sceneInfra.setSend(send) sceneInfra.setSend(send)
engineCommandManager.modelingSend = send
return () => { return () => {
canvas?.removeEventListener('mousemove', sceneInfra.onMouseMove) canvas?.removeEventListener('mousemove', sceneInfra.onMouseMove)
canvas?.removeEventListener('mousedown', sceneInfra.onMouseDown) canvas?.removeEventListener('mousedown', sceneInfra.onMouseDown)

View File

@ -22,11 +22,9 @@ import {
import { import {
ARROWHEAD, ARROWHEAD,
AXIS_GROUP, AXIS_GROUP,
DEFAULT_PLANES,
DefaultPlane,
defaultPlaneColor,
getSceneScale, getSceneScale,
INTERSECTION_PLANE_LAYER, INTERSECTION_PLANE_LAYER,
OnClickCallbackArgs,
OnMouseEnterLeaveArgs, OnMouseEnterLeaveArgs,
RAYCASTABLE_PLANE, RAYCASTABLE_PLANE,
SEGMENT_LENGTH_LABEL, SEGMENT_LENGTH_LABEL,
@ -47,7 +45,6 @@ import {
PipeExpression, PipeExpression,
Program, Program,
ProgramMemory, ProgramMemory,
programMemoryInit,
recast, recast,
SketchGroup, SketchGroup,
ExtrudeGroup, ExtrudeGroup,
@ -79,6 +76,7 @@ import {
} from 'lang/std/sketch' } from 'lang/std/sketch'
import { isOverlap, normaliseAngle, roundOff, throttle } from 'lib/utils' import { isOverlap, normaliseAngle, roundOff, throttle } from 'lib/utils'
import { import {
addStartProfileAt,
createArrayExpression, createArrayExpression,
createCallExpressionStdLib, createCallExpressionStdLib,
createLiteral, createLiteral,
@ -96,10 +94,7 @@ import { createGridHelper, orthoScale, perspScale } from './helpers'
import { Models } from '@kittycad/lib' import { Models } from '@kittycad/lib'
import { uuidv4 } from 'lib/utils' import { uuidv4 } from 'lib/utils'
import { SegmentOverlayPayload, SketchDetails } from 'machines/modelingMachine' import { SegmentOverlayPayload, SketchDetails } from 'machines/modelingMachine'
import { import { EngineCommandManager } from 'lang/std/engineConnection'
ArtifactMapCommand,
EngineCommandManager,
} from 'lang/std/engineConnection'
import { import {
getRectangleCallExpressions, getRectangleCallExpressions,
updateRectangleSketch, updateRectangleSketch,
@ -130,7 +125,7 @@ export const HIDE_HOVER_SEGMENT_LENGTH = 60 // in pixels
export class SceneEntities { export class SceneEntities {
engineCommandManager: EngineCommandManager engineCommandManager: EngineCommandManager
scene: Scene scene: Scene
sceneProgramMemory: ProgramMemory = { root: {}, return: null } sceneProgramMemory: ProgramMemory = ProgramMemory.empty()
activeSegments: { [key: string]: Group } = {} activeSegments: { [key: string]: Group } = {}
intersectionPlane: Mesh | null = null intersectionPlane: Mesh | null = null
axisGroup: Group | null = null axisGroup: Group | null = null
@ -204,6 +199,7 @@ export class SceneEntities {
createIntersectionPlane() { createIntersectionPlane() {
if (sceneInfra.scene.getObjectByName(RAYCASTABLE_PLANE)) { if (sceneInfra.scene.getObjectByName(RAYCASTABLE_PLANE)) {
// this.removeIntersectionPlane()
console.warn('createIntersectionPlane called when it already exists') console.warn('createIntersectionPlane called when it already exists')
return return
} }
@ -300,6 +296,51 @@ export class SceneEntities {
if (intersectionPlane) this.scene.remove(intersectionPlane) if (intersectionPlane) this.scene.remove(intersectionPlane)
} }
setupNoPointsListener({
sketchDetails,
afterClick,
}: {
sketchDetails: SketchDetails
afterClick: (args: OnClickCallbackArgs) => void
}) {
// Create a THREEjs plane to raycast clicks onto
this.createIntersectionPlane()
const quaternion = quaternionFromUpNForward(
new Vector3(...sketchDetails.yAxis),
new Vector3(...sketchDetails.zAxis)
)
// Position the click raycast plane
if (this.intersectionPlane) {
this.intersectionPlane.setRotationFromQuaternion(quaternion)
this.intersectionPlane.position.copy(
new Vector3(...(sketchDetails?.origin || [0, 0, 0]))
)
}
sceneInfra.setCallbacks({
onClick: async (args) => {
if (!args) return
if (args.mouseEvent.which !== 1) return
const { intersectionPoint } = args
if (!intersectionPoint?.twoD || !sketchDetails?.sketchPathToNode) return
const addStartProfileAtRes = addStartProfileAt(
kclManager.ast,
sketchDetails.sketchPathToNode,
[intersectionPoint.twoD.x, intersectionPoint.twoD.y]
)
if (trap(addStartProfileAtRes)) return
const { modifiedAst } = addStartProfileAtRes
await kclManager.updateAst(modifiedAst, false)
this.removeIntersectionPlane()
// Now perform the caller-specified action
afterClick(args)
},
})
}
async setupSketch({ async setupSketch({
sketchPathToNode, sketchPathToNode,
forward, forward,
@ -539,7 +580,7 @@ export class SceneEntities {
segmentName: 'line' | 'tangentialArcTo' = 'line', segmentName: 'line' | 'tangentialArcTo' = 'line',
shouldTearDown = true shouldTearDown = true
) => { ) => {
const _ast = JSON.parse(JSON.stringify(kclManager.ast)) const _ast = structuredClone(kclManager.ast)
const _node1 = getNodeFromPath<VariableDeclaration>( const _node1 = getNodeFromPath<VariableDeclaration>(
_ast, _ast,
@ -550,9 +591,9 @@ export class SceneEntities {
const variableDeclarationName = const variableDeclarationName =
_node1.node?.declarations?.[0]?.id?.name || '' _node1.node?.declarations?.[0]?.id?.name || ''
const sg = kclManager.programMemory.root[ const sg = kclManager.programMemory.get(
variableDeclarationName variableDeclarationName
] as SketchGroup ) as SketchGroup
const lastSeg = sg.value.slice(-1)[0] || sg.start const lastSeg = sg.value.slice(-1)[0] || sg.start
const index = sg.value.length // because we've added a new segment that's not in the memory yet, no need for `-1` const index = sg.value.length // because we've added a new segment that's not in the memory yet, no need for `-1`
@ -676,21 +717,6 @@ export class SceneEntities {
...this.mouseEnterLeaveCallbacks(), ...this.mouseEnterLeaveCallbacks(),
}) })
} }
setupRectangleOriginListener = () => {
sceneInfra.setCallbacks({
onClick: (args) => {
const twoD = args.intersectionPoint?.twoD
if (!twoD) {
console.warn(`This click didn't have a 2D intersection`, args)
return
}
sceneInfra.modelingSend({
type: 'Add rectangle origin',
data: [twoD.x, twoD.y],
})
},
})
}
setupDraftRectangle = async ( setupDraftRectangle = async (
sketchPathToNode: PathToNode, sketchPathToNode: PathToNode,
forward: [number, number, number], forward: [number, number, number],
@ -698,7 +724,7 @@ export class SceneEntities {
sketchOrigin: [number, number, number], sketchOrigin: [number, number, number],
rectangleOrigin: [x: number, y: number] rectangleOrigin: [x: number, y: number]
) => { ) => {
let _ast = JSON.parse(JSON.stringify(kclManager.ast)) let _ast = structuredClone(kclManager.ast)
const _node1 = getNodeFromPath<VariableDeclaration>( const _node1 = getNodeFromPath<VariableDeclaration>(
_ast, _ast,
@ -708,6 +734,8 @@ export class SceneEntities {
if (trap(_node1)) return Promise.reject(_node1) if (trap(_node1)) return Promise.reject(_node1)
const variableDeclarationName = const variableDeclarationName =
_node1.node?.declarations?.[0]?.id?.name || '' _node1.node?.declarations?.[0]?.id?.name || ''
const startSketchOn = _node1.node?.declarations
const startSketchOnInit = startSketchOn?.[0]?.init
const tags: [string, string, string] = [ const tags: [string, string, string] = [
findUniqueName(_ast, 'rectangleSegmentA'), findUniqueName(_ast, 'rectangleSegmentA'),
@ -715,21 +743,14 @@ export class SceneEntities {
findUniqueName(_ast, 'rectangleSegmentC'), findUniqueName(_ast, 'rectangleSegmentC'),
] ]
const _node2 = getNodeFromPath<VariableDeclaration>(
_ast,
sketchPathToNode || [],
'VariableDeclaration'
)
if (trap(_node2)) return Promise.reject(_node2)
const startSketchOn = _node2.node?.declarations
const startSketchOnInit = startSketchOn?.[0]?.init
startSketchOn[0].init = createPipeExpression([ startSketchOn[0].init = createPipeExpression([
startSketchOnInit, startSketchOnInit,
...getRectangleCallExpressions(rectangleOrigin, tags), ...getRectangleCallExpressions(rectangleOrigin, tags),
]) ])
_ast = parse(recast(_ast)) let _recastAst = parse(recast(_ast))
if (trap(_recastAst)) return Promise.reject(_recastAst)
_ast = _recastAst
const { programMemoryOverride, truncatedAst } = await this.setupSketch({ const { programMemoryOverride, truncatedAst } = await this.setupSketch({
sketchPathToNode, sketchPathToNode,
@ -743,7 +764,7 @@ export class SceneEntities {
sceneInfra.setCallbacks({ sceneInfra.setCallbacks({
onMove: async (args) => { onMove: async (args) => {
// Update the width and height of the draft rectangle // Update the width and height of the draft rectangle
const pathToNodeTwo = JSON.parse(JSON.stringify(sketchPathToNode)) const pathToNodeTwo = structuredClone(sketchPathToNode)
pathToNodeTwo[1][0] = 0 pathToNodeTwo[1][0] = 0
const _node = getNodeFromPath<VariableDeclaration>( const _node = getNodeFromPath<VariableDeclaration>(
@ -768,9 +789,9 @@ export class SceneEntities {
programMemoryOverride, programMemoryOverride,
}) })
this.sceneProgramMemory = programMemory this.sceneProgramMemory = programMemory
const sketchGroup = programMemory.root[ const sketchGroup = programMemory.get(
variableDeclarationName variableDeclarationName
] as SketchGroup ) as SketchGroup
const sgPaths = sketchGroup.value const sgPaths = sketchGroup.value
const orthoFactor = orthoScale(sceneInfra.camControls.camera) const orthoFactor = orthoScale(sceneInfra.camControls.camera)
@ -805,7 +826,9 @@ export class SceneEntities {
if (sketchInit.type === 'PipeExpression') { if (sketchInit.type === 'PipeExpression') {
updateRectangleSketch(sketchInit, x, y, tags[0]) updateRectangleSketch(sketchInit, x, y, tags[0])
_ast = parse(recast(_ast)) let _recastAst = parse(recast(_ast))
if (trap(_recastAst)) return Promise.reject(_recastAst)
_ast = _recastAst
// Update the primary AST and unequip the rectangle tool // Update the primary AST and unequip the rectangle tool
await kclManager.executeAstMock(_ast) await kclManager.executeAstMock(_ast)
@ -820,9 +843,9 @@ export class SceneEntities {
// Prepare to update the THREEjs scene // Prepare to update the THREEjs scene
this.sceneProgramMemory = programMemory this.sceneProgramMemory = programMemory
const sketchGroup = programMemory.root[ const sketchGroup = programMemory.get(
variableDeclarationName variableDeclarationName
] as SketchGroup ) as SketchGroup
const sgPaths = sketchGroup.value const sgPaths = sketchGroup.value
const orthoFactor = orthoScale(sceneInfra.camControls.camera) const orthoFactor = orthoScale(sceneInfra.camControls.camera)
@ -1009,10 +1032,14 @@ export class SceneEntities {
PROFILE_START, PROFILE_START,
]) ])
if (!group) return if (!group) return
const pathToNode: PathToNode = JSON.parse( const pathToNode: PathToNode = structuredClone(group.userData.pathToNode)
JSON.stringify(group.userData.pathToNode) const varDecIndex = pathToNode[1][0]
) if (typeof varDecIndex !== 'number') {
const varDecIndex = JSON.parse(JSON.stringify(pathToNode[1][0])) console.error(
`Expected varDecIndex to be a number, but found: ${typeof varDecIndex} ${varDecIndex}`
)
return
}
if (draftInfo) { if (draftInfo) {
pathToNode[1][0] = 0 pathToNode[1][0] = 0
} }
@ -1081,9 +1108,9 @@ export class SceneEntities {
}) })
this.sceneProgramMemory = programMemory this.sceneProgramMemory = programMemory
const maybeSketchGroup = programMemory.root[variableDeclarationName] const maybeSketchGroup = programMemory.get(variableDeclarationName)
let sketchGroup = undefined let sketchGroup = undefined
if (maybeSketchGroup.type === 'SketchGroup') { if (maybeSketchGroup?.type === 'SketchGroup') {
sketchGroup = maybeSketchGroup sketchGroup = maybeSketchGroup
} else if ((maybeSketchGroup as ExtrudeGroup).sketchGroup) { } else if ((maybeSketchGroup as ExtrudeGroup).sketchGroup) {
sketchGroup = (maybeSketchGroup as ExtrudeGroup).sketchGroup sketchGroup = (maybeSketchGroup as ExtrudeGroup).sketchGroup
@ -1473,150 +1500,6 @@ export class SceneEntities {
this._tearDownSketch(0, resolve, reject, { removeAxis }) this._tearDownSketch(0, resolve, reject, { removeAxis })
}) })
} }
setupDefaultPlaneHover() {
sceneInfra.setCallbacks({
onMouseEnter: ({ selected }) => {
if (!(selected instanceof Mesh && selected.parent)) return
if (selected.parent.userData.type !== DEFAULT_PLANES) return
const type: DefaultPlane = selected.userData.type
selected.material.color = defaultPlaneColor(type, 0.5, 1)
},
onMouseLeave: ({ selected }) => {
if (!(selected instanceof Mesh && selected.parent)) return
if (selected.parent.userData.type !== DEFAULT_PLANES) return
const type: DefaultPlane = selected.userData.type
selected.material.color = defaultPlaneColor(type)
},
onClick: async (args) => {
const { entity_id } = await sendSelectEventToEngine(
args?.mouseEvent,
document.getElementById('video-stream') as HTMLVideoElement,
sceneInfra._streamDimensions
)
let _entity_id = entity_id
if (!_entity_id) return
if (
engineCommandManager.defaultPlanes?.xy === _entity_id ||
engineCommandManager.defaultPlanes?.xz === _entity_id ||
engineCommandManager.defaultPlanes?.yz === _entity_id ||
engineCommandManager.defaultPlanes?.negXy === _entity_id ||
engineCommandManager.defaultPlanes?.negXz === _entity_id ||
engineCommandManager.defaultPlanes?.negYz === _entity_id
) {
const defaultPlaneStrMap: Record<string, DefaultPlaneStr> = {
[engineCommandManager.defaultPlanes.xy]: 'XY',
[engineCommandManager.defaultPlanes.xz]: 'XZ',
[engineCommandManager.defaultPlanes.yz]: 'YZ',
[engineCommandManager.defaultPlanes.negXy]: '-XY',
[engineCommandManager.defaultPlanes.negXz]: '-XZ',
[engineCommandManager.defaultPlanes.negYz]: '-YZ',
}
// TODO can we get this information from rust land when it creates the default planes?
// maybe returned from make_default_planes (src/wasm-lib/src/wasm.rs)
let zAxis: [number, number, number] = [0, 0, 1]
let yAxis: [number, number, number] = [0, 1, 0]
// get unit vector from camera position to target
const camVector = sceneInfra.camControls.camera.position
.clone()
.sub(sceneInfra.camControls.target)
if (engineCommandManager.defaultPlanes?.xy === _entity_id) {
zAxis = [0, 0, 1]
yAxis = [0, 1, 0]
if (camVector.z < 0) {
zAxis = [0, 0, -1]
_entity_id = engineCommandManager.defaultPlanes?.negXy || ''
}
} else if (engineCommandManager.defaultPlanes?.yz === _entity_id) {
zAxis = [1, 0, 0]
yAxis = [0, 0, 1]
if (camVector.x < 0) {
zAxis = [-1, 0, 0]
_entity_id = engineCommandManager.defaultPlanes?.negYz || ''
}
} else if (engineCommandManager.defaultPlanes?.xz === _entity_id) {
zAxis = [0, 1, 0]
yAxis = [0, 0, 1]
_entity_id = engineCommandManager.defaultPlanes?.negXz || ''
if (camVector.y < 0) {
zAxis = [0, -1, 0]
_entity_id = engineCommandManager.defaultPlanes?.xz || ''
}
}
sceneInfra.modelingSend({
type: 'Select default plane',
data: {
type: 'defaultPlane',
planeId: _entity_id,
plane: defaultPlaneStrMap[_entity_id],
zAxis,
yAxis,
},
})
return
}
const artifact = this.engineCommandManager.artifactMap[_entity_id]
// If we clicked on an extrude wall, we climb up the parent Id
// to get the sketch profile's face ID. If we clicked on an endcap,
// we already have it.
const targetId =
'additionalData' in artifact &&
artifact.additionalData?.type === 'cap'
? _entity_id
: artifact.parentId
// tsc cannot infer that target can have extrusions
// from the commandType (why?) so we need to cast it
const target = this.engineCommandManager.artifactMap?.[
targetId || ''
] as ArtifactMapCommand & { extrusions?: string[] }
// TODO: We get the first extrusion command ID,
// which is fine while backend systems only support one extrusion.
// but we need to more robustly handle resolving to the correct extrusion
// if there are multiple.
const extrusions =
this.engineCommandManager.artifactMap?.[target?.extrusions?.[0] || '']
if (artifact?.commandType !== 'solid3d_get_extrusion_face_info') return
const faceInfo = await getFaceDetails(_entity_id)
if (!faceInfo?.origin || !faceInfo?.z_axis || !faceInfo?.y_axis) return
const { z_axis, y_axis, origin } = faceInfo
const sketchPathToNode = getNodePathFromSourceRange(
kclManager.ast,
artifact.range
)
const extrudePathToNode = extrusions?.range
? getNodePathFromSourceRange(kclManager.ast, extrusions.range)
: []
sceneInfra.modelingSend({
type: 'Select default plane',
data: {
type: 'extrudeFace',
zAxis: [z_axis.x, z_axis.y, z_axis.z],
yAxis: [y_axis.x, y_axis.y, y_axis.z],
position: [origin.x, origin.y, origin.z].map(
(num) => num / sceneInfra._baseUnitMultiplier
) as [number, number, number],
sketchPathToNode,
extrudePathToNode,
cap:
artifact?.additionalData?.type === 'cap'
? artifact.additionalData.info
: 'none',
faceId: _entity_id,
},
})
return
},
})
}
mouseEnterLeaveCallbacks() { mouseEnterLeaveCallbacks() {
return { return {
onMouseEnter: ({ selected, dragSelected }: OnMouseEnterLeaveArgs) => { onMouseEnter: ({ selected, dragSelected }: OnMouseEnterLeaveArgs) => {
@ -1763,7 +1646,7 @@ function prepareTruncatedMemoryAndAst(
} }
| Error { | Error {
const bodyIndex = Number(sketchPathToNode?.[1]?.[0]) || 0 const bodyIndex = Number(sketchPathToNode?.[1]?.[0]) || 0
const _ast = JSON.parse(JSON.stringify(ast)) const _ast = structuredClone(ast)
const _node = getNodeFromPath<VariableDeclaration>( const _node = getNodeFromPath<VariableDeclaration>(
_ast, _ast,
@ -1773,7 +1656,7 @@ function prepareTruncatedMemoryAndAst(
if (err(_node)) return _node if (err(_node)) return _node
const variableDeclarationName = _node.node?.declarations?.[0]?.id?.name || '' const variableDeclarationName = _node.node?.declarations?.[0]?.id?.name || ''
const lastSeg = ( const lastSeg = (
programMemory.root[variableDeclarationName] as SketchGroup programMemory.get(variableDeclarationName) as SketchGroup
).value.slice(-1)[0] ).value.slice(-1)[0]
if (draftSegment) { if (draftSegment) {
// truncatedAst needs to setup with another segment at the end // truncatedAst needs to setup with another segment at the end
@ -1822,35 +1705,29 @@ function prepareTruncatedMemoryAndAst(
} }
const truncatedAst: Program = { const truncatedAst: Program = {
..._ast, ..._ast,
body: [JSON.parse(JSON.stringify(_ast.body[bodyIndex]))], body: [structuredClone(_ast.body[bodyIndex])],
} }
const programMemoryOverride = programMemoryInit()
if (err(programMemoryOverride)) return programMemoryOverride
// Grab all the TagDeclarators and TagIdentifiers from memory. // Grab all the TagDeclarators and TagIdentifiers from memory.
let start = _node.node.start let start = _node.node.start
for (const key in programMemory.root) { const programMemoryOverride = programMemory.filterVariables(true, (value) => {
const value = programMemory.root[key]
if (!('__meta' in value)) {
continue
}
if ( if (
!('__meta' in value) ||
value.__meta === undefined || value.__meta === undefined ||
value.__meta.length === 0 || value.__meta.length === 0 ||
value.__meta[0].sourceRange === undefined value.__meta[0].sourceRange === undefined
) { ) {
continue return false
} }
if (value.__meta[0].sourceRange[0] >= start) { if (value.__meta[0].sourceRange[0] >= start) {
// We only want things before our start point. // We only want things before our start point.
continue return false
} }
if (value.type === 'TagIdentifier') { return value.type === 'TagIdentifier'
programMemoryOverride.root[key] = JSON.parse(JSON.stringify(value)) })
} 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]
@ -1858,12 +1735,12 @@ function prepareTruncatedMemoryAndAst(
continue continue
} }
const name = node.declarations[0].id.name const name = node.declarations[0].id.name
// const memoryItem = kclManager.programMemory.root[name] const memoryItem = programMemory.get(name)
const memoryItem = programMemory.root[name]
if (!memoryItem) { if (!memoryItem) {
continue continue
} }
programMemoryOverride.root[name] = JSON.parse(JSON.stringify(memoryItem)) const error = programMemoryOverride.set(name, structuredClone(memoryItem))
if (err(error)) return error
} }
return { return {
truncatedAst, truncatedAst,
@ -1900,7 +1777,7 @@ export function sketchGroupFromPathToNode({
) )
if (err(_varDec)) return _varDec if (err(_varDec)) return _varDec
const varDec = _varDec.node const varDec = _varDec.node
const result = programMemory.root[varDec?.id?.name || ''] const result = programMemory.get(varDec?.id?.name || '')
if (result?.type === 'ExtrudeGroup') { if (result?.type === 'ExtrudeGroup') {
return result.sketchGroup return result.sketchGroup
} }
@ -2026,13 +1903,17 @@ export async function getFaceDetails(
entity_id: entityId, entity_id: entityId,
}, },
}) })
const faceInfo: Models['GetSketchModePlane_type'] = ( const resp = await engineCommandManager.sendSceneCommand({
await engineCommandManager.sendSceneCommand({ type: 'modeling_cmd_req',
type: 'modeling_cmd_req', cmd_id: uuidv4(),
cmd_id: uuidv4(), cmd: { type: 'get_sketch_mode_plane' },
cmd: { type: 'get_sketch_mode_plane' }, })
}) const faceInfo =
)?.data?.data resp?.success &&
resp?.resp.type === 'modeling' &&
resp?.resp?.data?.modeling_response?.type === 'get_sketch_mode_plane'
? resp?.resp?.data?.modeling_response.data
: ({} as Models['GetSketchModePlane_type'])
await engineCommandManager.sendSceneCommand({ await engineCommandManager.sendSceneCommand({
type: 'modeling_cmd_req', type: 'modeling_cmd_req',
cmd_id: uuidv4(), cmd_id: uuidv4(),

View File

@ -11,10 +11,8 @@ import {
Raycaster, Raycaster,
Vector2, Vector2,
Group, Group,
PlaneGeometry,
MeshBasicMaterial, MeshBasicMaterial,
Mesh, Mesh,
DoubleSide,
Intersection, Intersection,
Object3D, Object3D,
Object3DEventMap, Object3DEventMap,
@ -48,7 +46,6 @@ export const DEBUG_SHOW_INTERSECTION_PLANE: false = false
export const DEBUG_SHOW_BOTH_SCENES: false = false export const DEBUG_SHOW_BOTH_SCENES: false = false
export const RAYCASTABLE_PLANE = 'raycastable-plane' export const RAYCASTABLE_PLANE = 'raycastable-plane'
export const DEFAULT_PLANES = 'default-planes'
export const X_AXIS = 'xAxis' export const X_AXIS = 'xAxis'
export const Y_AXIS = 'yAxis' export const Y_AXIS = 'yAxis'
@ -72,7 +69,7 @@ interface OnDragCallbackArgs extends OnMouseEnterLeaveArgs {
} }
intersects: Intersection<Object3D<Object3DEventMap>>[] intersects: Intersection<Object3D<Object3DEventMap>>[]
} }
interface OnClickCallbackArgs { export interface OnClickCallbackArgs {
mouseEvent: MouseEvent mouseEvent: MouseEvent
intersectionPoint?: { intersectionPoint?: {
twoD: Vector2 twoD: Vector2
@ -325,16 +322,9 @@ export class SceneInfra {
this.camControls.camera, this.camControls.camera,
this.camControls.target this.camControls.target
) )
const planesGroup = this.scene.getObjectByName(DEFAULT_PLANES)
const axisGroup = this.scene const axisGroup = this.scene
.getObjectByName(AXIS_GROUP) .getObjectByName(AXIS_GROUP)
?.getObjectByName('gridHelper') ?.getObjectByName('gridHelper')
planesGroup &&
planesGroup.scale.set(
scale / this._baseUnitMultiplier,
scale / this._baseUnitMultiplier,
scale / this._baseUnitMultiplier
)
axisGroup?.name === 'gridHelper' && axisGroup.scale.set(scale, scale, scale) axisGroup?.name === 'gridHelper' && axisGroup.scale.set(scale, scale, scale)
} }
@ -632,59 +622,6 @@ export class SceneInfra {
this.onClickCallback({ mouseEvent, intersects }) this.onClickCallback({ mouseEvent, intersects })
} }
} }
showDefaultPlanes() {
const addPlane = (
rotation: { x: number; y: number; z: number }, //
type: DefaultPlane
): Mesh => {
const planeGeometry = new PlaneGeometry(100, 100)
const planeMaterial = new MeshBasicMaterial({
color: defaultPlaneColor(type),
transparent: true,
opacity: 0.0,
side: DoubleSide,
depthTest: false, // needed to avoid transparency issues
})
const plane = new Mesh(planeGeometry, planeMaterial)
plane.rotation.x = rotation.x
plane.rotation.y = rotation.y
plane.rotation.z = rotation.z
plane.userData.type = type
plane.name = type
return plane
}
const planes = [
addPlane({ x: 0, y: Math.PI / 2, z: 0 }, YZ_PLANE),
addPlane({ x: 0, y: 0, z: 0 }, XY_PLANE),
addPlane({ x: -Math.PI / 2, y: 0, z: 0 }, XZ_PLANE),
]
const planesGroup = new Group()
planesGroup.userData.type = DEFAULT_PLANES
planesGroup.name = DEFAULT_PLANES
planesGroup.add(...planes)
planesGroup.traverse((child) => {
if (child instanceof Mesh) {
child.layers.enable(SKETCH_LAYER)
}
})
planesGroup.layers.enable(SKETCH_LAYER)
const sceneScale = getSceneScale(
this.camControls.camera,
this.camControls.target
)
planesGroup.scale.set(
sceneScale / this._baseUnitMultiplier,
sceneScale / this._baseUnitMultiplier,
sceneScale / this._baseUnitMultiplier
)
this.scene.add(planesGroup)
}
removeDefaultPlanes() {
const planesGroup = this.scene.children.find(
({ userData }) => userData.type === DEFAULT_PLANES
)
if (planesGroup) this.scene.remove(planesGroup)
}
updateOtherSelectionColors = (otherSelections: Axis[]) => { updateOtherSelectionColors = (otherSelections: Axis[]) => {
const axisGroup = this.scene.children.find( const axisGroup = this.scene.children.find(
({ userData }) => userData?.type === AXIS_GROUP ({ userData }) => userData?.type === AXIS_GROUP
@ -742,28 +679,3 @@ function baseUnitTomm(baseUnit: BaseUnit) {
return 914.4 return 914.4
} }
} }
export type DefaultPlane =
| 'xy-default-plane'
| 'xz-default-plane'
| 'yz-default-plane'
export const XY_PLANE: DefaultPlane = 'xy-default-plane'
export const XZ_PLANE: DefaultPlane = 'xz-default-plane'
export const YZ_PLANE: DefaultPlane = 'yz-default-plane'
export function defaultPlaneColor(
plane: DefaultPlane,
lowCh = 0.1,
highCh = 0.7
): Color {
switch (plane) {
case XY_PLANE:
return new Color(highCh, lowCh, lowCh)
case XZ_PLANE:
return new Color(lowCh, lowCh, highCh)
case YZ_PLANE:
return new Color(lowCh, highCh, lowCh)
}
return new Color(lowCh, lowCh, lowCh)
}

View File

@ -1,56 +1,93 @@
import { Popover } from '@headlessui/react' import { Popover } from '@headlessui/react'
import { ActionButton, ActionButtonProps } from './ActionButton' import { ActionButtonProps } from './ActionButton'
import { CustomIcon } from './CustomIcon'
type ActionButtonSplitProps = Omit<ActionButtonProps, 'iconEnd'> & { type ActionButtonSplitProps = ActionButtonProps & { Element: 'button' } & {
name?: string
splitMenuItems: { splitMenuItems: {
id: string
label: string label: string
shortcut?: string shortcut?: string
onClick: () => void onClick: () => void
disabled?: boolean disabled?: boolean
status?: 'available' | 'unavailable' | 'kcl-only'
}[] }[]
} }
export function ActionButtonDropdown({ export function ActionButtonDropdown({
splitMenuItems, splitMenuItems,
className, className,
children,
...props ...props
}: ActionButtonSplitProps) { }: ActionButtonSplitProps) {
const baseClassNames = `action-button p-0 m-0 group mono text-xs leading-none flex items-center gap-2 rounded-sm border-solid border border-chalkboard-30 hover:border-chalkboard-40 enabled:dark:border-chalkboard-70 dark:hover:border-chalkboard-60 dark:bg-chalkboard-90/50 text-chalkboard-100 dark:text-chalkboard-10`
return ( return (
<Popover className="relative"> <Popover className={`${baseClassNames} ${className}`}>
<Popover.Button {({ close }) => (
as={ActionButton} <>
className={className} {children}
{...props} <Popover.Button className="border-transparent dark:border-transparent p-0 m-0 rounded-none !outline-none ui-open:border-primary ui-open:bg-primary">
Element="button" <CustomIcon
iconEnd={{ name="caretDown"
icon: 'caretDown', className={
className: 'ui-open:rotate-180', 'w-3.5 h-5 text-chalkboard-70 dark:text-chalkboard-40 rounded-none ' +
bgClassName: 'ui-open:rotate-180 ui-open:!text-chalkboard-10'
'bg-chalkboard-20 dark:bg-chalkboard-80 ui-open:bg-primary ui-open:text-chalkboard-10', }
}} />
/> <span className="sr-only">
<Popover.Panel {props.name ? props.name + ': ' : ''}open menu
as="ul" </span>
className="absolute z-20 left-1/2 -translate-x-1/2 top-full mt-1 w-fit max-h-[80vh] overflow-y-auto py-2 flex flex-col gap-1 align-stretch text-inherit dark:text-chalkboard-10 bg-chalkboard-10 dark:bg-chalkboard-100 rounded shadow-lg border border-solid border-chalkboard-30 dark:border-chalkboard-80 text-sm m-0 p-0" </Popover.Button>
> <Popover.Panel
{splitMenuItems.map((item) => ( as="ul"
<li className="contents" key={item.label}> className="!pointer-events-auto absolute z-20 left-1/2 -translate-x-1/2 top-full mt-4 w-fit max-w-[280px] max-h-[80vh] overflow-y-auto py-2 flex flex-col align-stretch text-inherit dark:text-chalkboard-10 bg-chalkboard-10 dark:bg-chalkboard-100 rounded shadow-lg border border-solid border-chalkboard-30 dark:border-chalkboard-80 text-sm m-0 p-0"
<button >
onClick={item.onClick} {splitMenuItems.map((item) => (
className="block px-3 py-1 hover:bg-primary/10 dark:hover:bg-chalkboard-80 border-0 m-0 text-sm w-full rounded-none text-left disabled:!bg-transparent dark:disabled:text-chalkboard-60" <li className="contents" key={item.label}>
disabled={item.disabled} <button
data-testid={item.label} onClick={() => {
> item.onClick()
<span className="capitalize">{item.label}</span> // Close the popover
{item.shortcut && ( close()
<kbd className="bg-primary/10 dark:bg-chalkboard-80 dark:group-hover:bg-primary font-mono rounded-sm dark:text-inherit inline-block px-1 border-primary dark:border-chalkboard-90"> }}
{item.shortcut} className="group/button flex items-center gap-6 px-3 py-1 font-sans text-xs hover:bg-primary/10 dark:hover:bg-chalkboard-80 border-0 m-0 w-full rounded-none text-left disabled:!bg-transparent dark:disabled:text-chalkboard-60"
</kbd> disabled={item.disabled}
)} data-testid={'dropdown-' + item.id}
</button> >
</li> <span className="capitalize flex-grow text-left">
))} {item.label}
</Popover.Panel> </span>
{item.status === 'unavailable' ? (
<div className="flex flex-none items-center gap-1">
<span className="text-chalkboard-70 dark:text-chalkboard-40">
In development
</span>
<CustomIcon
name="lockClosed"
className="w-4 h-4 text-chalkboard-70 dark:text-chalkboard-40"
/>
</div>
) : item.status === 'kcl-only' ? (
<div className="flex flex-none items-center gap-1">
<span className="text-chalkboard-70 dark:text-chalkboard-40">
KCL code only
</span>
<CustomIcon
name="code"
className="w-4 h-4 text-chalkboard-70 dark:text-chalkboard-40"
/>
</div>
) : item.shortcut ? (
<kbd className="hotkey flex-none group-disabled/button:text-chalkboard-50 dark:group-disabled/button:text-chalkboard-70 group-disabled/button:border-chalkboard-20 dark:group-disabled/button:border-chalkboard-80">
{item.shortcut}
</kbd>
) : null}
</button>
</li>
))}
</Popover.Panel>
</>
)}
</Popover> </Popover>
) )
} }

View File

@ -30,7 +30,7 @@ export const AppHeader = ({
className={ className={
'w-full grid ' + 'w-full grid ' +
styles.header + styles.header +
' overlaid-panes sticky top-0 z-20 px-2 items-center ' + ' overlaid-panes sticky top-0 z-20 px-2 items-start ' +
className className
} }
> >
@ -49,9 +49,9 @@ export const AppHeader = ({
<> <>
<CommandBarOpenButton /> <CommandBarOpenButton />
<RefreshButton /> <RefreshButton />
<UserSidebarMenu user={user} />
</> </>
)} )}
<UserSidebarMenu user={user} />
</div> </div>
</header> </header>
) )

View File

@ -1,5 +1,5 @@
import { useEffect, useState, useRef } from 'react' import { useEffect, useState, useRef } from 'react'
import { parse, BinaryPart, Value } from '../lang/wasm' import { parse, BinaryPart, Value, ProgramMemory } from '../lang/wasm'
import { import {
createIdentifier, createIdentifier,
createLiteral, createLiteral,
@ -120,8 +120,7 @@ export function useCalc({
}, []) }, [])
useEffect(() => { useEffect(() => {
const allVarNames = Object.keys(programMemory.root) if (programMemory.has(newVariableName)) {
if (allVarNames.includes(newVariableName)) {
setIsNewVariableNameUnique(false) setIsNewVariableNameUnique(false)
} else { } else {
setIsNewVariableNameUnique(true) setIsNewVariableNameUnique(true)
@ -143,17 +142,20 @@ export function useCalc({
const code = `const __result__ = ${value}` const code = `const __result__ = ${value}`
const ast = parse(code) const ast = parse(code)
if (trap(ast)) return if (trap(ast)) return
const _programMem: any = { root: {}, return: null } const _programMem: ProgramMemory = ProgramMemory.empty()
availableVarInfo.variables.forEach(({ key, value }) => { for (const { key, value } of availableVarInfo.variables) {
_programMem.root[key] = { type: 'userVal', value, __meta: [] } const error = _programMem.set(key, {
}) type: 'UserVal',
value,
__meta: [],
})
if (trap(error)) return
}
executeAst({ executeAst({
ast, ast,
engineCommandManager, engineCommandManager,
useFakeExecutor: true, useFakeExecutor: true,
programMemoryOverride: JSON.parse( programMemoryOverride: kclManager.programMemory.clone(),
JSON.stringify(kclManager.programMemory)
),
}).then(({ programMemory }) => { }).then(({ programMemory }) => {
const resultDeclaration = ast.body.find( const resultDeclaration = ast.body.find(
(a) => (a) =>
@ -163,7 +165,7 @@ export function useCalc({
const init = const init =
resultDeclaration?.type === 'VariableDeclaration' && resultDeclaration?.type === 'VariableDeclaration' &&
resultDeclaration?.declarations?.[0]?.init resultDeclaration?.declarations?.[0]?.init
const result = programMemory?.root?.__result__?.value const result = programMemory?.get('__result__')?.value
setCalcResult(typeof result === 'number' ? String(result) : 'NAN') setCalcResult(typeof result === 'number' ? String(result) : 'NAN')
init && setValueNode(init) init && setValueNode(init)
}) })

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