Compare commits

...

44 Commits

Author SHA1 Message Date
7d6427ab64 Add cursor-not-allowed to onboarding backdrops that block clicks (#6789)
* Add `cursor-not-allowed` to onboarding backdrops that block clicks

Some follow-up feedback after #6714 from @jacebrowning, so that users
know why they can't click around.

* Make anything in the onboarding card `cursor-auto`
2025-05-09 13:28:45 -04:00
4abbe0d57a Result of npm prune (#6807)
pierremtb/adhoc/npm-prune
2025-05-09 17:07:06 +00:00
a631ff689f Remove unnecessary checks for execution completion from onboarding test (#6804)
We don't care if the axial fan loads under 15s on a cheap CI machine, at
least not in this test.
2025-05-09 17:01:42 +00:00
e1d401adfe Remove snapshottoken variable and playwright-secrets.env file (#6801)
* Remove snapshottoken
Fixes #6800

* Add placeholder in .env.development

* Clean up language

* Update CONTRIBUTING.md

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

* Add dotenv to secrets for local testing

* Lint

* Reorg things

* Quick fix

* Last one for windows

---------

Co-authored-by: Jace Browning <jacebrowning@gmail.com>
2025-05-09 12:32:35 -04:00
6f49c88382 Remove dev.zoo.dev from contributing (#6799) 2025-05-09 10:20:22 -04:00
374d07b995 Turn on Billing UI in releases (#6788)
* Turn on Billing UI in releases

* Update most snapshots but one, and new masks
2025-05-09 09:04:45 -04:00
3481252082 fix subtract test (#6791)
* fix subtract test

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

* fix subtract test

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

* fixups

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

---------

Signed-off-by: Jess Frazelle <github@jessfraz.com>
2025-05-08 20:28:41 -07:00
035f3b6aed Update known-issues.md (#6790) 2025-05-09 03:21:25 +00:00
923feadfa5 Suggest a list of possible arg labels when an argument is unlabelled (#6755)
Signed-off-by: Nick Cameron <nrc@ncameron.org>
2025-05-09 14:28:04 +12:00
1ea66d6f23 [Fix]: Always show stack trace on the page if an Error shows up (#6785)
* fix: show stack traces

* fix: update GH with report a bug
2025-05-08 21:17:34 -05:00
3b7b4f85a1 Update onboarding to V1 browser and desktop flows (#6714)
* Remove unused `telemetryLoader`

* Remove onboarding redirect behavior

* Allow subRoute to be passed to navigateToProject

* Replace warning dialog routes with toasts

* Wire up new utilities and toasts to UI components

* Add home sidebar buttons for tutorial flow

* Rename menu item

* Add flex-1 so home-layout fills available space

* Remove onboarding avatar tests, they are becoming irrelevant

* Consolidate onboarding tests to one longer one

and update it to not use pixel color checks, and use fixtures.

* Shorten warning toast button text

* tsc, lint, and circular deps

* Update circular dep file

* Fix mistakes made in circular update tweaking

* One more dumb created circular dep

* Update src/routes/Onboarding/utils.tsx

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

* Fix narrow screen home layout breaking

* fix: kevin, navigation routes fixed

* fix: filename parsing is correct now for onboarding with the last file sep

* Fix e2e test state checks that are diff on Linux

* Create onboarding project entirely through systemIOMachine

* Fix Windows path construction

* Make utility to verify a string is an onboarding value

* Little biome formatting suggestion fix

* Units onboarding step was not using OnboardingButtons

* Add type checking of next and previous status, fix useNextClick

* Update `OnboardingStatus` type on WASM side

* Make onboarding different on browser and web, placeholder component

* Show proof of concept with custom content per route

* Make text type args not insta dismiss when you click anywhere

* Make some utility hooks for the onboarding

* Update requestedProjectName along with requestedProjectName

* Build out a rough draft of desktop onboarding

* Remove unused onboarding route files

* Build out rough draft of browser onboarding content

* @jgomez720 browser flow feedback

* @jgomez420 desktop feedback

* tsc and lints

* Tweaks

* Import is dead, long live Add files

* What's up with my inability to type "highlight"?

* Codespell and String casting

* Update browser sample to be axial fan

* lint and tsc

* codespell again

* Remove unused nightmare function `useDemoCode`

* Add a few unit tests

* Update desktop to use bulk file creation from #6747

* Oops overwrote main.kcl on the modify with text-to-cad step

* Undo the dumb use of `sep` that I introduced

* Fix up project test

which was fragile to the number of steps in the onboarding smh

* Fix up onboarding flow test

* typo

---------

Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>
Co-authored-by: Kevin Nadro <kevin@zoo.dev>
2025-05-09 00:37:21 +00:00
9853353512 Update text-to-cad experimental label (#6786)
update text-to-cad label
2025-05-08 22:06:01 +00:00
7b8585f3c3 Add @web tag to new web-only tests for later CI use (#6784)
pierremtb/adhoc/add-web-tag-for-later
2025-05-08 17:58:05 -04:00
fc3ce4cda8 Release KCL 68 (#6783) 2025-05-08 20:41:26 +00:00
a7f5c56ba1 Error on "Open in desktop" click if URL is too long on Windows (#6768)
* pierremtb/issue6200-toast-error-if-windows-and-length-over-2046

* Add test for web
2025-05-08 16:22:36 -04:00
max
c8747bd55a Extend point-and-click edit flow to non-pipe Chamfer and Fillet (#6767)
* enable non-piped fillets and chamfers

* reorder chamferAstMod

* tsc

* editEdgeTreatment + refactor + hookup

* remove unused stuff

* test

* typos

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

* else else else

* Apply suggestions from code review

pierre edits

Co-authored-by: Pierre Jacquier <pierrejacquier39@gmail.com>

* const

* parameterName

* fmt

* efficiency !

* graphite being helpful

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>
Co-authored-by: Pierre Jacquier <pierrejacquier39@gmail.com>
2025-05-08 20:16:36 +00:00
e2fd3948f5 [Feature] Create assembly samples from home page (#6747)
* fix: how?

* fix: 0 byte thumbnail png loading bug

* fix: adding navigate to single file back

* fix: cargo fmt

* fix: sorting files to match manifest and unit test

* fix: restoring back to main

* fix: cargo fmt

* fix: ope, I forgot I deleted some code that renamed single files to the samples name to track easier within the file tree

* fix: ope

* Update src/lib/commandBarConfigs/applicationCommandConfig.ts

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

* fix: unique name for project, ope

* fix: filtered samples for web and skeleton create a sample command

* fix: Create A Sample specifically desktop home page instead of overloading the add to file

* fix: hiding source

* fix: gotcha on add to file with existing project default args and assemblies

---------

Co-authored-by: Frank Noirot <frank@zoo.dev>
2025-05-08 19:41:29 +00:00
e960d4d8a4 BREAKING: Change array functions to call user function with keyword args (#6779)
* Change array functions to call user function with keyword args

* Fix KCL to use keyword params

* Remove unneeded positional call code

* Update docs

* Update output
2025-05-08 19:10:47 +00:00
1ccf8d4dd4 Change display of mixed array to be clear what it is (#6757) 2025-05-08 14:47:15 -04:00
b65ea8e0a9 Change pattern functions to call user function with keyword args (#6772)
* Change pattern functions to call user function with keyword args

* Fix KCL code to use unlabeled syntax

* Update generated output
2025-05-08 13:43:50 -05:00
90cb26c6d9 Fix just lint to check all targets (#6777) 2025-05-08 11:28:33 -07:00
max
3562076b83 Removes "fillets cannot touch" warning message (#6771)
rm warningMessage
2025-05-08 20:11:01 +02:00
6230747b51 Remove test that can never run in our current setup (#6774)
Remove test that can never run with our current setup
2025-05-08 17:02:41 +00:00
479179dd9b #6734 Clean up unused code (#6736)
* remove unused code in modelingMachine

* remove unused actions in featureTreeMachine

* video.pause is not async

* remove unused param in Toolbar

* remove unused rectangleOrigin from getRectangleCallExpressions

* fmt

* parseProjectRoute is not async anymore

* prefix unused params with underscore

* insertNewStartProfileAt/sketchEntryNodePath param is not used

* remove unused constraintType parameter from getRemoveConstraintsTransform

* underscore unused params

* remove unused scale param in segment.ts

* remove unused for in sceneInfra

* remove unused sketchEntryNodePath from sceneEntitiesManager methods

* remove unused shouldTearDown param

* remove unused planeNodePath param from setup draft methods

* remove unused ast param
2025-05-08 06:58:30 -04:00
67f9dba77b #6686 Fix Unable to double click to edit sketch with specific set of actions (#6766)
* Canceling sketch mode into 'undo startSketchOn' should work from all sketch states, not just in Line

* add test
2025-05-08 05:50:25 -04:00
89c345649d dont bust cache on external file change (#6756)
* dont bust cache on external file change

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

* dont bust cache on external file change

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

* dont bust cache on external file change

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

* add to the comment

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

---------

Signed-off-by: Jess Frazelle <github@jessfraz.com>
2025-05-08 05:33:32 -04:00
0550eef701 Fix the settings docs links (#6763)
Signed-off-by: Nick Cameron <nrc@ncameron.org>
2025-05-08 16:35:11 +12:00
1c21198499 Fix trackball camera by weaving through EngineStream (#6760)
* Fix trackball camera by weaving through EngineStream

Fixes #6472. Just a missing setting moved in #5312, which wasn't caught
because testing that the orbit maneuver is actually performing a
"trackball-like" movement is nonexistent. I don't know how to test that
reliably, but typing this object provides the red squiggles to reveal
the missing property.

* Update src/components/EngineStream.tsx

---------

Co-authored-by: Kurt Hutten <k.hutten@protonmail.ch>
2025-05-07 23:43:08 -04:00
8ac232414d Truncate "text" arg value summaries by default (#6754)
Splitting out some work I had in #6254 that wasn't directly related to
onboarding into its own tiny PR.
2025-05-07 22:22:04 -04:00
91e306f447 Release KCL 67 (#6751)
Breaking changes:

 - Fully removed positional arguments from function calls. Keyword arguments are now the only way to call a function.

Added:

 - Warn on usage of the unknown numeric suffix (#6690)

Fixed:

 - Fix units bug with involuteCircular (#6711)
 - Importing 3D files on Windows (#6697)
2025-05-07 17:54:45 -07:00
f01957edc7 Docs: Links and desciptions for number types (#6752)
Links and desciptions for number types

Signed-off-by: Nick Cameron <nrc@ncameron.org>
2025-05-07 16:05:57 -07:00
e9f6ebb6d1 Bump modeling cmds (#6746)
* fixes

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

* bump modeling-cmds

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

* updates

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

---------

Signed-off-by: Jess Frazelle <github@jessfraz.com>
2025-05-07 21:10:18 +00:00
2fee3a424c More docs fixes (#6733)
* Fix various docs errors around std module

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

* remove KCL from lang docs titles and move settings docs

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

* Include functions declared in Rust in module docs

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

---------

Signed-off-by: Nick Cameron <nrc@ncameron.org>
2025-05-08 08:26:56 +12:00
43d5a72514 Migrate Text-to-CAD (edit) to multi-file endpoint (#6066)
* start of migrate to multi file endpoint

* get some relative path stuff sorted

* blobifying files, and making selections work with imports working

* add write to disk

* warn about big projects

* update known circular

* update snapshot

* remove log

* tweak selection filters

* Update src/components/ModelingMachineProvider.tsx

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

* fmt

* fix one thing

* typo

* raw dog form data like a fucking peasant

* remove fake data

* fmt

* steal Kevin's stuff

* good progress

* clean up

* fix writing to files when response returns

* comment the terriable code

* push fix of sorts

* better fix

* spot of clean up

* fix: Needed to support the bad request flow, the toast will hang forever, the return control flows don't dismiss a forever toast

* fix: handling more error flows by dismissing the toast

* chore: leaving a comment for a confusing workflow

* fix: trying to clean up some async logic

* fix: trying to fix a few things at once...

* fix: fixing toast success

* fix: how did this desync?

* fix: removing useless logic, we write to disk ahead of time, the continue is to say ya no problem

* fix: typo

* Change back to `spawnChild`, forego `actors` by reference

* fix: updating PR comments

* fix: found a bug with paths from rust! it is actually OS paths!

* fix: updated type still is failing tsc

* fix: the type of the machine was wrong, we always set it to at least ''

* fix: idk man

* Fix happy path test (button labels)

---------

Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>
Co-authored-by: Kevin Nadro <kevin@zoo.dev>
Co-authored-by: Frank Noirot <frankjohnson1993@gmail.com>
Co-authored-by: Kevin Nadro <nadr0@users.noreply.github.com>
Co-authored-by: Pierre Jacquier <pierre@zoo.dev>
2025-05-07 17:54:40 +00:00
f938364d54 Better, faster typo checker (#6716)
* Fix typo 'horizonal'

* Fix typos

* Fix more typos

* Fix more typos

* Update CI action

* Fix typos

* Update src/lang/queryAst.test.ts

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

* Update src/lang/queryAst.test.ts

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

* Update typos

* Update snap

---------

Co-authored-by: Jonathan Tran <jonnytran@gmail.com>
2025-05-07 12:48:23 -05:00
998dbdc6ff Fix: thumbnail.png would not be created in a few scenarios, the commandType wasn't populated in some workflows. (#6744)
* fix: moving screenshot logic to after KCL runtime. More robust

* fix: removing toast debugging

* fix: cleaning up the old logic
2025-05-07 12:47:35 -05:00
2b3dfaf023 wip: request (and store) debug data in the connection (#6698)
Add in new Debug stubs to the connection
2025-05-07 12:10:40 -04:00
f8a33a63ac Make 'npm run test:rust' work out-of-the-box (#6721)
* Make 'npm run test:rust' work out-of-the-box

* Simplify instructions and remove stale

* Update to use correct value from the documentation

See https://doc.rust-lang.org/std/backtrace/index.html
2025-05-07 15:35:49 +00:00
af50422544 Small touch up to default planes suffix (#6738)
pierremtb/adhoc/planes-suffix-touchup
2025-05-07 15:28:32 +00:00
6e21c486e8 Remove fixme on foreign import assembly test (#6735)
pierremtb/adhoc/remove-fixme-foreign-import-test
2025-05-07 09:56:03 -04:00
c6ee10cd50 Put XY back into default plane feature tree (#6731)
* put xy back into default plane feature tree

* color code

* Update src/components/ModelingSidebar/ModelingPanes/FeatureTreePane.tsx

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-05-07 14:02:52 +10:00
6170319428 Nuke the billing poller (#6732) 2025-05-07 03:29:17 +00:00
e373d285fe test the wasm side (#6726)
Signed-off-by: Jess Frazelle <github@jessfraz.com>
2025-05-07 03:04:34 +00:00
17c326e654 fix sketch on boolean test (#6730) 2025-05-07 11:49:53 +10:00
393 changed files with 51865 additions and 5657 deletions

View File

@ -1,3 +1,5 @@
# DO NOT commit secrets, overrides go in the ignored `.env.development.local`
NODE_ENV=development
DEV=true
@ -7,7 +9,11 @@ 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
# ONLY add your token in .env.development.local if you want to skip auth, otherwise this token takes precedence!
#VITE_KC_DEV_TOKEN="your token from dev.zoo.dev should go in .env.development.local"
#VITE_KC_DEV_TOKEN="optional token to skip auth in the app"
#token="required token for playwright. TODO: clean up env vars in #3973"
RUST_BACKTRACE=1
PYO3_PYTHON=/usr/local/bin/python3
#KITTYCAD_API_TOKEN="required token for engine testing"
FAIL_ON_CONSOLE_ERRORS=true

View File

@ -2,7 +2,6 @@ on:
push:
branches:
- main
pull_request:
workflow_dispatch:
permissions:
@ -131,7 +130,6 @@ jobs:
with:
name: nextest-archive
path: rust/nextest-archive.tar.zst
run-test-artifacts:
name: cargo test (shard ${{ matrix.partitionIndex}})
runs-on:
@ -186,4 +184,40 @@ jobs:
env:
KITTYCAD_API_TOKEN: ${{secrets.KITTYCAD_API_TOKEN_DEV}}
ZOO_HOST: https://api.dev.zoo.dev
run-wasm-tests:
name: Run wasm tests
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Use correct Rust toolchain
shell: bash
run: |
[ -e rust-toolchain.toml ] || cp rust/rust-toolchain.toml ./
- name: Install rust
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
cache: false # Configured below.
- uses: taiki-e/install-action@d4635f2de61c8b8104d59cd4aede2060638378cc
with:
tool: wasm-pack
- name: Rust Cache
uses: Swatinem/rust-cache@v2
with:
workspaces: './rust'
- name: Build Wasm
shell: bash
run: |
npm install
npm run build:wasm
- name: Run wasm tests
run: |
cd rust
cd kcl-wasm-lib
#wasm-pack test --headless --chrome
env:
KITTYCAD_API_TOKEN: ${{ secrets.KITTYCAD_API_TOKEN_DEV }}
NODE_ENV: development

View File

@ -229,7 +229,6 @@ jobs:
max_attempts: 5
env:
token: ${{ secrets.KITTYCAD_API_TOKEN_DEV }}
snapshottoken: ${{ secrets.KITTYCAD_API_TOKEN }}
TAB_API_URL: ${{ secrets.TAB_API_URL }}
TAB_API_KEY: ${{ secrets.TAB_API_KEY }}
CI_COMMIT_SHA: ${{ github.event.pull_request.head.sha }}

View File

@ -171,13 +171,8 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
- name: Install codespell
run: |
python -m pip install codespell
- name: Run codespell
run: codespell --config .codespellrc # Edit this file to tweak the typo list and other configuration.
uses: crate-ci/typos@v1.32.0
npm-unit-test-kcl-samples:
runs-on: ubuntu-latest

View File

@ -63,7 +63,7 @@ If you're not a Zoo employee you won't be able to access the dev environment, yo
### Development environment variables
The Copilot LSP plugin in the editor requires a Zoo API token to run. In production, we authenticate this with a token via cookie in the browser and device auth token in the desktop environment, but this token is inaccessible in the dev browser version because the cookie is considered "cross-site" (from `localhost` to `dev.zoo.dev`). There is an optional environment variable called `VITE_KC_DEV_TOKEN` that you can populate with a dev token in a `.env.development.local` file to not check it into Git, which will use that token instead of other methods for the LSP service.
The Copilot LSP plugin in the editor requires a Zoo API token to run. In production, we authenticate this with a token via cookie in the browser and device auth token in the desktop environment, but this token is inaccessible in the dev browser version because the cookie is considered "cross-site" (from `localhost` to `zoo.dev`). There is an optional environment variable called `VITE_KC_DEV_TOKEN` that you can populate with a dev token in a `.env.development.local` file to not check it into Git, which will use that token instead of other methods for the LSP service.
### Developing in Chrome
@ -198,15 +198,9 @@ For more information on fuzzing you can check out
### Playwright tests
You will need a `./e2e/playwright/playwright-secrets.env` file:
Prepare these system dependencies:
```bash
$ touch ./e2e/playwright/playwright-secrets.env
$ cat ./e2e/playwright/playwright-secrets.env
token=<dev.zoo.dev/account/api-tokens>
snapshottoken=<zoo.dev/account/api-tokens>
```
or use `export` to set the environment variables `token` and `snapshottoken`.
- Set $token from https://zoo.dev/account/api-tokens
#### Snapshot tests (Google Chrome on Ubuntu only)
@ -300,131 +294,17 @@ Which will run our suite of [Vitest unit](https://vitest.dev/) and [React Testin
### Rust tests
**Dependencies**
Prepare these system dependencies:
- `KITTYCAD_API_TOKEN`
- `cargo-nextest`
- `just`
- Set `$KITTYCAD_API_TOKEN` from https://zoo.dev/account/api-tokens
- Install `just` following [these instructions](https://just.systems/man/en/packages.html)
#### Setting KITTYCAD_API_TOKEN
Use the production zoo.dev token, set this environment variable before running the tests
#### Installing cargonextest
then run tests that target the KCL language:
```
cd rust
cargo search cargo-nextest
cargo install cargo-nextest
npm run test:rust
```
#### just
install [`just`](https://github.com/casey/just?tab=readme-ov-file#pre-built-binaries)
#### Running the tests
```bash
# With just
# Make sure KITTYCAD_API_TOKEN=<prod zoo.dev token> is set
# Make sure you installed cargo-nextest
# Make sure you installed just
cd rust
just test
```
```bash
# Without just
# Make sure KITTYCAD_API_TOKEN=<prod zoo.dev token> is set
# Make sure you installed cargo-nextest
cd rust
export RUST_BRACKTRACE="full" && cargo nextest run --workspace --test-threads=1
```
Where `XXX` is an API token from the production engine (NOT the dev environment).
We recommend using [nextest](https://nexte.st/) to run the Rust tests (its faster and is used in CI). Once installed, run the tests using
```
cd rust
KITTYCAD_API_TOKEN=XXX cargo run nextest
```
### Mapping CI CD jobs to local commands
When you see the CI CD fail on jobs you may wonder three things
- Do I have a bug in my code?
- Is the test flaky?
- Is there a bug in `main`?
To answer these questions the following commands will give you confidence to locate the issue.
#### Static Analysis
Part of the CI CD pipeline performs static analysis on the code. Use the following commands to mimic the CI CD jobs.
The following set of commands should get us closer to one and done commands to instantly retest issues.
```
npm run test-setup
```
> Gotcha, are packages up to date and is the wasm built?
```
npm run tsc
npm run fmt:check
npm run lint
npm run test:unit:local
```
> Gotcha: Our unit tests have integration tests in them. You need to run a localhost server to run the unit tests.
#### E2E Tests
**Playwright Electron**
These E2E tests run in electron. There are tests that are skipped if they are ran in a windows, linux, or macos environment. We can use playwright tags to implement test skipping.
```
npm run test:playwright:electron:local
npm run test:playwright:electron:windows:local
npm run test:playwright:electron:macos:local
npm run test:playwright:electron:ubuntu:local
```
> Why does it say local? The CI CD commands that run in the pipeline cannot be ran locally. A single command will not properly setup the testing environment locally.
#### Some notes on CI
The tests are broken into snapshot tests and non-snapshot tests, and they run in that order, they automatically commit new snap shots, so if you see an image commit check it was an intended change. If we have non-determinism in the snapshots such that they are always committing new images, hopefully this annoyance makes us fix them asap, if you notice this happening let Kurt know. But for the odd occasion `git reset --hard HEAD~ && git push -f` is your friend.
How to interpret failing playwright tests?
If your tests fail, click through to the action and see that the tests failed on a line that includes `await page.getByTestId('loading').waitFor({ state: 'detached' })`, this means the test fail because the stream never started. It's you choice if you want to re-run the test, or ignore the failure.
We run on ubuntu and macos, because safari doesn't work on linux because of the dreaded "no RTCPeerConnection variable" error. But linux runs first and then macos for the same reason that we limit the number of parallel tests to 1 because we limit stream connections per user, so tests would start failing we if let them run together.
If something fails on CI you can download the artifact, unzip it and then open `playwright-report/data/<UUID>.zip` with https://trace.playwright.dev/ to see what happened.
#### Getting started writing a playwright test in our app
Besides following the instructions above and using the playwright docs, our app is weird because of the whole stream thing, which means our testing is weird. Because we've just figured out this stuff and therefore docs might go stale quick here's a 15min vid/tutorial
https://github.com/KittyCAD/modeling-app/assets/29681384/6f5e8e85-1003-4fd9-be7f-f36ce833942d
<details>
<summary>
PS: for the debug panel, the following JSON is useful for snapping the camera
</summary>
```JSON
{"type":"modeling_cmd_req","cmd_id":"054e5472-e5e9-4071-92d7-1ce3bac61956","cmd":{"type":"default_camera_look_at","center":{"x":15,"y":0,"z":0},"up":{"x":0,"y":0,"z":1},"vantage":{"x":30,"y":30,"z":30}}}
```
</details>
### Logging
To display logging (to the terminal or console) set `ZOO_LOG=1`. This will log some warnings and simple performance metrics. To view these in test runs, use `-- --nocapture`.

View File

@ -1,5 +1,5 @@
.PHONY: all
all: install build check
all: install check build
###############################################################################
# INSTALL
@ -106,6 +106,7 @@ test: test-unit test-e2e
.PHONY: test-unit
test-unit: install ## Run the unit tests
npm run test:rust
@ curl -fs localhost:3000 >/dev/null || ( echo "Error: localhost:3000 not available, 'make run-web' first" && exit 1 )
npm run test:unit

39
_typos.toml Normal file
View File

@ -0,0 +1,39 @@
[files]
extend-exclude = [
"**/target",
"node_modules",
"build",
"dist",
"out",
"**/Cargo.lock",
"docs/**/*.md",
"docs/**/*.json",
"e2e/playwright/lib/console-error-whitelist.ts",
".package-lock.json",
"**/package-lock.json",
"openapi/*.json",
"packages/codemirror-lang-kcl/test/all.test.ts",
"public/kcl-samples",
"rust/kcl-lib/tests/kcl_samples",
"tsconfig.tsbuildinfo",
"src/lib/machine-api.d.ts",
"kcl-book/book",
]
[default.extend-words]
metalness = "metalness" # appearance API
Hom = "Hom" # short for homogenous
typ = "typ" # used to declare a variable named 'type' which is a reserved keyword in Rust
ue = "ue" # short for UnaryExpression
THRE = "THRE" # Weird bug that wrongly detects THREEjs as a typo
nwo = "nwo" # don't know what this is about tbh
"ot" = "ot" # some abbreviation, idk what
"oe" = "oe" # some abbreviation, idk what
[default]
extend-ignore-identifiers-re = [
"\\dnd", # e.g. 2nd
]
extend-ignore-re = [
"@xstate-layout .*",
]

View File

@ -1,5 +1,5 @@
---
title: "KCL Known Issues"
title: "Known Issues"
excerpt: "Known issues with the KCL standard library for the Zoo Design Studio."
layout: manual
---
@ -15,12 +15,6 @@ once fixed in engine will just start working here with no language changes.
- **Import**: Right now you can import a file, even if that file has brep data
you cannot edit it, after v1, the engine will account for this.
- **Fillets**: Fillets cannot intersect, you will get an error. Only simple fillet
cases work currently.
- **Chamfers**: Chamfers cannot intersect, you will get an error. Only simple
chamfer cases work currently.
- **Appearance**: Changing the appearance on a loft does not work.
- **CSG Booleans**: Coplanar (bodies that share a plane) unions, subtractions, and intersections are not currently supported.

View File

@ -1,5 +1,5 @@
---
title: "KCL Modules"
title: "Modules"
excerpt: "Documentation of modules for the KCL language for the Zoo Design Studio."
layout: manual
---

View File

@ -1,5 +1,5 @@
---
title: "KCL Settings"
title: "Settings"
excerpt: "Documentation of settings for the KCL language and Zoo Design Studio."
layout: manual
---
@ -8,16 +8,16 @@ layout: manual
There are three levels of settings available in Zoo Design Studio:
1. [User Settings](/docs/kcl/settings-user): Global settings that apply to all projects, stored in `user.toml`
2. [Project Settings](/docs/kcl/settings-project): Settings specific to a project, stored in `project.toml`
1. [User Settings](/docs/kcl-lang/settings/user): Global settings that apply to all projects, stored in `user.toml`
2. [Project Settings](/docs/kcl-lang/settings/project): Settings specific to a project, stored in `project.toml`
3. Per-file Settings: Settings that apply to a single KCL file, specified using the `@settings` attribute
## Configuration Files
Zoo Design Studio uses TOML files for configuration:
* **User Settings**: `user.toml` - See [complete documentation](/docs/kcl/settings-user)
* **Project Settings**: `project.toml` - See [complete documentation](/docs/kcl/settings-project)
* **User Settings**: `user.toml` - See [complete documentation](/docs/kcl-lang/settings/user)
* **Project Settings**: `project.toml` - See [complete documentation](/docs/kcl-lang/settings/project)
## Per-file settings

View File

@ -1,5 +1,5 @@
---
title: "KCL Types"
title: "Types"
excerpt: "Documentation of types for the KCL standard library for the Zoo Design Studio."
layout: manual
---

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,6 +1,6 @@
---
title: "END"
subtitle: "Constant in prelude"
subtitle: "Constant in std"
excerpt: "Identifies the ending face of an extrusion. I.e., the new face created by an extrusion."
layout: manual
---

View File

@ -1,6 +1,6 @@
---
title: "START"
subtitle: "Constant in prelude"
subtitle: "Constant in std"
excerpt: "Identifies the starting face of an extrusion. I.e., the face which is extruded."
layout: manual
---

View File

@ -1,6 +1,6 @@
---
title: "X"
subtitle: "Constant in prelude"
subtitle: "Constant in std"
excerpt: ""
layout: manual
---

View File

@ -1,6 +1,6 @@
---
title: "XY"
subtitle: "Constant in prelude"
subtitle: "Constant in std"
excerpt: ""
layout: manual
---

View File

@ -1,6 +1,6 @@
---
title: "XZ"
subtitle: "Constant in prelude"
subtitle: "Constant in std"
excerpt: ""
layout: manual
---

View File

@ -1,6 +1,6 @@
---
title: "Y"
subtitle: "Constant in prelude"
subtitle: "Constant in std"
excerpt: ""
layout: manual
---

View File

@ -1,6 +1,6 @@
---
title: "YZ"
subtitle: "Constant in prelude"
subtitle: "Constant in std"
excerpt: ""
layout: manual
---

View File

@ -1,6 +1,6 @@
---
title: "Z"
subtitle: "Constant in prelude"
subtitle: "Constant in std"
excerpt: ""
layout: manual
---

View File

@ -1,6 +1,6 @@
---
title: "E"
subtitle: "Constant in math"
subtitle: "Constant in std::math"
excerpt: "The value of Eulers number `e`."
layout: manual
---

View File

@ -1,6 +1,6 @@
---
title: "PI"
subtitle: "Constant in math"
subtitle: "Constant in std::math"
excerpt: "The value of `pi`, Archimedes constant (π)."
layout: manual
---

View File

@ -1,6 +1,6 @@
---
title: "TAU"
subtitle: "Constant in math"
subtitle: "Constant in std::math"
excerpt: "The value of `tau`, the full circle constant (τ). Equal to 2π."
layout: manual
---

View File

@ -1,6 +1,6 @@
---
title: "turns::HALF_TURN"
subtitle: "Constant in turns"
subtitle: "Constant in std::turns"
excerpt: ""
layout: manual
---

View File

@ -1,6 +1,6 @@
---
title: "turns::QUARTER_TURN"
subtitle: "Constant in turns"
subtitle: "Constant in std::turns"
excerpt: ""
layout: manual
---

View File

@ -1,6 +1,6 @@
---
title: "turns::THREE_QUARTER_TURN"
subtitle: "Constant in turns"
subtitle: "Constant in std::turns"
excerpt: ""
layout: manual
---

View File

@ -1,6 +1,6 @@
---
title: "turns::ZERO"
subtitle: "Constant in turns"
subtitle: "Constant in std::turns"
excerpt: ""
layout: manual
---

File diff suppressed because one or more lines are too long

View File

@ -1,6 +1,6 @@
---
title: "abs"
subtitle: "Function in math"
subtitle: "Function in std::math"
excerpt: "Compute the absolute value of a number."
layout: manual
---

View File

@ -1,6 +1,6 @@
---
title: "acos"
subtitle: "Function in math"
subtitle: "Function in std::math"
excerpt: "Compute the arccosine of a number."
layout: manual
---
@ -17,11 +17,11 @@ acos(@num: number(_)): number(rad)
| Name | Type | Description | Required |
|----------|------|-------------|----------|
| `num` | `number(_)` | | Yes |
| `num` | [`number(_)`](/docs/kcl-std/types/std-types-number) | A number | Yes |
### Returns
`number(rad)`
[`number(rad)`](/docs/kcl-std/types/std-types-number) - A number
### Examples

View File

@ -1,6 +1,6 @@
---
title: "asin"
subtitle: "Function in math"
subtitle: "Function in std::math"
excerpt: "Compute the arcsine of a number."
layout: manual
---
@ -17,11 +17,11 @@ asin(@num: number(_)): number(rad)
| Name | Type | Description | Required |
|----------|------|-------------|----------|
| `num` | `number(_)` | | Yes |
| `num` | [`number(_)`](/docs/kcl-std/types/std-types-number) | A number | Yes |
### Returns
`number(rad)`
[`number(rad)`](/docs/kcl-std/types/std-types-number) - A number
### Examples

View File

@ -1,6 +1,6 @@
---
title: "atan"
subtitle: "Function in math"
subtitle: "Function in std::math"
excerpt: "Compute the arctangent of a number."
layout: manual
---
@ -17,11 +17,11 @@ Consider using `atan2()` instead for the true inverse of tangent.
| Name | Type | Description | Required |
|----------|------|-------------|----------|
| `num` | `number(_)` | | Yes |
| `num` | [`number(_)`](/docs/kcl-std/types/std-types-number) | A number | Yes |
### Returns
`number(rad)`
[`number(rad)`](/docs/kcl-std/types/std-types-number) - A number
### Examples

View File

@ -1,6 +1,6 @@
---
title: "atan2"
subtitle: "Function in math"
subtitle: "Function in std::math"
excerpt: "Compute the four quadrant arctangent of Y and X."
layout: manual
---
@ -20,12 +20,12 @@ atan2(
| Name | Type | Description | Required |
|----------|------|-------------|----------|
| `y` | `number(Length)` | | Yes |
| `x` | `number(Length)` | | Yes |
| `y` | [`number(Length)`](/docs/kcl-std/types/std-types-number) | A number | Yes |
| `x` | [`number(Length)`](/docs/kcl-std/types/std-types-number) | A number | Yes |
### Returns
`number(rad)`
[`number(rad)`](/docs/kcl-std/types/std-types-number) - A number
### Examples

View File

@ -1,6 +1,6 @@
---
title: "ceil"
subtitle: "Function in math"
subtitle: "Function in std::math"
excerpt: "Compute the smallest integer greater than or equal to a number."
layout: manual
---

View File

@ -1,6 +1,6 @@
---
title: "cos"
subtitle: "Function in math"
subtitle: "Function in std::math"
excerpt: "Compute the cosine of a number."
layout: manual
---
@ -17,11 +17,11 @@ cos(@num: number(Angle)): number(_)
| Name | Type | Description | Required |
|----------|------|-------------|----------|
| `num` | `number(Angle)` | | Yes |
| `num` | [`number(Angle)`](/docs/kcl-std/types/std-types-number) | A number | Yes |
### Returns
`number(_)`
[`number(_)`](/docs/kcl-std/types/std-types-number) - A number
### Examples

View File

@ -1,6 +1,6 @@
---
title: "floor"
subtitle: "Function in math"
subtitle: "Function in std::math"
excerpt: "Compute the largest integer less than or equal to a number."
layout: manual
---

View File

@ -1,6 +1,6 @@
---
title: "ln"
subtitle: "Function in math"
subtitle: "Function in std::math"
excerpt: "Compute the natural logarithm of the number."
layout: manual
---

View File

@ -1,6 +1,6 @@
---
title: "log"
subtitle: "Function in math"
subtitle: "Function in std::math"
excerpt: "Compute the logarithm of the number with respect to an arbitrary base."
layout: manual
---
@ -23,7 +23,7 @@ and `log10` can produce more accurate results for base 10.
| Name | Type | Description | Required |
|----------|------|-------------|----------|
| `input` | [`number`](/docs/kcl-std/types/std-types-number) | The number to compute the logarithm of. | Yes |
| `base` | `number(_)` | The base of the logarithm. | Yes |
| `base` | [`number(_)`](/docs/kcl-std/types/std-types-number) | The base of the logarithm. | Yes |
### Returns

View File

@ -1,6 +1,6 @@
---
title: "log10"
subtitle: "Function in math"
subtitle: "Function in std::math"
excerpt: "Compute the base 10 logarithm of the number."
layout: manual
---

View File

@ -1,6 +1,6 @@
---
title: "log2"
subtitle: "Function in math"
subtitle: "Function in std::math"
excerpt: "Compute the base 2 logarithm of the number."
layout: manual
---

View File

@ -1,6 +1,6 @@
---
title: "max"
subtitle: "Function in math"
subtitle: "Function in std::math"
excerpt: "Compute the maximum of the given arguments."
layout: manual
---

View File

@ -1,6 +1,6 @@
---
title: "min"
subtitle: "Function in math"
subtitle: "Function in std::math"
excerpt: "Compute the minimum of the given arguments."
layout: manual
---

View File

@ -1,6 +1,6 @@
---
title: "polar"
subtitle: "Function in math"
subtitle: "Function in std::math"
excerpt: ""
layout: manual
---
@ -21,8 +21,8 @@ cartesian (x/y/z grid) coordinates.
| Name | Type | Description | Required |
|----------|------|-------------|----------|
| `angle` | `number(rad)` | | Yes |
| `length` | `number(Length)` | | Yes |
| `angle` | [`number(rad)`](/docs/kcl-std/types/std-types-number) | A number | Yes |
| `length` | [`number(Length)`](/docs/kcl-std/types/std-types-number) | A number | Yes |
### Returns

View File

@ -1,6 +1,6 @@
---
title: "pow"
subtitle: "Function in math"
subtitle: "Function in std::math"
excerpt: "Compute the number to a power."
layout: manual
---
@ -21,7 +21,7 @@ pow(
| Name | Type | Description | Required |
|----------|------|-------------|----------|
| `input` | [`number`](/docs/kcl-std/types/std-types-number) | The number to raise. | Yes |
| `exp` | `number(_)` | The power to raise to. | Yes |
| `exp` | [`number(_)`](/docs/kcl-std/types/std-types-number) | The power to raise to. | Yes |
### Returns

View File

@ -1,6 +1,6 @@
---
title: "rem"
subtitle: "Function in math"
subtitle: "Function in std::math"
excerpt: ""
layout: manual
---

View File

@ -1,6 +1,6 @@
---
title: "round"
subtitle: "Function in math"
subtitle: "Function in std::math"
excerpt: "Round a number to the nearest integer."
layout: manual
---

View File

@ -1,6 +1,6 @@
---
title: "sin"
subtitle: "Function in math"
subtitle: "Function in std::math"
excerpt: "Compute the sine of a number."
layout: manual
---
@ -17,11 +17,11 @@ sin(@num: number(Angle)): number(_)
| Name | Type | Description | Required |
|----------|------|-------------|----------|
| `num` | `number(Angle)` | | Yes |
| `num` | [`number(Angle)`](/docs/kcl-std/types/std-types-number) | A number | Yes |
### Returns
`number(_)`
[`number(_)`](/docs/kcl-std/types/std-types-number) - A number
### Examples

View File

@ -1,6 +1,6 @@
---
title: "sqrt"
subtitle: "Function in math"
subtitle: "Function in std::math"
excerpt: "Compute the square root of a number."
layout: manual
---

View File

@ -1,6 +1,6 @@
---
title: "tan"
subtitle: "Function in math"
subtitle: "Function in std::math"
excerpt: "Compute the tangent of a number."
layout: manual
---
@ -17,11 +17,11 @@ tan(@num: number(Angle)): number(_)
| Name | Type | Description | Required |
|----------|------|-------------|----------|
| `num` | `number(Angle)` | | Yes |
| `num` | [`number(Angle)`](/docs/kcl-std/types/std-types-number) | A number | Yes |
### Returns
`number(_)`
[`number(_)`](/docs/kcl-std/types/std-types-number) - A number
### Examples

View File

@ -1,6 +1,6 @@
---
title: "offsetPlane"
subtitle: "Function in prelude"
subtitle: "Function in std"
excerpt: "Offset a plane by a distance along its normal."
layout: manual
---
@ -22,7 +22,7 @@ plane and 10 units away from it.
| Name | Type | Description | Required |
|----------|------|-------------|----------|
| `plane` | [`Plane`](/docs/kcl-std/types/std-types-Plane) | The plane (e.g. `XY`) which this new plane is created from. | Yes |
| `offset` | `number(Length)` | Distance from the standard plane this new plane will be created at. | Yes |
| `offset` | [`number(Length)`](/docs/kcl-std/types/std-types-number) | Distance from the standard plane this new plane will be created at. | Yes |
### Returns

View File

@ -1,6 +1,6 @@
---
title: "circle"
subtitle: "Function in sketch"
subtitle: "Function in std::sketch"
excerpt: ""
layout: manual
---
@ -25,7 +25,7 @@ the provided (x, y) origin point.
|----------|------|-------------|----------|
| `sketch_or_surface` | [`Sketch`](/docs/kcl-std/types/std-types-Sketch) or [`Plane`](/docs/kcl-std/types/std-types-Plane) or [`Face`](/docs/kcl-std/types/std-types-Face) | Sketch to extend, or plane or surface to sketch on. | Yes |
| `center` | [`Point2d`](/docs/kcl-std/types/std-types-Point2d) | The center of the circle. | Yes |
| `radius` | `number(Length)` | The radius of the circle. | Yes |
| `radius` | [`number(Length)`](/docs/kcl-std/types/std-types-number) | The radius of the circle. | 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 circle. | No |
### Returns

View File

@ -1,6 +1,6 @@
---
title: "revolve"
subtitle: "Function in sketch"
subtitle: "Function in std::sketch"
excerpt: "Rotate a sketch around some provided axis, creating a solid from its extent."
layout: manual
---
@ -37,10 +37,10 @@ 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)` | Angle to revolve (in degrees). Default is 360. | No |
| `tolerance` | `number(Length)` | Tolerance for the revolve operation. | No |
| `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 |
| `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)` | If specified, will also revolve in the opposite direction to 'angle' to the specified angle. If 'symmetric' is true, this value is ignored. | 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 |

File diff suppressed because one or more lines are too long

View File

@ -1,6 +1,6 @@
---
title: "fillet"
subtitle: "Function in solid"
subtitle: "Function in std::solid"
excerpt: "Blend a transitional edge along a tagged path, smoothing the sharp edge."
layout: manual
---
@ -26,9 +26,9 @@ will smoothly blend the transition.
| Name | Type | Description | Required |
|----------|------|-------------|----------|
| `solid` | [`Solid`](/docs/kcl-std/types/std-types-Solid) | The solid whose edges should be filletted | Yes |
| `radius` | `number(Length)` | The radius of the fillet | 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)` | The tolerance for this fillet | No |
| `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 |
### Returns

View File

@ -1,6 +1,6 @@
---
title: "hollow"
subtitle: "Function in solid"
subtitle: "Function in std::solid"
excerpt: "Make the inside of a 3D object hollow."
layout: manual
---
@ -22,7 +22,7 @@ provided thickness remains around the exterior of the shape.
| Name | Type | Description | Required |
|----------|------|-------------|----------|
| `solid` | [`Solid`](/docs/kcl-std/types/std-types-Solid) | Which solid to hollow out | Yes |
| `thickness` | `number(Length)` | The thickness of the remaining shell | Yes |
| `thickness` | [`number(Length)`](/docs/kcl-std/types/std-types-number) | The thickness of the remaining shell | Yes |
### Returns

View File

@ -1,6 +1,6 @@
---
title: "shell"
subtitle: "Function in solid"
subtitle: "Function in std::solid"
excerpt: ""
layout: manual
---
@ -23,7 +23,7 @@ provided thickness remains, taking volume starting at the providedface, leaving
| Name | Type | Description | Required |
|----------|------|-------------|----------|
| `solids` | [`[Solid; 1+]`](/docs/kcl-std/types/std-types-Solid) | Which solid (or solids) to shell out | Yes |
| `thickness` | `number(Length)` | The thickness of the shell | 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 |
### Returns

View File

@ -1,6 +1,6 @@
---
title: "mirror2d"
subtitle: "Function in transform"
subtitle: "Function in std::transform"
excerpt: "Mirror a sketch."
layout: manual
---

View File

@ -1,6 +1,6 @@
---
title: "units::toCentimeters"
subtitle: "Function in units"
subtitle: "Function in std::units"
excerpt: "Convert a number to centimeters from its current units."
layout: manual
---
@ -17,11 +17,11 @@ units::toCentimeters(@num: number(cm)): number(cm)
| Name | Type | Description | Required |
|----------|------|-------------|----------|
| `num` | `number(cm)` | | Yes |
| `num` | [`number(cm)`](/docs/kcl-std/types/std-types-number) | A number | Yes |
### Returns
`number(cm)`
[`number(cm)`](/docs/kcl-std/types/std-types-number) - A number

View File

@ -1,6 +1,6 @@
---
title: "units::toDegrees"
subtitle: "Function in units"
subtitle: "Function in std::units"
excerpt: "Converts a number to degrees from its current units."
layout: manual
---
@ -17,11 +17,11 @@ units::toDegrees(@num: number(deg)): number(deg)
| Name | Type | Description | Required |
|----------|------|-------------|----------|
| `num` | `number(deg)` | | Yes |
| `num` | [`number(deg)`](/docs/kcl-std/types/std-types-number) | A number | Yes |
### Returns
`number(deg)`
[`number(deg)`](/docs/kcl-std/types/std-types-number) - A number
### Examples

View File

@ -1,6 +1,6 @@
---
title: "units::toFeet"
subtitle: "Function in units"
subtitle: "Function in std::units"
excerpt: "Convert a number to feet from its current units."
layout: manual
---
@ -17,11 +17,11 @@ units::toFeet(@num: number(ft)): number(ft)
| Name | Type | Description | Required |
|----------|------|-------------|----------|
| `num` | `number(ft)` | | Yes |
| `num` | [`number(ft)`](/docs/kcl-std/types/std-types-number) | A number | Yes |
### Returns
`number(ft)`
[`number(ft)`](/docs/kcl-std/types/std-types-number) - A number

View File

@ -1,6 +1,6 @@
---
title: "units::toInches"
subtitle: "Function in units"
subtitle: "Function in std::units"
excerpt: "Convert a number to inches from its current units."
layout: manual
---
@ -17,11 +17,11 @@ units::toInches(@num: number(in)): number(in)
| Name | Type | Description | Required |
|----------|------|-------------|----------|
| `num` | `number(in)` | | Yes |
| `num` | [`number(in)`](/docs/kcl-std/types/std-types-number) | A number | Yes |
### Returns
`number(in)`
[`number(in)`](/docs/kcl-std/types/std-types-number) - A number

View File

@ -1,6 +1,6 @@
---
title: "units::toMeters"
subtitle: "Function in units"
subtitle: "Function in std::units"
excerpt: "Convert a number to meters from its current units."
layout: manual
---
@ -17,11 +17,11 @@ units::toMeters(@num: number(m)): number(m)
| Name | Type | Description | Required |
|----------|------|-------------|----------|
| `num` | `number(m)` | | Yes |
| `num` | [`number(m)`](/docs/kcl-std/types/std-types-number) | A number | Yes |
### Returns
`number(m)`
[`number(m)`](/docs/kcl-std/types/std-types-number) - A number

View File

@ -1,6 +1,6 @@
---
title: "units::toMillimeters"
subtitle: "Function in units"
subtitle: "Function in std::units"
excerpt: "Convert a number to millimeters from its current units."
layout: manual
---
@ -17,11 +17,11 @@ units::toMillimeters(@num: number(mm)): number(mm)
| Name | Type | Description | Required |
|----------|------|-------------|----------|
| `num` | `number(mm)` | | Yes |
| `num` | [`number(mm)`](/docs/kcl-std/types/std-types-number) | A number | Yes |
### Returns
`number(mm)`
[`number(mm)`](/docs/kcl-std/types/std-types-number) - A number

View File

@ -1,6 +1,6 @@
---
title: "units::toRadians"
subtitle: "Function in units"
subtitle: "Function in std::units"
excerpt: "Converts a number to radians from its current units."
layout: manual
---
@ -17,11 +17,11 @@ units::toRadians(@num: number(rad)): number(rad)
| Name | Type | Description | Required |
|----------|------|-------------|----------|
| `num` | `number(rad)` | | Yes |
| `num` | [`number(rad)`](/docs/kcl-std/types/std-types-number) | A number | Yes |
### Returns
`number(rad)`
[`number(rad)`](/docs/kcl-std/types/std-types-number) - A number
### Examples

View File

@ -1,6 +1,6 @@
---
title: "units::toYards"
subtitle: "Function in units"
subtitle: "Function in std::units"
excerpt: "Converts a number to yards from its current units."
layout: manual
---
@ -17,11 +17,11 @@ units::toYards(@num: number(yd)): number(yd)
| Name | Type | Description | Required |
|----------|------|-------------|----------|
| `num` | `number(yd)` | | Yes |
| `num` | [`number(yd)`](/docs/kcl-std/types/std-types-number) | A number | Yes |
### Returns
`number(yd)`
[`number(yd)`](/docs/kcl-std/types/std-types-number) - A number

View File

@ -50,7 +50,7 @@ r = 10 // radius
// Call `map`, using an anonymous function instead of a named one.
circles = map(
[1..3],
f = fn(id) {
f = fn(@id) {
return startSketchOn(XY)
|> circle(center = [id * 2 * r, 0], radius = r)
},

View File

@ -10,4 +10,10 @@ layout: manual
## Functions and constants
* [`map`](/docs/kcl-std/map)
* [`pop`](/docs/kcl-std/pop)
* [`push`](/docs/kcl-std/push)
* [`reduce`](/docs/kcl-std/reduce)

View File

@ -23,6 +23,9 @@ layout: manual
* [`ceil`](/docs/kcl-std/functions/std-math-ceil)
* [`cos`](/docs/kcl-std/functions/std-math-cos)
* [`floor`](/docs/kcl-std/functions/std-math-floor)
* [`legAngX`](/docs/kcl-std/legAngX)
* [`legAngY`](/docs/kcl-std/legAngY)
* [`legLen`](/docs/kcl-std/legLen)
* [`ln`](/docs/kcl-std/functions/std-math-ln)
* [`log`](/docs/kcl-std/functions/std-math-log)
* [`log10`](/docs/kcl-std/functions/std-math-log10)

View File

@ -12,6 +12,44 @@ layout: manual
## Functions and constants
* [`angledLine`](/docs/kcl-std/angledLine)
* [`angledLineThatIntersects`](/docs/kcl-std/angledLineThatIntersects)
* [`arc`](/docs/kcl-std/arc)
* [`bezierCurve`](/docs/kcl-std/bezierCurve)
* [`circle`](/docs/kcl-std/functions/std-sketch-circle)
* [`circleThreePoint`](/docs/kcl-std/circleThreePoint)
* [`close`](/docs/kcl-std/close)
* [`extrude`](/docs/kcl-std/extrude)
* [`getCommonEdge`](/docs/kcl-std/getCommonEdge)
* [`getNextAdjacentEdge`](/docs/kcl-std/getNextAdjacentEdge)
* [`getOppositeEdge`](/docs/kcl-std/getOppositeEdge)
* [`getPreviousAdjacentEdge`](/docs/kcl-std/getPreviousAdjacentEdge)
* [`involuteCircular`](/docs/kcl-std/involuteCircular)
* [`lastSegX`](/docs/kcl-std/lastSegX)
* [`lastSegY`](/docs/kcl-std/lastSegY)
* [`line`](/docs/kcl-std/line)
* [`loft`](/docs/kcl-std/loft)
* [`patternCircular2d`](/docs/kcl-std/patternCircular2d)
* [`patternTransform2d`](/docs/kcl-std/patternTransform2d)
* [`polygon`](/docs/kcl-std/polygon)
* [`profileStart`](/docs/kcl-std/profileStart)
* [`profileStartX`](/docs/kcl-std/profileStartX)
* [`profileStartY`](/docs/kcl-std/profileStartY)
* [`revolve`](/docs/kcl-std/functions/std-sketch-revolve)
* [`segAng`](/docs/kcl-std/segAng)
* [`segEnd`](/docs/kcl-std/segEnd)
* [`segEndX`](/docs/kcl-std/segEndX)
* [`segEndY`](/docs/kcl-std/segEndY)
* [`segLen`](/docs/kcl-std/segLen)
* [`segStart`](/docs/kcl-std/segStart)
* [`segStartX`](/docs/kcl-std/segStartX)
* [`segStartY`](/docs/kcl-std/segStartY)
* [`startProfile`](/docs/kcl-std/startProfile)
* [`startSketchOn`](/docs/kcl-std/startSketchOn)
* [`subtract2d`](/docs/kcl-std/subtract2d)
* [`sweep`](/docs/kcl-std/sweep)
* [`tangentToEnd`](/docs/kcl-std/tangentToEnd)
* [`tangentialArc`](/docs/kcl-std/tangentialArc)
* [`xLine`](/docs/kcl-std/xLine)
* [`yLine`](/docs/kcl-std/yLine)

View File

@ -15,5 +15,11 @@ layout: manual
* [`chamfer`](/docs/kcl-std/functions/std-solid-chamfer)
* [`fillet`](/docs/kcl-std/functions/std-solid-fillet)
* [`hollow`](/docs/kcl-std/functions/std-solid-hollow)
* [`intersect`](/docs/kcl-std/intersect)
* [`patternCircular3d`](/docs/kcl-std/patternCircular3d)
* [`patternLinear3d`](/docs/kcl-std/patternLinear3d)
* [`patternTransform`](/docs/kcl-std/patternTransform)
* [`shell`](/docs/kcl-std/functions/std-solid-shell)
* [`subtract`](/docs/kcl-std/subtract)
* [`union`](/docs/kcl-std/union)

View File

@ -13,4 +13,7 @@ layout: manual
## Functions and constants
* [`mirror2d`](/docs/kcl-std/functions/std-transform-mirror2d)
* [`rotate`](/docs/kcl-std/rotate)
* [`scale`](/docs/kcl-std/scale)
* [`translate`](/docs/kcl-std/translate)

View File

@ -1,6 +1,6 @@
---
title: "prelude"
subtitle: "Module in "
title: "std"
subtitle: "Module in std::"
excerpt: "The KCL standard library "
layout: manual
---
@ -30,6 +30,11 @@ Contains frequently used constants, functions for interacting with the KittyCAD
* [`Y`](/docs/kcl-std/consts/std-Y)
* [`YZ`](/docs/kcl-std/consts/std-YZ)
* [`Z`](/docs/kcl-std/consts/std-Z)
* [`appearance`](/docs/kcl-std/appearance)
* [`assert`](/docs/kcl-std/assert)
* [`assertIs`](/docs/kcl-std/assertIs)
* [`clone`](/docs/kcl-std/clone)
* [`helix`](/docs/kcl-std/functions/std-helix)
* [`offsetPlane`](/docs/kcl-std/functions/std-offsetPlane)
* [`patternLinear2d`](/docs/kcl-std/patternLinear2d)

View File

@ -1,11 +1,11 @@
---
title: "patternCircular2d"
subtitle: "Function in std::sketch"
excerpt: "Repeat a 2-dimensional sketch some number of times along a partial or complete circle some specified number of times. Each object may additionally be rotated along the circle, ensuring orentation of the solid with respect to the center of the circle is maintained."
excerpt: "Repeat a 2-dimensional sketch some number of times along a partial or complete circle some specified number of times. Each object may additionally be rotated along the circle, ensuring orientation of the solid with respect to the center of the circle is maintained."
layout: manual
---
Repeat a 2-dimensional sketch some number of times along a partial or complete circle some specified number of times. Each object may additionally be rotated along the circle, ensuring orentation of the solid with respect to the center of the circle is maintained.
Repeat a 2-dimensional sketch some number of times along a partial or complete circle some specified number of times. Each object may additionally be rotated along the circle, ensuring orientation of the solid with respect to the center of the circle is maintained.
```kcl
patternCircular2d(

View File

@ -1,11 +1,11 @@
---
title: "patternCircular3d"
subtitle: "Function in std::solid"
excerpt: "Repeat a 3-dimensional solid some number of times along a partial or complete circle some specified number of times. Each object may additionally be rotated along the circle, ensuring orentation of the solid with respect to the center of the circle is maintained."
excerpt: "Repeat a 3-dimensional solid some number of times along a partial or complete circle some specified number of times. Each object may additionally be rotated along the circle, ensuring orientation of the solid with respect to the center of the circle is maintained."
layout: manual
---
Repeat a 3-dimensional solid some number of times along a partial or complete circle some specified number of times. Each object may additionally be rotated along the circle, ensuring orentation of the solid with respect to the center of the circle is maintained.
Repeat a 3-dimensional solid some number of times along a partial or complete circle some specified number of times. Each object may additionally be rotated along the circle, ensuring orientation of the solid with respect to the center of the circle is maintained.
```kcl
patternCircular3d(

View File

@ -34,8 +34,8 @@ reduce(
```kcl
// This function adds two numbers.
fn add(a, b) {
return a + b
fn add(@a, accum) {
return a + accum
}
// This function adds an array of numbers.
@ -49,7 +49,7 @@ fn sum(@arr) {
fn sum(arr):
sumSoFar = 0
for i in arr:
sumSoFar = add(sumSoFar, i)
sumSoFar = add(i, sumSoFar)
return sumSoFar */
// We use `assert` to check that our `sum` function gives the
@ -72,8 +72,8 @@ arr = [1, 2, 3]
sum = reduce(
arr,
initial = 0,
f = fn(i, result_so_far) {
return i + result_so_far
f = fn(@i, accum) {
return i + accum
},
)
@ -105,11 +105,11 @@ fn decagon(@radius) {
fullDecagon = reduce(
[1..10],
initial = startOfDecagonSketch,
f = fn(i, partialDecagon) {
f = fn(@i, accum) {
// Draw one edge of the decagon.
x = cos(stepAngle * i) * radius
y = sin(stepAngle * i) * radius
return line(partialDecagon, end = [x, y])
return line(accum, end = [x, y])
},
)

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -133826,14 +133826,14 @@
false
],
[
"r = 10 // radius\n// Call `map`, using an anonymous function instead of a named one.\ncircles = map(\n [1..3],\n f = fn(id) {\n return startSketchOn(XY)\n |> circle(center = [id * 2 * r, 0], radius = r)\n },\n)",
"r = 10 // radius\n// Call `map`, using an anonymous function instead of a named one.\ncircles = map(\n [1..3],\n f = fn(@id) {\n return startSketchOn(XY)\n |> circle(center = [id * 2 * r, 0], radius = r)\n },\n)",
false
]
]
},
{
"name": "patternCircular2d",
"summary": "Repeat a 2-dimensional sketch some number of times along a partial or complete circle some specified number of times. Each object may additionally be rotated along the circle, ensuring orentation of the solid with respect to the center of the circle is maintained.",
"summary": "Repeat a 2-dimensional sketch some number of times along a partial or complete circle some specified number of times. Each object may additionally be rotated along the circle, ensuring orientation of the solid with respect to the center of the circle is maintained.",
"description": "",
"tags": [
"sketch"
@ -145093,7 +145093,7 @@
},
{
"name": "patternCircular3d",
"summary": "Repeat a 3-dimensional solid some number of times along a partial or complete circle some specified number of times. Each object may additionally be rotated along the circle, ensuring orentation of the solid with respect to the center of the circle is maintained.",
"summary": "Repeat a 3-dimensional solid some number of times along a partial or complete circle some specified number of times. Each object may additionally be rotated along the circle, ensuring orientation of the solid with respect to the center of the circle is maintained.",
"description": "",
"tags": [
"solid"
@ -232586,15 +232586,15 @@
"deprecated": false,
"examples": [
[
"// This function adds two numbers.\nfn add(a, b) {\n return a + b\n}\n\n// This function adds an array of numbers.\n// It uses the `reduce` function, to call the `add` function on every\n// element of the `arr` parameter. The starting value is 0.\nfn sum(@arr) {\n return reduce(arr, initial = 0, f = add)\n}\n\n/* The above is basically like this pseudo-code:\nfn sum(arr):\n sumSoFar = 0\n for i in arr:\n sumSoFar = add(sumSoFar, i)\n return sumSoFar */\n\n// We use `assert` to check that our `sum` function gives the\n// expected result. It's good to check your work!\nassert(\n sum([1, 2, 3]),\n isEqualTo = 6,\n tolerance = 0.1,\n error = \"1 + 2 + 3 summed is 6\",\n)",
"// This function adds two numbers.\nfn add(@a, accum) {\n return a + accum\n}\n\n// This function adds an array of numbers.\n// It uses the `reduce` function, to call the `add` function on every\n// element of the `arr` parameter. The starting value is 0.\nfn sum(@arr) {\n return reduce(arr, initial = 0, f = add)\n}\n\n/* The above is basically like this pseudo-code:\nfn sum(arr):\n sumSoFar = 0\n for i in arr:\n sumSoFar = add(i, sumSoFar)\n return sumSoFar */\n\n// We use `assert` to check that our `sum` function gives the\n// expected result. It's good to check your work!\nassert(\n sum([1, 2, 3]),\n isEqualTo = 6,\n tolerance = 0.1,\n error = \"1 + 2 + 3 summed is 6\",\n)",
false
],
[
"// This example works just like the previous example above, but it uses\n// an anonymous `add` function as its parameter, instead of declaring a\n// named function outside.\narr = [1, 2, 3]\nsum = reduce(\n arr,\n initial = 0,\n f = fn(i, result_so_far) {\n return i + result_so_far\n },\n)\n\n// We use `assert` to check that our `sum` function gives the\n// expected result. It's good to check your work!\nassert(\n sum,\n isEqualTo = 6,\n tolerance = 0.1,\n error = \"1 + 2 + 3 summed is 6\",\n)",
"// This example works just like the previous example above, but it uses\n// an anonymous `add` function as its parameter, instead of declaring a\n// named function outside.\narr = [1, 2, 3]\nsum = reduce(\n arr,\n initial = 0,\n f = fn(@i, accum) {\n return i + accum\n },\n)\n\n// We use `assert` to check that our `sum` function gives the\n// expected result. It's good to check your work!\nassert(\n sum,\n isEqualTo = 6,\n tolerance = 0.1,\n error = \"1 + 2 + 3 summed is 6\",\n)",
false
],
[
"// Declare a function that sketches a decagon.\nfn decagon(@radius) {\n // Each side of the decagon is turned this many radians from the previous angle.\n stepAngle = (1 / 10 * TAU): number(rad)\n\n // Start the decagon sketch at this point.\n startOfDecagonSketch = startSketchOn(XY)\n |> startProfile(at = [cos(0) * radius, sin(0) * radius])\n\n // Use a `reduce` to draw the remaining decagon sides.\n // For each number in the array 1..10, run the given function,\n // which takes a partially-sketched decagon and adds one more edge to it.\n fullDecagon = reduce(\n [1..10],\n initial = startOfDecagonSketch,\n f = fn(i, partialDecagon) {\n // Draw one edge of the decagon.\n x = cos(stepAngle * i) * radius\n y = sin(stepAngle * i) * radius\n return line(partialDecagon, end = [x, y])\n },\n )\n\n return fullDecagon\n}\n\n/* The `decagon` above is basically like this pseudo-code:\nfn decagon(radius):\n stepAngle = ((1/10) * TAU): number(rad)\n plane = startSketchOn(XY)\n startOfDecagonSketch = startProfile(plane, at = [(cos(0)*radius), (sin(0) * radius)])\n\n // Here's the reduce part.\n partialDecagon = startOfDecagonSketch\n for i in [1..10]:\n x = cos(stepAngle * i) * radius\n y = sin(stepAngle * i) * radius\n partialDecagon = line(partialDecagon, end = [x, y])\n fullDecagon = partialDecagon // it's now full\n return fullDecagon */\n\n// Use the `decagon` function declared above, to sketch a decagon with radius 5.\ndecagon(5.0)\n |> close()",
"// Declare a function that sketches a decagon.\nfn decagon(@radius) {\n // Each side of the decagon is turned this many radians from the previous angle.\n stepAngle = (1 / 10 * TAU): number(rad)\n\n // Start the decagon sketch at this point.\n startOfDecagonSketch = startSketchOn(XY)\n |> startProfile(at = [cos(0) * radius, sin(0) * radius])\n\n // Use a `reduce` to draw the remaining decagon sides.\n // For each number in the array 1..10, run the given function,\n // which takes a partially-sketched decagon and adds one more edge to it.\n fullDecagon = reduce(\n [1..10],\n initial = startOfDecagonSketch,\n f = fn(@i, accum) {\n // Draw one edge of the decagon.\n x = cos(stepAngle * i) * radius\n y = sin(stepAngle * i) * radius\n return line(accum, end = [x, y])\n },\n )\n\n return fullDecagon\n}\n\n/* The `decagon` above is basically like this pseudo-code:\nfn decagon(radius):\n stepAngle = ((1/10) * TAU): number(rad)\n plane = startSketchOn(XY)\n startOfDecagonSketch = startProfile(plane, at = [(cos(0)*radius), (sin(0) * radius)])\n\n // Here's the reduce part.\n partialDecagon = startOfDecagonSketch\n for i in [1..10]:\n x = cos(stepAngle * i) * radius\n y = sin(stepAngle * i) * radius\n partialDecagon = line(partialDecagon, end = [x, y])\n fullDecagon = partialDecagon // it's now full\n return fullDecagon */\n\n// Use the `decagon` function declared above, to sketch a decagon with radius 5.\ndecagon(5.0)\n |> close()",
false
]
]

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,6 +1,6 @@
---
title: "Axis2d"
subtitle: "Type in types"
subtitle: "Type in std::types"
excerpt: "An infinite line in 2d space."
layout: manual
---

View File

@ -1,6 +1,6 @@
---
title: "Axis3d"
subtitle: "Type in types"
subtitle: "Type in std::types"
excerpt: "An infinite line in 3d space."
layout: manual
---

View File

@ -1,6 +1,6 @@
---
title: "Edge"
subtitle: "Type in types"
subtitle: "Type in std::types"
excerpt: "The edge of a solid."
layout: manual
---

View File

@ -1,6 +1,6 @@
---
title: "Face"
subtitle: "Type in types"
subtitle: "Type in std::types"
excerpt: "A face."
layout: manual
---

View File

@ -1,6 +1,6 @@
---
title: "Helix"
subtitle: "Type in types"
subtitle: "Type in std::types"
excerpt: "A helix."
layout: manual
---

View File

@ -1,6 +1,6 @@
---
title: "Plane"
subtitle: "Type in types"
subtitle: "Type in std::types"
excerpt: "A plane."
layout: manual
---

View File

@ -1,6 +1,6 @@
---
title: "Point2d"
subtitle: "Type in types"
subtitle: "Type in std::types"
excerpt: "A point in two dimensional space."
layout: manual
---

View File

@ -1,6 +1,6 @@
---
title: "Point3d"
subtitle: "Type in types"
subtitle: "Type in std::types"
excerpt: "A point in three dimensional space."
layout: manual
---

View File

@ -1,6 +1,6 @@
---
title: "Sketch"
subtitle: "Type in types"
subtitle: "Type in std::types"
excerpt: "A sketch is a collection of paths."
layout: manual
---

View File

@ -1,6 +1,6 @@
---
title: "Solid"
subtitle: "Type in types"
subtitle: "Type in std::types"
excerpt: "A solid is a collection of extrude surfaces."
layout: manual
---

View File

@ -1,6 +1,6 @@
---
title: "any"
subtitle: "Type in types"
subtitle: "Type in std::types"
excerpt: "Any value."
layout: manual
---

View File

@ -1,6 +1,6 @@
---
title: "bool"
subtitle: "Type in types"
subtitle: "Type in std::types"
excerpt: "A boolean value."
layout: manual
---

View File

@ -1,6 +1,6 @@
---
title: "number"
subtitle: "Type in types"
subtitle: "Type in std::types"
excerpt: "A number"
layout: manual
---
@ -9,7 +9,7 @@ A number
May be signed or unsigned, an integer or decimal value.
You may see a number type with units, e.g., `number(mm)`. These are currently experimental.
You may see a number type with units, e.g., [`number(mm)`](/docs/kcl-std/types/std-types-number). These are currently experimental.

View File

@ -1,6 +1,6 @@
---
title: "string"
subtitle: "Type in types"
subtitle: "Type in std::types"
excerpt: "A sequence of characters"
layout: manual
---

View File

@ -1,6 +1,6 @@
---
title: "tag"
subtitle: "Type in types"
subtitle: "Type in std::types"
excerpt: "Tags are used to give a name (tag) to a specific path."
layout: manual
---

View File

@ -514,9 +514,13 @@ test.describe('Command bar tests', () => {
})
})
test(`Zoom to fit to shared model on web`, async ({ page, scene }) => {
test(
`Zoom to fit to shared model on web`,
{ tag: ['@web'] },
async ({ page, scene }) => {
if (process.env.PLATFORM !== '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 () => {
@ -548,7 +552,8 @@ profile001 = startProfile(sketch001, at = [-484.34, 484.95])
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,

View File

@ -1355,7 +1355,7 @@ sketch001 = startSketchOn(XZ)
const projectLink = page.getByRole('link', { name: 'cube' })
const gizmo = page.locator('[aria-label*=gizmo]')
const resetCameraButton = page.getByRole('button', { name: 'Reset view' })
const locationToHavColor = async (
const locationToHaveColor = async (
position: { x: number; y: number },
color: [number, number, number]
) => {
@ -1374,7 +1374,7 @@ sketch001 = startSketchOn(XZ)
await expect
.poll(
async () =>
locationToHavColor(notTheOrigin, TEST_COLORS.DARK_MODE_PLANE_XZ),
locationToHaveColor(notTheOrigin, TEST_COLORS.DARK_MODE_PLANE_XZ),
{
timeout: 5000,
message: 'XZ plane color is visible',
@ -1397,7 +1397,7 @@ sketch001 = startSketchOn(XZ)
await expect
.poll(
async () =>
locationToHavColor(origin, TEST_COLORS.DARK_MODE_PLANE_XZ),
locationToHaveColor(origin, TEST_COLORS.DARK_MODE_PLANE_XZ),
{
timeout: 3000,
message: 'Plane color should not be visible',
@ -1406,7 +1406,7 @@ sketch001 = startSketchOn(XZ)
.toBeGreaterThan(15)
await expect
.poll(
async () => locationToHavColor(origin, TEST_COLORS.DARK_MODE_BKGD),
async () => locationToHaveColor(origin, TEST_COLORS.DARK_MODE_BKGD),
{
timeout: 3000,
message: 'Background color should not be visible',

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