Compare commits

...

63 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
170 changed files with 5475 additions and 3899 deletions

View File

@ -124,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: {
@ -166,7 +166,7 @@ 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,
@ -180,7 +180,7 @@ const extrusion = extrude(5, sketch001)
} | } |
{ {
// 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,
@ -198,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,

View File

@ -128,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: {
@ -170,7 +170,7 @@ 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,
@ -184,7 +184,7 @@ const extrusion = extrude(5, sketch001)
} | } |
{ {
// 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,
@ -202,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,

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,7 +85,7 @@ 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,
@ -99,7 +99,7 @@ const example = extrude(10, exampleSketch)
} | } |
{ {
// 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,
@ -117,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,
@ -455,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: {
@ -497,7 +497,7 @@ 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,
@ -511,7 +511,7 @@ const example = extrude(10, exampleSketch)
} | } |
{ {
// 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,
@ -529,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,

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,7 +84,7 @@ 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,
@ -98,7 +98,7 @@ const extrusion = extrude(10, sketch001)
} | } |
{ {
// 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,
@ -116,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,
@ -454,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: {
@ -496,7 +496,7 @@ 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,
@ -510,7 +510,7 @@ const extrusion = extrude(10, sketch001)
} | } |
{ {
// 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,
@ -528,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,

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,7 +86,7 @@ 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,
@ -100,7 +100,7 @@ const example = extrude(10, exampleSketch)
} | } |
{ {
// 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 +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,
@ -456,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: {
@ -498,7 +498,7 @@ 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,
@ -512,7 +512,7 @@ const example = extrude(10, exampleSketch)
} | } |
{ {
// 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,
@ -530,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,

View File

@ -136,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: {
@ -178,7 +178,7 @@ 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,
@ -192,7 +192,7 @@ const example = extrude(10, exampleSketch)
} | } |
{ {
// 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,
@ -210,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,
@ -548,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: {
@ -590,7 +590,7 @@ 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,
@ -604,7 +604,7 @@ const example = extrude(10, exampleSketch)
} | } |
{ {
// 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,
@ -622,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,

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,7 +83,7 @@ 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,
@ -97,7 +97,7 @@ const example = extrude(10, exampleSketch)
} | } |
{ {
// 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 +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,
@ -453,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: {
@ -495,7 +495,7 @@ 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,
@ -509,7 +509,7 @@ const example = extrude(10, exampleSketch)
} | } |
{ {
// 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,
@ -527,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,

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,7 +83,7 @@ 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,
@ -97,7 +97,7 @@ const example = extrude(10, exampleSketch)
} | } |
{ {
// 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 +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,
@ -453,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: {
@ -495,7 +495,7 @@ 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,
@ -509,7 +509,7 @@ const example = extrude(10, exampleSketch)
} | } |
{ {
// 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,
@ -527,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,

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,7 +94,7 @@ 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,
@ -108,7 +108,7 @@ const exampleSketch = startSketchOn('XZ')
} | } |
{ {
// 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,
@ -126,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,
@ -464,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: {
@ -506,7 +506,7 @@ 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,
@ -520,7 +520,7 @@ const exampleSketch = startSketchOn('XZ')
} | } |
{ {
// 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,
@ -538,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,

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,7 +89,7 @@ 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,
@ -103,7 +103,7 @@ const example = extrude(10, exampleSketch)
} | } |
{ {
// 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 +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,
@ -459,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: {
@ -501,7 +501,7 @@ 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,
@ -515,7 +515,7 @@ const example = extrude(10, exampleSketch)
} | } |
{ {
// 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,
@ -533,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,

View File

@ -149,7 +149,7 @@ 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,
@ -163,7 +163,7 @@ const mountingPlate = extrude(thickness, mountingPlateSketch)
} | } |
{ {
// 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,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: {
@ -223,7 +223,7 @@ 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,
@ -237,7 +237,7 @@ const mountingPlate = extrude(thickness, mountingPlateSketch)
} | } |
{ {
// 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,
@ -549,7 +549,7 @@ 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,
@ -563,7 +563,7 @@ const mountingPlate = extrude(thickness, mountingPlateSketch)
} | } |
{ {
// 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,
@ -581,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: {
@ -623,7 +623,7 @@ 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,
@ -637,7 +637,7 @@ const mountingPlate = extrude(thickness, mountingPlateSketch)
} | } |
{ {
// 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,

View File

@ -82,7 +82,7 @@ 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,
@ -96,7 +96,7 @@ const example = extrude(5, exampleSketch)
} | } |
{ {
// 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 +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,
@ -324,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: {
@ -366,7 +366,7 @@ 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,
@ -380,7 +380,7 @@ const example = extrude(5, exampleSketch)
} | } |
{ {
// 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,
@ -619,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: {
@ -661,7 +661,7 @@ 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,
@ -675,7 +675,7 @@ const example = extrude(5, exampleSketch)
} | } |
{ {
// 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,
@ -693,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,

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,7 +84,7 @@ 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,
@ -98,7 +98,7 @@ const example = extrude(10, exampleSketch)
} | } |
{ {
// 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,
@ -116,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,
@ -454,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: {
@ -496,7 +496,7 @@ 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,
@ -510,7 +510,7 @@ const example = extrude(10, exampleSketch)
} | } |
{ {
// 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,
@ -528,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,

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,7 +109,7 @@ 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,
@ -123,7 +123,7 @@ const example = extrude(10, exampleSketch)
} | } |
{ {
// 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,
@ -141,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,
@ -479,7 +479,7 @@ 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,
@ -493,7 +493,7 @@ const example = extrude(10, exampleSketch)
} | } |
{ {
// 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,
@ -511,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: {
@ -553,7 +553,7 @@ 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,
@ -567,7 +567,7 @@ const example = extrude(10, exampleSketch)
} | } |
{ {
// 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,

View File

@ -149,7 +149,7 @@ 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,
@ -163,7 +163,7 @@ const mountingPlate = extrude(thickness, mountingPlateSketch)
} | } |
{ {
// 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,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: {
@ -223,7 +223,7 @@ 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,
@ -237,7 +237,7 @@ const mountingPlate = extrude(thickness, mountingPlateSketch)
} | } |
{ {
// 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,
@ -549,7 +549,7 @@ 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,
@ -563,7 +563,7 @@ const mountingPlate = extrude(thickness, mountingPlateSketch)
} | } |
{ {
// 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,
@ -581,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: {
@ -623,7 +623,7 @@ 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,
@ -637,7 +637,7 @@ const mountingPlate = extrude(thickness, mountingPlateSketch)
} | } |
{ {
// 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,

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,7 +50,7 @@ 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,
@ -65,7 +64,7 @@ const part001 = startSketchOn('XY')
} | } |
{ {
// 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,
@ -83,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: {
@ -125,7 +124,7 @@ 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,
@ -139,7 +138,7 @@ const part001 = startSketchOn('XY')
} | } |
{ {
// 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,
@ -442,7 +441,7 @@ 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,
@ -456,7 +455,7 @@ const part001 = startSketchOn('XY')
} | } |
{ {
// 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 +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: {
@ -516,7 +515,7 @@ 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,
@ -530,7 +529,7 @@ const part001 = startSketchOn('XY')
} | } |
{ {
// 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,

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,7 +95,7 @@ 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,
@ -109,7 +109,7 @@ const example = extrude(1, exampleSketch)
} | } |
{ {
// 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 +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,
@ -457,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: {
@ -499,7 +499,7 @@ 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,
@ -513,7 +513,7 @@ const example = extrude(1, exampleSketch)
} | } |
{ {
// 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,
@ -531,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,
@ -860,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: {
@ -902,7 +902,7 @@ 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,
@ -916,7 +916,7 @@ const example = extrude(1, exampleSketch)
} | } |
{ {
// 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,
@ -934,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,

View File

@ -62,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)

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,7 +75,7 @@ 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,
@ -89,7 +89,7 @@ const example = extrude(5, exampleSketch)
} | } |
{ {
// 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,
@ -107,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,

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,7 +75,7 @@ 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,
@ -89,7 +89,7 @@ const example = extrude(5, exampleSketch)
} | } |
{ {
// 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,
@ -107,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,

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,7 +88,7 @@ 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,
@ -102,7 +102,7 @@ const example = extrude(5, exampleSketch)
} | } |
{ {
// 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 +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,
@ -458,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: {
@ -500,7 +500,7 @@ 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,
@ -514,7 +514,7 @@ const example = extrude(5, exampleSketch)
} | } |
{ {
// 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,
@ -532,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,

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,7 +75,7 @@ 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,
@ -89,7 +89,7 @@ const example = extrude(5, exampleSketch)
} | } |
{ {
// 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,
@ -107,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,
@ -445,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: {
@ -487,7 +487,7 @@ 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,
@ -501,7 +501,7 @@ const example = extrude(5, exampleSketch)
} | } |
{ {
// 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,
@ -519,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,

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,7 +93,7 @@ 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,
@ -107,7 +107,7 @@ const example = extrude(1, exampleSketch)
} | } |
{ {
// 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,
@ -125,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,

View File

@ -55,7 +55,7 @@ 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,
@ -69,7 +69,7 @@ const example = extrude(-5, exampleSketch)
} | } |
{ {
// 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,
@ -87,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: {
@ -129,7 +129,7 @@ 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,
@ -143,7 +143,7 @@ const example = extrude(-5, exampleSketch)
} | } |
{ {
// 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,

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,7 +86,7 @@ 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,
@ -100,7 +100,7 @@ const example = extrude(1, exampleSketch)
} | } |
{ {
// 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 +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,

View File

@ -53,7 +53,7 @@ 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,
@ -67,7 +67,7 @@ const example = extrude(1, exampleSketch)
} | } |
{ {
// 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,
@ -85,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: {
@ -127,7 +127,7 @@ 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,
@ -141,7 +141,7 @@ const example = extrude(1, exampleSketch)
} | } |
{ {
// 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,

View File

@ -55,7 +55,7 @@ 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,
@ -69,7 +69,7 @@ let vase = layer()
} | } |
{ {
// 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,
@ -87,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: {
@ -129,7 +129,7 @@ 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,
@ -143,7 +143,7 @@ let vase = layer()
} | } |
{ {
// 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,

48
docs/kcl/polar.md Normal file

File diff suppressed because one or more lines are too long

View File

@ -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,7 +76,7 @@ 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,
@ -90,7 +90,7 @@ const sketch001 = startSketchOn('XY')
} | } |
{ {
// 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 +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,

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,7 +71,7 @@ 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,
@ -85,7 +85,7 @@ const sketch001 = startSketchOn('XY')
} | } |
{ {
// 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,
@ -103,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,

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,7 +70,7 @@ 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,
@ -84,7 +84,7 @@ const sketch001 = startSketchOn('XY')
} | } |
{ {
// 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 +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,

View File

@ -250,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: {
@ -292,7 +292,7 @@ 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,
@ -306,7 +306,7 @@ uuid |
} | } |
{ {
// 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,
@ -324,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,
@ -658,7 +658,7 @@ 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,
@ -672,7 +672,7 @@ uuid |
} | } |
{ {
// 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,
@ -690,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: {
@ -732,7 +732,7 @@ 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,
@ -746,7 +746,7 @@ uuid |
} | } |
{ {
// 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,

View File

@ -137,7 +137,7 @@ 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,
@ -151,7 +151,7 @@ shell({ faces: ['end'], thickness: 0.25 }, firstSketch)
} | } |
{ {
// 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,
@ -169,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: {
@ -211,7 +211,7 @@ 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,
@ -225,7 +225,7 @@ shell({ faces: ['end'], thickness: 0.25 }, firstSketch)
} | } |
{ {
// 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,
@ -528,7 +528,7 @@ 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,
@ -542,7 +542,7 @@ shell({ faces: ['end'], thickness: 0.25 }, firstSketch)
} | } |
{ {
// 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 +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: {
@ -602,7 +602,7 @@ 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,
@ -616,7 +616,7 @@ shell({ faces: ['end'], thickness: 0.25 }, firstSketch)
} | } |
{ {
// 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,

View File

@ -97,7 +97,7 @@ 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,
@ -111,7 +111,7 @@ const example = extrude(5, exampleSketch)
} | } |
{ {
// 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,
@ -129,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: {
@ -411,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: {
@ -453,7 +453,7 @@ 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,
@ -467,7 +467,7 @@ const example = extrude(5, exampleSketch)
} | } |
{ {
// 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 +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,

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,7 +101,7 @@ 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,
@ -115,7 +115,7 @@ const example = extrude(5, exampleSketch)
} | } |
{ {
// 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,
@ -133,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,

View File

@ -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,7 +166,7 @@ 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,
@ -180,7 +180,7 @@ const a1 = startSketchOn({
} | } |
{ {
// 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,
@ -198,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: {
@ -578,7 +578,7 @@ 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,
@ -592,7 +592,7 @@ const a1 = startSketchOn({
} | } |
{ {
// 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,
@ -610,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: {

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,7 +84,7 @@ 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,
@ -98,7 +98,7 @@ const example = extrude(10, exampleSketch)
} | } |
{ {
// 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,
@ -116,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,
@ -454,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: {
@ -496,7 +496,7 @@ 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,
@ -510,7 +510,7 @@ const example = extrude(10, exampleSketch)
} | } |
{ {
// 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,
@ -528,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,

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,7 +75,7 @@ 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,
@ -89,7 +89,7 @@ const example = extrude(10, exampleSketch)
} | } |
{ {
// 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,
@ -107,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,
@ -445,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: {
@ -487,7 +487,7 @@ 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,
@ -501,7 +501,7 @@ const example = extrude(10, exampleSketch)
} | } |
{ {
// 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,
@ -519,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,

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,7 +78,7 @@ 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,
@ -92,7 +92,7 @@ const example = extrude(10, exampleSketch)
} | } |
{ {
// 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 +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,
@ -448,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: {
@ -490,7 +490,7 @@ 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,
@ -504,7 +504,7 @@ const example = extrude(10, exampleSketch)
} | } |
{ {
// 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,
@ -522,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,

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,7 +78,7 @@ 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,
@ -92,7 +92,7 @@ const example = extrude(10, exampleSketch)
} | } |
{ {
// 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 +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,
@ -448,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: {
@ -490,7 +490,7 @@ 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,
@ -504,7 +504,7 @@ const example = extrude(10, exampleSketch)
} | } |
{ {
// 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,
@ -522,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,

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,7 +76,7 @@ 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,
@ -90,7 +90,7 @@ const example = extrude(10, exampleSketch)
} | } |
{ {
// 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 +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,
@ -446,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: {
@ -488,7 +488,7 @@ 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,
@ -502,7 +502,7 @@ const example = extrude(10, exampleSketch)
} | } |
{ {
// 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,
@ -520,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,

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,7 +74,7 @@ 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,
@ -88,7 +88,7 @@ const example = extrude(5, exampleSketch)
} | } |
{ {
// 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 +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,
@ -444,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: {
@ -486,7 +486,7 @@ 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,
@ -500,7 +500,7 @@ const example = extrude(5, exampleSketch)
} | } |
{ {
// 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,
@ -518,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,

View File

@ -925,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()
@ -1045,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 }) => {
@ -2265,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)
@ -3975,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')
@ -4132,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
@ -7243,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')
@ -8047,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')
})

Binary file not shown.

Before

Width:  |  Height:  |  Size: 48 KiB

After

Width:  |  Height:  |  Size: 48 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 46 KiB

After

Width:  |  Height:  |  Size: 45 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 54 KiB

After

Width:  |  Height:  |  Size: 54 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 48 KiB

After

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 36 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: 16 KiB

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 31 KiB

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 46 KiB

After

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 63 KiB

After

Width:  |  Height:  |  Size: 62 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 31 KiB

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 34 KiB

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 34 KiB

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 33 KiB

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 37 KiB

After

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 31 KiB

After

Width:  |  Height:  |  Size: 31 KiB

View File

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

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.4", "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

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

@ -17,8 +17,8 @@ import type {
PluginSpec, PluginSpec,
ViewPlugin, ViewPlugin,
} from '@codemirror/view' } from '@codemirror/view'
import { setDiagnosticsEffect } from '@codemirror/lint'
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'
@ -36,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, '')
@ -216,20 +215,6 @@ export class LanguageServerPlugin implements PluginValue {
if (!this.client.ready) return if (!this.client.ready) return
// TODO(paultag): This is the *wrong* place for this to live.
//
// We need to clear diagnostics before updating the code, because
// if the code shrinks, the errors/diagnostics can go out of range
// of the source code, which cause an exception, breaking all the
// things.
//
// We need some sort of clear diagnostics boolean on the editor
// and we can drop this.
this.view.dispatch({
effects: [setDiagnosticsEffect.of([])],
annotations: [],
})
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({
@ -587,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: {

204
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.71", "syn 2.0.72",
] ]
[[package]] [[package]]
@ -367,7 +367,7 @@ checksum = "6e0c28dcc82d7c8ead5cb13beb15405b57b8546e93215673ff8ca0349a028107"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.71", "syn 2.0.72",
] ]
[[package]] [[package]]
@ -407,7 +407,7 @@ checksum = "3c87f3f15e7794432337fc718554eaa4dc8f04c9677a950ffe366f20a162ae42"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.71", "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.71", "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.71", "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.71", "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.71", "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.71", "syn 2.0.72",
] ]
[[package]] [[package]]
@ -1118,7 +1124,7 @@ checksum = "a668eda54683121533a393014d8692171709ff57a7d61f187b6e782719f8933f"
dependencies = [ dependencies = [
"darling_core", "darling_core",
"quote", "quote",
"syn 2.0.71", "syn 2.0.72",
] ]
[[package]] [[package]]
@ -1179,7 +1185,7 @@ checksum = "4078275de501a61ceb9e759d37bdd3d7210e654dbc167ac1a3678ef4435ed57b"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.71", "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.71", "syn 2.0.72",
] ]
[[package]] [[package]]
@ -1227,7 +1233,7 @@ checksum = "67e77553c4162a157adbf834ebae5b415acbecbeafc7a74b0e886657506a7611"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.71", "syn 2.0.72",
] ]
[[package]] [[package]]
@ -1288,7 +1294,7 @@ checksum = "487585f4d0c6655fe74905e2504d8ad6908e4db67f744eb140876906c2f3175d"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.71", "syn 2.0.72",
] ]
[[package]] [[package]]
@ -1320,7 +1326,7 @@ checksum = "f2b99bf03862d7f545ebc28ddd33a665b50865f4dfd84031a393823879bd4c54"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.71", "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.71", "syn 2.0.72",
] ]
[[package]] [[package]]
@ -1588,7 +1594,7 @@ checksum = "1a5c6c585bc94aaf2c7b51dd4c2ba22680844aba4c687be581871a6f518c5742"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.71", "syn 2.0.72",
] ]
[[package]] [[package]]
@ -1704,7 +1710,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.71", "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.71", "syn 2.0.72",
] ]
[[package]] [[package]]
@ -2008,7 +2014,7 @@ dependencies = [
"inflections", "inflections",
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.71", "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.71", "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.2.0" 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",
@ -3368,7 +3389,7 @@ dependencies = [
"regex", "regex",
"regex-syntax 0.8.3", "regex-syntax 0.8.3",
"structmeta", "structmeta",
"syn 2.0.71", "syn 2.0.72",
] ]
[[package]] [[package]]
@ -3487,7 +3508,7 @@ dependencies = [
"phf_shared 0.11.2", "phf_shared 0.11.2",
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.71", "syn 2.0.72",
] ]
[[package]] [[package]]
@ -3519,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",
@ -3555,7 +3576,7 @@ checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.71", "syn 2.0.72",
] ]
[[package]] [[package]]
@ -4429,7 +4450,7 @@ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"serde_derive_internals", "serde_derive_internals",
"syn 2.0.71", "syn 2.0.72",
] ]
[[package]] [[package]]
@ -4549,7 +4570,7 @@ checksum = "e0cd7e117be63d3c3678776753929474f3b04a43a080c744d6b0ae2a8c28e222"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.71", "syn 2.0.72",
] ]
[[package]] [[package]]
@ -4560,17 +4581,18 @@ checksum = "330f01ce65a3a5fe59a60c82f3c9a024b573b8a6e875bd233fe5f934e71d54e3"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.71", "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",
] ]
@ -4593,14 +4615,14 @@ checksum = "6c64451ba24fc7a6a2d60fc75dd9c83c90903b19028d4eff35e88fc1e86564e9"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.71", "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",
] ]
@ -4614,7 +4636,7 @@ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"serde", "serde",
"syn 2.0.71", "syn 2.0.72",
] ]
[[package]] [[package]]
@ -4656,7 +4678,7 @@ dependencies = [
"darling", "darling",
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.71", "syn 2.0.72",
] ]
[[package]] [[package]]
@ -4924,7 +4946,7 @@ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"structmeta-derive", "structmeta-derive",
"syn 2.0.71", "syn 2.0.72",
] ]
[[package]] [[package]]
@ -4935,7 +4957,7 @@ checksum = "152a0b65a590ff6c3da95cabe2353ee04e6167c896b28e3b14478c2636c922fc"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.71", "syn 2.0.72",
] ]
[[package]] [[package]]
@ -4957,7 +4979,7 @@ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"rustversion", "rustversion",
"syn 2.0.71", "syn 2.0.72",
] ]
[[package]] [[package]]
@ -4990,9 +5012,9 @@ dependencies = [
[[package]] [[package]]
name = "syn" name = "syn"
version = "2.0.71" 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 = "b146dcf730474b4bcd16c311627b31ede9ab149045db4d6088b3becaea046462" checksum = "dc4b9b9bf2add8093d3f2c0204471e951b2285580335de42f9d2534f3ae7a8af"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
@ -5008,7 +5030,7 @@ dependencies = [
"proc-macro-error", "proc-macro-error",
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.71", "syn 2.0.72",
] ]
[[package]] [[package]]
@ -5025,7 +5047,7 @@ checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.71", "syn 2.0.72",
] ]
[[package]] [[package]]
@ -5067,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",
] ]
@ -5220,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",
] ]
@ -5242,7 +5264,7 @@ dependencies = [
"serde", "serde",
"serde_json", "serde_json",
"sha2", "sha2",
"syn 2.0.71", "syn 2.0.72",
"tauri-utils", "tauri-utils",
"thiserror", "thiserror",
"time", "time",
@ -5260,7 +5282,7 @@ dependencies = [
"heck 0.5.0", "heck 0.5.0",
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.71", "syn 2.0.72",
"tauri-codegen", "tauri-codegen",
"tauri-utils", "tauri-utils",
] ]
@ -5278,7 +5300,7 @@ dependencies = [
"serde", "serde",
"serde_json", "serde_json",
"tauri-utils", "tauri-utils",
"toml 0.8.14", "toml 0.8.19",
"walkdir", "walkdir",
] ]
@ -5562,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",
@ -5618,22 +5640,22 @@ checksum = "8eaa81235c7058867fa8c0e7314f33dcce9c215f535d1913822a2b3f5e289f3c"
[[package]] [[package]]
name = "thiserror" name = "thiserror"
version = "1.0.62" 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 = "f2675633b1499176c2dff06b0856a27976a8f9d436737b4cf4f312d4d91d8bbb" checksum = "c0342370b38b6a11b6cc11d6a805569958d54cfa061a29969c3b5ce2ea405724"
dependencies = [ dependencies = [
"thiserror-impl", "thiserror-impl",
] ]
[[package]] [[package]]
name = "thiserror-impl" name = "thiserror-impl"
version = "1.0.62" 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 = "d20468752b09f49e909e55a5d338caa8bedf615594e9d80bc4c565d30faf798c" checksum = "a4558b58466b9ad7ca0f102865eccc95938dca1a74a856f2b57b6629050da261"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.71", "syn 2.0.72",
] ]
[[package]] [[package]]
@ -5730,7 +5752,7 @@ checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.71", "syn 2.0.72",
] ]
[[package]] [[package]]
@ -5809,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",
] ]
@ -5865,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]]
@ -5930,7 +5952,7 @@ checksum = "84fd902d4e0b9a4b27f2f440108dc034e1758628a9b702f8ec61ad66355422fa"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.71", "syn 2.0.72",
] ]
[[package]] [[package]]
@ -5959,7 +5981,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.71", "syn 2.0.72",
] ]
[[package]] [[package]]
@ -6089,7 +6111,7 @@ checksum = "c88cc88fd23b5a04528f3a8436024f20010a16ec18eb23c164b1242f65860130"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.71", "syn 2.0.72",
"termcolor", "termcolor",
] ]
@ -6237,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"
@ -6306,7 +6334,7 @@ dependencies = [
"proc-macro-error", "proc-macro-error",
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.71", "syn 2.0.72",
] ]
[[package]] [[package]]
@ -6405,7 +6433,7 @@ dependencies = [
"once_cell", "once_cell",
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.71", "syn 2.0.72",
"wasm-bindgen-shared", "wasm-bindgen-shared",
] ]
@ -6439,7 +6467,7 @@ checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.71", "syn 2.0.72",
"wasm-bindgen-backend", "wasm-bindgen-backend",
"wasm-bindgen-shared", "wasm-bindgen-shared",
] ]
@ -6580,7 +6608,7 @@ checksum = "ac1345798ecd8122468840bcdf1b95e5dc6d2206c5e4b0eafa078d061f59c9bc"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.71", "syn 2.0.72",
] ]
[[package]] [[package]]
@ -6686,7 +6714,7 @@ checksum = "9107ddc059d5b6fbfbffdfa7a7fe3e22a226def0b2608f72e9d552763d3e1ad7"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.71", "syn 2.0.72",
] ]
[[package]] [[package]]
@ -6697,7 +6725,7 @@ checksum = "29bee4b38ea3cde66011baa44dba677c432a78593e202392d1e9070cf2a7fca7"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.71", "syn 2.0.72",
] ]
[[package]] [[package]]
@ -6944,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",
] ]
@ -7149,7 +7177,7 @@ checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.71", "syn 2.0.72",
] ]
[[package]] [[package]]

View File

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

View File

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

@ -190,49 +190,59 @@ export function Toolbar({
maybeIconConfig[0].onClick(configCallbackProps) maybeIconConfig[0].onClick(configCallbackProps)
} }
> >
<ToolbarItemContents <span
itemConfig={maybeIconConfig[0]} className={!maybeIconConfig[0].showTitle ? 'sr-only' : ''}
configCallbackProps={configCallbackProps} >
/> {maybeIconConfig[0].title}
</span>
</ActionButton> </ActionButton>
<ToolbarItemTooltip
itemConfig={maybeIconConfig[0]}
configCallbackProps={configCallbackProps}
/>
</ActionButtonDropdown> </ActionButtonDropdown>
) )
} }
const itemConfig = maybeIconConfig const itemConfig = maybeIconConfig
return ( return (
<ActionButton <div className="relative" key={itemConfig.id}>
Element="button" <ActionButton
key={itemConfig.id} Element="button"
id={itemConfig.id} key={itemConfig.id}
data-testid={itemConfig.id} id={itemConfig.id}
iconStart={{ data-testid={itemConfig.id}
icon: itemConfig.icon, iconStart={{
className: iconClassName, icon: itemConfig.icon,
bgClassName: bgClassName, className: iconClassName,
}} bgClassName: bgClassName,
className={ }}
'pressed:!text-chalkboard-10 pressed:enabled:hovered:!text-chalkboard-10 ' + className={
buttonBorderClassName + 'pressed:!text-chalkboard-10 pressed:enabled:hovered:!text-chalkboard-10 ' +
' ' + buttonBorderClassName +
buttonBgClassName + ' ' +
(!itemConfig.showTitle ? ' !px-0' : '') buttonBgClassName +
} (!itemConfig.showTitle ? ' !px-0' : '')
name={itemConfig.title} }
aria-description={itemConfig.description} name={itemConfig.title}
aria-pressed={itemConfig.isActive} aria-description={itemConfig.description}
disabled={ aria-pressed={itemConfig.isActive}
disableAllButtons || disabled={
itemConfig.status !== 'available' || disableAllButtons ||
itemConfig.disabled itemConfig.status !== 'available' ||
} itemConfig.disabled
onClick={() => itemConfig.onClick(configCallbackProps)} }
> onClick={() => itemConfig.onClick(configCallbackProps)}
<ToolbarItemContents >
<span className={!itemConfig.showTitle ? 'sr-only' : ''}>
{itemConfig.title}
</span>
</ActionButton>
<ToolbarItemTooltip
itemConfig={itemConfig} itemConfig={itemConfig}
configCallbackProps={configCallbackProps} configCallbackProps={configCallbackProps}
/> />
</ActionButton> </div>
) )
})} })}
</ul> </ul>
@ -250,7 +260,7 @@ export function Toolbar({
* It contains a tooltip with the title, description, and links * It contains a tooltip with the title, description, and links
* and a hotkey listener * and a hotkey listener
*/ */
const ToolbarItemContents = memo(function ToolbarItemContents({ const ToolbarItemTooltip = memo(function ToolbarItemContents({
itemConfig, itemConfig,
configCallbackProps, configCallbackProps,
}: { }: {
@ -272,73 +282,69 @@ const ToolbarItemContents = memo(function ToolbarItemContents({
) )
return ( return (
<> <Tooltip
<span className={!itemConfig.showTitle ? 'sr-only' : ''}> inert={false}
{itemConfig.title} position="bottom"
</span> wrapperClassName="!p-4 !pointer-events-auto"
<Tooltip contentClassName="!text-left text-wrap !text-xs !p-0 !pb-2 flex gap-2 !max-w-none !w-72 flex-col items-stretch"
position="bottom" >
wrapperClassName="!p-4 !pointer-events-auto" <div className="rounded-top flex items-center gap-2 pt-3 pb-2 px-2 bg-chalkboard-20/50 dark:bg-chalkboard-80/50">
contentClassName="!text-left text-wrap !text-xs !p-0 !pb-2 flex gap-2 !max-w-none !w-72 flex-col items-stretch" <span
> className={`text-sm flex-1 ${
<div className="rounded-top flex items-center gap-2 pt-3 pb-2 px-2 bg-chalkboard-20/50 dark:bg-chalkboard-80/50"> itemConfig.status !== 'available'
<span ? 'text-chalkboard-70 dark:text-chalkboard-40'
className={`text-sm flex-1 ${ : ''
itemConfig.status !== 'available' }`}
? 'text-chalkboard-70 dark:text-chalkboard-40' >
: '' {itemConfig.title}
}`} </span>
> {itemConfig.status === 'available' && itemConfig.hotkey ? (
{itemConfig.title} <kbd className="flex-none hotkey">{itemConfig.hotkey}</kbd>
</span> ) : itemConfig.status === 'kcl-only' ? (
{itemConfig.status === 'available' && itemConfig.hotkey ? ( <>
<kbd className="flex-none hotkey">{itemConfig.hotkey}</kbd> <span className="text-wrap font-sans flex-0 text-chalkboard-70 dark:text-chalkboard-40">
) : itemConfig.status === 'kcl-only' ? ( 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"> <span className="text-wrap font-sans flex-0 text-chalkboard-70 dark:text-chalkboard-40">
KCL code only In development
</span> </span>
<CustomIcon <CustomIcon
name="code" name="lockClosed"
className="w-5 h-5 text-chalkboard-70 dark:text-chalkboard-40" 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> </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

@ -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,
@ -78,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,
@ -200,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
} }
@ -296,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,
@ -672,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],
@ -704,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'),
@ -711,15 +743,6 @@ 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),
@ -1477,146 +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 pathId =
artifact?.type === 'extrudeWall' || artifact?.type === 'extrudeCap'
? artifact.pathId
: ''
// tsc cannot infer that target can have extrusions
// from the commandType (why?) so we need to cast it
const path = this.engineCommandManager.artifactMap?.[pathId || '']
const extrusionId =
path?.type === 'startPath' ? path.extrusionIds[0] : ''
// 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?.[extrusionId]
if (artifact?.type !== 'extrudeCap' && artifact?.type !== 'extrudeWall')
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.type === 'extrudeCap' ? artifact.cap : 'none',
faceId: _entity_id,
},
})
return
},
})
}
mouseEnterLeaveCallbacks() { mouseEnterLeaveCallbacks() {
return { return {
onMouseEnter: ({ selected, dragSelected }: OnMouseEnterLeaveArgs) => { onMouseEnter: ({ selected, dragSelected }: OnMouseEnterLeaveArgs) => {

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

@ -5,6 +5,8 @@ import { CustomIcon } from './CustomIcon'
import { useLocation, useNavigate } from 'react-router-dom' import { useLocation, useNavigate } from 'react-router-dom'
import { createAndOpenNewProject } from 'lib/tauriFS' import { createAndOpenNewProject } from 'lib/tauriFS'
import { paths } from 'lib/paths' import { paths } from 'lib/paths'
import { useAbsoluteFilePath } from 'hooks/useAbsoluteFilePath'
import { useLspContext } from './LspProvider'
const HelpMenuDivider = () => ( const HelpMenuDivider = () => (
<div className="h-[1px] bg-chalkboard-110 dark:bg-chalkboard-80" /> <div className="h-[1px] bg-chalkboard-110 dark:bg-chalkboard-80" />
@ -12,16 +14,18 @@ const HelpMenuDivider = () => (
export function HelpMenu(props: React.PropsWithChildren) { export function HelpMenu(props: React.PropsWithChildren) {
const location = useLocation() const location = useLocation()
const { onProjectOpen } = useLspContext()
const filePath = useAbsoluteFilePath()
const isInProject = location.pathname.includes(paths.FILE) const isInProject = location.pathname.includes(paths.FILE)
const navigate = useNavigate() const navigate = useNavigate()
const { settings } = useSettingsAuthContext() const { settings } = useSettingsAuthContext()
return ( return (
<Popover className="relative"> <Popover className="relative">
<Popover.Button className="border-none p-0 m-0 rounded-full grid place-content-center"> <Popover.Button className="grid p-0 m-0 border-none rounded-full place-content-center">
<CustomIcon <CustomIcon
name="questionMark" name="questionMark"
className="w-7 h-7 rounded-full bg-chalkboard-110 dark:bg-chalkboard-80 text-chalkboard-10" className="rounded-full w-7 h-7 bg-chalkboard-110 dark:bg-chalkboard-80 text-chalkboard-10"
/> />
<span className="sr-only">Help and resources</span> <span className="sr-only">Help and resources</span>
<Tooltip position="top-right" wrapperClassName="ui-open:hidden"> <Tooltip position="top-right" wrapperClassName="ui-open:hidden">
@ -30,7 +34,7 @@ export function HelpMenu(props: React.PropsWithChildren) {
</Popover.Button> </Popover.Button>
<Popover.Panel <Popover.Panel
as="ul" as="ul"
className="absolute right-0 left-auto bottom-full mb-1 w-64 py-2 flex flex-col gap-1 align-stretch text-chalkboard-10 dark:text-inherit bg-chalkboard-110 dark:bg-chalkboard-100 rounded shadow-lg border border-solid border-chalkboard-110 dark:border-chalkboard-80 text-sm m-0 p-0" className="absolute right-0 left-auto flex flex-col w-64 gap-1 p-0 py-2 m-0 mb-1 text-sm border border-solid rounded shadow-lg bottom-full align-stretch text-chalkboard-10 dark:text-inherit bg-chalkboard-110 dark:bg-chalkboard-100 border-chalkboard-110 dark:border-chalkboard-80"
> >
<HelpMenuItem <HelpMenuItem
as="a" as="a"
@ -84,7 +88,12 @@ export function HelpMenu(props: React.PropsWithChildren) {
</HelpMenuItem> </HelpMenuItem>
<HelpMenuItem <HelpMenuItem
as="button" as="button"
onClick={() => navigate('settings?tab=keybindings')} onClick={() => {
const targetPath = location.pathname.includes(paths.FILE)
? filePath + paths.SETTINGS
: paths.HOME + paths.SETTINGS
navigate(targetPath + '?tab=keybindings')
}}
> >
Keyboard shortcuts Keyboard shortcuts
</HelpMenuItem> </HelpMenuItem>
@ -99,9 +108,9 @@ export function HelpMenu(props: React.PropsWithChildren) {
}, },
}) })
if (isInProject) { if (isInProject) {
navigate('onboarding') navigate(filePath + paths.ONBOARDING.INDEX)
} else { } else {
createAndOpenNewProject(navigate) createAndOpenNewProject({ onProjectOpen, navigate })
} }
}} }}
> >
@ -128,7 +137,7 @@ function HelpMenuItem({
}: HelpMenuItemProps) { }: HelpMenuItemProps) {
const baseClassName = 'block px-2 py-1 hover:bg-chalkboard-80' const baseClassName = 'block px-2 py-1 hover:bg-chalkboard-80'
return ( return (
<li className="m-0 p-0"> <li className="p-0 m-0">
{as === 'a' ? ( {as === 'a' ? (
<a <a
{...(props as React.ComponentProps<'a'>)} {...(props as React.ComponentProps<'a'>)}

View File

@ -1,5 +1,5 @@
import { useMachine } from '@xstate/react' import { useMachine } from '@xstate/react'
import React, { createContext, useEffect, useRef } from 'react' import React, { createContext, useEffect, useMemo, useRef } from 'react'
import { import {
AnyStateMachine, AnyStateMachine,
ContextFrom, ContextFrom,
@ -8,7 +8,12 @@ import {
StateFrom, StateFrom,
assign, assign,
} from 'xstate' } from 'xstate'
import { SetSelections, modelingMachine } from 'machines/modelingMachine' import {
SetSelections,
getPersistedContext,
modelingMachine,
modelingMachineDefaultContext,
} from 'machines/modelingMachine'
import { useSetupEngineManager } from 'hooks/useSetupEngineManager' import { useSetupEngineManager } from 'hooks/useSetupEngineManager'
import { useSettingsAuthContext } from 'hooks/useSettingsAuthContext' import { useSettingsAuthContext } from 'hooks/useSettingsAuthContext'
import { import {
@ -72,7 +77,6 @@ import { err, trap } from 'lib/trap'
import { useCommandsContext } from 'hooks/useCommandsContext' import { useCommandsContext } from 'hooks/useCommandsContext'
import { modelingMachineEvent } from 'editor/manager' import { modelingMachineEvent } from 'editor/manager'
import { hasValidFilletSelection } from 'lang/modifyAst/addFillet' import { hasValidFilletSelection } from 'lang/modifyAst/addFillet'
import { uuidv4 } from 'lib/utils'
type MachineContext<T extends AnyStateMachine> = { type MachineContext<T extends AnyStateMachine> = {
state: StateFrom<T> state: StateFrom<T>
@ -100,6 +104,7 @@ export const ModelingMachineProvider = ({
} = useSettingsAuthContext() } = useSettingsAuthContext()
const token = auth?.context?.token const token = auth?.context?.token
const streamRef = useRef<HTMLDivElement>(null) const streamRef = useRef<HTMLDivElement>(null)
const persistedContext = useMemo(() => getPersistedContext(), [])
let [searchParams] = useSearchParams() let [searchParams] = useSearchParams()
const pool = searchParams.get('pool') const pool = searchParams.get('pool')
@ -122,6 +127,13 @@ export const ModelingMachineProvider = ({
const [modelingState, modelingSend, modelingActor] = useMachine( const [modelingState, modelingSend, modelingActor] = useMachine(
modelingMachine, modelingMachine,
{ {
context: {
...modelingMachineDefaultContext,
store: {
...modelingMachineDefaultContext.store,
...persistedContext,
},
},
actions: { actions: {
'disable copilot': () => { 'disable copilot': () => {
editorManager.setCopilotEnabled(false) editorManager.setCopilotEnabled(false)
@ -143,7 +155,9 @@ export const ModelingMachineProvider = ({
kclManager.executeCode().then(() => { kclManager.executeCode().then(() => {
if (engineCommandManager.engineConnection?.idleMode) return if (engineCommandManager.engineConnection?.idleMode) return
store.videoElement?.play() store.videoElement?.play().catch((e) => {
console.warn('Video playing was prevented', e)
})
}) })
})() })()
}, },

View File

@ -27,27 +27,3 @@ export const LogsPane = () => {
</div> </div>
) )
} }
export const KclErrorsPane = () => {
const theme = useResolvedTheme()
const { errors } = useKclContext()
return (
<div className="overflow-hidden">
<div className="absolute inset-0 p-2 flex flex-col overflow-auto">
<ReactJsonTypeHack
src={errors}
collapsed={1}
collapseStringsAfterLength={60}
enableClipboard={false}
displayArrayKey={false}
displayDataTypes={false}
displayObjectSize={true}
indentWidth={2}
quotesOnKeys={false}
name={false}
theme={theme === 'light' ? 'rjv-default' : 'monokai'}
/>
</div>
</div>
)
}

View File

@ -3,7 +3,6 @@ import {
faBugSlash, faBugSlash,
faCode, faCode,
faCodeCommit, faCodeCommit,
faExclamationCircle,
faSquareRootVariable, faSquareRootVariable,
} from '@fortawesome/free-solid-svg-icons' } from '@fortawesome/free-solid-svg-icons'
import { KclEditorMenu } from 'components/ModelingSidebar/ModelingPanes/KclEditorMenu' import { KclEditorMenu } from 'components/ModelingSidebar/ModelingPanes/KclEditorMenu'
@ -11,20 +10,28 @@ import { CustomIconName } from 'components/CustomIcon'
import { KclEditorPane } from 'components/ModelingSidebar/ModelingPanes/KclEditorPane' import { KclEditorPane } from 'components/ModelingSidebar/ModelingPanes/KclEditorPane'
import { ReactNode } from 'react' import { ReactNode } from 'react'
import { MemoryPane, MemoryPaneMenu } from './MemoryPane' import { MemoryPane, MemoryPaneMenu } from './MemoryPane'
import { KclErrorsPane, LogsPane } from './LoggingPanes' import { LogsPane } from './LoggingPanes'
import { DebugPane } from './DebugPane' import { DebugPane } from './DebugPane'
import { FileTreeInner, FileTreeMenu } from 'components/FileTree' import { FileTreeInner, FileTreeMenu } from 'components/FileTree'
import { useKclContext } from 'lang/KclProvider'
export type SidebarType = export type SidebarType =
| 'code' | 'code'
| 'debug' | 'debug'
| 'export' | 'export'
| 'files' | 'files'
| 'kclErrors'
| 'logs' | 'logs'
| 'lspMessages' | 'lspMessages'
| 'variables' | 'variables'
/**
* This interface can be extended as more context is needed for the panes
* to determine if they should show their badges or not.
*/
interface PaneCallbackProps {
kclContext: ReturnType<typeof useKclContext>
}
export type SidebarPane = { export type SidebarPane = {
id: SidebarType id: SidebarType
title: string title: string
@ -33,6 +40,7 @@ export type SidebarPane = {
Content: ReactNode | React.FC Content: ReactNode | React.FC
Menu?: ReactNode | React.FC Menu?: ReactNode | React.FC
hideOnPlatform?: 'desktop' | 'web' hideOnPlatform?: 'desktop' | 'web'
showBadge?: (props: PaneCallbackProps) => boolean | number
} }
export const sidebarPanes: SidebarPane[] = [ export const sidebarPanes: SidebarPane[] = [
@ -43,6 +51,7 @@ export const sidebarPanes: SidebarPane[] = [
Content: KclEditorPane, Content: KclEditorPane,
keybinding: 'Shift + C', keybinding: 'Shift + C',
Menu: KclEditorMenu, Menu: KclEditorMenu,
showBadge: ({ kclContext }) => kclContext.errors.length,
}, },
{ {
id: 'files', id: 'files',
@ -68,13 +77,6 @@ export const sidebarPanes: SidebarPane[] = [
Content: LogsPane, Content: LogsPane,
keybinding: 'Shift + L', keybinding: 'Shift + L',
}, },
{
id: 'kclErrors',
title: 'KCL Errors',
icon: faExclamationCircle,
Content: KclErrorsPane,
keybinding: 'Shift + E',
},
{ {
id: 'debug', id: 'debug',
title: 'Debug', title: 'Debug',

View File

@ -12,6 +12,7 @@ import { useModelingContext } from 'hooks/useModelingContext'
import { CustomIconName } from 'components/CustomIcon' import { CustomIconName } from 'components/CustomIcon'
import { useCommandsContext } from 'hooks/useCommandsContext' import { useCommandsContext } from 'hooks/useCommandsContext'
import { IconDefinition } from '@fortawesome/free-solid-svg-icons' import { IconDefinition } from '@fortawesome/free-solid-svg-icons'
import { useKclContext } from 'lang/KclProvider'
interface ModelingSidebarProps { interface ModelingSidebarProps {
paneOpacity: '' | 'opacity-20' | 'opacity-40' paneOpacity: '' | 'opacity-20' | 'opacity-40'
@ -19,6 +20,7 @@ interface ModelingSidebarProps {
export function ModelingSidebar({ paneOpacity }: ModelingSidebarProps) { export function ModelingSidebar({ paneOpacity }: ModelingSidebarProps) {
const { commandBarSend } = useCommandsContext() const { commandBarSend } = useCommandsContext()
const kclContext = useKclContext()
const { settings } = useSettingsAuthContext() const { settings } = useSettingsAuthContext()
const onboardingStatus = settings.context.app.onboardingStatus const onboardingStatus = settings.context.app.onboardingStatus
const { send, context } = useModelingContext() const { send, context } = useModelingContext()
@ -62,6 +64,15 @@ export function ModelingSidebar({ paneOpacity }: ModelingSidebarProps) {
[sidebarPanes, showDebugPanel.current] [sidebarPanes, showDebugPanel.current]
) )
const paneBadgeMap: Record<SidebarType, number | boolean> = useMemo(() => {
return filteredPanes.reduce((acc, pane) => {
if (pane.showBadge) {
acc[pane.id] = pane.showBadge({ kclContext })
}
return acc
}, {} as Record<SidebarType, number | boolean>)
}, [kclContext.errors])
const togglePane = useCallback( const togglePane = useCallback(
(newPane: SidebarType) => { (newPane: SidebarType) => {
send({ send({
@ -120,6 +131,7 @@ export function ModelingSidebar({ paneOpacity }: ModelingSidebarProps) {
paneIsOpen={context.store?.openPanes.includes(pane.id)} paneIsOpen={context.store?.openPanes.includes(pane.id)}
onClick={() => togglePane(pane.id)} onClick={() => togglePane(pane.id)}
aria-pressed={context.store?.openPanes.includes(pane.id)} aria-pressed={context.store?.openPanes.includes(pane.id)}
showBadge={paneBadgeMap[pane.id]}
/> />
))} ))}
</ul> </ul>
@ -136,7 +148,6 @@ export function ModelingSidebar({ paneOpacity }: ModelingSidebarProps) {
iconClassName: action.iconClassName, iconClassName: action.iconClassName,
iconSize: 'md', iconSize: 'md',
}} }}
paneIsOpen={false}
onClick={action.action} onClick={action.action}
/> />
))} ))}
@ -186,13 +197,15 @@ interface ModelingPaneButtonProps
iconSize?: 'sm' | 'md' | 'lg' iconSize?: 'sm' | 'md' | 'lg'
} }
onClick: () => void onClick: () => void
paneIsOpen: boolean paneIsOpen?: boolean
showBadge?: boolean | number
} }
function ModelingPaneButton({ function ModelingPaneButton({
paneConfig, paneConfig,
onClick, onClick,
paneIsOpen, paneIsOpen,
showBadge,
...props ...props
}: ModelingPaneButtonProps) { }: ModelingPaneButtonProps) {
useHotkeys(paneConfig.keybinding, onClick, { useHotkeys(paneConfig.keybinding, onClick, {
@ -220,12 +233,37 @@ function ModelingPaneButton({
'rounded-sm ' + (paneIsOpen ? '!bg-primary' : '!bg-transparent') 'rounded-sm ' + (paneIsOpen ? '!bg-primary' : '!bg-transparent')
} }
/> />
<span className="sr-only">{paneConfig.title} pane</span> <span className="sr-only">
<Tooltip position="right" hoverOnly> {paneConfig.title}
<span className="flex-1">{paneConfig.title} pane: </span> {paneIsOpen !== undefined ? ` pane` : ''}
<span className="hotkey text-xs capitalize"> </span>
{paneConfig.keybinding} {!!showBadge && (
<p
className={
'absolute m-0 p-0 -top-1 -right-1 w-3 h-3 flex items-center justify-center text-[10px] font-semibold text-white bg-primary hue-rotate-90 rounded-full border border-chalkboard-10 dark:border-chalkboard-80'
}
>
<span className="sr-only">&nbsp;has&nbsp;</span>
{typeof showBadge === 'number' ? (
<span>{showBadge}</span>
) : (
<span className="sr-only">a</span>
)}
<span className="sr-only">
&nbsp;notification{Number(showBadge) > 1 ? 's' : ''}
</span>
</p>
)}
<Tooltip
position="right"
contentClassName="max-w-none flex items-center gap-4"
hoverOnly
>
<span className="flex-1">
{paneConfig.title}
{paneIsOpen !== undefined ? ` pane` : ''}
</span> </span>
<kbd className="hotkey text-xs capitalize">{paneConfig.keybinding}</kbd>
</Tooltip> </Tooltip>
</button> </button>
) )

View File

@ -19,7 +19,8 @@ import { createAndOpenNewProject, getSettingsFolderPaths } from 'lib/tauriFS'
import { paths } from 'lib/paths' import { paths } from 'lib/paths'
import { useDotDotSlash } from 'hooks/useDotDotSlash' import { useDotDotSlash } from 'hooks/useDotDotSlash'
import { sep } from '@tauri-apps/api/path' import { sep } from '@tauri-apps/api/path'
import { ForwardedRef, forwardRef } from 'react' import { ForwardedRef, forwardRef, useEffect } from 'react'
import { useLspContext } from 'components/LspProvider'
interface AllSettingsFieldsProps { interface AllSettingsFieldsProps {
searchParamTab: SettingsLevel searchParamTab: SettingsLevel
@ -33,9 +34,10 @@ export const AllSettingsFields = forwardRef(
) => { ) => {
const location = useLocation() const location = useLocation()
const navigate = useNavigate() const navigate = useNavigate()
const { onProjectOpen } = useLspContext()
const dotDotSlash = useDotDotSlash() const dotDotSlash = useDotDotSlash()
const { const {
settings: { send, context }, settings: { send, context, state },
} = useSettingsAuthContext() } = useSettingsAuthContext()
const projectPath = const projectPath =
@ -48,19 +50,37 @@ export const AllSettingsFields = forwardRef(
) )
: undefined : undefined
function restartOnboarding() { async function restartOnboarding() {
send({ send({
type: `set.app.onboardingStatus`, type: `set.app.onboardingStatus`,
data: { level: 'user', value: '' }, data: { level: 'user', value: '' },
}) })
if (isFileSettings) {
navigate(dotDotSlash(1) + paths.ONBOARDING.INDEX)
} else {
createAndOpenNewProject(navigate)
}
} }
/**
* A "listener" for the XState to return to "idle" state
* when the user resets the onboarding, using the callback above
*/
useEffect(() => {
async function navigateToOnboardingStart() {
if (
state.context.app.onboardingStatus.user === '' &&
state.matches('idle')
) {
if (isFileSettings) {
// If we're in a project, first navigate to the onboarding start here
// so we can trigger the warning screen if necessary
navigate(dotDotSlash(1) + paths.ONBOARDING.INDEX)
} else {
// If we're in the global settings, create a new project and navigate
// to the onboarding start in that project
await createAndOpenNewProject({ onProjectOpen, navigate })
}
}
}
navigateToOnboardingStart()
}, [isFileSettings, navigate, state])
return ( return (
<div className="relative overflow-y-auto"> <div className="relative overflow-y-auto">
<div ref={scrollRef} className="flex flex-col gap-4 px-2"> <div ref={scrollRef} className="flex flex-col gap-4 px-2">

View File

@ -175,11 +175,35 @@ export const SettingsAuthProviderBase = ({
id: `${event.type}.success`, id: `${event.type}.success`,
}) })
}, },
'Execute AST': () => { 'Execute AST': (context, event) => {
kclManager.isFirstRender = true try {
kclManager.executeCode(true).then(() => { const allSettingsIncludesUnitChange =
kclManager.isFirstRender = false event.type === 'Set all settings' &&
}) event.settings?.modeling?.defaultUnit?.current !==
context.modeling.defaultUnit.current
const resetSettingsIncludesUnitChange =
event.type === 'Reset settings' &&
context.modeling.defaultUnit.current !==
settings?.modeling?.defaultUnit?.default
if (
event.type === 'set.modeling.defaultUnit' ||
allSettingsIncludesUnitChange ||
resetSettingsIncludesUnitChange
) {
kclManager.isFirstRender = true
kclManager.executeCode(true).then(() => {
kclManager.isFirstRender = false
})
} else {
// For any future logging we'd like to do
// console.log(
// 'Not re-executing AST because the settings change did not affect the code interpretation'
// )
}
} catch (e) {
console.error('Error executing AST after settings change', e)
}
}, },
}, },
services: { services: {

View File

@ -156,7 +156,13 @@ export const Stream = () => {
useEffect(() => { useEffect(() => {
setIsFirstRender(kclManager.isFirstRender) setIsFirstRender(kclManager.isFirstRender)
if (!kclManager.isFirstRender) videoRef.current?.play() if (!kclManager.isFirstRender)
setTimeout(() =>
// execute in the next event loop
videoRef.current?.play().catch((e) => {
console.warn('Video playing was prevented', e, videoRef.current)
})
)
setIsFreezeFrame(!kclManager.isFirstRender) setIsFreezeFrame(!kclManager.isFirstRender)
}, [kclManager.isFirstRender]) }, [kclManager.isFirstRender])
@ -170,8 +176,12 @@ export const Stream = () => {
if (!mediaStream) return if (!mediaStream) return
// Do not immediately play the stream! // Do not immediately play the stream!
videoRef.current.srcObject = mediaStream try {
videoRef.current.pause() videoRef.current.srcObject = mediaStream
videoRef.current.pause()
} catch (e) {
console.warn('Attempted to pause stream while play was still loading', e)
}
send({ send({
type: 'Set context', type: 'Set context',
@ -215,7 +225,7 @@ export const Stream = () => {
}, },
}) })
if (state.matches('Sketch')) return if (state.matches('Sketch')) return
if (state.matches('Sketch no face')) return if (state.matches('idle.showPlanes')) return
if (!context.store?.didDragInStream && btnName(e).left) { if (!context.store?.didDragInStream && btnName(e).left) {
sendSelectEventToEngine( sendSelectEventToEngine(

View File

@ -57,7 +57,8 @@
transition-delay: var(--_delay); transition-delay: var(--_delay);
} }
:is(:focus-visible) > .tooltipWrapper.withFocus { :is(:focus-visible) > .tooltipWrapper.withFocus,
:focus-within > .tooltipWrapper.withFocus {
visibility: visible; visibility: visible;
opacity: 1; opacity: 1;
} }

View File

@ -29,7 +29,7 @@ export default function Tooltip({
return ( return (
<div <div
// @ts-ignore while awaiting merge of this PR for support of "inert" https://github.com/DefinitelyTyped/DefinitelyTyped/pull/60822 // @ts-ignore while awaiting merge of this PR for support of "inert" https://github.com/DefinitelyTyped/DefinitelyTyped/pull/60822
inert={inert} {...{ inert: inert ? '' : undefined }}
role="tooltip" role="tooltip"
className={`p-3 ${ className={`p-3 ${
position !== 'left' && position !== 'right' ? 'px-0' : '' position !== 'left' && position !== 'right' ? 'px-0' : ''

View File

@ -6,11 +6,7 @@ import { Selections, processCodeMirrorRanges, Selection } from 'lib/selections'
import { undo, redo } from '@codemirror/commands' import { undo, redo } from '@codemirror/commands'
import { CommandBarMachineEvent } from 'machines/commandBarMachine' import { CommandBarMachineEvent } from 'machines/commandBarMachine'
import { addLineHighlight, addLineHighlightEvent } from './highlightextension' import { addLineHighlight, addLineHighlightEvent } from './highlightextension'
import { import { Diagnostic, setDiagnosticsEffect } from '@codemirror/lint'
forEachDiagnostic,
Diagnostic,
setDiagnosticsEffect,
} from '@codemirror/lint'
const updateOutsideEditorAnnotation = Annotation.define<boolean>() const updateOutsideEditorAnnotation = Annotation.define<boolean>()
export const updateOutsideEditorEvent = updateOutsideEditorAnnotation.of(true) export const updateOutsideEditorEvent = updateOutsideEditorAnnotation.of(true)
@ -114,12 +110,20 @@ export default class EditorManager {
} }
} }
clearDiagnostics(): void {
this.setDiagnostics([])
}
setDiagnostics(diagnostics: Diagnostic[]): void { setDiagnostics(diagnostics: Diagnostic[]): void {
if (!this._editorView) return if (!this._editorView) return
// Clear out any existing diagnostics that are the same.
for (const diagnostic of diagnostics) {
for (const otherDiagnostic of diagnostics) {
if (diagnosticIsEqual(diagnostic, otherDiagnostic)) {
diagnostics = diagnostics.filter(
(d) => !diagnosticIsEqual(d, diagnostic)
)
diagnostics.push(diagnostic)
break
}
}
}
this._editorView.dispatch({ this._editorView.dispatch({
effects: [setDiagnosticsEffect.of(diagnostics)], effects: [setDiagnosticsEffect.of(diagnostics)],
@ -131,26 +135,6 @@ export default class EditorManager {
}) })
} }
addDiagnostics(diagnostics: Diagnostic[]): void {
if (!this._editorView) return
forEachDiagnostic(this._editorView.state, function (diag) {
diagnostics.push(diag)
})
const uniqueDiagnostics = new Set<Diagnostic>()
diagnostics.forEach((diagnostic) => {
for (const knownDiagnostic of uniqueDiagnostics.values()) {
if (diagnosticIsEqual(diagnostic, knownDiagnostic)) {
return
}
}
uniqueDiagnostics.add(diagnostic)
})
this.setDiagnostics([...uniqueDiagnostics])
}
undo() { undo() {
if (this._editorView) { if (this._editorView) {
undo(this._editorView) undo(this._editorView)

View File

@ -1,10 +1,17 @@
import { useEffect } from 'react' import { useEffect } from 'react'
import { editorManager, engineCommandManager } from 'lib/singletons' import {
editorManager,
engineCommandManager,
kclManager,
sceneInfra,
} from 'lib/singletons'
import { useModelingContext } from './useModelingContext' import { useModelingContext } from './useModelingContext'
import { getEventForSelectWithPoint } from 'lib/selections' import { getEventForSelectWithPoint } from 'lib/selections'
import { DefaultPlaneStr, getFaceDetails } from 'clientSideScene/sceneEntities'
import { getNodePathFromSourceRange } from 'lang/queryAst'
export function useEngineConnectionSubscriptions() { export function useEngineConnectionSubscriptions() {
const { send, context } = useModelingContext() const { send, context, state } = useModelingContext()
useEffect(() => { useEffect(() => {
if (!engineCommandManager) return if (!engineCommandManager) return
@ -40,4 +47,135 @@ export function useEngineConnectionSubscriptions() {
unSubClick() unSubClick()
} }
}, [engineCommandManager, context?.sketchEnginePathId]) }, [engineCommandManager, context?.sketchEnginePathId])
useEffect(() => {
const unSub = engineCommandManager.subscribeTo({
event: 'select_with_point',
callback: state.matches('Sketch no face')
? async ({ data }) => {
let planeId = data.entity_id
if (!planeId) return
if (
engineCommandManager.defaultPlanes?.xy === planeId ||
engineCommandManager.defaultPlanes?.xz === planeId ||
engineCommandManager.defaultPlanes?.yz === planeId ||
engineCommandManager.defaultPlanes?.negXy === planeId ||
engineCommandManager.defaultPlanes?.negXz === planeId ||
engineCommandManager.defaultPlanes?.negYz === planeId
) {
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 === planeId) {
zAxis = [0, 0, 1]
yAxis = [0, 1, 0]
if (camVector.z < 0) {
zAxis = [0, 0, -1]
planeId = engineCommandManager.defaultPlanes?.negXy || ''
}
} else if (engineCommandManager.defaultPlanes?.yz === planeId) {
zAxis = [1, 0, 0]
yAxis = [0, 0, 1]
if (camVector.x < 0) {
zAxis = [-1, 0, 0]
planeId = engineCommandManager.defaultPlanes?.negYz || ''
}
} else if (engineCommandManager.defaultPlanes?.xz === planeId) {
zAxis = [0, 1, 0]
yAxis = [0, 0, 1]
planeId = engineCommandManager.defaultPlanes?.negXz || ''
if (camVector.y < 0) {
zAxis = [0, -1, 0]
planeId = engineCommandManager.defaultPlanes?.xz || ''
}
}
sceneInfra.modelingSend({
type: 'Select default plane',
data: {
type: 'defaultPlane',
planeId: planeId,
plane: defaultPlaneStrMap[planeId],
zAxis,
yAxis,
},
})
return
}
const artifact = engineCommandManager.artifactMap[planeId]
console.log('artifact', artifact)
// 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 pathId =
artifact?.type === 'extrudeWall' ||
artifact?.type === 'extrudeCap'
? artifact.pathId
: ''
const path = engineCommandManager.artifactMap?.[pathId || '']
const extrusionId =
path?.type === 'startPath' ? path.extrusionIds[0] : ''
// 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 = engineCommandManager.artifactMap?.[extrusionId]
if (
artifact?.type !== 'extrudeCap' &&
artifact?.type !== 'extrudeWall'
)
return
const faceInfo = await getFaceDetails(planeId)
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.type === 'extrudeCap' ? artifact.cap : 'none',
faceId: planeId,
},
})
return
}
: () => {},
})
return unSub
}, [state])
} }

View File

@ -186,6 +186,7 @@ export function useSetupEngineManager(
} }
function getDimensions(streamWidth?: number, streamHeight?: number) { function getDimensions(streamWidth?: number, streamHeight?: number) {
const factorOf = 4
const maxResolution = 2000 const maxResolution = 2000
const width = streamWidth ? streamWidth : 0 const width = streamWidth ? streamWidth : 0
const height = streamHeight ? streamHeight : 0 const height = streamHeight ? streamHeight : 0
@ -193,7 +194,7 @@ function getDimensions(streamWidth?: number, streamHeight?: number) {
Math.min(maxResolution / width, maxResolution / height), Math.min(maxResolution / width, maxResolution / height),
1.0 1.0
) )
const quadWidth = Math.round((width * ratio) / 4) * 4 const quadWidth = Math.round((width * ratio) / factorOf) * factorOf
const quadHeight = Math.round((height * ratio) / 4) * 4 const quadHeight = Math.round((height * ratio) / factorOf) * factorOf
return { width: quadWidth, height: quadHeight } return { width: quadWidth, height: quadHeight }
} }

View File

@ -17,6 +17,7 @@ import {
} from 'lang/wasm' } from 'lang/wasm'
import { getNodeFromPath } from './queryAst' import { getNodeFromPath } from './queryAst'
import { codeManager, editorManager, sceneInfra } from 'lib/singletons' import { codeManager, editorManager, sceneInfra } from 'lib/singletons'
import { Diagnostic } from '@codemirror/lint'
export class KclManager { export class KclManager {
private _ast: Program = { private _ast: Program = {
@ -32,6 +33,7 @@ export class KclManager {
} }
private _programMemory: ProgramMemory = ProgramMemory.empty() private _programMemory: ProgramMemory = ProgramMemory.empty()
private _logs: string[] = [] private _logs: string[] = []
private _lints: Diagnostic[] = []
private _kclErrors: KCLError[] = [] private _kclErrors: KCLError[] = []
private _isExecuting = false private _isExecuting = false
private _wasmInitFailed = true private _wasmInitFailed = true
@ -72,16 +74,36 @@ export class KclManager {
this._logsCallBack(logs) this._logsCallBack(logs)
} }
get lints() {
return this._lints
}
set lints(lints) {
if (lints === this._lints) return
this._lints = lints
// Run the lints through the diagnostics.
this.kclErrors = this._kclErrors
}
get kclErrors() { get kclErrors() {
return this._kclErrors return this._kclErrors
} }
set kclErrors(kclErrors) { set kclErrors(kclErrors) {
if (kclErrors === this._kclErrors && this.lints.length === 0) return
this._kclErrors = kclErrors this._kclErrors = kclErrors
let diagnostics = kclErrorsToDiagnostics(kclErrors) let diagnostics = kclErrorsToDiagnostics(kclErrors)
editorManager.addDiagnostics(diagnostics) if (this.lints.length > 0) {
diagnostics = diagnostics.concat(this.lints)
}
editorManager.setDiagnostics(diagnostics)
this._kclErrorsCallBack(kclErrors) this._kclErrorsCallBack(kclErrors)
} }
addKclErrors(kclErrors: KCLError[]) {
if (kclErrors.length === 0) return
this.kclErrors = this.kclErrors.concat(kclErrors)
}
get isExecuting() { get isExecuting() {
return this._isExecuting return this._isExecuting
} }
@ -148,12 +170,12 @@ export class KclManager {
safeParse(code: string): Program | null { safeParse(code: string): Program | null {
const ast = parse(code) const ast = parse(code)
this.lints = []
this.kclErrors = [] this.kclErrors = []
if (!err(ast)) return ast if (!err(ast)) return ast
const kclerror: KCLError = ast as KCLError const kclerror: KCLError = ast as KCLError
console.error('error parsing code', kclerror) this.addKclErrors([kclerror])
this.kclErrors = [kclerror]
// TODO: re-eval if session should end? // TODO: re-eval if session should end?
if (kclerror.msg === 'file is empty') if (kclerror.msg === 'file is empty')
this.engineCommandManager?.endSession() this.engineCommandManager?.endSession()
@ -190,16 +212,19 @@ export class KclManager {
this._cancelTokens.set(currentExecutionId, false) this._cancelTokens.set(currentExecutionId, false)
this.isExecuting = true this.isExecuting = true
// Make sure we clear before starting again. End session will do this.
this.engineCommandManager?.endSession()
await this.ensureWasmInit() await this.ensureWasmInit()
const { logs, errors, programMemory } = await executeAst({ const { logs, errors, programMemory } = await executeAst({
ast, ast,
engineCommandManager: this.engineCommandManager, engineCommandManager: this.engineCommandManager,
}) })
editorManager.addDiagnostics(await lintAst({ ast: ast })) this.lints = await lintAst({ ast: ast })
sceneInfra.modelingSend({ type: 'code edit during sketch' }) sceneInfra.modelingSend({ type: 'code edit during sketch' })
defaultSelectionFilter(programMemory, this.engineCommandManager) defaultSelectionFilter(programMemory, this.engineCommandManager)
await this.engineCommandManager.waitForAllCommands()
if (zoomToFit) { if (zoomToFit) {
let zoomObjectId: string | undefined = '' let zoomObjectId: string | undefined = ''
@ -219,6 +244,15 @@ export class KclManager {
padding: 0.1, // padding around the objects padding: 0.1, // padding around the objects
}, },
}) })
await this.engineCommandManager.sendSceneCommand({
type: 'modeling_cmd_req',
cmd_id: uuidv4(),
cmd: {
type: 'zoom_to_fit',
object_ids: zoomObjectId ? [zoomObjectId] : [], // leave empty to zoom to all objects
padding: 0.1, // padding around the objects
},
})
} }
this.isExecuting = false this.isExecuting = false
@ -228,7 +262,7 @@ export class KclManager {
return return
} }
this.logs = logs this.logs = logs
this.kclErrors = errors this.addKclErrors(errors)
this.programMemory = programMemory this.programMemory = programMemory
this.ast = { ...ast } this.ast = { ...ast }
this._executeCallback() this._executeCallback()
@ -272,8 +306,6 @@ export class KclManager {
useFakeExecutor: true, useFakeExecutor: true,
}) })
editorManager.addDiagnostics(await lintAst({ ast: ast }))
this._logs = logs this._logs = logs
this._kclErrors = errors this._kclErrors = errors
this._programMemory = programMemory this._programMemory = programMemory
@ -305,7 +337,6 @@ export class KclManager {
}) })
} }
async executeCode(zoomToFit?: boolean): Promise<void> { async executeCode(zoomToFit?: boolean): Promise<void> {
console.log('[kcl/KclSingleton] executeCode')
const ast = this.safeParse(codeManager.code) const ast = this.safeParse(codeManager.code)
if (!ast) { if (!ast) {
this.clearAst() this.clearAst()

View File

@ -869,6 +869,7 @@ export function hasSketchPipeBeenExtruded(selection: Selection, ast: Program) {
) )
if (err(_varDec)) return false if (err(_varDec)) return false
const varDec = _varDec.node const varDec = _varDec.node
if (varDec.type !== 'VariableDeclarator') return false
let extruded = false let extruded = false
traverse(ast as any, { traverse(ast as any, {
enter(node) { enter(node) {

View File

@ -2,7 +2,7 @@ import { Program, SourceRange } from 'lang/wasm'
import { VITE_KC_API_WS_MODELING_URL } from 'env' import { VITE_KC_API_WS_MODELING_URL } from 'env'
import { Models } from '@kittycad/lib' import { Models } from '@kittycad/lib'
import { exportSave } from 'lib/exportSave' import { exportSave } from 'lib/exportSave'
import { uuidv4 } from 'lib/utils' import { deferExecution, uuidv4 } from 'lib/utils'
import { Themes, getThemeColorForEngine, getOppositeTheme } from 'lib/theme' import { Themes, getThemeColorForEngine, getOppositeTheme } from 'lib/theme'
import { DefaultPlanes } from 'wasm-lib/kcl/bindings/DefaultPlanes' import { DefaultPlanes } from 'wasm-lib/kcl/bindings/DefaultPlanes'
import { import {
@ -12,6 +12,7 @@ import {
ResponseMap, ResponseMap,
createArtifactMap, createArtifactMap,
} from 'lang/std/artifactMap' } from 'lang/std/artifactMap'
import { useModelingContext } from 'hooks/useModelingContext'
// TODO(paultag): This ought to be tweakable. // TODO(paultag): This ought to be tweakable.
const pingIntervalMs = 10000 const pingIntervalMs = 10000
@ -1204,6 +1205,8 @@ export class EngineCommandManager extends EventTarget {
private onEngineConnectionNewTrack = ({ private onEngineConnectionNewTrack = ({
detail, detail,
}: CustomEvent<NewTrackArgs>) => {} }: CustomEvent<NewTrackArgs>) => {}
modelingSend: ReturnType<typeof useModelingContext>['send'] =
(() => {}) as any
start({ start({
restart, restart,
@ -1549,7 +1552,6 @@ export class EngineCommandManager extends EventTarget {
} }
} }
async startNewSession() { async startNewSession() {
this.artifactMap = {}
this.orderedCommands = [] this.orderedCommands = []
this.responseMap = {} this.responseMap = {}
await this.initPlanes() await this.initPlanes()
@ -1784,6 +1786,14 @@ export class EngineCommandManager extends EventTarget {
this.engineConnection?.send(message.command) this.engineConnection?.send(message.command)
return promise return promise
} }
deferredArtifactPopulated = deferExecution((a?: null) => {
this.modelingSend({ type: 'Artifact graph populated' })
}, 200)
deferredArtifactEmptied = deferExecution((a?: null) => {
this.modelingSend({ type: 'Artifact graph emptied' })
}, 200)
/** /**
* When an execution takes place we want to wait until we've got replies for all of the commands * When an execution takes place we want to wait until we've got replies for all of the commands
* When this is done when we build the artifact map synchronously. * When this is done when we build the artifact map synchronously.
@ -1795,21 +1805,16 @@ export class EngineCommandManager extends EventTarget {
responseMap: this.responseMap, responseMap: this.responseMap,
ast: this.getAst(), ast: this.getAst(),
}) })
if (Object.values(this.artifactMap).length) {
this.deferredArtifactEmptied(null)
} else {
this.deferredArtifactPopulated(null)
}
} }
private async initPlanes() { private async initPlanes() {
if (this.planesInitialized()) return if (this.planesInitialized()) return
const planes = await this.makeDefaultPlanes() const planes = await this.makeDefaultPlanes()
this.defaultPlanes = planes this.defaultPlanes = planes
this.subscribeTo({
event: 'select_with_point',
callback: ({ data }) => {
if (!data?.entity_id) return
if (!planes) return
if (![planes.xy, planes.yz, planes.xz].includes(data.entity_id)) return
this.onPlaneSelectCallback(data.entity_id)
},
})
} }
planesInitialized(): boolean { planesInitialized(): boolean {
return ( return (
@ -1820,11 +1825,6 @@ export class EngineCommandManager extends EventTarget {
) )
} }
onPlaneSelectCallback = (id: string) => {}
onPlaneSelected(callback: (id: string) => void) {
this.onPlaneSelectCallback = callback
}
async setPlaneHidden(id: string, hidden: boolean) { async setPlaneHidden(id: string, hidden: boolean) {
return await this.sendSceneCommand({ return await this.sendSceneCommand({
type: 'modeling_cmd_req', type: 'modeling_cmd_req',

View File

@ -211,7 +211,7 @@ describe('testing addTagForSketchOnFace', () => {
` `
const code = genCode(originalLine) const code = genCode(originalLine)
const ast = parse(code) const ast = parse(code)
const programMemory = await enginelessExecutor(ast) await enginelessExecutor(ast)
const sourceStart = code.indexOf(originalLine) const sourceStart = code.indexOf(originalLine)
const sourceRange: [number, number] = [ const sourceRange: [number, number] = [
sourceStart, sourceStart,

View File

@ -24,13 +24,6 @@ export const getRectangleCallExpressions = (
rectangleOrigin: [number, number], rectangleOrigin: [number, number],
tags: [string, string, string] tags: [string, string, string]
) => [ ) => [
createCallExpressionStdLib('startProfileAt', [
createArrayExpression([
createLiteral(roundOff(rectangleOrigin[0])),
createLiteral(roundOff(rectangleOrigin[1])),
]),
createPipeSubstitution(),
]),
createCallExpressionStdLib('angledLine', [ createCallExpressionStdLib('angledLine', [
createArrayExpression([ createArrayExpression([
createLiteral(0), // 0 deg createLiteral(0), // 0 deg

View File

@ -14,6 +14,7 @@ import {
listProjects, listProjects,
readAppSettingsFile, readAppSettingsFile,
} from './tauri' } from './tauri'
import { engineCommandManager } from './singletons'
export const isHidden = (fileOrDir: FileEntry) => export const isHidden = (fileOrDir: FileEntry) =>
!!fileOrDir.name?.startsWith('.') !!fileOrDir.name?.startsWith('.')
@ -116,9 +117,23 @@ export async function getSettingsFolderPaths(projectPath?: string) {
} }
} }
export async function createAndOpenNewProject( export async function createAndOpenNewProject({
onProjectOpen,
navigate,
}: {
onProjectOpen: (
project: {
name: string | null
path: string | null
} | null,
file: FileEntry | null
) => void
navigate: (path: string) => void navigate: (path: string) => void
) { }) {
// Clear the scene and end the session.
engineCommandManager.endSession()
// Create a new project with the onboarding project name
const configuration = await readAppSettingsFile() const configuration = await readAppSettingsFile()
const projects = await listProjects(configuration) const projects = await listProjects(configuration)
const nextIndex = getNextProjectIndex(ONBOARDING_PROJECT_NAME, projects) const nextIndex = getNextProjectIndex(ONBOARDING_PROJECT_NAME, projects)
@ -126,6 +141,24 @@ export async function createAndOpenNewProject(
ONBOARDING_PROJECT_NAME, ONBOARDING_PROJECT_NAME,
nextIndex nextIndex
) )
const newFile = await createNewProjectDirectory(name, bracket, configuration) const newProject = await createNewProjectDirectory(
navigate(`${paths.FILE}/${encodeURIComponent(newFile.path)}`) name,
bracket,
configuration
)
// Prep the LSP and navigate to the onboarding start
onProjectOpen(
{
name: newProject.name,
path: newProject.path,
},
null
)
navigate(
`${paths.FILE}/${encodeURIComponent(newProject.default_file)}${
paths.ONBOARDING.INDEX
}`
)
return newProject
} }

File diff suppressed because one or more lines are too long

View File

@ -1,5 +1,11 @@
import { useModelingContext } from 'hooks/useModelingContext' import { useModelingContext } from 'hooks/useModelingContext'
import { OnboardingButtons, useDemoCode, useDismiss, useNextClick } from '.' import {
kbdClasses,
OnboardingButtons,
useDemoCode,
useDismiss,
useNextClick,
} from '.'
import { onboardingPaths } from 'routes/Onboarding/paths' import { onboardingPaths } from 'routes/Onboarding/paths'
export default function OnboardingCodeEditor() { export default function OnboardingCodeEditor() {
@ -66,8 +72,8 @@ export default function OnboardingCodeEditor() {
</p> </p>
<p className="my-4"> <p className="my-4">
You can resize the pane by dragging the handle on the right, and you You can resize the pane by dragging the handle on the right, and you
can collapse it by clicking the title bar or pressing{' '} can collapse it by clicking the X button in the pane's title bar or
<kbd>Shift</kbd> + <kbd>C</kbd>. pressing <kbd className={kbdClasses}>Shift + C</kbd>.
</p> </p>
</section> </section>
<OnboardingButtons <OnboardingButtons

View File

@ -19,8 +19,9 @@ export default function Export() {
<section className="flex-1"> <section className="flex-1">
<h2 className="text-2xl font-bold">Export</h2> <h2 className="text-2xl font-bold">Export</h2>
<p className="my-4"> <p className="my-4">
Try opening the project menu and clicking the "Export Part" at the In addition to the "Export current part" button in the project menu,
bottom of the pane. you can also click the Export button icon at the bottom of the left
sidebar. Try clicking it now.
</p> </p>
<p className="my-4"> <p className="my-4">
{APP_NAME} uses{' '} {APP_NAME} uses{' '}

View File

@ -21,9 +21,10 @@ export default function FutureWork() {
<div className="max-w-full xl:max-w-2xl border border-chalkboard-50 dark:border-chalkboard-80 shadow-lg flex flex-col justify-center bg-chalkboard-10 dark:bg-chalkboard-90 p-8 rounded"> <div className="max-w-full xl:max-w-2xl border border-chalkboard-50 dark:border-chalkboard-80 shadow-lg flex flex-col justify-center bg-chalkboard-10 dark:bg-chalkboard-90 p-8 rounded">
<h1 className="text-2xl font-bold">Future Work</h1> <h1 className="text-2xl font-bold">Future Work</h1>
<p className="my-4"> <p className="my-4">
We have curves, cuts, and many more CAD features coming soon. We want We have curves, cuts, multi-profile sketch mode, and many more CAD
your feedback on this user interface, and we want to know what features coming soon. We want your feedback on this user interface,
features you want to see next. Please message us in{' '} and we want to know what features you want to see next. Please message
us in{' '}
<a <a
href="https://discord.gg/JQEpHR7Nt2" href="https://discord.gg/JQEpHR7Nt2"
target="_blank" target="_blank"

View File

@ -3,95 +3,126 @@ import { onboardingPaths } from 'routes/Onboarding/paths'
import { useSettingsAuthContext } from 'hooks/useSettingsAuthContext' import { useSettingsAuthContext } from 'hooks/useSettingsAuthContext'
import { Themes, getSystemTheme } from 'lib/theme' import { Themes, getSystemTheme } from 'lib/theme'
import { bracket } from 'lib/exampleKcl' import { bracket } from 'lib/exampleKcl'
import { import { createAndOpenNewProject } from 'lib/tauriFS'
getNextProjectIndex,
interpolateProjectNameWithIndex,
} from 'lib/tauriFS'
import { isTauri } from 'lib/isTauri' import { isTauri } from 'lib/isTauri'
import { useNavigate } from 'react-router-dom' import { useNavigate, useRouteLoaderData } from 'react-router-dom'
import { paths } from 'lib/paths'
import { codeManager, kclManager } from 'lib/singletons' import { codeManager, kclManager } from 'lib/singletons'
import { join } from '@tauri-apps/api/path' import { APP_NAME } from 'lib/constants'
import { import { useState } from 'react'
APP_NAME, import { useLspContext } from 'components/LspProvider'
ONBOARDING_PROJECT_NAME, import { IndexLoaderData } from 'lib/types'
PROJECT_ENTRYPOINT, import { paths } from 'lib/paths'
} from 'lib/constants' import { useFileContext } from 'hooks/useFileContext'
import { createNewProjectDirectory, listProjects } from 'lib/tauri'
function OnboardingWithNewFile() { /**
const navigate = useNavigate() * Show either a welcome screen or a warning screen
const dismiss = useDismiss() * depending on if the user has code in the editor.
const next = useNextClick(onboardingPaths.INDEX) */
export default function OnboardingIntroduction() {
const [shouldShowWarning, setShouldShowWarning] = useState(
codeManager.code !== '' && codeManager.code !== bracket
)
async function createAndOpenNewProject() { return shouldShowWarning ? (
const projects = await listProjects() <OnboardingResetWarning setShouldShowWarning={setShouldShowWarning} />
const nextIndex = getNextProjectIndex(ONBOARDING_PROJECT_NAME, projects) ) : (
const name = interpolateProjectNameWithIndex( <OnboardingIntroductionInner />
ONBOARDING_PROJECT_NAME, )
nextIndex }
)
const newFile = await createNewProjectDirectory(name, bracket) interface OnboardingResetWarningProps {
navigate( setShouldShowWarning: (arg: boolean) => void
`${paths.FILE}/${encodeURIComponent( }
await join(newFile.path, PROJECT_ENTRYPOINT)
)}${paths.ONBOARDING.INDEX}` function OnboardingResetWarning(props: OnboardingResetWarningProps) {
)
}
return ( return (
<div className="fixed inset-0 z-50 grid place-content-center bg-chalkboard-110/50"> <div className="fixed inset-0 z-50 grid place-content-center bg-chalkboard-110/50">
<div className="max-w-3xl p-8 rounded bg-chalkboard-10 dark:bg-chalkboard-90"> <div className="max-w-3xl p-8 rounded bg-chalkboard-10 dark:bg-chalkboard-90">
{!isTauri() ? ( {!isTauri() ? (
<> <OnboardingWarningWeb {...props} />
<h1 className="text-3xl font-bold text-warn-80 dark:text-warn-10">
Replaying onboarding resets your code
</h1>
<p className="my-4">
We see you have some of your own code written in this project.
Please save it somewhere else before continuing the onboarding.
</p>
<OnboardingButtons
className="mt-6"
dismiss={dismiss}
next={() => {
// We do want to update both the state and editor here.
codeManager.updateCodeEditor(bracket)
kclManager.executeCode(true)
next()
}}
nextText="Overwrite code and continue"
/>
</>
) : ( ) : (
<> <OnboardingWarningDesktop {...props} />
<h1 className="flex flex-wrap items-center gap-4 text-3xl font-bold">
Would you like to create a new project?
</h1>
<section className="my-12">
<p className="my-4">
You have some content in this project that we don't want to
overwrite. If you would like to create a new project, please
click the button below.
</p>
</section>
<OnboardingButtons
className="mt-6"
dismiss={dismiss}
next={() => {
void createAndOpenNewProject()
codeManager.updateCodeEditor(bracket)
dismiss()
}}
nextText="Make a new project"
/>
</>
)} )}
</div> </div>
</div> </div>
) )
} }
export default function OnboardingIntroduction() { function OnboardingWarningDesktop(props: OnboardingResetWarningProps) {
const navigate = useNavigate()
const dismiss = useDismiss()
const loaderData = useRouteLoaderData(paths.FILE) as IndexLoaderData
const { context: fileContext } = useFileContext()
const { onProjectClose, onProjectOpen } = useLspContext()
async function onAccept() {
onProjectClose(
loaderData.file || null,
fileContext.project.path || null,
false
)
await createAndOpenNewProject({ onProjectOpen, navigate })
props.setShouldShowWarning(false)
}
return (
<>
<h1 className="flex flex-wrap items-center gap-4 text-3xl font-bold">
Would you like to create a new project?
</h1>
<section className="my-12">
<p className="my-4">
You have some content in this project that we don't want to overwrite.
If you would like to create a new project, please click the button
below.
</p>
</section>
<OnboardingButtons
className="mt-6"
dismiss={dismiss}
next={onAccept}
nextText="Make a new project"
/>
</>
)
}
function OnboardingWarningWeb(props: OnboardingResetWarningProps) {
const dismiss = useDismiss()
return (
<>
<h1 className="text-3xl font-bold text-warn-80 dark:text-warn-10">
Replaying onboarding resets your code
</h1>
<p className="my-4">
We see you have some of your own code written in this project. Please
save it somewhere else before continuing the onboarding.
</p>
<OnboardingButtons
className="mt-6"
dismiss={dismiss}
next={async () => {
// We do want to update both the state and editor here.
codeManager.updateCodeStateEditor(bracket)
await codeManager.writeToFile()
kclManager.isFirstRender = true
await kclManager.executeCode(true).then(() => {
kclManager.isFirstRender = false
})
props.setShouldShowWarning(false)
}}
nextText="Overwrite code and continue"
/>
</>
)
}
function OnboardingIntroductionInner() {
// Reset the code to the bracket code
useDemoCode()
const { const {
settings: { settings: {
state: { state: {
@ -108,12 +139,8 @@ export default function OnboardingIntroduction() {
: '' : ''
const dismiss = useDismiss() const dismiss = useDismiss()
const next = useNextClick(onboardingPaths.CAMERA) const next = useNextClick(onboardingPaths.CAMERA)
const currentCode = codeManager.code
const isStarterCode = currentCode === '' || currentCode === bracket
useDemoCode() return (
return isStarterCode ? (
<div className="fixed inset-0 z-50 grid place-content-center bg-chalkboard-110/50"> <div className="fixed inset-0 z-50 grid place-content-center bg-chalkboard-110/50">
<div className="max-w-3xl p-8 rounded bg-chalkboard-10 dark:bg-chalkboard-90"> <div className="max-w-3xl p-8 rounded bg-chalkboard-10 dark:bg-chalkboard-90">
<h1 className="flex flex-wrap items-center gap-4 text-3xl font-bold"> <h1 className="flex flex-wrap items-center gap-4 text-3xl font-bold">
@ -172,7 +199,5 @@ export default function OnboardingIntroduction() {
/> />
</div> </div>
</div> </div>
) : (
<OnboardingWithNewFile />
) )
} }

View File

@ -20,8 +20,9 @@ export default function ProjectMenu() {
<section className="flex-1"> <section className="flex-1">
<h2 className="text-2xl font-bold">Project Menu</h2> <h2 className="text-2xl font-bold">Project Menu</h2>
<p className="my-4"> <p className="my-4">
Click on your part's name in the upper left to open the project Click on {tauri ? `your part's name` : `the app name`} in the upper
menu. left to open the project menu, where you can open the project
settings and export your current part.
{tauri && ( {tauri && (
<> You can click the Zoo logo to quickly navigate home.</> <> You can click the Zoo logo to quickly navigate home.</>
)} )}
@ -43,8 +44,8 @@ export default function ProjectMenu() {
) : ( ) : (
<> <>
<p className="my-4"> <p className="my-4">
From here you can export your part. You can't manage separate You can't manage separate files and separate projects from the
files and separate projects from the browser; you have to{' '} browser; you have to{' '}
<a <a
href="https://zoo.dev/modeling-app/download" href="https://zoo.dev/modeling-app/download"
target="_blank" target="_blank"

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