Compare commits

...

48 Commits

Author SHA1 Message Date
1e056cfd8a Display numeric units in the variables pane (#6683) 2025-05-06 03:40:18 +00:00
32db31e6c3 Increase cargo test retries (#6704) 2025-05-06 03:15:02 +00:00
9c246d6621 Fix units bug with involuteCircular (#6711)
Signed-off-by: Nick Cameron <nrc@ncameron.org>
2025-05-06 14:58:53 +12:00
9c52f5b19a Add tags to Rust std lib functions (#6701)
Signed-off-by: Nick Cameron <nrc@ncameron.org>
2025-05-06 14:14:11 +12:00
0464de33b1 Update the docs script (#6709)
Signed-off-by: Nick Cameron <nrc@ncameron.org>
2025-05-06 01:41:24 +00:00
1ed6bb8a7c change to no longer parallel for edges (#6705)
Signed-off-by: Jess Frazelle <github@jessfraz.com>
2025-05-06 01:06:20 +00:00
8f72920764 Fix app settings location not changing betwen nightly and release (#6656)
App settings location is not changing betwen nightly and release
Fixes #6655
2025-05-05 19:23:34 -04:00
574d6dae7f Add modules to docs (#6699)
* Support modules in docs

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

* shuffle around directories

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

---------

Signed-off-by: Nick Cameron <nrc@ncameron.org>
2025-05-06 11:02:55 +12:00
cf2e9d4b91 Add kclVersion as a field of the setting attribute (#6689)
Signed-off-by: Nick Cameron <nrc@ncameron.org>
2025-05-06 08:44:03 +12:00
7ab879a94f Show "experimental" badges around ML functionality (#6648)
* Make "experimental" a valid status for toolbar and commands

* Wire up status through createMachineCommand

* Add beaker icon

* Show UI elements if status is experimental

* Make ML operations experimental, powered by a flag

* Update command descriptions

* Add tooltip to home page Text-to-CAD button

* Splelnig erorrs

* 🧹lints

* Oopsie daisy Add KCL file isn't experimental

* Add warning message element to text area arg input

* Update message to common named constant
2025-05-05 15:36:22 +00:00
21da3c6482 allow var rename with tool equipped (#6693) 2025-05-05 08:13:13 -04:00
5f836358c0 Warn on usage of the unknown numeric suffix (#6690)
Signed-off-by: Nick Cameron <nrc@ncameron.org>
2025-05-05 13:17:55 +12:00
f407762259 Remove unused build scripts (#6673) 2025-05-03 12:07:54 -04:00
dea20861a0 Fix subtract2d icon in the Feature Tree (#6682) 2025-05-03 07:07:46 -04:00
bc818f10c3 Remove last remnants of legacy positional call (#6678)
* Remove last remnants of legacy positional call

* Update docs

* Fix segAng()

* Fix more docs

* Update docs again
2025-05-02 20:07:31 -05:00
19f5031ef7 Release KCL 66 (#6679)
Breaking changes:

 - All functions (even functions defined by users) must use keyword arguments, not positional arguments
2025-05-02 21:55:58 +00:00
b71eb4fb89 Simplify some test code (#6669) 2025-05-02 21:39:20 +00:00
c327c73087 Catch import scene selection on transforms and point to the feature tree (#6674)
* Catch import scene selection on transforms and point to the feature tree
Fixes #6667

* Add test for toast on clone, bringing back forgotten test
2025-05-02 17:25:33 -04:00
4fe8741ea7 Remove CallExpression support (#6639)
Users MUST use keyword call syntax now.

Closes https://github.com/KittyCAD/modeling-app/issues/4600
2025-05-02 16:08:12 -05:00
75916d4300 Fix resetting onboarding from settings in web after #6564 (#6675)
Fix resetting onboarding in web after #6564

Oversight on my part while refactoring the onboarding system in #6564.
The new centralized `acceptOnboarding` workflow constructs a relative
path, so we have to get out of the settings before invoking it.
2025-05-02 16:48:38 -04:00
e65a6b6a38 Remove reminder message in import (#6668)
Fixes #6666
2025-05-02 19:58:06 +00:00
86a83cadd3 Make onboarding optional, able to be ignored on desktop (take 2) (#6628)
* 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

* Thanks Graphite Diamond, I should use that new util

* Remove TODO comment

* Fix botched merge because IS_PLAYWRIGHT moved or something

---------

Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>
Co-authored-by: Kevin Nadro <kevin@zoo.dev>
2025-05-02 15:54:49 -04:00
00553c34ab Enable Boolean op deletion from the feature tree (#6637)
* Can't Delete Union From Feature Tree
Fixes #6584. Works locally but the new tests don't appear to work yet

* Change tests to right-click > Delete
2025-05-02 15:34:21 -04:00
ace9a59a45 fix cache and imports (#6647)
* updates

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

* fix clippy

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

---------

Signed-off-by: Jess Frazelle <github@jessfraz.com>
2025-05-02 17:41:14 +00:00
09ebb517d9 Fix link to types.md in docs (#6653)
Signed-off-by: Nick Cameron <nrc@ncameron.org>
2025-05-02 09:06:43 -07:00
1c697d30ee Fix to not add extra spaces when formatting call (#6652) 2025-05-02 08:16:07 -05:00
c2dd4d1d2e Same hotkey for center rect and center circle (#6642)
Removed hotkey on center rectangle, seems less common than corner rectangle. Happy to be chalenged. Fixes #6634.
2025-05-02 04:59:33 -04:00
6866c9d418 Fix bad links in docs code blocks (#6649)
Signed-off-by: Nick Cameron <nrc@ncameron.org>
2025-05-02 16:00:27 +12:00
819ee23565 Fix to cache correct PathToNode in artifact graph (#6632)
* Add NodePath to artifact graph

Since this is cached, this should make PathToNode computation correct
even when code is formatted, whitespace changes, and source ranges
are different.

* Remove dead code

* Add unit tests

* Add tests for PathToNode conversion

* Remove unused parameter

* Add missing PathToNode cases

* Fix to handle unlabeled arg

* Cherry pick unlabeled arg fix

* Change PathToNode comment to match TS implementation
2025-05-01 23:55:12 -04:00
02a37e207f Rust ci uses dev (#6643)
* point rust tests at dev too

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

* point python tests at dev

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

---------

Signed-off-by: Jess Frazelle <github@jessfraz.com>
2025-05-02 00:13:16 +00:00
7356af556a add million lint in dev mode (#6162)
add million lint

Signed-off-by: Jess Frazelle <github@jessfraz.com>
2025-05-01 22:35:55 +00:00
88288c3979 Fix layout shift on home page, fix narrow screen layout (#6631)
* Fix layout shift on home page, fix narrow screen layout

* LINTS
2025-05-01 21:41:13 +00:00
763b05e2e6 Fix the generate docs action (#6638)
Signed-off-by: Nick Cameron <nrc@ncameron.org>
2025-05-01 21:28:47 +00:00
39351aed58 Wrong case in no-projects copy on homepage (#6636)
Fixes #6635
2025-05-01 18:51:12 +00:00
e8e7c22b95 #6457 Disable sharing for multi-file AST (#6583)
* disable ShareButton if AST uses import statement

* remove unused code

* add e2e test for ShareButton disabled in multi-file projects
2025-05-01 14:01:08 -04:00
ad975152c1 Update readme logo (#6573)
* pierremtb/adhoc/readme-logo-update

* Change to just cropping
2025-05-01 13:43:09 -04:00
ed406734a7 [Feature]: Initialize engine with view_isometric as a user. (#6604)
* feature: initialize system to view_isometric, playwright(e2e) does zoom_to_fit

* fix: PR fixes

* fix: removing testing code

* fix: I definitely bricked my .spacemacs config and it is using the wrong eslint when I save files :(

* fix: typo

* fix: typoos

* fix: fuking hack

* chore: move exported var from e2e to src then reimport

* fix: got em

* fix: remove console log

* fix: how did this get in that file?? moved it

* fix: location for scene empty check zzz:

* fix: removed debugging code

* fix: forgot the hack for the load view without geometry workflow

* fix: copy
2025-05-01 13:42:44 -04:00
89bae66257 KCL: User-defined KCL functions in examples etc now use keywords (#6603)
Preparing for the removal of positional functions from the language. The first big step is to change all our KCL code examples, test code, public samples etc to all use keyword functions.

Apologies for how large this PR is. Most of it is:

- Changing example KCL that defined its own functions, so the functions now use keyword arguments rather than positional arguments. E.g. change `cube([20, 20])` to be `cube(center = [20, 20])`.
- Some parts of the code assumed positional code and didn't handle keyword calls, e.g. the linter would only check for positional calls to startSketchOn. Now they should work with either positional or keyword.
- Update all the artifacts

This does _not_ remove support for positional calls. That will be in a follow-up PR.
2025-05-01 12:36:51 -04:00
16f5d9c284 Docs improvements (#6615)
Signed-off-by: Nick Cameron <nrc@ncameron.org>
2025-05-01 08:56:27 -07:00
00148d84d8 Ignore the new Debug message (#6627)
Ignore the new Debug message
2025-05-01 08:55:52 -07:00
390cedf79f Update dependabot config (#6616)
Update dependabot config from KittyCAD/ciso
2025-05-01 15:32:02 +02:00
b686c79b49 More lsp endpoints we were missing (#6612)
* add prepare rename

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

* add document color

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-01 02:47:36 +00:00
2d77aa0d36 Revert "Make onboarding optional, able to be ignored on desktop" (#6610)
Revert "Make onboarding optional, able to be ignored on desktop (#6564)"

This reverts commit 820082d7f2.
2025-04-30 21:58:11 -04:00
012102fe86 enhance the signature help (#6606)
update with test

Signed-off-by: Jess Frazelle <github@jessfraz.com>
2025-04-30 20:58:46 +00:00
1a6b147107 Fix to not double import math in the prelude (#6605) 2025-04-30 19:49:55 +00:00
2978b34b7b Skip TAB-disabled tests locally by default (#6601) 2025-04-30 15:32:37 -04:00
dee77e814a remove rust bw compatible settings (#6085)
regenerate the settings docs



cleanup

Signed-off-by: Jess Frazelle <github@jessfraz.com>
2025-04-30 19:00:37 +00:00
820082d7f2 Make onboarding optional, able to be ignored on desktop (#6564)
* 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

---------

Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>
Co-authored-by: Kevin Nadro <kevin@zoo.dev>
2025-04-30 14:43:51 -04:00
1107 changed files with 110510 additions and 102273 deletions

View File

@ -1,3 +1,3 @@
[codespell] [codespell]
ignore-words-list: crate,everytime,inout,co-ordinate,ot,nwo,atleast,ue,afterall,ser,fromM,FromM ignore-words-list: crate,everytime,inout,co-ordinate,ot,nwo,atleast,ue,afterall,ser,fromM,FromM
skip: **/target,node_modules,build,dist,./out,**/Cargo.lock,./docs/kcl/*.md,./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 skip: **/target,node_modules,build,dist,./out,**/Cargo.lock,./docs/**/*.md,./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

View File

@ -7,11 +7,11 @@ if [[ ! -f "test-results/.last-run.json" ]]; then
# If no last run artifact, than run Playwright normally # If no last run artifact, than run Playwright normally
echo "run playwright normally" echo "run playwright normally"
if [[ "$3" == *ubuntu* ]]; then if [[ "$3" == *ubuntu* ]]; then
xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" -- npm run test:playwright:electron:ubuntu -- --shard=$1/$2 || true xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" -- npm run test:playwright:electron -- --shard=$1/$2 || true
elif [[ "$3" == *windows* ]]; then elif [[ "$3" == *windows* ]]; then
npm run test:playwright:electron:windows -- --shard=$1/$2 || true npm run test:playwright:electron -- --grep=@windows --shard=$1/$2 || true
elif [[ "$3" == *macos* ]]; then elif [[ "$3" == *macos* ]]; then
npm run test:playwright:electron:macos -- --shard=$1/$2 || true npm run test:playwright:electron -- --grep=@macos --shard=$1/$2 || true
else else
echo "Do not run Playwright. Unable to detect os runtime." echo "Do not run Playwright. Unable to detect os runtime."
exit 1 exit 1
@ -31,11 +31,11 @@ while [[ $retry -le $max_retries ]]; do
echo "retried=true" >>$GITHUB_OUTPUT echo "retried=true" >>$GITHUB_OUTPUT
echo "run playwright with last failed tests and retry $retry" echo "run playwright with last failed tests and retry $retry"
if [[ "$3" == *ubuntu* ]]; then if [[ "$3" == *ubuntu* ]]; then
xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" -- npm run test:playwright:electron:ubuntu -- --last-failed || true xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" -- npm run test:playwright:electron -- --last-failed || true
elif [[ "$3" == *windows* ]]; then elif [[ "$3" == *windows* ]]; then
npm run test:playwright:electron:windows -- --last-failed || true npm run test:playwright:electron -- --grep=@windows --last-failed || true
elif [[ "$3" == *macos* ]]; then elif [[ "$3" == *macos* ]]; then
npm run test:playwright:electron:macos -- --last-failed || true npm run test:playwright:electron -- --grep=@macos --last-failed || true
else else
echo "Do not run playwright. Unable to detect os runtime." echo "Do not run playwright. Unable to detect os runtime."
exit 1 exit 1

441
.github/dependabot.yml vendored
View File

@ -16,9 +16,12 @@ updates:
security: security:
applies-to: security-updates applies-to: security-updates
update-types: update-types:
- major
- minor - minor
- patch - patch
security-major:
applies-to: security-updates
update-types:
- major
patch: patch:
applies-to: version-updates applies-to: version-updates
update-types: update-types:
@ -49,9 +52,408 @@ updates:
security: security:
applies-to: security-updates applies-to: security-updates
update-types: update-types:
- major
- minor - minor
- patch - patch
security-major:
applies-to: security-updates
update-types:
- major
patch:
applies-to: version-updates
update-types:
- patch
major:
applies-to: version-updates
update-types:
- major
minor:
applies-to: version-updates
update-types:
- minor
- patch
- package-ecosystem: cargo
directory: /rust/kcl-python-bindings
schedule:
interval: weekly
day: monday
time: '03:00'
timezone: America/Los_Angeles
open-pull-requests-limit: 5
reviewers:
- adamchalmers
- franknoirot
- irev-dev
- jessfraz
groups:
security:
applies-to: security-updates
update-types:
- minor
- patch
security-major:
applies-to: security-updates
update-types:
- major
patch:
applies-to: version-updates
update-types:
- patch
major:
applies-to: version-updates
update-types:
- major
minor:
applies-to: version-updates
update-types:
- minor
- patch
- package-ecosystem: cargo
directory: /rust/kcl-to-core
schedule:
interval: weekly
day: monday
time: '03:00'
timezone: America/Los_Angeles
open-pull-requests-limit: 5
reviewers:
- adamchalmers
- franknoirot
- irev-dev
- jessfraz
groups:
security:
applies-to: security-updates
update-types:
- minor
- patch
security-major:
applies-to: security-updates
update-types:
- major
patch:
applies-to: version-updates
update-types:
- patch
major:
applies-to: version-updates
update-types:
- major
minor:
applies-to: version-updates
update-types:
- minor
- patch
- package-ecosystem: cargo
directory: /rust/kcl-language-server-release
schedule:
interval: weekly
day: monday
time: '03:00'
timezone: America/Los_Angeles
open-pull-requests-limit: 5
reviewers:
- adamchalmers
- franknoirot
- irev-dev
- jessfraz
groups:
security:
applies-to: security-updates
update-types:
- minor
- patch
security-major:
applies-to: security-updates
update-types:
- major
patch:
applies-to: version-updates
update-types:
- patch
major:
applies-to: version-updates
update-types:
- major
minor:
applies-to: version-updates
update-types:
- minor
- patch
- package-ecosystem: cargo
directory: /rust/kcl-wasm-lib
schedule:
interval: weekly
day: monday
time: '03:00'
timezone: America/Los_Angeles
open-pull-requests-limit: 5
reviewers:
- adamchalmers
- franknoirot
- irev-dev
- jessfraz
groups:
security:
applies-to: security-updates
update-types:
- minor
- patch
security-major:
applies-to: security-updates
update-types:
- major
patch:
applies-to: version-updates
update-types:
- patch
major:
applies-to: version-updates
update-types:
- major
minor:
applies-to: version-updates
update-types:
- minor
- patch
- package-ecosystem: cargo
directory: /rust/kcl-derive-docs
schedule:
interval: weekly
day: monday
time: '03:00'
timezone: America/Los_Angeles
open-pull-requests-limit: 5
reviewers:
- adamchalmers
- franknoirot
- irev-dev
- jessfraz
groups:
security:
applies-to: security-updates
update-types:
- minor
- patch
security-major:
applies-to: security-updates
update-types:
- major
patch:
applies-to: version-updates
update-types:
- patch
major:
applies-to: version-updates
update-types:
- major
minor:
applies-to: version-updates
update-types:
- minor
- patch
- package-ecosystem: cargo
directory: /rust/kcl-bumper
schedule:
interval: weekly
day: monday
time: '03:00'
timezone: America/Los_Angeles
open-pull-requests-limit: 5
reviewers:
- adamchalmers
- franknoirot
- irev-dev
- jessfraz
groups:
security:
applies-to: security-updates
update-types:
- minor
- patch
security-major:
applies-to: security-updates
update-types:
- major
patch:
applies-to: version-updates
update-types:
- patch
major:
applies-to: version-updates
update-types:
- major
minor:
applies-to: version-updates
update-types:
- minor
- patch
- package-ecosystem: cargo
directory: /rust/kcl-language-server
schedule:
interval: weekly
day: monday
time: '03:00'
timezone: America/Los_Angeles
open-pull-requests-limit: 5
reviewers:
- adamchalmers
- franknoirot
- irev-dev
- jessfraz
groups:
security:
applies-to: security-updates
update-types:
- minor
- patch
security-major:
applies-to: security-updates
update-types:
- major
patch:
applies-to: version-updates
update-types:
- patch
major:
applies-to: version-updates
update-types:
- major
minor:
applies-to: version-updates
update-types:
- minor
- patch
- package-ecosystem: cargo
directory: /rust/kcl-lib
schedule:
interval: weekly
day: monday
time: '03:00'
timezone: America/Los_Angeles
open-pull-requests-limit: 5
reviewers:
- adamchalmers
- franknoirot
- irev-dev
- jessfraz
groups:
security:
applies-to: security-updates
update-types:
- minor
- patch
security-major:
applies-to: security-updates
update-types:
- major
patch:
applies-to: version-updates
update-types:
- patch
major:
applies-to: version-updates
update-types:
- major
minor:
applies-to: version-updates
update-types:
- minor
- patch
- package-ecosystem: cargo
directory: /rust/kcl-lib/fuzz
schedule:
interval: weekly
day: monday
time: '03:00'
timezone: America/Los_Angeles
open-pull-requests-limit: 5
reviewers:
- adamchalmers
- franknoirot
- irev-dev
- jessfraz
groups:
security:
applies-to: security-updates
update-types:
- minor
- patch
security-major:
applies-to: security-updates
update-types:
- major
patch:
applies-to: version-updates
update-types:
- patch
major:
applies-to: version-updates
update-types:
- major
minor:
applies-to: version-updates
update-types:
- minor
- patch
- package-ecosystem: cargo
directory: /rust/kcl-test-server
schedule:
interval: weekly
day: monday
time: '03:00'
timezone: America/Los_Angeles
open-pull-requests-limit: 5
reviewers:
- adamchalmers
- franknoirot
- irev-dev
- jessfraz
groups:
security:
applies-to: security-updates
update-types:
- minor
- patch
security-major:
applies-to: security-updates
update-types:
- major
patch:
applies-to: version-updates
update-types:
- patch
major:
applies-to: version-updates
update-types:
- major
minor:
applies-to: version-updates
update-types:
- minor
- patch
- package-ecosystem: cargo
directory: /rust/kcl-directory-test-macro
schedule:
interval: weekly
day: monday
time: '03:00'
timezone: America/Los_Angeles
open-pull-requests-limit: 5
reviewers:
- adamchalmers
- franknoirot
- irev-dev
- jessfraz
groups:
security:
applies-to: security-updates
update-types:
- minor
- patch
security-major:
applies-to: security-updates
update-types:
- major
patch: patch:
applies-to: version-updates applies-to: version-updates
update-types: update-types:
@ -82,9 +484,12 @@ updates:
security: security:
applies-to: security-updates applies-to: security-updates
update-types: update-types:
- major
- minor - minor
- patch - patch
security-major:
applies-to: security-updates
update-types:
- major
patch: patch:
applies-to: version-updates applies-to: version-updates
update-types: update-types:
@ -115,9 +520,12 @@ updates:
security: security:
applies-to: security-updates applies-to: security-updates
update-types: update-types:
- major
- minor - minor
- patch - patch
security-major:
applies-to: security-updates
update-types:
- major
patch: patch:
applies-to: version-updates applies-to: version-updates
update-types: update-types:
@ -148,9 +556,12 @@ updates:
security: security:
applies-to: security-updates applies-to: security-updates
update-types: update-types:
- major
- minor - minor
- patch - patch
security-major:
applies-to: security-updates
update-types:
- major
patch: patch:
applies-to: version-updates applies-to: version-updates
update-types: update-types:
@ -181,9 +592,12 @@ updates:
security: security:
applies-to: security-updates applies-to: security-updates
update-types: update-types:
- major
- minor - minor
- patch - patch
security-major:
applies-to: security-updates
update-types:
- major
patch: patch:
applies-to: version-updates applies-to: version-updates
update-types: update-types:
@ -214,9 +628,12 @@ updates:
security: security:
applies-to: security-updates applies-to: security-updates
update-types: update-types:
- major
- minor - minor
- patch - patch
security-major:
applies-to: security-updates
update-types:
- major
patch: patch:
applies-to: version-updates applies-to: version-updates
update-types: update-types:
@ -247,9 +664,12 @@ updates:
security: security:
applies-to: security-updates applies-to: security-updates
update-types: update-types:
- major
- minor - minor
- patch - patch
security-major:
applies-to: security-updates
update-types:
- major
patch: patch:
applies-to: version-updates applies-to: version-updates
update-types: update-types:
@ -280,9 +700,12 @@ updates:
security: security:
applies-to: security-updates applies-to: security-updates
update-types: update-types:
- major
- minor - minor
- patch - patch
security-major:
applies-to: security-updates
update-types:
- major
patch: patch:
applies-to: version-updates applies-to: version-updates
update-types: update-types:

View File

@ -84,9 +84,10 @@ jobs:
run: | run: |
set -euo pipefail set -euo pipefail
cd rust cd rust
cargo nextest run --workspace --features artifact-graph --retries=2 --no-fail-fast --profile ci simulation_tests::kcl_samples 2>&1 | tee /tmp/github-actions.log cargo nextest run --workspace --features artifact-graph --retries=10 --no-fail-fast --profile ci simulation_tests::kcl_samples 2>&1 | tee /tmp/github-actions.log
env: env:
KITTYCAD_API_TOKEN: ${{secrets.KITTYCAD_API_TOKEN}} KITTYCAD_API_TOKEN: ${{secrets.KITTYCAD_API_TOKEN_DEV}}
ZOO_HOST: https://api.dev.zoo.dev
RUST_BACKTRACE: full RUST_BACKTRACE: full
- name: Commit differences - name: Commit differences
if: steps.path-changes.outputs.outside-kcl-samples == 'false' && steps.cargo-test-kcl-samples.outcome == 'failure' if: steps.path-changes.outputs.outside-kcl-samples == 'false' && steps.cargo-test-kcl-samples.outcome == 'failure'
@ -116,7 +117,8 @@ jobs:
env: env:
# The default is auto, and insta behaves differently in CI vs. not. # The default is auto, and insta behaves differently in CI vs. not.
INSTA_UPDATE: always INSTA_UPDATE: always
KITTYCAD_API_TOKEN: ${{secrets.KITTYCAD_API_TOKEN}} KITTYCAD_API_TOKEN: ${{secrets.KITTYCAD_API_TOKEN_DEV}}
ZOO_HOST: https://api.dev.zoo.dev
# Configure nextest when it's run by insta (via just). # Configure nextest when it's run by insta (via just).
NEXTEST_PROFILE: ci NEXTEST_PROFILE: ci
RUST_BACKTRACE: full RUST_BACKTRACE: full
@ -178,9 +180,10 @@ jobs:
ls -lah ls -lah
cd rust cd rust
cargo nextest run\ cargo nextest run\
--retries=2 --no-fail-fast -P ci --archive-file nextest-archive.tar.zst \ --retries=10 --no-fail-fast --profile ci --archive-file nextest-archive.tar.zst \
--partition count:${{ matrix.partitionIndex}}/${{ matrix.partitionTotal }} \ --partition count:${{ matrix.partitionIndex}}/${{ matrix.partitionTotal }} \
2>&1 | tee /tmp/github-actions.log 2>&1 | tee /tmp/github-actions.log
env: env:
KITTYCAD_API_TOKEN: ${{secrets.KITTYCAD_API_TOKEN}} KITTYCAD_API_TOKEN: ${{secrets.KITTYCAD_API_TOKEN_DEV}}
ZOO_HOST: https://api.dev.zoo.dev

View File

@ -38,15 +38,13 @@ jobs:
run: | run: |
mkdir -p documentation/content/pages/docs/kcl/ mkdir -p documentation/content/pages/docs/kcl/
# cleanup old # cleanup old
rm -rf documentation/content/pages/docs/kcl/*.md rm -rf documentation/content/pages/docs/kcl-std
rm -rf documentation/content/pages/docs/kcl/types rm -rf documentation/content/pages/docs/kcl-lang
rm -rf documentation/content/pages/docs/kcl/settings
rm -rf documentation/content/pages/docs/kcl/consts
# move new # move new
mv -f docs/kcl/*.md documentation/content/pages/docs/kcl/ mv -f docs/kcl-std documentation/content/pages/docs
mv -f docs/kcl/types documentation/content/pages/docs/kcl/ mv -f docs/kcl-lang documentation/content/pages/docs
mv -f docs/kcl/settings documentation/content/pages/docs/kcl/ # We don't need the README
mv -f docs/kcl/consts documentation/content/pages/docs/kcl/ rm documentation/content/pages/docs/kcl-std/README.md
- name: move kcl-samples - name: move kcl-samples
shell: bash shell: bash
run: | run: |

View File

@ -125,7 +125,8 @@ jobs:
just setup-uv just setup-uv
just test just test
env: env:
KITTYCAD_API_TOKEN: ${{ secrets.KITTYCAD_API_TOKEN }} KITTYCAD_API_TOKEN: ${{ secrets.KITTYCAD_API_TOKEN_DEV }}
ZOO_HOST: https://api.dev.zoo.dev
sdist: sdist:
runs-on: ubuntu-latest runs-on: ubuntu-latest

1
.gitignore vendored
View File

@ -85,3 +85,4 @@ venv
.vscode-test .vscode-test
.biome/ .biome/
.million

View File

@ -97,7 +97,7 @@ The following will need to be run when checking out a new commit and guarantees
```bash ```bash
npm install npm install
npm run build:wasm npm run build:wasm
npm start # or npm run build:local && npm run serve for slower but more production-like build npm start
``` ```
## Before submitting a PR ## Before submitting a PR

View File

@ -49,14 +49,9 @@ REACT_SOURCES := $(wildcard src/*.tsx) $(wildcard src/**/*.tsx)
TYPESCRIPT_SOURCES := tsconfig.* $(wildcard src/*.ts) $(wildcard src/**/*.ts) TYPESCRIPT_SOURCES := tsconfig.* $(wildcard src/*.ts) $(wildcard src/**/*.ts)
VITE_SOURCES := $(wildcard vite.*) $(wildcard vite/**/*.tsx) VITE_SOURCES := $(wildcard vite.*) $(wildcard vite/**/*.tsx)
.PHONY: build .PHONY: build
build: build-web build-desktop build: install public/kcl_wasm_lib_bg.wasm .vite/build/main.js
.PHONY: build-web
build-web: install public/kcl_wasm_lib_bg.wasm build/index.html
.PHONY: build-desktop
build-desktop: install public/kcl_wasm_lib_bg.wasm .vite/build/main.js
public/kcl_wasm_lib_bg.wasm: $(CARGO_SOURCES) $(RUST_SOURCES) public/kcl_wasm_lib_bg.wasm: $(CARGO_SOURCES) $(RUST_SOURCES)
ifdef WINDOWS ifdef WINDOWS
@ -65,9 +60,6 @@ else
npm run build:wasm:dev npm run build:wasm:dev
endif endif
build/index.html: $(REACT_SOURCES) $(TYPESCRIPT_SOURCES) $(VITE_SOURCES)
npm run build:local
.vite/build/main.js: $(REACT_SOURCES) $(TYPESCRIPT_SOURCES) $(VITE_SOURCES) .vite/build/main.js: $(REACT_SOURCES) $(TYPESCRIPT_SOURCES) $(VITE_SOURCES)
npm run tronb:vite:dev npm run tronb:vite:dev
@ -95,11 +87,11 @@ TARGET ?= desktop
run: run-$(TARGET) run: run-$(TARGET)
.PHONY: run-web .PHONY: run-web
run-web: install build-web ## Start the web app run-web: install build ## Start the web app
npm run start npm run start
.PHONY: run-desktop .PHONY: run-desktop
run-desktop: install build-desktop ## Start the desktop app run-desktop: install build ## Start the desktop app
npm run tron:start npm run tron:start
############################################################################### ###############################################################################
@ -121,7 +113,7 @@ test-unit: install ## Run the unit tests
test-e2e: test-e2e-$(TARGET) test-e2e: test-e2e-$(TARGET)
.PHONY: test-e2e-web .PHONY: test-e2e-web
test-e2e-web: install build-web ## Run the web e2e tests test-e2e-web: install build ## Run the web e2e tests
@ curl -fs localhost:3000 >/dev/null || ( echo "Error: localhost:3000 not available, 'make run-web' first" && exit 1 ) @ curl -fs localhost:3000 >/dev/null || ( echo "Error: localhost:3000 not available, 'make run-web' first" && exit 1 )
ifdef E2E_GREP ifdef E2E_GREP
npm run chrome:test -- --headed --grep="$(E2E_GREP)" --max-failures=$(E2E_FAILURES) npm run chrome:test -- --headed --grep="$(E2E_GREP)" --max-failures=$(E2E_FAILURES)
@ -130,7 +122,7 @@ else
endif endif
.PHONY: test-e2e-desktop .PHONY: test-e2e-desktop
test-e2e-desktop: install build-desktop ## Run the desktop e2e tests test-e2e-desktop: install build ## Run the desktop e2e tests
ifdef E2E_GREP ifdef E2E_GREP
npm run test:playwright:electron -- --grep="$(E2E_GREP)" --max-failures=$(E2E_FAILURES) npm run test:playwright:electron -- --grep="$(E2E_GREP)" --max-failures=$(E2E_FAILURES)
else else

12
docs/kcl-lang/index.md Normal file
View File

@ -0,0 +1,12 @@
---
title: "KCL Language Guide"
excerpt: "Documentation of the KCL language for the Zoo Design Studio."
layout: manual
---
## Topics
* [`Types`](/docs/kcl-lang/types)
* [`Modules`](/docs/kcl-lang/modules)
* [`Settings`](/docs/kcl-lang/settings)
* [`Known Issues`](/docs/kcl-lang/known-issues)

View File

@ -12,7 +12,7 @@ to other modules.
```kcl ```kcl
// util.kcl // util.kcl
export fn increment(x) { export fn increment(@x) {
return x + 1 return x + 1
} }
``` ```
@ -37,11 +37,11 @@ Multiple functions can be exported in a file.
```kcl ```kcl
// util.kcl // util.kcl
export fn increment(x) { export fn increment(@x) {
return x + 1 return x + 1
} }
export fn decrement(x) { export fn decrement(@x) {
return x - 1 return x - 1
} }
``` ```
@ -81,7 +81,7 @@ fn cube(center) {
|> extrude(length = 10) |> extrude(length = 10)
} }
myCube = cube([0, 0]) myCube = cube(center = [0, 0])
``` ```
*Pros* *Pros*

View File

@ -55,20 +55,6 @@ This setting has further nested options. See the schema for full details.
The onboarding status of the app. The onboarding status of the app.
**Default:** None
##### theme_color
The hue of the primary theme color for the app.
**Default:** None
##### enable_ssao
Whether or not Screen Space Ambient Occlusion (SSAO) is enabled.
**Default:** None **Default:** None
##### dismiss_web_banner ##### dismiss_web_banner
@ -128,13 +114,6 @@ The default unit to use in modeling dimensions.
Highlight edges of 3D objects? Highlight edges of 3D objects?
**Default:** None
##### show_debug_panel
Whether to show the debug panel, which lets you see various states of the app to aid in development. Remove this when we remove backwards compatibility with the old settings file.
**Default:** None **Default:** None
##### enable_ssao ##### enable_ssao

View File

@ -57,34 +57,6 @@ This setting has further nested options. See the schema for full details.
The onboarding status of the app. The onboarding status of the app.
**Default:** None
##### project_directory
Backwards compatible project directory setting.
**Default:** None
##### theme
Backwards compatible theme setting.
**Default:** None
##### theme_color
The hue of the primary theme color for the app.
**Default:** None
##### enable_ssao
Whether or not Screen Space Ambient Occlusion (SSAO) is enabled.
**Default:** None **Default:** None
##### dismiss_web_banner ##### dismiss_web_banner
@ -103,7 +75,7 @@ When the user is idle, teardown the stream after some time.
##### allow_orbit_in_sketch_mode ##### allow_orbit_in_sketch_mode
When the user is idle, and this is true, the stream will be torn down. Allow orbiting in sketch mode.
**Default:** None **Default:** None
@ -159,13 +131,6 @@ The controls for how to navigate the 3D view.
Highlight edges of 3D objects? Highlight edges of 3D objects?
**Default:** None
##### show_debug_panel
Whether to show the debug panel, which lets you see various states of the app to aid in development. Remove this when we remove backwards compatibility with the old settings file.
**Default:** None **Default:** None
##### enable_ssao ##### enable_ssao

View File

@ -8,16 +8,16 @@ layout: manual
There are three levels of settings available in Zoo Design Studio: 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` 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` 2. [Project Settings](/docs/kcl/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 3. Per-file Settings: Settings that apply to a single KCL file, specified using the `@settings` attribute
## Configuration Files ## Configuration Files
Zoo Design Studio uses TOML files for configuration: Zoo Design Studio uses TOML files for configuration:
* **User Settings**: `user.toml` - See [complete documentation](/docs/kcl/settings/user) * **User Settings**: `user.toml` - See [complete documentation](/docs/kcl/settings-user)
* **Project Settings**: `project.toml` - See [complete documentation](/docs/kcl/settings/project) * **Project Settings**: `project.toml` - See [complete documentation](/docs/kcl/settings-project)
## Per-file settings ## Per-file settings
@ -25,7 +25,7 @@ Settings which affect a single file are configured using the settings attribute.
This must be at the top of the KCL file (comments before the attribute are permitted). This must be at the top of the KCL file (comments before the attribute are permitted).
For example: For example:
```js ```kcl
// The settings attribute. // The settings attribute.
@settings(defaultLengthUnit = in) @settings(defaultLengthUnit = in)

View File

@ -9,10 +9,6 @@ layout: manual
All these types can be nested in various forms where nesting applies. Like All these types can be nested in various forms where nesting applies. Like
arrays can hold objects and vice versa. arrays can hold objects and vice versa.
## Boolean
`true` or `false` work when defining values.
## Constant declaration ## Constant declaration
Constants are defined with a name and a value, like so: Constants are defined with a name and a value, like so:
@ -23,7 +19,7 @@ myBool = false
Currently you cannot redeclare a constant. Currently you cannot redeclare a constant.
## Array ## Arrays
An array is defined with `[]` braces. What is inside the brackets can An array is defined with `[]` braces. What is inside the brackets can
be of any type. For example, the following is completely valid: be of any type. For example, the following is completely valid:
@ -36,7 +32,7 @@ If you want to get a value from an array you can use the index like so:
`myArray[0]`. `myArray[0]`.
## Object ## Objects
An object is defined with `{}` braces. Here is an example object: An object is defined with `{}` braces. Here is an example object:
@ -47,6 +43,15 @@ myObj = { a = 0, b = "thing" }
We support two different ways of getting properties from objects, you can call We support two different ways of getting properties from objects, you can call
`myObj.a` or `myObj["a"]` both work. `myObj.a` or `myObj["a"]` both work.
## `ImportedGeometry`
Using `import` you can import geometry defined using other CAD software. In KCL,
these objects have type `ImportedGeometry` and can mostly be treated like any
other solid (they can be rotated, scaled, etc.), although there is no access to
their internal components. See the [modules and imports docs](modules) for more
detail on importing geometry.
## Binary expressions ## Binary expressions
You can also do math! Let's show an example below: You can also do math! Let's show an example below:
@ -176,7 +181,7 @@ Check the docs page for each function and look at its examples to see.
Tags are used to give a name (tag) to a specific path. Tags are used to give a name (tag) to a specific path.
### Tag Declaration ### `TagDeclarator`
The syntax for declaring a tag is `$myTag` you would use it in the following The syntax for declaring a tag is `$myTag` you would use it in the following
way: way:
@ -199,14 +204,24 @@ startSketchOn(XZ)
|> close() |> close()
``` ```
### Tag Identifier ### `TagIdentifier`
As per the example above you can use the tag identifier to get a reference to the As per the example above you can use the tag identifier to get a reference to the
tagged object. The syntax for this is `myTag`. tagged object. The syntax for this is `myTag`.
In the example above we use the tag identifier to get the angle of the segment In the example above we use the tag identifier to get the angle of the segment
`segAng(rectangleSegmentA001, %)`. `segAng(rectangleSegmentA001)`.
### `Start`
There is a special tag, `START` (with type `Start`, although under the cover, it's a string)
for identifying the face of a solid which was the start of an extrusion (i.e., the surface which
is extruded).
### `End`
There is a special tag, `END` (with type `End`, although under the cover, it's a string)
for identifying the face of a solid which was finishes an extrusion.
### Tag Scope ### Tag Scope
@ -234,8 +249,8 @@ fn rect(origin) {
|> close() |> close()
} }
rect([0, 0]) rect(origin = [0, 0])
rect([20, 0]) rect(origin = [20, 0])
``` ```
Those tags would only be available in the `rect` function and not globally. Those tags would only be available in the `rect` function and not globally.
@ -264,8 +279,8 @@ fn rect(origin) {
|> close() |> close()
} }
rect([0, 0]) rect(origin = [0, 0])
myRect = rect([20, 0]) myRect = rect(origin = [20, 0])
myRect myRect
|> extrude(length = 10) |> extrude(length = 10)

5
docs/kcl-std/README.md Normal file
View File

@ -0,0 +1,5 @@
# Autogenerated docs
Everything in this directory and its subdirectories (except this file) is automatically generated. Do not edit anything in this directory directly, your changes will be lost.
The directory contents are generated by running the `test_generate_stdlib_markdown_docs` test in `/rust/kcl-lib/src/docs/gen_std_tests.rs`. Files are generated from the standard library declared in KCL (`/rust/kcl-lib/std`) and in Rust (`/rust/kcl-lib/src/std`), and by copying files from `../kcl-src`.

View File

@ -10,34 +10,33 @@ Draw a line segment relative to the current origin using the polar measure of so
```kcl ```kcl
angledLine( angledLine(
sketch: [Sketch](/docs/kcl/types/Sketch), sketch: Sketch,
angle: [number](/docs/kcl/types/number), angle: number,
length?: [number](/docs/kcl/types/number), length?: number,
lengthX?: [number](/docs/kcl/types/number), lengthX?: number,
lengthY?: [number](/docs/kcl/types/number), lengthY?: number,
endAbsoluteX?: [number](/docs/kcl/types/number), endAbsoluteX?: number,
endAbsoluteY?: [number](/docs/kcl/types/number), endAbsoluteY?: number,
tag?: [TagDeclarator](/docs/kcl/types#tag-declaration), tag?: TagDeclarator,
): [Sketch](/docs/kcl/types/Sketch) ): Sketch
``` ```
### Arguments ### Arguments
| Name | Type | Description | Required | | Name | Type | Description | Required |
|----------|------|-------------|----------| |----------|------|-------------|----------|
| `sketch` | [`Sketch`](/docs/kcl/types/Sketch) | Which sketch should this path be added to? | Yes | | `sketch` | [`Sketch`](/docs/kcl-std/types/std-types-Sketch) | Which sketch should this path be added to? | Yes |
| `angle` | [`number`](/docs/kcl/types/number) | Which angle should the line be drawn at? | Yes | | `angle` | [`number`](/docs/kcl-std/types/std-types-number) | Which angle should the line be drawn at? | Yes |
| `length` | [`number`](/docs/kcl/types/number) | Draw the line this distance along the given angle. Only one of `length`, `lengthX`, `lengthY`, `endAbsoluteX`, `endAbsoluteY` can be given. | No | | `length` | [`number`](/docs/kcl-std/types/std-types-number) | Draw the line this distance along the given angle. Only one of `length`, `lengthX`, `lengthY`, `endAbsoluteX`, `endAbsoluteY` can be given. | No |
| `lengthX` | [`number`](/docs/kcl/types/number) | Draw the line this distance along the X axis. Only one of `length`, `lengthX`, `lengthY`, `endAbsoluteX`, `endAbsoluteY` can be given. | No | | `lengthX` | [`number`](/docs/kcl-std/types/std-types-number) | Draw the line this distance along the X axis. Only one of `length`, `lengthX`, `lengthY`, `endAbsoluteX`, `endAbsoluteY` can be given. | No |
| `lengthY` | [`number`](/docs/kcl/types/number) | Draw the line this distance along the Y axis. Only one of `length`, `lengthX`, `lengthY`, `endAbsoluteX`, `endAbsoluteY` can be given. | No | | `lengthY` | [`number`](/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`](/docs/kcl/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 | | `endAbsoluteX` | [`number`](/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`](/docs/kcl/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 | | `endAbsoluteY` | [`number`](/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` | [`TagDeclarator`](/docs/kcl/types#tag-declaration) | Create a new tag which refers to this line | No | | [`tag`](/docs/kcl-std/types/std-types-tag) | [`TagDeclarator`](/docs/kcl-lang/types#TagDeclarator) | Create a new tag which refers to this line | No |
### Returns ### Returns
[`Sketch`](/docs/kcl/types/Sketch) [`Sketch`](/docs/kcl-std/types/std-types-Sketch)
### Examples ### Examples

View File

@ -10,28 +10,27 @@ Draw an angled line from the current origin, constructing a line segment such th
```kcl ```kcl
angledLineThatIntersects( angledLineThatIntersects(
sketch: [Sketch](/docs/kcl/types/Sketch), sketch: Sketch,
angle: [number](/docs/kcl/types/number), angle: number,
intersectTag: [TagIdentifier](/docs/kcl/types#tag-identifier), intersectTag: TagIdentifier,
offset?: [number](/docs/kcl/types/number), offset?: number,
tag?: [TagDeclarator](/docs/kcl/types#tag-declaration), tag?: TagDeclarator,
): [Sketch](/docs/kcl/types/Sketch) ): Sketch
``` ```
### Arguments ### Arguments
| Name | Type | Description | Required | | Name | Type | Description | Required |
|----------|------|-------------|----------| |----------|------|-------------|----------|
| `sketch` | [`Sketch`](/docs/kcl/types/Sketch) | Which sketch should this path be added to? | Yes | | `sketch` | [`Sketch`](/docs/kcl-std/types/std-types-Sketch) | Which sketch should this path be added to? | Yes |
| `angle` | [`number`](/docs/kcl/types/number) | Which angle should the line be drawn at? | Yes | | `angle` | [`number`](/docs/kcl-std/types/std-types-number) | Which angle should the line be drawn at? | Yes |
| `intersectTag` | [`TagIdentifier`](/docs/kcl/types#tag-identifier) | The tag of the line to intersect with | Yes | | `intersectTag` | [`TagIdentifier`](/docs/kcl-lang/types#TagIdentifier) | The tag of the line to intersect with | Yes |
| `offset` | [`number`](/docs/kcl/types/number) | The offset from the intersecting line. Defaults to 0. | No | | `offset` | [`number`](/docs/kcl-std/types/std-types-number) | The offset from the intersecting line. Defaults to 0. | No |
| `tag` | [`TagDeclarator`](/docs/kcl/types#tag-declaration) | Create a new tag which refers to this line | No | | [`tag`](/docs/kcl-std/types/std-types-tag) | [`TagDeclarator`](/docs/kcl-lang/types#TagDeclarator) | Create a new tag which refers to this line | No |
### Returns ### Returns
[`Sketch`](/docs/kcl/types/Sketch) [`Sketch`](/docs/kcl-std/types/std-types-Sketch)
### Examples ### Examples

View File

@ -10,26 +10,25 @@ This will work on any solid, including extruded solids, revolved solids, and she
```kcl ```kcl
appearance( appearance(
solids: [[Solid](/docs/kcl/types/Solid)OrImportedGeometry](/docs/kcl/types/[Solid](/docs/kcl/types/Solid)OrImportedGeometry), solids: [Solid] | ImportedGeometry,
color: String, color: string,
metalness?: [number](/docs/kcl/types/number), metalness?: number,
roughness?: [number](/docs/kcl/types/number), roughness?: number,
): [[Solid](/docs/kcl/types/Solid)OrImportedGeometry](/docs/kcl/types/[Solid](/docs/kcl/types/Solid)OrImportedGeometry) ): [Solid] | ImportedGeometry
``` ```
### Arguments ### Arguments
| Name | Type | Description | Required | | Name | Type | Description | Required |
|----------|------|-------------|----------| |----------|------|-------------|----------|
| `solids` | [`SolidOrImportedGeometry`](/docs/kcl/types/SolidOrImportedGeometry) | The solid(s) whose appearance is being set | Yes | | `solids` | [`[Solid]`](/docs/kcl-std/types/std-types-Solid) or [`ImportedGeometry`](/docs/kcl-lang/types#ImportedGeometry) | The solid(s) whose appearance is being set | Yes |
| `color` | `String` | Color of the new material, a hex string like '#ff0000' | Yes | | `color` | [`string`](/docs/kcl-std/types/std-types-string) | Color of the new material, a hex string like '#ff0000' | Yes |
| `metalness` | [`number`](/docs/kcl/types/number) | Metalness of the new material, a percentage like 95.7. | No | | `metalness` | [`number`](/docs/kcl-std/types/std-types-number) | Metalness of the new material, a percentage like 95.7. | No |
| `roughness` | [`number`](/docs/kcl/types/number) | Roughness of the new material, a percentage like 95.7. | No | | `roughness` | [`number`](/docs/kcl-std/types/std-types-number) | Roughness of the new material, a percentage like 95.7. | No |
### Returns ### Returns
[`SolidOrImportedGeometry`](/docs/kcl/types/SolidOrImportedGeometry) - Data for a solid or an imported geometry. [`[Solid]`](/docs/kcl-std/types/std-types-Solid) or [`ImportedGeometry`](/docs/kcl-lang/types#ImportedGeometry) - Data for a solid or an imported geometry.
### Examples ### Examples
@ -72,9 +71,9 @@ fn cube(center) {
|> extrude(length = 10) |> extrude(length = 10)
} }
example0 = cube([0, 0]) example0 = cube(center = [0, 0])
example1 = cube([20, 0]) example1 = cube(center = [20, 0])
example2 = cube([40, 0]) example2 = cube(center = [40, 0])
appearance( appearance(
[example0, example1], [example0, example1],

View File

@ -12,32 +12,31 @@ Unless this makes a lot of sense and feels like what you're looking for to const
```kcl ```kcl
arc( arc(
sketch: [Sketch](/docs/kcl/types/Sketch), sketch: Sketch,
angleStart?: [number](/docs/kcl/types/number), angleStart?: number,
angleEnd?: [number](/docs/kcl/types/number), angleEnd?: number,
radius?: [number](/docs/kcl/types/number), radius?: number,
interiorAbsolute?: [[[number](/docs/kcl/types/number)]](/docs/kcl/types/[number](/docs/kcl/types/number)), interiorAbsolute?: Point2d,
endAbsolute?: [[[number](/docs/kcl/types/number)]](/docs/kcl/types/[number](/docs/kcl/types/number)), endAbsolute?: Point2d,
tag?: [TagDeclarator](/docs/kcl/types#tag-declaration), tag?: TagDeclarator,
): [Sketch](/docs/kcl/types/Sketch) ): Sketch
``` ```
### Arguments ### Arguments
| Name | Type | Description | Required | | Name | Type | Description | Required |
|----------|------|-------------|----------| |----------|------|-------------|----------|
| `sketch` | [`Sketch`](/docs/kcl/types/Sketch) | Which sketch should this path be added to? | Yes | | `sketch` | [`Sketch`](/docs/kcl-std/types/std-types-Sketch) | Which sketch should this path be added to? | Yes |
| `angleStart` | [`number`](/docs/kcl/types/number) | Where along the circle should this arc start? | No | | `angleStart` | [`number`](/docs/kcl-std/types/std-types-number) | Where along the circle should this arc start? | No |
| `angleEnd` | [`number`](/docs/kcl/types/number) | Where along the circle should this arc end? | No | | `angleEnd` | [`number`](/docs/kcl-std/types/std-types-number) | Where along the circle should this arc end? | No |
| `radius` | [`number`](/docs/kcl/types/number) | How large should the circle be? | No | | `radius` | [`number`](/docs/kcl-std/types/std-types-number) | How large should the circle be? | No |
| `interiorAbsolute` | [`[number]`](/docs/kcl/types/number) | Any point between the arc's start and end? Requires `endAbsolute`. Incompatible with `angleStart` or `angleEnd` | 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` | [`[number]`](/docs/kcl/types/number) | Where should this arc end? Requires `interiorAbsolute`. 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` | [`TagDeclarator`](/docs/kcl/types#tag-declaration) | Create a new tag which refers to this line | No | | [`tag`](/docs/kcl-std/types/std-types-tag) | [`TagDeclarator`](/docs/kcl-lang/types#TagDeclarator) | Create a new tag which refers to this line | No |
### Returns ### Returns
[`Sketch`](/docs/kcl/types/Sketch) [`Sketch`](/docs/kcl-std/types/std-types-Sketch)
### Examples ### Examples

View File

@ -10,30 +10,29 @@ Check a value meets some expected conditions at runtime. Program terminates with
```kcl ```kcl
assert( assert(
actual: [number](/docs/kcl/types/number), actual: number,
isGreaterThan?: [number](/docs/kcl/types/number), isGreaterThan?: number,
isLessThan?: [number](/docs/kcl/types/number), isLessThan?: number,
isGreaterThanOrEqual?: [number](/docs/kcl/types/number), isGreaterThanOrEqual?: number,
isLessThanOrEqual?: [number](/docs/kcl/types/number), isLessThanOrEqual?: number,
isEqualTo?: [number](/docs/kcl/types/number), isEqualTo?: number,
tolerance?: [number](/docs/kcl/types/number), tolerance?: number,
error?: String, error?: string,
): () ): ()
``` ```
### Arguments ### Arguments
| Name | Type | Description | Required | | Name | Type | Description | Required |
|----------|------|-------------|----------| |----------|------|-------------|----------|
| `actual` | [`number`](/docs/kcl/types/number) | Value to check. It will be compared with one of the comparison arguments. | Yes | | `actual` | [`number`](/docs/kcl-std/types/std-types-number) | Value to check. It will be compared with one of the comparison arguments. | Yes |
| `isGreaterThan` | [`number`](/docs/kcl/types/number) | Comparison argument. If given, checks the `actual` value is greater than this. | No | | `isGreaterThan` | [`number`](/docs/kcl-std/types/std-types-number) | Comparison argument. If given, checks the `actual` value is greater than this. | No |
| `isLessThan` | [`number`](/docs/kcl/types/number) | Comparison argument. If given, checks the `actual` value is less than this. | No | | `isLessThan` | [`number`](/docs/kcl-std/types/std-types-number) | Comparison argument. If given, checks the `actual` value is less than this. | No |
| `isGreaterThanOrEqual` | [`number`](/docs/kcl/types/number) | Comparison argument. If given, checks the `actual` value is greater than or equal to this. | No | | `isGreaterThanOrEqual` | [`number`](/docs/kcl-std/types/std-types-number) | Comparison argument. If given, checks the `actual` value is greater than or equal to this. | No |
| `isLessThanOrEqual` | [`number`](/docs/kcl/types/number) | Comparison argument. If given, checks the `actual` value is less than or equal to this. | No | | `isLessThanOrEqual` | [`number`](/docs/kcl-std/types/std-types-number) | Comparison argument. If given, checks the `actual` value is less than or equal to this. | No |
| `isEqualTo` | [`number`](/docs/kcl/types/number) | Comparison argument. If given, checks the `actual` value is less than or equal to this. | No | | `isEqualTo` | [`number`](/docs/kcl-std/types/std-types-number) | Comparison argument. If given, checks the `actual` value is less than or equal to this. | No |
| `tolerance` | [`number`](/docs/kcl/types/number) | If `isEqualTo` is used, this is the tolerance to allow for the comparison. This tolerance is used because KCL's number system has some floating-point imprecision when used with very large decimal places. | No | | `tolerance` | [`number`](/docs/kcl-std/types/std-types-number) | If `isEqualTo` is used, this is the tolerance to allow for the comparison. This tolerance is used because KCL's number system has some floating-point imprecision when used with very large decimal places. | No |
| `error` | `String` | If the value was false, the program will terminate with this error message | No | | `error` | [`string`](/docs/kcl-std/types/std-types-string) | If the value was false, the program will terminate with this error message | No |
### Returns ### Returns

View File

@ -10,18 +10,17 @@ Asserts that a value is the boolean value true.
```kcl ```kcl
assertIs( assertIs(
actual: [bool](/docs/kcl/types/bool), actual: bool,
error?: String, error?: string,
): () ): ()
``` ```
### Arguments ### Arguments
| Name | Type | Description | Required | | Name | Type | Description | Required |
|----------|------|-------------|----------| |----------|------|-------------|----------|
| `actual` | [`bool`](/docs/kcl/types/bool) | Value to check. If this is the boolean value true, assert passes. Otherwise it fails. | Yes | | `actual` | [`bool`](/docs/kcl-std/types/std-types-bool) | Value to check. If this is the boolean value true, assert passes. Otherwise it fails. | Yes |
| `error` | `String` | If the value was false, the program will terminate with this error message | No | | `error` | [`string`](/docs/kcl-std/types/std-types-string) | If the value was false, the program will terminate with this error message | No |
### Returns ### Returns

View File

@ -10,28 +10,27 @@ Draw a smooth, continuous, curved line segment from the current origin to the de
```kcl ```kcl
bezierCurve( bezierCurve(
sketch: [Sketch](/docs/kcl/types/Sketch), sketch: Sketch,
control1: [[[number](/docs/kcl/types/number)]](/docs/kcl/types/[number](/docs/kcl/types/number)), control1: Point2d,
control2: [[[number](/docs/kcl/types/number)]](/docs/kcl/types/[number](/docs/kcl/types/number)), control2: Point2d,
end: [[[number](/docs/kcl/types/number)]](/docs/kcl/types/[number](/docs/kcl/types/number)), end: Point2d,
tag?: [TagDeclarator](/docs/kcl/types#tag-declaration), tag?: TagDeclarator,
): [Sketch](/docs/kcl/types/Sketch) ): Sketch
``` ```
### Arguments ### Arguments
| Name | Type | Description | Required | | Name | Type | Description | Required |
|----------|------|-------------|----------| |----------|------|-------------|----------|
| `sketch` | [`Sketch`](/docs/kcl/types/Sketch) | Which sketch should this path be added to? | Yes | | `sketch` | [`Sketch`](/docs/kcl-std/types/std-types-Sketch) | Which sketch should this path be added to? | Yes |
| `control1` | [`[number]`](/docs/kcl/types/number) | First control point for the cubic | Yes | | `control1` | [`Point2d`](/docs/kcl-std/types/std-types-Point2d) | First control point for the cubic | Yes |
| `control2` | [`[number]`](/docs/kcl/types/number) | Second control point for the cubic | Yes | | `control2` | [`Point2d`](/docs/kcl-std/types/std-types-Point2d) | Second control point for the cubic | Yes |
| `end` | [`[number]`](/docs/kcl/types/number) | How far away (along the X and Y axes) should this line go? | Yes | | `end` | [`Point2d`](/docs/kcl-std/types/std-types-Point2d) | How far away (along the X and Y axes) should this line go? | Yes |
| `tag` | [`TagDeclarator`](/docs/kcl/types#tag-declaration) | Create a new tag which refers to this line | No | | [`tag`](/docs/kcl-std/types/std-types-tag) | [`TagDeclarator`](/docs/kcl-lang/types#TagDeclarator) | Create a new tag which refers to this line | No |
### Returns ### Returns
[`Sketch`](/docs/kcl/types/Sketch) [`Sketch`](/docs/kcl-std/types/std-types-Sketch)
### Examples ### Examples

View File

@ -10,28 +10,27 @@ Construct a circle derived from 3 points.
```kcl ```kcl
circleThreePoint( circleThreePoint(
sketchSurfaceOrGroup: [[Sketch](/docs/kcl/types/Sketch)OrSurface](/docs/kcl/types/[Sketch](/docs/kcl/types/Sketch)OrSurface), sketchSurfaceOrGroup: Sketch | Plane | Face,
p1: [[[number](/docs/kcl/types/number)]](/docs/kcl/types/[number](/docs/kcl/types/number)), p1: Point2d,
p2: [[[number](/docs/kcl/types/number)]](/docs/kcl/types/[number](/docs/kcl/types/number)), p2: Point2d,
p3: [[[number](/docs/kcl/types/number)]](/docs/kcl/types/[number](/docs/kcl/types/number)), p3: Point2d,
tag?: [TagDeclarator](/docs/kcl/types#tag-declaration), tag?: TagDeclarator,
): [Sketch](/docs/kcl/types/Sketch) ): Sketch
``` ```
### Arguments ### Arguments
| Name | Type | Description | Required | | Name | Type | Description | Required |
|----------|------|-------------|----------| |----------|------|-------------|----------|
| `sketchSurfaceOrGroup` | [`SketchOrSurface`](/docs/kcl/types/SketchOrSurface) | Plane or surface to sketch on. | Yes | | `sketchSurfaceOrGroup` | [`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) | Plane or surface to sketch on. | Yes |
| `p1` | [`[number]`](/docs/kcl/types/number) | 1st point to derive the circle. | Yes | | `p1` | [`Point2d`](/docs/kcl-std/types/std-types-Point2d) | 1st point to derive the circle. | Yes |
| `p2` | [`[number]`](/docs/kcl/types/number) | 2nd point to derive the circle. | Yes | | `p2` | [`Point2d`](/docs/kcl-std/types/std-types-Point2d) | 2nd point to derive the circle. | Yes |
| `p3` | [`[number]`](/docs/kcl/types/number) | 3rd point to derive the circle. | Yes | | `p3` | [`Point2d`](/docs/kcl-std/types/std-types-Point2d) | 3rd point to derive the circle. | Yes |
| `tag` | [`TagDeclarator`](/docs/kcl/types#tag-declaration) | Identifier for the circle to reference elsewhere. | No | | [`tag`](/docs/kcl-std/types/std-types-tag) | [`TagDeclarator`](/docs/kcl-lang/types#TagDeclarator) | Identifier for the circle to reference elsewhere. | No |
### Returns ### Returns
[`Sketch`](/docs/kcl/types/Sketch) [`Sketch`](/docs/kcl-std/types/std-types-Sketch)
### Examples ### Examples

View File

@ -13,19 +13,18 @@ This doesn't really have much utility unless you need the equivalent of a double
Really only use this function if YOU ARE SURE you need it. In most cases you do not need clone and using a pattern with `instance = 2` is more appropriate. Really only use this function if YOU ARE SURE you need it. In most cases you do not need clone and using a pattern with `instance = 2` is more appropriate.
```kcl ```kcl
clone(geometry: [GeometryWithImportedGeometry](/docs/kcl/types/GeometryWithImportedGeometry)): [GeometryWithImportedGeometry](/docs/kcl/types/GeometryWithImportedGeometry) clone(geometry: Solid | Sketch | ImportedGeometry): Solid | Sketch | ImportedGeometry
``` ```
### Arguments ### Arguments
| Name | Type | Description | Required | | Name | Type | Description | Required |
|----------|------|-------------|----------| |----------|------|-------------|----------|
| `geometry` | [`GeometryWithImportedGeometry`](/docs/kcl/types/GeometryWithImportedGeometry) | The sketch, solid, or imported geometry to be cloned | Yes | | `geometry` | [`Solid`](/docs/kcl-std/types/std-types-Solid) or [`Sketch`](/docs/kcl-std/types/std-types-Sketch) or [`ImportedGeometry`](/docs/kcl-lang/types#ImportedGeometry) | The sketch, solid, or imported geometry to be cloned | Yes |
### Returns ### Returns
[`GeometryWithImportedGeometry`](/docs/kcl/types/GeometryWithImportedGeometry) - A geometry including an imported geometry. [`Solid`](/docs/kcl-std/types/std-types-Solid) or [`Sketch`](/docs/kcl-std/types/std-types-Sketch) or [`ImportedGeometry`](/docs/kcl-lang/types#ImportedGeometry) - A geometry including an imported geometry.
### Examples ### Examples

View File

@ -10,22 +10,21 @@ Construct a line segment from the current origin back to the profile's origin, e
```kcl ```kcl
close( close(
sketch: [Sketch](/docs/kcl/types/Sketch), sketch: Sketch,
tag?: [TagDeclarator](/docs/kcl/types#tag-declaration), tag?: TagDeclarator,
): [Sketch](/docs/kcl/types/Sketch) ): Sketch
``` ```
### Arguments ### Arguments
| Name | Type | Description | Required | | Name | Type | Description | Required |
|----------|------|-------------|----------| |----------|------|-------------|----------|
| `sketch` | [`Sketch`](/docs/kcl/types/Sketch) | The sketch you want to close | Yes | | `sketch` | [`Sketch`](/docs/kcl-std/types/std-types-Sketch) | The sketch you want to close | Yes |
| `tag` | [`TagDeclarator`](/docs/kcl/types#tag-declaration) | Create a new tag which refers to this line | No | | [`tag`](/docs/kcl-std/types/std-types-tag) | [`TagDeclarator`](/docs/kcl-lang/types#TagDeclarator) | Create a new tag which refers to this line | No |
### Returns ### Returns
[`Sketch`](/docs/kcl/types/Sketch) [`Sketch`](/docs/kcl-std/types/std-types-Sketch)
### Examples ### Examples

View File

@ -10,30 +10,29 @@ You can provide more than one sketch to extrude, and they will all be extruded i
```kcl ```kcl
extrude( extrude(
sketches: [[[Sketch](/docs/kcl/types/Sketch)]](/docs/kcl/types/[Sketch](/docs/kcl/types/Sketch)), sketches: [Sketch],
length: [number](/docs/kcl/types/number), length: number,
symmetric?: [bool](/docs/kcl/types/bool), symmetric?: bool,
bidirectionalLength?: [number](/docs/kcl/types/number), bidirectionalLength?: number,
tagStart?: [TagDeclarator](/docs/kcl/types#tag-declaration), tagStart?: TagDeclarator,
tagEnd?: [TagDeclarator](/docs/kcl/types#tag-declaration), tagEnd?: TagDeclarator,
): [[[Solid](/docs/kcl/types/Solid)]](/docs/kcl/types/[Solid](/docs/kcl/types/Solid)) ): [Solid]
``` ```
### Arguments ### Arguments
| Name | Type | Description | Required | | Name | Type | Description | Required |
|----------|------|-------------|----------| |----------|------|-------------|----------|
| `sketches` | [`[Sketch]`](/docs/kcl/types/Sketch) | Which sketch or sketches should be extruded | Yes | | `sketches` | [`[Sketch]`](/docs/kcl-std/types/std-types-Sketch) | Which sketch or sketches should be extruded | Yes |
| `length` | [`number`](/docs/kcl/types/number) | How far to extrude the given sketches | Yes | | `length` | [`number`](/docs/kcl-std/types/std-types-number) | How far to extrude the given sketches | Yes |
| `symmetric` | [`bool`](/docs/kcl/types/bool) | If true, the extrusion will happen symmetrically around the sketch. Otherwise, the | No | | `symmetric` | [`bool`](/docs/kcl-std/types/std-types-bool) | If true, the extrusion will happen symmetrically around the sketch. Otherwise, the | No |
| `bidirectionalLength` | [`number`](/docs/kcl/types/number) | If specified, will also extrude in the opposite direction to 'distance' to the specified distance. If 'symmetric' is true, this value is ignored. | No | | `bidirectionalLength` | [`number`](/docs/kcl-std/types/std-types-number) | If specified, will also extrude in the opposite direction to 'distance' to the specified distance. If 'symmetric' is true, this value is ignored. | No |
| `tagStart` | [`TagDeclarator`](/docs/kcl/types#tag-declaration) | A named tag for the face at the start of the extrusion, i.e. the original sketch | No | | `tagStart` | [`TagDeclarator`](/docs/kcl-lang/types#TagDeclarator) | A named tag for the face at the start of the extrusion, i.e. the original sketch | No |
| `tagEnd` | [`TagDeclarator`](/docs/kcl/types#tag-declaration) | A named tag for the face at the end of the extrusion, i.e. the new face created by extruding the original sketch | No | | `tagEnd` | [`TagDeclarator`](/docs/kcl-lang/types#TagDeclarator) | A named tag for the face at the end of the extrusion, i.e. the new face created by extruding the original sketch | No |
### Returns ### Returns
[`[Solid]`](/docs/kcl/types/Solid) [`[Solid]`](/docs/kcl-std/types/std-types-Solid)
### Examples ### Examples

View File

@ -10,32 +10,31 @@ Create a helix.
```kcl ```kcl
helix( helix(
revolutions: [number](/docs/kcl/types/number)(_), revolutions: number(_),
angleStart: [number](/docs/kcl/types/number)(Angle), angleStart: number(Angle),
ccw?: [bool](/docs/kcl/types/bool), ccw?: bool,
radius?: [number](/docs/kcl/types/number)(Length), radius?: number(Length),
axis?: [Axis3d](/docs/kcl/types/Axis3d) | [Edge](/docs/kcl/types/Edge), axis?: Axis3d | Edge,
length?: [number](/docs/kcl/types/number)(Length), length?: number(Length),
cylinder?: [Solid](/docs/kcl/types/Solid), cylinder?: Solid,
): [Helix](/docs/kcl/types/Helix) ): Helix
``` ```
### Arguments ### Arguments
| Name | Type | Description | Required | | Name | Type | Description | Required |
|----------|------|-------------|----------| |----------|------|-------------|----------|
| `revolutions` | `number(_)` | Number of revolutions. | Yes | | `revolutions` | `number(_)` | Number of revolutions. | Yes |
| `angleStart` | `number(Angle)` | Start angle. | Yes | | `angleStart` | `number(Angle)` | Start angle. | Yes |
| `ccw` | [`bool`](/docs/kcl/types/bool) | Is the helix rotation counter clockwise? The default is `false`. | No | | `ccw` | [`bool`](/docs/kcl-std/types/std-types-bool) | Is the helix rotation counter clockwise? The default is `false`. | No |
| `radius` | `number(Length)` | Radius of the helix. | No | | `radius` | `number(Length)` | Radius of the helix. | No |
| `axis` | [`Axis3d`](/docs/kcl/types/Axis3d) or [`Edge`](/docs/kcl/types/Edge) | Axis to use for the helix. | No | | `axis` | [`Axis3d`](/docs/kcl-std/types/std-types-Axis3d) or [`Edge`](/docs/kcl-std/types/std-types-Edge) | Axis to use for the helix. | No |
| `length` | `number(Length)` | Length of the helix. This is not necessary if the helix is created around an edge. If not given the length of the edge is used. | No | | `length` | `number(Length)` | Length of the helix. This is not necessary if the helix is created around an edge. If not given the length of the edge is used. | No |
| `cylinder` | [`Solid`](/docs/kcl/types/Solid) | Cylinder to create the helix on. | No | | `cylinder` | [`Solid`](/docs/kcl-std/types/std-types-Solid) | Cylinder to create the helix on. | No |
### Returns ### Returns
[`Helix`](/docs/kcl/types/Helix) [`Helix`](/docs/kcl-std/types/std-types-Helix)
### Examples ### Examples

View File

@ -9,19 +9,18 @@ Compute the absolute value of a number.
```kcl ```kcl
abs(@input: [number](/docs/kcl/types/number)): [number](/docs/kcl/types/number) abs(@input: number): number
``` ```
### Arguments ### Arguments
| Name | Type | Description | Required | | Name | Type | Description | Required |
|----------|------|-------------|----------| |----------|------|-------------|----------|
| `input` | [`number`](/docs/kcl/types/number) | | Yes | | `input` | [`number`](/docs/kcl-std/types/std-types-number) | | Yes |
### Returns ### Returns
[`number`](/docs/kcl/types/number) [`number`](/docs/kcl-std/types/std-types-number)
### Examples ### Examples

View File

@ -9,10 +9,9 @@ Compute the arccosine of a number.
```kcl ```kcl
acos(@num: [number](/docs/kcl/types/number)(_)): [number](/docs/kcl/types/number)(rad) acos(@num: number(_)): number(rad)
``` ```
### Arguments ### Arguments
| Name | Type | Description | Required | | Name | Type | Description | Required |

View File

@ -9,10 +9,9 @@ Compute the arcsine of a number.
```kcl ```kcl
asin(@num: [number](/docs/kcl/types/number)(_)): [number](/docs/kcl/types/number)(rad) asin(@num: number(_)): number(rad)
``` ```
### Arguments ### Arguments
| Name | Type | Description | Required | | Name | Type | Description | Required |

View File

@ -9,10 +9,9 @@ Compute the arctangent of a number.
Consider using `atan2()` instead for the true inverse of tangent. Consider using `atan2()` instead for the true inverse of tangent.
```kcl ```kcl
atan(@num: [number](/docs/kcl/types/number)(_)): [number](/docs/kcl/types/number)(rad) atan(@num: number(_)): number(rad)
``` ```
### Arguments ### Arguments
| Name | Type | Description | Required | | Name | Type | Description | Required |

View File

@ -10,12 +10,11 @@ Compute the four quadrant arctangent of Y and X.
```kcl ```kcl
atan2( atan2(
y: [number](/docs/kcl/types/number)(Length), y: number(Length),
x: [number](/docs/kcl/types/number)(Length), x: number(Length),
): [number](/docs/kcl/types/number)(rad) ): number(rad)
``` ```
### Arguments ### Arguments
| Name | Type | Description | Required | | Name | Type | Description | Required |

View File

@ -9,19 +9,18 @@ Compute the smallest integer greater than or equal to a number.
```kcl ```kcl
ceil(@input: [number](/docs/kcl/types/number)): [number](/docs/kcl/types/number) ceil(@input: number): number
``` ```
### Arguments ### Arguments
| Name | Type | Description | Required | | Name | Type | Description | Required |
|----------|------|-------------|----------| |----------|------|-------------|----------|
| `input` | [`number`](/docs/kcl/types/number) | | Yes | | `input` | [`number`](/docs/kcl-std/types/std-types-number) | | Yes |
### Returns ### Returns
[`number`](/docs/kcl/types/number) [`number`](/docs/kcl-std/types/std-types-number)
### Examples ### Examples

View File

@ -9,10 +9,9 @@ Compute the cosine of a number.
```kcl ```kcl
cos(@num: [number](/docs/kcl/types/number)(Angle)): [number](/docs/kcl/types/number)(_) cos(@num: number(Angle)): number(_)
``` ```
### Arguments ### Arguments
| Name | Type | Description | Required | | Name | Type | Description | Required |

View File

@ -9,19 +9,18 @@ Compute the largest integer less than or equal to a number.
```kcl ```kcl
floor(@input: [number](/docs/kcl/types/number)): [number](/docs/kcl/types/number) floor(@input: number): number
``` ```
### Arguments ### Arguments
| Name | Type | Description | Required | | Name | Type | Description | Required |
|----------|------|-------------|----------| |----------|------|-------------|----------|
| `input` | [`number`](/docs/kcl/types/number) | | Yes | | `input` | [`number`](/docs/kcl-std/types/std-types-number) | | Yes |
### Returns ### Returns
[`number`](/docs/kcl/types/number) [`number`](/docs/kcl-std/types/std-types-number)
### Examples ### Examples

View File

@ -9,19 +9,18 @@ Compute the natural logarithm of the number.
```kcl ```kcl
ln(@input: [number](/docs/kcl/types/number)): [number](/docs/kcl/types/number) ln(@input: number): number
``` ```
### Arguments ### Arguments
| Name | Type | Description | Required | | Name | Type | Description | Required |
|----------|------|-------------|----------| |----------|------|-------------|----------|
| `input` | [`number`](/docs/kcl/types/number) | | Yes | | `input` | [`number`](/docs/kcl-std/types/std-types-number) | | Yes |
### Returns ### Returns
[`number`](/docs/kcl/types/number) [`number`](/docs/kcl-std/types/std-types-number)
### Examples ### Examples

View File

@ -12,22 +12,21 @@ and `log10` can produce more accurate results for base 10.
```kcl ```kcl
log( log(
@input: [number](/docs/kcl/types/number), @input: number,
base: [number](/docs/kcl/types/number)(_), base: number(_),
): [number](/docs/kcl/types/number) ): number
``` ```
### Arguments ### Arguments
| Name | Type | Description | Required | | Name | Type | Description | Required |
|----------|------|-------------|----------| |----------|------|-------------|----------|
| `input` | [`number`](/docs/kcl/types/number) | The number to compute the logarithm of. | Yes | | `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(_)` | The base of the logarithm. | Yes |
### Returns ### Returns
[`number`](/docs/kcl/types/number) [`number`](/docs/kcl-std/types/std-types-number)
### Examples ### Examples

View File

@ -9,19 +9,18 @@ Compute the base 10 logarithm of the number.
```kcl ```kcl
log10(@input: [number](/docs/kcl/types/number)): [number](/docs/kcl/types/number) log10(@input: number): number
``` ```
### Arguments ### Arguments
| Name | Type | Description | Required | | Name | Type | Description | Required |
|----------|------|-------------|----------| |----------|------|-------------|----------|
| `input` | [`number`](/docs/kcl/types/number) | | Yes | | `input` | [`number`](/docs/kcl-std/types/std-types-number) | | Yes |
### Returns ### Returns
[`number`](/docs/kcl/types/number) [`number`](/docs/kcl-std/types/std-types-number)
### Examples ### Examples

View File

@ -9,19 +9,18 @@ Compute the base 2 logarithm of the number.
```kcl ```kcl
log2(@input: [number](/docs/kcl/types/number)): [number](/docs/kcl/types/number) log2(@input: number): number
``` ```
### Arguments ### Arguments
| Name | Type | Description | Required | | Name | Type | Description | Required |
|----------|------|-------------|----------| |----------|------|-------------|----------|
| `input` | [`number`](/docs/kcl/types/number) | | Yes | | `input` | [`number`](/docs/kcl-std/types/std-types-number) | | Yes |
### Returns ### Returns
[`number`](/docs/kcl/types/number) [`number`](/docs/kcl-std/types/std-types-number)
### Examples ### Examples

View File

@ -9,19 +9,18 @@ Compute the maximum of the given arguments.
```kcl ```kcl
max(@input: [[number](/docs/kcl/types/number); 1+]): [number](/docs/kcl/types/number) max(@input: [number; 1+]): number
``` ```
### Arguments ### Arguments
| Name | Type | Description | Required | | Name | Type | Description | Required |
|----------|------|-------------|----------| |----------|------|-------------|----------|
| `input` | `[number; 1+]` | An array of numbers to compute the maximum of. | Yes | | `input` | [`[number; 1+]`](/docs/kcl-std/types/std-types-number) | An array of numbers to compute the maximum of. | Yes |
### Returns ### Returns
[`number`](/docs/kcl/types/number) [`number`](/docs/kcl-std/types/std-types-number)
### Examples ### Examples

View File

@ -9,19 +9,18 @@ Compute the minimum of the given arguments.
```kcl ```kcl
min(@input: [[number](/docs/kcl/types/number); 1+]): [number](/docs/kcl/types/number) min(@input: [number; 1+]): number
``` ```
### Arguments ### Arguments
| Name | Type | Description | Required | | Name | Type | Description | Required |
|----------|------|-------------|----------| |----------|------|-------------|----------|
| `input` | `[number; 1+]` | An array of numbers to compute the minimum of. | Yes | | `input` | [`[number; 1+]`](/docs/kcl-std/types/std-types-number) | An array of numbers to compute the minimum of. | Yes |
### Returns ### Returns
[`number`](/docs/kcl/types/number) [`number`](/docs/kcl-std/types/std-types-number)
### Examples ### Examples

View File

@ -11,12 +11,11 @@ cartesian (x/y/z grid) coordinates.
```kcl ```kcl
polar( polar(
angle: [number](/docs/kcl/types/number)(rad), angle: number(rad),
length: [number](/docs/kcl/types/number)(Length), length: number(Length),
): [Point2d](/docs/kcl/types/Point2d) ): Point2d
``` ```
### Arguments ### Arguments
| Name | Type | Description | Required | | Name | Type | Description | Required |
@ -26,7 +25,7 @@ polar(
### Returns ### Returns
[`Point2d`](/docs/kcl/types/Point2d) [`Point2d`](/docs/kcl-std/types/std-types-Point2d)
### Examples ### Examples

View File

@ -10,22 +10,21 @@ Compute the number to a power.
```kcl ```kcl
pow( pow(
@input: [number](/docs/kcl/types/number), @input: number,
exp: [number](/docs/kcl/types/number)(_), exp: number(_),
): [number](/docs/kcl/types/number) ): number
``` ```
### Arguments ### Arguments
| Name | Type | Description | Required | | Name | Type | Description | Required |
|----------|------|-------------|----------| |----------|------|-------------|----------|
| `input` | [`number`](/docs/kcl/types/number) | The number to raise. | Yes | | `input` | [`number`](/docs/kcl-std/types/std-types-number) | The number to raise. | Yes |
| `exp` | `number(_)` | The power to raise to. | Yes | | `exp` | `number(_)` | The power to raise to. | Yes |
### Returns ### Returns
[`number`](/docs/kcl/types/number) [`number`](/docs/kcl-std/types/std-types-number)
### Examples ### Examples

View File

@ -11,22 +11,21 @@ If `num` is negative, the result will be too.
```kcl ```kcl
rem( rem(
@num: [number](/docs/kcl/types/number), @num: number,
divisor: [number](/docs/kcl/types/number), divisor: number,
): [number](/docs/kcl/types/number) ): number
``` ```
### Arguments ### Arguments
| Name | Type | Description | Required | | Name | Type | Description | Required |
|----------|------|-------------|----------| |----------|------|-------------|----------|
| `num` | [`number`](/docs/kcl/types/number) | The number which will be divided by `divisor`. | Yes | | `num` | [`number`](/docs/kcl-std/types/std-types-number) | The number which will be divided by `divisor`. | Yes |
| `divisor` | [`number`](/docs/kcl/types/number) | The number which will divide `num`. | Yes | | `divisor` | [`number`](/docs/kcl-std/types/std-types-number) | The number which will divide `num`. | Yes |
### Returns ### Returns
[`number`](/docs/kcl/types/number) [`number`](/docs/kcl-std/types/std-types-number)
### Examples ### Examples

View File

@ -9,19 +9,18 @@ Round a number to the nearest integer.
```kcl ```kcl
round(@input: [number](/docs/kcl/types/number)): [number](/docs/kcl/types/number) round(@input: number): number
``` ```
### Arguments ### Arguments
| Name | Type | Description | Required | | Name | Type | Description | Required |
|----------|------|-------------|----------| |----------|------|-------------|----------|
| `input` | [`number`](/docs/kcl/types/number) | | Yes | | `input` | [`number`](/docs/kcl-std/types/std-types-number) | | Yes |
### Returns ### Returns
[`number`](/docs/kcl/types/number) [`number`](/docs/kcl-std/types/std-types-number)
### Examples ### Examples

View File

@ -9,10 +9,9 @@ Compute the sine of a number.
```kcl ```kcl
sin(@num: [number](/docs/kcl/types/number)(Angle)): [number](/docs/kcl/types/number)(_) sin(@num: number(Angle)): number(_)
``` ```
### Arguments ### Arguments
| Name | Type | Description | Required | | Name | Type | Description | Required |

View File

@ -9,19 +9,18 @@ Compute the square root of a number.
```kcl ```kcl
sqrt(@input: [number](/docs/kcl/types/number)): [number](/docs/kcl/types/number) sqrt(@input: number): number
``` ```
### Arguments ### Arguments
| Name | Type | Description | Required | | Name | Type | Description | Required |
|----------|------|-------------|----------| |----------|------|-------------|----------|
| `input` | [`number`](/docs/kcl/types/number) | | Yes | | `input` | [`number`](/docs/kcl-std/types/std-types-number) | | Yes |
### Returns ### Returns
[`number`](/docs/kcl/types/number) [`number`](/docs/kcl-std/types/std-types-number)
### Examples ### Examples

View File

@ -9,10 +9,9 @@ Compute the tangent of a number.
```kcl ```kcl
tan(@num: [number](/docs/kcl/types/number)(Angle)): [number](/docs/kcl/types/number)(_) tan(@num: number(Angle)): number(_)
``` ```
### Arguments ### Arguments
| Name | Type | Description | Required | | Name | Type | Description | Required |

View File

@ -10,23 +10,22 @@ For example, if you offset the `XZ` plane by 10, the new plane will be parallel
plane and 10 units away from it. plane and 10 units away from it.
```kcl ```kcl
offset[Plane](/docs/kcl/types/Plane)( offsetPlane(
@plane: [Plane](/docs/kcl/types/Plane), @plane: Plane,
offset: [number](/docs/kcl/types/number)(Length), offset: number(Length),
): [Plane](/docs/kcl/types/Plane) ): Plane
``` ```
### Arguments ### Arguments
| Name | Type | Description | Required | | Name | Type | Description | Required |
|----------|------|-------------|----------| |----------|------|-------------|----------|
| `plane` | [`Plane`](/docs/kcl/types/Plane) | The plane (e.g. `XY`) which this new plane is created from. | Yes | | `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)` | Distance from the standard plane this new plane will be created at. | Yes |
### Returns ### Returns
[`Plane`](/docs/kcl/types/Plane) [`Plane`](/docs/kcl-std/types/std-types-Plane)
### Examples ### Examples

View File

@ -19,34 +19,33 @@ revolved around the same axis.
```kcl ```kcl
revolve( revolve(
@sketches: [[Sketch](/docs/kcl/types/Sketch); 1+], @sketches: [Sketch; 1+],
axis: [Axis2d](/docs/kcl/types/Axis2d) | [Edge](/docs/kcl/types/Edge), axis: Axis2d | Edge,
angle?: [number](/docs/kcl/types/number)(Angle), angle?: number(Angle),
tolerance?: [number](/docs/kcl/types/number)(Length), tolerance?: number(Length),
symmetric?: [bool](/docs/kcl/types/bool), symmetric?: bool,
bidirectionalAngle?: [number](/docs/kcl/types/number)(Angle), bidirectionalAngle?: number(Angle),
tagStart?: tag, tagStart?: tag,
tagEnd?: tag, tagEnd?: tag,
): [Solid](/docs/kcl/types/Solid) ): Solid
``` ```
### Arguments ### Arguments
| Name | Type | Description | Required | | Name | Type | Description | Required |
|----------|------|-------------|----------| |----------|------|-------------|----------|
| `sketches` | `[Sketch; 1+]` | The sketch or set of sketches that should be revolved | Yes | | `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/types/Axis2d) or [`Edge`](/docs/kcl/types/Edge) | Axis of revolution. | 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 | | `angle` | `number(Angle)` | Angle to revolve (in degrees). Default is 360. | No |
| `tolerance` | `number(Length)` | Tolerance for the revolve operation. | No | | `tolerance` | `number(Length)` | Tolerance for the revolve operation. | No |
| `symmetric` | [`bool`](/docs/kcl/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 | | `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)` | 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` | A named tag for the face at the start of the revolve, i.e. the original sketch. | 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` | A named tag for the face at the end of the revolve. | No | | `tagEnd` | [`tag`](/docs/kcl-std/types/std-types-tag) | A named tag for the face at the end of the revolve. | No |
### Returns ### Returns
[`Solid`](/docs/kcl/types/Solid) [`Solid`](/docs/kcl-std/types/std-types-Solid)
### Examples ### Examples

View File

@ -11,26 +11,25 @@ the provided (x, y) origin point.
```kcl ```kcl
circle( circle(
@sketch_or_surface: [Sketch](/docs/kcl/types/Sketch) | [Plane](/docs/kcl/types/Plane) | [Face](/docs/kcl/types/Face), @sketch_or_surface: Sketch | Plane | Face,
center: [Point2d](/docs/kcl/types/Point2d), center: Point2d,
radius: [number](/docs/kcl/types/number)(Length), radius: number(Length),
tag?: tag, tag?: tag,
): [Sketch](/docs/kcl/types/Sketch) ): Sketch
``` ```
### Arguments ### Arguments
| Name | Type | Description | Required | | Name | Type | Description | Required |
|----------|------|-------------|----------| |----------|------|-------------|----------|
| `sketch_or_surface` | [`Sketch`](/docs/kcl/types/Sketch) or [`Plane`](/docs/kcl/types/Plane) or [`Face`](/docs/kcl/types/Face) | Sketch to extend, or plane or surface to sketch on. | Yes | | `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/types/Point2d) | The center of the circle. | 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)` | The radius of the circle. | Yes |
| `tag` | `tag` | Create a new tag which refers to this circle. | No | | [`tag`](/docs/kcl-std/types/std-types-tag) | [`tag`](/docs/kcl-std/types/std-types-tag) | Create a new tag which refers to this circle. | No |
### Returns ### Returns
[`Sketch`](/docs/kcl/types/Sketch) [`Sketch`](/docs/kcl-std/types/std-types-Sketch)
### Examples ### Examples

View File

@ -12,22 +12,21 @@ Mirror occurs around a local sketch axis rather than a global axis.
```kcl ```kcl
mirror2d( mirror2d(
@sketches: [[Sketch](/docs/kcl/types/Sketch); 1+], @sketches: [Sketch; 1+],
axis: [Axis2d](/docs/kcl/types/Axis2d) | [Edge](/docs/kcl/types/Edge), axis: Axis2d | Edge,
): [Sketch](/docs/kcl/types/Sketch) ): Sketch
``` ```
### Arguments ### Arguments
| Name | Type | Description | Required | | Name | Type | Description | Required |
|----------|------|-------------|----------| |----------|------|-------------|----------|
| `sketches` | `[Sketch; 1+]` | The sketch or sketches to be reflected. | Yes | | `sketches` | [`[Sketch; 1+]`](/docs/kcl-std/types/std-types-Sketch) | The sketch or sketches to be reflected. | Yes |
| `axis` | [`Axis2d`](/docs/kcl/types/Axis2d) or [`Edge`](/docs/kcl/types/Edge) | The axis to reflect around. | Yes | | `axis` | [`Axis2d`](/docs/kcl-std/types/std-types-Axis2d) or [`Edge`](/docs/kcl-std/types/std-types-Edge) | The axis to reflect around. | Yes |
### Returns ### Returns
[`Sketch`](/docs/kcl/types/Sketch) [`Sketch`](/docs/kcl-std/types/std-types-Sketch)
### Examples ### Examples

View File

@ -12,26 +12,25 @@ a sharp, straight transitional edge.
```kcl ```kcl
chamfer( chamfer(
@solid: [Solid](/docs/kcl/types/Solid), @solid: Solid,
length: [number](/docs/kcl/types/number)(Length), length: number(Length),
tags: [[Edge](/docs/kcl/types/Edge); 1+], tags: [Edge; 1+],
tag?: tag, tag?: tag,
): [Solid](/docs/kcl/types/Solid) ): Solid
``` ```
### Arguments ### Arguments
| Name | Type | Description | Required | | Name | Type | Description | Required |
|----------|------|-------------|----------| |----------|------|-------------|----------|
| `solid` | [`Solid`](/docs/kcl/types/Solid) | The solid whose edges should be chamfered | Yes | | `solid` | [`Solid`](/docs/kcl-std/types/std-types-Solid) | The solid whose edges should be chamfered | Yes |
| `length` | `number(Length)` | The length of the chamfer | Yes | | `length` | `number(Length)` | The length of the chamfer | Yes |
| `tags` | `[Edge; 1+]` | The paths you want to chamfer | Yes | | `tags` | [`[Edge; 1+]`](/docs/kcl-std/types/std-types-Edge) | The paths you want to chamfer | Yes |
| `tag` | `tag` | Create a new tag which refers to this chamfer | 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 chamfer | No |
### Returns ### Returns
[`Solid`](/docs/kcl/types/Solid) [`Solid`](/docs/kcl-std/types/std-types-Solid)
### Examples ### Examples
@ -76,7 +75,7 @@ sg = startSketchOn(XY)
return sg return sg
} }
part001 = cube([0,0], 20) part001 = cube(pos = [0,0], scale = 20)
|> close(tag = $line1) |> close(tag = $line1)
|> extrude(length = 20) |> extrude(length = 20)
// We tag the chamfer to reference it later. // We tag the chamfer to reference it later.

View File

@ -12,28 +12,27 @@ will smoothly blend the transition.
```kcl ```kcl
fillet( fillet(
@solid: [Solid](/docs/kcl/types/Solid), @solid: Solid,
radius: [number](/docs/kcl/types/number)(Length), radius: number(Length),
tags: [[Edge](/docs/kcl/types/Edge); 1+], tags: [Edge; 1+],
tolerance?: [number](/docs/kcl/types/number)(Length), tolerance?: number(Length),
tag?: tag, tag?: tag,
): [Solid](/docs/kcl/types/Solid) ): Solid
``` ```
### Arguments ### Arguments
| Name | Type | Description | Required | | Name | Type | Description | Required |
|----------|------|-------------|----------| |----------|------|-------------|----------|
| `solid` | [`Solid`](/docs/kcl/types/Solid) | The solid whose edges should be filletted | Yes | | `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)` | The radius of the fillet | Yes |
| `tags` | `[Edge; 1+]` | The paths you want to 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)` | The tolerance for this fillet | No |
| `tag` | `tag` | Create a new tag which refers to 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 ### Returns
[`Solid`](/docs/kcl/types/Solid) [`Solid`](/docs/kcl-std/types/std-types-Solid)
### Examples ### Examples

View File

@ -11,22 +11,21 @@ provided thickness remains around the exterior of the shape.
```kcl ```kcl
hollow( hollow(
@solid: [Solid](/docs/kcl/types/Solid), @solid: Solid,
thickness: [number](/docs/kcl/types/number)(Length), thickness: number(Length),
): [Solid](/docs/kcl/types/Solid) ): Solid
``` ```
### Arguments ### Arguments
| Name | Type | Description | Required | | Name | Type | Description | Required |
|----------|------|-------------|----------| |----------|------|-------------|----------|
| `solid` | [`Solid`](/docs/kcl/types/Solid) | Which solid to hollow out | Yes | | `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)` | The thickness of the remaining shell | Yes |
### Returns ### Returns
[`Solid`](/docs/kcl/types/Solid) [`Solid`](/docs/kcl-std/types/std-types-Solid)
### Examples ### Examples

View File

@ -11,24 +11,23 @@ provided thickness remains, taking volume starting at the providedface, leaving
```kcl ```kcl
shell( shell(
@solids: [[Solid](/docs/kcl/types/Solid); 1+], @solids: [Solid; 1+],
thickness: [number](/docs/kcl/types/number)(Length), thickness: number(Length),
faces: [tag; 1+], faces: [tag; 1+],
): [[[Solid](/docs/kcl/types/Solid)]](/docs/kcl/types/[Solid](/docs/kcl/types/Solid)) ): [Solid]
``` ```
### Arguments ### Arguments
| Name | Type | Description | Required | | Name | Type | Description | Required |
|----------|------|-------------|----------| |----------|------|-------------|----------|
| `solids` | `[Solid; 1+]` | Which solid (or solids) to shell out | Yes | | `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)` | The thickness of the shell | Yes |
| `faces` | `[tag; 1+]` | The faces you want removed | Yes | | `faces` | [`[tag; 1+]`](/docs/kcl-std/types/std-types-tag) | The faces you want removed | Yes |
### Returns ### Returns
[`[Solid]`](/docs/kcl/types/Solid) [`[Solid]`](/docs/kcl-std/types/std-types-Solid)
### Examples ### Examples

View File

@ -9,10 +9,9 @@ Convert a number to centimeters from its current units.
```kcl ```kcl
units::toCentimeters(@num: [number](/docs/kcl/types/number)(cm)): [number](/docs/kcl/types/number)(cm) units::toCentimeters(@num: number(cm)): number(cm)
``` ```
### Arguments ### Arguments
| Name | Type | Description | Required | | Name | Type | Description | Required |

View File

@ -9,10 +9,9 @@ Converts a number to degrees from its current units.
```kcl ```kcl
units::toDegrees(@num: [number](/docs/kcl/types/number)(deg)): [number](/docs/kcl/types/number)(deg) units::toDegrees(@num: number(deg)): number(deg)
``` ```
### Arguments ### Arguments
| Name | Type | Description | Required | | Name | Type | Description | Required |

View File

@ -9,10 +9,9 @@ Convert a number to feet from its current units.
```kcl ```kcl
units::toFeet(@num: [number](/docs/kcl/types/number)(ft)): [number](/docs/kcl/types/number)(ft) units::toFeet(@num: number(ft)): number(ft)
``` ```
### Arguments ### Arguments
| Name | Type | Description | Required | | Name | Type | Description | Required |

View File

@ -9,10 +9,9 @@ Convert a number to inches from its current units.
```kcl ```kcl
units::toInches(@num: [number](/docs/kcl/types/number)(in)): [number](/docs/kcl/types/number)(in) units::toInches(@num: number(in)): number(in)
``` ```
### Arguments ### Arguments
| Name | Type | Description | Required | | Name | Type | Description | Required |

View File

@ -9,10 +9,9 @@ Convert a number to meters from its current units.
```kcl ```kcl
units::toMeters(@num: [number](/docs/kcl/types/number)(m)): [number](/docs/kcl/types/number)(m) units::toMeters(@num: number(m)): number(m)
``` ```
### Arguments ### Arguments
| Name | Type | Description | Required | | Name | Type | Description | Required |

View File

@ -9,10 +9,9 @@ Convert a number to millimeters from its current units.
```kcl ```kcl
units::toMillimeters(@num: [number](/docs/kcl/types/number)(mm)): [number](/docs/kcl/types/number)(mm) units::toMillimeters(@num: number(mm)): number(mm)
``` ```
### Arguments ### Arguments
| Name | Type | Description | Required | | Name | Type | Description | Required |

View File

@ -9,10 +9,9 @@ Converts a number to radians from its current units.
```kcl ```kcl
units::toRadians(@num: [number](/docs/kcl/types/number)(rad)): [number](/docs/kcl/types/number)(rad) units::toRadians(@num: number(rad)): number(rad)
``` ```
### Arguments ### Arguments
| Name | Type | Description | Required | | Name | Type | Description | Required |

View File

@ -9,10 +9,9 @@ Converts a number to yards from its current units.
```kcl ```kcl
units::toYards(@num: [number](/docs/kcl/types/number)(yd)): [number](/docs/kcl/types/number)(yd) units::toYards(@num: number(yd)): number(yd)
``` ```
### Arguments ### Arguments
| Name | Type | Description | Required | | Name | Type | Description | Required |

View File

@ -9,15 +9,14 @@ Get the shared edge between two faces.
```kcl ```kcl
getCommon[Edge](/docs/kcl/types/Edge)(faces: [[TagIdentifier](/docs/kcl/types#tag-identifier)]): Uuid getCommonEdge(faces: [TagIdentifier]): Uuid
``` ```
### Arguments ### Arguments
| Name | Type | Description | Required | | Name | Type | Description | Required |
|----------|------|-------------|----------| |----------|------|-------------|----------|
| `faces` | `[TagIdentifier]` | The tags of the faces you want to find the common edge between | Yes | | `faces` | [`[TagIdentifier]`](/docs/kcl-lang/types#TagIdentifier) | The tags of the faces you want to find the common edge between | Yes |
### Returns ### Returns

View File

@ -9,15 +9,14 @@ Get the next adjacent edge to the edge given.
```kcl ```kcl
getNextAdjacent[Edge](/docs/kcl/types/Edge)(edge: [TagIdentifier](/docs/kcl/types#tag-identifier)): Uuid getNextAdjacentEdge(edge: TagIdentifier): Uuid
``` ```
### Arguments ### Arguments
| Name | Type | Description | Required | | Name | Type | Description | Required |
|----------|------|-------------|----------| |----------|------|-------------|----------|
| `edge` | [`TagIdentifier`](/docs/kcl/types#tag-identifier) | The tag of the edge you want to find the next adjacent edge of. | Yes | | `edge` | [`TagIdentifier`](/docs/kcl-lang/types#TagIdentifier) | The tag of the edge you want to find the next adjacent edge of. | Yes |
### Returns ### Returns

View File

@ -9,15 +9,14 @@ Get the opposite edge to the edge given.
```kcl ```kcl
getOpposite[Edge](/docs/kcl/types/Edge)(edge: [TagIdentifier](/docs/kcl/types#tag-identifier)): Uuid getOppositeEdge(edge: TagIdentifier): Uuid
``` ```
### Arguments ### Arguments
| Name | Type | Description | Required | | Name | Type | Description | Required |
|----------|------|-------------|----------| |----------|------|-------------|----------|
| `edge` | [`TagIdentifier`](/docs/kcl/types#tag-identifier) | The tag of the edge you want to find the opposite edge of. | Yes | | `edge` | [`TagIdentifier`](/docs/kcl-lang/types#TagIdentifier) | The tag of the edge you want to find the opposite edge of. | Yes |
### Returns ### Returns

View File

@ -9,15 +9,14 @@ Get the previous adjacent edge to the edge given.
```kcl ```kcl
getPreviousAdjacent[Edge](/docs/kcl/types/Edge)(edge: [TagIdentifier](/docs/kcl/types#tag-identifier)): Uuid getPreviousAdjacentEdge(edge: TagIdentifier): Uuid
``` ```
### Arguments ### Arguments
| Name | Type | Description | Required | | Name | Type | Description | Required |
|----------|------|-------------|----------| |----------|------|-------------|----------|
| `edge` | [`TagIdentifier`](/docs/kcl/types#tag-identifier) | The tag of the edge you want to find the previous adjacent edge of. | Yes | | `edge` | [`TagIdentifier`](/docs/kcl-lang/types#TagIdentifier) | The tag of the edge you want to find the previous adjacent edge of. | Yes |
### Returns ### Returns

160
docs/kcl-std/index.md Normal file
View File

@ -0,0 +1,160 @@
---
title: "KCL Standard Library"
excerpt: "Documentation for the KCL standard library for the Zoo Design Studio."
layout: manual
---
## Table of Contents
### Functions
* [**std**](/docs/kcl-std/modules/std)
* [`angledLine`](/docs/kcl-std/angledLine)
* [`angledLineThatIntersects`](/docs/kcl-std/angledLineThatIntersects)
* [`appearance`](/docs/kcl-std/appearance)
* [`arc`](/docs/kcl-std/arc)
* [`assert`](/docs/kcl-std/assert)
* [`assertIs`](/docs/kcl-std/assertIs)
* [`bezierCurve`](/docs/kcl-std/bezierCurve)
* [`circleThreePoint`](/docs/kcl-std/circleThreePoint)
* [`clone`](/docs/kcl-std/clone)
* [`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)
* [`helix`](/docs/kcl-std/functions/std-helix)
* [`intersect`](/docs/kcl-std/intersect)
* [`involuteCircular`](/docs/kcl-std/involuteCircular)
* [`lastSegX`](/docs/kcl-std/lastSegX)
* [`lastSegY`](/docs/kcl-std/lastSegY)
* [`legAngX`](/docs/kcl-std/legAngX)
* [`legAngY`](/docs/kcl-std/legAngY)
* [`legLen`](/docs/kcl-std/legLen)
* [`line`](/docs/kcl-std/line)
* [`loft`](/docs/kcl-std/loft)
* [`map`](/docs/kcl-std/map)
* [`offsetPlane`](/docs/kcl-std/functions/std-offsetPlane)
* [`patternCircular2d`](/docs/kcl-std/patternCircular2d)
* [`patternCircular3d`](/docs/kcl-std/patternCircular3d)
* [`patternLinear2d`](/docs/kcl-std/patternLinear2d)
* [`patternLinear3d`](/docs/kcl-std/patternLinear3d)
* [`patternTransform`](/docs/kcl-std/patternTransform)
* [`patternTransform2d`](/docs/kcl-std/patternTransform2d)
* [`polygon`](/docs/kcl-std/polygon)
* [`pop`](/docs/kcl-std/pop)
* [`profileStart`](/docs/kcl-std/profileStart)
* [`profileStartX`](/docs/kcl-std/profileStartX)
* [`profileStartY`](/docs/kcl-std/profileStartY)
* [`push`](/docs/kcl-std/push)
* [`reduce`](/docs/kcl-std/reduce)
* [`revolve`](/docs/kcl-std/functions/std-revolve)
* [`rotate`](/docs/kcl-std/rotate)
* [`scale`](/docs/kcl-std/scale)
* [`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)
* [`subtract`](/docs/kcl-std/subtract)
* [`subtract2d`](/docs/kcl-std/subtract2d)
* [`sweep`](/docs/kcl-std/sweep)
* [`tangentToEnd`](/docs/kcl-std/tangentToEnd)
* [`tangentialArc`](/docs/kcl-std/tangentialArc)
* [`translate`](/docs/kcl-std/translate)
* [`union`](/docs/kcl-std/union)
* [`xLine`](/docs/kcl-std/xLine)
* [`yLine`](/docs/kcl-std/yLine)
* [**std::math**](/docs/kcl-std/modules/std-math)
* [`abs`](/docs/kcl-std/functions/std-math-abs)
* [`acos`](/docs/kcl-std/functions/std-math-acos)
* [`asin`](/docs/kcl-std/functions/std-math-asin)
* [`atan`](/docs/kcl-std/functions/std-math-atan)
* [`atan2`](/docs/kcl-std/functions/std-math-atan2)
* [`ceil`](/docs/kcl-std/functions/std-math-ceil)
* [`cos`](/docs/kcl-std/functions/std-math-cos)
* [`floor`](/docs/kcl-std/functions/std-math-floor)
* [`ln`](/docs/kcl-std/functions/std-math-ln)
* [`log`](/docs/kcl-std/functions/std-math-log)
* [`log10`](/docs/kcl-std/functions/std-math-log10)
* [`log2`](/docs/kcl-std/functions/std-math-log2)
* [`max`](/docs/kcl-std/functions/std-math-max)
* [`min`](/docs/kcl-std/functions/std-math-min)
* [`polar`](/docs/kcl-std/functions/std-math-polar)
* [`pow`](/docs/kcl-std/functions/std-math-pow)
* [`rem`](/docs/kcl-std/functions/std-math-rem)
* [`round`](/docs/kcl-std/functions/std-math-round)
* [`sin`](/docs/kcl-std/functions/std-math-sin)
* [`sqrt`](/docs/kcl-std/functions/std-math-sqrt)
* [`tan`](/docs/kcl-std/functions/std-math-tan)
* [**std::sketch**](/docs/kcl-std/modules/std-sketch)
* [`circle`](/docs/kcl-std/functions/std-sketch-circle)
* [`mirror2d`](/docs/kcl-std/functions/std-sketch-mirror2d)
* [**std::solid**](/docs/kcl-std/modules/std-solid)
* [`chamfer`](/docs/kcl-std/functions/std-solid-chamfer)
* [`fillet`](/docs/kcl-std/functions/std-solid-fillet)
* [`hollow`](/docs/kcl-std/functions/std-solid-hollow)
* [`shell`](/docs/kcl-std/functions/std-solid-shell)
* [**std::units**](/docs/kcl-std/modules/std-units)
* [`units::toCentimeters`](/docs/kcl-std/functions/std-units-toCentimeters)
* [`units::toDegrees`](/docs/kcl-std/functions/std-units-toDegrees)
* [`units::toFeet`](/docs/kcl-std/functions/std-units-toFeet)
* [`units::toInches`](/docs/kcl-std/functions/std-units-toInches)
* [`units::toMeters`](/docs/kcl-std/functions/std-units-toMeters)
* [`units::toMillimeters`](/docs/kcl-std/functions/std-units-toMillimeters)
* [`units::toRadians`](/docs/kcl-std/functions/std-units-toRadians)
* [`units::toYards`](/docs/kcl-std/functions/std-units-toYards)
### Constants
* [**std**](/docs/kcl-std/modules/std)
* [`END`](/docs/kcl-std/consts/std-END)
* [`START`](/docs/kcl-std/consts/std-START)
* [`X`](/docs/kcl-std/consts/std-X)
* [`XY`](/docs/kcl-std/consts/std-XY)
* [`XZ`](/docs/kcl-std/consts/std-XZ)
* [`Y`](/docs/kcl-std/consts/std-Y)
* [`YZ`](/docs/kcl-std/consts/std-YZ)
* [`Z`](/docs/kcl-std/consts/std-Z)
* [**std::math**](/docs/kcl-std/modules/std-math)
* [`E`](/docs/kcl-std/consts/std-math-E)
* [`PI`](/docs/kcl-std/consts/std-math-PI)
* [`TAU`](/docs/kcl-std/consts/std-math-TAU)
* [**std::turns**](/docs/kcl-std/modules/std-turns)
* [`turns::HALF_TURN`](/docs/kcl-std/consts/std-turns-HALF_TURN)
* [`turns::QUARTER_TURN`](/docs/kcl-std/consts/std-turns-QUARTER_TURN)
* [`turns::THREE_QUARTER_TURN`](/docs/kcl-std/consts/std-turns-THREE_QUARTER_TURN)
* [`turns::ZERO`](/docs/kcl-std/consts/std-turns-ZERO)
### Types
See also the [types overview](/docs/kcl-lang/types)
* [**Primitive types**](/docs/kcl-std/modules/Primitive types)
* [`End`](/docs/kcl-std/types#End)
* [`ImportedGeometry`](/docs/kcl-std/types#ImportedGeometry)
* [`Start`](/docs/kcl-std/types#Start)
* [`TagDeclarator`](/docs/kcl-std/types#TagDeclarator)
* [`TagIdentifier`](/docs/kcl-std/types#TagIdentifier)
* [`any`](/docs/kcl-std/types/std-types-any)
* [`bool`](/docs/kcl-std/types/std-types-bool)
* [`number`](/docs/kcl-std/types/std-types-number)
* [`string`](/docs/kcl-std/types/std-types-string)
* [`tag`](/docs/kcl-std/types/std-types-tag)
* [**std::types**](/docs/kcl-std/modules/std-types)
* [`Axis2d`](/docs/kcl-std/types/std-types-Axis2d)
* [`Axis3d`](/docs/kcl-std/types/std-types-Axis3d)
* [`Edge`](/docs/kcl-std/types/std-types-Edge)
* [`Face`](/docs/kcl-std/types/std-types-Face)
* [`Helix`](/docs/kcl-std/types/std-types-Helix)
* [`Plane`](/docs/kcl-std/types/std-types-Plane)
* [`Point2d`](/docs/kcl-std/types/std-types-Point2d)
* [`Point3d`](/docs/kcl-std/types/std-types-Point3d)
* [`Sketch`](/docs/kcl-std/types/std-types-Sketch)
* [`Solid`](/docs/kcl-std/types/std-types-Solid)

View File

@ -10,22 +10,21 @@ Intersect computes the geometric intersection of multiple solid bodies, returnin
```kcl ```kcl
intersect( intersect(
solids: [[[Solid](/docs/kcl/types/Solid)]](/docs/kcl/types/[Solid](/docs/kcl/types/Solid)), solids: [Solid],
tolerance?: [number](/docs/kcl/types/number), tolerance?: number,
): [[[Solid](/docs/kcl/types/Solid)]](/docs/kcl/types/[Solid](/docs/kcl/types/Solid)) ): [Solid]
``` ```
### Arguments ### Arguments
| Name | Type | Description | Required | | Name | Type | Description | Required |
|----------|------|-------------|----------| |----------|------|-------------|----------|
| `solids` | [`[Solid]`](/docs/kcl/types/Solid) | The solids to intersect. | Yes | | `solids` | [`[Solid]`](/docs/kcl-std/types/std-types-Solid) | The solids to intersect. | Yes |
| `tolerance` | [`number`](/docs/kcl/types/number) | The tolerance to use for the intersection operation. | No | | `tolerance` | [`number`](/docs/kcl-std/types/std-types-number) | The tolerance to use for the intersection operation. | No |
### Returns ### Returns
[`[Solid]`](/docs/kcl/types/Solid) [`[Solid]`](/docs/kcl-std/types/std-types-Solid)
### Examples ### Examples
@ -44,8 +43,8 @@ fn cube(center, size) {
|> extrude(length = 10) |> extrude(length = 10)
} }
part001 = cube([0, 0], 10) part001 = cube(center = [0, 0], size = 10)
part002 = cube([7, 3], 5) part002 = cube(center = [7, 3], size = 5)
|> translate(z = 1) |> translate(z = 1)
intersectedPart = intersect([part001, part002]) intersectedPart = intersect([part001, part002])
@ -69,8 +68,8 @@ fn cube(center, size) {
|> extrude(length = 10) |> extrude(length = 10)
} }
part001 = cube([0, 0], 10) part001 = cube(center = [0, 0], size = 10)
part002 = cube([7, 3], 5) part002 = cube(center = [7, 3], size = 5)
|> translate(z = 1) |> translate(z = 1)
// This is the equivalent of: intersect([part001, part002]) // This is the equivalent of: intersect([part001, part002])

View File

@ -10,30 +10,29 @@ Extend the current sketch with a new involute circular curve.
```kcl ```kcl
involuteCircular( involuteCircular(
sketch: [Sketch](/docs/kcl/types/Sketch), sketch: Sketch,
startRadius: [number](/docs/kcl/types/number), startRadius: number,
endRadius: [number](/docs/kcl/types/number), endRadius: number,
angle: [number](/docs/kcl/types/number), angle: number,
reverse?: [bool](/docs/kcl/types/bool), reverse?: bool,
tag?: [TagDeclarator](/docs/kcl/types#tag-declaration), tag?: TagDeclarator,
): [Sketch](/docs/kcl/types/Sketch) ): Sketch
``` ```
### Arguments ### Arguments
| Name | Type | Description | Required | | Name | Type | Description | Required |
|----------|------|-------------|----------| |----------|------|-------------|----------|
| `sketch` | [`Sketch`](/docs/kcl/types/Sketch) | Which sketch should this path be added to? | Yes | | `sketch` | [`Sketch`](/docs/kcl-std/types/std-types-Sketch) | Which sketch should this path be added to? | Yes |
| `startRadius` | [`number`](/docs/kcl/types/number) | The involute is described between two circles, start_radius is the radius of the inner circle. | Yes | | `startRadius` | [`number`](/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`](/docs/kcl/types/number) | The involute is described between two circles, end_radius is the radius of the outer circle. | Yes | | `endRadius` | [`number`](/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`](/docs/kcl/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 | | `angle` | [`number`](/docs/kcl-std/types/std-types-number) | The angle to rotate the involute by. A value of zero will produce a curve with a tangent along the x-axis at the start point of the curve. | Yes |
| `reverse` | [`bool`](/docs/kcl/types/bool) | If reverse is true, the segment will start from the end of the involute, otherwise it will start from that start. Defaults to false. | 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. Defaults to false. | No |
| `tag` | [`TagDeclarator`](/docs/kcl/types#tag-declaration) | Create a new tag which refers to this line | No | | [`tag`](/docs/kcl-std/types/std-types-tag) | [`TagDeclarator`](/docs/kcl-lang/types#TagDeclarator) | Create a new tag which refers to this line | No |
### Returns ### Returns
[`Sketch`](/docs/kcl/types/Sketch) [`Sketch`](/docs/kcl-std/types/std-types-Sketch)
### Examples ### Examples

View File

@ -9,19 +9,18 @@ Extract the 'x' axis value of the last line segment in the provided 2-d sketch.
```kcl ```kcl
lastSegX(sketch: [Sketch](/docs/kcl/types/Sketch)): [number](/docs/kcl/types/number) lastSegX(sketch: Sketch): number
``` ```
### Arguments ### Arguments
| Name | Type | Description | Required | | Name | Type | Description | Required |
|----------|------|-------------|----------| |----------|------|-------------|----------|
| `sketch` | [`Sketch`](/docs/kcl/types/Sketch) | The sketch whose line segment is being queried | Yes | | `sketch` | [`Sketch`](/docs/kcl-std/types/std-types-Sketch) | The sketch whose line segment is being queried | Yes |
### Returns ### Returns
[`number`](/docs/kcl/types/number) [`number`](/docs/kcl-std/types/std-types-number)
### Examples ### Examples

View File

@ -9,19 +9,18 @@ Extract the 'y' axis value of the last line segment in the provided 2-d sketch.
```kcl ```kcl
lastSegY(sketch: [Sketch](/docs/kcl/types/Sketch)): [number](/docs/kcl/types/number) lastSegY(sketch: Sketch): number
``` ```
### Arguments ### Arguments
| Name | Type | Description | Required | | Name | Type | Description | Required |
|----------|------|-------------|----------| |----------|------|-------------|----------|
| `sketch` | [`Sketch`](/docs/kcl/types/Sketch) | The sketch whose line segment is being queried | Yes | | `sketch` | [`Sketch`](/docs/kcl-std/types/std-types-Sketch) | The sketch whose line segment is being queried | Yes |
### Returns ### Returns
[`number`](/docs/kcl/types/number) [`number`](/docs/kcl-std/types/std-types-number)
### Examples ### Examples

37
docs/kcl-std/legAngX.md Normal file
View File

@ -0,0 +1,37 @@
---
title: "legAngX"
excerpt: "Compute the angle of the given leg for x."
layout: manual
---
Compute the angle of the given leg for x.
```kcl
legAngX(
hypotenuse: number,
leg: number,
): number
```
### Arguments
| Name | Type | Description | Required |
|----------|------|-------------|----------|
| `hypotenuse` | [`number`](/docs/kcl-std/types/std-types-number) | The length of the triangle's hypotenuse | Yes |
| `leg` | [`number`](/docs/kcl-std/types/std-types-number) | The length of one of the triangle's legs (i.e. non-hypotenuse side) | Yes |
### Returns
[`number`](/docs/kcl-std/types/std-types-number)
### Examples
```kcl
legAngX(hypotenuse = 5, leg = 3)
```

37
docs/kcl-std/legAngY.md Normal file
View File

@ -0,0 +1,37 @@
---
title: "legAngY"
excerpt: "Compute the angle of the given leg for y."
layout: manual
---
Compute the angle of the given leg for y.
```kcl
legAngY(
hypotenuse: number,
leg: number,
): number
```
### Arguments
| Name | Type | Description | Required |
|----------|------|-------------|----------|
| `hypotenuse` | [`number`](/docs/kcl-std/types/std-types-number) | The length of the triangle's hypotenuse | Yes |
| `leg` | [`number`](/docs/kcl-std/types/std-types-number) | The length of one of the triangle's legs (i.e. non-hypotenuse side) | Yes |
### Returns
[`number`](/docs/kcl-std/types/std-types-number)
### Examples
```kcl
legAngY(hypotenuse = 5, leg = 3)
```

37
docs/kcl-std/legLen.md Normal file
View File

@ -0,0 +1,37 @@
---
title: "legLen"
excerpt: "Compute the length of the given leg."
layout: manual
---
Compute the length of the given leg.
```kcl
legLen(
hypotenuse: number,
leg: number,
): number
```
### Arguments
| Name | Type | Description | Required |
|----------|------|-------------|----------|
| `hypotenuse` | [`number`](/docs/kcl-std/types/std-types-number) | The length of the triangle's hypotenuse | Yes |
| `leg` | [`number`](/docs/kcl-std/types/std-types-number) | The length of one of the triangle's legs (i.e. non-hypotenuse side) | Yes |
### Returns
[`number`](/docs/kcl-std/types/std-types-number)
### Examples
```kcl
legLen(hypotenuse = 5, leg = 3)
```

View File

@ -10,26 +10,25 @@ Extend the current sketch with a new straight line.
```kcl ```kcl
line( line(
sketch: [Sketch](/docs/kcl/types/Sketch), sketch: Sketch,
endAbsolute?: [[[number](/docs/kcl/types/number)]](/docs/kcl/types/[number](/docs/kcl/types/number)), endAbsolute?: Point2d,
end?: [[[number](/docs/kcl/types/number)]](/docs/kcl/types/[number](/docs/kcl/types/number)), end?: Point2d,
tag?: [TagDeclarator](/docs/kcl/types#tag-declaration), tag?: TagDeclarator,
): [Sketch](/docs/kcl/types/Sketch) ): Sketch
``` ```
### Arguments ### Arguments
| Name | Type | Description | Required | | Name | Type | Description | Required |
|----------|------|-------------|----------| |----------|------|-------------|----------|
| `sketch` | [`Sketch`](/docs/kcl/types/Sketch) | Which sketch should this path be added to? | Yes | | `sketch` | [`Sketch`](/docs/kcl-std/types/std-types-Sketch) | Which sketch should this path be added to? | Yes |
| `endAbsolute` | [`[number]`](/docs/kcl/types/number) | Which absolute point should this line go to? Incompatible with `end`. | No | | `endAbsolute` | [`Point2d`](/docs/kcl-std/types/std-types-Point2d) | Which absolute point should this line go to? Incompatible with `end`. | No |
| `end` | [`[number]`](/docs/kcl/types/number) | How far away (along the X and Y axes) should this line go? Incompatible with `endAbsolute`. | 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` | [`TagDeclarator`](/docs/kcl/types#tag-declaration) | Create a new tag which refers to this line | No | | [`tag`](/docs/kcl-std/types/std-types-tag) | [`TagDeclarator`](/docs/kcl-lang/types#TagDeclarator) | Create a new tag which refers to this line | No |
### Returns ### Returns
[`Sketch`](/docs/kcl/types/Sketch) [`Sketch`](/docs/kcl-std/types/std-types-Sketch)
### Examples ### Examples

View File

@ -10,32 +10,31 @@ The sketches need to closed and on the same plane.
```kcl ```kcl
loft( loft(
sketches: [[[Sketch](/docs/kcl/types/Sketch)]](/docs/kcl/types/[Sketch](/docs/kcl/types/Sketch)), sketches: [Sketch],
vDegree: NonZeroU32, vDegree: number,
bezApproximateRational: [bool](/docs/kcl/types/bool), bezApproximateRational: bool,
baseCurveIndex?: integer, baseCurveIndex?: number,
tolerance?: [number](/docs/kcl/types/number), tolerance?: number,
tagStart?: [TagDeclarator](/docs/kcl/types#tag-declaration), tagStart?: TagDeclarator,
tagEnd?: [TagDeclarator](/docs/kcl/types#tag-declaration), tagEnd?: TagDeclarator,
): [Solid](/docs/kcl/types/Solid) ): Solid
``` ```
### Arguments ### Arguments
| Name | Type | Description | Required | | Name | Type | Description | Required |
|----------|------|-------------|----------| |----------|------|-------------|----------|
| `sketches` | [`[Sketch]`](/docs/kcl/types/Sketch) | Which sketches to loft. Must include at least 2 sketches. | Yes | | `sketches` | [`[Sketch]`](/docs/kcl-std/types/std-types-Sketch) | Which sketches to loft. Must include at least 2 sketches. | Yes |
| `vDegree` | `NonZeroU32` | Degree of the interpolation. Must be greater than zero. For example, use 2 for quadratic, or 3 for cubic interpolation in the V direction. This defaults to 2, if not specified. | Yes | | `vDegree` | [`number`](/docs/kcl-std/types/std-types-number) | Degree of the interpolation. Must be greater than zero. For example, use 2 for quadratic, or 3 for cubic interpolation in the V direction. This defaults to 2, if not specified. | Yes |
| `bezApproximateRational` | [`bool`](/docs/kcl/types/bool) | Attempt to approximate rational curves (such as arcs) using a bezier. This will remove banding around interpolations between arcs and non-arcs. It may produce errors in other scenarios Over time, this field won't be necessary. | Yes | | `bezApproximateRational` | [`bool`](/docs/kcl-std/types/std-types-bool) | Attempt to approximate rational curves (such as arcs) using a bezier. This will remove banding around interpolations between arcs and non-arcs. It may produce errors in other scenarios Over time, this field won't be necessary. | Yes |
| `baseCurveIndex` | `integer` | This can be set to override the automatically determined topological base curve, which is usually the first section encountered. | No | | `baseCurveIndex` | [`number`](/docs/kcl-std/types/std-types-number) | This can be set to override the automatically determined topological base curve, which is usually the first section encountered. | No |
| `tolerance` | [`number`](/docs/kcl/types/number) | Tolerance for the loft operation. | No | | `tolerance` | [`number`](/docs/kcl-std/types/std-types-number) | Tolerance for the loft operation. | No |
| `tagStart` | [`TagDeclarator`](/docs/kcl/types#tag-declaration) | A named tag for the face at the start of the loft, i.e. the original sketch | No | | `tagStart` | [`TagDeclarator`](/docs/kcl-lang/types#TagDeclarator) | A named tag for the face at the start of the loft, i.e. the original sketch | No |
| `tagEnd` | [`TagDeclarator`](/docs/kcl/types#tag-declaration) | A named tag for the face at the end of the loft, i.e. the last sketch | No | | `tagEnd` | [`TagDeclarator`](/docs/kcl-lang/types#TagDeclarator) | A named tag for the face at the end of the loft, i.e. the last sketch | No |
### Returns ### Returns
[`Solid`](/docs/kcl/types/Solid) [`Solid`](/docs/kcl-std/types/std-types-Solid)
### Examples ### Examples

View File

@ -10,29 +10,28 @@ Given a list like `[a, b, c]`, and a function like `f`, returns `[f(a), f(b), f(
```kcl ```kcl
map( map(
array: [[[KclValue](/docs/kcl/types/KclValue)]](/docs/kcl/types/[KclValue](/docs/kcl/types/KclValue)), array: [any],
f: FunctionSource, f: FunctionSource,
): [[[KclValue](/docs/kcl/types/KclValue)]](/docs/kcl/types/[KclValue](/docs/kcl/types/KclValue)) ): [any]
``` ```
### Arguments ### Arguments
| Name | Type | Description | Required | | Name | Type | Description | Required |
|----------|------|-------------|----------| |----------|------|-------------|----------|
| `array` | [`[KclValue]`](/docs/kcl/types/KclValue) | Input array. The output array is this input array, but every element has had the function `f` run on it. | Yes | | `array` | [`[any]`](/docs/kcl-std/types/std-types-any) | Input array. The output array is this input array, but every element has had the function `f` run on it. | Yes |
| `f` | `FunctionSource` | A function. The output array is just the input array, but `f` has been run on every item. | Yes | | `f` | `FunctionSource` | A function. The output array is just the input array, but `f` has been run on every item. | Yes |
### Returns ### Returns
[`[KclValue]`](/docs/kcl/types/KclValue) [`[any]`](/docs/kcl-std/types/std-types-any)
### Examples ### Examples
```kcl ```kcl
r = 10 // radius r = 10 // radius
fn drawCircle(id) { fn drawCircle(@id) {
return startSketchOn(XY) return startSketchOn(XY)
|> circle(center = [id * 2 * r, 0], radius = r) |> circle(center = [id * 2 * r, 0], radius = r)
} }

View File

@ -0,0 +1,38 @@
---
title: "std::math"
excerpt: ""
layout: manual
---
## Functions and constants
* [`E`](/docs/kcl-std/consts/std-math-E)
* [`PI`](/docs/kcl-std/consts/std-math-PI)
* [`TAU`](/docs/kcl-std/consts/std-math-TAU)
* [`abs`](/docs/kcl-std/functions/std-math-abs)
* [`acos`](/docs/kcl-std/functions/std-math-acos)
* [`asin`](/docs/kcl-std/functions/std-math-asin)
* [`atan`](/docs/kcl-std/functions/std-math-atan)
* [`atan2`](/docs/kcl-std/functions/std-math-atan2)
* [`ceil`](/docs/kcl-std/functions/std-math-ceil)
* [`cos`](/docs/kcl-std/functions/std-math-cos)
* [`floor`](/docs/kcl-std/functions/std-math-floor)
* [`ln`](/docs/kcl-std/functions/std-math-ln)
* [`log`](/docs/kcl-std/functions/std-math-log)
* [`log10`](/docs/kcl-std/functions/std-math-log10)
* [`log2`](/docs/kcl-std/functions/std-math-log2)
* [`max`](/docs/kcl-std/functions/std-math-max)
* [`min`](/docs/kcl-std/functions/std-math-min)
* [`polar`](/docs/kcl-std/functions/std-math-polar)
* [`pow`](/docs/kcl-std/functions/std-math-pow)
* [`rem`](/docs/kcl-std/functions/std-math-rem)
* [`round`](/docs/kcl-std/functions/std-math-round)
* [`sin`](/docs/kcl-std/functions/std-math-sin)
* [`sqrt`](/docs/kcl-std/functions/std-math-sqrt)
* [`tan`](/docs/kcl-std/functions/std-math-tan)

View File

@ -0,0 +1,16 @@
---
title: "std::sketch"
excerpt: ""
layout: manual
---
## Functions and constants
* [`circle`](/docs/kcl-std/functions/std-sketch-circle)
* [`mirror2d`](/docs/kcl-std/functions/std-sketch-mirror2d)

View File

@ -0,0 +1,18 @@
---
title: "std::solid"
excerpt: ""
layout: manual
---
## Functions and constants
* [`chamfer`](/docs/kcl-std/functions/std-solid-chamfer)
* [`fillet`](/docs/kcl-std/functions/std-solid-fillet)
* [`hollow`](/docs/kcl-std/functions/std-solid-hollow)
* [`shell`](/docs/kcl-std/functions/std-solid-shell)

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