Compare commits

...

24 Commits

Author SHA1 Message Date
8b20f898fe fix fmt 2025-02-21 14:48:38 +01:00
d7c5c3cf9d fix 2025-02-21 14:46:47 +01:00
270781d5cd better testing for making sure we update the cache state on just settings changes (#5445) 2025-02-21 06:08:49 +00:00
96b93f8d51 Review folllow ups (#5444)
* Remove StandardPlane docs

Signed-off-by: Nick Cameron <nrc@ncameron.org>

* Add a struct for encapsualting an f64 and a type

Signed-off-by: Nick Cameron <nrc@ncameron.org>

---------

Signed-off-by: Nick Cameron <nrc@ncameron.org>
2025-02-21 12:36:21 +13:00
59b1c414f0 fix: E2E test assumes codemirror error is present when it is lazy loaded (#5446)
* fix: test is written incorrectly, assumes codemirror has DOM content when it does not

* fix: auto fmt fixes
2025-02-20 23:33:13 +00:00
fd07b8cff5 Fixes to docs (#5440)
* updates

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

* updates

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

* clenaup

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

---------

Signed-off-by: Jess Frazelle <github@jessfraz.com>
2025-02-20 20:49:27 +00:00
21efb2c0bd Support warning and non-fatal errors when executing (#5431)
* Support warning and non-fatal errors when executing

Signed-off-by: Nick Cameron <nrc@ncameron.org>

* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)

* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)

---------

Signed-off-by: Nick Cameron <nrc@ncameron.org>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2025-02-21 09:30:44 +13:00
30029a63a1 Fix kcl file opening on Windows (double click) on second instance (#5420)
* WIP: Double-clicking on .kcl file on Windows redirects to the home page if the app is already open
Fixes #5412

* Add deep link test case for linux

* Add mac tests

* Lint and win tests

* Fix e2e tests

* Logs everywhere

* windows weird? yup

* More logzzz maybe it's not windows

* Remove :/// replacement. Add catch log

* Fix and clean up

* FIx lint

* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)

* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)

* More lint

* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)

* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)

* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)

* Clean up tests further

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2025-02-20 15:23:39 -05:00
9f5003cafc Make z-index relation between sketch scene items explicit and colocated (#5435)
* Set up start of semantic z-index layers in tailwind.config.js

* Use first two active semantic z-index layers to fix just this issue
2025-02-20 18:53:35 +00:00
5232e1d40a Bump kcl-samples manifest fallback (#5434)
I think this is going away very soon but I don't want it to annoy
anyone's work in the meantime.
2025-02-20 18:36:22 +00:00
23c25c2b50 Patch test with longer timeout (#5438)
Also adds a TODO with a link to
https://github.com/KittyCAD/modeling-app/issues/5437 to track the
underlying issue
2025-02-20 17:14:43 +00:00
50273c0edc Fix kcl-lib derive-docs version (#5436) 2025-02-20 12:05:36 -05:00
8a03bf50e3 make multiple sketches on same face individually editable (#5430)
make multipl sketches individuall editable
2025-02-20 10:14:35 -05:00
7500ef0065 Declare parts of std in KCL rather than Rust (#5147)
Declare std in KCL
2025-02-20 19:33:21 +13:00
099c48cd63 better docs on solids and sketches (#5428)
* updates

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

* fix docs;

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

* updates

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

* updates

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

* updates

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

* updates

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

* updates

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

* updates

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

* updates

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

* updates

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

* parens

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

* parens

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

---------

Signed-off-by: Jess Frazelle <github@jessfraz.com>
2025-02-20 03:48:27 +00:00
f35cd3ef26 Generalise and simplify offsetPlane (#5429)
* Generalise and simplify offsetPlane

Signed-off-by: Nick Cameron <nrc@ncameron.org>

* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)

* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)

---------

Signed-off-by: Nick Cameron <nrc@ncameron.org>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2025-02-20 15:55:29 +13:00
695c432d1e CM KCL: highlight property names, labeled args and annotations (#5386)
* CM KCL: highlight property names in objects

* CM KCL: highlight arg labels in fn calls

* CM KCL: highlight annotations

* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)

---------

Co-authored-by: Matt Mundell <matt@mundell.me>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2025-02-20 01:17:18 +00:00
2835665a6a KCL: Script for releasing (#5422) 2025-02-19 16:56:51 -06:00
45707d2974 More numeric types baby steps (#5388)
* Add units to Paths

Signed-off-by: Nick Cameron <nrc@ncameron.org>

* Add some NumericType combination functions

Signed-off-by: Nick Cameron <nrc@ncameron.org>

* Fix docs/json/snippets generation from schemas

Signed-off-by: Nick Cameron <nrc@ncameron.org>

---------

Signed-off-by: Nick Cameron <nrc@ncameron.org>
2025-02-20 10:12:37 +13:00
b2e1d21d45 Add Delete to right-click context menu of feature tree operations (#5302)
* Revert "Revert multi-profile (#4812)"

This reverts commit efe8089b08.

* fix poor 1000ms wait UX

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

* trigger CI

* Add Rust side artifacts for startSketchOn face or plane (#4834)

* Add Rust side artifacts for startSketchOn face or plane

* move ast digging

---------

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

* lint

* lint

* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-macos-8-cores)

* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)

* A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-16-cores)

* trigger CI

* chore: disabled file watcher which prevents faster file write (#4835)

* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)

* partial fixes

* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)

* Trigger CI

* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)

* Trigger CI

* Fix up all the tests

* Fix partial execution

* wip

* WIP

* wip

* rust changes to make three point confrom to same as others since we're not ready with name params yet

* most of the fix for 3 point circle

* get overlays working for circle three point

* fmt

* fix types

* cargo fmt

* add face codef ref for walls and caps

* fix sketch on face after updates to rust side artifact graph

* some things needed for multi-profile tests

* bad attempts at fixing rust

* more

* more

* fix rust

* more rust fixes

* overlay fix

* remove duplicate test

* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)

* lint and typing

* maybe fix a unit test

* small thing

* WIP: Add Delete right click menu item to Feature Tree
Copying code around
Fixes #5090

* I don't know why it works

* WIP

* fix circ dep

* fix unit test

* fix some tests

* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)

* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)

* Working deletion machine loo

* Working helix deletion

* Extend deletion to more things

* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)

* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)

* fix sweep point-and-click test

* fix more tests and add a fix me

* fix more tests

* fix electron specific test

* tsc

* more test tweaks

* update docs

* commint snaps?

* is clippy happy now?

* clippy again

* test works now without me changing anything big-fixed-itself

* small bug

* make three point have cross hair to make it consistent with othe rtools

* fix up state diagram

* fmt

* add draft point for first click of three point circ

* 1 test for three point circle

* 2 test for three point circle

* clean up

* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)

* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)

* remove bad doc comment

* remove test skip

* remove onboarding test changes

* Update src/lang/modifyAst.ts

Co-authored-by: Jonathan Tran <jonnytran@gmail.com>

* Update output from simulation tests

* Fix to use correct source ranges

This also reduces cloning.

* Change back to skipping face cap none and both

* Update output after changing back to skipping none and both

* Fix clippy warning

* fix profile start snap bug

* WIP: migrate to actor

* add path ids to cap

* fix going into edit sketch

* make other startSketchOn's work

* fix snapshot test

* explain function name

* Update src/lib/rectangleTool.ts

Co-authored-by: Frank Noirot <frank@zoo.dev>

* rename error

* remove file tree from diff

* Update src/clientSideScene/segments.ts

Co-authored-by: Frank Noirot <frank@zoo.dev>

* nit

* Continue actor migration

* Prevent double write to KCL code on revolve

* Clean up

* Update output after adding cap-to-path graph edge

* Clean up

* Update machine diag

* Update context menu hotkey class

* Fix edit/select sketch-on-cap via feature tree

* clean up for face codeRef

* fix changing tools part way through circle/rect tools

* fix delete of circle profile

* fix close profiles

* fix closing profile bug (tangentArcTo being ignored)

* remove stale comment

* Delete paths associated with sketch when the sketch plane is deleted

* Add support for deleting sketches on caps (not walls)

* get delet working for walls

* make delet of extrusions work for multi profile

* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)

* Delete the sketch statement too on the cap and wall cases

* Don't write to file in `split-sketch-pipe-if-needed` unless necessary

* Don't wait for file write to complete within `updateEditorWithAstAndWriteToFile`
It is already debounced internally. If we await it, we will have to wait for a debounced timeout

* Fix bad conflict resolution

* Fix a few things post merge

* Add guard back, fixing tests

* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)

* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)

* Add e2e test

* Working tests on ubuntu

* Another one

* Update src/machines/featureTreeMachine.ts

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

* Fix sketch test
@Irev-Dev's suggestion

---------

Co-authored-by: Kurt Hutten Irev-Dev <k.hutten@protonmail.ch>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Jonathan Tran <jonnytran@gmail.com>
Co-authored-by: Kevin Nadro <nadr0@users.noreply.github.com>
Co-authored-by: 49lf <ircsurfer33@gmail.com>
Co-authored-by: Frank Noirot <frank@zoo.dev>
Co-authored-by: Frank Noirot <frankjohnson1993@gmail.com>
2025-02-19 18:43:27 +00:00
b98f5605b6 [bugfix] Fix user settings opening (#5414)
* Create .gitattributes

* Fix projectPath URI decoding

* Try to enforce UTF-8 encoding on all files except Windows-specific
scripts

* edit file encoding

* edit gitattributes

* Update kcl-samples

* fmt
2025-02-19 13:31:07 -05:00
c050e03df1 Fix sketch test (#5425)
@Irev-Dev's suggestion
2025-02-19 13:30:53 -05:00
b6fa4325f0 Bump modeling-cmds from 0.2.93 to 0.2.97 (#5327)
* Bump modeling-cmds from 0.2.93 to 0.2.96

Among other things, this switches the default units for imported file
formats to millimeters from meters.

* Fix wasm build error

* Upgrade to the latest modeling-cmds 0.2.97
2025-02-19 10:30:26 -08:00
0804aecc63 Fix typo in error msg (#5411)
Part of https://github.com/KittyCAD/modeling-app/issues/5355
2025-02-19 17:40:17 +00:00
304 changed files with 60128 additions and 20530 deletions

13
.gitattributes vendored Normal file
View File

@ -0,0 +1,13 @@
# Set default behavior to automatically normalize line endings.
* text=auto
# Force batch scripts to always use CRLF line endings so that if a repo is accessed
# in Windows via a file share from Linux, the scripts will work.
*.{cmd,[cC][mM][dD]} text working-tree-encoding=UTF-16LE eol=CRLF
*.{bat,[bB][aA][tT]} text working-tree-encoding=UTF-16LE eol=CRLF
*.{ics,[iI][cC][sS]} text working-tree-encoding=UTF-16LE eol=CRLF
*.{ps1,[iP][sS][1]} text working-tree-encoding=UTF-16LE eol=CRLF
# Force bash scripts to always use LF line endings so that if a repo is accessed
# in Unix via a file share from Windows, the scripts will work.
*.sh text eol=lfol=lf

3
.gitignore vendored
View File

@ -41,9 +41,12 @@ e2e/playwright/playwright-secrets.env
e2e/playwright/temp1.png
e2e/playwright/temp2.png
e2e/playwright/temp3.png
# this will be overridden for specific directories
e2e/playwright/**/*.png
# exports from snapshot-tests.spec.ts "exports of each format should work"
e2e/playwright/export-snapshots/*
!e2e/playwright/export-snapshots/*.png
!e2e/playwright/snapshot-tests.spec.ts-snapshots/*.png
/kcl-samples
/test-results/

15
docs/kcl/HALF_TURN.md Normal file
View File

@ -0,0 +1,15 @@
---
title: "HALF_TURN"
excerpt: ""
layout: manual
---
```js
HALF_TURN: number(deg) = 180deg
```

15
docs/kcl/QUARTER_TURN.md Normal file
View File

@ -0,0 +1,15 @@
---
title: "QUARTER_TURN"
excerpt: ""
layout: manual
---
```js
QUARTER_TURN: number(deg) = 90deg
```

View File

@ -0,0 +1,15 @@
---
title: "THREE_QUARTER_TURN"
excerpt: ""
layout: manual
---
```js
THREE_QUARTER_TURN: number(deg) = 270deg
```

15
docs/kcl/ZERO.md Normal file
View File

@ -0,0 +1,15 @@
---
title: "ZERO"
excerpt: ""
layout: manual
---
```js
ZERO: number = 0
```

View File

@ -18,12 +18,12 @@ chamfer(data: ChamferData, solid: Solid, tag?: TagDeclarator) -> Solid
| Name | Type | Description | Required |
|----------|------|-------------|----------|
| `data` | [`ChamferData`](/docs/kcl/types/ChamferData) | Data for chamfers. | Yes |
| `solid` | [`Solid`](/docs/kcl/types/Solid) | An solid is a collection of extrude surfaces. | Yes |
| `solid` | [`Solid`](/docs/kcl/types/Solid) | A solid is a collection of extrude surfaces. | Yes |
| `tag` | [`TagDeclarator`](/docs/kcl/types#tag-declaration) | | No |
### Returns
[`Solid`](/docs/kcl/types/Solid) - An solid is a collection of extrude surfaces.
[`Solid`](/docs/kcl/types/Solid) - A solid is a collection of extrude surfaces.
### Examples

32
docs/kcl/const_E.md Normal file

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,15 @@
---
title: "HALF_TURN"
excerpt: ""
layout: manual
---
```js
HALF_TURN: number(deg) = 180deg
```

28
docs/kcl/const_PI.md Normal file

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,15 @@
---
title: "QUARTER_TURN"
excerpt: ""
layout: manual
---
```js
QUARTER_TURN: number(deg) = 90deg
```

32
docs/kcl/const_TAU.md Normal file

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,15 @@
---
title: "THREE_QUARTER_TURN"
excerpt: ""
layout: manual
---
```js
THREE_QUARTER_TURN: number(deg) = 270deg
```

15
docs/kcl/const_ZERO.md Normal file
View File

@ -0,0 +1,15 @@
---
title: "ZERO"
excerpt: ""
layout: manual
---
```js
ZERO: number = 0
```

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,15 @@
---
title: "std::prelude::HALF_TURN"
excerpt: ""
layout: manual
---
```js
std::prelude::HALF_TURN: number(deg) = 180deg
```

View File

@ -0,0 +1,15 @@
---
title: "std::prelude::QUARTER_TURN"
excerpt: ""
layout: manual
---
```js
std::prelude::QUARTER_TURN: number(deg) = 90deg
```

View File

@ -0,0 +1,15 @@
---
title: "std::prelude::THREE_QUARTER_TURN"
excerpt: ""
layout: manual
---
```js
std::prelude::THREE_QUARTER_TURN: number(deg) = 270deg
```

View File

@ -0,0 +1,15 @@
---
title: "std::prelude::ZERO"
excerpt: ""
layout: manual
---
```js
std::prelude::ZERO: number = 0
```

File diff suppressed because one or more lines are too long

View File

@ -4,9 +4,11 @@ excerpt: "Return the value of Eulers number `e`."
layout: manual
---
**WARNING:** This function is deprecated.
Return the value of Eulers number `e`.
**DEPRECATED** use the constant E
```js
e() -> number

View File

@ -18,12 +18,12 @@ fillet(data: FilletData, solid: Solid, tag?: TagDeclarator) -> Solid
| Name | Type | Description | Required |
|----------|------|-------------|----------|
| `data` | [`FilletData`](/docs/kcl/types/FilletData) | Data for fillets. | Yes |
| `solid` | [`Solid`](/docs/kcl/types/Solid) | An solid is a collection of extrude surfaces. | Yes |
| `solid` | [`Solid`](/docs/kcl/types/Solid) | A solid is a collection of extrude surfaces. | Yes |
| `tag` | [`TagDeclarator`](/docs/kcl/types#tag-declaration) | | No |
### Returns
[`Solid`](/docs/kcl/types/Solid) - An solid is a collection of extrude surfaces.
[`Solid`](/docs/kcl/types/Solid) - A solid is a collection of extrude surfaces.
### Examples

View File

@ -18,11 +18,11 @@ helixRevolutions(data: HelixRevolutionsData, solid: Solid) -> Solid
| Name | Type | Description | Required |
|----------|------|-------------|----------|
| `data` | [`HelixRevolutionsData`](/docs/kcl/types/HelixRevolutionsData) | Data for helix revolutions. | Yes |
| `solid` | [`Solid`](/docs/kcl/types/Solid) | An solid is a collection of extrude surfaces. | Yes |
| `solid` | [`Solid`](/docs/kcl/types/Solid) | A solid is a collection of extrude surfaces. | Yes |
### Returns
[`Solid`](/docs/kcl/types/Solid) - An solid is a collection of extrude surfaces.
[`Solid`](/docs/kcl/types/Solid) - A solid is a collection of extrude surfaces.
### Examples

View File

@ -18,11 +18,11 @@ hollow(thickness: number, solid: Solid) -> Solid
| Name | Type | Description | Required |
|----------|------|-------------|----------|
| `thickness` | `number` | | Yes |
| `solid` | [`Solid`](/docs/kcl/types/Solid) | An solid is a collection of extrude surfaces. | Yes |
| `solid` | [`Solid`](/docs/kcl/types/Solid) | A solid is a collection of extrude surfaces. | Yes |
### Returns
[`Solid`](/docs/kcl/types/Solid) - An solid is a collection of extrude surfaces.
[`Solid`](/docs/kcl/types/Solid) - A solid is a collection of extrude surfaces.
### Examples

View File

@ -9,6 +9,7 @@ layout: manual
* [Types](kcl/types)
* [Modules](kcl/modules)
* [Known Issues](kcl/KNOWN-ISSUES)
* **`std`**
* [`abs`](kcl/abs)
* [`acos`](kcl/acos)
* [`angleToMatchLengthX`](kcl/angleToMatchLengthX)
@ -38,8 +39,6 @@ layout: manual
* [`circleThreePoint`](kcl/circleThreePoint)
* [`close`](kcl/close)
* [`cm`](kcl/cm)
* [`cos`](kcl/cos)
* [`e`](kcl/e)
* [`extrude`](kcl/extrude)
* [`fillet`](kcl/fillet)
* [`floor`](kcl/floor)
@ -76,7 +75,6 @@ layout: manual
* [`patternLinear3d`](kcl/patternLinear3d)
* [`patternTransform`](kcl/patternTransform)
* [`patternTransform2d`](kcl/patternTransform2d)
* [`pi`](kcl/pi)
* [`polar`](kcl/polar)
* [`polygon`](kcl/polygon)
* [`pop`](kcl/pop)
@ -98,17 +96,14 @@ layout: manual
* [`segStartX`](kcl/segStartX)
* [`segStartY`](kcl/segStartY)
* [`shell`](kcl/shell)
* [`sin`](kcl/sin)
* [`sqrt`](kcl/sqrt)
* [`startProfileAt`](kcl/startProfileAt)
* [`startSketchOn`](kcl/startSketchOn)
* [`sweep`](kcl/sweep)
* [`tan`](kcl/tan)
* [`tangentToEnd`](kcl/tangentToEnd)
* [`tangentialArc`](kcl/tangentialArc)
* [`tangentialArcTo`](kcl/tangentialArcTo)
* [`tangentialArcToRelative`](kcl/tangentialArcToRelative)
* [`tau`](kcl/tau)
* [`toDegrees`](kcl/toDegrees)
* [`toRadians`](kcl/toRadians)
* [`xLine`](kcl/xLine)
@ -116,3 +111,15 @@ layout: manual
* [`yLine`](kcl/yLine)
* [`yLineTo`](kcl/yLineTo)
* [`yd`](kcl/yd)
* **`std::math`**
* [`E`](kcl/const_std-math-E)
* [`PI`](kcl/const_std-math-PI)
* [`TAU`](kcl/const_std-math-TAU)
* [`cos`](kcl/std-math-cos)
* [`sin`](kcl/std-math-sin)
* [`tan`](kcl/std-math-tan)
* **`std::prelude`**
* [`HALF_TURN`](kcl/const_std-prelude-HALF_TURN)
* [`QUARTER_TURN`](kcl/const_std-prelude-QUARTER_TURN)
* [`THREE_QUARTER_TURN`](kcl/const_std-prelude-THREE_QUARTER_TURN)
* [`ZERO`](kcl/const_std-prelude-ZERO)

View File

@ -25,7 +25,7 @@ loft(sketches: [Sketch], v_degree: NonZeroU32, bez_approximate_rational: bool, b
### Returns
[`Solid`](/docs/kcl/types/Solid) - An solid is a collection of extrude surfaces.
[`Solid`](/docs/kcl/types/Solid) - A solid is a collection of extrude surfaces.
### Examples

View File

@ -9,7 +9,7 @@ Offset a plane by a distance along its normal.
For example, if you offset the 'XZ' plane by 10, the new plane will be parallel to the 'XZ' plane and 10 units away from it.
```js
offsetPlane(std_plane: StandardPlane, offset: number) -> Plane
offsetPlane(plane: PlaneData, offset: number) -> Plane
```
@ -17,7 +17,7 @@ offsetPlane(std_plane: StandardPlane, offset: number) -> Plane
| Name | Type | Description | Required |
|----------|------|-------------|----------|
| `std_plane` | [`StandardPlane`](/docs/kcl/types/StandardPlane) | Which standard plane (e.g. XY) should this new plane be created from? | Yes |
| `plane` | [`PlaneData`](/docs/kcl/types/PlaneData) | The plane (e.g. 'XY') which this new plane is created from. | Yes |
| `offset` | `number` | Distance from the standard plane this new plane will be created at. | Yes |
### Returns

View File

@ -4,9 +4,11 @@ excerpt: "Return the value of `pi`. Archimedes constant (π)."
layout: manual
---
**WARNING:** This function is deprecated.
Return the value of `pi`. Archimedes constant (π).
**DEPRECATED** use the constant PI
```js
pi() -> number

View File

@ -76,7 +76,7 @@ assertEqual(sum, 6, 0.00001, "1 + 2 + 3 summed is 6")
// Declare a function that sketches a decagon.
fn decagon(radius) {
// Each side of the decagon is turned this many degrees from the previous angle.
stepAngle = 1 / 10 * tau()
stepAngle = 1 / 10 * TAU
// Start the decagon sketch at this point.
startOfDecagonSketch = startSketchOn('XY')
@ -97,7 +97,7 @@ fn decagon(radius) {
/* The `decagon` above is basically like this pseudo-code:
fn decagon(radius):
stepAngle = (1/10) * tau()
stepAngle = (1/10) * TAU
plane = startSketchOn('XY')
startOfDecagonSketch = startProfileAt([(cos(0)*radius), (sin(0) * radius)], plane)

View File

@ -24,7 +24,7 @@ revolve(data: RevolveData, sketch: Sketch) -> Solid
### Returns
[`Solid`](/docs/kcl/types/Solid) - An solid is a collection of extrude surfaces.
[`Solid`](/docs/kcl/types/Solid) - A solid is a collection of extrude surfaces.
### Examples

File diff suppressed because one or more lines are too long

View File

@ -6,7 +6,15 @@ layout: manual
Start a new 2-dimensional sketch on a specific plane or face.
### Sketch on Face Behavior
There are some important behaviors to understand when sketching on a face:
The resulting sketch will _include_ the face and thus Solid that was sketched on. So say you were to export the resulting Sketch / Solid from a sketch on a face, you would get both the artifact of the sketch on the face and the parent face / Solid itself.
This is important to understand because if you were to then sketch on the resulting Solid, it would again include the face and parent Solid that was sketched on. This could go on indefinitely.
The point is if you want to export the result of a sketch on a face, you only need to export the final Solid that was created from the sketch on the face, since it will include all the parent faces and Solids.
```js
startSketchOn(data: SketchData, tag?: FaceTag) -> SketchSurface

44
docs/kcl/std-math-cos.md Normal file

File diff suppressed because one or more lines are too long

44
docs/kcl/std-math-sin.md Normal file

File diff suppressed because one or more lines are too long

44
docs/kcl/std-math-tan.md Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

View File

@ -24,7 +24,7 @@ sweep(sketch: Sketch, path: SweepPath, sectional?: bool, tolerance?: number) ->
### Returns
[`Solid`](/docs/kcl/types/Solid) - An solid is a collection of extrude surfaces.
[`Solid`](/docs/kcl/types/Solid) - A solid is a collection of extrude surfaces.
### Examples

File diff suppressed because one or more lines are too long

View File

@ -4,9 +4,11 @@ excerpt: "Return the value of `tau`. The full circle constant (τ). Equal to 2π
layout: manual
---
**WARNING:** This function is deprecated.
Return the value of `tau`. The full circle constant (τ). Equal to 2π.
**DEPRECATED** use the constant TAU
```js
tau() -> number

View File

@ -18,6 +18,7 @@ A base path.
|----------|------|-------------|----------|
| `from` |`[number, number]`| The from point. | No |
| `to` |`[number, number]`| The to point. | No |
| `units` |[`UnitLen`](/docs/kcl/types/UnitLen)| A unit of length. | No |
| `tag` |[`TagDeclarator`](/docs/kcl/types#tag-declaration)| The tag of the path. | No |
| `__geoMeta` |[`GeoMeta`](/docs/kcl/types/GeoMeta)| Metadata. | No |

View File

@ -1,9 +1,10 @@
---
title: "EnvironmentRef"
excerpt: ""
excerpt: "An index pointing to a snapshot within a specific (unspecified) environment."
layout: manual
---
An index pointing to a snapshot within a specific (unspecified) environment.
[`SnapshotRef`](/docs/kcl/types/SnapshotRef)

View File

@ -28,7 +28,7 @@ An extrude plane.
| `faceId` |`string`| The face id for the extrude plane. | No |
| `tag` |[`TagDeclarator`](/docs/kcl/types#tag-declaration)| The tag. | No |
| `id` |`string`| The id of the geometry. | No |
| `sourceRange` |`SourceRange`| The source range. | No |
| `sourceRange` |[`SourceRange`](/docs/kcl/types/SourceRange)| The source range. | No |
----
@ -48,7 +48,7 @@ An extruded arc.
| `faceId` |`string`| The face id for the extrude plane. | No |
| `tag` |[`TagDeclarator`](/docs/kcl/types#tag-declaration)| The tag. | No |
| `id` |`string`| The id of the geometry. | No |
| `sourceRange` |`SourceRange`| The source range. | No |
| `sourceRange` |[`SourceRange`](/docs/kcl/types/SourceRange)| The source range. | No |
----
@ -68,7 +68,7 @@ Geometry metadata.
| `faceId` |`string`| The id for the chamfer surface. | No |
| `tag` |[`TagDeclarator`](/docs/kcl/types#tag-declaration)| The tag. | No |
| `id` |`string`| The id of the geometry. | No |
| `sourceRange` |`SourceRange`| The source range. | No |
| `sourceRange` |[`SourceRange`](/docs/kcl/types/SourceRange)| The source range. | No |
----
@ -88,7 +88,7 @@ Geometry metadata.
| `faceId` |`string`| The id for the fillet surface. | No |
| `tag` |[`TagDeclarator`](/docs/kcl/types#tag-declaration)| The tag. | No |
| `id` |`string`| The id of the geometry. | No |
| `sourceRange` |`SourceRange`| The source range. | No |
| `sourceRange` |[`SourceRange`](/docs/kcl/types/SourceRange)| The source range. | No |
----

View File

@ -23,7 +23,7 @@ A face.
| `yAxis` |[`Point3d`](/docs/kcl/types/Point3d)| What should the face's Y axis be? | No |
| `zAxis` |[`Point3d`](/docs/kcl/types/Point3d)| The z-axis (normal). | No |
| `solid` |[`Solid`](/docs/kcl/types/Solid)| The solid the face is on. | No |
| `units` |[`UnitLen`](/docs/kcl/types/UnitLen)| A face. | No |
| `units` |[`UnitLen`](/docs/kcl/types/UnitLen)| A unit of length. | No |
| `__meta` |`[` [`Metadata`](/docs/kcl/types/Metadata) `]`| | No |

View File

@ -11,7 +11,6 @@ A tag for a face.
**This schema accepts any of the following:**
A tag for a face.
[`StartOrEnd`](/docs/kcl/types/StartOrEnd)

View File

@ -17,6 +17,6 @@ Geometry metadata.
| Property | Type | Description | Required |
|----------|------|-------------|----------|
| `id` |`string`| The id of the geometry. | No |
| `sourceRange` |`SourceRange`| The source range. | No |
| `sourceRange` |[`SourceRange`](/docs/kcl/types/SourceRange)| The source range. | No |

View File

@ -21,7 +21,7 @@ A helix.
| `revolutions` |`number`| Number of revolutions. | No |
| `angleStart` |`number`| Start angle (in degrees). | No |
| `ccw` |`boolean`| Is the helix rotation counter clockwise? | No |
| `units` |[`UnitLen`](/docs/kcl/types/UnitLen)| A helix. | No |
| `units` |[`UnitLen`](/docs/kcl/types/UnitLen)| A unit of length. | No |
| `__meta` |`[` [`Metadata`](/docs/kcl/types/Metadata) `]`| | No |

View File

@ -21,7 +21,7 @@ A helix.
| `revolutions` |`number`| Number of revolutions. | No |
| `angleStart` |`number`| Start angle (in degrees). | No |
| `ccw` |`boolean`| Is the helix rotation counter clockwise? | No |
| `units` |[`UnitLen`](/docs/kcl/types/UnitLen)| A helix. | No |
| `units` |[`UnitLen`](/docs/kcl/types/UnitLen)| A unit of length. | No |
| `__meta` |`[` [`Metadata`](/docs/kcl/types/Metadata) `]`| | No |

View File

@ -59,7 +59,7 @@ Any KCL value.
|----------|------|-------------|----------|
| `type` |enum: `Number`| | No |
| `value` |`number`| | No |
| `ty` |[`NumericType`](/docs/kcl/types/NumericType)| Any KCL value. | No |
| `ty` |[`NumericType`](/docs/kcl/types/NumericType)| | No |
| `__meta` |`[` [`Metadata`](/docs/kcl/types/Metadata) `]`| | No |
@ -164,7 +164,7 @@ Any KCL value.
| Property | Type | Description | Required |
|----------|------|-------------|----------|
| `type` |enum: [`Plane`](/docs/kcl/types/Plane)| | No |
| `value` |[`Plane`](/docs/kcl/types/Plane)| Any KCL value. | No |
| `value` |[`Plane`](/docs/kcl/types/Plane)| A plane. | No |
----
@ -180,7 +180,7 @@ Any KCL value.
| Property | Type | Description | Required |
|----------|------|-------------|----------|
| `type` |enum: [`Face`](/docs/kcl/types/Face)| | No |
| `value` |[`Face`](/docs/kcl/types/Face)| Any KCL value. | No |
| `value` |[`Face`](/docs/kcl/types/Face)| A face. | No |
----
@ -196,7 +196,7 @@ Any KCL value.
| Property | Type | Description | Required |
|----------|------|-------------|----------|
| `type` |enum: [`Sketch`](/docs/kcl/types/Sketch)| | No |
| `value` |[`Sketch`](/docs/kcl/types/Sketch)| Any KCL value. | No |
| `value` |[`Sketch`](/docs/kcl/types/Sketch)| A sketch is a collection of paths. | No |
----
@ -228,7 +228,7 @@ Any KCL value.
| Property | Type | Description | Required |
|----------|------|-------------|----------|
| `type` |enum: [`Solid`](/docs/kcl/types/Solid)| | No |
| `value` |[`Solid`](/docs/kcl/types/Solid)| Any KCL value. | No |
| `value` |[`Solid`](/docs/kcl/types/Solid)| A solid is a collection of extrude surfaces. | No |
----
@ -260,7 +260,7 @@ Any KCL value.
| Property | Type | Description | Required |
|----------|------|-------------|----------|
| `type` |enum: [`Helix`](/docs/kcl/types/Helix)| | No |
| `value` |[`Helix`](/docs/kcl/types/Helix)| Any KCL value. | No |
| `value` |[`Helix`](/docs/kcl/types/Helix)| A helix. | No |
----
@ -295,7 +295,7 @@ Data for an imported geometry.
| Property | Type | Description | Required |
|----------|------|-------------|----------|
| `type` |enum: `Function`| | No |
| `memory` |[`EnvironmentRef`](/docs/kcl/types/EnvironmentRef)| Any KCL value. | No |
| `memory` |[`EnvironmentRef`](/docs/kcl/types/EnvironmentRef)| | No |
| `__meta` |`[` [`Metadata`](/docs/kcl/types/Metadata) `]`| | No |
@ -312,7 +312,7 @@ Data for an imported geometry.
| Property | Type | Description | Required |
|----------|------|-------------|----------|
| `type` |enum: `Module`| | No |
| `value` |[`ModuleId`](/docs/kcl/types/ModuleId)| Any KCL value. | No |
| `value` |[`ModuleId`](/docs/kcl/types/ModuleId)| Identifier of a source file. Uses a u32 to keep the size small. | No |
| `__meta` |`[` [`Metadata`](/docs/kcl/types/Metadata) `]`| | No |
@ -329,7 +329,7 @@ Data for an imported geometry.
| Property | Type | Description | Required |
|----------|------|-------------|----------|
| `type` |enum: [`KclNone`](/docs/kcl/types/KclNone)| | No |
| `value` |[`KclNone`](/docs/kcl/types/KclNone)| Any KCL value. | No |
| `value` |[`KclNone`](/docs/kcl/types/KclNone)| KCL value for an optional parameter which was not given an argument. (remember, parameters are in the function declaration, arguments are in the function call/application). | No |
| `__meta` |`[` [`Metadata`](/docs/kcl/types/Metadata) `]`| | No |

View File

@ -16,6 +16,6 @@ Metadata.
| Property | Type | Description | Required |
|----------|------|-------------|----------|
| `sourceRange` |`SourceRange`| The source range. | No |
| `sourceRange` |[`SourceRange`](/docs/kcl/types/SourceRange)| The source range. | No |

View File

@ -33,6 +33,7 @@ layout: manual
----
A unit of length.
**Type:** `object`
@ -140,6 +141,7 @@ layout: manual
----
A unit of angle.
**Type:** `object`
@ -209,8 +211,8 @@ layout: manual
| Property | Type | Description | Required |
|----------|------|-------------|----------|
| `type` |enum: `Default`| | No |
| `len` |[`UnitLen`](/docs/kcl/types/UnitLen)| | No |
| `angle` |[`UnitAngle`](/docs/kcl/types/UnitAngle)| | No |
| `len` |[`UnitLen`](/docs/kcl/types/UnitLen)| A unit of length. | No |
| `angle` |[`UnitAngle`](/docs/kcl/types/UnitAngle)| A unit of angle. | No |
----

View File

@ -27,6 +27,7 @@ A path that goes to a point.
| `type` |enum: `ToPoint`| | No |
| `from` |`[number, number]`| The from point. | No |
| `to` |`[number, number]`| The to point. | No |
| `units` |[`UnitLen`](/docs/kcl/types/UnitLen)| A unit of length. | No |
| `tag` |[`TagDeclarator`](/docs/kcl/types#tag-declaration)| The tag of the path. | No |
| `__geoMeta` |[`GeoMeta`](/docs/kcl/types/GeoMeta)| Metadata. | No |
@ -49,6 +50,7 @@ A arc that is tangential to the last path segment that goes to a point
| `ccw` |`boolean`| arc's direction | No |
| `from` |`[number, number]`| The from point. | No |
| `to` |`[number, number]`| The to point. | No |
| `units` |[`UnitLen`](/docs/kcl/types/UnitLen)| A unit of length. | No |
| `tag` |[`TagDeclarator`](/docs/kcl/types#tag-declaration)| The tag of the path. | No |
| `__geoMeta` |[`GeoMeta`](/docs/kcl/types/GeoMeta)| Metadata. | No |
@ -71,6 +73,7 @@ A arc that is tangential to the last path segment
| `ccw` |`boolean`| arc's direction | No |
| `from` |`[number, number]`| The from point. | No |
| `to` |`[number, number]`| The to point. | No |
| `units` |[`UnitLen`](/docs/kcl/types/UnitLen)| A unit of length. | No |
| `tag` |[`TagDeclarator`](/docs/kcl/types#tag-declaration)| The tag of the path. | No |
| `__geoMeta` |[`GeoMeta`](/docs/kcl/types/GeoMeta)| Metadata. | No |
@ -94,6 +97,7 @@ a complete arc
| `ccw` |`boolean`| arc's direction This is used to compute the tangential angle. | No |
| `from` |`[number, number]`| The from point. | No |
| `to` |`[number, number]`| The to point. | No |
| `units` |[`UnitLen`](/docs/kcl/types/UnitLen)| A unit of length. | No |
| `tag` |[`TagDeclarator`](/docs/kcl/types#tag-declaration)| The tag of the path. | No |
| `__geoMeta` |[`GeoMeta`](/docs/kcl/types/GeoMeta)| Metadata. | No |
@ -117,6 +121,7 @@ A base path.
| `p3` |`[number, number]`| Point 3 of the circle | No |
| `from` |`[number, number]`| The from point. | No |
| `to` |`[number, number]`| The to point. | No |
| `units` |[`UnitLen`](/docs/kcl/types/UnitLen)| A unit of length. | No |
| `tag` |[`TagDeclarator`](/docs/kcl/types#tag-declaration)| The tag of the path. | No |
| `__geoMeta` |[`GeoMeta`](/docs/kcl/types/GeoMeta)| Metadata. | No |
@ -138,6 +143,7 @@ A path that is horizontal.
| `x` |`number`| The x coordinate. | No |
| `from` |`[number, number]`| The from point. | No |
| `to` |`[number, number]`| The to point. | No |
| `units` |[`UnitLen`](/docs/kcl/types/UnitLen)| A unit of length. | No |
| `tag` |[`TagDeclarator`](/docs/kcl/types#tag-declaration)| The tag of the path. | No |
| `__geoMeta` |[`GeoMeta`](/docs/kcl/types/GeoMeta)| Metadata. | No |
@ -160,6 +166,7 @@ An angled line to.
| `y` |`number`| The y coordinate. | No |
| `from` |`[number, number]`| The from point. | No |
| `to` |`[number, number]`| The to point. | No |
| `units` |[`UnitLen`](/docs/kcl/types/UnitLen)| A unit of length. | No |
| `tag` |[`TagDeclarator`](/docs/kcl/types#tag-declaration)| The tag of the path. | No |
| `__geoMeta` |[`GeoMeta`](/docs/kcl/types/GeoMeta)| Metadata. | No |
@ -180,6 +187,7 @@ A base path.
| `type` |enum: `Base`| | No |
| `from` |`[number, number]`| The from point. | No |
| `to` |`[number, number]`| The to point. | No |
| `units` |[`UnitLen`](/docs/kcl/types/UnitLen)| A unit of length. | No |
| `tag` |[`TagDeclarator`](/docs/kcl/types#tag-declaration)| The tag of the path. | No |
| `__geoMeta` |[`GeoMeta`](/docs/kcl/types/GeoMeta)| Metadata. | No |
@ -203,6 +211,7 @@ A circular arc, not necessarily tangential to the current point.
| `ccw` |`boolean`| True if the arc is counterclockwise. | No |
| `from` |`[number, number]`| The from point. | No |
| `to` |`[number, number]`| The to point. | No |
| `units` |[`UnitLen`](/docs/kcl/types/UnitLen)| A unit of length. | No |
| `tag` |[`TagDeclarator`](/docs/kcl/types#tag-declaration)| The tag of the path. | No |
| `__geoMeta` |[`GeoMeta`](/docs/kcl/types/GeoMeta)| Metadata. | No |

View File

@ -18,12 +18,12 @@ A plane.
|----------|------|-------------|----------|
| `id` |`string`| The id of the plane. | No |
| `artifactId` |[`ArtifactId`](/docs/kcl/types/ArtifactId)| The artifact ID. | No |
| `value` |[`PlaneType`](/docs/kcl/types/PlaneType)| A plane. | No |
| `value` |[`PlaneType`](/docs/kcl/types/PlaneType)| Type for a plane. | No |
| `origin` |[`Point3d`](/docs/kcl/types/Point3d)| Origin of the plane. | No |
| `xAxis` |[`Point3d`](/docs/kcl/types/Point3d)| What should the plane's X axis be? | No |
| `yAxis` |[`Point3d`](/docs/kcl/types/Point3d)| What should the plane's Y axis be? | No |
| `zAxis` |[`Point3d`](/docs/kcl/types/Point3d)| The z-axis (normal). | No |
| `units` |[`UnitLen`](/docs/kcl/types/UnitLen)| A plane. | No |
| `units` |[`UnitLen`](/docs/kcl/types/UnitLen)| A unit of length. | No |
| `__meta` |`[` [`Metadata`](/docs/kcl/types/Metadata) `]`| | No |

View File

@ -17,6 +17,6 @@ Data for polar coordinates.
| Property | Type | Description | Required |
|----------|------|-------------|----------|
| `angle` |`number`| The angle of the line (in degrees). | No |
| `length` |`number`| The length of the line. | No |
| `length` |[`TyF64`](/docs/kcl/types/TyF64)| The length of the line. | No |

View File

@ -6,6 +6,40 @@ layout: manual
A sketch is a collection of paths.
When you define a sketch to a variable like:
```kcl
mySketch = startSketchOn('XY')
|> startProfileAt([-12, 12], %)
|> line(end = [24, 0])
|> line(end = [0, -24])
|> line(end = [-24, 0])
|> close()
```
The `mySketch` variable will be an executed [`Sketch`](/docs/kcl/types/Sketch) object. Executed being past tense, because the engine has already executed the commands to create the sketch.
The previous sketch commands will never be executed again, in this case.
If you would like to encapsulate the commands to create the sketch any time you call it, you can use a function.
```kcl
fn createSketch() {
return startSketchOn('XY')
|> startProfileAt([-12, 12], %)
|> line(end = [24, 0])
|> line(end = [0, -24])
|> line(end = [-24, 0])
|> close()
}
```
Now, every time you call `createSketch()`, the commands will be executed and a new sketch will be created.
When you assign the result of `createSketch()` to a variable (`mySketch = createSketch()`), you are assigning the executed sketch to that variable. Meaning that the sketch `mySketch` will not be executed again.
You can still execute _new_ commands on the sketch like `extrude`, `revolve`, `loft`, etc. and the sketch will be updated.
**Type:** `object`
@ -23,7 +57,7 @@ A sketch is a collection of paths.
| `tags` |`object`| Tag identifiers that have been declared in this sketch. | No |
| `artifactId` |[`ArtifactId`](/docs/kcl/types/ArtifactId)| The original id of the sketch. This stays the same even if the sketch is is sketched on face etc. | No |
| `originalId` |`string`| | No |
| `units` |[`UnitLen`](/docs/kcl/types/UnitLen)| A sketch is a collection of paths. | No |
| `units` |[`UnitLen`](/docs/kcl/types/UnitLen)| A unit of length. | No |
| `__meta` |`[` [`Metadata`](/docs/kcl/types/Metadata) `]`| Metadata. | No |

View File

@ -11,7 +11,7 @@ Data for start sketch on. You can start a sketch on a plane or an solid.
**This schema accepts any of the following:**
Data for start sketch on. You can start a sketch on a plane or an solid.
Orientation data that can be used to construct a plane, not a plane in itself.
[`PlaneData`](/docs/kcl/types/PlaneData)
@ -23,7 +23,7 @@ Data for start sketch on. You can start a sketch on a plane or an solid.
----
Data for start sketch on. You can start a sketch on a plane or an solid.
A plane.
[`Plane`](/docs/kcl/types/Plane)
@ -35,7 +35,43 @@ Data for start sketch on. You can start a sketch on a plane or an solid.
----
Data for start sketch on. You can start a sketch on a plane or an solid.
A solid is a collection of extrude surfaces.
When you define a solid to a variable like:
```kcl
myPart = startSketchOn('XY')
|> startProfileAt([-12, 12], %)
|> line(end = [24, 0])
|> line(end = [0, -24])
|> line(end = [-24, 0])
|> close()
|> extrude(length = 6)
```
The `myPart` variable will be an executed [`Solid`](/docs/kcl/types/Solid) object. Executed being past tense, because the engine has already executed the commands to create the solid.
The previous solid commands will never be executed again, in this case.
If you would like to encapsulate the commands to create the solid any time you call it, you can use a function.
```kcl
fn createPart() {
return startSketchOn('XY')
|> startProfileAt([-12, 12], %)
|> line(end = [24, 0])
|> line(end = [0, -24])
|> line(end = [-24, 0])
|> close()
|> extrude(length = 6)
}
```
Now, every time you call `createPart()`, the commands will be executed and a new solid will be created.
When you assign the result of `createPart()` to a variable (`myPart = createPart()`), you are assigning the executed solid to that variable. Meaning that the solid `myPart` will not be executed again.
You can still execute _new_ commands on the solid like `shell`, `fillet`, `chamfer`, etc. and the solid will be updated.
[`Solid`](/docs/kcl/types/Solid)

View File

@ -11,7 +11,7 @@ A sketch surface or a sketch.
**This schema accepts any of the following:**
A sketch surface or a sketch.
A sketch type.
[`SketchSurface`](/docs/kcl/types/SketchSurface)
@ -23,7 +23,41 @@ A sketch surface or a sketch.
----
A sketch surface or a sketch.
A sketch is a collection of paths.
When you define a sketch to a variable like:
```kcl
mySketch = startSketchOn('XY')
|> startProfileAt([-12, 12], %)
|> line(end = [24, 0])
|> line(end = [0, -24])
|> line(end = [-24, 0])
|> close()
```
The `mySketch` variable will be an executed [`Sketch`](/docs/kcl/types/Sketch) object. Executed being past tense, because the engine has already executed the commands to create the sketch.
The previous sketch commands will never be executed again, in this case.
If you would like to encapsulate the commands to create the sketch any time you call it, you can use a function.
```kcl
fn createSketch() {
return startSketchOn('XY')
|> startProfileAt([-12, 12], %)
|> line(end = [24, 0])
|> line(end = [0, -24])
|> line(end = [-24, 0])
|> close()
}
```
Now, every time you call `createSketch()`, the commands will be executed and a new sketch will be created.
When you assign the result of `createSketch()` to a variable (`mySketch = createSketch()`), you are assigning the executed sketch to that variable. Meaning that the sketch `mySketch` will not be executed again.
You can still execute _new_ commands on the sketch like `extrude`, `revolve`, `loft`, etc. and the sketch will be updated.
[`Sketch`](/docs/kcl/types/Sketch)

View File

@ -14,6 +14,40 @@ A sketch or a group of sketches.
A sketch is a collection of paths.
When you define a sketch to a variable like:
```kcl
mySketch = startSketchOn('XY')
|> startProfileAt([-12, 12], %)
|> line(end = [24, 0])
|> line(end = [0, -24])
|> line(end = [-24, 0])
|> close()
```
The `mySketch` variable will be an executed [`Sketch`](/docs/kcl/types/Sketch) object. Executed being past tense, because the engine has already executed the commands to create the sketch.
The previous sketch commands will never be executed again, in this case.
If you would like to encapsulate the commands to create the sketch any time you call it, you can use a function.
```kcl
fn createSketch() {
return startSketchOn('XY')
|> startProfileAt([-12, 12], %)
|> line(end = [24, 0])
|> line(end = [0, -24])
|> line(end = [-24, 0])
|> close()
}
```
Now, every time you call `createSketch()`, the commands will be executed and a new sketch will be created.
When you assign the result of `createSketch()` to a variable (`mySketch = createSketch()`), you are assigning the executed sketch to that variable. Meaning that the sketch `mySketch` will not be executed again.
You can still execute _new_ commands on the sketch like `extrude`, `revolve`, `loft`, etc. and the sketch will be updated.
**Type:** `object`
@ -32,7 +66,7 @@ A sketch is a collection of paths.
| `tags` |`object`| Tag identifiers that have been declared in this sketch. | No |
| `artifactId` |[`ArtifactId`](/docs/kcl/types/ArtifactId)| The original id of the sketch. This stays the same even if the sketch is is sketched on face etc. | No |
| `originalId` |`string`| | No |
| `units` |[`UnitLen`](/docs/kcl/types/UnitLen)| A sketch or a group of sketches. | No |
| `units` |[`UnitLen`](/docs/kcl/types/UnitLen)| A unit of length. | No |
| `__meta` |`[` [`Metadata`](/docs/kcl/types/Metadata) `]`| Metadata. | No |

View File

@ -27,12 +27,12 @@ A plane.
| `type` |enum: `plane`| | No |
| `id` |`string`| The id of the plane. | No |
| `artifactId` |[`ArtifactId`](/docs/kcl/types/ArtifactId)| The artifact ID. | No |
| `value` |[`PlaneType`](/docs/kcl/types/PlaneType)| A sketch type. | No |
| `value` |[`PlaneType`](/docs/kcl/types/PlaneType)| Type for a plane. | No |
| `origin` |[`Point3d`](/docs/kcl/types/Point3d)| Origin of the plane. | No |
| `xAxis` |[`Point3d`](/docs/kcl/types/Point3d)| What should the plane's X axis be? | No |
| `yAxis` |[`Point3d`](/docs/kcl/types/Point3d)| What should the plane's Y axis be? | No |
| `zAxis` |[`Point3d`](/docs/kcl/types/Point3d)| The z-axis (normal). | No |
| `units` |[`UnitLen`](/docs/kcl/types/UnitLen)| A sketch type. | No |
| `units` |[`UnitLen`](/docs/kcl/types/UnitLen)| A unit of length. | No |
| `__meta` |`[` [`Metadata`](/docs/kcl/types/Metadata) `]`| | No |
@ -57,7 +57,7 @@ A face.
| `yAxis` |[`Point3d`](/docs/kcl/types/Point3d)| What should the face's Y axis be? | No |
| `zAxis` |[`Point3d`](/docs/kcl/types/Point3d)| The z-axis (normal). | No |
| `solid` |[`Solid`](/docs/kcl/types/Solid)| The solid the face is on. | No |
| `units` |[`UnitLen`](/docs/kcl/types/UnitLen)| A sketch type. | No |
| `units` |[`UnitLen`](/docs/kcl/types/UnitLen)| A unit of length. | No |
| `__meta` |`[` [`Metadata`](/docs/kcl/types/Metadata) `]`| | No |

View File

@ -1,10 +1,46 @@
---
title: "Solid"
excerpt: "An solid is a collection of extrude surfaces."
excerpt: "A solid is a collection of extrude surfaces."
layout: manual
---
An solid is a collection of extrude surfaces.
A solid is a collection of extrude surfaces.
When you define a solid to a variable like:
```kcl
myPart = startSketchOn('XY')
|> startProfileAt([-12, 12], %)
|> line(end = [24, 0])
|> line(end = [0, -24])
|> line(end = [-24, 0])
|> close()
|> extrude(length = 6)
```
The `myPart` variable will be an executed [`Solid`](/docs/kcl/types/Solid) object. Executed being past tense, because the engine has already executed the commands to create the solid.
The previous solid commands will never be executed again, in this case.
If you would like to encapsulate the commands to create the solid any time you call it, you can use a function.
```kcl
fn createPart() {
return startSketchOn('XY')
|> startProfileAt([-12, 12], %)
|> line(end = [24, 0])
|> line(end = [0, -24])
|> line(end = [-24, 0])
|> close()
|> extrude(length = 6)
}
```
Now, every time you call `createPart()`, the commands will be executed and a new solid will be created.
When you assign the result of `createPart()` to a variable (`myPart = createPart()`), you are assigning the executed solid to that variable. Meaning that the solid `myPart` will not be executed again.
You can still execute _new_ commands on the solid like `shell`, `fillet`, `chamfer`, etc. and the solid will be updated.
**Type:** `object`
@ -24,7 +60,7 @@ An solid is a collection of extrude surfaces.
| `startCapId` |`string`| The id of the extrusion start cap | No |
| `endCapId` |`string`| The id of the extrusion end cap | No |
| `edgeCuts` |`[` [`EdgeCut`](/docs/kcl/types/EdgeCut) `]`| Chamfers or fillets on this solid. | No |
| `units` |[`UnitLen`](/docs/kcl/types/UnitLen)| An solid is a collection of extrude surfaces. | No |
| `units` |[`UnitLen`](/docs/kcl/types/UnitLen)| A unit of length. | No |
| `__meta` |`[` [`Metadata`](/docs/kcl/types/Metadata) `]`| Metadata. | No |

View File

@ -12,7 +12,43 @@ A solid or a group of solids.
**This schema accepts exactly one of the following:**
An solid is a collection of extrude surfaces.
A solid is a collection of extrude surfaces.
When you define a solid to a variable like:
```kcl
myPart = startSketchOn('XY')
|> startProfileAt([-12, 12], %)
|> line(end = [24, 0])
|> line(end = [0, -24])
|> line(end = [-24, 0])
|> close()
|> extrude(length = 6)
```
The `myPart` variable will be an executed [`Solid`](/docs/kcl/types/Solid) object. Executed being past tense, because the engine has already executed the commands to create the solid.
The previous solid commands will never be executed again, in this case.
If you would like to encapsulate the commands to create the solid any time you call it, you can use a function.
```kcl
fn createPart() {
return startSketchOn('XY')
|> startProfileAt([-12, 12], %)
|> line(end = [24, 0])
|> line(end = [0, -24])
|> line(end = [-24, 0])
|> close()
|> extrude(length = 6)
}
```
Now, every time you call `createPart()`, the commands will be executed and a new solid will be created.
When you assign the result of `createPart()` to a variable (`myPart = createPart()`), you are assigning the executed solid to that variable. Meaning that the solid `myPart` will not be executed again.
You can still execute _new_ commands on the solid like `shell`, `fillet`, `chamfer`, etc. and the solid will be updated.
**Type:** `object`
@ -33,7 +69,7 @@ An solid is a collection of extrude surfaces.
| `startCapId` |`string`| The id of the extrusion start cap | No |
| `endCapId` |`string`| The id of the extrusion end cap | No |
| `edgeCuts` |`[` [`EdgeCut`](/docs/kcl/types/EdgeCut) `]`| Chamfers or fillets on this solid. | No |
| `units` |[`UnitLen`](/docs/kcl/types/UnitLen)| A solid or a group of solids. | No |
| `units` |[`UnitLen`](/docs/kcl/types/UnitLen)| A unit of length. | No |
| `__meta` |`[` [`Metadata`](/docs/kcl/types/Metadata) `]`| Metadata. | No |

View File

@ -0,0 +1,15 @@
---
title: "SourceRange"
excerpt: ""
layout: manual
---
**Type:** `integer` (`uint`)

View File

@ -1,90 +0,0 @@
---
title: "StandardPlane"
excerpt: "One of the standard planes."
layout: manual
---
One of the standard planes.
**This schema accepts exactly one of the following:**
The XY plane.
**enum:** `XY`
----
The opposite side of the XY plane.
**enum:** `-XY`
----
The XZ plane.
**enum:** `XZ`
----
The opposite side of the XZ plane.
**enum:** `-XZ`
----
The YZ plane.
**enum:** `YZ`
----
The opposite side of the YZ plane.
**enum:** `-YZ`
----

View File

@ -11,7 +11,41 @@ A path to sweep along.
**This schema accepts any of the following:**
A path to sweep along.
A sketch is a collection of paths.
When you define a sketch to a variable like:
```kcl
mySketch = startSketchOn('XY')
|> startProfileAt([-12, 12], %)
|> line(end = [24, 0])
|> line(end = [0, -24])
|> line(end = [-24, 0])
|> close()
```
The `mySketch` variable will be an executed [`Sketch`](/docs/kcl/types/Sketch) object. Executed being past tense, because the engine has already executed the commands to create the sketch.
The previous sketch commands will never be executed again, in this case.
If you would like to encapsulate the commands to create the sketch any time you call it, you can use a function.
```kcl
fn createSketch() {
return startSketchOn('XY')
|> startProfileAt([-12, 12], %)
|> line(end = [24, 0])
|> line(end = [0, -24])
|> line(end = [-24, 0])
|> close()
}
```
Now, every time you call `createSketch()`, the commands will be executed and a new sketch will be created.
When you assign the result of `createSketch()` to a variable (`mySketch = createSketch()`), you are assigning the executed sketch to that variable. Meaning that the sketch `mySketch` will not be executed again.
You can still execute _new_ commands on the sketch like `extrude`, `revolve`, `loft`, etc. and the sketch will be updated.
[`Sketch`](/docs/kcl/types/Sketch)
@ -23,7 +57,7 @@ A path to sweep along.
----
A path to sweep along.
A helix.
[`Helix`](/docs/kcl/types/Helix)

21
docs/kcl/types/TyF64.md Normal file
View File

@ -0,0 +1,21 @@
---
title: "TyF64"
excerpt: ""
layout: manual
---
**Type:** `object`
## Properties
| Property | Type | Description | Required |
|----------|------|-------------|----------|
| `n` |`number`| | No |
| `ty` |[`NumericType`](/docs/kcl/types/NumericType)| | No |

View File

@ -1,9 +1,10 @@
---
title: "UnitAngle"
excerpt: ""
excerpt: "A unit of angle."
layout: manual
---
A unit of angle.

View File

@ -1,9 +1,10 @@
---
title: "UnitLen"
excerpt: ""
excerpt: "A unit of length."
layout: manual
---
A unit of length.

View File

@ -5,6 +5,7 @@ import { ToolbarFixture } from './fixtures/toolbarFixture'
import fs from 'node:fs/promises'
import path from 'node:path'
import { getUtils } from './test-utils'
import { Locator } from '@playwright/test'
// test file is for testing point an click code gen functionality that's not sketch mode related
@ -2506,6 +2507,94 @@ extrude002 = extrude(sketch002, length = 50)
})
})
const shellPointAndClickDeletionCases = [
{ shouldUseKeyboard: true },
{ shouldUseKeyboard: false },
]
shellPointAndClickDeletionCases.forEach(({ shouldUseKeyboard }) => {
test(`Shell point-and-click deletion (shouldUseKeyboard: ${shouldUseKeyboard})`, async ({
context,
page,
homePage,
scene,
editor,
toolbar,
cmdBar,
}) => {
const sketchCode = `sketch001 = startSketchOn('XY')
profile001 = startProfileAt([-20, 20], sketch001)
|> xLine(40, %)
|> yLine(-60, %)
|> xLine(-40, %)
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close()
`
const extrudeCode = `extrude001 = extrude(profile001, length = 40)
`
const shellCode = `shell001 = shell(extrude001, faces = ['end'], thickness = 5)
`
const initialCode = sketchCode + extrudeCode + shellCode
await context.addInitScript((initialCode) => {
localStorage.setItem('persistCode', initialCode)
}, initialCode)
await page.setBodyDimensions({ width: 1000, height: 500 })
await homePage.goToModelingScene()
await scene.waitForExecutionDone()
await toolbar.openPane('feature-tree')
// One dumb hardcoded screen pixel value
const testPoint = { x: 590, y: 400 }
const extrudeColor: [number, number, number] = [100, 100, 100]
const sketchColor: [number, number, number] = [140, 140, 140]
const defaultPlaneColor: [number, number, number] = [50, 50, 100]
const deleteOperation = async (operationButton: Locator) => {
if (shouldUseKeyboard) {
await operationButton.click({ button: 'left' })
await page.keyboard.press('Backspace')
} else {
await operationButton.click({ button: 'right' })
const editButton = page.getByTestId('context-menu-delete')
await editButton.click()
}
}
await test.step(`Look for the grey of the extrude shape`, async () => {
await scene.expectPixelColor(extrudeColor, testPoint, 20)
})
await test.step('Delete shell and confirm deletion', async () => {
const operationButton = await toolbar.getFeatureTreeOperation(
'Shell',
0
)
await deleteOperation(operationButton)
await scene.expectPixelColor(extrudeColor, testPoint, 20)
await editor.expectEditor.not.toContain(shellCode)
})
await test.step('Delete extrude and confirm deletion', async () => {
const operationButton = await toolbar.getFeatureTreeOperation(
'Extrude',
0
)
await deleteOperation(operationButton)
await editor.expectEditor.not.toContain(extrudeCode)
await scene.expectPixelColor(sketchColor, testPoint, 20)
})
await test.step('Delete sketch and confirm empty scene', async () => {
const operationButton = await toolbar.getFeatureTreeOperation(
'Sketch',
0
)
await deleteOperation(operationButton)
await editor.expectEditor.toContain('')
await scene.expectPixelColor(defaultPlaneColor, testPoint, 20)
})
})
})
test(`Shell dry-run validation rejects sweeps`, async ({
context,
page,

View File

@ -117,7 +117,7 @@ test(
test(
'open a file in a project works and renders, open another file in different project with errors, it should clear the scene',
{ tag: '@electron' },
async ({ context, page }, testInfo) => {
async ({ context, page, editor }, testInfo) => {
await context.folderSetupFn(async (dir) => {
const bracketDir = path.join(dir, 'bracket')
await fsp.mkdir(bracketDir, { recursive: true })
@ -180,6 +180,11 @@ test(
await page.getByText('broken-code').click()
await page.waitForTimeout(2000)
await editor.scrollToText(
"|> line(end = [0, wallMountL], tag = 'outerEdge')"
)
// error in guter
await expect(page.locator('.cm-lint-marker-error')).toBeVisible()

View File

@ -2029,9 +2029,6 @@ profile003 = circle({ center = [6.92, -4.2], radius = 3.16 }, sketch001)
await moveToClearToolBarPopover()
await pointOnSegment({ shouldDbClick: true })
await page.waitForTimeout(600)
await toolbar.lineBtn.click()
await page.waitForTimeout(100)
})
await test.step('select and delete code for a profile', async () => {})
@ -2049,7 +2046,9 @@ profile003 = circle({ center = [6.92, -4.2], radius = 3.16 }, sketch001)
await test.step('add random new var between profiles', async () => {
await page.keyboard.type('myVar = 5')
await page.keyboard.press('Enter')
await page.waitForTimeout(600)
// If this timeout isn't long enough, the test breaks.
// TODO: fix https://github.com/KittyCAD/modeling-app/issues/5437
await page.waitForTimeout(3_000)
})
await sketchIsDrawnProperly()

Binary file not shown.

Before

Width:  |  Height:  |  Size: 60 KiB

After

Width:  |  Height:  |  Size: 60 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 76 KiB

After

Width:  |  Height:  |  Size: 76 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 51 KiB

After

Width:  |  Height:  |  Size: 51 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 143 KiB

After

Width:  |  Height:  |  Size: 143 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 127 KiB

After

Width:  |  Height:  |  Size: 127 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 49 KiB

After

Width:  |  Height:  |  Size: 49 KiB

View File

@ -945,4 +945,76 @@ fn cube`
).toBeVisible()
})
})
/**
* This test assumes that the default value of the "highlight edges" setting is "on".
*/
test(`Toggle stream settings multiple times`, async ({
page,
scene,
homePage,
context,
toolbar,
cmdBar,
}, testInfo) => {
await context.folderSetupFn(async (dir) => {
const projectDir = join(dir, 'project-000')
await fsp.mkdir(projectDir, { recursive: true })
await fsp.copyFile(
executorInputPath('cube.kcl'),
join(projectDir, 'main.kcl')
)
})
await test.step(`First snapshot`, async () => {
await homePage.openProject('project-000')
await toolbar.closePane('code')
await expect(toolbar.startSketchBtn).toBeEnabled({ timeout: 20_000 })
await scene.clickNoWhere()
})
const toast = (value: boolean) =>
page.getByText(
`Set highlight edges to "${String(value)}" as a user default`
)
const initialPath = testInfo.snapshotPath('toggle-settings-initial.png')
const initialScreenshot = await scene.streamWrapper.screenshot({
path: initialPath,
mask: [page.getByTestId('model-state-indicator')],
})
await test.step(`Toggle highlightEdges off`, async () => {
await cmdBar.openCmdBar()
await cmdBar.chooseCommand('Settings · modeling · highlight edges')
await cmdBar.selectOption({ name: 'off' }).click()
const falseToast = toast(false)
await expect(falseToast).toBeVisible()
await falseToast.waitFor({ state: 'detached' })
})
await expect(scene.streamWrapper).not.toHaveScreenshot(
'toggle-settings-initial.png',
{
maxDiffPixels: 15,
mask: [page.getByTestId('model-state-indicator')],
}
)
await test.step(`Toggle highlightEdges on`, async () => {
await cmdBar.openCmdBar()
await cmdBar.chooseCommand('Settings · modeling · highlight edges')
await cmdBar.selectOption({ name: 'on' }).click()
const trueToast = toast(true)
await expect(trueToast).toBeVisible()
await trueToast.waitFor({ state: 'detached' })
})
await expect(scene.streamWrapper).toHaveScreenshot(
'toggle-settings-initial.png',
{
maxDiffPixels: 15,
mask: [page.getByTestId('model-state-indicator')],
}
)
})
})

View File

@ -20,10 +20,14 @@ export const kclHighlight = styleTags({
LineComment: t.lineComment,
BlockComment: t.blockComment,
Shebang: t.meta,
AnnotationName: t.annotation,
PipeSubstitution: t.atom,
VariableDefinition: t.definition(t.variableName),
VariableName: t.variableName,
PropertyName: t.propertyName,
'AnnotationProperty/PropertyName': t.definition(t.propertyName),
'ObjectProperty/PropertyName': t.definition(t.propertyName),
'LabeledArgument/ArgumentLabel': t.definition(t.propertyName),
TagDeclarator: t.tagName,
'( )': t.paren,
'{ }': t.brace,

View File

@ -1,4 +1,11 @@
[
{
"file": "main.kcl",
"pathFromProjectDirectoryToFirstFile": "3d-boaty/main.kcl",
"multipleFiles": true,
"title": "3D Boaty",
"description": "This is a slight remix of Depep1's original 3D Boaty (https://www.printables.com/model/1141963-3d-boaty). This is a tool used for benchmarking 3D FDM printers for bed adhesion, overhangs, bridging and top surface quality. The name of this file is a bit of misnomer, the shape of the object is a typical park bench."
},
{
"file": "main.kcl",
"pathFromProjectDirectoryToFirstFile": "80-20-rail/main.kcl",
@ -34,6 +41,13 @@
"title": "Car Wheel Assembly",
"description": "A car wheel assembly with a rotor, tire, and lug nuts."
},
{
"file": "main.kcl",
"pathFromProjectDirectoryToFirstFile": "color-cube/main.kcl",
"multipleFiles": false,
"title": "Color Cube",
"description": "This is a color cube centered about the origin. It is used to help determine orientation in the scene."
},
{
"file": "main.kcl",
"pathFromProjectDirectoryToFirstFile": "cycloidal-gear/main.kcl",

View File

@ -179,10 +179,7 @@ const Overlays = () => {
// Set a large zIndex, the overlay for hover dropdown menu on line segments needs to render
// over the length labels on the line segments
return (
<div
className="absolute inset-0 pointer-events-none"
style={{ zIndex: '99999999' }}
>
<div className="absolute inset-0 pointer-events-none z-sketchOverlayDropdown">
{Object.entries(context.segmentOverlays)
.flatMap((a) =>
a[1].map((b) => ({ pathToNodeString: a[0], overlay: b }))

View File

@ -291,6 +291,7 @@ export class SceneInfra {
this.labelRenderer.domElement.style.position = 'absolute'
this.labelRenderer.domElement.style.top = '0px'
this.labelRenderer.domElement.style.pointerEvents = 'none'
this.labelRenderer.domElement.className = 'z-sketchSegmentIndicators'
window.addEventListener('resize', this.onWindowResize)
this.camControls = new CameraControls(

View File

@ -0,0 +1,82 @@
import { getPathOrUrlFromArgs, parseCLIArgs } from 'commandLineArgs'
const linuxDeepLinkArgv = [
'/tmp/.mount_Zoo Movq3t0x/zoo-modeling-app',
'--no-sandbox',
'--allow-file-access-from-files',
'zoo-studio://?create-file=true&name=deeplinks&code=cGxhbmUwMDEgPSBvZmZzZXRQbGFuZSgnWFonLCBvZmZzZXQgPSA1KQ%3D%3D',
]
const linuxNoPathArgv = [
'/tmp/.mount_Zoo MogQS2hd/zoo-modeling-app',
'--no-sandbox',
'--allow-file-access-from-files',
]
const linuxPathArgv = [
'/tmp/.mount_Zoo MogQS2hd/zoo-modeling-app',
'--no-sandbox',
'--allow-file-access-from-files',
'/home/pierremtb/Documents/zoo-modeling-app-projects/project-001/main.kcl',
]
const winDeepLinkArgv = [
'C:\\Program Files\\Zoo Modeling App\\Zoo Modeling App.exe',
'--allow-file-access-from-files',
'zoo-studio:///?create-file=true&name=deeplinkscopy&code=cGxhbmUwMDEgPSBvZmZzZXRQbGFuZSgnWFonLCBvZmZzZXQgPSA1KQo%3D',
]
const winNoPathArgv = [
'C:\\Program Files\\Zoo Modeling App\\Zoo Modeling App.exe',
'--allow-file-access-from-files',
]
const winPathArgv = [
'C:\\Program Files\\Zoo Modeling App\\Zoo Modeling App.exe',
'--allow-file-access-from-files',
'C:\\Users\\pierr\\Documents\\zoo-modeling-app-projects\\deeplink\\main.kcl',
]
// macos doesn't uses the open-url scheme so is different so no macDeepLinkArgv
const macNoPathArgv = [
'/Applications/Zoo Modeling App.app/Contents/MacOS/Zoo Modeling App',
]
const macPathArgv = [
'/Applications/Zoo Modeling App.app/Contents/MacOS/Zoo Modeling App',
'/Users/pierremtb/Documents/zoo-modeling-app-projects/loft/main.kcl',
]
describe('getPathOrUrlFromArgs', () => {
;[
['linux', linuxDeepLinkArgv],
['windows', winDeepLinkArgv],
// macos doesn't uses the open-url scheme so is different
].map(([os, argv]) => {
it(`should parse second-instance deep link argv on ${os}`, () => {
const args = parseCLIArgs(argv as string[])
expect(getPathOrUrlFromArgs(args)).toContain('zoo-studio://')
})
})
;[
['linux', linuxPathArgv],
['windows', winPathArgv],
['mac', macPathArgv],
].map(([os, argv]) => {
it(`should parse path argv on ${os}`, () => {
const args = parseCLIArgs(argv as string[])
expect(getPathOrUrlFromArgs(args)).toContain('main.kcl')
})
})
;[
['linux', linuxNoPathArgv],
['windows', winNoPathArgv],
['mac', macNoPathArgv],
].map(([os, argv]) => {
it(`should return undefined without path argv on ${os}`, () => {
const args = parseCLIArgs(argv as string[])
expect(getPathOrUrlFromArgs(args)).toBeUndefined()
})
})
})

View File

@ -1,7 +1,8 @@
import minimist from 'minimist'
import yargs from 'yargs'
import { hideBin } from 'yargs/helpers'
const argv = yargs(hideBin(process.argv))
export const argvFromYargs = yargs(hideBin(process.argv))
.option('telemetry', {
alias: 't',
type: 'boolean',
@ -9,4 +10,20 @@ const argv = yargs(hideBin(process.argv))
})
.parse()
export default argv
// TODO: find a better way to merge minimist and yargs parsers.
export function parseCLIArgs(argv: string[]): minimist.ParsedArgs {
return minimist(argv, {
// Treat all double-hyphenated arguments without equal signs as boolean
boolean: true,
})
}
export function getPathOrUrlFromArgs(
args: minimist.ParsedArgs
): string | undefined {
if (args._.length > 1) {
return args._[1]
}
return undefined
}

View File

@ -1,7 +1,6 @@
import toast from 'react-hot-toast'
import { ActionIcon, ActionIconProps } from './ActionIcon'
import {
MouseEvent,
RefObject,
useCallback,
useEffect,
@ -148,24 +147,22 @@ interface ContextMenuItemProps {
onClick?: () => void
hotkey?: string
'data-testid'?: string
disabled?: boolean
}
export function ContextMenuItem(props: ContextMenuItemProps) {
const { children, icon, onClick, hotkey } = props
const { children, icon, onClick, hotkey, disabled } = props
return (
<button
disabled={disabled}
data-testid={props['data-testid']}
className="flex items-center gap-2 py-1 px-2 cursor-pointer hover:bg-chalkboard-20 dark:hover:bg-chalkboard-80 border-none text-left"
onClick={onClick}
onClick={disabled ? undefined : onClick}
>
{icon && <ActionIcon icon={icon} bgClassName="!bg-transparent" />}
<div className="flex-1">{children}</div>
{hotkey && (
<kbd className="px-1.5 py-0.5 rounded bg-primary/10 text-primary dark:bg-chalkboard-80 dark:text-chalkboard-40">
{hotkey}
</kbd>
)}
{hotkey && <kbd className="hotkey">{hotkey}</kbd>}
</button>
)
}

View File

@ -800,11 +800,18 @@ export const ModelingMachineProvider = ({
}),
'animate-to-sketch': fromPromise(
async ({ input: { selectionRanges } }) => {
const artifact = selectionRanges.graphSelections[0].artifact
const plane = getPlaneFromArtifact(
selectionRanges.graphSelections[0].artifact,
artifact,
engineCommandManager.artifactGraph
)
if (err(plane)) return Promise.reject(plane)
// if the user selected a segment, make sure we enter the right sketch as there can be multiple on a plan
// but still works if the user selected a plane/face by defaulting to the first path
const mainPath =
artifact?.type === 'segment' || artifact?.type === 'solid2d'
? artifact?.pathId
: plane?.pathIds[0]
let sketch: KclValue | null = null
for (const variable of Object.values(
kclManager.execState.variables
@ -812,7 +819,7 @@ export const ModelingMachineProvider = ({
// find programMemory that matches path artifact
if (
variable?.type === 'Sketch' &&
variable.value.artifactId === plane.pathIds[0]
variable.value.artifactId === mainPath
) {
sketch = variable
break
@ -821,7 +828,7 @@ export const ModelingMachineProvider = ({
// if the variable is an sweep, check if the underlying sketch matches the artifact
variable?.type === 'Solid' &&
variable.value.sketch.on.type === 'plane' &&
variable.value.sketch.artifactId === plane.pathIds[0]
variable.value.sketch.artifactId === mainPath
) {
sketch = {
type: 'Sketch',
@ -841,9 +848,8 @@ export const ModelingMachineProvider = ({
info?.sketchDetails?.faceId || ''
)
const sketchArtifact = engineCommandManager.artifactGraph.get(
plane.pathIds[0]
)
const sketchArtifact =
engineCommandManager.artifactGraph.get(mainPath)
if (sketchArtifact?.type !== 'path')
return Promise.reject(new Error('No sketch artifact'))
const sketchPaths = getPathsFromArtifact({

View File

@ -324,6 +324,20 @@ const OperationItem = (props: {
}
}
function deleteOperation() {
if (
props.item.type === 'StdLibCall' ||
props.item.type === 'UserDefinedFunctionCall'
) {
props.send({
type: 'deleteOperation',
data: {
targetSourceRange: sourceRangeFromRust(props.item.sourceRange),
},
})
}
}
const menuItems = useMemo(
() => [
<ContextMenuItem
@ -364,14 +378,24 @@ const OperationItem = (props: {
</ContextMenuItem>,
]
: []),
...(props.item.type === 'StdLibCall' &&
stdLibMap[props.item.name]?.prepareToEdit
...(props.item.type === 'StdLibCall'
? [
<ContextMenuItem onClick={enterEditFlow}>
Edit {name}
<ContextMenuItem
disabled={!stdLibMap[props.item.name]?.prepareToEdit}
onClick={enterEditFlow}
hotkey="Double click"
>
Edit
</ContextMenuItem>,
]
: []),
<ContextMenuItem
onClick={deleteOperation}
hotkey="Delete"
data-testid="context-menu-delete"
>
Delete
</ContextMenuItem>,
],
[props.item, props.send]
)

View File

@ -33,11 +33,8 @@ describe('processMemory', () => {
const output = processMemory(execState.variables)
expect(output.myVar).toEqual(5)
expect(output.otherVar).toEqual(3)
expect(output).toEqual({
myVar: 5,
myFn: '__function(a)__',
otherVar: 3,
theExtrude: [
expect(output.myFn).toEqual('__function(a)__')
expect(output.theExtrude).toEqual([
{
type: 'extrudePlane',
tag: null,
@ -52,12 +49,29 @@ describe('processMemory', () => {
faceId: expect.any(String),
sourceRange: [expect.any(Number), expect.any(Number), 0],
},
],
theSketch: [
{ type: 'ToPoint', to: [-3.35, 0.17], from: [0, 0], tag: null },
{ type: 'ToPoint', to: [0.98, 5.16], from: [-3.35, 0.17], tag: null },
{ type: 'ToPoint', to: [2.15, 4.32], from: [0.98, 5.16], tag: null },
],
})
])
expect(output.theSketch).toEqual([
{
type: 'ToPoint',
to: [-3.35, 0.17],
from: [0, 0],
units: { type: 'Mm' },
tag: null,
},
{
type: 'ToPoint',
to: [0.98, 5.16],
from: [-3.35, 0.17],
units: { type: 'Mm' },
tag: null,
},
{
type: 'ToPoint',
to: [2.15, 4.32],
from: [0.98, 5.16],
units: { type: 'Mm' },
tag: null,
},
])
})
})

View File

@ -20,7 +20,7 @@ import {
getSettingsFolderPaths,
} from 'lib/desktopFS'
import { useDotDotSlash } from 'hooks/useDotDotSlash'
import { ForwardedRef, forwardRef, useEffect } from 'react'
import { ForwardedRef, forwardRef, useEffect, useMemo } from 'react'
import { useLspContext } from 'components/LspProvider'
import { toSync } from 'lib/utils'
import { reportRejection } from 'lib/trap'
@ -44,21 +44,23 @@ export const AllSettingsFields = forwardRef(
settings: { send, context, state },
} = useSettingsAuthContext()
const projectPath = useMemo(() => {
const filteredPathname = location.pathname
.replace(PATHS.FILE, '')
.replace(PATHS.SETTINGS, '')
const lastSlashIndex = filteredPathname.lastIndexOf(
// This is slicing off any remaining browser path segments,
// so we don't use window.electron.sep here
'/'
)
const projectPath =
isFileSettings && isDesktop()
? decodeURI(
location.pathname
.replace(PATHS.FILE + window.electron.sep, '')
.replace(PATHS.SETTINGS, '')
.slice(
0,
decodeURI(location.pathname).lastIndexOf(
window.electron.path.sep
)
)
)
? decodeURIComponent(filteredPathname.slice(lastSlashIndex + 1))
: undefined
return projectPath
}, [location.pathname])
function restartOnboarding() {
send({
type: `set.app.onboardingStatus`,
@ -197,9 +199,7 @@ export const AllSettingsFields = forwardRef(
<ActionButton
Element="button"
onClick={toSync(async () => {
const paths = await getSettingsFolderPaths(
projectPath ? decodeURIComponent(projectPath) : undefined
)
const paths = await getSettingsFolderPaths(projectPath)
const finalPath = paths[searchParamTab]
if (!finalPath) {
return new Error('finalPath undefined')

View File

@ -57,6 +57,7 @@ export function UnitsMenu() {
const newCode = changeKclSettings(codeManager.code, {
defaultLengthUnits: unitLengthToUnitLen(unit),
defaultAngleUnits: { type: 'Degrees' },
stdPath: null,
})
if (err(newCode)) {
toast.error(

View File

@ -401,6 +401,10 @@ export class KclManager {
this.errors = errors
// Do not add the errors since the program was interrupted and the error is not a real KCL error
this.addDiagnostics(isInterrupted ? [] : kclErrorsToDiagnostics(errors))
// Add warnings and non-fatal errors
this.addDiagnostics(
isInterrupted ? [] : complilationErrorsToDiagnostics(execState.errors)
)
this.execState = execState
if (!errors.length) {
this.lastSuccessfulVariables = execState.variables
@ -464,6 +468,8 @@ export class KclManager {
this._logs = logs
this.addDiagnostics(kclErrorsToDiagnostics(errors))
// Add warnings and non-fatal errors
this.addDiagnostics(complilationErrorsToDiagnostics(execState.errors))
this._execState = execState
this._variables = execState.variables

View File

@ -24,6 +24,7 @@ const mySketch001 = startSketchOn('XY')
start: {
to: [0, 0],
from: [0, 0],
units: { type: 'Mm' },
tag: null,
__geoMeta: {
id: expect.any(String),
@ -35,6 +36,7 @@ const mySketch001 = startSketchOn('XY')
type: 'ToPoint',
tag: null,
to: [-1.59, -1.54],
units: { type: 'Mm' },
from: [0, 0],
__geoMeta: {
sourceRange: [expect.any(Number), expect.any(Number), 0],
@ -45,6 +47,7 @@ const mySketch001 = startSketchOn('XY')
type: 'ToPoint',
to: [0.46, -5.82],
from: [-1.59, -1.54],
units: { type: 'Mm' },
tag: null,
__geoMeta: {
sourceRange: [expect.any(Number), expect.any(Number), 0],
@ -111,6 +114,7 @@ const mySketch001 = startSketchOn('XY')
type: 'ToPoint',
from: [0, 0],
to: [-1.59, -1.54],
units: { type: 'Mm' },
tag: null,
__geoMeta: {
id: expect.any(String),
@ -121,6 +125,7 @@ const mySketch001 = startSketchOn('XY')
type: 'ToPoint',
from: [-1.59, -1.54],
to: [0.46, -5.82],
units: { type: 'Mm' },
tag: null,
__geoMeta: {
id: expect.any(String),
@ -229,6 +234,7 @@ const sk2 = startSketchOn('XY')
type: 'ToPoint',
from: [0, 0],
to: [-2.5, 0],
units: { type: 'Mm' },
tag: null,
__geoMeta: {
id: expect.any(String),
@ -239,6 +245,7 @@ const sk2 = startSketchOn('XY')
type: 'ToPoint',
from: [-2.5, 0],
to: [0, 10],
units: { type: 'Mm' },
tag: {
end: expect.any(Number),
start: expect.any(Number),
@ -254,6 +261,7 @@ const sk2 = startSketchOn('XY')
type: 'ToPoint',
from: [0, 10],
to: [2.5, 0],
units: { type: 'Mm' },
tag: null,
__geoMeta: {
id: expect.any(String),
@ -335,6 +343,7 @@ const sk2 = startSketchOn('XY')
type: 'ToPoint',
from: [0, 0],
to: [-2.5, 0],
units: { type: 'Mm' },
tag: null,
__geoMeta: {
id: expect.any(String),
@ -345,6 +354,7 @@ const sk2 = startSketchOn('XY')
type: 'ToPoint',
from: [-2.5, 0],
to: [0, 3],
units: { type: 'Mm' },
tag: {
end: expect.any(Number),
start: expect.any(Number),
@ -360,6 +370,7 @@ const sk2 = startSketchOn('XY')
type: 'ToPoint',
from: [0, 3],
to: [2.5, 0],
units: { type: 'Mm' },
tag: null,
__geoMeta: {
id: expect.any(String),

View File

@ -72,6 +72,7 @@ const newVar = myVar + 1`
type: 'ToPoint',
to: [0, 2],
from: [0, 0],
units: { type: 'Mm' },
__geoMeta: {
sourceRange: [expect.any(Number), expect.any(Number), 0],
id: expect.any(String),
@ -87,6 +88,7 @@ const newVar = myVar + 1`
type: 'ToPoint',
to: [2, 3],
from: [0, 2],
units: { type: 'Mm' },
tag: null,
__geoMeta: {
sourceRange: [expect.any(Number), expect.any(Number), 0],
@ -97,6 +99,7 @@ const newVar = myVar + 1`
type: 'ToPoint',
to: [5, -1],
from: [2, 3],
units: { type: 'Mm' },
__geoMeta: {
sourceRange: [expect.any(Number), expect.any(Number), 0],
id: expect.any(String),
@ -165,6 +168,7 @@ const newVar = myVar + 1`
start: {
to: [0, 0],
from: [0, 0],
units: { type: 'Mm' },
tag: null,
__geoMeta: {
id: expect.any(String),
@ -188,6 +192,7 @@ const newVar = myVar + 1`
type: 'ToPoint',
to: [1, 1],
from: [0, 0],
units: { type: 'Mm' },
tag: null,
__geoMeta: {
sourceRange: [expect.any(Number), expect.any(Number), 0],
@ -198,6 +203,7 @@ const newVar = myVar + 1`
type: 'ToPoint',
to: [0, 1],
from: [1, 1],
units: { type: 'Mm' },
__geoMeta: {
sourceRange: [expect.any(Number), expect.any(Number), 0],
id: expect.any(String),
@ -213,6 +219,7 @@ const newVar = myVar + 1`
type: 'ToPoint',
to: [1, 1],
from: [0, 1],
units: { type: 'Mm' },
tag: null,
__geoMeta: {
sourceRange: [expect.any(Number), expect.any(Number), 0],

View File

@ -0,0 +1,38 @@
import { Selection } from 'lib/selections'
import { getFaceDetails } from 'clientSideScene/sceneEntities'
import { deleteFromSelection } from 'lang/modifyAst'
import { codeManager, engineCommandManager, kclManager } from 'lib/singletons'
import { err } from 'lib/trap'
import { executeAst } from 'lang/langHelpers'
export const deletionErrorMessage =
'Unable to delete selection. Please edit manually in code pane.'
export async function deleteSelectionPromise(
selection: Selection
): Promise<Error | void> {
let ast = kclManager.ast
const modifiedAst = await deleteFromSelection(
ast,
selection,
kclManager.variables,
engineCommandManager.artifactGraph,
getFaceDetails
)
if (err(modifiedAst)) {
return new Error(deletionErrorMessage)
}
const testExecute = await executeAst({
ast: modifiedAst,
engineCommandManager,
isMock: true,
})
if (testExecute.errors.length) {
return new Error(deletionErrorMessage)
}
await kclManager.updateAst(modifiedAst, true)
await codeManager.updateEditorWithAstAndWriteToFile(modifiedAst)
}

View File

@ -589,7 +589,12 @@ class EngineConnection extends EventTarget {
}
const initiateConnectingExclusive = () => {
if (that.triggeredStart) return
if (!that.sdpAnswer) {
console.log('SDP answer is not yet available')
return false
}
if (that.triggeredStart) return false
that.triggeredStart = true
// Start connecting.
@ -611,6 +616,7 @@ class EngineConnection extends EventTarget {
type: ConnectingType.SetRemoteDescription,
},
}
return true
}
this.onIceCandidate = (event: RTCPeerConnectionIceEvent) => {
@ -643,7 +649,9 @@ class EngineConnection extends EventTarget {
// Sometimes the remote end doesn't report the end of candidates.
// They have 3 seconds to.
setTimeout(() => {
initiateConnectingExclusive()
if (initiateConnectingExclusive()) {
console.warn('connected after 3 second delay')
}
}, 3000)
}
this.pc?.addEventListener?.('icecandidate', this.onIceCandidate)
@ -1525,9 +1533,9 @@ export class EngineCommandManager extends EventTarget {
return
}
const additionalSettings = this.settings.enableSSAO
? '&post_effect=ssao'
: ''
let additionalSettings = this.settings.enableSSAO ? '&post_effect=ssao' : ''
additionalSettings +=
'&show_grid=' + (this.settings.showScaleGrid ? 'true' : 'false')
const pool = !this.settings.pool ? '' : `&pool=${this.settings.pool}`
const url = `${VITE_KC_API_WS_MODELING_URL}?video_res_width=${width}&video_res_height=${height}${additionalSettings}${pool}`
this.engineConnection = new EngineConnection({

View File

@ -386,6 +386,7 @@ part001 = startSketchOn('XY')
type: 'ToPoint',
to: [5.62, 1.79],
from: [3.48, 0.44],
units: { type: 'Mm' },
tag: null,
})
})
@ -401,6 +402,7 @@ part001 = startSketchOn('XY')
expect(segment).toEqual({
to: [0, 0.04],
from: [0, 0.04],
units: { type: 'Mm' },
tag: null,
type: 'Base',
})

View File

@ -295,6 +295,7 @@ export interface ExecState {
artifacts: { [key in ArtifactId]?: RustArtifact }
artifactCommands: ArtifactCommand[]
artifactGraph: ArtifactGraph
errors: CompilationError[]
}
/**
@ -308,6 +309,7 @@ export function emptyExecState(): ExecState {
artifacts: {},
artifactCommands: [],
artifactGraph: defaultArtifactGraph(),
errors: [],
}
}
@ -333,6 +335,7 @@ function execStateFromRust(
artifacts: execOutcome.artifacts,
artifactCommands: execOutcome.artifactCommands,
artifactGraph,
errors: execOutcome.errors,
}
}
@ -343,6 +346,7 @@ function mockExecStateFromRust(execOutcome: RustExecOutcome): ExecState {
artifacts: execOutcome.artifacts,
artifactCommands: execOutcome.artifactCommands,
artifactGraph: new Map<ArtifactId, Artifact>(),
errors: execOutcome.errors,
}
}

View File

@ -106,6 +106,7 @@ export type ModelingCommandSchema = {
prompt: string
selection: Selections
}
'Delete selection': {}
}
export const modelingMachineCommandConfig: StateMachineCommandSetConfig<

File diff suppressed because one or more lines are too long

View File

@ -44,7 +44,6 @@ import {
addHelix,
addOffsetPlane,
addSweep,
deleteFromSelection,
extrudeSketch,
loftSketches,
} from 'lang/modifyAst'
@ -70,12 +69,10 @@ import {
} from 'components/Toolbar/SetAbsDistance'
import { ModelingCommandSchema } from 'lib/commandBarConfigs/modelingCommandConfig'
import { err, reportRejection, trap } from 'lib/trap'
import { getFaceDetails } from 'clientSideScene/sceneEntities'
import { DefaultPlaneStr } from 'lib/planes'
import { uuidv4 } from 'lib/utils'
import { Coords2d } from 'lang/std/sketch'
import { deleteSegment } from 'clientSideScene/ClientSideSceneComp'
import { executeAst } from 'lang/langHelpers'
import toast from 'react-hot-toast'
import { ToolbarModeName } from 'lib/toolbar'
import { quaternionFromUpNForward } from 'clientSideScene/helpers'
@ -83,6 +80,11 @@ import { Mesh, Vector3 } from 'three'
import { MachineManager } from 'components/MachineManagerProvider'
import { addShell } from 'lang/modifyAst/addShell'
import { KclCommandValue } from 'lib/commandTypes'
import { ModelingMachineContext } from 'components/ModelingMachineProvider'
import {
deleteSelectionPromise,
deletionErrorMessage,
} from 'lang/modifyAst/deleteSelection'
import { getPathsFromPlaneArtifact } from 'lang/std/artifactGraph'
import { createProfileStartHandle } from 'clientSideScene/segments'
import { DRAFT_POINT } from 'clientSideScene/sceneInfra'
@ -308,6 +310,10 @@ export type ModelingMachineEvent =
| { type: 'Helix'; data: ModelingCommandSchema['Helix'] }
| { type: 'Text-to-CAD'; data: ModelingCommandSchema['Text-to-CAD'] }
| { type: 'Prompt-to-edit'; data: ModelingCommandSchema['Prompt-to-edit'] }
| {
type: 'Delete selection'
data: ModelingCommandSchema['Delete selection']
}
| {
type: 'Add rectangle origin'
data: [x: number, y: number]
@ -731,38 +737,6 @@ export const modelingMachine = setup({
}
})().catch(reportRejection)
},
'AST delete selection': ({ context: { selectionRanges } }) => {
;(async () => {
const errorMessage =
'Unable to delete selection. Please edit manually in code pane.'
let ast = kclManager.ast
const modifiedAst = await deleteFromSelection(
ast,
selectionRanges.graphSelections[0],
kclManager.variables,
engineCommandManager.artifactGraph,
getFaceDetails
)
if (err(modifiedAst)) {
toast.error(errorMessage)
return
}
const testExecute = await executeAst({
ast: modifiedAst,
engineCommandManager,
isMock: true,
})
if (testExecute.errors.length) {
toast.error(errorMessage)
return
}
await kclManager.updateAst(modifiedAst, true)
await codeManager.updateEditorWithAstAndWriteToFile(modifiedAst)
})().catch(reportRejection)
},
'set selection filter to curves only': () => {
;(async () => {
await engineCommandManager.sendSceneCommand({
@ -2170,6 +2144,34 @@ export const modelingMachine = setup({
input: ModelingCommandSchema['Prompt-to-edit']
}) => {}
),
deleteSelectionAstMod: fromPromise(
({
input: { selectionRanges },
}: {
input: { selectionRanges: Selections }
}) => {
return new Promise((resolve, reject) => {
if (!selectionRanges) {
reject(new Error(deletionErrorMessage))
}
const selection = selectionRanges.graphSelections[0]
if (!selectionRanges) {
reject(new Error(deletionErrorMessage))
}
deleteSelectionPromise(selection)
.then((result) => {
if (err(result)) {
reject(result)
return
}
resolve(result)
})
.catch(reject)
})
}
),
},
// end actors
}).createMachine({
@ -2243,10 +2245,9 @@ export const modelingMachine = setup({
},
'Delete selection': {
target: 'idle',
target: 'Applying Delete selection',
guard: 'has valid selection for deletion',
actions: ['AST delete selection'],
reenter: false,
reenter: true,
},
'Text-to-CAD': {
@ -3366,6 +3367,28 @@ export const modelingMachine = setup({
onError: 'idle',
},
},
'Applying Delete selection': {
invoke: {
src: 'deleteSelectionAstMod',
id: 'deleteSelectionAstMod',
input: ({ event, context }) => {
return { selectionRanges: context.selectionRanges }
},
onDone: 'idle',
onError: {
target: 'idle',
reenter: true,
actions: ({ event }) => {
if ('error' in event && err(event.error)) {
toast.error(event.error.message)
}
},
},
},
},
},
initial: 'idle',

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