0f0fc39d07
Add display of array element types in error messages ( #7113 )
...
* Add test showing unhelpful error message
* Add display of array element types in error messages
* Change to prose description
* Update output
2025-05-20 20:50:24 -04:00
4212b95232
Add KCL importing relative to where you're importing from ( #7125 )
...
* add test
Signed-off-by: Jess Frazelle <github@jessfraz.com >
* Add importing relative to where you're importing from
* Update output
* Remove runtime panics
* Change to debug_assert
---------
Signed-off-by: Jess Frazelle <github@jessfraz.com >
Co-authored-by: Jess Frazelle <github@jessfraz.com >
2025-05-21 00:47:32 +00:00
815ff7dc2b
more subtract regression tests ( #7123 )
...
* more regression tests
Signed-off-by: Jess Frazelle <github@jessfraz.com >
* snaps
Signed-off-by: Jess Frazelle <github@jessfraz.com >
* iupdates
Signed-off-by: Jess Frazelle <github@jessfraz.com >
---------
Signed-off-by: Jess Frazelle <github@jessfraz.com >
2025-05-20 16:02:44 -07:00
c7baa26b2d
idiomatic kcl for hip sample ( #7095 )
...
* idiomatic kcl for hip sample
* Update kcl-samples simulation test output
* updates
Signed-off-by: Jess Frazelle <github@jessfraz.com >
---------
Signed-off-by: Jess Frazelle <github@jessfraz.com >
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Jess Frazelle <github@jessfraz.com >
2025-05-20 11:36:08 -07:00
c5cd460595
Show error when trying to export at non-top-level ( #7110 )
2025-05-20 12:43:11 -04:00
511334683a
test: Add regression test for importing only at the top level ( #7104 )
...
Add regression test for importing only at the top level
2025-05-20 11:43:48 -04:00
651181e62c
Restrict subdirectory imports to main.kcl ( #7094 )
...
Signed-off-by: Nick Cameron <nrc@ncameron.org >
2025-05-20 18:13:17 +12:00
38a245f2fc
fix typos in the kcl samples ( #7078 )
...
typos
2025-05-20 05:47:33 +00:00
1b4289f93f
allow nested files imported ( #7090 )
...
* allow nested files
Signed-off-by: Jess Frazelle <github@jessfraz.com >
* fix test
Signed-off-by: Jess Frazelle <github@jessfraz.com >
* disallow bad things
Signed-off-by: Jess Frazelle <github@jessfraz.com >
* add playwright test on windows
Signed-off-by: Jess Frazelle <github@jessfraz.com >
* add playwright test on windows
Signed-off-by: Jess Frazelle <github@jessfraz.com >
* fixes
Signed-off-by: Jess Frazelle <github@jessfraz.com >
* updates
Signed-off-by: Jess Frazelle <github@jessfraz.com >
* updates
Signed-off-by: Jess Frazelle <github@jessfraz.com >
* fix test
Signed-off-by: Jess Frazelle <github@jessfraz.com >
* Update rust/kcl-lib/tests/nested_windows_main_kcl/unparsed@main.kcl.snap
Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>
* updates
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 >
Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>
2025-05-19 22:42:25 -04:00
d0697c24fd
Change Sketch to use the units of the module ( #7076 )
...
* Change Sketch to use the units of the module
* Update output
2025-05-19 20:20:47 -04:00
553e650fbe
Add brake disc to samples. ( #7059 )
...
* Add brake disc.
* Update kcl-samples simulation test output
* Update public/kcl-samples/brake-rotor/main.kcl
Co-authored-by: Adam Chalmers <adam.chalmers@zoo.dev >
* Update public/kcl-samples/brake-rotor/main.kcl
Co-authored-by: Adam Chalmers <adam.chalmers@zoo.dev >
* updates
Signed-off-by: Jess Frazelle <github@jessfraz.com >
---------
Signed-off-by: Jess Frazelle <github@jessfraz.com >
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Adam Chalmers <adam.chalmers@zoo.dev >
Co-authored-by: Jess Frazelle <jessfraz@users.noreply.github.com >
Co-authored-by: Jess Frazelle <github@jessfraz.com >
2025-05-19 15:24:37 -07:00
978d5d44a2
rotate a named axis ( #7087 )
...
updates
Signed-off-by: Jess Frazelle <github@jessfraz.com >
2025-05-19 22:11:35 +00:00
9df476543a
turn on the revolve test ( #7075 )
...
* turn on the revolve test
Signed-off-by: Jess Frazelle <github@jessfraz.com >
* updates
Signed-off-by: Jess Frazelle <github@jessfraz.com >
* updates
Signed-off-by: Jess Frazelle <github@jessfraz.com >
* updates
Signed-off-by: Jess Frazelle <github@jessfraz.com >
* updates
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-19 14:51:44 -07:00
cf303ebe97
Declare pattern transform functions in KCL ( #7057 )
...
* Declare pattern transform using KCL
Signed-off-by: Nick Cameron <nrc@ncameron.org >
* Boolean function param defaults
Signed-off-by: Nick Cameron <nrc@ncameron.org >
* Parse empty record types in fn types
Signed-off-by: Nick Cameron <nrc@ncameron.org >
---------
Signed-off-by: Nick Cameron <nrc@ncameron.org >
2025-05-20 08:25:29 +12:00
b19acd550d
Type check and coerce arguments to user functions and return values from std Rust functions ( #6958 )
...
* Shuffle around function call code
Signed-off-by: Nick Cameron <nrc@ncameron.org >
* Refactor function calls to share more code
Signed-off-by: Nick Cameron <nrc@ncameron.org >
* Hack to leave the result of revolve as a singleton rather than array
Signed-off-by: Nick Cameron <nrc@ncameron.org >
---------
Signed-off-by: Nick Cameron <nrc@ncameron.org >
2025-05-19 16:50:15 +12:00
658497da1d
Allow same syntax for patterns as mirror revolve ( #7054 )
...
* allow named axis for patterns
Signed-off-by: Jess Frazelle <github@jessfraz.com >
* docs
Signed-off-by: Jess Frazelle <github@jessfraz.com >
* images
Signed-off-by: Jess Frazelle <github@jessfraz.com >
* Fix typo
Co-authored-by: Jonathan Tran <jonnytran@gmail.com >
---------
Signed-off-by: Jess Frazelle <github@jessfraz.com >
Co-authored-by: Adam Chalmers <adam.chalmers@zoo.dev >
Co-authored-by: Jonathan Tran <jonnytran@gmail.com >
2025-05-19 02:25:35 +00:00
bd01059a92
more csg regression tests ( #7032 )
...
* more csg regression tests
Signed-off-by: Jess Frazelle <github@jessfraz.com >
* artifacts
Signed-off-by: Jess Frazelle <github@jessfraz.com >
---------
Signed-off-by: Jess Frazelle <github@jessfraz.com >
2025-05-18 16:50:51 -07:00
3168c22de7
Remove false positive missing messages for other module SourceRanges ( #7050 )
2025-05-18 06:21:10 -04:00
b0a41939e8
Max's KCL samples ( #7041 )
...
* 3d models
* Update kcl-samples simulation test output
* typos
* Update kcl-samples simulation test output
---------
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2025-05-17 11:16:22 -04:00
416de9a9fb
allow more than one tool ( #6945 )
...
* allow more than one tool
Signed-off-by: Jess Frazelle <github@jessfraz.com >
* updates
Signed-off-by: Jess Frazelle <github@jessfraz.com >
* updates
Signed-off-by: Jess Frazelle <github@jessfraz.com >
* updates
Signed-off-by: Jess Frazelle <github@jessfraz.com >
* update tests
Signed-off-by: Jess Frazelle <github@jessfraz.com >
* fmt
Signed-off-by: Jess Frazelle <github@jessfraz.com >
* bump kcl
Signed-off-by: Jess Frazelle <github@jessfraz.com >
---------
Signed-off-by: Jess Frazelle <github@jessfraz.com >
2025-05-16 23:22:50 +00:00
e7d2289a14
Revolve adjacency info ( #7008 )
...
* check edge colinear
* cleanup
* revert cargo.toml
* revert cargo.toml properly
* undo yarn.lock
* clippy
* add new sim test
* move tolerance2
* typo
Signed-off-by: Jess Frazelle <github@jessfraz.com >
* fmt
Signed-off-by: Jess Frazelle <github@jessfraz.com >
* update snap
Signed-off-by: Jess Frazelle <github@jessfraz.com >
* push real snap
Signed-off-by: Jess Frazelle <github@jessfraz.com >
* update tests
Signed-off-by: Jess Frazelle <github@jessfraz.com >
---------
Signed-off-by: Jess Frazelle <github@jessfraz.com >
Co-authored-by: Jess Frazelle <jessfraz@users.noreply.github.com >
Co-authored-by: Jess Frazelle <github@jessfraz.com >
2025-05-16 22:02:30 +00:00
729e0a7949
add a subtract regression test ( #7018 )
...
* add a subtraact regression test
Signed-off-by: Jess Frazelle <github@jessfraz.com >
* also rename some github actions job so we can require them;
Signed-off-by: Jess Frazelle <github@jessfraz.com >
* artifacts
Signed-off-by: Jess Frazelle <github@jessfraz.com >
---------
Signed-off-by: Jess Frazelle <github@jessfraz.com >
2025-05-16 20:06:56 +00:00
a280a8c3f0
Nickmccleery/i have no idea what im doing ( #6967 )
...
* Yeet in alt param structure.
* updates
Signed-off-by: Jess Frazelle <github@jessfraz.com >
---------
Signed-off-by: Jess Frazelle <github@jessfraz.com >
Co-authored-by: Jess Frazelle <github@jessfraz.com >
2025-05-16 02:16:32 +00:00
f6e26e0bab
test: Add face_code_ref to the mermaid output ( #6985 )
...
* Add face_code_ref to the mermaid output
* Update output
2025-05-15 20:14:31 -04:00
74939e5cd6
Fix execution caching to cache artifact graph NodePath ( #6978 )
...
* Fix to add NodePaths to SketchOnFace and SketchOnPlane artifacts
* Fix to only compute the new part of the artifact graph
* Change to early-return sooner when in mock mode
* Add another test
* Fix to propagate NodePath for sketch on face
* Update output
2025-05-15 19:18:03 -04:00
2516df3a39
fix my insta test fubar ( #6981 )
...
* fix my insta test fubar
Signed-off-by: Jess Frazelle <github@jessfraz.com >
* more python tests
Signed-off-by: Jess Frazelle <github@jessfraz.com >
* more python tests
Signed-off-by: Jess Frazelle <github@jessfraz.com >
---------
Signed-off-by: Jess Frazelle <github@jessfraz.com >
2025-05-15 13:37:12 -07:00
92fc294eae
Update mesh clone test ( #6597 )
2025-05-15 16:46:37 +00:00
94f194a984
new sweep default ( #6965 )
...
snaps
Signed-off-by: Jess Frazelle <github@jessfraz.com >
2025-05-15 11:50:55 +00:00
334145f0be
fix sketch on face of union ( #6949 )
...
* fix sketch on face of union
Signed-off-by: Jess Frazelle <github@jessfraz.com >
* rotate the model
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-14 23:25:12 +00:00
078b7f3bf7
fix errors from the wasm side ( #6939 )
...
* updates
Signed-off-by: Jess Frazelle <github@jessfraz.com >
* playwright tests
Signed-off-by: Jess Frazelle <github@jessfraz.com >
* fix tests
Signed-off-by: Jess Frazelle <github@jessfraz.com >
* updates
Signed-off-by: Jess Frazelle <github@jessfraz.com >
* updates
Signed-off-by: Jess Frazelle <github@jessfraz.com >
* updates
Signed-off-by: Jess Frazelle <github@jessfraz.com >
* change order of operations
Signed-off-by: Jess Frazelle <github@jessfraz.com >
* lint
Signed-off-by: Jess Frazelle <github@jessfraz.com >
* fixups
Signed-off-by: Jess Frazelle <github@jessfraz.com >
* Revert "fixups"
This reverts commit c54fd71074
.
* fixups
Signed-off-by: Jess Frazelle <github@jessfraz.com >
---------
Signed-off-by: Jess Frazelle <github@jessfraz.com >
2025-05-14 13:20:46 -07:00
ce566fb6e5
Accept idents as KW args ( #6644 )
...
Support kw arg/local variable shorthand
Signed-off-by: Nick Cameron <nrc@ncameron.org >
2025-05-15 07:42:48 +12:00
5c2dfb8e40
Support new sweep flag ( #6932 )
...
Closes https://github.com/KittyCAD/engine/issues/3115
2025-05-14 13:54:10 -05:00
696222a070
Change KCL error messages to display principal type of values ( #6906 )
2025-05-14 10:04:51 -04:00
1e487ef3bd
Include NodePath in artifact graph mermaid charts as comments ( #6884 )
...
* Display NodePath in artifact graph mermaid charts
* Update output
* Change node path display to be only comments
* Update output
* Update output after rebase
2025-05-14 05:31:58 +00:00
78b6854c6b
bump modeling-cmds, nuke slow world ( #6753 )
...
* bump modeling-cmds, nuke slow world
Signed-off-by: Jess Frazelle <github@jessfraz.com >
* more stuffs
Signed-off-by: Jess Frazelle <github@jessfraz.com >
* updates
Signed-off-by: Jess Frazelle <github@jessfraz.com >
* updates
Signed-off-by: Jess Frazelle <github@jessfraz.com >
* i mechanical engineered today
Signed-off-by: Jess Frazelle <github@jessfraz.com >
* reverse uno your revolves
Signed-off-by: Jess Frazelle <github@jessfraz.com >
* updates
Signed-off-by: Jess Frazelle <github@jessfraz.com >
* updates
Signed-off-by: Jess Frazelle <github@jessfraz.com >
* updates
Signed-off-by: Jess Frazelle <github@jessfraz.com >
* retry logic
Signed-off-by: Jess Frazelle <github@jessfraz.com >
* updates
Signed-off-by: Jess Frazelle <github@jessfraz.com >
* updates
Signed-off-by: Jess Frazelle <github@jessfraz.com >
* fixes
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-14 04:07:24 +00:00
7944a4ce41
New single-file samples for the website ( #6670 )
...
* New single-file samples for the website
* Update kcl-samples simulation test output
* Update kcl-samples simulation test output
* Update kcl-samples simulation test output
* Update kcl-samples simulation test output
* Update kcl-samples simulation test output
* Update kcl-samples simulation test output
* Update kcl-samples simulation test output
* Update kcl-samples simulation test output
* Update kcl-samples simulation test output
* Update kcl-samples simulation test output
* Update kcl-samples simulation test output
* Update kcl-samples simulation test output
* Update kcl-samples simulation test output
* Delete public/kcl-samples/piston directory
* More
* updates
Signed-off-by: Jess Frazelle <github@jessfraz.com >
* updates
Signed-off-by: Jess Frazelle <github@jessfraz.com >
* updates
Signed-off-by: Jess Frazelle <github@jessfraz.com >
* updates
Signed-off-by: Jess Frazelle <github@jessfraz.com >
* updates
Signed-off-by: Jess Frazelle <github@jessfraz.com >
* updates
Signed-off-by: Jess Frazelle <github@jessfraz.com >
* move another test
Signed-off-by: Jess Frazelle <github@jessfraz.com >
* updates
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 >
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Jess Frazelle <jessfraz@users.noreply.github.com >
Co-authored-by: Jess Frazelle <github@jessfraz.com >
2025-05-13 15:05:57 -07:00
4640f1a3ad
Teaching t2c how to counterbore, countersink, and counterdrill ( #6833 )
...
* Teaching t2c how to counterbore, countersink, and counterdrill
* Delete public/kcl-samples/parametric-bearing-pillow-block directory
* Update mounting-wire.kcl
* new artifiacts
Signed-off-by: Jess Frazelle <github@jessfraz.com >
* Update kcl-samples simulation test output
* Update kcl-samples simulation test output
* updates
Signed-off-by: Jess Frazelle <github@jessfraz.com >
* updates
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 >
Co-authored-by: Jess Frazelle <jessfraz@users.noreply.github.com >
Co-authored-by: Jess Frazelle <github@jessfraz.com >
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2025-05-13 14:11:50 -07:00
cd79059d97
Subtract tests ( #6913 )
...
* add subtract test and cleanup some other tests
Signed-off-by: Jess Frazelle <github@jessfraz.com >
* updates
Signed-off-by: Jess Frazelle <github@jessfraz.com >
* fmt
Signed-off-by: Jess Frazelle <github@jessfraz.com >
---------
Signed-off-by: Jess Frazelle <github@jessfraz.com >
2025-05-13 14:06:10 -07:00
2d95e19048
Gears DLC (free) ( #6835 )
...
* Gears DLC (free)
Using the involuteCircular fn to create a variety of cylindrical gearsets
* Delete public/kcl-samples/gear directory
* Update main.kcl
fixing gear meshing
* new samples
Signed-off-by: Jess Frazelle <github@jessfraz.com >
* add link
Signed-off-by: Jess Frazelle <github@jessfraz.com >
---------
Signed-off-by: Jess Frazelle <github@jessfraz.com >
Co-authored-by: Jess Frazelle <jessfraz@users.noreply.github.com >
Co-authored-by: Jess Frazelle <github@jessfraz.com >
2025-05-13 14:03:52 -07:00
d047587bc1
Avoid using full revolve for now ( #6912 )
...
Avoid using revolve for now
When we moved to concurrent execution of KCL modules, we begun to see an
error we never fully understood, and because it was pretty hard to
trigger, we wound up never being able to fix it. Today we were able to
track it down to the `revolve` call here.
Specifically, the problem is triggered when we're doing a "Full Revolve"
(e.g., `angle = 359.999999` passes, but *not* `angle = 360` or the
default, as it is in `main`), and concurrently executing modules will
see something weird happen with `getNextAdjacentEdge`.
From all the smoke I believe this happens only when we are doing a *full
revolve*, *AND* we're executing other modules which are calling
`getNextAdjacentEdge`.
When the `revolve` is present, we can lose the race in *either*
`talk-button.kcl` OR `case.kcl`.
If I move back to single-threaded execution OR I add imports to sequence
things carefully, I can get the tests to pass. If the revolve is an
`extrude` or not a full revolve, it works fine.
My best guess is that it seems like the world got flipped upside down or
something, such that "next edge" has a different orentation for two
calls. My even further guess is that inside `revolve` we mutate
something connection-global such that it alters the intepretation of
calls made during the revolve implementation's "critical section".
2025-05-13 20:20:48 +00:00
128e1093fb
Update snaps ( #6911 )
...
* update pattern entity ids since that pr merged
Signed-off-by: Jess Frazelle <github@jessfraz.com >
* artifacts
Signed-off-by: Jess Frazelle <github@jessfraz.com >
---------
Signed-off-by: Jess Frazelle <github@jessfraz.com >
2025-05-13 19:27:34 +00:00
be14022f97
Update samples PNG export ( #6908 )
2025-05-13 18:03:27 +00:00
01c7b69f50
Function types ( #6891 )
...
* Change Fn to fn for function types
Signed-off-by: Nick Cameron <nrc@ncameron.org >
* Support args and return types in function types
Signed-off-by: Nick Cameron <nrc@ncameron.org >
* Use fancy function types in the docs
Signed-off-by: Nick Cameron <nrc@ncameron.org >
---------
Signed-off-by: Nick Cameron <nrc@ncameron.org >
2025-05-13 14:59:23 +12:00
a049768f1c
Move some more functions to be declared in KCL ( #6856 )
...
* Move the leg functions to KCL
Signed-off-by: Nick Cameron <nrc@ncameron.org >
* Move array functions to KCL
Signed-off-by: Nick Cameron <nrc@ncameron.org >
* Move clone to KCL
Signed-off-by: Nick Cameron <nrc@ncameron.org >
* Add a function type
Signed-off-by: Nick Cameron <nrc@ncameron.org >
---------
Signed-off-by: Nick Cameron <nrc@ncameron.org >
2025-05-13 08:29:38 +12:00
1a325d0b29
Fix to use correct units for array range expressions ( #6837 )
...
* Fix to use correct units for array range expressions
* Update output
2025-05-12 01:30:33 -04:00
bbe89f56a7
Fix the KCL any type and array coercion incorrectly nesting ( #6816 )
...
* Add sim test for any type
* Fix doc comments to match code
* Add array ascription tests
* Commit new test output
* Fix to not panic when type is undefined
* Fix to not panic on use of the any type
* Update test and generated output
* Fix error message after rebase
* Fix subtype of any
* Fix KCL to use new keyword args
* Fix to not nest MixedArray in HomArray
* Update output
* Remove all creation of MixedArray and use HomArray instead
* Rename MixedArray to Tuple
* Fix to coerce arrays the way tuples are done
* Restructure to appease the type signature extraction
* Fix TS unit test
* Update output after switch to HomArray
* Update docs
* Fix to remove edge case when creating points
* Update docs with broken point signature
* Fix display of tuples to not collide with arrays
* Change push to an array with type mismatch to be an error
* Add sim test for push type error
* Fix acription to more general array element type
* Fix to coerce point types
* Change array push to not error when item type differs
* Fix coercion tests
* Change to only flatten as a last resort and remove flattening tuples
* Contort code to appease doc generation
* Update docs
* Fix coerce axes
* Fix flattening test to test arrays instead of tuples
* Remove special subtype case for singleton coercion
2025-05-12 03:57:31 +00:00
97594b9a9e
Proper type-checking where a function requires a tag identifier not just a tag ( #6848 )
...
Signed-off-by: Nick Cameron <nrc@ncameron.org >
2025-05-12 12:57:50 +12:00
f73831ac27
more subtract regression tests ( #6831 )
...
updates
Signed-off-by: Jess Frazelle <github@jessfraz.com >
2025-05-10 19:23:55 -04:00
09f39499e9
add subtract regression tests ( #6829 )
...
Signed-off-by: Jess Frazelle <github@jessfraz.com >
2025-05-10 13:48:38 -07:00
7ac4a9507b
fix unwrap ( #6825 )
...
* fix unwrap
Signed-off-by: Jess Frazelle <github@jessfraz.com >
* add test
Signed-off-by: Jess Frazelle <github@jessfraz.com >
* updates
Signed-off-by: Jess Frazelle <github@jessfraz.com >
* udaptes
Signed-off-by: Jess Frazelle <github@jessfraz.com >
---------
Signed-off-by: Jess Frazelle <github@jessfraz.com >
2025-05-10 13:00:14 -07:00