Releases: KittyCAD/modeling-app
v0.41.0
Changed
- Breaking: KCL now uses keyword arguments for
line
,lineTo
,extrude
, andclose
.
See the instructions below to migrate existing models.
Why are we doing this?
Because it'll let us evolve the KCL standard library, adding new options to functions without breaking existing code. We don't want to have a painful annual release process where you upgrade all your KCL code from 1.1 to 1.2 and a bunch of things break. In the future, if we want to add a new option, it'll be added as a new optional keyword argument. For example, we will probably let you pass adiameter
to build a circle, instead of aradius
. You can then use whichever keyword you want (and it'll give you an error if you use both, or neither).This also helps us integrate a constraint solver in the future -- you'll be able to pass fewer keyword arguments, and the constraint solver will fill in the missing values for you 🙂 Eventually.
What is changing?
The first few functions we're changing areline
,lineTo
,extrude
andclose
. Here's a before-and-after example:
line([3, 4], mySketch, $myTag)
becomes
line(mySketch, end = [3, 4], tag = $myTag)
Note that the first argument doesn't need a label. Keyword functions may declare at most one argument that doesn't need a label. If used, this has to be the first argument.
Also, if you use an unlabeled argument in a
|>
you can omit the argument, and it'll be implicitly set to%
. This means%
isn't needed most of the time anymore.Example
box = startSketchOn("XZ") |> startProfileAt([10, 10], %) |> line([10, 0], %) |> line([0, 10], %) |> line([-10, 0], %, $thirdLineOfBox) |> close(%) |> extrude(5, %)
becomes
box = startSketchOn("XZ") |> startProfileAt([10, 10], %) |> line(end = [10, 0]) |> line(end = [0, 10]) |> line(end = [-10, 0], tag = $thirdLineOfBox) |> close() |> extrude(length = 5)
Migration
Here is a list of regexes you can use to find-and-replace your old KCL code with the new keyword argument code. You can run this in ZMA's find-and-replace (ctrl+F or cmd+F in the KCL code panel), or in VSCode's global find-and-replace (so you can fix up all your files at once). Note this won't trigger for any multi-line function calls (where you separate each argument with a newline). For those you'll have to fix it up manually, sorry!\bline\(([^=]*), %\) line(end = $1) \bline\((.*), %, (.*)\) line(end = $1, tag = $2) \blineTo\((.*), %\) line(endAbsolute = $1) \blineTo\((.*), %, (.*)\) line(endAbsolute = $1, tag = $2) \bextrude\((.*), %\) extrude(length = $1) \bextrude\(([^=]*), ([a-zA-Z0-9]+)\) extrude($2, length = $1) close\(%, (.*)\) close(tag = $1) close\(%\) close()
Added
- Point-and-click Sweep and Revolve
- Project thumbnails on the home page
- Trackball camera setting
- File tree now lets you duplicate files
- Dedicated section for construction commands in the toolbar
Fixed
- Highlighted code in the editor is now easier to read in dark mode
- Artifact graph now survives when there's an execution error
Full Changelog: v0.40.0...v0.41.0
v0.40.0
Added
- Reason for dry-run validation failure provided in error toasts (Shell and Loft commands)
Fixed
- Units in samples after the removal of
project.toml
Full Changelog: v0.39.0...v0.40.0
v0.39.0
Added
- Per-file units, use
@settings(defaultLengthUnit = in)
at the top of your files!
Fixed
- Clearing sketch DOM elements after redirecting to the home page
- Center rectangle now works again, works with new LiteralValue structure
- Open project command lists project names
- Imports in projects with subdirectories
Deprecated
- Deprecate
import("file.obj")
. Useimport "file.obj"
instead.
Full Changelog: v0.38.0...v0.39.0
v0.38.0
Changed
- Tweaks to clarify tooltips from tool dropdown menus
Fixed
- "No results found" now shown for empty search results in command palette
- Badge indicator now placed over the respective button in the sidebar
- Properly setting selection range when KCL editor is not mounted
- Extra margins removed on some code editor menu items
- Scene units now set on a module's default units
Full Changelog: v0.37.0...v0.38.0
v0.37.0
Changed
- Uniqueness check to "Create project" command, and more consistent naming across the app
Added
- Return key to go through Onboarding steps
- 3-point circle interactive sketch tool
- Orbit in sketch mode via user setting
- Selection dry-run validation for Shell
Fixed
- Show toolbar tooltips on hover only, hide when dropdowns are open
- Loft command prompt focus
Full Changelog: v0.36.1...v0.37.0
v0.36.1
v0.36.0
Added
- KCL stdlib function to pop from arrays by @guptaarnav
- Code editor autocomplete shows when a KCL stdlib function is deprecated
- Point-and-click deletion (Backspace or Delete) of lofts, shells, and offset planes
- KCL helixes are now available (no point-and-click yet)
Fixed
- Open updater toast changelog links externally by @marc2332
- Refactor: removed unused
UpdaterModal
component by @marc2332 - Error for missing a closing bracket clearer
- Show the stream while the scene builds, relevant for large files
- More testing for foreign characters in project name
- Wasm panic catching errors and restoring application state and WebAssembly instance
- Shell point-and-click picking the wrong face with piped extrudes
New Contributors
Full Changelog: v0.35.0...v0.36.0
v0.35.0
Added
- Toolbar button for Text-to-CAD
- Prompt-to-edit and its toolbar button
- 3-point circle sketch tool and KCL stdlib function
- First draft of a feature tree pane
- KCL: support for non-integer fractional numbers in KCL rem() arguments
- Enable enter for autocompletions in the command palette KCL input
- Add parsing keyword function calls inside pipelines
Changed
- Breaking: Remove backwards compatibility for snake case in KCL objects
Fixed
- Don't error on failure to fetch privacy settings to fix LSP in dev mode by @TomPridham (thank you!)
- Match package license to LICENSE file by @mattmundell (thank you!)
- CodeMirror KCL: Support
=
in record init and new function syntax by @mattmundell (thank you!) - Remove the old Loft GitHub issue link in the toolbar
- Use app foreground color for focus outline button color so there's no hue collision
Full Changelog: v0.34.0...v0.35.0
v0.34.0
Added
- Under the hood: Basic program generation for improved caching
Fixed
- Issue with the code editor getting stuck on a sample part for some macOS users on v0.33.0
Full Changelog: v0.33.0...v0.34.0
v0.33.0
Changed
- KCL: completions to use new
=
syntax for object arguments instead of old:
- KCL: stdlib function
startSketchAt()
now deprecated, withstartSketchOn()
remaining the preferred option - KCL: unlabeled first parameter now defaults to
%
Added
- KCL: completion supported from import statements
- KCL: Implemented boolean logical and/or, thanks @guptaarnav!
- Dry-run validation for Loft
- Double click label on sketch to dimension
Full Changelog: v0.32.0...v0.33.0