Compare commits

...

82 Commits

Author SHA1 Message Date
4de0b57ea4 Add array concatenation using the plus operator 2025-07-01 19:58:27 -04:00
fba62dab98 Add parsing arrays and objects as binary operands (#7661)
* Add parsing arrays and objects as binary operands

* Add sim test showing the error message
2025-07-01 23:33:36 +00:00
a85a534d6b Release KCL 84 (#7653) 2025-07-01 15:15:35 -04:00
6ddbb7a31d Fix unknown property error message on sketches and solids (#7632)
* Fix unknown property error message on sketches and solids

* Add suggestion for common case

* Move test code in file to avoid conflict
2025-07-01 18:37:01 +00:00
051bb0589e KCL: rectangle function (#7616)
* KCL test for rectangle

* Rectangle function

* Rectangle helper tests

* Rectangle helper

* Fix clippy lints

* Update docs

* fmt

* Fix bug

* fmt

* Fix doc comments

* Update generated docs

---------

Co-authored-by: Jonathan Tran <jonnytran@gmail.com>
2025-07-01 14:26:04 -04:00
7f9851ae28 [Chore]: Added url-checker, updated circular-deps, documented new static analysis .txt pattern (#7442)
* fix: ignoring url checker files

* fix: url checker

* fix: auto fmt and cleanup

* fix: moving the bash scripts and known files into the scripts repo

* fix: removed all url_results and made it be all in memory

* fix: fixed the newline issue

* fix: url checking as a step to the static analysis

* fix: removed old code

* chore: writing documentation on our static checker pattern

* fix: updating the docs more to be clearer

* fix: copy and paste without understanding requirements of ci cd dependencies? do i need all of these?

* fix: updating

* fix: I thought this got in?

* Update CONTRIBUTING.md

Co-authored-by: Jace Browning <jacebrowning@gmail.com>

---------

Co-authored-by: Jace Browning <jacebrowning@gmail.com>
2025-07-01 13:01:42 -05:00
fbcbb341e2 KCL: Add planeOf function to stdlib (#7643)
Gets the plane a face lies on, if any.

Closes #7642
2025-07-01 17:42:12 +00:00
4a080d1583 Bump @types/node from 22.15.32 to 24.0.3 in /packages/codemirror-lsp-client in the major group (#7490)
Bump @types/node in /packages/codemirror-lsp-client in the major group

Bumps the major group in /packages/codemirror-lsp-client with 1 update: [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node).


Updates `@types/node` from 22.15.32 to 24.0.3
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

---
updated-dependencies:
- dependency-name: "@types/node"
  dependency-version: 24.0.3
  dependency-type: direct:development
  update-type: version-update:semver-major
  dependency-group: major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Pierre Jacquier <pierrejacquier39@gmail.com>
2025-07-01 12:01:45 -04:00
85c721fb49 Add display of units for calculated KCL values (#7619)
* Add display of units in UI modals with calculated KCL values

* Fix command bar display to handle units

* Add display of units in the command bar

* Fix more cases of NaN from units

* Fix to support explicit plus for exponent in scientific notation

* Fix display in autocomplete

* Change to parseFloat to be more resilient

* Add e2e test for command bar

* Change an existing test to use explicit inline units

* Fix case when input string can't be parsed
2025-06-30 15:26:45 -04:00
27af2d08a3 Bump the patch group in /rust with 3 updates (#7575)
* Bump the patch group in /rust with 3 updates

Bumps the patch group in /rust with 3 updates: [toml_edit](https://github.com/toml-rs/toml), [syn](https://github.com/dtolnay/syn) and [toml](https://github.com/toml-rs/toml).


Updates `toml_edit` from 0.22.26 to 0.22.27
- [Commits](https://github.com/toml-rs/toml/compare/v0.22.26...v0.22.27)

Updates `syn` from 2.0.103 to 2.0.104
- [Release notes](https://github.com/dtolnay/syn/releases)
- [Commits](https://github.com/dtolnay/syn/compare/2.0.103...2.0.104)

Updates `toml` from 0.8.22 to 0.8.23
- [Commits](https://github.com/toml-rs/toml/compare/toml-v0.8.22...toml-v0.8.23)

---
updated-dependencies:
- dependency-name: toml_edit
  dependency-version: 0.22.27
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: patch
- dependency-name: syn
  dependency-version: 2.0.104
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: patch
- dependency-name: toml
  dependency-version: 0.8.23
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* Trigger CI

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Jonathan Tran <jonnytran@gmail.com>
2025-06-30 12:09:43 -04:00
fb8b975b5e Bump esbuild from 0.25.2 to 0.25.3 in the security group across 1 directory (#6681)
Bump esbuild in the security group across 1 directory

Bumps the security group with 1 update in the / directory: [esbuild](https://github.com/evanw/esbuild).


Updates `esbuild` from 0.25.2 to 0.25.3
- [Release notes](https://github.com/evanw/esbuild/releases)
- [Changelog](https://github.com/evanw/esbuild/blob/main/CHANGELOG.md)
- [Commits](https://github.com/evanw/esbuild/compare/v0.25.2...v0.25.3)

---
updated-dependencies:
- dependency-name: esbuild
  dependency-version: 0.25.3
  dependency-type: direct:development
  dependency-group: security
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-06-30 15:40:33 +00:00
62d8d45a58 Bump the major group across 1 directory with 4 updates (#7572)
* Bump the major group across 1 directory with 4 updates

Bumps the major group with 4 updates in the / directory: [dawidd6/action-download-artifact](https://github.com/dawidd6/action-download-artifact), [runs-on/action](https://github.com/runs-on/action), [actions/create-github-app-token](https://github.com/actions/create-github-app-token) and [astral-sh/setup-uv](https://github.com/astral-sh/setup-uv).


Updates `dawidd6/action-download-artifact` from 7 to 11
- [Release notes](https://github.com/dawidd6/action-download-artifact/releases)
- [Commits](https://github.com/dawidd6/action-download-artifact/compare/v7...v11)

Updates `runs-on/action` from 1 to 2
- [Release notes](https://github.com/runs-on/action/releases)
- [Commits](https://github.com/runs-on/action/compare/v1...v2)

Updates `actions/create-github-app-token` from 1 to 2
- [Release notes](https://github.com/actions/create-github-app-token/releases)
- [Commits](https://github.com/actions/create-github-app-token/compare/v1...v2)

Updates `astral-sh/setup-uv` from 5 to 6
- [Release notes](https://github.com/astral-sh/setup-uv/releases)
- [Commits](https://github.com/astral-sh/setup-uv/compare/v5...v6)

---
updated-dependencies:
- dependency-name: dawidd6/action-download-artifact
  dependency-version: '11'
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: major
- dependency-name: runs-on/action
  dependency-version: '2'
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: major
- dependency-name: actions/create-github-app-token
  dependency-version: '2'
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: major
- dependency-name: astral-sh/setup-uv
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: major
...

Signed-off-by: dependabot[bot] <support@github.com>

* bump

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Max Ammann <max.ammann@zoo.dev>
2025-06-30 10:07:54 -04:00
ae3440df0a Use proper envs for Rust functions (#7623) 2025-06-29 07:03:36 -05:00
af658c909d Enterprise plans should not have the upgrade button (#7628)
* Enterprise plans should not have the upgrade button
Fixes #7627

* Move the check to BillingDialog

* Hide home box and change bool check

* Add component tests

* Clean up
2025-06-28 12:03:41 -04:00
7ec11d23c8 Capitalize labels in the native file menu (#7639) 2025-06-28 12:00:47 -04:00
30000a1eac Fix the vertical alignment on the temporary workspace label (#7638) 2025-06-28 13:23:47 +00:00
cb3b45747c Change AI to ML because cringe (#7636)
Change AI to ML
2025-06-27 19:44:05 +00:00
fe66310f2d Update output to match main (#7630) 2025-06-27 17:29:27 +00:00
fefb6cfe87 Rerun sim tests after #7608 (#7624) 2025-06-27 10:21:30 -04:00
0f8375cbb4 [BUG] offsetPlane back-side startSketchOn (#7622)
offset backPlane selection bug
2025-06-27 21:36:42 +10:00
107adc77b3 Allow the origin of rotation to be specified (#7608)
* pass axis origin to endpoint

* fmt

* fix lint errors

* update sim tests with new transform endpoint

* added missed files

* revert cargo.toml

* implement review requests

* fmt

* revert unnecessary custom origin
2025-06-27 00:38:18 +01:00
4356885aa2 Bump cargo to 1.88; 2024 edition for kcl-lib (#7618)
This is a big one because the edition changes a fair number of things.
2025-06-26 22:02:54 +00:00
6a2027cd51 Keep subtract solids selection to one until engine supports multiple (#7617)
Follow up to #7614
2025-06-26 21:36:05 +00:00
f49cf8281c Allow point-and-click Substract to take in multiple solids and tools (#7614)
* Allow point-and-click Substract to take in multiple tools
Fixes #7612

* Change target to solids for consistency and make it support multi select too

* Improve err message

* Update src/lang/modifyAst/boolean.ts

Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>

* Update src/lang/modifyAst/boolean.ts

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

* Good bot

* Reduce array to single value if len 1

* Remove console.log

---------

Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>
Co-authored-by: Kurt Hutten <k.hutten@protonmail.ch>
2025-06-26 16:43:53 -04:00
7de27c648f Revoke token when logging out (#7493)
* Revoke token when logging out

* extract OAUTH2_DEVICE_CLIENT_ID

* Update snapshots

* Update snapshots

* try fix

* try fix

* Move client id to `@src/lib/constants`

---------

Co-authored-by: Jonathan Tran <jonnytran@gmail.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Pierre Jacquier <pierrejacquier39@gmail.com>
Co-authored-by: Pierre Jacquier <pierre@zoo.dev>
2025-06-26 15:24:16 -04:00
344fb6f84d Hide Helix arguments that should have been hidden, plus other flow fixes (#7606)
* Make sure mode-related args are hidden in point-and-click commands after option args change
Fixes #7589

* WIP improving helix flows and fixing tests

* Fix 2 more tests

* Add test step for opt arg

* Fix last helix test

* Clean up tests, hope to fix CI
2025-06-26 14:12:36 -04:00
df808b3e58 Bump google-github-actions/auth from 2.1.8 to 2.1.10 in the patch group across 1 directory (#6566)
Bump google-github-actions/auth in the patch group across 1 directory

Bumps the patch group with 1 update in the / directory: [google-github-actions/auth](https://github.com/google-github-actions/auth).


Updates `google-github-actions/auth` from 2.1.8 to 2.1.10
- [Release notes](https://github.com/google-github-actions/auth/releases)
- [Changelog](https://github.com/google-github-actions/auth/blob/main/CHANGELOG.md)
- [Commits](https://github.com/google-github-actions/auth/compare/v2.1.8...v2.1.10)

---
updated-dependencies:
- dependency-name: google-github-actions/auth
  dependency-version: 2.1.10
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Pierre Jacquier <pierrejacquier39@gmail.com>
2025-06-25 13:33:09 -04:00
e1ab6bbc48 Swap "must" for "should" in identifier casing lint (#7604)
Draft: Swap "must" for "should" in identifier casing lint
2025-06-25 12:48:02 -04:00
0a1f35b89a Release KCL 83 (#7603) 2025-06-25 10:42:57 -04:00
78278d6889 Force the samples manifest to be updated (#7591)
* Force the samples manifest to be updated

* Skip manifest generation on Windows

This results in non-POSIX paths in the manifest.
2025-06-25 10:42:39 -04:00
6f1a539e83 Error on non-count indexing (#7539)
Signed-off-by: Nick Cameron <nrc@ncameron.org>
2025-06-25 20:36:57 +12:00
0ad619e1d2 Change to use doc comments (#7596) 2025-06-24 15:56:55 -04:00
8d876a806e Enable optional arguments in point-and-click Revolve (#7590)
* WIP: Enable optional arguments in point-and-click Revolve

* Add e2e test step
2025-06-24 15:45:16 -04:00
c7f0a6c2a0 Upgrade to ts-rs 11.0 for TS type fixes (#7581)
* Bump ts-rs from 10.1.0 to 11.0.1

* Fix breaking changes

* Fix tsc errors

* Update output

* Upgrade to kittycad-modeling-cmds 0.2.124 for ts-rs update

* Update parser snaps

* Update output of gridfinity_bins_stacking_lip sample

* Fix missing field in TS unit tests

* Fix tsc type error with fixed_size_grid project setting
2025-06-24 18:38:43 +00:00
e4941cb524 Fix quote escaping in docs (#7594) 2025-06-24 17:43:43 +00:00
1b687a82a6 Update stdlib docs output to match main (#7593)
* Update sim test output to match main

* Update stdlib docs
2025-06-24 12:44:28 -04:00
1bb882acf8 #7455 Last window size improvements: fix full screen on windows (#7586)
* fix full screen size issue on windows

* createWindow() reuse param is not used
2025-06-23 19:06:26 -04:00
478bf34f2b Coordinate grid uses same scale as user's units (#7465)
Closes https://github.com/KittyCAD/engine/issues/3494. Thanks to @nadr0 for helping on the JS side.

If users set their units, the grid will stop auto scaling, and instead will be set to 10 of whatever unit they used. 

If users set their units, and those units are metric, then it'll include a scale bar (see screenshot). Imperial units won't have that bar. 

This behaviour is configurable via settings.

## Limitations

 - The scale bar below the grid cannot be disabled in metric units, and cannot be enabled in imperial units

<img width="1690" alt="Screenshot 2025-06-05 at 7 51 41 PM" src="https://github.com/user-attachments/assets/c597087c-f96d-4c30-95f4-b3d8ba2b5567" />
2025-06-23 17:30:26 -05:00
dbc87292e4 Enable optional arguments in point-and-click Loft (#7587)
* Enable optional arguments in point-and-click Sweep
Fixes #7578

* Fix bug and add e2e test step

* Fix review not triggering bug and e2e test

* WIP: Enable optional arguments in point-and-click Loft

* Add edit flow for loft

* WIP: e2e test and fix

* Got it

* Got it v2 🤦
2025-06-23 18:24:52 -04:00
bb3a74076f Improve display of KCL backtrace (#7582)
* Improve display of KCL backtrace

* Fix circular dep
2025-06-23 21:11:13 +00:00
0cd6031aae Enable optional arguments in point-and-click Sweep (#7580)
* Enable optional arguments in point-and-click Sweep
Fixes #7578

* Fix bug and add e2e test step

* Fix review not triggering bug and e2e test
2025-06-23 16:17:17 -04:00
1e1bdbd6e7 use face edge info for some mirrors (#7174)
* use face edge info for some mirrors

* add functionality for other mirror function

* Fix to create new Sketch when mirror results in a new path

* use the original ids and clone the sketches

* remove mirror param

* clippy fix

* debuggin, rm yarn

* Revert "remove mirror param"

This reverts commit a848e243f8.

* use arrbitrary edge_id as sketch mirror id

* additinoal clenaup

* Update rust/kcl-lib/src/std/mirror.rs

Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>

* set .mirror for continuous case

* fix warning

* works without the for loops

* add error handling

* remove duplicate setter

* rm unused var

* clenaup

* unused import

* remove unused let

* Update snapshots

* Update snapshots

* cleanup

* update sim tests

---------

Co-authored-by: gserena <serena@zoo.dev>
Co-authored-by: Jonathan Tran <jonnytran@gmail.com>
Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2025-06-23 12:27:03 -05:00
631b63b1b6 Add reminder to merge documentation PRs with KCL releases (#7579)
* Add reminder to merge documentation PRs with KCL releases

* Link to page to force Dependabot updates
2025-06-23 15:44:41 +00:00
eabcf86436 Add building the artifact graph in sketch mode, take 2 (#7557)
* Add building the artifact graph in mock execution

* Update output

* Add updating the artifact graph after mock execution

* Fix spelling

* Fix to return it all the way

* Fix to not make artifact fields undefined in TS
2025-06-23 15:34:14 +00:00
7ce0ef770a #5576 Fix coredump hotkey on linux (#7577)
* fix hotkey combination for coredump on linux

* add test
2025-06-23 15:01:40 +00:00
599ab33e40 Add bidirectional and twist optional args to point-and-click Extrude (#7496)
* WIP: Add bidirectional args to point-and-click Extrude
Will eventually close #7495

* Wire up edit flow for symmetric

* Show skip true args in header in review phase

* Add bidirectionalLength

* Make currentArg always part of header

* WIP

* Add twistAng

* Proper optional args line in review

* Labels in progress button and option arg section heading

* Clean up extrude specific changes

* Clean up to separate from #7506

* Clean up to separate from #7506

* More clean up across branches

* More UI polish

* Remove options bool icon

* Fix labels for tests

* Upgrade e2e tests to cmdBar fixtures with fixes

* More fixes

* Fixed up more tests related to sweep behavior change

* Fix nodeToEdit not having hidden: true on Shell

* Add typecheck

* WIP: footer buttons

* back to reg width

* Clean up

* Update snapshots

* Update snapshots

* Clean up

* Fix tests and remove label

* Refactor

* Fix offset plane test

* Add CommandBarDivider

* Fix step back

* Update snapshots

* Add comment

* Fix it, thanks bot

* Clean up and inline optional heading

* Little case tweak

* Update src/components/CommandBar/CommandBarReview.tsx

Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>

* Rename to CommandBarHeaderFooter

* Rename to CommandBarHeaderFooter

* Clean things up and fix edit

* Add test

* Revert something quick

* Reorg args to match kcl order

* Clean up edit arg retrieval error checks

* Lint

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>
2025-06-23 14:53:01 +00:00
c584d942d4 Log to the console when there's an error (#7556) 2025-06-21 05:55:07 -04:00
35b8872678 Chore: clean up duplication of nodeToEdit props (#7553)
pierremtb/adhoc/cleanup-nodetoedit-in-config
2025-06-20 17:04:24 -04:00
2f245fe445 Fix: Lints with non-ASCII characters (#7554)
Non-ASCII characters in KCL source code would be displayed wrong, causing weird visuals or at worst, exceptions.

Before:
<img width="449" alt="Screenshot 2025-06-20 at 2 02 23 PM" src="https://github.com/user-attachments/assets/ecd7eef5-de2c-4176-b83e-6c631d081503" />

After:
<img width="459" alt="Screenshot 2025-06-20 at 2 34 10 PM" src="https://github.com/user-attachments/assets/fba2818e-1536-4482-ae09-7bc5b1754581" />
2025-06-20 20:03:00 +00:00
4b95980e9e Set CurrentValue arg to hidden (#7552)
We changed the way `hidden`ness is determined in #7506. Fixes #7551 by
making this one oddball command arg use that new explicit way.
2025-06-20 19:07:05 +00:00
53d6613d0d UTF-8 vs UTF-16 mismatch in KCL diagnostic SourceRanges (#7537)
# Background

The KCL interpreter (written in Rust) reports errors, lints and other diagnostics as UTF-8 source range offsets. JavaScript, including CodeMirror, represents source code as UTF-16 strings. 

# Problem

This means the UTF-8 source ranges sent from Rust don't correspond to the same text in the JS UTF-16 GUI. At best, this means the source ranges highlight the wrong thing if you use non-ASCII characters. At worst, it can cause exceptions by trying to highlight a range that doesn't even exist.

Here's the problem, on main: 

<img width="178" alt="Screenshot 2025-06-20 at 11 52 03 AM" src="https://github.com/user-attachments/assets/9a4e75bf-965f-49d8-b238-8868b35912a1" />

# Solution

We define a KCL SourceRange as _always_ being UTF-8. This means if a source range is constructed in JS, it should be converted to UTF-8. When these ranges are converted into CodeMirror diagnostics, they should be converted to UTF-16.

Here's the same code as above, but on this branch:

<img width="170" alt="Screenshot 2025-06-20 at 11 50 55 AM" src="https://github.com/user-attachments/assets/a5b971c0-0b02-4acd-8fcf-5a133331682b" />

Closes https://github.com/KittyCAD/modeling-app/issues/4327
2025-06-20 19:04:49 +00:00
416d0b37a2 Proper command bar UI support for optional args (#7506)
* WIP: Add bidirectional args to point-and-click Extrude
Will eventually close #7495

* Wire up edit flow for symmetric

* Show skip true args in header in review phase

* Add bidirectionalLength

* Make currentArg always part of header

* WIP

* Add twistAng

* Proper optional args line in review

* Labels in progress button and option arg section heading

* Clean up extrude specific changes

* More UI polish

* Remove options bool icon

* Fix labels for tests

* Upgrade e2e tests to cmdBar fixtures with fixes

* More fixes

* Fixed up more tests related to sweep behavior change

* Fix nodeToEdit not having hidden: true on Shell

* Add typecheck

* WIP: footer buttons

* back to reg width

* Clean up

* Clean up

* Fix tests and remove label

* Refactor

* Fix offset plane test

* Add CommandBarDivider

* Fix step back

* Add comment

* Fix it, thanks bot

* Clean up and inline optional heading

* Little case tweak

* Update src/components/CommandBar/CommandBarReview.tsx

Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>

* Rename to CommandBarHeaderFooter

---------

Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>
2025-06-20 16:05:20 +00:00
5f2a10ec7e docs: Add better docs for tolerance parameter (#7548)
* Add better docs for tolerance parameter

* Update generated docs
2025-06-20 11:42:14 -04:00
24edb66b3c WIP: #7249 Convert new variable name to camelCase automatically (#7546)
convert new variable name to camelcase automatically
2025-06-20 07:45:24 -04:00
903ba33c46 Make the Playwright API reporter more generic (#7534) 2025-06-19 20:19:53 -04:00
c5bf6ad42d Add ellipsis to match the other Loading components (#7526) 2025-06-20 00:09:25 +00:00
eeaa71142a Convert units of tolerance for CSG functions (#7540)
Signed-off-by: Nick Cameron <nrc@ncameron.org>
2025-06-20 07:14:30 +12:00
0d1fc1b513 Fix network machines indicator alignment (#7535)
* Fix network machines indicator alignment
By integrating it better with the new API

* Update snapshots

* Update snapshots

* Add networkMachineStatus only behind isDesktop

* Update snapshots

* Small cleanup

* Fix test-id

* Update snapshots

* Lint

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2025-06-19 16:48:09 +00:00
d510e58ebc Point staging version link to corresponding commit on GitHub (#7529)
* Add the 'Download the app' button back on web
Fixes #7527

* Fix staging release link in desktop app
Fixes #7513

* Update snapshots

* Update snapshots

* Update snapshots

* Add ref parsing logic and unit test

* Oops

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2025-06-19 11:30:28 -04:00
23a01e86e6 Add edit flow for Parameters to Feature Tree (#7536)
* Add edit flow to named parameters, show their value in feature tree

* Amend a feature tree test to include editing a parameter

* Enforce disallowing "create new variable" in edit parameter flow

* Add wrapping behavior! Sorry forgot to commit this

* Update src/machines/commandBarMachine.ts

Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>

---------

Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>
2025-06-19 11:14:37 -04:00
9dd6e3e852 KCL: Support non-ASCII identifiers (#7525)
Both human and LLMs want to write KCL code in non-English languages. This is important and we should support it.

Note that errors are currently a bit broken with non-ASCII identifiers, see #4327
2025-06-19 14:10:21 +00:00
9eaacc2a51 KCL: involuteCircular can use diameter in addition to radius (#7519)
Mechanical engineers prefer using diameter over radius.
2025-06-19 14:09:24 +00:00
de6e0f6b18 Add the 'Download the app' button back on web (#7528)
* Add the 'Download the app' button back on web
Fixes #7527

* Update snapshots

* Update snapshots

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2025-06-19 12:56:37 +00:00
d02a9f59ae #6629 Make undo redo work without code pane being open (#7511)
* move useHotkey for undo/redo into App

* _editorView should be private

* get editorView should be a real get method for consistency

* resolve tsc errors

* fmt

* setView, setState are not exposed

* make undo work without editorview when kcl pane is closed

* lint

* circular deps

* resolve circular deps

* fix undo being 1 step late

* unrelated console.warn removed

* fix undo when code pane is closed during editing

* cleanup

* allow undo to get beyond when code editor has been mounted

* fix up clearHistory

* add test for testing  Undo with closed code pane
2025-06-19 11:26:51 +00:00
92f930dfc0 Improve release template regarding updater checks (#7532)
* Improve release template regarding updater checks

* Break it up and change update label
2025-06-19 09:32:22 +00:00
e651e0c2cf load wasm from custom port (#7514)
* load wasm from custom port

* Jon's suggestion
2025-06-19 09:20:01 +00:00
6358eed7e4 Release KCL 82 (#7531) 2025-06-19 01:03:13 +00:00
fe581ff1d2 Replace lower-right controls with a full status bar (#7443)
* Resurrect this branch with an initial commit

* Add telemetry to global default items

* Add credit progress bar to status bar

* Add selection info to status bar

* Add help menu to "local" side

* Rename statusBarItem utils

* Delete LowerRightControls, now unused

* fix lints

* Update snapshots

* Add test-id to network health indicator, which all E2E tests rely on

* Update src/components/StatusBar/StatusBar.tsx

Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>

* Fix a couple little issues with the e2e tests

* Fix gizmo e2e tests (it moved) and network health test (it should not be on home page)

* More tweaks to accomodate changes to network health indicator

We made use of two test ID's to make Playwright aware of the state, one
of which was on the icon. Now that we want to normalize usage of the
status bar along a more limited API, that became a not possible. This
just tweaks some test code that relied on that fact.

* Fix lints

* Update snapshots

* Re-run CI

* Update snapshots

* Update snapshots

* Test fixes, label logic tweaks

* Update snapshots

* Update snapshots

* Fix up last few tests hopefully. Relative path syntax failed on windows

* Relative paths are behaving badly on Windows, use the old code here

* Update snapshots

* Update snapshots

* Tweak y-value to work on all platforms, ubuntu didn't like 438

* Fix tooltip and popover alignment on NetworkMachineIndicator

* Remove dire warning comment

* Update src/components/StatusBar/defaultStatusBarItems.tsx

Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>

* @lee-at-zoo-corp feedback, pull hooks out of UI code

* Re-run CI

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>
2025-06-17 20:29:27 +00:00
b301fbba22 KCL: Remove stale extrudeTwist docs (#7503)
Thanks Greg
2025-06-17 18:39:34 +00:00
0c702e4bab Use nightly rustfmt in CI (#7509)
* Use nightly rustfmt in CI

* Fix current code to be nightly formatted
2025-06-17 18:30:33 +00:00
25b9a34640 Nit: Name the various 'upload-artifact' CI steps (#7498)
This makes it easier to read GH actions and find the artifacts you're looking for.
2025-06-17 14:34:27 +00:00
b2152a5684 Bump the minor group across 1 directory with 25 updates (#7491)
* Bump the minor group across 1 directory with 25 updates

Bumps the minor group with 25 updates in the /rust directory:

| Package | From | To |
| --- | --- | --- |
| [bson](https://github.com/mongodb/bson-rust) | `2.14.0` | `2.15.0` |
| [clap](https://github.com/clap-rs/clap) | `4.5.36` | `4.5.40` |
| [miette](https://github.com/zkat/miette) | `7.5.0` | `7.6.0` |
| [pyo3](https://github.com/pyo3/pyo3) | `0.24.1` | `0.24.2` |
| [tokio](https://github.com/tokio-rs/tokio) | `1.44.2` | `1.45.1` |
| [uuid](https://github.com/uuid-rs/uuid) | `1.16.0` | `1.17.0` |
| [toml_edit](https://github.com/toml-rs/toml) | `0.22.24` | `0.22.26` |
| [proc-macro2](https://github.com/dtolnay/proc-macro2) | `1.0.94` | `1.0.95` |
| [syn](https://github.com/dtolnay/syn) | `2.0.100` | `2.0.103` |
| [signal-hook](https://github.com/vorner/signal-hook) | `0.3.17` | `0.3.18` |
| [flate2](https://github.com/rust-lang/flate2-rs) | `1.1.1` | `1.1.2` |
| [chrono](https://github.com/chronotope/chrono) | `0.4.40` | `0.4.41` |
| [itertools](https://github.com/rust-itertools/itertools) | `0.13.0` | `0.14.0` |
| [reqwest](https://github.com/seanmonstar/reqwest) | `0.12.15` | `0.12.20` |
| [sha2](https://github.com/RustCrypto/hashes) | `0.10.8` | `0.10.9` |
| [tabled](https://github.com/zhiburt/tabled) | `0.18.0` | `0.20.0` |
| [tempfile](https://github.com/Stebalien/tempfile) | `3.19.0` | `3.20.0` |
| [toml](https://github.com/toml-rs/toml) | `0.8.20` | `0.8.22` |
| [tynm](https://github.com/azriel91/tynm) | `0.1.10` | `0.2.0` |
| [winnow](https://github.com/winnow-rs/winnow) | `0.7.10` | `0.7.11` |
| [tokio-tungstenite](https://github.com/snapview/tokio-tungstenite) | `0.26.2` | `0.27.0` |
| [expectorate](https://github.com/oxidecomputer/expectorate) | `1.1.0` | `1.2.0` |
| [insta](https://github.com/mitsuhiko/insta) | `1.42.2` | `1.43.1` |
| [twenty-twenty](https://github.com/kittycad/twenty-twenty) | `0.8.1` | `0.8.2` |
| [data-encoding](https://github.com/ia0/data-encoding) | `2.8.0` | `2.9.0` |



Updates `bson` from 2.14.0 to 2.15.0
- [Release notes](https://github.com/mongodb/bson-rust/releases)
- [Commits](https://github.com/mongodb/bson-rust/compare/v2.14.0...v2.15.0)

Updates `clap` from 4.5.36 to 4.5.40
- [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.36...clap_complete-v4.5.40)

Updates `miette` from 7.5.0 to 7.6.0
- [Release notes](https://github.com/zkat/miette/releases)
- [Changelog](https://github.com/zkat/miette/blob/main/CHANGELOG.md)
- [Commits](https://github.com/zkat/miette/commits/miette-derive-v7.6.0)

Updates `pyo3` from 0.24.1 to 0.24.2
- [Release notes](https://github.com/pyo3/pyo3/releases)
- [Changelog](https://github.com/PyO3/pyo3/blob/main/CHANGELOG.md)
- [Commits](https://github.com/pyo3/pyo3/compare/v0.24.1...v0.24.2)

Updates `tokio` from 1.44.2 to 1.45.1
- [Release notes](https://github.com/tokio-rs/tokio/releases)
- [Commits](https://github.com/tokio-rs/tokio/compare/tokio-1.44.2...tokio-1.45.1)

Updates `uuid` from 1.16.0 to 1.17.0
- [Release notes](https://github.com/uuid-rs/uuid/releases)
- [Commits](https://github.com/uuid-rs/uuid/compare/v1.16.0...v1.17.0)

Updates `toml_edit` from 0.22.24 to 0.22.26
- [Commits](https://github.com/toml-rs/toml/compare/v0.22.24...v0.22.26)

Updates `proc-macro2` from 1.0.94 to 1.0.95
- [Release notes](https://github.com/dtolnay/proc-macro2/releases)
- [Commits](https://github.com/dtolnay/proc-macro2/compare/1.0.94...1.0.95)

Updates `syn` from 2.0.100 to 2.0.103
- [Release notes](https://github.com/dtolnay/syn/releases)
- [Commits](https://github.com/dtolnay/syn/compare/2.0.100...2.0.103)

Updates `signal-hook` from 0.3.17 to 0.3.18
- [Changelog](https://github.com/vorner/signal-hook/blob/master/CHANGELOG.md)
- [Commits](https://github.com/vorner/signal-hook/compare/v0.3.17...v0.3.18)

Updates `flate2` from 1.1.1 to 1.1.2
- [Release notes](https://github.com/rust-lang/flate2-rs/releases)
- [Commits](https://github.com/rust-lang/flate2-rs/compare/1.1.1...1.1.2)

Updates `chrono` from 0.4.40 to 0.4.41
- [Release notes](https://github.com/chronotope/chrono/releases)
- [Changelog](https://github.com/chronotope/chrono/blob/main/CHANGELOG.md)
- [Commits](https://github.com/chronotope/chrono/compare/v0.4.40...v0.4.41)

Updates `itertools` from 0.13.0 to 0.14.0
- [Changelog](https://github.com/rust-itertools/itertools/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-itertools/itertools/compare/v0.13.0...v0.14.0)

Updates `reqwest` from 0.12.15 to 0.12.20
- [Release notes](https://github.com/seanmonstar/reqwest/releases)
- [Changelog](https://github.com/seanmonstar/reqwest/blob/master/CHANGELOG.md)
- [Commits](https://github.com/seanmonstar/reqwest/compare/v0.12.15...v0.12.20)

Updates `sha2` from 0.10.8 to 0.10.9
- [Commits](https://github.com/RustCrypto/hashes/compare/sha2-v0.10.8...sha2-v0.10.9)

Updates `tabled` from 0.18.0 to 0.20.0
- [Changelog](https://github.com/zhiburt/tabled/blob/master/CHANGELOG.md)
- [Commits](https://github.com/zhiburt/tabled/commits)

Updates `tempfile` from 3.19.0 to 3.20.0
- [Changelog](https://github.com/Stebalien/tempfile/blob/master/CHANGELOG.md)
- [Commits](https://github.com/Stebalien/tempfile/compare/v3.19.0...v3.20.0)

Updates `toml` from 0.8.20 to 0.8.22
- [Commits](https://github.com/toml-rs/toml/compare/toml-v0.8.20...toml-v0.8.22)

Updates `tynm` from 0.1.10 to 0.2.0
- [Release notes](https://github.com/azriel91/tynm/releases)
- [Changelog](https://github.com/azriel91/tynm/blob/main/CHANGELOG.md)
- [Commits](https://github.com/azriel91/tynm/compare/0.1.10...0.2.0)

Updates `winnow` from 0.7.10 to 0.7.11
- [Changelog](https://github.com/winnow-rs/winnow/blob/main/CHANGELOG.md)
- [Commits](https://github.com/winnow-rs/winnow/compare/v0.7.10...v0.7.11)

Updates `tokio-tungstenite` from 0.26.2 to 0.27.0
- [Changelog](https://github.com/snapview/tokio-tungstenite/blob/master/CHANGELOG.md)
- [Commits](https://github.com/snapview/tokio-tungstenite/compare/v0.26.2...v0.27.0)

Updates `expectorate` from 1.1.0 to 1.2.0
- [Release notes](https://github.com/oxidecomputer/expectorate/releases)
- [Commits](https://github.com/oxidecomputer/expectorate/compare/v1.1.0...v1.2.0)

Updates `insta` from 1.42.2 to 1.43.1
- [Release notes](https://github.com/mitsuhiko/insta/releases)
- [Changelog](https://github.com/mitsuhiko/insta/blob/master/CHANGELOG.md)
- [Commits](https://github.com/mitsuhiko/insta/compare/1.42.2...1.43.1)

Updates `twenty-twenty` from 0.8.1 to 0.8.2
- [Release notes](https://github.com/kittycad/twenty-twenty/releases)
- [Commits](https://github.com/kittycad/twenty-twenty/commits/v0.8.2)

Updates `data-encoding` from 2.8.0 to 2.9.0
- [Commits](https://github.com/ia0/data-encoding/compare/v2.8.0...v2.9.0)

---
updated-dependencies:
- dependency-name: bson
  dependency-version: 2.15.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: minor
- dependency-name: clap
  dependency-version: 4.5.40
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: minor
- dependency-name: miette
  dependency-version: 7.6.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: minor
- dependency-name: pyo3
  dependency-version: 0.24.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: minor
- dependency-name: tokio
  dependency-version: 1.45.1
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: minor
- dependency-name: uuid
  dependency-version: 1.17.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: minor
- dependency-name: toml_edit
  dependency-version: 0.22.26
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: minor
- dependency-name: proc-macro2
  dependency-version: 1.0.95
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: minor
- dependency-name: syn
  dependency-version: 2.0.103
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: minor
- dependency-name: signal-hook
  dependency-version: 0.3.18
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: minor
- dependency-name: flate2
  dependency-version: 1.1.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: minor
- dependency-name: chrono
  dependency-version: 0.4.41
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: minor
- dependency-name: itertools
  dependency-version: 0.14.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: minor
- dependency-name: reqwest
  dependency-version: 0.12.20
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: minor
- dependency-name: sha2
  dependency-version: 0.10.9
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: minor
- dependency-name: tabled
  dependency-version: 0.20.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: minor
- dependency-name: tempfile
  dependency-version: 3.20.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: minor
- dependency-name: toml
  dependency-version: 0.8.22
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: minor
- dependency-name: tynm
  dependency-version: 0.2.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: minor
- dependency-name: winnow
  dependency-version: 0.7.11
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: minor
- dependency-name: tokio-tungstenite
  dependency-version: 0.27.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: minor
- dependency-name: expectorate
  dependency-version: 1.2.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: minor
- dependency-name: insta
  dependency-version: 1.43.1
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: minor
- dependency-name: twenty-twenty
  dependency-version: 0.8.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: minor
- dependency-name: data-encoding
  dependency-version: 2.9.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* Update snapshots

* Update snapshots

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2025-06-17 05:29:38 -04:00
832bf77c92 #7255 tangentialArc: angle, radius point-and-click support (#7449)
* separate handling of tangentialArc with angle and radius args

* make previousEndTangent available in segment input for handling tangentialArc with angle/radius

* start adding support for editing tangentialArc with angle, radius

* draw tangentialArc sketch when using angle, radius

* fix getTanPreviousPoint when using tangentialArc with angle, radius

* fix case of unwanted negative angles when calculating angle for tangentialArc

* lint

* add test for tangentialArc dragging with andle, radius

* lint, fmt

* fix getArgForEnd for tangentialArc with radius, angle

* renaming vars
2025-06-17 05:29:21 -04:00
acb43fc82c Prompt for temporary workspace when loading external sample or share link code (#7393)
* Prompt for temporary workspace when loading external sample

* Always go into temporary workspace when loading sample

* Always go into temporary workspace even on external links

* x

* Add tests

* Fix typo

* Update snapshots

* Update snapshots

* Fix tests that now strip code param

* Fix test

* Weird...

* fmt

* x

* Add await

* agh

* Do not clear query parameters, causes more problems than not

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2025-06-16 22:52:13 -04:00
7486d25cf1 Change KCL stdlib floating-point results to not be platform dependent (#7499)
* Add libm dependency

* Change to use libm for trig functions

* Remove redactions for floating point

* Update output

* Use clippy to prevent stdlib math sneaking back in

---------

Co-authored-by: Adam Chalmers <adam.chalmers@zoo.dev>
2025-06-17 01:34:50 +00:00
1a4a030671 Properly respect associativity when reformatting (#7486)
Signed-off-by: Nick Cameron <nrc@ncameron.org>
2025-06-17 11:10:37 +12:00
3049d939e1 Create CODEOWNERS (#7363)
* Create CODEOWNERS

Dependabot is moving away from reviewers flag and CODEOWNERS should be used instead: https://github.blog/changelog/2025-04-29-dependabot-reviewers-configuration-option-being-replaced-by-code-owners/

This PR adds people from the dependabot config.

* Create CODEOWNERS

* Delete CODEOWNERS

* Use new kcl team

Co-authored-by: Pierre Jacquier <pierre@zoo.dev>

---------

Co-authored-by: Jonathan Tran <jonnytran@gmail.com>
Co-authored-by: Pierre Jacquier <pierre@zoo.dev>
2025-06-16 16:39:07 -04:00
ad9822e8ac Change to use web-time instead of unmaintained instant crate (#7497) 2025-06-16 16:36:05 -04:00
aae34cf1e5 Deterministic artifact graph - bring back the clockwork universe (#7483)
* Change to use deterministic artifact graph

* Update output to use the new order

* Fix to clear everything when scene is cleared

* Fix lots

* Update artifact graph output for the last time

* Delete unused sorting code

* Remove unneeded cfg

* Fix to preserve top-level artifacts when there's an error

* Update output after error fix

* Add better doc comments

* Remove duplicate global operations

* Update comments

* Update ignored tests that were flaky

* Update graph for new samples after rebase

* Fix test assertion message
2025-06-16 17:55:24 +00:00
d6278cf075 KCL: change twist to a case of extrude (#7481)
@franknoirot @jtran and I decided that the `extrudeTwist()` function (which I added in https://github.com/KittyCAD/modeling-app/pull/7480) would be better as an optional case of the normal `extrude` function. Doing it this way means less work for the frontend team.
2025-06-16 16:35:30 +00:00
4159cc0047 Fix pausing when camera state command hangs (#7475) 2025-06-16 09:43:33 -04:00
3936017f10 Tag types (#7458)
* Replace tag type with tagIdent and tagDecl

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

* Replace tagIdent with TaggedEdge and TaggedFace

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

---------

Signed-off-by: Nick Cameron <nrc@ncameron.org>
2025-06-16 09:10:36 +12:00
1507 changed files with 193289 additions and 99310 deletions

View File

@ -9,6 +9,7 @@ VITE_KC_SITE_BASE_URL=https://dev.zoo.dev
VITE_KC_SITE_APP_URL=https://app.dev.zoo.dev
VITE_KC_SKIP_AUTH=false
VITE_KC_CONNECTION_TIMEOUT_MS=5000
#VITE_WASM_URL="optional way of overriding the wasm url, particular for unit tests which need this if you running not on the default 3000 port"
#VITE_KC_DEV_TOKEN="optional token to skip auth in the app"
#token="required token for playwright. TODO: clean up env vars in #3973"

3
.github/CODEOWNERS vendored Normal file
View File

@ -0,0 +1,3 @@
* @KittyCAD/frontend
/src/ @KittyCAD/frontend
/rust/ @KittyCAD/kcl

View File

@ -2,7 +2,7 @@
name: Release
about: Create a new release for the Zoo Design Studio
title: "Cut release v1.?.?"
labels: [release]
labels: [meta/release]
---
> Instructions: https://github.com/KittyCAD/modeling-app/blob/main/CONTRIBUTING.md#shipping-releases
@ -19,7 +19,8 @@ Release builds URL: ???
* [ ] Confirm the application opens (dismiss the updater)
* [ ] Create a project with a basic Text-to-CAD prompt
* [ ] Confirm the result is viewable in an engine stream
* [ ] Open the application again and confirm the updater can downgrade
* [ ] Use 'Check for updates' to bring back the updater toast
* [ ] Confirm the app can update to the previous release
## macOS via ???
@ -27,7 +28,8 @@ Release builds URL: ???
* [ ] Confirm the application opens (dismiss the updater)
* [ ] Create a project with a basic Text-to-CAD prompt
* [ ] Confirm the result is viewable in an engine stream
* [ ] Open the application again and confirm the updater can downgrade
* [ ] Use 'Check for updates' to bring back the updater toast
* [ ] Confirm the app can update to the previous release
## Linux via ???
@ -35,4 +37,5 @@ Release builds URL: ???
* [ ] Confirm the application opens (dismiss the updater)
* [ ] Create a project with a basic Text-to-CAD prompt
* [ ] Confirm the result is viewable in an engine stream
* [ ] Open the application again and confirm the updater can downgrade
* [ ] Use 'Check for updates' to bring back the updater toast
* [ ] Confirm the app can update to the previous release

View File

@ -43,7 +43,7 @@ jobs:
- name: Download Wasm Cache
id: download-wasm
if: ${{ github.event_name == 'pull_request' && steps.filter.outputs.rust == 'false' }}
uses: dawidd6/action-download-artifact@v7
uses: dawidd6/action-download-artifact@v11
continue-on-error: true
with:
github_token: ${{secrets.GITHUB_TOKEN}}
@ -362,7 +362,7 @@ jobs:
- name: Authenticate to Google Cloud
if: ${{ env.IS_STAGING == 'true' }}
uses: 'google-github-actions/auth@v2.1.8'
uses: 'google-github-actions/auth@v2.1.10'
with:
credentials_json: '${{ secrets.GOOGLE_CLOUD_DL_SA }}'

View File

@ -31,15 +31,15 @@ jobs:
- name: Use correct Rust toolchain
shell: bash
run: |
[ -e rust-toolchain.toml ] || cp rust/rust-toolchain.toml ./
cp .github/workflows/nightly-rust-toolchain.toml rust-toolchain.toml
- name: Install rust
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
cache-workspaces: rust
components: rustfmt
- name: Run cargo fmt
- name: Run nightly cargo fmt
run: |
cd rust
cargo fmt -- --check
cargo +nightly fmt -- --check
shell: bash

View File

@ -25,8 +25,8 @@ jobs:
- runner=8cpu-linux-x64
- extras=s3-cache
steps:
- uses: runs-on/action@v1
- uses: actions/create-github-app-token@v1
- uses: runs-on/action@v2
- uses: actions/create-github-app-token@v2
id: app-token
with:
app-id: ${{ secrets.MODELING_APP_GH_APP_ID }}
@ -149,8 +149,8 @@ jobs:
partitionIndex: [1, 2, 3, 4, 5, 6]
partitionTotal: [6]
steps:
- uses: runs-on/action@v1
- uses: actions/create-github-app-token@v1
- uses: runs-on/action@v2
- uses: actions/create-github-app-token@v2
id: app-token
with:
app-id: ${{ secrets.MODELING_APP_GH_APP_ID }}
@ -207,8 +207,8 @@ jobs:
- runner=32cpu-linux-x64
- extras=s3-cache
steps:
- uses: runs-on/action@v1
- uses: actions/create-github-app-token@v1
- uses: runs-on/action@v2
- uses: actions/create-github-app-token@v2
id: app-token
with:
app-id: ${{ secrets.MODELING_APP_GH_APP_ID }}

View File

@ -46,7 +46,7 @@ jobs:
- name: Download Wasm cache
id: download-wasm
if: ${{ github.event_name != 'schedule' && steps.filter.outputs.rust == 'false' }}
uses: dawidd6/action-download-artifact@v7
uses: dawidd6/action-download-artifact@v11
continue-on-error: true
with:
github_token: ${{secrets.GITHUB_TOKEN}}
@ -95,7 +95,8 @@ jobs:
shell: bash
run: npm run build:wasm
- uses: actions/upload-artifact@v4
- name: Upload compiled wasm artifacts
uses: actions/upload-artifact@v4
with:
name: prepared-wasm
path: |
@ -109,7 +110,7 @@ jobs:
steps:
- uses: actions/create-github-app-token@v1
- uses: actions/create-github-app-token@v2
id: app-token
with:
app-id: ${{ secrets.MODELING_APP_GH_APP_ID }}
@ -176,7 +177,8 @@ jobs:
CI_SUITE: e2e:snapshots
TARGET: web
- uses: actions/upload-artifact@v4
- name: Upload playwright report
uses: actions/upload-artifact@v4
if: ${{ !cancelled() }}
with:
name: playwright-report-snapshot-${{ github.sha }}
@ -228,7 +230,7 @@ jobs:
steps:
- uses: actions/create-github-app-token@v1
- uses: actions/create-github-app-token@v2
id: app-token
with:
app-id: ${{ secrets.MODELING_APP_GH_APP_ID }}
@ -290,7 +292,8 @@ jobs:
CI_SUITE: e2e:web
TARGET: web
- uses: actions/upload-artifact@v4
- name: Upload playwright report
uses: actions/upload-artifact@v4
if: ${{ !cancelled() && (success() || failure()) }}
with:
name: playwright-report-web-${{ env.OS_NAME }}-${{ matrix.shardIndex }}-${{ github.sha }}
@ -415,7 +418,8 @@ jobs:
CI_SUITE: e2e:desktop
TARGET: desktop
- uses: actions/upload-artifact@v4
- name: Upload test report
uses: actions/upload-artifact@v4
if: always()
with:
name: test-results-desktop-${{ env.OS_NAME }}-${{ matrix.shardIndex }}-${{ github.sha }}
@ -424,7 +428,8 @@ jobs:
retention-days: 30
overwrite: true
- uses: actions/upload-artifact@v4
- name: Upload playwright report
uses: actions/upload-artifact@v4
if: always()
with:
name: playwright-report-desktop-${{ env.OS_NAME }}-${{ matrix.shardIndex }}-${{ github.sha }}

View File

@ -20,7 +20,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/create-github-app-token@v1
- uses: actions/create-github-app-token@v2
id: app-token
with:
# required

View File

@ -328,7 +328,7 @@ jobs:
mkdir -p releases/language-server/${{ env.TAG }}
cp -r build/* releases/language-server/${{ env.TAG }}
- name: "Authenticate to Google Cloud"
uses: "google-github-actions/auth@v2.1.8"
uses: "google-github-actions/auth@v2.1.10"
with:
credentials_json: "${{ secrets.GOOGLE_CLOUD_DL_SA }}"
- name: Set up Cloud SDK

View File

@ -113,7 +113,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v5
uses: astral-sh/setup-uv@v6
- uses: actions-rust-lang/setup-rust-toolchain@v1
- uses: taiki-e/install-action@just
- name: Run tests
@ -130,7 +130,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Install the latest version of uv
uses: astral-sh/setup-uv@v5
uses: astral-sh/setup-uv@v6
- name: Install codespell
run: |
uv venv .venv
@ -161,7 +161,7 @@ jobs:
with:
path: rust/kcl-python-bindings
- name: Install the latest version of uv
uses: astral-sh/setup-uv@v5
uses: astral-sh/setup-uv@v6
- name: do uv things
run: |
cd rust/kcl-python-bindings

View File

@ -0,0 +1,3 @@
[toolchain]
channel = "nightly"
components = ["rustfmt"]

View File

@ -108,7 +108,7 @@ jobs:
run: npm run files:set-notes
- name: Authenticate to Google Cloud
uses: 'google-github-actions/auth@v2.1.8'
uses: 'google-github-actions/auth@v2.1.10'
with:
credentials_json: '${{ secrets.GOOGLE_CLOUD_DL_SA }}'

View File

@ -120,6 +120,36 @@ jobs:
- run: npm run circular-deps:diff
npm-url-checker:
runs-on: ubuntu-latest
needs: npm-build-wasm
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'npm'
- run: npm install
- name: Download all artifacts
uses: actions/download-artifact@v4
- name: Copy prepared wasm
run: |
ls -R prepared-wasm
cp prepared-wasm/kcl_wasm_lib_bg.wasm public
mkdir rust/kcl-wasm-lib/pkg
cp prepared-wasm/kcl_wasm_lib* rust/kcl-wasm-lib/pkg
- name: Copy prepared ts-rs bindings
run: |
ls -R prepared-ts-rs-bindings
mkdir rust/kcl-lib/bindings
cp -r prepared-ts-rs-bindings/* rust/kcl-lib/bindings/
- run: npm run url-checker:diff
python-codespell:
runs-on: ubuntu-22.04
steps:

2
.gitignore vendored
View File

@ -87,4 +87,4 @@ venv
.vscode-test
.biome/
.million
.million

View File

@ -235,6 +235,47 @@ To display logging (to the terminal or console) set `ZOO_LOG=1`. This will log s
To enable memory metrics, build with `--features dhat-heap`.
## Running scripts
There are multiple scripts under the folder path `./scripts` which can be used in various settings.
### Pattern for a static file, npm run commands, and CI-CD checks
If you want to implement a static checker follow this pattern. Two static checkers we have are circular dependency checks in our typescript code and url checker to see if any hard coded URL is the typescript application 404s. We have a set of known files in `./scripts/known/*.txt` which is the baseline.
If you improve the baseline, run the overwrite command and commit the new smaller baseline. Try not to make the baseline bigger, the CI CD will complain.
These baselines are to hold us to higher standards and help implement automated testing against the repository
#### Output result to stdout
- `npm run circular-deps`
- `npm run url-checker`
- create a `<name>.sh` file that will run the static checker then output the result to `stdout`
#### Overwrite result to known .txt file on disk
If the application needs to overwrite the known file on disk use this pattern. This known .txt file will be source controlled as the baseline
- `npm run circular-deps:overwrite`
- `npm run url-checker:overwrite`
#### Diff baseline and current
These commands will write a /tmp/ file on disk and compare it to the known file in the repository. This command will also be used in the CI CD pipeline for automated checks
- create a `diff-<name>.sh` file that is the script to diff your tmp file to the baseline
e.g. `diff-url-checker.sh`
```bash
#!/bin/bash
set -euo pipefail
npm run url-checker > /tmp/urls.txt
diff --ignore-blank-lines -w /tmp/urls.txt ./scripts/known/urls.txt
```
- `npm run circular-deps:diff`
- `npm run url-checker:diff`
## Proposing changes
Before you submit a contribution PR to this repo, please ensure that:
@ -280,6 +321,9 @@ Assign someone to each section of the manual checklist generated by the issue te
Follow the instructions [here](./rust/README.md) to publish new crates.
This ensures that the KCL accepted by the app is also accepted by the CLI.
If there are documentation changes, merge the corresponding Dependabot PRs [here](https://github.com/KittyCAD/website/pulls/app%2Fdependabot) for the website.
You can trigger Dependabot to check for updates [here](https://github.com/KittyCAD/website/network/updates/17261214/jobs).
#### 5. Publish the release
Head over to https://github.com/KittyCAD/modeling-app/releases/new, pick the newly created tag and type it in the **Release title** field as well.

View File

@ -62,7 +62,10 @@ else
endif
public/kcl-samples/manifest.json: $(KCL_SOURCES)
ifndef WINDOWS
cd rust/kcl-lib && EXPECTORATE=overwrite cargo test generate_manifest
@ touch $@
endif
.vite/build/main.js: $(REACT_SOURCES) $(TYPESCRIPT_SOURCES) $(VITE_SOURCES)
npm run tronb:vite:dev

View File

@ -83,6 +83,13 @@ Allow orbiting in sketch mode.
Whether to show the debug panel, which lets you see various states of the app to aid in development.
**Default:** None
##### fixed_size_grid
If true, the grid cells will be fixed-size, where the width is your default length unit. If false, the grid will get larger as you zoom out, and smaller as you zoom in.
**Default:** None

View File

@ -44,7 +44,7 @@ detail on importing geometry.
Tags are used to give a name (tag) to a specific path.
### `TagDeclarator`
### Tag declarations - `TagDecl`
The syntax for declaring a tag is `$myTag` you would use it in the following
way:
@ -67,24 +67,28 @@ startSketchOn(XZ)
|> close()
```
### `TagIdentifier`
When a function requires declaring a new tag (using the `$` syntax), the argument has type [`TagDecl`](/docs/kcl-std/types/std-types-TagDecl).
As per the example above you can use the tag identifier to get a reference to the
tagged object. The syntax for this is `myTag`.
### Tag identifiers
In the example above we use the tag identifier to get the angle of the segment
`segAng(rectangleSegmentA001)`.
A tag created using a tag declarator can be used by writing its name without the `$`, e.g., `myTag`.
Where necessary to disambiguate from tag declarations, we call these tag identifiers.
### `Start`
In the example above we use the tag identifier `rectangleSegmentA001` to get the angle of the segment
using `segAng(rectangleSegmentA001)`.
There is a special tag, `START` (with type `Start`, although under the cover, it's a string)
for identifying the face of a solid which was the start of an extrusion (i.e., the surface which
is extruded).
Tags can identify either an edge or face of a solid, or a line or other edge of a sketch. Functions
which take a tag identifier as an argument will use either [`TaggedEdge`](/docs/kcl-std/types/std-types-TaggedEdge) (for the edge of a
solid or sketch) or [`TaggedFace`](/docs/kcl-std/types/std-types-TaggedFace).
### `End`
If a line in a sketch is tagged and then the sketch is extruded, the tag is a `TaggedEdge` before
extrusion and a `TaggedFace` after extrusion.
#### `START` and `END`
[`START`](/docs/kcl-std/consts/std-START) and [`END`](/docs/kcl-std/consts/std-END) are special tags
for identifying the starting and ending faces of an extruded solid.
There is a special tag, `END` (with type `End`, although under the cover, it's a string)
for identifying the face of a solid which was finishes an extrusion.
### Tag Scope

View File

@ -8,9 +8,13 @@ layout: manual
Identifies the ending face of an extrusion. I.e., the new face created by an extrusion.
```kcl
END: string = 'end'
END: TaggedFace
```
### Type
[`TaggedFace`](/docs/kcl-std/types/std-types-TaggedFace) - A tag which references a face of a solid, including the distinguished tags `START` and `END`.

View File

@ -8,9 +8,13 @@ layout: manual
Identifies the starting face of an extrusion. I.e., the face which is extruded.
```kcl
START: string = 'start'
START: TaggedFace
```
### Type
[`TaggedFace`](/docs/kcl-std/types/std-types-TaggedFace) - A tag which references a face of a solid, including the distinguished tags `START` and `END`.

View File

@ -8,9 +8,13 @@ layout: manual
The X-axis (can be used in both 2d and 3d contexts).
```kcl
X
X: Axis3d
```
### Type
[`Axis3d`](/docs/kcl-std/types/std-types-Axis3d) - An abstract and infinite line in 3d space.

View File

@ -8,9 +8,13 @@ layout: manual
An abstract 3d plane aligned with the X and Y axes. Its normal is the positive Z axis.
```kcl
XY
XY: Plane
```
### Type
[`Plane`](/docs/kcl-std/types/std-types-Plane) - An abstract plane.

View File

@ -8,9 +8,13 @@ layout: manual
An abstract 3d plane aligned with the X and Z axes. Its normal is the negative Y axis.
```kcl
XZ
XZ: Plane
```
### Type
[`Plane`](/docs/kcl-std/types/std-types-Plane) - An abstract plane.

View File

@ -8,9 +8,13 @@ layout: manual
The Y-axis (can be used in both 2d and 3d contexts).
```kcl
Y
Y: Axis3d
```
### Type
[`Axis3d`](/docs/kcl-std/types/std-types-Axis3d) - An abstract and infinite line in 3d space.

View File

@ -8,9 +8,13 @@ layout: manual
An abstract 3d plane aligned with the Y and Z axes. Its normal is the positive X axis.
```kcl
YZ
YZ: Plane
```
### Type
[`Plane`](/docs/kcl-std/types/std-types-Plane) - An abstract plane.

View File

@ -8,9 +8,13 @@ layout: manual
The 3D Z-axis.
```kcl
Z
Z: Axis3d
```
### Type
[`Axis3d`](/docs/kcl-std/types/std-types-Axis3d) - An abstract and infinite line in 3d space.

View File

@ -13,6 +13,10 @@ E: number = 2.71828182845904523536028747135266250_
### Type
[`number`](/docs/kcl-std/types/std-types-number) - A number.
### Examples
```kcl

View File

@ -11,7 +11,7 @@ The value of `pi`, Archimedes constant (π).
PI: number(_?) = 3.14159265358979323846264338327950288_?
```
`PI` is a number and is technically a ratio, so you might expect it to have type `number(_)`.
`PI` is a number and is technically a ratio, so you might expect it to have type [`number(_)`](/docs/kcl-std/types/std-types-number).
However, `PI` is nearly always used for converting between different units - usually degrees to or
from radians. Therefore, `PI` is treated a bit specially by KCL and always has unknown units. This
means that if you use `PI`, you will need to give KCL some extra information about the units of numbers.
@ -19,6 +19,10 @@ Usually you should use type ascription on the result of calculations, e.g., `(2
It is better to use `units::toRadians` or `units::toDegrees` to convert between angles with
different units where possible.
### Type
[`number(_?)`](/docs/kcl-std/types/std-types-number) - A number.
### Examples
```kcl

View File

@ -13,6 +13,10 @@ TAU: number = 6.28318530717958647692528676655900577_
### Type
[`number`](/docs/kcl-std/types/std-types-number) - A number.
### Examples
```kcl

View File

@ -13,4 +13,8 @@ sweep::SKETCH_PLANE: string = 'sketchPlane'
### Type
[`string`](/docs/kcl-std/types/std-types-string) - A sequence of characters

View File

@ -13,4 +13,8 @@ sweep::TRAJECTORY: string = 'trajectoryCurve'
### Type
[`string`](/docs/kcl-std/types/std-types-string) - A sequence of characters

View File

@ -13,4 +13,8 @@ turns::HALF_TURN: number(deg) = 180deg
### Type
[`number(deg)`](/docs/kcl-std/types/std-types-number) - A number.

View File

@ -13,4 +13,8 @@ turns::QUARTER_TURN: number(deg) = 90deg
### Type
[`number(deg)`](/docs/kcl-std/types/std-types-number) - A number.

View File

@ -13,4 +13,8 @@ turns::THREE_QUARTER_TURN: number(deg) = 270deg
### Type
[`number(deg)`](/docs/kcl-std/types/std-types-number) - A number.

View File

@ -8,9 +8,13 @@ layout: manual
No turn, zero degrees/radians.
```kcl
turns::ZERO
turns::ZERO: number(Angle)
```
### Type
[`number(Angle)`](/docs/kcl-std/types/std-types-number) - A number.

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -16,7 +16,7 @@ angledLine(
lengthY?: number(Length),
endAbsoluteX?: number(Length),
endAbsoluteY?: number(Length),
tag?: tag,
tag?: TagDecl,
): Sketch
```
@ -33,7 +33,7 @@ angledLine(
| `lengthY` | [`number(Length)`](/docs/kcl-std/types/std-types-number) | Draw the line this distance along the Y axis. Only one of `length`, `lengthX`, `lengthY`, `endAbsoluteX`, `endAbsoluteY` can be given. | No |
| `endAbsoluteX` | [`number(Length)`](/docs/kcl-std/types/std-types-number) | Draw the line along the given angle until it reaches this point along the X axis. Only one of `length`, `lengthX`, `lengthY`, `endAbsoluteX`, `endAbsoluteY` can be given. | No |
| `endAbsoluteY` | [`number(Length)`](/docs/kcl-std/types/std-types-number) | Draw the line along the given angle until it reaches this point along the Y axis. Only one of `length`, `lengthX`, `lengthY`, `endAbsoluteX`, `endAbsoluteY` can be given. | No |
| [`tag`](/docs/kcl-std/types/std-types-tag) | [`tag`](/docs/kcl-std/types/std-types-tag) | Create a new tag which refers to this line. | No |
| `tag` | [`TagDecl`](/docs/kcl-std/types/std-types-TagDecl) | Create a new tag which refers to this line. | No |
### Returns

View File

@ -11,9 +11,9 @@ Draw an angled line from the current origin, constructing a line segment such th
angledLineThatIntersects(
@sketch: Sketch,
angle: number(Angle),
intersectTag: tag,
intersectTag: TaggedEdge,
offset?: number(Length),
tag?: tag,
tag?: TagDecl,
): Sketch
```
@ -25,9 +25,9 @@ angledLineThatIntersects(
|----------|------|-------------|----------|
| `sketch` | [`Sketch`](/docs/kcl-std/types/std-types-Sketch) | Which sketch should this path be added to? | Yes |
| `angle` | [`number(Angle)`](/docs/kcl-std/types/std-types-number) | Which angle should the line be drawn at? | Yes |
| `intersectTag` | [`tag`](/docs/kcl-std/types/std-types-tag) | The tag of the line to intersect with. | Yes |
| `intersectTag` | [`TaggedEdge`](/docs/kcl-std/types/std-types-TaggedEdge) | The tag of the line to intersect with. | Yes |
| `offset` | [`number(Length)`](/docs/kcl-std/types/std-types-number) | The offset from the intersecting line. | No |
| [`tag`](/docs/kcl-std/types/std-types-tag) | [`tag`](/docs/kcl-std/types/std-types-tag) | Create a new tag which refers to this line. | No |
| `tag` | [`TagDecl`](/docs/kcl-std/types/std-types-TagDecl) | Create a new tag which refers to this line. | No |
### Returns

View File

@ -16,7 +16,7 @@ arc(
diameter?: number(Length),
interiorAbsolute?: Point2d,
endAbsolute?: Point2d,
tag?: tag,
tag?: TagDecl,
): Sketch
```
@ -40,7 +40,7 @@ for to construct your shape, you're likely looking for tangentialArc.
| `diameter` | [`number(Length)`](/docs/kcl-std/types/std-types-number) | How large should the circle be? Incompatible with `radius`. | No |
| `interiorAbsolute` | [`Point2d`](/docs/kcl-std/types/std-types-Point2d) | Any point between the arc's start and end? Requires `endAbsolute`. Incompatible with `angleStart` or `angleEnd`. | No |
| `endAbsolute` | [`Point2d`](/docs/kcl-std/types/std-types-Point2d) | Where should this arc end? Requires `interiorAbsolute`. Incompatible with `angleStart` or `angleEnd`. | No |
| [`tag`](/docs/kcl-std/types/std-types-tag) | [`tag`](/docs/kcl-std/types/std-types-tag) | Create a new tag which refers to this arc. | No |
| `tag` | [`TagDecl`](/docs/kcl-std/types/std-types-TagDecl) | Create a new tag which refers to this arc. | No |
### Returns

File diff suppressed because one or more lines are too long

View File

@ -13,7 +13,7 @@ circle(
center: Point2d,
radius?: number(Length),
diameter?: number(Length),
tag?: tag,
tag?: TagDecl,
): Sketch
```
@ -27,7 +27,7 @@ circle(
| `center` | [`Point2d`](/docs/kcl-std/types/std-types-Point2d) | The center of the circle. | Yes |
| `radius` | [`number(Length)`](/docs/kcl-std/types/std-types-number) | The radius of the circle. Incompatible with `diameter`. | No |
| `diameter` | [`number(Length)`](/docs/kcl-std/types/std-types-number) | The diameter of the circle. Incompatible with `radius`. | No |
| [`tag`](/docs/kcl-std/types/std-types-tag) | [`tag`](/docs/kcl-std/types/std-types-tag) | Create a new tag which refers to this circle. | No |
| `tag` | [`TagDecl`](/docs/kcl-std/types/std-types-TagDecl) | Create a new tag which refers to this circle. | No |
### Returns

View File

@ -13,7 +13,7 @@ circleThreePoint(
p1: Point2d,
p2: Point2d,
p3: Point2d,
tag?: tag,
tag?: TagDecl,
): Sketch
```
@ -27,7 +27,7 @@ circleThreePoint(
| `p1` | [`Point2d`](/docs/kcl-std/types/std-types-Point2d) | 1st point to derive the circle. | Yes |
| `p2` | [`Point2d`](/docs/kcl-std/types/std-types-Point2d) | 2nd point to derive the circle. | Yes |
| `p3` | [`Point2d`](/docs/kcl-std/types/std-types-Point2d) | 3rd point to derive the circle. | Yes |
| [`tag`](/docs/kcl-std/types/std-types-tag) | [`tag`](/docs/kcl-std/types/std-types-tag) | Identifier for the circle to reference elsewhere. | No |
| `tag` | [`TagDecl`](/docs/kcl-std/types/std-types-TagDecl) | Identifier for the circle to reference elsewhere. | No |
### Returns

View File

@ -10,7 +10,7 @@ Construct a line segment from the current origin back to the profile's origin, e
```kcl
close(
@sketch: Sketch,
tag?: tag,
tag?: TagDecl,
): Sketch
```
@ -24,7 +24,7 @@ starting point.
| Name | Type | Description | Required |
|----------|------|-------------|----------|
| `sketch` | [`Sketch`](/docs/kcl-std/types/std-types-Sketch) | The sketch you want to close. | Yes |
| [`tag`](/docs/kcl-std/types/std-types-tag) | [`tag`](/docs/kcl-std/types/std-types-tag) | Create a new tag which refers to this line. | No |
| `tag` | [`TagDecl`](/docs/kcl-std/types/std-types-TagDecl) | Create a new tag which refers to this line. | No |
### Returns

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -8,7 +8,7 @@ layout: manual
Get the shared edge between two faces.
```kcl
getCommonEdge(faces: [tag; 2]): Edge
getCommonEdge(faces: [TaggedFace; 2]): Edge
```
@ -17,7 +17,7 @@ getCommonEdge(faces: [tag; 2]): Edge
| Name | Type | Description | Required |
|----------|------|-------------|----------|
| `faces` | `[tag; 2]` | The tags of the faces you want to find the common edge between. | Yes |
| `faces` | `[TaggedFace; 2]` | The tags of the faces you want to find the common edge between. | Yes |
### Returns

View File

@ -8,7 +8,7 @@ layout: manual
Get the next adjacent edge to the edge given.
```kcl
getNextAdjacentEdge(@edge: tag): Edge
getNextAdjacentEdge(@edge: TaggedEdge): Edge
```
@ -17,7 +17,7 @@ getNextAdjacentEdge(@edge: tag): Edge
| Name | Type | Description | Required |
|----------|------|-------------|----------|
| `edge` | [`tag`](/docs/kcl-std/types/std-types-tag) | The tag of the edge you want to find the next adjacent edge of. | Yes |
| `edge` | [`TaggedEdge`](/docs/kcl-std/types/std-types-TaggedEdge) | The tag of the edge you want to find the next adjacent edge of. | Yes |
### Returns

View File

@ -8,7 +8,7 @@ layout: manual
Get the opposite edge to the edge given.
```kcl
getOppositeEdge(@edge: tag): Edge
getOppositeEdge(@edge: TaggedEdge): Edge
```
@ -17,7 +17,7 @@ getOppositeEdge(@edge: tag): Edge
| Name | Type | Description | Required |
|----------|------|-------------|----------|
| `edge` | [`tag`](/docs/kcl-std/types/std-types-tag) | The tag of the edge you want to find the opposite edge of. | Yes |
| `edge` | [`TaggedEdge`](/docs/kcl-std/types/std-types-TaggedEdge) | The tag of the edge you want to find the opposite edge of. | Yes |
### Returns

View File

@ -8,7 +8,7 @@ layout: manual
Get the previous adjacent edge to the edge given.
```kcl
getPreviousAdjacentEdge(@edge: tag): Edge
getPreviousAdjacentEdge(@edge: TaggedEdge): Edge
```
@ -17,7 +17,7 @@ getPreviousAdjacentEdge(@edge: tag): Edge
| Name | Type | Description | Required |
|----------|------|-------------|----------|
| `edge` | [`tag`](/docs/kcl-std/types/std-types-tag) | The tag of the edge you want to find the previous adjacent edge of. | Yes |
| `edge` | [`TaggedEdge`](/docs/kcl-std/types/std-types-TaggedEdge) | The tag of the edge you want to find the previous adjacent edge of. | Yes |
### Returns

View File

@ -10,11 +10,13 @@ Extend the current sketch with a new involute circular curve.
```kcl
involuteCircular(
@sketch: Sketch,
startRadius: number(Length),
endRadius: number(Length),
angle: number(Angle),
startRadius?: number(Length),
endRadius?: number(Length),
startDiameter?: number(Length),
endDiameter?: number(Length),
reverse?: bool,
tag?: tag,
tag?: TagDecl,
): Sketch
```
@ -25,11 +27,13 @@ involuteCircular(
| Name | Type | Description | Required |
|----------|------|-------------|----------|
| `sketch` | [`Sketch`](/docs/kcl-std/types/std-types-Sketch) | Which sketch should this path be added to? | Yes |
| `startRadius` | [`number(Length)`](/docs/kcl-std/types/std-types-number) | The involute is described between two circles, start_radius is the radius of the inner circle. | Yes |
| `endRadius` | [`number(Length)`](/docs/kcl-std/types/std-types-number) | The involute is described between two circles, end_radius is the radius of the outer circle. | Yes |
| `angle` | [`number(Angle)`](/docs/kcl-std/types/std-types-number) | The angle to rotate the involute by. A value of zero will produce a curve with a tangent along the x-axis at the start point of the curve. | Yes |
| `startRadius` | [`number(Length)`](/docs/kcl-std/types/std-types-number) | The involute is described between two circles, startRadius is the radius of the inner circle. Either `startRadius` or `startDiameter` must be given (but not both). | No |
| `endRadius` | [`number(Length)`](/docs/kcl-std/types/std-types-number) | The involute is described between two circles, endRadius is the radius of the outer circle. Either `endRadius` or `endDiameter` must be given (but not both). | No |
| `startDiameter` | [`number(Length)`](/docs/kcl-std/types/std-types-number) | The involute is described between two circles, startDiameter describes the inner circle. Either `startRadius` or `startDiameter` must be given (but not both). | No |
| `endDiameter` | [`number(Length)`](/docs/kcl-std/types/std-types-number) | The involute is described between two circles, endDiameter describes the outer circle. Either `endRadius` or `endDiameter` must be given (but not both). | No |
| `reverse` | [`bool`](/docs/kcl-std/types/std-types-bool) | If reverse is true, the segment will start from the end of the involute, otherwise it will start from that start. | No |
| [`tag`](/docs/kcl-std/types/std-types-tag) | [`tag`](/docs/kcl-std/types/std-types-tag) | Create a new tag which refers to this line. | No |
| `tag` | [`TagDecl`](/docs/kcl-std/types/std-types-TagDecl) | Create a new tag which refers to this line. | No |
### Returns

View File

@ -12,7 +12,7 @@ line(
@sketch: Sketch,
endAbsolute?: Point2d,
end?: Point2d,
tag?: tag,
tag?: TagDecl,
): Sketch
```
@ -25,7 +25,7 @@ line(
| `sketch` | [`Sketch`](/docs/kcl-std/types/std-types-Sketch) | Which sketch should this path be added to? | Yes |
| `endAbsolute` | [`Point2d`](/docs/kcl-std/types/std-types-Point2d) | Which absolute point should this line go to? Incompatible with `end`. | No |
| `end` | [`Point2d`](/docs/kcl-std/types/std-types-Point2d) | How far away (along the X and Y axes) should this line go? Incompatible with `endAbsolute`. | No |
| [`tag`](/docs/kcl-std/types/std-types-tag) | [`tag`](/docs/kcl-std/types/std-types-tag) | Create a new tag which refers to this line. | No |
| `tag` | [`TagDecl`](/docs/kcl-std/types/std-types-TagDecl) | Create a new tag which refers to this line. | No |
### Returns

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

@ -15,8 +15,8 @@ revolve(
tolerance?: number(Length),
symmetric?: bool,
bidirectionalAngle?: number(Angle),
tagStart?: tag,
tagEnd?: tag,
tagStart?: TagDecl,
tagEnd?: TagDecl,
): [Solid; 1+]
```
@ -38,11 +38,11 @@ revolved around the same axis.
| `sketches` | [`[Sketch; 1+]`](/docs/kcl-std/types/std-types-Sketch) | The sketch or set of sketches that should be revolved | Yes |
| `axis` | [`Axis2d`](/docs/kcl-std/types/std-types-Axis2d) or [`Edge`](/docs/kcl-std/types/std-types-Edge) | Axis of revolution. | Yes |
| `angle` | [`number(Angle)`](/docs/kcl-std/types/std-types-number) | Angle to revolve (in degrees). Default is 360. | No |
| `tolerance` | [`number(Length)`](/docs/kcl-std/types/std-types-number) | Tolerance for the revolve operation. | No |
| `tolerance` | [`number(Length)`](/docs/kcl-std/types/std-types-number) | Defines the smallest distance below which two entities are considered coincident, intersecting, coplanar, or similar. For most use cases, it should not be changed from its default value of 10^-7 millimeters. | No |
| `symmetric` | [`bool`](/docs/kcl-std/types/std-types-bool) | If true, the extrusion will happen symmetrically around the sketch. Otherwise, the extrusion will happen on only one side of the sketch. | No |
| `bidirectionalAngle` | [`number(Angle)`](/docs/kcl-std/types/std-types-number) | If specified, will also revolve in the opposite direction to 'angle' to the specified angle. If 'symmetric' is true, this value is ignored. | No |
| `tagStart` | [`tag`](/docs/kcl-std/types/std-types-tag) | A named tag for the face at the start of the revolve, i.e. the original sketch. | No |
| `tagEnd` | [`tag`](/docs/kcl-std/types/std-types-tag) | A named tag for the face at the end of the revolve. | No |
| `tagStart` | [`TagDecl`](/docs/kcl-std/types/std-types-TagDecl) | A named tag for the face at the start of the revolve, i.e. the original sketch. | No |
| `tagEnd` | [`TagDecl`](/docs/kcl-std/types/std-types-TagDecl) | A named tag for the face at the end of the revolve. | No |
### Returns

View File

@ -8,7 +8,7 @@ layout: manual
Compute the angle (in degrees) of the provided line segment.
```kcl
segAng(@tag: tag): number(Angle)
segAng(@tag: TaggedEdge): number(Angle)
```
@ -17,7 +17,7 @@ segAng(@tag: tag): number(Angle)
| Name | Type | Description | Required |
|----------|------|-------------|----------|
| [`tag`](/docs/kcl-std/types/std-types-tag) | [`tag`](/docs/kcl-std/types/std-types-tag) | The line segment being queried by its tag. | Yes |
| `tag` | [`TaggedEdge`](/docs/kcl-std/types/std-types-TaggedEdge) | The line segment being queried by its tag. | Yes |
### Returns

View File

@ -8,7 +8,7 @@ layout: manual
Compute the ending point of the provided line segment.
```kcl
segEnd(@tag: tag): Point2d
segEnd(@tag: TaggedEdge): Point2d
```
@ -17,7 +17,7 @@ segEnd(@tag: tag): Point2d
| Name | Type | Description | Required |
|----------|------|-------------|----------|
| [`tag`](/docs/kcl-std/types/std-types-tag) | [`tag`](/docs/kcl-std/types/std-types-tag) | The line segment being queried by its tag. | Yes |
| `tag` | [`TaggedEdge`](/docs/kcl-std/types/std-types-TaggedEdge) | The line segment being queried by its tag. | Yes |
### Returns

View File

@ -8,7 +8,7 @@ layout: manual
Compute the ending point of the provided line segment along the 'x' axis.
```kcl
segEndX(@tag: tag): number(Length)
segEndX(@tag: TaggedEdge): number(Length)
```
@ -17,7 +17,7 @@ segEndX(@tag: tag): number(Length)
| Name | Type | Description | Required |
|----------|------|-------------|----------|
| [`tag`](/docs/kcl-std/types/std-types-tag) | [`tag`](/docs/kcl-std/types/std-types-tag) | The line segment being queried by its tag. | Yes |
| `tag` | [`TaggedEdge`](/docs/kcl-std/types/std-types-TaggedEdge) | The line segment being queried by its tag. | Yes |
### Returns

View File

@ -8,7 +8,7 @@ layout: manual
Compute the ending point of the provided line segment along the 'y' axis.
```kcl
segEndY(@tag: tag): number(Length)
segEndY(@tag: TaggedEdge): number(Length)
```
@ -17,7 +17,7 @@ segEndY(@tag: tag): number(Length)
| Name | Type | Description | Required |
|----------|------|-------------|----------|
| [`tag`](/docs/kcl-std/types/std-types-tag) | [`tag`](/docs/kcl-std/types/std-types-tag) | The line segment being queried by its tag. | Yes |
| `tag` | [`TaggedEdge`](/docs/kcl-std/types/std-types-TaggedEdge) | The line segment being queried by its tag. | Yes |
### Returns

View File

@ -8,7 +8,7 @@ layout: manual
Compute the length of the provided line segment.
```kcl
segLen(@tag: tag): number(Length)
segLen(@tag: TaggedEdge): number(Length)
```
@ -17,7 +17,7 @@ segLen(@tag: tag): number(Length)
| Name | Type | Description | Required |
|----------|------|-------------|----------|
| [`tag`](/docs/kcl-std/types/std-types-tag) | [`tag`](/docs/kcl-std/types/std-types-tag) | The line segment being queried by its tag. | Yes |
| `tag` | [`TaggedEdge`](/docs/kcl-std/types/std-types-TaggedEdge) | The line segment being queried by its tag. | Yes |
### Returns

View File

@ -8,7 +8,7 @@ layout: manual
Compute the starting point of the provided line segment.
```kcl
segStart(@tag: tag): Point2d
segStart(@tag: TaggedEdge): Point2d
```
@ -17,7 +17,7 @@ segStart(@tag: tag): Point2d
| Name | Type | Description | Required |
|----------|------|-------------|----------|
| [`tag`](/docs/kcl-std/types/std-types-tag) | [`tag`](/docs/kcl-std/types/std-types-tag) | The line segment being queried by its tag. | Yes |
| `tag` | [`TaggedEdge`](/docs/kcl-std/types/std-types-TaggedEdge) | The line segment being queried by its tag. | Yes |
### Returns

View File

@ -8,7 +8,7 @@ layout: manual
Compute the starting point of the provided line segment along the 'x' axis.
```kcl
segStartX(@tag: tag): number(Length)
segStartX(@tag: TaggedEdge): number(Length)
```
@ -17,7 +17,7 @@ segStartX(@tag: tag): number(Length)
| Name | Type | Description | Required |
|----------|------|-------------|----------|
| [`tag`](/docs/kcl-std/types/std-types-tag) | [`tag`](/docs/kcl-std/types/std-types-tag) | The line segment being queried by its tag. | Yes |
| `tag` | [`TaggedEdge`](/docs/kcl-std/types/std-types-TaggedEdge) | The line segment being queried by its tag. | Yes |
### Returns

View File

@ -8,7 +8,7 @@ layout: manual
Compute the starting point of the provided line segment along the 'y' axis.
```kcl
segStartY(@tag: tag): number(Length)
segStartY(@tag: TaggedEdge): number(Length)
```
@ -17,7 +17,7 @@ segStartY(@tag: tag): number(Length)
| Name | Type | Description | Required |
|----------|------|-------------|----------|
| [`tag`](/docs/kcl-std/types/std-types-tag) | [`tag`](/docs/kcl-std/types/std-types-tag) | The line segment being queried by its tag. | Yes |
| `tag` | [`TaggedEdge`](/docs/kcl-std/types/std-types-TaggedEdge) | The line segment being queried by its tag. | Yes |
### Returns

View File

@ -11,7 +11,7 @@ Start a new profile at a given point.
startProfile(
@startProfileOn: Plane | Face,
at: Point2d,
tag?: tag,
tag?: TagDecl,
): Sketch
```
@ -23,7 +23,7 @@ startProfile(
|----------|------|-------------|----------|
| `startProfileOn` | [`Plane`](/docs/kcl-std/types/std-types-Plane) or [`Face`](/docs/kcl-std/types/std-types-Face) | What to start the profile on. | Yes |
| `at` | [`Point2d`](/docs/kcl-std/types/std-types-Point2d) | Where to start the profile. An absolute point. | Yes |
| [`tag`](/docs/kcl-std/types/std-types-tag) | [`tag`](/docs/kcl-std/types/std-types-tag) | Tag this first starting point. | No |
| `tag` | [`TagDecl`](/docs/kcl-std/types/std-types-TagDecl) | Tag this first starting point. | No |
### Returns

View File

@ -10,7 +10,7 @@ Start a new 2-dimensional sketch on a specific plane or face.
```kcl
startSketchOn(
@planeOrSolid: Solid | Plane,
face?: tag,
face?: TaggedFace,
): Plane | Face
```
@ -36,7 +36,7 @@ face, since it will include all the parent faces and Solids.
| Name | Type | Description | Required |
|----------|------|-------------|----------|
| `planeOrSolid` | [`Solid`](/docs/kcl-std/types/std-types-Solid) or [`Plane`](/docs/kcl-std/types/std-types-Plane) | Profile whose start is being used. | Yes |
| `face` | [`tag`](/docs/kcl-std/types/std-types-tag) | Identify a face of a solid if a solid is specified as the input argument (`planeOrSolid`). | No |
| `face` | [`TaggedFace`](/docs/kcl-std/types/std-types-TaggedFace) | Identify a face of a solid if a solid is specified as the input argument (`planeOrSolid`). | No |
### Returns

File diff suppressed because one or more lines are too long

View File

@ -8,7 +8,7 @@ layout: manual
Returns the angle coming out of the end of the segment in degrees.
```kcl
tangentToEnd(@tag: tag): number(Angle)
tangentToEnd(@tag: TaggedEdge): number(Angle)
```
@ -17,7 +17,7 @@ tangentToEnd(@tag: tag): number(Angle)
| Name | Type | Description | Required |
|----------|------|-------------|----------|
| [`tag`](/docs/kcl-std/types/std-types-tag) | [`tag`](/docs/kcl-std/types/std-types-tag) | The line segment being queried by its tag. | Yes |
| `tag` | [`TaggedEdge`](/docs/kcl-std/types/std-types-TaggedEdge) | The line segment being queried by its tag. | Yes |
### Returns

View File

@ -15,7 +15,7 @@ tangentialArc(
radius?: number(Length),
diameter?: number(Length),
angle?: number(Angle),
tag?: tag,
tag?: TagDecl,
): Sketch
```
@ -35,7 +35,7 @@ for 'angle' degrees along the imaginary circle.
| `radius` | [`number(Length)`](/docs/kcl-std/types/std-types-number) | Radius of the imaginary circle. `angle` must be given. Incompatible with `end` and `endAbsolute` and `diameter`. | No |
| `diameter` | [`number(Length)`](/docs/kcl-std/types/std-types-number) | Diameter of the imaginary circle. `angle` must be given. Incompatible with `end` and `endAbsolute` and `radius`. | No |
| `angle` | [`number(Angle)`](/docs/kcl-std/types/std-types-number) | Offset of the arc. `radius` must be given. Incompatible with `end` and `endAbsolute`. | No |
| [`tag`](/docs/kcl-std/types/std-types-tag) | [`tag`](/docs/kcl-std/types/std-types-tag) | Create a new tag which refers to this arc. | No |
| `tag` | [`TagDecl`](/docs/kcl-std/types/std-types-TagDecl) | Create a new tag which refers to this arc. | No |
### Returns

View File

@ -12,7 +12,7 @@ xLine(
@sketch: Sketch,
length?: number(Length),
endAbsolute?: number(Length),
tag?: tag,
tag?: TagDecl,
): Sketch
```
@ -25,7 +25,7 @@ xLine(
| `sketch` | [`Sketch`](/docs/kcl-std/types/std-types-Sketch) | Which sketch should this path be added to? | Yes |
| `length` | [`number(Length)`](/docs/kcl-std/types/std-types-number) | How far away along the X axis should this line go? Incompatible with `endAbsolute`. | No |
| `endAbsolute` | [`number(Length)`](/docs/kcl-std/types/std-types-number) | Which absolute X value should this line go to? Incompatible with `length`. | No |
| [`tag`](/docs/kcl-std/types/std-types-tag) | [`tag`](/docs/kcl-std/types/std-types-tag) | Create a new tag which refers to this line. | No |
| `tag` | [`TagDecl`](/docs/kcl-std/types/std-types-TagDecl) | Create a new tag which refers to this line. | No |
### Returns

View File

@ -12,7 +12,7 @@ yLine(
@sketch: Sketch,
length?: number(Length),
endAbsolute?: number(Length),
tag?: tag,
tag?: TagDecl,
): Sketch
```
@ -25,7 +25,7 @@ yLine(
| `sketch` | [`Sketch`](/docs/kcl-std/types/std-types-Sketch) | Which sketch should this path be added to? | Yes |
| `length` | [`number(Length)`](/docs/kcl-std/types/std-types-number) | How far away along the Y axis should this line go? Incompatible with `endAbsolute`. | No |
| `endAbsolute` | [`number(Length)`](/docs/kcl-std/types/std-types-number) | Which absolute Y value should this line go to? Incompatible with `length`. | No |
| [`tag`](/docs/kcl-std/types/std-types-tag) | [`tag`](/docs/kcl-std/types/std-types-tag) | Create a new tag which refers to this line. | No |
| `tag` | [`TagDecl`](/docs/kcl-std/types/std-types-TagDecl) | Create a new tag which refers to this line. | No |
### Returns

File diff suppressed because one or more lines are too long

View File

@ -13,7 +13,7 @@ fillet(
radius: number(Length),
tags: [Edge; 1+],
tolerance?: number(Length),
tag?: tag,
tag?: TagDecl,
): Solid
```
@ -28,8 +28,8 @@ will smoothly blend the transition.
| `solid` | [`Solid`](/docs/kcl-std/types/std-types-Solid) | The solid whose edges should be filletted | Yes |
| `radius` | [`number(Length)`](/docs/kcl-std/types/std-types-number) | The radius of the fillet | Yes |
| `tags` | [`[Edge; 1+]`](/docs/kcl-std/types/std-types-Edge) | The paths you want to fillet | Yes |
| `tolerance` | [`number(Length)`](/docs/kcl-std/types/std-types-number) | The tolerance for this fillet | No |
| [`tag`](/docs/kcl-std/types/std-types-tag) | [`tag`](/docs/kcl-std/types/std-types-tag) | Create a new tag which refers to this fillet | No |
| `tolerance` | [`number(Length)`](/docs/kcl-std/types/std-types-number) | Defines the smallest distance below which two entities are considered coincident, intersecting, coplanar, or similar. For most use cases, it should not be changed from its default value of 10^-7 millimeters. | No |
| `tag` | [`TagDecl`](/docs/kcl-std/types/std-types-TagDecl) | Create a new tag which refers to this fillet | No |
### Returns

File diff suppressed because one or more lines are too long

View File

@ -24,7 +24,7 @@ verifying fit, and analyzing overlapping geometries in assemblies.
| Name | Type | Description | Required |
|----------|------|-------------|----------|
| `solids` | `[Solid; 2+]` | The solids to intersect. | Yes |
| `tolerance` | [`number(Length)`](/docs/kcl-std/types/std-types-number) | The tolerance to use for the intersection operation. | No |
| `tolerance` | [`number(Length)`](/docs/kcl-std/types/std-types-number) | Defines the smallest distance below which two entities are considered coincident, intersecting, coplanar, or similar. For most use cases, it should not be changed from its default value of 10^-7 millimeters. | No |
### Returns

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

@ -27,7 +27,7 @@ and complex multi-body part modeling.
|----------|------|-------------|----------|
| `solids` | [`[Solid; 1+]`](/docs/kcl-std/types/std-types-Solid) | The solids to use as the base to subtract from. | Yes |
| `tools` | [`[Solid]`](/docs/kcl-std/types/std-types-Solid) | The solids to subtract. | Yes |
| `tolerance` | [`number(Length)`](/docs/kcl-std/types/std-types-number) | The tolerance to use for the subtraction operation. | No |
| `tolerance` | [`number(Length)`](/docs/kcl-std/types/std-types-number) | Defines the smallest distance below which two entities are considered coincident, intersecting, coplanar, or similar. For most use cases, it should not be changed from its default value of 10^-7 millimeters. | No |
### Returns

View File

@ -21,7 +21,7 @@ union(
| Name | Type | Description | Required |
|----------|------|-------------|----------|
| `solids` | `[Solid; 2+]` | The solids to union. | Yes |
| `tolerance` | [`number(Length)`](/docs/kcl-std/types/std-types-number) | The tolerance to use for the union operation. | No |
| `tolerance` | [`number(Length)`](/docs/kcl-std/types/std-types-number) | Defines the smallest distance below which two entities are considered coincident, intersecting, coplanar, or similar. For most use cases, it should not be changed from its default value of 10^-7 millimeters. | No |
### Returns

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

@ -55,7 +55,6 @@ layout: manual
* [`circleThreePoint`](/docs/kcl-std/functions/std-sketch-circleThreePoint)
* [`close`](/docs/kcl-std/functions/std-sketch-close)
* [`extrude`](/docs/kcl-std/functions/std-sketch-extrude)
* [`extrudeTwist`](/docs/kcl-std/functions/std-sketch-extrudeTwist)
* [`getCommonEdge`](/docs/kcl-std/functions/std-sketch-getCommonEdge)
* [`getNextAdjacentEdge`](/docs/kcl-std/functions/std-sketch-getNextAdjacentEdge)
* [`getOppositeEdge`](/docs/kcl-std/functions/std-sketch-getOppositeEdge)
@ -68,10 +67,12 @@ layout: manual
* [`patternCircular2d`](/docs/kcl-std/functions/std-sketch-patternCircular2d)
* [`patternLinear2d`](/docs/kcl-std/functions/std-sketch-patternLinear2d)
* [`patternTransform2d`](/docs/kcl-std/functions/std-sketch-patternTransform2d)
* [`planeOf`](/docs/kcl-std/functions/std-sketch-planeOf)
* [`polygon`](/docs/kcl-std/functions/std-sketch-polygon)
* [`profileStart`](/docs/kcl-std/functions/std-sketch-profileStart)
* [`profileStartX`](/docs/kcl-std/functions/std-sketch-profileStartX)
* [`profileStartY`](/docs/kcl-std/functions/std-sketch-profileStartY)
* [`rectangle`](/docs/kcl-std/functions/std-sketch-rectangle)
* [`revolve`](/docs/kcl-std/functions/std-sketch-revolve)
* [`segAng`](/docs/kcl-std/functions/std-sketch-segAng)
* [`segEnd`](/docs/kcl-std/functions/std-sketch-segEnd)
@ -146,12 +147,12 @@ See also the [types overview](/docs/kcl-lang/types)
* [**Primitive types**](/docs/kcl-lang/types)
* [`ImportedGeometry`](/docs/kcl-std/types/std-types-ImportedGeometry)
* [`TagDecl`](/docs/kcl-std/types/std-types-TagDecl)
* [`any`](/docs/kcl-std/types/std-types-any)
* [`bool`](/docs/kcl-std/types/std-types-bool)
* [`fn`](/docs/kcl-std/types/std-types-fn)
* [`number`](/docs/kcl-std/types/std-types-number)
* [`string`](/docs/kcl-std/types/std-types-string)
* [`tag`](/docs/kcl-std/types/std-types-tag)
* [**std::types**](/docs/kcl-std/modules/std-types)
* [`Axis2d`](/docs/kcl-std/types/std-types-Axis2d)
* [`Axis3d`](/docs/kcl-std/types/std-types-Axis3d)
@ -163,3 +164,5 @@ See also the [types overview](/docs/kcl-lang/types)
* [`Point3d`](/docs/kcl-std/types/std-types-Point3d)
* [`Sketch`](/docs/kcl-std/types/std-types-Sketch)
* [`Solid`](/docs/kcl-std/types/std-types-Solid)
* [`TaggedEdge`](/docs/kcl-std/types/std-types-TaggedEdge)
* [`TaggedFace`](/docs/kcl-std/types/std-types-TaggedFace)

View File

@ -20,7 +20,6 @@ This module contains functions for creating and manipulating sketches, and makin
* [`circleThreePoint`](/docs/kcl-std/functions/std-sketch-circleThreePoint)
* [`close`](/docs/kcl-std/functions/std-sketch-close)
* [`extrude`](/docs/kcl-std/functions/std-sketch-extrude)
* [`extrudeTwist`](/docs/kcl-std/functions/std-sketch-extrudeTwist)
* [`getCommonEdge`](/docs/kcl-std/functions/std-sketch-getCommonEdge)
* [`getNextAdjacentEdge`](/docs/kcl-std/functions/std-sketch-getNextAdjacentEdge)
* [`getOppositeEdge`](/docs/kcl-std/functions/std-sketch-getOppositeEdge)
@ -33,10 +32,12 @@ This module contains functions for creating and manipulating sketches, and makin
* [`patternCircular2d`](/docs/kcl-std/functions/std-sketch-patternCircular2d)
* [`patternLinear2d`](/docs/kcl-std/functions/std-sketch-patternLinear2d)
* [`patternTransform2d`](/docs/kcl-std/functions/std-sketch-patternTransform2d)
* [`planeOf`](/docs/kcl-std/functions/std-sketch-planeOf)
* [`polygon`](/docs/kcl-std/functions/std-sketch-polygon)
* [`profileStart`](/docs/kcl-std/functions/std-sketch-profileStart)
* [`profileStartX`](/docs/kcl-std/functions/std-sketch-profileStartX)
* [`profileStartY`](/docs/kcl-std/functions/std-sketch-profileStartY)
* [`rectangle`](/docs/kcl-std/functions/std-sketch-rectangle)
* [`revolve`](/docs/kcl-std/functions/std-sketch-revolve)
* [`segAng`](/docs/kcl-std/functions/std-sketch-segAng)
* [`segEnd`](/docs/kcl-std/functions/std-sketch-segEnd)

View File

@ -24,6 +24,9 @@ Types can (optionally) be used to describe a function's arguments and returned v
* [`Point3d`](/docs/kcl-std/types/std-types-Point3d)
* [`Sketch`](/docs/kcl-std/types/std-types-Sketch)
* [`Solid`](/docs/kcl-std/types/std-types-Solid)
* [`TagDecl`](/docs/kcl-std/types/std-types-TagDecl)
* [`TaggedEdge`](/docs/kcl-std/types/std-types-TaggedEdge)
* [`TaggedFace`](/docs/kcl-std/types/std-types-TaggedFace)
* [`any`](/docs/kcl-std/types/std-types-any)
* [`bool`](/docs/kcl-std/types/std-types-bool)
* [`fn`](/docs/kcl-std/types/std-types-fn)

View File

@ -0,0 +1,102 @@
---
title: "TagDecl"
subtitle: "Type in std::types"
excerpt: "Tags are used to give a name (tag) to a specific path."
layout: manual
---
Tags are used to give a name (tag) to a specific path.
### Tag Declaration
The syntax for declaring a tag is `$myTag`. You would use it in the following
way:
```js
startSketchOn(XZ)
|> startProfile(at = origin)
|> angledLine(angle = 0, length = 191.26, tag = $rectangleSegmentA001)
|> angledLine(
angle = segAng(rectangleSegmentA001) - 90deg,
length = 196.99,
tag = $rectangleSegmentB001,
)
|> angledLine(
angle = segAng(rectangleSegmentA001),
length = -segLen(rectangleSegmentA001),
tag = $rectangleSegmentC001,
)
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close()
```
### Tag Scope
Tags are scoped globally if in the root context meaning in this example you can
use the tag `rectangleSegmentA001` in any function or expression in the file.
However if the code was written like this:
```js
fn rect(origin) {
return startSketchOn(XZ)
|> startProfile(at = origin)
|> angledLine(angle = 0, length = 191.26, tag = $rectangleSegmentA001)
|> angledLine(
angle = segAng(rectangleSegmentA001) - 90,
length = 196.99,
tag = $rectangleSegmentB001
)
|> angledLine(
angle = segAng(rectangleSegmentA001),
length = -segLen(rectangleSegmentA001),
tag = $rectangleSegmentC001
)
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close()
}
rect(origin = [0, 0])
rect(origin = [20, 0])
```
Those tags would only be available in the `rect` function and not globally.
However you likely want to use those tags somewhere outside the `rect` function.
Tags are accessible through the sketch group they are declared in.
For example the following code works.
```js
fn rect(origin) {
return startSketchOn(XZ)
|> startProfile(at = origin)
|> angledLine(angle = 0, length = 191.26, tag = $rectangleSegmentA001)
|> angledLine(
angle = segAng(rectangleSegmentA001) - 90deg,
length = 196.99,
tag = $rectangleSegmentB001,
)
|> angledLine(
angle = segAng(rectangleSegmentA001),
length = -segLen(rectangleSegmentA001),
tag = $rectangleSegmentC001,
)
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close()
}
rect(origin = [0, 0])
myRect = rect(origin = [20, 0])
myRect
|> extrude(length = 10)
|> fillet(radius = 0.5, tags = [myRect.tags.rectangleSegmentA001])
```
See how we use the tag `rectangleSegmentA001` in the `fillet` function outside
the `rect` function. This is because the `rect` function is returning the
sketch group that contains the tags.

View File

@ -0,0 +1,17 @@
---
title: "TaggedEdge"
subtitle: "Type in std::types"
excerpt: "A tag which references a line, arc, or other edge in a sketch or an edge of a solid."
layout: manual
---
A tag which references a line, arc, or other edge in a sketch or an edge of a solid.
Created by using a tag declarator (see the docs for [`TagDecl`](/docs/kcl-std/types/std-types-TagDecl)). Can be used where an [`Edge`](/docs/kcl-std/types/std-types-Edge) is
required.
If a line in a sketch is tagged and then the sketch is extruded, the tag is a [`TaggedEdge`](/docs/kcl-std/types/std-types-TaggedEdge) before
extrusion and a [`TaggedFace`](/docs/kcl-std/types/std-types-TaggedFace) after extrusion.

View File

@ -0,0 +1,16 @@
---
title: "TaggedFace"
subtitle: "Type in std::types"
excerpt: "A tag which references a face of a solid, including the distinguished tags `START` and `END`."
layout: manual
---
A tag which references a face of a solid, including the distinguished tags `START` and `END`.
Created by using a tag declarator (see the docs for [`TagDecl`](/docs/kcl-std/types/std-types-TagDecl)).
If a line in a sketch is tagged and then the sketch is extruded, the tag is a [`TaggedEdge`](/docs/kcl-std/types/std-types-TaggedEdge) before
extrusion and a [`TaggedFace`](/docs/kcl-std/types/std-types-TaggedFace) after extrusion.

View File

@ -1,109 +1,19 @@
---
title: "tag"
subtitle: "Type in std::types"
excerpt: "Tags are used to give a name (tag) to a specific path."
excerpt: "Reference a previously created tag. Used much like a variable."
layout: manual
---
Tags are used to give a name (tag) to a specific path.
**WARNING:** This type is deprecated.
### Tag Declaration
Reference a previously created tag. Used much like a variable.
The syntax for declaring a tag is `$myTag` you would use it in the following
way:
```js
startSketchOn(XZ)
|> startProfile(at = origin)
|> angledLine(angle = 0, length = 191.26, tag = $rectangleSegmentA001)
|> angledLine(
angle = segAng(rectangleSegmentA001) - 90deg,
length = 196.99,
tag = $rectangleSegmentB001,
)
|> angledLine(
angle = segAng(rectangleSegmentA001),
length = -segLen(rectangleSegmentA001),
tag = $rectangleSegmentC001,
)
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close()
```kcl
type tag = TaggedEdge
```
### Tag Identifier
As per the example above you can use the tag identifier to get a reference to the
tagged object. The syntax for this is `myTag`.
In the example above we use the tag identifier to get the angle of the segment
`segAng(rectangleSegmentA001)`.
### Tag Scope
Tags are scoped globally if in the root context meaning in this example you can
use the tag `rectangleSegmentA001` in any function or expression in the file.
However if the code was written like this:
```js
fn rect(origin) {
return startSketchOn(XZ)
|> startProfile(at = origin)
|> angledLine(angle = 0, length = 191.26, tag = $rectangleSegmentA001)
|> angledLine(
angle = segAng(rectangleSegmentA001) - 90,
length = 196.99,
tag = $rectangleSegmentB001)
|> angledLine(
angle = segAng(rectangleSegmentA001),
length = -segLen(rectangleSegmentA001),
tag = $rectangleSegmentC001
)
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close()
}
rect(origin = [0, 0])
rect(origin = [20, 0])
```
Those tags would only be available in the `rect` function and not globally.
However you likely want to use those tags somewhere outside the `rect` function.
Tags are accessible through the sketch group they are declared in.
For example the following code works.
```js
fn rect(origin) {
return startSketchOn(XZ)
|> startProfile(at = origin)
|> angledLine(angle = 0, length = 191.26, tag = $rectangleSegmentA001)
|> angledLine(
angle = segAng(rectangleSegmentA001) - 90deg,
length = 196.99
tag = $rectangleSegmentB001,
)
|> angledLine(
angle = segAng(rectangleSegmentA001),
length = -segLen(rectangleSegmentA001)
tag = $rectangleSegmentC001,
)
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close()
}
rect(origin = [0, 0])
myRect = rect(origin = [20, 0])
myRect
|> extrude(length = 10)
|> fillet(radius = 0.5, tags = [myRect.tags.rectangleSegmentA001])
```
See how we use the tag `rectangleSegmentA001` in the `fillet` function outside
the `rect` function. This is because the `rect` function is returning the
sketch group that contains the tags.
Prefer to use [`TaggedEdge`](/docs/kcl-std/types/std-types-TaggedEdge) or [`TaggedFace`](/docs/kcl-std/types/std-types-TaggedFace). For more details on tags, see the docs for [`TagDecl`](/docs/kcl-std/types/std-types-TagDecl).

View File

@ -12,7 +12,7 @@ test.describe('Point and click for boolean workflows', () => {
},
{
name: 'subtract',
code: 'subtract([extrude001], tools = [extrude006])',
code: 'subtract(extrude001, tools = extrude006)',
},
{
name: 'intersect',
@ -81,6 +81,8 @@ test.describe('Point and click for boolean workflows', () => {
if (operationName !== 'subtract') {
// should down shift key to select multiple objects
await page.keyboard.down('Shift')
} else {
await cmdBar.progressCmdBar()
}
// Select second object
@ -103,8 +105,8 @@ test.describe('Point and click for boolean workflows', () => {
await cmdBar.expectState({
stage: 'review',
headerArguments: {
Tool: '1 path',
Target: '1 path',
Solids: '1 path',
Tools: '1 path',
},
commandName,
})

View File

@ -5,6 +5,7 @@ import { uuidv4 } from '@src/lib/utils'
import type { HomePageFixture } from '@e2e/playwright/fixtures/homePageFixture'
import type { SceneFixture } from '@e2e/playwright/fixtures/sceneFixture'
import type { ToolbarFixture } from '@e2e/playwright/fixtures/toolbarFixture'
import type { CmdBarFixture } from '@e2e/playwright/fixtures/cmdBarFixture'
import { getUtils } from '@e2e/playwright/test-utils'
import { expect, test } from '@e2e/playwright/zoo-test'
@ -14,13 +15,18 @@ test.describe('Can create sketches on all planes and their back sides', () => {
homePage: HomePageFixture,
scene: SceneFixture,
toolbar: ToolbarFixture,
cmdBar: CmdBarFixture,
plane: string,
clickCoords: { x: number; y: number }
) => {
const u = await getUtils(page)
// await page.addInitScript(() => {
// localStorage.setItem('persistCode', '@settings(defaultLengthUnit = in)')
// })
await page.setBodyDimensions({ width: 1200, height: 500 })
await homePage.goToModelingScene()
// await scene.settled(cmdBar)
const XYPlanRed: [number, number, number] = [98, 50, 51]
await scene.expectPixelColor(XYPlanRed, { x: 700, y: 300 }, 15)
@ -119,12 +125,166 @@ test.describe('Can create sketches on all planes and their back sides', () => {
]
for (const config of planeConfigs) {
test(config.plane, async ({ page, homePage, scene, toolbar }) => {
test(config.plane, async ({ page, homePage, scene, toolbar, cmdBar }) => {
await sketchOnPlaneAndBackSideTest(
page,
homePage,
scene,
toolbar,
cmdBar,
config.plane,
config.coords
)
})
}
})
test.describe('Can create sketches on offset planes and their back sides', () => {
const sketchOnPlaneAndBackSideTest = async (
page: Page,
homePage: HomePageFixture,
scene: SceneFixture,
toolbar: ToolbarFixture,
cmdbar: CmdBarFixture,
plane: string,
clickCoords: { x: number; y: number }
) => {
const u = await getUtils(page)
await page.addInitScript(() => {
localStorage.setItem(
'persistCode',
`@settings(defaultLengthUnit = in)
xyPlane = offsetPlane(XY, offset = 0.05)
xzPlane = offsetPlane(XZ, offset = 0.05)
yzPlane = offsetPlane(YZ, offset = 0.05)
`
)
})
await page.setBodyDimensions({ width: 1200, height: 500 })
await homePage.goToModelingScene()
// await scene.settled(cmdbar)
const XYPlanRed: [number, number, number] = [74, 74, 74]
await scene.expectPixelColor(XYPlanRed, { x: 700, y: 300 }, 15)
await u.openDebugPanel()
const coord =
plane === '-XY' || plane === '-YZ' || plane === 'XZ' ? -100 : 100
const camCommand: EngineCommand = {
type: 'modeling_cmd_req',
cmd_id: uuidv4(),
cmd: {
type: 'default_camera_look_at',
center: { x: 0, y: 0, z: 0 },
vantage: { x: coord, y: coord, z: coord },
up: { x: 0, y: 0, z: 1 },
},
}
const updateCamCommand: EngineCommand = {
type: 'modeling_cmd_req',
cmd_id: uuidv4(),
cmd: {
type: 'default_camera_get_settings',
},
}
const prefix = plane.length === 3 ? '-' : ''
const planeName = plane
.slice(plane.length === 3 ? 1 : 0)
.toLocaleLowerCase()
const codeLine1 = `sketch001 = startSketchOn(${prefix}${planeName}Plane)`
const codeLine2 = `profile001 = startProfile(sketch001, at = [${0.91 + (plane[0] === '-' ? 0.01 : 0)}, -${1.21 + (plane[0] === '-' ? 0.01 : 0)}])`
await u.openDebugPanel()
await u.clearCommandLogs()
await page.getByRole('button', { name: 'Start Sketch' }).click()
await u.sendCustomCmd(camCommand)
await page.waitForTimeout(100)
await u.sendCustomCmd(updateCamCommand)
await u.closeDebugPanel()
await toolbar.openFeatureTreePane()
await toolbar.getDefaultPlaneVisibilityButton('XY').click()
await toolbar.getDefaultPlaneVisibilityButton('XZ').click()
await toolbar.getDefaultPlaneVisibilityButton('YZ').click()
await expect(
toolbar
.getDefaultPlaneVisibilityButton('YZ')
.locator('[aria-label="eye crossed out"]')
).toBeVisible()
await page.mouse.click(clickCoords.x, clickCoords.y)
await page.waitForTimeout(600) // wait for animation
await toolbar.waitUntilSketchingReady()
await expect(
page.getByRole('button', { name: 'line Line', exact: true })
).toBeVisible()
await u.closeDebugPanel()
await page.mouse.click(707, 393)
await expect(page.locator('.cm-content')).toContainText(codeLine1)
await expect(page.locator('.cm-content')).toContainText(codeLine2)
await page
.getByRole('button', { name: 'line Line', exact: true })
.first()
.click()
await u.openAndClearDebugPanel()
await page.getByRole('button', { name: 'Exit Sketch' }).click()
await u.expectCmdLog('[data-message-type="execution-done"]')
await u.clearCommandLogs()
await u.removeCurrentCode()
}
const planeConfigs = [
{
plane: 'XY',
coords: { x: 600, y: 388 },
description: 'red plane',
},
{
plane: 'YZ',
coords: { x: 700, y: 250 },
description: 'green plane',
},
{
plane: 'XZ',
coords: { x: 684, y: 427 },
description: 'blue plane',
},
{
plane: '-XY',
coords: { x: 600, y: 118 },
description: 'back of red plane',
},
{
plane: '-YZ',
coords: { x: 700, y: 219 },
description: 'back of green plane',
},
{
plane: '-XZ',
coords: { x: 700, y: 80 },
description: 'back of blue plane',
},
]
for (const config of planeConfigs) {
test(config.plane, async ({ page, homePage, scene, toolbar, cmdBar }) => {
await sketchOnPlaneAndBackSideTest(
page,
homePage,
scene,
toolbar,
cmdBar,
config.plane,
config.coords
)

View File

@ -265,6 +265,8 @@ middle(0)
})
await expect(
page.getByText(`assert failed: Expected 0 to be greater than 0 but it wasn't
Backtrace:
assert()
check()
middle()`)

View File

@ -4,7 +4,6 @@ import * as fsp from 'fs/promises'
import { executorInputPath, getUtils } from '@e2e/playwright/test-utils'
import { expect, test } from '@e2e/playwright/zoo-test'
import { expectPixelColor } from '@e2e/playwright/fixtures/sceneFixture'
test.describe('Command bar tests', () => {
test('Extrude from command bar selects extrude line after', async ({
@ -308,7 +307,7 @@ test.describe('Command bar tests', () => {
)
const continueButton = page.getByRole('button', { name: 'Continue' })
const submitButton = page.getByRole('button', { name: 'Submit command' })
const submitButton = page.getByTestId('command-bar-submit')
await continueButton.click()
// Review step and argument hotkeys
@ -515,47 +514,6 @@ test.describe('Command bar tests', () => {
})
})
test(
`Zoom to fit to shared model on web`,
{ tag: ['@web'] },
async ({ page, scene }) => {
if (process.env.TARGET !== 'web') {
// This test is web-only
// TODO: re-enable on CI as part of a new @web test suite
return
}
await test.step(`Prepare and navigate to home page with query params`, async () => {
// a quad in the top left corner of the XZ plane (which is out of the current view)
const code = `sketch001 = startSketchOn(XZ)
profile001 = startProfile(sketch001, at = [-484.34, 484.95])
|> yLine(length = -69.1)
|> xLine(length = 66.84)
|> yLine(length = 71.37)
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close()
`
const targetURL = `?create-file=true&name=test&units=mm&code=${encodeURIComponent(btoa(code))}&ask-open-desktop=true`
await page.goto(page.url() + targetURL)
expect(page.url()).toContain(targetURL)
})
await test.step(`Submit the command`, async () => {
await page.getByTestId('continue-to-web-app-button').click()
await scene.connectionEstablished()
// This makes SystemIOMachineActors.createKCLFile run after EngineStream/firstPlay
await page.waitForTimeout(3000)
await page.getByTestId('command-bar-submit').click()
})
await test.step(`Ensure we created the project and are in the modeling scene`, async () => {
await expectPixelColor(page, [252, 252, 252], { x: 600, y: 260 }, 8)
})
}
)
test(`Can add and edit a named parameter or constant`, async ({
page,
homePage,
@ -567,7 +525,9 @@ profile001 = startProfile(sketch001, at = [-484.34, 484.95])
const projectName = 'test'
const beforeKclCode = `a = 5
b = a * a
c = 3 + a`
c = 3 + a
theta = 45deg
`
await context.folderSetupFn(async (dir) => {
const testProject = join(dir, projectName)
await fsp.mkdir(testProject, { recursive: true })
@ -657,9 +617,45 @@ c = 3 + a`
stage: 'commandBarClosed',
})
})
await test.step(`Edit a parameter with explicit units via command bar`, async () => {
await cmdBar.cmdBarOpenBtn.click()
await cmdBar.chooseCommand('edit parameter')
await cmdBar
.selectOption({
name: 'theta',
})
.click()
await cmdBar.expectState({
stage: 'arguments',
commandName: 'Edit parameter',
currentArgKey: 'value',
currentArgValue: '45deg',
headerArguments: {
Name: 'theta',
Value: '',
},
highlightedHeaderArg: 'value',
})
await cmdBar.argumentInput
.locator('[contenteditable]')
.fill('45deg + 1deg')
await cmdBar.progressCmdBar()
await cmdBar.expectState({
stage: 'review',
commandName: 'Edit parameter',
headerArguments: {
Name: 'theta',
Value: '46deg',
},
})
await cmdBar.progressCmdBar()
await cmdBar.expectState({
stage: 'commandBarClosed',
})
})
await editor.expectEditor.toContain(
`a = 5b = a * amyParameter001 = ${newValue}c = 3 + a`
`a = 5b = a * amyParameter001 = ${newValue}c = 3 + atheta = 45deg + 1deg`
)
})

View File

@ -54,9 +54,7 @@ test(
await page.keyboard.press('Enter')
// Click the checkbox
const submitButton = page.getByText('Confirm Export')
await expect(submitButton).toBeVisible()
await page.keyboard.press('Enter')
await cmdBar.submit()
// Expect it to succeed
const errorToastMessage = page.getByText(`Error while exporting`)
@ -119,9 +117,7 @@ test(
await page.keyboard.press('Enter')
// Click the checkbox
const submitButton = page.getByText('Confirm Export')
await expect(submitButton).toBeVisible()
await page.keyboard.press('Enter')
await cmdBar.submit()
// Look out for the toast message
const exportingToastMessage = page.getByText(`Exporting...`)

View File

@ -288,7 +288,7 @@ a1 = startSketchOn(offsetPlane(XY, offset = 10))
// error text on hover
await page.hover('.cm-lint-marker-info')
await expect(
page.getByText('Identifiers must be lowerCamelCase').first()
page.getByText('Identifiers should be lowerCamelCase').first()
).toBeVisible()
await page.locator('#code-pane button:first-child').click()
@ -314,7 +314,7 @@ sketch_001 = startSketchOn(XY)
// error text on hover
await page.hover('.cm-lint-marker-info')
await expect(
page.getByText('Identifiers must be lowerCamelCase').first()
page.getByText('Identifiers should be lowerCamelCase').first()
).toBeVisible()
})
@ -511,7 +511,7 @@ sketch_001 = startSketchOn(XY)
// error text on hover
await page.hover('.cm-lint-marker-info')
await expect(
page.getByText('Identifiers must be lowerCamelCase').first()
page.getByText('Identifiers should be lowerCamelCase').first()
).toBeVisible()
// focus the editor
@ -539,7 +539,7 @@ sketch_001 = startSketchOn(XY)
// error text on hover
await page.hover('.cm-lint-marker-info')
await expect(
page.getByText('Identifiers must be lowerCamelCase').first()
page.getByText('Identifiers should be lowerCamelCase').first()
).toBeVisible()
})
@ -681,7 +681,7 @@ a1 = startSketchOn(offsetPlane(XY, offset = 10))
// error text on hover
await page.hover('.cm-lint-marker-info')
await expect(
page.getByText('Identifiers must be lowerCamelCase').first()
page.getByText('Identifiers should be lowerCamelCase').first()
).toBeVisible()
// select the line that's causing the error and delete it
@ -1617,4 +1617,33 @@ sketch001 = startSketchOn(XZ)
// Verify error is still visible
await expect(page.locator('.cm-lint-marker-error')).toHaveCount(1)
})
test('Core dump hotkey', async ({ page, scene, cmdBar, homePage }) => {
await page.addInitScript(async () => {
localStorage.setItem(
'persistCode',
`sketch001 = startSketchOn(XZ)
profile001 = circle(sketch001, center = [-100.0, -100.0], radius = 50.0)
`
)
})
const viewportSize = { width: 1200, height: 800 }
await page.setBodyDimensions(viewportSize)
await homePage.goToModelingScene()
await scene.connectionEstablished()
await scene.settled(cmdBar)
const modifier = process.platform === 'darwin' ? 'Meta' : 'Control'
await page.keyboard.press(`${modifier}+Shift+.`)
const toast1 = page.getByText('Starting core dump...')
await expect(toast1).toBeVisible()
const toast2 = page.getByText('Core dump completed')
await expect(toast2).toBeVisible()
})
})

View File

@ -229,11 +229,12 @@ test.describe('Feature Tree pane', () => {
const initialCode = `sketch001 = startSketchOn(XZ)
|> circle(center = [0, 0], radius = 5)
renamedExtrude = extrude(sketch001, length = ${initialInput})`
const newConstantName = 'length001'
const expectedCode = `${newConstantName} = 23
const newParameterName = 'length001'
const expectedCode = `${newParameterName} = 23
sketch001 = startSketchOn(XZ)
|> circle(center = [0, 0], radius = 5)
renamedExtrude = extrude(sketch001, length = ${newConstantName})`
renamedExtrude = extrude(sketch001, length = ${newParameterName})`
const editedParameterValue = '23 * 2'
await context.folderSetupFn(async (dir) => {
const testDir = join(dir, 'test-sample')
@ -279,7 +280,7 @@ test.describe('Feature Tree pane', () => {
})
})
await test.step('Add a named constant for distance argument and submit', async () => {
await test.step('Add a parameter for distance argument and submit', async () => {
await expect(cmdBar.currentArgumentInput).toBeVisible()
await cmdBar.variableCheckbox.click()
await cmdBar.progressCmdBar()
@ -296,13 +297,43 @@ test.describe('Feature Tree pane', () => {
highlightedCode: '',
diagnostics: [],
activeLines: [
`renamedExtrude = extrude(sketch001, length = ${newConstantName})`,
`renamedExtrude = extrude(sketch001, length = ${newParameterName})`,
],
})
await editor.expectEditor.toContain(expectedCode, {
shouldNormalise: true,
})
})
await test.step('Edit the parameter via the feature tree', async () => {
const parameter = await toolbar.getFeatureTreeOperation('Parameter', 0)
await parameter.dblclick()
await cmdBar.expectState({
commandName: 'Edit parameter',
currentArgKey: 'value',
currentArgValue: '23',
headerArguments: {
Name: newParameterName,
Value: '23',
},
stage: 'arguments',
highlightedHeaderArg: 'value',
})
await cmdBar.argumentInput
.locator('[contenteditable]')
.fill(editedParameterValue)
await cmdBar.progressCmdBar()
await cmdBar.expectState({
stage: 'review',
commandName: 'Edit parameter',
headerArguments: {
Name: newParameterName,
Value: '46', // Shows calculated result
},
})
await cmdBar.progressCmdBar()
await editor.expectEditor.toContain(editedParameterValue)
})
})
test(`User can edit an offset plane operation from the feature tree`, async ({
context,

View File

@ -118,15 +118,11 @@ export class CmdBarFixture {
return
}
const arrowButton = this.page.getByRole('button', {
name: 'arrow right Continue',
})
const arrowButton = this.page.getByTestId('command-bar-continue')
if (await arrowButton.isVisible()) {
await arrowButton.click()
await this.continue()
} else {
await this.page
.getByRole('button', { name: 'checkmark Submit command' })
.click()
await this.submit()
}
}
@ -191,6 +187,13 @@ export class CmdBarFixture {
return this.page.getByRole('option', options)
}
/**
* Select an optional argument from the command bar during review
*/
clickOptionalArgument = async (argName: string) => {
await this.page.getByTestId(`cmd-bar-add-optional-arg-${argName}`).click()
}
/**
* Clicks the Create new variable button for kcl input
*/

View File

@ -183,14 +183,15 @@ export class EditorFixture {
scrollToText(text: string, placeCursor?: boolean) {
return this.page.evaluate(
(args: { text: string; placeCursor?: boolean }) => {
const editorView = window.editorManager.getEditorView()
// error TS2339: Property 'docView' does not exist on type 'EditorView'.
// Except it does so :shrug:
// @ts-ignore
let index = window.editorManager._editorView?.docView.view.state.doc
const index = editorView?.docView.view.state.doc
.toString()
.indexOf(args.text)
window.editorManager._editorView?.focus()
window.editorManager._editorView?.dispatch({
editorView?.focus()
editorView?.dispatch({
selection: window.EditorSelection.create([
window.EditorSelection.cursor(index),
]),

View File

@ -274,6 +274,13 @@ export class ToolbarFixture {
.nth(operationIndex)
}
getDefaultPlaneVisibilityButton(plane: 'XY' | 'XZ' | 'YZ' = 'XY') {
const index = plane === 'XZ' ? 0 : plane === 'XY' ? 1 : 2
return this.featureTreePane
.getByTestId('feature-tree-visibility-toggle')
.nth(index)
}
/**
* View source on a specific operation in the Feature Tree pane.
* @param operationName The name of the operation type

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