Compare commits

...

25 Commits

Author SHA1 Message Date
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
2b0ced179a Add files via upload (#7429)
* Add files via upload

* Update snapshots

* Update snapshots

* Update snapshots

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Jace Browning <jacebrowning@gmail.com>
2025-06-14 02:27:27 +00:00
c2f6ce065d KCL: New extrudeTwist endpoint (#7480)
This does not include feature tree editing support.
2025-06-13 21:17:01 +00:00
b3bdc35da2 Prevent query params from getting eaten by redirect (#7479)
* Fix URL generated

* Prevent query params from getting eaten by redirect
2025-06-13 16:42:59 -04:00
8fe4f67a29 Fix URL generated (#7478) 2025-06-13 15:31:51 -04:00
c6b1d11700 Fix to not panic when using the wrong argument type (#7474) 2025-06-13 14:02:14 -04:00
2ef84382a6 Show a countdown on reconnect (#7470)
* Show a countdown on reconnect

* Reduce visual jank
2025-06-13 15:05:13 +00:00
939c2c77b0 the settings docs have a stutter with 2 h1s this fixes it (#7472)
* the settings docs have a stutter with 2 h1s this fixes it

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

* regenerate

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

---------

Signed-off-by: Jessie Frazelle <github@jessfraz.com>
2025-06-13 16:33:28 +10:00
31ec0184a1 Switch to plain Markdown template for releases (#7471) 2025-06-12 22:36:04 +00:00
62c4546658 Create an issue template for releases (#7467)
* Create an issue template for releases

* Remove invalid syntax

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-12 19:28:26 +00:00
383b38c2d2 Add operations for variable declarations (#7451)
* Add operations for variable declarations

* Update output

* Change to use OpKclValue

* Update output after merge
2025-06-12 16:38:12 +00:00
794 changed files with 212085 additions and 93693 deletions

3
.github/CODEOWNERS vendored Normal file
View File

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

38
.github/ISSUE_TEMPLATE/release.md vendored Normal file
View File

@ -0,0 +1,38 @@
---
name: Release
about: Create a new release for the Zoo Design Studio
title: "Cut release v1.?.?"
labels: [release]
---
> Instructions: https://github.com/KittyCAD/modeling-app/blob/main/CONTRIBUTING.md#shipping-releases
---
# Manual Checklist
Release builds URL: ???
## Windows via ???
* [ ] Download the release build for this platform
* [ ] 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
## macOS via ???
* [ ] Download the release build for this platform
* [ ] 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
## Linux via ???
* [ ] Download the release build for this platform
* [ ] 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

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

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

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

View File

@ -251,7 +251,8 @@ Before you submit a contribution PR to this repo, please ensure that:
#### 1. Create a 'Cut release $VERSION' issue
It will be used to document changelog discussions and release testing.
Use the **Release** issue template.
This will be used to facilitate changelog discussions and release testing.
https://github.com/KittyCAD/modeling-app/issues/new
@ -270,27 +271,9 @@ The workflow should be listed right away [in this list](https://github.com/Kitty
#### 3. Manually test artifacts
##### Release builds
The release builds can be found under the `out-{arch}-{platform}` zip files, at the very bottom of the `build-apps` summary page for the workflow (triggered by the tag in step 2).
Manually test against [this list](https://github.com/KittyCAD/modeling-app/issues/3588) across Windows, MacOS, Linux and posting results as comments in the issue.
A prompt should show up asking for a downgrade to the last release version. Running through that at the end of testing
and making sure the current release candidate has the ability to be updated to what electron-updater points to is critical,
but what is actually being downloaded and installed isn't.
If the prompt doesn't show up, start the app in command line to grab the electron-updater logs. This is likely an issue with the current build that needs addressing.
```
# Windows (PowerShell)
& 'C:\Program Files\Zoo Design Studio\Zoo Design Studio.exe'
# macOS
/Applications/Zoo\ Modeling\ App.app/Contents/MacOS/Zoo\ Modeling\ App
# Linux
./Zoo Design Studio-{version}-{arch}-linux.AppImage
```
Assign someone to each section of the manual checklist generated by the issue template.
#### 4. Bump the KCL version

View File

@ -4,8 +4,6 @@ excerpt: "Project specific settings for the app. These live in `project.toml` in
layout: manual
---
# Project Settings
Project specific settings for the app. These live in `project.toml` in the base of the project directory. Updating the settings for the project in the app will update this file automatically. Do not edit this file manually, as it may be overwritten by the app. Manual edits can cause corruption of the settings file.
## Project Configuration Structure
@ -184,4 +182,4 @@ color = 240.0
# Use inches as the default measurement unit
base_unit = "in"
```
```

View File

@ -4,8 +4,6 @@ excerpt: "User specific settings for the app. These live in `user.toml` in the a
layout: manual
---
# User Settings
User specific settings for the app. These live in `user.toml` in the app's configuration directory. Updating the settings in the app will update this file automatically. Do not edit this file manually, as it may be overwritten by the app. Manual edits can cause corruption of the settings file.
## User Configuration Structure
@ -234,4 +232,4 @@ base_unit = "mm"
# Disable text wrapping in the editor
text_wrapping = false
```
```

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.

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

View File

@ -16,7 +16,7 @@ bezierCurve(
control1Absolute?: Point2d,
control2Absolute?: Point2d,
endAbsolute?: Point2d,
tag?: tag,
tag?: TagDecl,
): Sketch
```
@ -33,7 +33,7 @@ bezierCurve(
| `control1Absolute` | [`Point2d`](/docs/kcl-std/types/std-types-Point2d) | First control point for the cubic. Absolute point. | No |
| `control2Absolute` | [`Point2d`](/docs/kcl-std/types/std-types-Point2d) | Second control point for the cubic. Absolute point. | No |
| `endAbsolute` | [`Point2d`](/docs/kcl-std/types/std-types-Point2d) | Coordinate on the plane at which this line should end. | 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

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

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

@ -14,7 +14,7 @@ involuteCircular(
endRadius: number(Length),
angle: number(Angle),
reverse?: bool,
tag?: tag,
tag?: TagDecl,
): Sketch
```
@ -29,7 +29,7 @@ involuteCircular(
| `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 |
| `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

View File

@ -14,8 +14,8 @@ loft(
bezApproximateRational?: bool,
baseCurveIndex?: number(_),
tolerance?: number(Length),
tagStart?: tag,
tagEnd?: tag,
tagStart?: TagDecl,
tagEnd?: TagDecl,
): Solid
```
@ -30,8 +30,8 @@ The sketches need to be closed and on different planes that are parallel.
| `bezApproximateRational` | [`bool`](/docs/kcl-std/types/std-types-bool) | Attempt to approximate rational curves (such as arcs) using a bezier. This will remove banding around interpolations between arcs and non-arcs. It may produce errors in other scenarios. Over time, this field won't be necessary. | No |
| `baseCurveIndex` | [`number(_)`](/docs/kcl-std/types/std-types-number) | This can be set to override the automatically determined topological base curve, which is usually the first section encountered. | No |
| `tolerance` | [`number(Length)`](/docs/kcl-std/types/std-types-number) | Tolerance for the loft operation. | No |
| `tagStart` | [`tag`](/docs/kcl-std/types/std-types-tag) | A named tag for the face at the start of the loft, 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 loft. | No |
| `tagStart` | [`TagDecl`](/docs/kcl-std/types/std-types-TagDecl) | A named tag for the face at the start of the loft, 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 loft. | No |
### Returns

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+]
```
@ -41,8 +41,8 @@ revolved around the same axis.
| `tolerance` | [`number(Length)`](/docs/kcl-std/types/std-types-number) | Tolerance for the revolve operation. | 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

View File

@ -14,8 +14,8 @@ sweep(
sectional?: bool,
tolerance?: number(Length),
relativeTo?: string,
tagStart?: tag,
tagEnd?: tag,
tagStart?: TagDecl,
tagEnd?: TagDecl,
): [Solid; 1+]
```
@ -37,8 +37,8 @@ swept along the same path.
| `sectional` | [`bool`](/docs/kcl-std/types/std-types-bool) | If true, the sweep will be broken up into sub-sweeps (extrusions, revolves, sweeps) based on the trajectory path components. | No |
| `tolerance` | [`number(Length)`](/docs/kcl-std/types/std-types-number) | Tolerance for this operation. | No |
| `relativeTo` | [`string`](/docs/kcl-std/types/std-types-string) | What is the sweep relative to? Can be either 'sketchPlane' or 'trajectoryCurve'. | No |
| `tagStart` | [`tag`](/docs/kcl-std/types/std-types-tag) | A named tag for the face at the start of the sweep, 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 sweep. | No |
| `tagStart` | [`TagDecl`](/docs/kcl-std/types/std-types-TagDecl) | A named tag for the face at the start of the sweep, 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 sweep. | No |
### Returns

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

View File

@ -12,7 +12,7 @@ chamfer(
@solid: Solid,
length: number(Length),
tags: [Edge; 1+],
tag?: tag,
tag?: TagDecl,
): Solid
```
@ -27,7 +27,7 @@ a sharp, straight transitional edge.
| `solid` | [`Solid`](/docs/kcl-std/types/std-types-Solid) | The solid whose edges should be chamfered | Yes |
| `length` | [`number(Length)`](/docs/kcl-std/types/std-types-number) | The length of the chamfer | Yes |
| `tags` | [`[Edge; 1+]`](/docs/kcl-std/types/std-types-Edge) | The paths you want to chamfer | 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 chamfer | No |
| `tag` | [`TagDecl`](/docs/kcl-std/types/std-types-TagDecl) | Create a new tag which refers to this chamfer | No |
### Returns

View File

@ -13,7 +13,7 @@ fillet(
radius: number(Length),
tags: [Edge; 1+],
tolerance?: number(Length),
tag?: tag,
tag?: TagDecl,
): Solid
```
@ -29,7 +29,7 @@ will smoothly blend the transition.
| `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 |
| `tag` | [`TagDecl`](/docs/kcl-std/types/std-types-TagDecl) | Create a new tag which refers to this fillet | No |
### Returns

View File

@ -11,7 +11,7 @@ Remove volume from a 3-dimensional shape such that a wall of the provided thickn
shell(
@solids: [Solid; 1+],
thickness: number(Length),
faces: [tag; 1+],
faces: [TaggedFace; 1+],
): [Solid]
```
@ -23,7 +23,7 @@ shell(
|----------|------|-------------|----------|
| `solids` | [`[Solid; 1+]`](/docs/kcl-std/types/std-types-Solid) | Which solid (or solids) to shell out | Yes |
| `thickness` | [`number(Length)`](/docs/kcl-std/types/std-types-number) | The thickness of the shell | Yes |
| `faces` | [`[tag; 1+]`](/docs/kcl-std/types/std-types-tag) | The faces you want removed | Yes |
| `faces` | [`[TaggedFace; 1+]`](/docs/kcl-std/types/std-types-TaggedFace) | The faces you want removed | Yes |
### Returns

View File

@ -145,12 +145,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)
@ -162,3 +162,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

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

@ -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 ({
@ -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,

View File

@ -170,7 +170,7 @@ test(
// error text on hover
await page.hover('.cm-lint-marker-error')
const crypticErrorText =
'tag requires a value with type `tag`, but found a value with type `string`.'
'tag requires a value with type `TagDecl`, but found a value with type `string`.'
await expect(page.getByText(crypticErrorText).first()).toBeVisible()
// black pixel means the scene has been cleared.
@ -369,7 +369,7 @@ test(
// error text on hover
await page.hover('.cm-lint-marker-error')
const crypticErrorText =
'tag requires a value with type `tag`, but found a value with type `string`.'
'tag requires a value with type `TagDecl`, but found a value with type `string`.'
await expect(page.getByText(crypticErrorText).first()).toBeVisible()
// black pixel means the scene has been cleared.
@ -408,7 +408,7 @@ test(
// error text on hover
await page.hover('.cm-lint-marker-error')
const crypticErrorText =
'tag requires a value with type `tag`, but found a value with type `string`.'
'tag requires a value with type `TagDecl`, but found a value with type `string`.'
await expect(page.getByText(crypticErrorText).first()).toBeVisible()
}
)

View File

@ -575,7 +575,7 @@ extrude002 = extrude(profile002, length = 150)
name: 'Projects',
})
const projectLink = page.getByRole('link', { name: 'bracket' })
const networkHealthIndicator = page.getByTestId('network-toggle')
const networkHealthIndicator = page.getByTestId(/network-toggle/)
await test.step('Check the home page', async () => {
await expect(projectsHeading).toBeVisible()

View File

@ -1445,6 +1445,48 @@ solid001 = subtract([extrude001], tools = [extrude002])
await u.closeDebugPanel()
})
test('Can edit a tangentialArc defined by angle and radius', async ({
page,
homePage,
editor,
toolbar,
scene,
cmdBar,
}) => {
const viewportSize = { width: 1500, height: 750 }
await page.setBodyDimensions(viewportSize)
await page.addInitScript(async () => {
localStorage.setItem(
'persistCode',
`@settings(defaultLengthUnit=in)
sketch001 = startSketchOn(XZ)
|> startProfile(at = [-10, -10])
|> line(end = [20.0, 10.0])
|> tangentialArc(angle = 60deg, radius=10.0)`
)
})
await homePage.goToModelingScene()
await toolbar.waitForFeatureTreeToBeBuilt()
await scene.settled(cmdBar)
await (await toolbar.getFeatureTreeOperation('Sketch', 0)).dblclick()
await page.waitForTimeout(1000)
await page.mouse.move(1200, 139)
await page.mouse.down()
await page.mouse.move(870, 250)
await page.waitForTimeout(200)
await editor.expectEditor.toContain(
`tangentialArc(angle = 234.01deg, radius = 4.08)`,
{ shouldNormalise: true }
)
})
test('Can delete a single segment line with keyboard', async ({
page,
scene,

View File

@ -798,7 +798,7 @@ test('theme persists', async ({ page, context, homePage }) => {
await page.getByTestId('settings-close-button').click()
const networkToggle = page.getByTestId('network-toggle')
const networkToggle = page.getByTestId(/network-toggle/)
// simulate network down
await u.emulateNetworkConditions({

Binary file not shown.

Before

Width:  |  Height:  |  Size: 56 KiB

After

Width:  |  Height:  |  Size: 55 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 49 KiB

After

Width:  |  Height:  |  Size: 50 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 56 KiB

After

Width:  |  Height:  |  Size: 57 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 49 KiB

After

Width:  |  Height:  |  Size: 50 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 50 KiB

After

Width:  |  Height:  |  Size: 48 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 48 KiB

After

Width:  |  Height:  |  Size: 47 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 44 KiB

After

Width:  |  Height:  |  Size: 43 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 48 KiB

After

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 52 KiB

After

Width:  |  Height:  |  Size: 51 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 58 KiB

After

Width:  |  Height:  |  Size: 57 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 31 KiB

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 51 KiB

After

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 49 KiB

After

Width:  |  Height:  |  Size: 50 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 75 KiB

After

Width:  |  Height:  |  Size: 74 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 47 KiB

After

Width:  |  Height:  |  Size: 47 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 59 KiB

After

Width:  |  Height:  |  Size: 60 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 133 KiB

After

Width:  |  Height:  |  Size: 134 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 117 KiB

After

Width:  |  Height:  |  Size: 117 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 133 KiB

After

Width:  |  Height:  |  Size: 134 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 66 KiB

After

Width:  |  Height:  |  Size: 67 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 69 KiB

After

Width:  |  Height:  |  Size: 70 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 65 KiB

After

Width:  |  Height:  |  Size: 66 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 68 KiB

After

Width:  |  Height:  |  Size: 68 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 68 KiB

After

Width:  |  Height:  |  Size: 68 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

After

Width:  |  Height:  |  Size: 64 KiB

View File

@ -0,0 +1,117 @@
import { expect, test } from '@e2e/playwright/zoo-test'
import { stringToBase64 } from '@src/lib/base64'
test.describe('Temporary workspace', () => {
test(
'Opening a share link creates a temporary environment that is not saved',
{ tag: ['@web'] },
async ({ page, editor, scene, cmdBar, homePage }) => {
await test.step('Pre-condition: editor is empty', async () => {
await homePage.goToModelingScene()
await scene.settled(cmdBar)
await editor.expectEditor.toContain('')
})
await test.step('Go to share link, check new content present, make a change', async () => {
const code = `sketch001 = startSketchOn(XY)
profile001 = startProfile(sketch001, at = [-124.89, -186.4])
|> line(end = [391.31, 444.04])
|> line(end = [96.21, -493.07])
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close()
extrude001 = extrude(profile001, length = 5)
`
const codeQueryParam = encodeURIComponent(stringToBase64(code))
const targetURL = `?create-file=true&browser=test&code=${codeQueryParam}&ask-open-desktop=true`
await page.goto(page.url() + targetURL)
await expect.poll(() => page.url()).toContain(targetURL)
const button = page.getByRole('button', { name: 'Continue to web app' })
await button.click()
await editor.expectEditor.toContain(code, { shouldNormalise: true })
await editor.scrollToText('-124.89', true)
await page.keyboard.press('9')
await page.keyboard.press('9')
})
await test.step('Post-condition: empty editor once again (original state)', async () => {
await homePage.goToModelingScene()
await scene.settled(cmdBar)
const code = await page.evaluate(() =>
window.localStorage.getItem('persistCode')
)
await expect(code).toContain('')
})
}
)
test(
'Opening a sample link creates a temporary environment that is not saved',
{ tag: ['@web'] },
async ({ page, editor, scene, cmdBar, homePage }) => {
await test.step('Pre-condition: editor is empty', async () => {
await homePage.goToModelingScene()
await scene.settled(cmdBar)
await editor.expectEditor.toContain('')
})
await test.step('Load sample, make an edit', async () => {
await page.goto(
`${page.url()}/?cmd=add-kcl-file-to-project&groupId=application&projectName=browser&source=kcl-samples&sample=brake-rotor/main.kcl`
)
await editor.scrollToText('114.3', true)
await page.keyboard.press('9')
await page.keyboard.press('9')
})
await test.step('Post-condition: empty editor once again (original state)', async () => {
await homePage.goToModelingScene()
await scene.settled(cmdBar)
const code = await page.evaluate(() =>
window.localStorage.getItem('persistCode')
)
await expect(code).toContain('')
})
}
)
test(
'Hitting save will save the temporary workspace',
{ tag: ['@web'] },
async ({ page, editor, scene, cmdBar, homePage }) => {
const buttonSaveTemporaryWorkspace = page.getByTestId('tws-save')
await test.step('Pre-condition: editor is empty', async () => {
await homePage.goToModelingScene()
await scene.settled(cmdBar)
await editor.expectEditor.toContain('')
})
await test.step('Load sample, make an edit, *save*', async () => {
await page.goto(
`${page.url()}/?cmd=add-kcl-file-to-project&groupId=application&projectName=browser&source=kcl-samples&sample=brake-rotor/main.kcl`
)
await homePage.goToModelingScene()
await scene.settled(cmdBar)
await editor.scrollToText('114.3')
await editor.replaceCode('114.3', '999.9133')
await editor.expectEditor.toContain('999.9133')
await buttonSaveTemporaryWorkspace.click()
await expect(buttonSaveTemporaryWorkspace).not.toBeVisible()
await editor.expectEditor.toContain('999.9133')
})
await test.step('Post-condition: has the edits in localStorage', async () => {
const code = await page.evaluate(() =>
window.localStorage.getItem('persistCode')
)
await expect(code).toContain('999.9133')
})
}
)
})

View File

@ -24,16 +24,15 @@ test.describe('Test network related behaviors', () => {
await homePage.goToModelingScene()
const networkToggle = page.getByTestId('network-toggle')
const networkToggle = page.getByTestId(/network-toggle/)
// This is how we wait until the stream is online
await expect(
page.getByRole('button', { name: 'Start Sketch' })
).not.toBeDisabled({ timeout: 15000 })
const networkWidget = page.locator('[data-testid="network-toggle"]')
await expect(networkWidget).toBeVisible()
await networkWidget.hover()
await expect(networkToggle).toBeVisible()
await networkToggle.hover()
const networkPopover = page.locator('[data-testid="network-popover"]')
await expect(networkPopover).not.toBeVisible()
@ -44,7 +43,7 @@ test.describe('Test network related behaviors', () => {
).toBeVisible()
// Click the network widget
await networkWidget.click()
await networkToggle.click()
// Check the modal opened.
await expect(networkPopover).toBeVisible()
@ -65,8 +64,8 @@ test.describe('Test network related behaviors', () => {
// Expect the network to be down
await expect(networkToggle).toContainText('Network health (Offline)')
// Click the network widget
await networkWidget.click()
// Click the network toggle
await networkToggle.click()
// Check the modal opened.
await expect(networkPopover).toBeVisible()
@ -99,7 +98,7 @@ test.describe('Test network related behaviors', () => {
'Engine disconnect & reconnect in sketch mode',
{ tag: '@skipLocalEngine' },
async ({ page, homePage, toolbar, scene, cmdBar }) => {
const networkToggle = page.getByTestId('network-toggle')
const networkToggle = page.getByTestId(/network-toggle/)
const networkToggleConnectedText = page.getByText(
'Network health (Strong)'
)
@ -286,7 +285,7 @@ profile001 = startProfile(sketch001, at = [12.34, -12.34])
'Paused stream freezes view frame, unpause reconnect is seamless to user',
{ tag: ['@desktop', '@skipLocalEngine'] },
async ({ page, homePage, scene, cmdBar, toolbar, tronApp }) => {
const networkToggle = page.getByTestId('network-toggle')
const networkToggle = page.getByTestId(/network-toggle/)
const networkToggleConnectedText = page.getByText(
'Network health (Strong)'
)

View File

@ -37,7 +37,7 @@ export const headerMasks = (page: Page) => [
]
export const lowerRightMasks = (page: Page) => [
page.getByTestId('network-toggle'),
page.getByTestId(/network-toggle/),
page.getByTestId('billing-remaining-bar'),
]

View File

@ -8,37 +8,37 @@ test.describe('Testing Gizmo', () => {
const cases = [
{
testDescription: 'top view',
clickPosition: { x: 951, y: 385 },
clickPosition: { x: 951, y: 402 },
expectedCameraPosition: { x: 800, y: -152, z: 4886.02 },
expectedCameraTarget: { x: 800, y: -152, z: 26 },
},
{
testDescription: 'bottom view',
clickPosition: { x: 951, y: 429 },
clickPosition: { x: 951, y: 449 },
expectedCameraPosition: { x: 800, y: -152, z: -4834.02 },
expectedCameraTarget: { x: 800, y: -152, z: 26 },
},
{
testDescription: 'right view',
clickPosition: { x: 929, y: 417 },
clickPosition: { x: 929, y: 435 },
expectedCameraPosition: { x: 5660.02, y: -152, z: 26 },
expectedCameraTarget: { x: 800, y: -152, z: 26 },
},
{
testDescription: 'left view',
clickPosition: { x: 974, y: 397 },
clickPosition: { x: 974, y: 417 },
expectedCameraPosition: { x: -4060.02, y: -152, z: 26 },
expectedCameraTarget: { x: 800, y: -152, z: 26 },
},
{
testDescription: 'back view',
clickPosition: { x: 967, y: 421 },
clickPosition: { x: 967, y: 441 },
expectedCameraPosition: { x: 800, y: 4708.02, z: 26 },
expectedCameraTarget: { x: 800, y: -152, z: 26 },
},
{
testDescription: 'front view',
clickPosition: { x: 935, y: 393 },
clickPosition: { x: 935, y: 413 },
expectedCameraPosition: { x: 800, y: -5012.02, z: 26 },
expectedCameraTarget: { x: 800, y: -152, z: 26 },
},

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