* Add ability to pick default plane in feature tree in 'Sketch no face' mode
* add ability to select deoffset plane where starting a new sketch
* use selectDefaultSketchPlane
* refactor: remove some duplication
* warning cleanups
* feature tree items selectable depedngin on no face sketch mode
* lint
* fix small jump because of border:none when going into and back from 'No face sketch' mode
* grey out items other than offset planes in 'No face sketch' mode
* start sketching on plane in context menu
* sketch on offset plane with context menu
* add ability to right click on default plane and start sketch on it
* default planes in feature tree should be selectable because of right click context menu
* add right click Start sketch option for selected plane on the canvas
* selectDefaultSketchPlane returns error now
* circular deps
* move select functions to lib/selections.ts to avoid circular deps
* add test for clicking on feature tree after starting a new sketch
* graphite suggestion
* fix bug of not being able to create offset plane using another offset plane with command bar
* add ability to select default plane on feature when going through the Offset plane command bar flow
* fix: logging information about the login
* chore: improving the withBaseURL workflow
* chore: moving VITE_KC_API_BASE_URL to the helper function
* fix: env to helper function api base url
* chore: fixing another api base url
* chore: shortlinks with base api helper function
* chore: prompt edit with base helper function
* fix: auto fmt
* fix: withAPIBaseURL for all urls
* fix: AI caught my typo, RIP
* fix: expected
* fix: renaming this so it is less specific to environment
---------
Co-authored-by: Jace Browning <jacebrowning@gmail.com>
## Goal
Currently, there's no way in KCL to get fields of a plane, e.g. the underlying X axis, Y axis or origin.
This would be useful for geometry calculations in KCL. It would help KCL users write transformations between planes for rotating geometry.
For example, this enables
```kcl
export fn crossProduct(@vectors) {
a = vectors[0]
b = vectors[1]
x = a[1] * b[2] - (a[2] * b[1])
y = a[2] * b[0] - (a[0] * b[2])
z = a[0] * b[1] - (a[1] * b[0])
return [x, y, z]
}
export fn normalOf(@plane) {
return crossProduct([plane.xAxis, plane.yAxis])
}
```
## Implementation
My goal was just to enable a simple getter for planes, like `myPlane.xAxis` and yAxis and origins. That's nearly what happened, except I discovered that there's two ways to represent a plane: either `KclValue::Plane` or `KclValue::Object` with the right fields.
No matter which format your plane is represented as, it should behave consistently when you get its properties. Those properties should be returned as `[number; 3]` because that is how KCL represents points.
Unfortunately we actually require planes-as-objects to be defined with axes like `myPlane = { xAxis = { x = 1, y = 0, z = 0 }, ...}`, but that's a mistake in my opinion. So if you do use that representation of a plane, it should still return a [number; 3]. This required some futzing around so that we let you access object fields .x and .y as [0] and [1], which is weird, but whatever, I think it's good.
This PR is tested via planestuff.kcl which has a Rust unit test.
Part of the hole efforts, see https://github.com/KittyCAD/modeling-app/discussions/7543
* fix: ignoring url checker files
* fix: url checker
* fix: auto fmt and cleanup
* fix: moving the bash scripts and known files into the scripts repo
* fix: removed all url_results and made it be all in memory
* fix: fixed the newline issue
* fix: url checking as a step to the static analysis
* fix: removed old code
* chore: writing documentation on our static checker pattern
* fix: updating the docs more to be clearer
* fix: copy and paste without understanding requirements of ci cd dependencies? do i need all of these?
* fix: updating
* fix: I thought this got in?
* Update CONTRIBUTING.md
Co-authored-by: Jace Browning <jacebrowning@gmail.com>
---------
Co-authored-by: Jace Browning <jacebrowning@gmail.com>
* Add display of units in UI modals with calculated KCL values
* Fix command bar display to handle units
* Add display of units in the command bar
* Fix more cases of NaN from units
* Fix to support explicit plus for exponent in scientific notation
* Fix display in autocomplete
* Change to parseFloat to be more resilient
* Add e2e test for command bar
* Change an existing test to use explicit inline units
* Fix case when input string can't be parsed
* Enterprise plans should not have the upgrade button
Fixes#7627
* Move the check to BillingDialog
* Hide home box and change bool check
* Add component tests
* Clean up
* Allow point-and-click Substract to take in multiple tools
Fixes#7612
* Change target to solids for consistency and make it support multi select too
* Improve err message
* Update src/lang/modifyAst/boolean.ts
Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>
* Update src/lang/modifyAst/boolean.ts
Co-authored-by: Kurt Hutten <k.hutten@protonmail.ch>
* Good bot
* Reduce array to single value if len 1
* Remove console.log
---------
Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>
Co-authored-by: Kurt Hutten <k.hutten@protonmail.ch>
* Make sure mode-related args are hidden in point-and-click commands after option args change
Fixes#7589
* WIP improving helix flows and fixing tests
* Fix 2 more tests
* Add test step for opt arg
* Fix last helix test
* Clean up tests, hope to fix CI
Closes https://github.com/KittyCAD/engine/issues/3494. Thanks to @nadr0 for helping on the JS side.
If users set their units, the grid will stop auto scaling, and instead will be set to 10 of whatever unit they used.
If users set their units, and those units are metric, then it'll include a scale bar (see screenshot). Imperial units won't have that bar.
This behaviour is configurable via settings.
## Limitations
- The scale bar below the grid cannot be disabled in metric units, and cannot be enabled in imperial units
<img width="1690" alt="Screenshot 2025-06-05 at 7 51 41 PM" src="https://github.com/user-attachments/assets/c597087c-f96d-4c30-95f4-b3d8ba2b5567" />
* Enable optional arguments in point-and-click Sweep
Fixes#7578
* Fix bug and add e2e test step
* Fix review not triggering bug and e2e test
* WIP: Enable optional arguments in point-and-click Loft
* Add edit flow for loft
* WIP: e2e test and fix
* Got it
* Got it v2 🤦
* use face edge info for some mirrors
* add functionality for other mirror function
* Fix to create new Sketch when mirror results in a new path
* use the original ids and clone the sketches
* remove mirror param
* clippy fix
* debuggin, rm yarn
* Revert "remove mirror param"
This reverts commit a848e243f8.
* use arrbitrary edge_id as sketch mirror id
* additinoal clenaup
* Update rust/kcl-lib/src/std/mirror.rs
Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>
* set .mirror for continuous case
* fix warning
* works without the for loops
* add error handling
* remove duplicate setter
* rm unused var
* clenaup
* unused import
* remove unused let
* Update snapshots
* Update snapshots
* cleanup
* update sim tests
---------
Co-authored-by: gserena <serena@zoo.dev>
Co-authored-by: Jonathan Tran <jonnytran@gmail.com>
Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
* Add building the artifact graph in mock execution
* Update output
* Add updating the artifact graph after mock execution
* Fix spelling
* Fix to return it all the way
* Fix to not make artifact fields undefined in TS
* WIP: Add bidirectional args to point-and-click Extrude
Will eventually close#7495
* Wire up edit flow for symmetric
* Show skip true args in header in review phase
* Add bidirectionalLength
* Make currentArg always part of header
* WIP
* Add twistAng
* Proper optional args line in review
* Labels in progress button and option arg section heading
* Clean up extrude specific changes
* Clean up to separate from #7506
* Clean up to separate from #7506
* More clean up across branches
* More UI polish
* Remove options bool icon
* Fix labels for tests
* Upgrade e2e tests to cmdBar fixtures with fixes
* More fixes
* Fixed up more tests related to sweep behavior change
* Fix nodeToEdit not having hidden: true on Shell
* Add typecheck
* WIP: footer buttons
* back to reg width
* Clean up
* Update snapshots
* Update snapshots
* Clean up
* Fix tests and remove label
* Refactor
* Fix offset plane test
* Add CommandBarDivider
* Fix step back
* Update snapshots
* Add comment
* Fix it, thanks bot
* Clean up and inline optional heading
* Little case tweak
* Update src/components/CommandBar/CommandBarReview.tsx
Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>
* Rename to CommandBarHeaderFooter
* Rename to CommandBarHeaderFooter
* Clean things up and fix edit
* Add test
* Revert something quick
* Reorg args to match kcl order
* Clean up edit arg retrieval error checks
* Lint
---------
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>
# Background
The KCL interpreter (written in Rust) reports errors, lints and other diagnostics as UTF-8 source range offsets. JavaScript, including CodeMirror, represents source code as UTF-16 strings.
# Problem
This means the UTF-8 source ranges sent from Rust don't correspond to the same text in the JS UTF-16 GUI. At best, this means the source ranges highlight the wrong thing if you use non-ASCII characters. At worst, it can cause exceptions by trying to highlight a range that doesn't even exist.
Here's the problem, on main:
<img width="178" alt="Screenshot 2025-06-20 at 11 52 03 AM" src="https://github.com/user-attachments/assets/9a4e75bf-965f-49d8-b238-8868b35912a1" />
# Solution
We define a KCL SourceRange as _always_ being UTF-8. This means if a source range is constructed in JS, it should be converted to UTF-8. When these ranges are converted into CodeMirror diagnostics, they should be converted to UTF-16.
Here's the same code as above, but on this branch:
<img width="170" alt="Screenshot 2025-06-20 at 11 50 55 AM" src="https://github.com/user-attachments/assets/a5b971c0-0b02-4acd-8fcf-5a133331682b" />
Closes https://github.com/KittyCAD/modeling-app/issues/4327
* WIP: Add bidirectional args to point-and-click Extrude
Will eventually close#7495
* Wire up edit flow for symmetric
* Show skip true args in header in review phase
* Add bidirectionalLength
* Make currentArg always part of header
* WIP
* Add twistAng
* Proper optional args line in review
* Labels in progress button and option arg section heading
* Clean up extrude specific changes
* More UI polish
* Remove options bool icon
* Fix labels for tests
* Upgrade e2e tests to cmdBar fixtures with fixes
* More fixes
* Fixed up more tests related to sweep behavior change
* Fix nodeToEdit not having hidden: true on Shell
* Add typecheck
* WIP: footer buttons
* back to reg width
* Clean up
* Clean up
* Fix tests and remove label
* Refactor
* Fix offset plane test
* Add CommandBarDivider
* Fix step back
* Add comment
* Fix it, thanks bot
* Clean up and inline optional heading
* Little case tweak
* Update src/components/CommandBar/CommandBarReview.tsx
Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>
* Rename to CommandBarHeaderFooter
---------
Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>
* Add the 'Download the app' button back on web
Fixes#7527
* Fix staging release link in desktop app
Fixes#7513
* Update snapshots
* Update snapshots
* Update snapshots
* Add ref parsing logic and unit test
* Oops
---------
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
* Add edit flow to named parameters, show their value in feature tree
* Amend a feature tree test to include editing a parameter
* Enforce disallowing "create new variable" in edit parameter flow
* Add wrapping behavior! Sorry forgot to commit this
* Update src/machines/commandBarMachine.ts
Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>
---------
Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>
Both human and LLMs want to write KCL code in non-English languages. This is important and we should support it.
Note that errors are currently a bit broken with non-ASCII identifiers, see #4327
* Add the 'Download the app' button back on web
Fixes#7527
* Update snapshots
* Update snapshots
---------
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
* move useHotkey for undo/redo into App
* _editorView should be private
* get editorView should be a real get method for consistency
* resolve tsc errors
* fmt
* setView, setState are not exposed
* make undo work without editorview when kcl pane is closed
* lint
* circular deps
* resolve circular deps
* fix undo being 1 step late
* unrelated console.warn removed
* fix undo when code pane is closed during editing
* cleanup
* allow undo to get beyond when code editor has been mounted
* fix up clearHistory
* add test for testing Undo with closed code pane
* 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>
* 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
* 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>
* 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>
* 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
@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.
* 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>
* 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>
* Improve docs around PI
Signed-off-by: Nick Cameron <nrc@ncameron.org>
* Refactor and polish type error messages
Signed-off-by: Nick Cameron <nrc@ncameron.org>
* Add suggestion to fix unknown numbers error
Signed-off-by: Nick Cameron <nrc@ncameron.org>
* Don't warn so often about unknown units
Signed-off-by: Nick Cameron <nrc@ncameron.org>
---------
Signed-off-by: Nick Cameron <nrc@ncameron.org>
* Add degrees annotations to examples
Signed-off-by: Nick Cameron <nrc@ncameron.org>
* Fix a units bug with the modulo operation
Signed-off-by: Nick Cameron <nrc@ncameron.org>
---------
Signed-off-by: Nick Cameron <nrc@ncameron.org>
* pierremtb/adhoc-quick-sharelink-follow-up
* Update snapshots
* Update snapshots
* Remove Linux from 2000 tests
* Revert "Remove Linux from 2000 tests"
This reverts commit ad9bc58dd7.
* Remove Linux from 2000 tests and guard linux in the app too
* Revert "Remove Linux from 2000 tests and guard linux in the app too"
This reverts commit e13983eb12.
* Break out test in two
* Not
* Add debug prints
* Try to force userAgent in pw config
* Revert "Try to force userAgent in pw config"
This reverts commit d1e6d7c7be.
* Clean up
* Add sad fix
---------
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
* Change so that operations are stored per module
* Refactor so that all modeling commands go through ExecState
* Remove unneeded PartialOrd implementations
* Remove artifact_commands from KclError since it was only for debugging
---------
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
* desktop app should remember the last window size
* localStorage doesnt work in electron, use a settings file
* save bounds (position too)
* only restore saved bounds if its still valid for current displays
* typo
* remove logs
* cleanup
* typo
* add version to LastWindowConfig
* rename window_config.json to device_state.json
* Rename nightly to staging and have it point to dev infra
Fixes#7421
* To revert: force IS_STAGING
* chmod +x ./scripts/flip-files-to-staging.sh
* Fix mix up dev and prod
* Revert "To revert: force IS_STAGING"
This reverts commit 0178604a55.
* WIP: Use namespace windows-2-cores for build-apps
* WIP: 8-cores to see if it's different
* WIP: macos-6-cores and windows-4-cores
* To revert: test IS_RELEASE
* Change d drive to c for cert
* Maintain job naming
* Revert "To revert: test IS_RELEASE"
This reverts commit 5d4eadce6c.
* Change job names
* Add HammerJS
* Fmt and little type cleanup
* Implement multi-touch through HammerJS
* Add velocity-decay "flick" behavior for orbit
* Update src/clientSideScene/CameraControls.ts
Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>
* tsc fix
* Update src/clientSideScene/CameraControls.ts
Co-authored-by: Kurt Hutten <k.hutten@protonmail.ch>
* Release KCL 80 (#7391)
* Check for updates button in moar menus & toasts (#7369)
* Check for update button in more menus
Fixes#7368
* Add menubar item
* Another one
* Add Checking for updates... and No new update toasts
* Lint
* Trigger CI
* Update src/main.ts
Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>
* Update electron-builder.yml
Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>
* Update electron-builder.yml
* Moar clean up
---------
Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>
* Format examples in docs (#7378)
Signed-off-by: Nick Cameron <nrc@ncameron.org>
* Fix some typos in previous PR (#7392)
Signed-off-by: Nick Cameron <nrc@ncameron.org>
* Remove the untyped getters from std::args (#7377)
* Move last uses of untypeed arg getters
Signed-off-by: Nick Cameron <nrc@ncameron.org>
* Rename _typed functions
Signed-off-by: Nick Cameron <nrc@ncameron.org>
---------
Signed-off-by: Nick Cameron <nrc@ncameron.org>
* WIP #7226 Fix remove constraints (#7304)
* handle if graphSelections is empty
* fix removeConstrainingValuesInfo by using pathToNodes if available instead of selectionRanges: current selection should not be required to remove constraints
* selectionRanges not needed for removeConstrainingValuesInfo anymore
* fix remove constraint unit test: pass line's pathToNode instead of argument to remove constraint
* Change to use artifact pathToNode (#7361)
* Change to use artifact pathToNode
* Fix to do bounds checking
* move TTC capture to unit test (#7268)
* move TTC capture to unit test
* progress with artifact
* fmt
* abstract cases
* add another case
* add another test
* update snapshots with proper file names
* force to JSON
* fmt
* make jest happy
* add another example and other tweaks
* fix
* tweak
* add logs
* more logs
* strip out kcl version
* remove logs
* add comment explainer
* more comments
* more comment
* remove package-lock line
* Add support for tag on close segment when the last sketch edge is missing (#7375)
* add test
* fix
* Update snapshots
* Update snapshots
---------
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
* Use namespace for windows e2e tests (#7398)
* Use namespace for windows e2e tests
* Change to the new profile
* Remove TODO
* Commit new snapshots even if some tests failed (#7399)
* Commit new snapshots even if some tests failed
* Update snapshots
---------
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
* Clean up share link tests (#7372)
* pierremtb/adhoc/clean-up-share-link-tests
* Lint
* WIP labels
* Trigger CI
* Change to skips
* Remove old docs files (#7381)
* Remove old files; no longer generated.
* 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>
* #7199 Fix broken links in docs (#7397)
* update broken links
* update github discussion links, fmt
* update comment
---------
Co-authored-by: Jace Browning <jacebrowning@gmail.com>
* Inline engine issue from @Irev-Dev
* Add commented-out test to be implemented later https://github.com/KittyCAD/modeling-app/issues/7403
* Update e2e/playwright/test-utils.ts
Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>
---------
Signed-off-by: Nick Cameron <nrc@ncameron.org>
Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>
Co-authored-by: Kurt Hutten <k.hutten@protonmail.ch>
Co-authored-by: Jonathan Tran <jonnytran@gmail.com>
Co-authored-by: Pierre Jacquier <pierrejacquier39@gmail.com>
Co-authored-by: Nick Cameron <nrc@ncameron.org>
Co-authored-by: Andrew Varga <grizzly33@gmail.com>
Co-authored-by: max <margorskyi@gmail.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Jace Browning <jacebrowning@gmail.com>
Co-authored-by: Nick McCleery <34814836+nickmccleery@users.noreply.github.com>
* fix edge case of sketch not being exited out of properly
* Update e2e/playwright/sketch-tests.spec.ts
Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>
---------
Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>
Co-authored-by: Jace Browning <jacebrowning@gmail.com>
* Commit new snapshots even if some tests failed
* Update snapshots
---------
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
@ -65,7 +65,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 `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_KITTYCAD_API_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
@ -96,7 +96,7 @@ To package the app for your platform with electron-builder, run `npm run tronb:p
Prepare these system dependencies:
- Set $token from https://zoo.dev/account/api-tokens
- Set `$VITE_KITTYCAD_API_TOKEN` from https://zoo.dev/account/api-tokens
#### Snapshot tests (Google Chrome on Ubuntu only)
@ -235,6 +235,47 @@ To display logging (to the terminal or console) set `ZOO_LOG=1`. This will log s
To enable memory metrics, build with `--features dhat-heap`.
## Running scripts
There are multiple scripts under the folder path `./scripts` which can be used in various settings.
### Pattern for a static file, npm run commands, and CI-CD checks
If you want to implement a static checker follow this pattern. Two static checkers we have are circular dependency checks in our typescript code and url checker to see if any hard coded URL is the typescript application 404s. We have a set of known files in `./scripts/known/*.txt` which is the baseline.
If you improve the baseline, run the overwrite command and commit the new smaller baseline. Try not to make the baseline bigger, the CI CD will complain.
These baselines are to hold us to higher standards and help implement automated testing against the repository
#### Output result to stdout
-`npm run circular-deps`
-`npm run url-checker`
- create a `<name>.sh` file that will run the static checker then output the result to `stdout`
#### Overwrite result to known .txt file on disk
If the application needs to overwrite the known file on disk use this pattern. This known .txt file will be source controlled as the baseline
-`npm run circular-deps:overwrite`
-`npm run url-checker:overwrite`
#### Diff baseline and current
These commands will write a /tmp/ file on disk and compare it to the known file in the repository. This command will also be used in the CI CD pipeline for automated checks
- create a `diff-<name>.sh` file that is the script to diff your tmp file to the baseline
@ -270,33 +312,18 @@ 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.
Assign someone to each section of the manual checklist generated by the issue template.
#### 4. Bump the KCL version
Follow the instructions [here](./rust/README.md) to publish new crates.
This ensures that the KCL accepted by the app is also accepted by the CLI.
If there are documentation changes, merge the corresponding Dependabot PRs [here](https://github.com/KittyCAD/website/pulls/app%2Fdependabot) for the website.
You can trigger Dependabot to check for updates [here](https://github.com/KittyCAD/website/network/updates/17261214/jobs).
#### 5. Publish the release
Head over to https://github.com/KittyCAD/modeling-app/releases/new, pick the newly created tag and type it in the **Release title** field as well.
@ -46,3 +46,7 @@ KCL has no support for area, volume, or other higher dimension units. When inter
## Explicit conversions
You might sometimes need to convert from one unit to another for some calculation. You can do this implicitly when calling a function (see above), but if you can't or don't want to, then you can use the explicit conversion functions in the [`std::units`](/docs/kcl-std/modules/std-units) module.
KCL cannot know about changes to units caused by arithmetic. For example, you may intend for `10in * 25.4` to be the value `254mm` (i.e., `10in` in mm), however, the result of that computation in KCL is `254in`. It is always better to rely on automatic conversion or to use the explicit conversion functions, where possible.
Converting between degrees and radians using π ([`PI`](/docs/kcl-std/consts/std-math-PI) in KCL) is especially prone to this error and so the `PI` constant always requires specifying units of any computation it is used with. E.g., `radius = (circumference / (2 * PI)): number(mm)`.
@ -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.
@ -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
@ -85,6 +83,13 @@ Allow orbiting in sketch mode.
Whether to show the debug panel, which lets you see various states of the app to aid in development.
**Default:** None
##### fixed_size_grid
If true, the grid cells will be fixed-size, where the width is your default length unit. If false, the grid will get larger as you zoom out, and smaller as you zoom in.
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`.
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`.
| `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 |
@ -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
@ -53,7 +53,7 @@ for to construct your shape, you're likely looking for tangentialArc.
@ -10,11 +10,13 @@ Extend the current sketch with a new involute circular curve.
```kcl
involuteCircular(
@sketch: Sketch,
startRadius: number(Length),
endRadius: number(Length),
angle: number(Angle),
startRadius?: number(Length),
endRadius?: number(Length),
startDiameter?: number(Length),
endDiameter?: number(Length),
reverse?: bool,
tag?: tag,
tag?: TagDecl,
): Sketch
```
@ -25,11 +27,13 @@ involuteCircular(
| Name | Type | Description | Required |
|----------|------|-------------|----------|
| `sketch` | [`Sketch`](/docs/kcl-std/types/std-types-Sketch) | Which sketch should this path be added to? | Yes |
| `startRadius` | [`number(Length)`](/docs/kcl-std/types/std-types-number) | The involute is described between two circles, start_radius is the radius of the inner circle. | Yes |
| `endRadius` | [`number(Length)`](/docs/kcl-std/types/std-types-number) | The involute is described between two circles, end_radius is the radius of the outer circle. | Yes |
| `angle` | [`number(Angle)`](/docs/kcl-std/types/std-types-number) | The angle to rotate the involute by. A value of zero will produce a curve with a tangent along the x-axis at the start point of the curve. | Yes |
| `startRadius` | [`number(Length)`](/docs/kcl-std/types/std-types-number) | The involute is described between two circles, startRadius is the radius of the inner circle. Either `startRadius` or `startDiameter` must be given (but not both). | No |
| `endRadius` | [`number(Length)`](/docs/kcl-std/types/std-types-number) | The involute is described between two circles, endRadius is the radius of the outer circle. Either `endRadius` or `endDiameter` must be given (but not both). | No |
| `startDiameter` | [`number(Length)`](/docs/kcl-std/types/std-types-number) | The involute is described between two circles, startDiameter describes the inner circle. Either `startRadius` or `startDiameter` must be given (but not both). | No |
| `endDiameter` | [`number(Length)`](/docs/kcl-std/types/std-types-number) | The involute is described between two circles, endDiameter describes the outer circle. Either `endRadius` or `endDiameter` must be given (but not both). | No |
| `reverse` | [`bool`](/docs/kcl-std/types/std-types-bool) | If reverse is true, the segment will start from the end of the involute, otherwise it will start from that start. | No |
| [`tag`](/docs/kcl-std/types/std-types-tag) | [`tag`](/docs/kcl-std/types/std-types-tag) | Create a new tag which refers to this line. | No |
| `tag` | [`TagDecl`](/docs/kcl-std/types/std-types-TagDecl) | Create a new tag which refers to this line. | No |
### Returns
@ -43,11 +47,11 @@ a = 10
b = 14
startSketchOn(XZ)
|> startProfile(at = [0, 0])
|> involuteCircular(startRadius = a, endRadius = b, angle = 60)
|> involuteCircular(startRadius = a, endRadius = b, angle = 60deg)
| `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 |
| `sketches` | [`[Sketch; 1+]`](/docs/kcl-std/types/std-types-Sketch) | The sketch or set of sketches that should be revolved | Yes |
| `axis` | [`Axis2d`](/docs/kcl-std/types/std-types-Axis2d) or [`Edge`](/docs/kcl-std/types/std-types-Edge) | Axis of revolution. | Yes |
| `angle` | [`number(Angle)`](/docs/kcl-std/types/std-types-number) | Angle to revolve (in degrees). Default is 360. | No |
| `tolerance` | [`number(Length)`](/docs/kcl-std/types/std-types-number) | Tolerance for the revolve operation. | No |
| `tolerance` | [`number(Length)`](/docs/kcl-std/types/std-types-number) | Defines the smallest distance below which two entities are considered coincident, intersecting, coplanar, or similar. For most use cases, it should not be changed from its default value of 10^-7 millimeters. | No |
| `symmetric` | [`bool`](/docs/kcl-std/types/std-types-bool) | If true, the extrusion will happen symmetrically around the sketch. Otherwise, the extrusion will happen on only one side of the sketch. | No |
| `bidirectionalAngle` | [`number(Angle)`](/docs/kcl-std/types/std-types-number) | If specified, will also revolve in the opposite direction to 'angle' to the specified angle. If 'symmetric' is true, this value is ignored. | No |
| `tagStart` | [`tag`](/docs/kcl-std/types/std-types-tag) | A named tag for the face at the start of the revolve, i.e. the original sketch. | No |
| `tagEnd` | [`tag`](/docs/kcl-std/types/std-types-tag) | A named tag for the face at the end of the revolve. | No |
| `tagStart` | [`TagDecl`](/docs/kcl-std/types/std-types-TagDecl) | A named tag for the face at the start of the revolve, i.e. the original sketch. | No |
| `tagEnd` | [`TagDecl`](/docs/kcl-std/types/std-types-TagDecl) | A named tag for the face at the end of the revolve. | No |
@ -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 |
@ -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 |
@ -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
@ -47,7 +47,7 @@ for 'angle' degrees along the imaginary circle.
```kcl
exampleSketch = startSketchOn(XZ)
|> startProfile(at = [0, 0])
|> angledLine(angle = 45, length = 10)
|> angledLine(angle = 45deg, length = 10)
|> tangentialArc(end = [0, -10])
|> line(end = [-10, 0])
|> close()
@ -61,7 +61,7 @@ example = extrude(exampleSketch, length = 10)
```kcl
exampleSketch = startSketchOn(XZ)
|> startProfile(at = [0, 0])
|> angledLine(angle = 60, length = 10)
|> angledLine(angle = 60deg, length = 10)
|> tangentialArc(endAbsolute = [15, 15])
|> line(end = [10, -15])
|> close()
@ -75,9 +75,9 @@ example = extrude(exampleSketch, length = 10)
| `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 |
| `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 |
@ -28,8 +28,8 @@ will smoothly blend the transition.
| `solid` | [`Solid`](/docs/kcl-std/types/std-types-Solid) | The solid whose edges should be filletted | Yes |
| `radius` | [`number(Length)`](/docs/kcl-std/types/std-types-number) | The radius of the fillet | Yes |
| `tags` | [`[Edge; 1+]`](/docs/kcl-std/types/std-types-Edge) | The paths you want to fillet | Yes |
| `tolerance` | [`number(Length)`](/docs/kcl-std/types/std-types-number) | The tolerance for this fillet | No |
| [`tag`](/docs/kcl-std/types/std-types-tag) | [`tag`](/docs/kcl-std/types/std-types-tag) | Create a new tag which refers to this fillet | No |
| `tolerance` | [`number(Length)`](/docs/kcl-std/types/std-types-number) | Defines the smallest distance below which two entities are considered coincident, intersecting, coplanar, or similar. For most use cases, it should not be changed from its default value of 10^-7 millimeters. | No |
| `tag` | [`TagDecl`](/docs/kcl-std/types/std-types-TagDecl) | Create a new tag which refers to this fillet | No |
@ -24,7 +24,7 @@ verifying fit, and analyzing overlapping geometries in assemblies.
| Name | Type | Description | Required |
|----------|------|-------------|----------|
| `solids` | `[Solid; 2+]` | The solids to intersect. | Yes |
| `tolerance` | [`number(Length)`](/docs/kcl-std/types/std-types-number) | The tolerance to use for the intersection operation. | No |
| `tolerance` | [`number(Length)`](/docs/kcl-std/types/std-types-number) | Defines the smallest distance below which two entities are considered coincident, intersecting, coplanar, or similar. For most use cases, it should not be changed from its default value of 10^-7 millimeters. | No |
@ -27,7 +27,7 @@ and complex multi-body part modeling.
|----------|------|-------------|----------|
| `solids` | [`[Solid; 1+]`](/docs/kcl-std/types/std-types-Solid) | The solids to use as the base to subtract from. | Yes |
| `tools` | [`[Solid]`](/docs/kcl-std/types/std-types-Solid) | The solids to subtract. | Yes |
| `tolerance` | [`number(Length)`](/docs/kcl-std/types/std-types-number) | The tolerance to use for the subtraction operation. | No |
| `tolerance` | [`number(Length)`](/docs/kcl-std/types/std-types-number) | Defines the smallest distance below which two entities are considered coincident, intersecting, coplanar, or similar. For most use cases, it should not be changed from its default value of 10^-7 millimeters. | No |
| `solids` | `[Solid; 2+]` | The solids to union. | Yes |
| `tolerance` | [`number(Length)`](/docs/kcl-std/types/std-types-number) | The tolerance to use for the union operation. | No |
| `tolerance` | [`number(Length)`](/docs/kcl-std/types/std-types-number) | Defines the smallest distance below which two entities are considered coincident, intersecting, coplanar, or similar. For most use cases, it should not be changed from its default value of 10^-7 millimeters. | No |
### Returns
Some files were not shown because too many files have changed in this diff
Show More
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.