Compare commits
115 Commits
kcl-63
...
bug-fillet
Author | SHA1 | Date | |
---|---|---|---|
c2dd4d1d2e | |||
6866c9d418 | |||
819ee23565 | |||
02a37e207f | |||
7356af556a | |||
88288c3979 | |||
763b05e2e6 | |||
39351aed58 | |||
e8e7c22b95 | |||
ad975152c1 | |||
ed406734a7 | |||
89bae66257 | |||
16f5d9c284 | |||
00148d84d8 | |||
390cedf79f | |||
b686c79b49 | |||
2d77aa0d36 | |||
012102fe86 | |||
1a6b147107 | |||
2978b34b7b | |||
dee77e814a | |||
820082d7f2 | |||
525f213f1d | |||
58a81da039 | |||
0002295cdf | |||
c050739f41 | |||
ccd5b0272d | |||
f1fdf48834 | |||
bae875382c | |||
14ce66bcc1 | |||
644c561815 | |||
5f31f3a6b3 | |||
a0afe9dd0e | |||
9c29756a38 | |||
bf63b21d74 | |||
0ea0d1703e | |||
29b8a442c2 | |||
844f229b5a | |||
fa51b4bbbc | |||
1fa6e1eccc | |||
44b810ee0a | |||
a9998be176 | |||
5e200aebcc | |||
e0cd3efc64 | |||
77e3efde9a | |||
a173a82d59 | |||
4d2bc18c2f | |||
aca5fdb521 | |||
8867258e47 | |||
f6cb725268 | |||
1bd570ceb9 | |||
1c87298b44 | |||
3a23ec1bee | |||
d96a4d3337 | |||
94452cce88 | |||
2e754f2a11 | |||
719136937e | |||
e207552255 | |||
1835e49191 | |||
145c28bbd5 | |||
a58a3361b6 | |||
efba773635 | |||
4439229ad2 | |||
0dcb8baf64 | |||
921adcb3eb | |||
24465cf463 | |||
d0b0365f75 | |||
0f88598dc0 | |||
d7e80b3cc7 | |||
25bb95a66e | |||
6e115c19d5 | |||
5a18f551aa | |||
0426967bf7 | |||
9d893d8f0b | |||
8de648f0db | |||
50f8131d83 | |||
5a4f8bd522 | |||
f8e53d941d | |||
717a2039cb | |||
6e7c44fca7 | |||
ffbe20b586 | |||
9547e95e9d | |||
a1f31f4348 | |||
604e244395 | |||
fe22a67cf6 | |||
885d2afaa3 | |||
be4a32a59e | |||
c501d3bfbf | |||
0ef1483e11 | |||
bbaaf86e4d | |||
6a0e10f8ab | |||
5c0ca52291 | |||
bff13f6bfe | |||
6001b71f06 | |||
bd1e68a4c8 | |||
8589f8fc5f | |||
6641e1178b | |||
6e0f1e71b2 | |||
0e945b6457 | |||
19155a9132 | |||
305d613d40 | |||
95f2caacab | |||
8f61ee1d2f | |||
b02dbd4fe6 | |||
668f6671a9 | |||
f6387eb7e9 | |||
83a87b046f | |||
20c2ce3bac | |||
2956f9ed55 | |||
510d74f2c7 | |||
457ab28f74 | |||
1502f923ee | |||
f03a684eec | |||
45e17c50e7 | |||
6bf74379a7 |
12
.github/ci-cd-scripts/playwright-electron.sh
vendored
12
.github/ci-cd-scripts/playwright-electron.sh
vendored
@ -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
441
.github/dependabot.yml
vendored
@ -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:
|
||||||
|
6
.github/workflows/cargo-bench.yml
vendored
6
.github/workflows/cargo-bench.yml
vendored
@ -26,12 +26,8 @@ name: cargo bench
|
|||||||
jobs:
|
jobs:
|
||||||
cargo-bench:
|
cargo-bench:
|
||||||
name: cargo bench
|
name: cargo bench
|
||||||
runs-on:
|
runs-on: ubuntu-latest
|
||||||
- runs-on=${{ github.run_id }}
|
|
||||||
- runner=32cpu-linux-x64
|
|
||||||
- extras=s3-cache
|
|
||||||
steps:
|
steps:
|
||||||
- uses: runs-on/action@v1
|
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- name: Use correct Rust toolchain
|
- name: Use correct Rust toolchain
|
||||||
shell: bash
|
shell: bash
|
||||||
|
95
.github/workflows/cargo-test.yml
vendored
95
.github/workflows/cargo-test.yml
vendored
@ -13,10 +13,14 @@ concurrency:
|
|||||||
cancel-in-progress: true
|
cancel-in-progress: true
|
||||||
name: cargo test
|
name: cargo test
|
||||||
jobs:
|
jobs:
|
||||||
cargotest:
|
build-test-artifacts:
|
||||||
name: cargo test
|
name: Build test artifacts
|
||||||
runs-on: ubuntu-latest-8-cores
|
runs-on:
|
||||||
|
- runs-on=${{ github.run_id }}
|
||||||
|
- runner=8cpu-linux-x64
|
||||||
|
- extras=s3-cache
|
||||||
steps:
|
steps:
|
||||||
|
- uses: runs-on/action@v1
|
||||||
- uses: actions/create-github-app-token@v1
|
- uses: actions/create-github-app-token@v1
|
||||||
id: app-token
|
id: app-token
|
||||||
with:
|
with:
|
||||||
@ -39,7 +43,6 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
GH_ACTIONS_AXIOM_TOKEN: ${{ secrets.GH_ACTIONS_AXIOM_TOKEN }}
|
GH_ACTIONS_AXIOM_TOKEN: ${{ secrets.GH_ACTIONS_AXIOM_TOKEN }}
|
||||||
OS_NAME: ${{ env.OS_NAME }}
|
OS_NAME: ${{ env.OS_NAME }}
|
||||||
- uses: taiki-e/install-action@cargo-llvm-cov
|
|
||||||
- uses: taiki-e/install-action@nextest
|
- uses: taiki-e/install-action@nextest
|
||||||
- name: Install just
|
- name: Install just
|
||||||
uses: taiki-e/install-action@just
|
uses: taiki-e/install-action@just
|
||||||
@ -81,11 +84,11 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
cd rust
|
cd rust
|
||||||
cargo nextest run --workspace --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=2 --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
|
||||||
RUST_MIN_STACK: 10485760000
|
|
||||||
- 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'
|
||||||
shell: bash
|
shell: bash
|
||||||
@ -114,27 +117,73 @@ 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
|
||||||
RUST_MIN_STACK: 10485760000
|
- name: Build and archive tests
|
||||||
- name: cargo test
|
run: |
|
||||||
if: steps.path-changes.outputs.outside-kcl-samples == 'true'
|
cd rust
|
||||||
|
cargo nextest archive --workspace --features artifact-graph --archive-file nextest-archive.tar.zst
|
||||||
|
- name: Upload archive to workflow
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: nextest-archive
|
||||||
|
path: rust/nextest-archive.tar.zst
|
||||||
|
|
||||||
|
run-test-artifacts:
|
||||||
|
name: cargo test (shard ${{ matrix.partitionIndex}})
|
||||||
|
runs-on:
|
||||||
|
- runs-on=${{ github.run_id }}
|
||||||
|
- runner=32cpu-linux-x64
|
||||||
|
- extras=s3-cache
|
||||||
|
needs: build-test-artifacts
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
partitionIndex: [1, 2, 3, 4, 5, 6]
|
||||||
|
partitionTotal: [6]
|
||||||
|
steps:
|
||||||
|
- uses: runs-on/action@v1
|
||||||
|
- uses: actions/create-github-app-token@v1
|
||||||
|
id: app-token
|
||||||
|
with:
|
||||||
|
app-id: ${{ secrets.MODELING_APP_GH_APP_ID }}
|
||||||
|
private-key: ${{ secrets.MODELING_APP_GH_APP_PRIVATE_KEY }}
|
||||||
|
owner: ${{ github.repository_owner }}
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
token: ${{ steps.app-token.outputs.token }}
|
||||||
|
- name: Use correct Rust toolchain
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
[ -e rust-toolchain.toml ] || cp rust/rust-toolchain.toml ./
|
||||||
|
- name: Install rust
|
||||||
|
uses: actions-rust-lang/setup-rust-toolchain@v1
|
||||||
|
with:
|
||||||
|
cache: false # Configured below.
|
||||||
|
- name: Start Vector
|
||||||
|
run: .github/ci-cd-scripts/start-vector-ubuntu.sh
|
||||||
|
env:
|
||||||
|
GH_ACTIONS_AXIOM_TOKEN: ${{ secrets.GH_ACTIONS_AXIOM_TOKEN }}
|
||||||
|
OS_NAME: ${{ env.OS_NAME }}
|
||||||
|
- uses: taiki-e/install-action@nextest
|
||||||
|
- name: Download archive
|
||||||
|
uses: actions/download-artifact@v4
|
||||||
|
with:
|
||||||
|
name: nextest-archive
|
||||||
|
- name: Run tests
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |-
|
run: |-
|
||||||
|
cp nextest-archive.tar.zst rust/nextest-archive.tar.zst
|
||||||
|
ls -lah
|
||||||
cd rust
|
cd rust
|
||||||
cargo llvm-cov nextest --workspace --lcov --output-path lcov.info --retries=2 --no-fail-fast -P ci 2>&1 | tee /tmp/github-actions.log
|
cargo nextest run\
|
||||||
|
--retries=2 --no-fail-fast -P ci --archive-file nextest-archive.tar.zst \
|
||||||
|
--partition count:${{ matrix.partitionIndex}}/${{ matrix.partitionTotal }} \
|
||||||
|
2>&1 | tee /tmp/github-actions.log
|
||||||
env:
|
env:
|
||||||
KITTYCAD_API_TOKEN: ${{secrets.KITTYCAD_API_TOKEN}}
|
KITTYCAD_API_TOKEN: ${{secrets.KITTYCAD_API_TOKEN_DEV}}
|
||||||
RUST_MIN_STACK: 10485760000
|
ZOO_HOST: https://api.dev.zoo.dev
|
||||||
- name: Upload to codecov.io
|
|
||||||
if: steps.path-changes.outputs.outside-kcl-samples == 'true'
|
|
||||||
uses: codecov/codecov-action@v5
|
|
||||||
with:
|
|
||||||
token: ${{secrets.CODECOV_TOKEN}}
|
|
||||||
fail_ci_if_error: true
|
|
||||||
flags: rust
|
|
||||||
verbose: true
|
|
||||||
files: lcov.info
|
|
||||||
|
|
||||||
|
47
.github/workflows/e2e-tests.yml
vendored
47
.github/workflows/e2e-tests.yml
vendored
@ -3,7 +3,6 @@ on:
|
|||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
- all-e2e # this bypasses `fixme()` using `orRunWhenFullSuiteEnabled()`
|
|
||||||
pull_request:
|
pull_request:
|
||||||
schedule:
|
schedule:
|
||||||
- cron: 0 * * * * # hourly
|
- cron: 0 * * * * # hourly
|
||||||
@ -278,28 +277,42 @@ jobs:
|
|||||||
timeout-minutes: 60
|
timeout-minutes: 60
|
||||||
env:
|
env:
|
||||||
OS_NAME: ${{ contains(matrix.os, 'ubuntu') && 'ubuntu' || (contains(matrix.os, 'windows') && 'windows' || 'macos') }}
|
OS_NAME: ${{ contains(matrix.os, 'ubuntu') && 'ubuntu' || (contains(matrix.os, 'windows') && 'windows' || 'macos') }}
|
||||||
name: playwright:electron:${{ contains(matrix.os, 'ubuntu') && 'ubuntu' || (contains(matrix.os, 'windows') && 'windows' || 'macos') }}:${{ matrix.shardIndex }}:${{ matrix.shardTotal }}
|
name: playwright:electron:${{ contains(matrix.os, 'ubuntu') && 'ubuntu' || (contains(matrix.os, 'windows') && 'windows' || 'macos') }} (shard ${{ matrix.shardIndex }})
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
# TODO: enable namespace-profile-windows-latest once available
|
# TODO: enable namespace-profile-windows-latest once available
|
||||||
os:
|
include:
|
||||||
- "runs-on=${{ github.run_id }}/family=i7ie.2xlarge/image=ubuntu22-full-x64"
|
- os: "runs-on=${{ github.run_id }}/family=i7ie.2xlarge/image=ubuntu22-full-x64"
|
||||||
- namespace-profile-macos-8-cores
|
shardIndex: 1
|
||||||
- windows-latest-8-cores
|
shardTotal: 8
|
||||||
shardIndex: [1, 2, 3, 4]
|
- os: "runs-on=${{ github.run_id }}/family=i7ie.2xlarge/image=ubuntu22-full-x64"
|
||||||
shardTotal: [4]
|
shardIndex: 2
|
||||||
# Disable macos and windows tests on hourly e2e tests since we only care
|
shardTotal: 8
|
||||||
# about server side changes.
|
- os: "runs-on=${{ github.run_id }}/family=i7ie.2xlarge/image=ubuntu22-full-x64"
|
||||||
# Technique from https://github.com/joaomcteixeira/python-project-skeleton/pull/31/files
|
shardIndex: 3
|
||||||
isScheduled:
|
shardTotal: 8
|
||||||
- ${{ github.event_name == 'schedule' }}
|
- os: "runs-on=${{ github.run_id }}/family=i7ie.2xlarge/image=ubuntu22-full-x64"
|
||||||
exclude:
|
shardIndex: 4
|
||||||
|
shardTotal: 8
|
||||||
|
- os: "runs-on=${{ github.run_id }}/family=i7ie.2xlarge/image=ubuntu22-full-x64"
|
||||||
|
shardIndex: 5
|
||||||
|
shardTotal: 8
|
||||||
|
- os: "runs-on=${{ github.run_id }}/family=i7ie.2xlarge/image=ubuntu22-full-x64"
|
||||||
|
shardIndex: 6
|
||||||
|
shardTotal: 8
|
||||||
|
- os: "runs-on=${{ github.run_id }}/family=i7ie.2xlarge/image=ubuntu22-full-x64"
|
||||||
|
shardIndex: 7
|
||||||
|
shardTotal: 8
|
||||||
|
- os: "runs-on=${{ github.run_id }}/family=i7ie.2xlarge/image=ubuntu22-full-x64"
|
||||||
|
shardIndex: 8
|
||||||
|
shardTotal: 8
|
||||||
- os: namespace-profile-macos-8-cores
|
- os: namespace-profile-macos-8-cores
|
||||||
isScheduled: true
|
shardIndex: 1
|
||||||
|
shardTotal: 1
|
||||||
- os: windows-latest-8-cores
|
- os: windows-latest-8-cores
|
||||||
isScheduled: true
|
shardIndex: 1
|
||||||
# TODO: add ref here for main and latest release tag
|
shardTotal: 1
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
6
.github/workflows/generate-website-docs.yml
vendored
6
.github/workflows/generate-website-docs.yml
vendored
@ -40,13 +40,15 @@ jobs:
|
|||||||
# cleanup old
|
# cleanup old
|
||||||
rm -rf documentation/content/pages/docs/kcl/*.md
|
rm -rf documentation/content/pages/docs/kcl/*.md
|
||||||
rm -rf documentation/content/pages/docs/kcl/types
|
rm -rf documentation/content/pages/docs/kcl/types
|
||||||
rm -rf documentation/content/pages/docs/kcl/settings
|
rm -rf documentation/content/pages/docs/kcl/functions
|
||||||
rm -rf documentation/content/pages/docs/kcl/consts
|
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/*.md documentation/content/pages/docs/kcl/
|
||||||
mv -f docs/kcl/types documentation/content/pages/docs/kcl/
|
mv -f docs/kcl/types documentation/content/pages/docs/kcl/
|
||||||
mv -f docs/kcl/settings documentation/content/pages/docs/kcl/
|
mv -f docs/kcl/functions documentation/content/pages/docs/kcl/
|
||||||
mv -f docs/kcl/consts documentation/content/pages/docs/kcl/
|
mv -f docs/kcl/consts documentation/content/pages/docs/kcl/
|
||||||
|
# We don't need the README
|
||||||
|
rm documentation/content/pages/docs/kcl/README.md
|
||||||
- name: move kcl-samples
|
- name: move kcl-samples
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
|
3
.github/workflows/kcl-python-bindings.yml
vendored
3
.github/workflows/kcl-python-bindings.yml
vendored
@ -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
|
||||||
|
45
.github/workflows/update-e2e-branch.yml
vendored
45
.github/workflows/update-e2e-branch.yml
vendored
@ -1,45 +0,0 @@
|
|||||||
name: update-e2e-branch
|
|
||||||
|
|
||||||
# This is used to sync the `all-e2e` branch with the `main` branch for the
|
|
||||||
# logic in the test utility `orRunWhenFullSuiteEnabled()` that allows all e2e
|
|
||||||
# tests to run on a particular branch to analyze failures metrics in Axiom.
|
|
||||||
|
|
||||||
on:
|
|
||||||
schedule:
|
|
||||||
- cron: '0 * * * *' # runs every hour
|
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: write
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
update-branch:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/create-github-app-token@v1
|
|
||||||
id: app-token
|
|
||||||
with:
|
|
||||||
app-id: ${{ secrets.MODELING_APP_GH_APP_ID }}
|
|
||||||
private-key: ${{ secrets.MODELING_APP_GH_APP_PRIVATE_KEY }}
|
|
||||||
owner: ${{ github.repository_owner }}
|
|
||||||
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
token: ${{ steps.app-token.outputs.token }}
|
|
||||||
|
|
||||||
- name: Sync with main
|
|
||||||
run: |
|
|
||||||
# Create the branch
|
|
||||||
git checkout all-e2e || git checkout -b all-e2e
|
|
||||||
|
|
||||||
# Reset to main
|
|
||||||
git fetch origin
|
|
||||||
git reset --hard origin/main
|
|
||||||
|
|
||||||
# Get a new SHA to prevent overwriting the commit status on main
|
|
||||||
git config --local user.email "github-actions[bot]@users.noreply.github.com"
|
|
||||||
git config --local user.name "github-actions[bot]"
|
|
||||||
git commit --allow-empty --message="[all-e2e] $(git log --max-count=1 --pretty=%B)"
|
|
||||||
|
|
||||||
# Overwrite the branch
|
|
||||||
git remote set-url origin https://x-access-token:${{ steps.app-token.outputs.token }}@github.com/${{ github.repository }}.git
|
|
||||||
git push --force origin all-e2e
|
|
1
.gitignore
vendored
1
.gitignore
vendored
@ -85,3 +85,4 @@ venv
|
|||||||
|
|
||||||
.vscode-test
|
.vscode-test
|
||||||
.biome/
|
.biome/
|
||||||
|
.million
|
||||||
|
1
.husky/pre-commit
Executable file
1
.husky/pre-commit
Executable file
@ -0,0 +1 @@
|
|||||||
|
npm run fmt
|
@ -1,4 +0,0 @@
|
|||||||
#!/usr/bin/env sh
|
|
||||||
. "$(dirname -- "$0")/_/husky.sh"
|
|
||||||
|
|
||||||
npm run fmt-check
|
|
26
docs/kcl-src/known-issues.md
Normal file
26
docs/kcl-src/known-issues.md
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
---
|
||||||
|
title: "KCL Known Issues"
|
||||||
|
excerpt: "Known issues with the KCL standard library for the Zoo Design Studio."
|
||||||
|
layout: manual
|
||||||
|
---
|
||||||
|
|
||||||
|
The following are bugs that are not in modeling-app or kcl itself. These bugs
|
||||||
|
once fixed in engine will just start working here with no language changes.
|
||||||
|
|
||||||
|
- **Sketch on Face**: If your sketch is outside the edges of the face (on which you
|
||||||
|
are sketching) you will get multiple models returned instead of one single
|
||||||
|
model for that sketch and its underlying 3D object.
|
||||||
|
If you see a red line around your model, it means this is happening.
|
||||||
|
|
||||||
|
- **Import**: Right now you can import a file, even if that file has brep data
|
||||||
|
you cannot edit it, after v1, the engine will account for this.
|
||||||
|
|
||||||
|
- **Fillets**: Fillets cannot intersect, you will get an error. Only simple fillet
|
||||||
|
cases work currently.
|
||||||
|
|
||||||
|
- **Chamfers**: Chamfers cannot intersect, you will get an error. Only simple
|
||||||
|
chamfer cases work currently.
|
||||||
|
|
||||||
|
- **Appearance**: Changing the appearance on a loft does not work.
|
||||||
|
|
||||||
|
- **CSG Booleans**: Coplanar (bodies that share a plane) unions, subtractions, and intersections are not currently supported.
|
365
docs/kcl-src/modules.md
Normal file
365
docs/kcl-src/modules.md
Normal file
@ -0,0 +1,365 @@
|
|||||||
|
---
|
||||||
|
title: "KCL Modules"
|
||||||
|
excerpt: "Documentation of modules for the KCL language for the Zoo Design Studio."
|
||||||
|
layout: manual
|
||||||
|
---
|
||||||
|
|
||||||
|
`KCL` allows splitting code up into multiple files. Each file is somewhat
|
||||||
|
isolated from other files as a separate module.
|
||||||
|
|
||||||
|
When you define a function, you can use `export` before it to make it available
|
||||||
|
to other modules.
|
||||||
|
|
||||||
|
```kcl
|
||||||
|
// util.kcl
|
||||||
|
export fn increment(@x) {
|
||||||
|
return x + 1
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
Other files in the project can now import functions that have been exported.
|
||||||
|
This makes them available to use in another file.
|
||||||
|
|
||||||
|
```norun
|
||||||
|
// main.kcl
|
||||||
|
import increment from "util.kcl"
|
||||||
|
|
||||||
|
answer = increment(41)
|
||||||
|
```
|
||||||
|
|
||||||
|
Imported files _must_ be in the same project so that units are uniform across
|
||||||
|
modules. This means that it must be in the same directory.
|
||||||
|
|
||||||
|
Import statements must be at the top-level of a file. It is not allowed to have
|
||||||
|
an `import` statement inside a function or in the body of an if‑else.
|
||||||
|
|
||||||
|
Multiple functions can be exported in a file.
|
||||||
|
|
||||||
|
```kcl
|
||||||
|
// util.kcl
|
||||||
|
export fn increment(@x) {
|
||||||
|
return x + 1
|
||||||
|
}
|
||||||
|
|
||||||
|
export fn decrement(@x) {
|
||||||
|
return x - 1
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
When importing, you can import multiple functions at once.
|
||||||
|
|
||||||
|
```norun
|
||||||
|
import increment, decrement from "util.kcl"
|
||||||
|
```
|
||||||
|
|
||||||
|
Imported symbols can be renamed for convenience or to avoid name collisions.
|
||||||
|
|
||||||
|
```norun
|
||||||
|
import increment as inc, decrement as dec from "util.kcl"
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Functions vs `clone`
|
||||||
|
|
||||||
|
There are two common patterns for re‑using geometry:
|
||||||
|
|
||||||
|
1. **Wrap the construction in a function** – flexible and fully parametric.
|
||||||
|
2. **Duplicate an existing object with `clone`** – lightning‑fast, but an exact
|
||||||
|
duplicate.
|
||||||
|
|
||||||
|
### Parametric function example
|
||||||
|
|
||||||
|
```kcl
|
||||||
|
fn cube(center) {
|
||||||
|
return startSketchOn(XY)
|
||||||
|
|> startProfile(at = [center[0] - 10, center[1] - 10])
|
||||||
|
|> line(endAbsolute = [center[0] + 10, center[1] - 10])
|
||||||
|
|> line(endAbsolute = [center[0] + 10, center[1] + 10])
|
||||||
|
|> line(endAbsolute = [center[0] - 10, center[1] + 10])
|
||||||
|
|> close()
|
||||||
|
|> extrude(length = 10)
|
||||||
|
}
|
||||||
|
|
||||||
|
myCube = cube(center = [0, 0])
|
||||||
|
```
|
||||||
|
|
||||||
|
*Pros*
|
||||||
|
- Any argument can be a parameter – size, position, appearance, etc.
|
||||||
|
- Works great inside loops, arrays, or optimisation sweeps.
|
||||||
|
|
||||||
|
*Cons*
|
||||||
|
- Every invocation rebuilds the entire feature tree.
|
||||||
|
- **Slower** than a straight duplicate – each call is its own render job.
|
||||||
|
|
||||||
|
### `clone` example
|
||||||
|
|
||||||
|
```kcl
|
||||||
|
sketch001 = startSketchOn(-XZ)
|
||||||
|
|> circle(center = [0, 0], radius = 10)
|
||||||
|
|> extrude(length = 5)
|
||||||
|
|> appearance(color = "#ff0000", metalness = 90, roughness = 90)
|
||||||
|
|
||||||
|
sketch002 = clone(sketch001) // ✓ instant copy
|
||||||
|
```
|
||||||
|
|
||||||
|
*Pros*
|
||||||
|
- Roughly an O(1) operation – we just duplicate the underlying engine handle.
|
||||||
|
- Perfect when you need ten identical bolts or two copies of the same imported STEP file.
|
||||||
|
|
||||||
|
*Cons*
|
||||||
|
- **Not parametric** – the clone is exactly the same shape as the source.
|
||||||
|
- If you need to tweak dimensions per‑instance, you’re back to a function.
|
||||||
|
|
||||||
|
> **Rule of thumb** – Reach for `clone` when the geometry is already what you want. Reach for a function when you need customisation.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Module‑level parallelism
|
||||||
|
|
||||||
|
Under the hood, the Design Studio runs **every module in parallel** where it can. This means:
|
||||||
|
|
||||||
|
- The top‑level code of `foo.kcl`, `bar.kcl`, and `baz.kcl` all start executing immediately and concurrently.
|
||||||
|
- Imports that read foreign files (STEP/OBJ/…) overlap their I/O and background render.
|
||||||
|
- CPU‑bound calculations in separate modules get their own worker threads.
|
||||||
|
|
||||||
|
### Why modules beat one‑big‑file
|
||||||
|
|
||||||
|
If you shoe‑horn everything into `main.kcl`, each statement runs sequentially:
|
||||||
|
|
||||||
|
```norun
|
||||||
|
import "big.step" as gizmo // blocks main while reading
|
||||||
|
|
||||||
|
gizmo |> translate(x=50) // blocks again while waiting for render
|
||||||
|
```
|
||||||
|
|
||||||
|
Split `gizmo` into its own file and the read/render can overlap whatever else `main.kcl` is doing.
|
||||||
|
|
||||||
|
```norun
|
||||||
|
// gizmo.kcl (worker A)
|
||||||
|
import "big.step"
|
||||||
|
|
||||||
|
// main.kcl (worker B)
|
||||||
|
import "gizmo.kcl" as gizmo // non‑blocking
|
||||||
|
|
||||||
|
// ... other setup ...
|
||||||
|
|
||||||
|
gizmo |> translate(x=50) // only blocks here
|
||||||
|
```
|
||||||
|
|
||||||
|
### Gotcha: defining but **not** calling functions
|
||||||
|
|
||||||
|
Defining a function inside a module is instantaneous – we just record the byte‑code. The heavy lifting happens when the function is **called**. So:
|
||||||
|
|
||||||
|
```norun
|
||||||
|
// util.kcl
|
||||||
|
export fn makeBolt(size) { /* … expensive CAD … */ }
|
||||||
|
```
|
||||||
|
|
||||||
|
If `main.kcl` waits until the very end to call `makeBolt`, *none* of that work was parallelised – you’ve pushed the cost back onto the serial tail of your script.
|
||||||
|
|
||||||
|
**Better:** call it early or move the invocation into another module.
|
||||||
|
|
||||||
|
```norun
|
||||||
|
// bolt_instance.kcl
|
||||||
|
import makeBolt from "util.kcl"
|
||||||
|
bolt = makeBolt(5) // executed in parallel
|
||||||
|
bolt
|
||||||
|
```
|
||||||
|
|
||||||
|
Now `main.kcl` can `import "bolt_instance.kcl" as bolt` and get the result that was rendered while it was busy doing other things.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Whole module import
|
||||||
|
|
||||||
|
You can also import the whole module. This is useful if you want to use the
|
||||||
|
result of a module as a variable, like a part.
|
||||||
|
|
||||||
|
```norun
|
||||||
|
import "tests/inputs/cube.kcl" as cube
|
||||||
|
cube
|
||||||
|
|> translate(x=10)
|
||||||
|
```
|
||||||
|
|
||||||
|
This imports the whole module and makes it available as `cube`. You can then
|
||||||
|
use it like any other object. The `cube` variable is now a reference to the
|
||||||
|
result of the module. This means that if you change the module, the `cube`
|
||||||
|
variable will change as well.
|
||||||
|
|
||||||
|
In `cube.kcl`, you cannot have multiple objects. It has to be a single part. If
|
||||||
|
you have multiple objects, you will get an error. This is because the module is
|
||||||
|
expected to return a single object that can be used as a variable.
|
||||||
|
|
||||||
|
The last expression or variable definition becomes the module's return value.
|
||||||
|
The module is expected to return a single object that can be used as a variable
|
||||||
|
by whatever imports it.
|
||||||
|
|
||||||
|
So for example, this is allowed:
|
||||||
|
|
||||||
|
```norun
|
||||||
|
... a bunch of code to create cube and cube2 ...
|
||||||
|
|
||||||
|
myUnion = union([cube, cube2])
|
||||||
|
```
|
||||||
|
|
||||||
|
You can also do this:
|
||||||
|
|
||||||
|
```norun
|
||||||
|
... a bunch of code to create cube and cube2 ...
|
||||||
|
|
||||||
|
union([cube, cube2])
|
||||||
|
```
|
||||||
|
|
||||||
|
Either way, the last line will return the union of the two objects.
|
||||||
|
|
||||||
|
Or what you could do instead is:
|
||||||
|
|
||||||
|
```norun
|
||||||
|
... a bunch of code to create cube and cube2 ...
|
||||||
|
|
||||||
|
myUnion = union([cube, cube2])
|
||||||
|
myUnion
|
||||||
|
```
|
||||||
|
|
||||||
|
This will assign the union of the two objects to a variable, and then return it
|
||||||
|
on the last statement. It's simply another way of doing the same thing.
|
||||||
|
|
||||||
|
The final statement is what's important because it's the return value of the
|
||||||
|
entire module. The module is expected to return a single object that can be used
|
||||||
|
as a variable by the file that imports it.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Multiple instances of the same import
|
||||||
|
|
||||||
|
Whether you are importing a file from another CAD system or a KCL file, that
|
||||||
|
file represents object(s) in memory. If you import the same file multiple times,
|
||||||
|
it will only be rendered once.
|
||||||
|
|
||||||
|
If you want to have multiple instances of the same object, you can use the
|
||||||
|
[`clone`](/docs/kcl/clone) function. This will render a new instance of the object in memory.
|
||||||
|
|
||||||
|
```norun
|
||||||
|
import cube from "tests/inputs/cube.kcl"
|
||||||
|
|
||||||
|
cube
|
||||||
|
|> translate(x=10)
|
||||||
|
clone(cube)
|
||||||
|
|> translate(x=20)
|
||||||
|
```
|
||||||
|
|
||||||
|
In the sample above, the `cube` object is imported from a KCL file. The first
|
||||||
|
instance is translated 10 units in the x direction. The second instance is
|
||||||
|
cloned and translated 20 units in the x direction. The two instances are now
|
||||||
|
separate objects in memory, and can be manipulated independently.
|
||||||
|
|
||||||
|
Here is an example with a file from another CAD system:
|
||||||
|
|
||||||
|
```kcl
|
||||||
|
import "tests/inputs/cube.step" as cube
|
||||||
|
|
||||||
|
cube
|
||||||
|
|> translate(x=10)
|
||||||
|
clone(cube)
|
||||||
|
|> translate(x=20)
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Importing files from other CAD systems
|
||||||
|
|
||||||
|
`import` can also be used to import files from other CAD systems. The format of the statement is the
|
||||||
|
same as for KCL files. You can only import the whole file, not items from it. E.g.,
|
||||||
|
|
||||||
|
```norun
|
||||||
|
import "tests/inputs/cube.obj"
|
||||||
|
|
||||||
|
// Use `cube` just like a KCL object.
|
||||||
|
```
|
||||||
|
|
||||||
|
```kcl
|
||||||
|
import "tests/inputs/cube.sldprt" as cube
|
||||||
|
|
||||||
|
// Use `cube` just like a KCL object.
|
||||||
|
```
|
||||||
|
|
||||||
|
For formats lacking unit data (such as STL, OBJ, or PLY files), the default
|
||||||
|
unit of measurement is millimeters. Alternatively you may specify the unit
|
||||||
|
by using an attribute. Likewise, you can also specify a coordinate system. E.g.,
|
||||||
|
|
||||||
|
```kcl
|
||||||
|
@(lengthUnit = ft, coords = opengl)
|
||||||
|
import "tests/inputs/cube.obj"
|
||||||
|
```
|
||||||
|
|
||||||
|
When importing a GLTF file, the bin file will be imported as well.
|
||||||
|
|
||||||
|
Import paths are relative to the current project directory. Imports currently only work when
|
||||||
|
using the native Design Studio, not in the browser.
|
||||||
|
|
||||||
|
### Supported values
|
||||||
|
|
||||||
|
File formats: `fbx`, `gltf`/`glb`, `obj`+, `ply`+, `sldprt`, `step`/`stp`, `stl`+. (Those marked with a
|
||||||
|
'+' support customising the length unit and coordinate system).
|
||||||
|
|
||||||
|
Length units: `mm` (the default), `cm`, `m`, `inch`, `ft`, `yd`.
|
||||||
|
|
||||||
|
Coordinate systems:
|
||||||
|
|
||||||
|
- `zoo` (the default), forward: -Y, up: +Z, handedness: right
|
||||||
|
- `opengl`, forward: +Z, up: +Y, handedness: right
|
||||||
|
- `vulkan`, forward: +Z, up: -Y, handedness: left
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Performance deep‑dive for foreign‑file imports
|
||||||
|
|
||||||
|
Parallelized foreign‑file imports now let you overlap file reads, initialization,
|
||||||
|
and rendering. To maximize throughput, you need to understand the three distinct
|
||||||
|
stages—reading, initializing (background render start), and invocation (blocking)
|
||||||
|
—and structure your code to defer blocking operations until the end.
|
||||||
|
|
||||||
|
### Foreign import execution stages
|
||||||
|
|
||||||
|
1. **Import (Read / Initialization) Stage**
|
||||||
|
```kcl
|
||||||
|
import "tests/inputs/cube.step" as cube
|
||||||
|
```
|
||||||
|
- Reads the file from disk and makes its API available.
|
||||||
|
- Starts engine rendering but **does not block** your script.
|
||||||
|
- This kick‑starts the render pipeline while you keep executing other code.
|
||||||
|
|
||||||
|
2. **Invocation (Blocking) Stage**
|
||||||
|
```kcl
|
||||||
|
import "tests/inputs/cube.step" as cube
|
||||||
|
|
||||||
|
cube
|
||||||
|
|> translate(z=10) // ← blocks here only
|
||||||
|
```
|
||||||
|
- Any method call (e.g., `translate`, `scale`, `rotate`) waits for the background render to finish before applying transformations.
|
||||||
|
|
||||||
|
### Best practices
|
||||||
|
|
||||||
|
#### 1. Defer blocking calls
|
||||||
|
|
||||||
|
```kcl
|
||||||
|
import "tests/inputs/cube.step" as cube // 1) Read / Background render starts
|
||||||
|
|
||||||
|
|
||||||
|
// --- perform other operations and calculations here ---
|
||||||
|
|
||||||
|
|
||||||
|
cube
|
||||||
|
|> translate(z=10) // 2) Blocks only here
|
||||||
|
```
|
||||||
|
|
||||||
|
#### 2. Split heavy work into separate modules
|
||||||
|
|
||||||
|
Place computationally expensive or IO‑heavy work into its own module so it can render in parallel while `main.kcl` continues.
|
||||||
|
|
||||||
|
#### Future improvements
|
||||||
|
|
||||||
|
Upcoming releases will auto‑analyse dependencies and only block when truly necessary. Until then, explicit deferral will give you the best performance.
|
||||||
|
|
||||||
|
|
45
docs/kcl-src/settings.md
Normal file
45
docs/kcl-src/settings.md
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
---
|
||||||
|
title: "KCL Settings"
|
||||||
|
excerpt: "Documentation of settings for the KCL language and Zoo Design Studio."
|
||||||
|
layout: manual
|
||||||
|
---
|
||||||
|
|
||||||
|
# KCL Settings
|
||||||
|
|
||||||
|
There are three levels of settings available in Zoo Design Studio:
|
||||||
|
|
||||||
|
1. [User Settings](/docs/kcl/settings-user): Global settings that apply to all projects, stored in `user.toml`
|
||||||
|
2. [Project Settings](/docs/kcl/settings-project): Settings specific to a project, stored in `project.toml`
|
||||||
|
3. Per-file Settings: Settings that apply to a single KCL file, specified using the `@settings` attribute
|
||||||
|
|
||||||
|
## Configuration Files
|
||||||
|
|
||||||
|
Zoo Design Studio uses TOML files for configuration:
|
||||||
|
|
||||||
|
* **User Settings**: `user.toml` - See [complete documentation](/docs/kcl/settings-user)
|
||||||
|
* **Project Settings**: `project.toml` - See [complete documentation](/docs/kcl/settings-project)
|
||||||
|
|
||||||
|
## Per-file settings
|
||||||
|
|
||||||
|
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).
|
||||||
|
For example:
|
||||||
|
|
||||||
|
```kcl
|
||||||
|
// The settings attribute.
|
||||||
|
@settings(defaultLengthUnit = in)
|
||||||
|
|
||||||
|
// The rest of your KCL code goes below...
|
||||||
|
|
||||||
|
x = 42 // Represents 42 inches.
|
||||||
|
```
|
||||||
|
|
||||||
|
The settings attribute may contain multiple properties separated by commas.
|
||||||
|
Valid properties are:
|
||||||
|
|
||||||
|
- `defaultLengthUnit`: the default length unit to use for numbers declared in this file.
|
||||||
|
- Accepted values: `mm`, `cm`, `m`, `in` (inches), `ft` (feet), `yd` (yards).
|
||||||
|
- `defaultAngleUnit`: the default angle unit to use for numbers declared in this file.
|
||||||
|
- Accepted values: `deg` (degrees), `rad` (radians).
|
||||||
|
|
||||||
|
These settings override any project-wide settings (configured in project.toml or via the UI).
|
299
docs/kcl-src/types.md
Normal file
299
docs/kcl-src/types.md
Normal file
@ -0,0 +1,299 @@
|
|||||||
|
---
|
||||||
|
title: "KCL Types"
|
||||||
|
excerpt: "Documentation of types for the KCL standard library for the Zoo Design Studio."
|
||||||
|
layout: manual
|
||||||
|
---
|
||||||
|
|
||||||
|
`KCL` defines the following types and keywords the language.
|
||||||
|
|
||||||
|
All these types can be nested in various forms where nesting applies. Like
|
||||||
|
arrays can hold objects and vice versa.
|
||||||
|
|
||||||
|
## Constant declaration
|
||||||
|
|
||||||
|
Constants are defined with a name and a value, like so:
|
||||||
|
|
||||||
|
```
|
||||||
|
myBool = false
|
||||||
|
```
|
||||||
|
|
||||||
|
Currently you cannot redeclare a constant.
|
||||||
|
|
||||||
|
## Arrays
|
||||||
|
|
||||||
|
An array is defined with `[]` braces. What is inside the brackets can
|
||||||
|
be of any type. For example, the following is completely valid:
|
||||||
|
|
||||||
|
```
|
||||||
|
myArray = ["thing", 2, false]
|
||||||
|
```
|
||||||
|
|
||||||
|
If you want to get a value from an array you can use the index like so:
|
||||||
|
`myArray[0]`.
|
||||||
|
|
||||||
|
|
||||||
|
## Objects
|
||||||
|
|
||||||
|
An object is defined with `{}` braces. Here is an example object:
|
||||||
|
|
||||||
|
```
|
||||||
|
myObj = { a = 0, b = "thing" }
|
||||||
|
```
|
||||||
|
|
||||||
|
We support two different ways of getting properties from objects, you can call
|
||||||
|
`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
|
||||||
|
|
||||||
|
You can also do math! Let's show an example below:
|
||||||
|
|
||||||
|
```
|
||||||
|
myMathExpression = 3 + 1 * 2 / 3 - 7
|
||||||
|
```
|
||||||
|
|
||||||
|
You can nest expressions in parenthesis as well:
|
||||||
|
|
||||||
|
```
|
||||||
|
myMathExpression = 3 + (1 * 2 / (3 - 7))
|
||||||
|
```
|
||||||
|
|
||||||
|
## Functions
|
||||||
|
|
||||||
|
We also have support for defining your own functions. Functions can take in any
|
||||||
|
type of argument. Below is an example of the syntax:
|
||||||
|
|
||||||
|
```
|
||||||
|
fn myFn(x) {
|
||||||
|
return x
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
As you can see above `myFn` just returns whatever it is given.
|
||||||
|
|
||||||
|
KCL's early drafts used positional arguments, but we now use keyword arguments:
|
||||||
|
|
||||||
|
```
|
||||||
|
// If you declare a function like this
|
||||||
|
fn add(left, right) {
|
||||||
|
return left + right
|
||||||
|
}
|
||||||
|
|
||||||
|
// You can call it like this:
|
||||||
|
total = add(left = 1, right = 2)
|
||||||
|
```
|
||||||
|
|
||||||
|
Functions can also declare one *unlabeled* arg. If you do want to declare an unlabeled arg, it must
|
||||||
|
be the first arg declared.
|
||||||
|
|
||||||
|
```
|
||||||
|
// The @ indicates an argument can be used without a label.
|
||||||
|
// Note that only the first argument can use @.
|
||||||
|
fn increment(@x) {
|
||||||
|
return x + 1
|
||||||
|
}
|
||||||
|
|
||||||
|
fn add(@x, delta) {
|
||||||
|
return x + delta
|
||||||
|
}
|
||||||
|
|
||||||
|
two = increment(1)
|
||||||
|
three = add(1, delta = 2)
|
||||||
|
```
|
||||||
|
|
||||||
|
## Pipelines
|
||||||
|
|
||||||
|
It can be hard to read repeated function calls, because of all the nested brackets.
|
||||||
|
|
||||||
|
```norun
|
||||||
|
i = 1
|
||||||
|
x = h(g(f(i)))
|
||||||
|
```
|
||||||
|
|
||||||
|
You can make this easier to read by breaking it into many declarations, but that is a bit annoying.
|
||||||
|
|
||||||
|
```norun
|
||||||
|
i = 1
|
||||||
|
x0 = f(i)
|
||||||
|
x1 = g(x0)
|
||||||
|
x = h(x1)
|
||||||
|
```
|
||||||
|
|
||||||
|
Instead, you can use the pipeline operator (`|>`) to simplify this.
|
||||||
|
|
||||||
|
Basically, `x |> f(%)` is a shorthand for `f(x)`. The left-hand side of the `|>` gets put into
|
||||||
|
the `%` in the right-hand side.
|
||||||
|
|
||||||
|
So, this means `x |> f(%) |> g(%)` is shorthand for `g(f(x))`. The code example above, with its
|
||||||
|
somewhat-clunky `x0` and `x1` constants could be rewritten as
|
||||||
|
|
||||||
|
```norun
|
||||||
|
i = 1
|
||||||
|
x = i
|
||||||
|
|> f(%)
|
||||||
|
|> g(%)
|
||||||
|
|> h(%)
|
||||||
|
```
|
||||||
|
|
||||||
|
This helps keep your code neat and avoid unnecessary declarations.
|
||||||
|
|
||||||
|
## Pipelines and keyword arguments
|
||||||
|
|
||||||
|
Say you have a long pipeline of sketch functions, like this:
|
||||||
|
|
||||||
|
```norun
|
||||||
|
startSketchOn(XZ)
|
||||||
|
|> line(%, end = [3, 4])
|
||||||
|
|> line(%, end = [10, 10])
|
||||||
|
|> line(%, end = [-13, -14])
|
||||||
|
|> close(%)
|
||||||
|
```
|
||||||
|
|
||||||
|
In this example, each function call outputs a sketch, and it gets put into the next function call via
|
||||||
|
the `%`, into the first (unlabeled) argument.
|
||||||
|
|
||||||
|
If a function call uses an unlabeled first parameter, it will default to `%` if it's not given. This
|
||||||
|
means that `|> line(%, end = [3, 4])` and `|> line(end = [3, 4])` are equivalent! So the above
|
||||||
|
could be rewritten as
|
||||||
|
|
||||||
|
```norun
|
||||||
|
startSketchOn(XZ)
|
||||||
|
|> line(end = [3, 4])
|
||||||
|
|> line(end = [10, 10])
|
||||||
|
|> line(end = [-13, -14])
|
||||||
|
|> close()
|
||||||
|
```
|
||||||
|
|
||||||
|
Note that we are still in the process of migrating KCL's standard library to use keyword arguments. So some
|
||||||
|
functions are still unfortunately using positional arguments. We're moving them over, so keep checking back.
|
||||||
|
Some functions are still using the old positional argument syntax.
|
||||||
|
Check the docs page for each function and look at its examples to see.
|
||||||
|
|
||||||
|
## Tags
|
||||||
|
|
||||||
|
Tags are used to give a name (tag) to a specific path.
|
||||||
|
|
||||||
|
### `TagDeclarator`
|
||||||
|
|
||||||
|
The syntax for declaring a tag is `$myTag` you would use it in the following
|
||||||
|
way:
|
||||||
|
|
||||||
|
```norun
|
||||||
|
startSketchOn(XZ)
|
||||||
|
|> startProfile(at = origin)
|
||||||
|
|> angledLine(angle = 0, length = 191.26, tag = $rectangleSegmentA001)
|
||||||
|
|> angledLine(
|
||||||
|
angle = segAng(rectangleSegmentA001) - 90,
|
||||||
|
length = 196.99,
|
||||||
|
tag = $rectangleSegmentB001,
|
||||||
|
)
|
||||||
|
|> angledLine(
|
||||||
|
angle = segAng(rectangleSegmentA001),
|
||||||
|
length = -segLen(rectangleSegmentA001),
|
||||||
|
tag = $rectangleSegmentC001,
|
||||||
|
)
|
||||||
|
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|
||||||
|
|> close()
|
||||||
|
```
|
||||||
|
|
||||||
|
### `TagIdentifier`
|
||||||
|
|
||||||
|
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`.
|
||||||
|
|
||||||
|
In the example above we use the tag identifier to get the angle of the segment
|
||||||
|
`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
|
||||||
|
|
||||||
|
Tags are scoped globally if in the root context meaning in this example you can
|
||||||
|
use the tag `rectangleSegmentA001` in any function or expression in the file.
|
||||||
|
|
||||||
|
However if the code was written like this:
|
||||||
|
|
||||||
|
```norun
|
||||||
|
fn rect(origin) {
|
||||||
|
return startSketchOn(XZ)
|
||||||
|
|> startProfile(at = origin)
|
||||||
|
|> angledLine(angle = 0, length = 191.26, tag = $rectangleSegmentA001)
|
||||||
|
|> angledLine(
|
||||||
|
angle = segAng(rectangleSegmentA001) - 90,
|
||||||
|
length = 196.99,
|
||||||
|
tag = $rectangleSegmentB001,
|
||||||
|
)
|
||||||
|
|> angledLine(
|
||||||
|
angle = segAng(rectangleSegmentA001),
|
||||||
|
length = -segLen(rectangleSegmentA001),
|
||||||
|
tag = $rectangleSegmentC001,
|
||||||
|
)
|
||||||
|
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|
||||||
|
|> close()
|
||||||
|
}
|
||||||
|
|
||||||
|
rect(origin = [0, 0])
|
||||||
|
rect(origin = [20, 0])
|
||||||
|
```
|
||||||
|
|
||||||
|
Those tags would only be available in the `rect` function and not globally.
|
||||||
|
|
||||||
|
However you likely want to use those tags somewhere outside the `rect` function.
|
||||||
|
|
||||||
|
Tags are accessible through the sketch group they are declared in.
|
||||||
|
For example the following code works.
|
||||||
|
|
||||||
|
```norun
|
||||||
|
fn rect(origin) {
|
||||||
|
return startSketchOn(XZ)
|
||||||
|
|> startProfile(at = origin)
|
||||||
|
|> angledLine(angle = 0, length = 191.26, tag = $rectangleSegmentA001)
|
||||||
|
|> angledLine(
|
||||||
|
angle = segAng(rectangleSegmentA001) - 90,
|
||||||
|
length = 196.99,
|
||||||
|
tag = $rectangleSegmentB001,
|
||||||
|
)
|
||||||
|
|> angledLine(
|
||||||
|
angle = segAng(rectangleSegmentA001),
|
||||||
|
length = -segLen(rectangleSegmentA001),
|
||||||
|
tag = $rectangleSegmentC001,
|
||||||
|
)
|
||||||
|
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|
||||||
|
|> close()
|
||||||
|
}
|
||||||
|
|
||||||
|
rect(origin = [0, 0])
|
||||||
|
myRect = rect(origin = [20, 0])
|
||||||
|
|
||||||
|
myRect
|
||||||
|
|> extrude(length = 10)
|
||||||
|
|> fillet(radius = 0.5, tags = [myRect.tags.rectangleSegmentA001])
|
||||||
|
```
|
||||||
|
|
||||||
|
See how we use the tag `rectangleSegmentA001` in the `fillet` function outside
|
||||||
|
the `rect` function. This is because the `rect` function is returning the
|
||||||
|
sketch group that contains the tags.
|
||||||
|
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
If you find any issues using any of the above expressions or syntax,
|
||||||
|
please file an issue with the `ast` label on the [modeling-app
|
||||||
|
repo](https://github.com/KittyCAD/modeling-app/issues/new).
|
5
docs/kcl/README.md
Normal file
5
docs/kcl/README.md
Normal 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`.
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -8,7 +8,7 @@ Draw a line segment relative to the current origin using the polar measure of so
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
```js
|
```kcl
|
||||||
angledLine(
|
angledLine(
|
||||||
sketch: Sketch,
|
sketch: Sketch,
|
||||||
angle: number,
|
angle: number,
|
||||||
@ -26,25 +26,25 @@ angledLine(
|
|||||||
|
|
||||||
| 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/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/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/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/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/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/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/types/std-types-number) | Draw the line along the given angle until it reaches this point along the Y axis. Only one of `length`, `lengthX`, `lengthY`, `endAbsoluteX`, `endAbsoluteY` can be given. | No |
|
||||||
| [`tag`](/docs/kcl/types/tag) | [`TagDeclarator`](/docs/kcl/types#tag-declaration) | Create a new tag which refers to this line | No |
|
| [`tag`](/docs/kcl/types/std-types-tag) | [`TagDeclarator`](/docs/kcl/types#TagDeclarator) | Create a new tag which refers to this line | No |
|
||||||
|
|
||||||
### Returns
|
### Returns
|
||||||
|
|
||||||
[`Sketch`](/docs/kcl/types/Sketch)
|
[`Sketch`](/docs/kcl/types/std-types-Sketch)
|
||||||
|
|
||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
|
||||||
```js
|
```kcl
|
||||||
exampleSketch = startSketchOn(XZ)
|
exampleSketch = startSketchOn(XZ)
|
||||||
|> startProfileAt([0, 0], %)
|
|> startProfile(at = [0, 0])
|
||||||
|> yLine(endAbsolute = 15)
|
|> yLine(endAbsolute = 15)
|
||||||
|> angledLine(angle = 30, length = 15)
|
|> angledLine(angle = 30, length = 15)
|
||||||
|> line(end = [8, -10])
|
|> line(end = [8, -10])
|
||||||
|
@ -8,7 +8,7 @@ Draw an angled line from the current origin, constructing a line segment such th
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
```js
|
```kcl
|
||||||
angledLineThatIntersects(
|
angledLineThatIntersects(
|
||||||
sketch: Sketch,
|
sketch: Sketch,
|
||||||
angle: number,
|
angle: number,
|
||||||
@ -23,22 +23,22 @@ angledLineThatIntersects(
|
|||||||
|
|
||||||
| 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/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/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/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/types/std-types-number) | The offset from the intersecting line. Defaults to 0. | No |
|
||||||
| [`tag`](/docs/kcl/types/tag) | [`TagDeclarator`](/docs/kcl/types#tag-declaration) | Create a new tag which refers to this line | No |
|
| [`tag`](/docs/kcl/types/std-types-tag) | [`TagDeclarator`](/docs/kcl/types#TagDeclarator) | Create a new tag which refers to this line | No |
|
||||||
|
|
||||||
### Returns
|
### Returns
|
||||||
|
|
||||||
[`Sketch`](/docs/kcl/types/Sketch)
|
[`Sketch`](/docs/kcl/types/std-types-Sketch)
|
||||||
|
|
||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
|
||||||
```js
|
```kcl
|
||||||
exampleSketch = startSketchOn(XZ)
|
exampleSketch = startSketchOn(XZ)
|
||||||
|> startProfileAt([0, 0], %)
|
|> startProfile(at = [0, 0])
|
||||||
|> line(endAbsolute = [5, 10])
|
|> line(endAbsolute = [5, 10])
|
||||||
|> line(endAbsolute = [-10, 10], tag = $lineToIntersect)
|
|> line(endAbsolute = [-10, 10], tag = $lineToIntersect)
|
||||||
|> line(endAbsolute = [0, 20])
|
|> line(endAbsolute = [0, 20])
|
||||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -8,7 +8,7 @@ Check a value meets some expected conditions at runtime. Program terminates with
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
```js
|
```kcl
|
||||||
assert(
|
assert(
|
||||||
actual: number,
|
actual: number,
|
||||||
isGreaterThan?: number,
|
isGreaterThan?: number,
|
||||||
@ -17,7 +17,7 @@ assert(
|
|||||||
isLessThanOrEqual?: number,
|
isLessThanOrEqual?: number,
|
||||||
isEqualTo?: number,
|
isEqualTo?: number,
|
||||||
tolerance?: number,
|
tolerance?: number,
|
||||||
error?: String,
|
error?: string,
|
||||||
): ()
|
): ()
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -26,14 +26,14 @@ assert(
|
|||||||
|
|
||||||
| 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/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/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/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/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/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/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/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/types/std-types-string) | If the value was false, the program will terminate with this error message | No |
|
||||||
|
|
||||||
### Returns
|
### Returns
|
||||||
|
|
||||||
@ -42,7 +42,7 @@ assert(
|
|||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
|
||||||
```js
|
```kcl
|
||||||
n = 10
|
n = 10
|
||||||
assert(n, isEqualTo = 10)
|
assert(n, isEqualTo = 10)
|
||||||
assert(
|
assert(
|
||||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -8,10 +8,10 @@ Asserts that a value is the boolean value true.
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
```js
|
```kcl
|
||||||
assertIs(
|
assertIs(
|
||||||
actual: bool,
|
actual: bool,
|
||||||
error?: String,
|
error?: string,
|
||||||
): ()
|
): ()
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -20,8 +20,8 @@ assertIs(
|
|||||||
|
|
||||||
| 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/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/types/std-types-string) | If the value was false, the program will terminate with this error message | No |
|
||||||
|
|
||||||
### Returns
|
### Returns
|
||||||
|
|
||||||
@ -30,7 +30,7 @@ assertIs(
|
|||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
|
||||||
```js
|
```kcl
|
||||||
kclIsFun = true
|
kclIsFun = true
|
||||||
assertIs(kclIsFun)
|
assertIs(kclIsFun)
|
||||||
```
|
```
|
||||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -8,12 +8,12 @@ Draw a smooth, continuous, curved line segment from the current origin to the de
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
```js
|
```kcl
|
||||||
bezierCurve(
|
bezierCurve(
|
||||||
sketch: Sketch,
|
sketch: Sketch,
|
||||||
control1: [number],
|
control1: Point2d,
|
||||||
control2: [number],
|
control2: Point2d,
|
||||||
end: [number],
|
end: Point2d,
|
||||||
tag?: TagDeclarator,
|
tag?: TagDeclarator,
|
||||||
): Sketch
|
): Sketch
|
||||||
```
|
```
|
||||||
@ -23,22 +23,22 @@ bezierCurve(
|
|||||||
|
|
||||||
| 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/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/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/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/types/std-types-Point2d) | How far away (along the X and Y axes) should this line go? | Yes |
|
||||||
| [`tag`](/docs/kcl/types/tag) | [`TagDeclarator`](/docs/kcl/types#tag-declaration) | Create a new tag which refers to this line | No |
|
| [`tag`](/docs/kcl/types/std-types-tag) | [`TagDeclarator`](/docs/kcl/types#TagDeclarator) | Create a new tag which refers to this line | No |
|
||||||
|
|
||||||
### Returns
|
### Returns
|
||||||
|
|
||||||
[`Sketch`](/docs/kcl/types/Sketch)
|
[`Sketch`](/docs/kcl/types/std-types-Sketch)
|
||||||
|
|
||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
|
||||||
```js
|
```kcl
|
||||||
exampleSketch = startSketchOn(XZ)
|
exampleSketch = startSketchOn(XZ)
|
||||||
|> startProfileAt([0, 0], %)
|
|> startProfile(at = [0, 0])
|
||||||
|> line(end = [0, 10])
|
|> line(end = [0, 10])
|
||||||
|> bezierCurve(control1 = [5, 0], control2 = [5, 10], end = [10, 10])
|
|> bezierCurve(control1 = [5, 0], control2 = [5, 10], end = [10, 10])
|
||||||
|> line(endAbsolute = [10, 0])
|
|> line(endAbsolute = [10, 0])
|
||||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -8,12 +8,12 @@ Construct a circle derived from 3 points.
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
```js
|
```kcl
|
||||||
circleThreePoint(
|
circleThreePoint(
|
||||||
sketchSurfaceOrGroup: SketchOrSurface,
|
sketchSurfaceOrGroup: Sketch | Plane | Face,
|
||||||
p1: [number],
|
p1: Point2d,
|
||||||
p2: [number],
|
p2: Point2d,
|
||||||
p3: [number],
|
p3: Point2d,
|
||||||
tag?: TagDeclarator,
|
tag?: TagDeclarator,
|
||||||
): Sketch
|
): Sketch
|
||||||
```
|
```
|
||||||
@ -23,20 +23,20 @@ circleThreePoint(
|
|||||||
|
|
||||||
| 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/types/std-types-Sketch) or [`Plane`](/docs/kcl/types/std-types-Plane) or [`Face`](/docs/kcl/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/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/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/types/std-types-Point2d) | 3rd point to derive the circle. | Yes |
|
||||||
| [`tag`](/docs/kcl/types/tag) | [`TagDeclarator`](/docs/kcl/types#tag-declaration) | Identifier for the circle to reference elsewhere. | No |
|
| [`tag`](/docs/kcl/types/std-types-tag) | [`TagDeclarator`](/docs/kcl/types#TagDeclarator) | Identifier for the circle to reference elsewhere. | No |
|
||||||
|
|
||||||
### Returns
|
### Returns
|
||||||
|
|
||||||
[`Sketch`](/docs/kcl/types/Sketch)
|
[`Sketch`](/docs/kcl/types/std-types-Sketch)
|
||||||
|
|
||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
|
||||||
```js
|
```kcl
|
||||||
exampleSketch = startSketchOn(XY)
|
exampleSketch = startSketchOn(XY)
|
||||||
|> circleThreePoint(p1 = [10, 10], p2 = [20, 8], p3 = [15, 5])
|
|> circleThreePoint(p1 = [10, 10], p2 = [20, 8], p3 = [15, 5])
|
||||||
|> extrude(length = 5)
|
|> extrude(length = 5)
|
||||||
|
258
docs/kcl/clone.md
Normal file
258
docs/kcl/clone.md
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -8,7 +8,7 @@ Identifies the ending face of an extrusion. I.e., the new face created by an ext
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
```js
|
```kcl
|
||||||
std::END: string = 'end'
|
std::END: string = 'end'
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@ Identifies the starting face of an extrusion. I.e., the face which is extruded.
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
```js
|
```kcl
|
||||||
std::START: string = 'start'
|
std::START: string = 'start'
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@ layout: manual
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
```js
|
```kcl
|
||||||
std::X
|
std::X
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@ layout: manual
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
```js
|
```kcl
|
||||||
std::XY
|
std::XY
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@ layout: manual
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
```js
|
```kcl
|
||||||
std::XZ
|
std::XZ
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@ layout: manual
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
```js
|
```kcl
|
||||||
std::Y
|
std::Y
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@ layout: manual
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
```js
|
```kcl
|
||||||
std::YZ
|
std::YZ
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@ layout: manual
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
```js
|
```kcl
|
||||||
std::Z
|
std::Z
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -8,15 +8,15 @@ The value of Euler’s number `e`.
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
```js
|
```kcl
|
||||||
std::math::E: number = 2.71828182845904523536028747135266250_
|
std::math::E: number = 2.71828182845904523536028747135266250_
|
||||||
```
|
```
|
||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
|
||||||
```js
|
```kcl
|
||||||
exampleSketch = startSketchOn(XZ)
|
exampleSketch = startSketchOn(XZ)
|
||||||
|> startProfileAt([0, 0], %)
|
|> startProfile(at = [0, 0])
|
||||||
|> angledLine(
|
|> angledLine(
|
||||||
angle = 30,
|
angle = 30,
|
||||||
length = 2 * E ^ 2,
|
length = 2 * E ^ 2,
|
||||||
|
@ -8,17 +8,17 @@ The value of `pi`, Archimedes’ constant (π).
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
```js
|
```kcl
|
||||||
std::math::PI: number = 3.14159265358979323846264338327950288_
|
std::math::PI: number(_?) = 3.14159265358979323846264338327950288_?
|
||||||
```
|
```
|
||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
|
||||||
```js
|
```kcl
|
||||||
circumference = 70
|
circumference = 70
|
||||||
|
|
||||||
exampleSketch = startSketchOn(XZ)
|
exampleSketch = startSketchOn(XZ)
|
||||||
|> circle(center = [0, 0], radius = circumference / (2 * PI))
|
|> circle(center = [0, 0], radius = (circumference / (2 * PI)): number(mm))
|
||||||
|
|
||||||
example = extrude(exampleSketch, length = 5)
|
example = extrude(exampleSketch, length = 5)
|
||||||
```
|
```
|
||||||
|
@ -8,15 +8,15 @@ The value of `tau`, the full circle constant (τ). Equal to 2π.
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
```js
|
```kcl
|
||||||
std::math::TAU: number = 6.28318530717958647692528676655900577_
|
std::math::TAU: number = 6.28318530717958647692528676655900577_
|
||||||
```
|
```
|
||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
|
||||||
```js
|
```kcl
|
||||||
exampleSketch = startSketchOn(XZ)
|
exampleSketch = startSketchOn(XZ)
|
||||||
|> startProfileAt([0, 0], %)
|
|> startProfile(at = [0, 0])
|
||||||
|> angledLine(
|
|> angledLine(
|
||||||
angle = 50,
|
angle = 50,
|
||||||
length = 10 * TAU,
|
length = 10 * TAU,
|
||||||
|
@ -8,7 +8,7 @@ layout: manual
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
```js
|
```kcl
|
||||||
std::turns::HALF_TURN: number(deg) = 180deg
|
std::turns::HALF_TURN: number(deg) = 180deg
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@ layout: manual
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
```js
|
```kcl
|
||||||
std::turns::QUARTER_TURN: number(deg) = 90deg
|
std::turns::QUARTER_TURN: number(deg) = 90deg
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@ layout: manual
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
```js
|
```kcl
|
||||||
std::turns::THREE_QUARTER_TURN: number(deg) = 270deg
|
std::turns::THREE_QUARTER_TURN: number(deg) = 270deg
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@ layout: manual
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
```js
|
```kcl
|
||||||
std::turns::ZERO: number = 0
|
std::turns::ZERO: number = 0
|
||||||
```
|
```
|
||||||
|
|
||||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
51
docs/kcl/functions/std-math-abs.md
Normal file
51
docs/kcl/functions/std-math-abs.md
Normal file
File diff suppressed because one or more lines are too long
45
docs/kcl/functions/std-math-acos.md
Normal file
45
docs/kcl/functions/std-math-acos.md
Normal file
File diff suppressed because one or more lines are too long
44
docs/kcl/functions/std-math-asin.md
Normal file
44
docs/kcl/functions/std-math-asin.md
Normal file
File diff suppressed because one or more lines are too long
43
docs/kcl/functions/std-math-atan.md
Normal file
43
docs/kcl/functions/std-math-atan.md
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
---
|
||||||
|
title: "std::math::atan"
|
||||||
|
excerpt: "Compute the arctangent of a number."
|
||||||
|
layout: manual
|
||||||
|
---
|
||||||
|
|
||||||
|
Compute the arctangent of a number.
|
||||||
|
|
||||||
|
Consider using `atan2()` instead for the true inverse of tangent.
|
||||||
|
|
||||||
|
```kcl
|
||||||
|
atan(@num: number(_)): number(rad)
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
### Arguments
|
||||||
|
|
||||||
|
| Name | Type | Description | Required |
|
||||||
|
|----------|------|-------------|----------|
|
||||||
|
| `num` | `number(_)` | | Yes |
|
||||||
|
|
||||||
|
### Returns
|
||||||
|
|
||||||
|
`number(rad)`
|
||||||
|
|
||||||
|
|
||||||
|
### Examples
|
||||||
|
|
||||||
|
```kcl
|
||||||
|
sketch001 = startSketchOn(XZ)
|
||||||
|
|> startProfile(at = [0, 0])
|
||||||
|
|> angledLine(
|
||||||
|
angle = atan(1.25),
|
||||||
|
length = 20,
|
||||||
|
)
|
||||||
|
|> yLine(endAbsolute = 0)
|
||||||
|
|> close()
|
||||||
|
|
||||||
|
extrude001 = extrude(sketch001, length = 5)
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
48
docs/kcl/functions/std-math-atan2.md
Normal file
48
docs/kcl/functions/std-math-atan2.md
Normal file
File diff suppressed because one or more lines are too long
42
docs/kcl/functions/std-math-ceil.md
Normal file
42
docs/kcl/functions/std-math-ceil.md
Normal file
File diff suppressed because one or more lines are too long
@ -1,14 +1,14 @@
|
|||||||
---
|
---
|
||||||
title: "std::math::cos"
|
title: "std::math::cos"
|
||||||
excerpt: "Compute the cosine of a number (in radians)."
|
excerpt: "Compute the cosine of a number."
|
||||||
layout: manual
|
layout: manual
|
||||||
---
|
---
|
||||||
|
|
||||||
Compute the cosine of a number (in radians).
|
Compute the cosine of a number.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
```js
|
```kcl
|
||||||
cos(@num: number(Angle)): number(_)
|
cos(@num: number(Angle)): number(_)
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -26,9 +26,9 @@ cos(@num: number(Angle)): number(_)
|
|||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
|
||||||
```js
|
```kcl
|
||||||
exampleSketch = startSketchOn(XZ)
|
exampleSketch = startSketchOn(XZ)
|
||||||
|> startProfileAt([0, 0], %)
|
|> startProfile(at = [0, 0])
|
||||||
|> angledLine(
|
|> angledLine(
|
||||||
angle = 30,
|
angle = 30,
|
||||||
length = 3 / cos(30deg),
|
length = 3 / cos(30deg),
|
42
docs/kcl/functions/std-math-floor.md
Normal file
42
docs/kcl/functions/std-math-floor.md
Normal file
File diff suppressed because one or more lines are too long
42
docs/kcl/functions/std-math-ln.md
Normal file
42
docs/kcl/functions/std-math-ln.md
Normal file
File diff suppressed because one or more lines are too long
48
docs/kcl/functions/std-math-log.md
Normal file
48
docs/kcl/functions/std-math-log.md
Normal file
File diff suppressed because one or more lines are too long
42
docs/kcl/functions/std-math-log10.md
Normal file
42
docs/kcl/functions/std-math-log10.md
Normal file
File diff suppressed because one or more lines are too long
42
docs/kcl/functions/std-math-log2.md
Normal file
42
docs/kcl/functions/std-math-log2.md
Normal file
File diff suppressed because one or more lines are too long
44
docs/kcl/functions/std-math-max.md
Normal file
44
docs/kcl/functions/std-math-max.md
Normal file
File diff suppressed because one or more lines are too long
44
docs/kcl/functions/std-math-min.md
Normal file
44
docs/kcl/functions/std-math-min.md
Normal file
File diff suppressed because one or more lines are too long
@ -9,7 +9,7 @@ layout: manual
|
|||||||
Convert polar/sphere (azimuth, elevation, distance) coordinates to
|
Convert polar/sphere (azimuth, elevation, distance) coordinates to
|
||||||
cartesian (x/y/z grid) coordinates.
|
cartesian (x/y/z grid) coordinates.
|
||||||
|
|
||||||
```js
|
```kcl
|
||||||
polar(
|
polar(
|
||||||
angle: number(rad),
|
angle: number(rad),
|
||||||
length: number(Length),
|
length: number(Length),
|
||||||
@ -26,14 +26,14 @@ polar(
|
|||||||
|
|
||||||
### Returns
|
### Returns
|
||||||
|
|
||||||
[`Point2d`](/docs/kcl/types/Point2d)
|
[`Point2d`](/docs/kcl/types/std-types-Point2d)
|
||||||
|
|
||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
|
||||||
```js
|
```kcl
|
||||||
exampleSketch = startSketchOn(XZ)
|
exampleSketch = startSketchOn(XZ)
|
||||||
|> startProfileAt([0, 0], %)
|
|> startProfile(at = [0, 0])
|
||||||
|> line(end = polar(angle = 30, length = 5), tag = $thing)
|
|> line(end = polar(angle = 30, length = 5), tag = $thing)
|
||||||
|> line(end = [0, 5])
|
|> line(end = [0, 5])
|
||||||
|> line(end = [segEndX(thing), 0])
|
|> line(end = [segEndX(thing), 0])
|
48
docs/kcl/functions/std-math-pow.md
Normal file
48
docs/kcl/functions/std-math-pow.md
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
42
docs/kcl/functions/std-math-round.md
Normal file
42
docs/kcl/functions/std-math-round.md
Normal file
File diff suppressed because one or more lines are too long
@ -1,14 +1,14 @@
|
|||||||
---
|
---
|
||||||
title: "std::math::sin"
|
title: "std::math::sin"
|
||||||
excerpt: "Compute the sine of a number (in radians)."
|
excerpt: "Compute the sine of a number."
|
||||||
layout: manual
|
layout: manual
|
||||||
---
|
---
|
||||||
|
|
||||||
Compute the sine of a number (in radians).
|
Compute the sine of a number.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
```js
|
```kcl
|
||||||
sin(@num: number(Angle)): number(_)
|
sin(@num: number(Angle)): number(_)
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -26,9 +26,9 @@ sin(@num: number(Angle)): number(_)
|
|||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
|
||||||
```js
|
```kcl
|
||||||
exampleSketch = startSketchOn(XZ)
|
exampleSketch = startSketchOn(XZ)
|
||||||
|> startProfileAt([0, 0], %)
|
|> startProfile(at = [0, 0])
|
||||||
|> angledLine(
|
|> angledLine(
|
||||||
angle = 50,
|
angle = 50,
|
||||||
length = 15 / sin(135deg),
|
length = 15 / sin(135deg),
|
44
docs/kcl/functions/std-math-sqrt.md
Normal file
44
docs/kcl/functions/std-math-sqrt.md
Normal file
File diff suppressed because one or more lines are too long
@ -1,14 +1,14 @@
|
|||||||
---
|
---
|
||||||
title: "std::math::tan"
|
title: "std::math::tan"
|
||||||
excerpt: "Compute the tangent of a number (in radians)."
|
excerpt: "Compute the tangent of a number."
|
||||||
layout: manual
|
layout: manual
|
||||||
---
|
---
|
||||||
|
|
||||||
Compute the tangent of a number (in radians).
|
Compute the tangent of a number.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
```js
|
```kcl
|
||||||
tan(@num: number(Angle)): number(_)
|
tan(@num: number(Angle)): number(_)
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -26,9 +26,9 @@ tan(@num: number(Angle)): number(_)
|
|||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
|
||||||
```js
|
```kcl
|
||||||
exampleSketch = startSketchOn(XZ)
|
exampleSketch = startSketchOn(XZ)
|
||||||
|> startProfileAt([0, 0], %)
|
|> startProfile(at = [0, 0])
|
||||||
|> angledLine(
|
|> angledLine(
|
||||||
angle = 50,
|
angle = 50,
|
||||||
length = 50 * tan((1/2): number(rad)),
|
length = 50 * tan((1/2): number(rad)),
|
122
docs/kcl/functions/std-offsetPlane.md
Normal file
122
docs/kcl/functions/std-offsetPlane.md
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
101
docs/kcl/functions/std-solid-chamfer.md
Normal file
101
docs/kcl/functions/std-solid-chamfer.md
Normal file
File diff suppressed because one or more lines are too long
96
docs/kcl/functions/std-solid-fillet.md
Normal file
96
docs/kcl/functions/std-solid-fillet.md
Normal file
File diff suppressed because one or more lines are too long
86
docs/kcl/functions/std-solid-hollow.md
Normal file
86
docs/kcl/functions/std-solid-hollow.md
Normal file
File diff suppressed because one or more lines are too long
193
docs/kcl/functions/std-solid-shell.md
Normal file
193
docs/kcl/functions/std-solid-shell.md
Normal file
File diff suppressed because one or more lines are too long
@ -1,5 +1,5 @@
|
|||||||
---
|
---
|
||||||
title: "std::toCentimeters"
|
title: "std::units::toCentimeters"
|
||||||
excerpt: "Convert a number to centimeters from its current units."
|
excerpt: "Convert a number to centimeters from its current units."
|
||||||
layout: manual
|
layout: manual
|
||||||
---
|
---
|
||||||
@ -8,8 +8,8 @@ Convert a number to centimeters from its current units.
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
```js
|
```kcl
|
||||||
toCentimeters(@num: number(cm)): number(cm)
|
units::toCentimeters(@num: number(cm)): number(cm)
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
44
docs/kcl/functions/std-units-toDegrees.md
Normal file
44
docs/kcl/functions/std-units-toDegrees.md
Normal file
File diff suppressed because one or more lines are too long
@ -1,5 +1,5 @@
|
|||||||
---
|
---
|
||||||
title: "std::toFeet"
|
title: "std::units::toFeet"
|
||||||
excerpt: "Convert a number to feet from its current units."
|
excerpt: "Convert a number to feet from its current units."
|
||||||
layout: manual
|
layout: manual
|
||||||
---
|
---
|
||||||
@ -8,8 +8,8 @@ Convert a number to feet from its current units.
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
```js
|
```kcl
|
||||||
toFeet(@num: number(ft)): number(ft)
|
units::toFeet(@num: number(ft)): number(ft)
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
|||||||
---
|
---
|
||||||
title: "std::toInches"
|
title: "std::units::toInches"
|
||||||
excerpt: "Convert a number to inches from its current units."
|
excerpt: "Convert a number to inches from its current units."
|
||||||
layout: manual
|
layout: manual
|
||||||
---
|
---
|
||||||
@ -8,8 +8,8 @@ Convert a number to inches from its current units.
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
```js
|
```kcl
|
||||||
toInches(@num: number(in)): number(in)
|
units::toInches(@num: number(in)): number(in)
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
|||||||
---
|
---
|
||||||
title: "std::toMeters"
|
title: "std::units::toMeters"
|
||||||
excerpt: "Convert a number to meters from its current units."
|
excerpt: "Convert a number to meters from its current units."
|
||||||
layout: manual
|
layout: manual
|
||||||
---
|
---
|
||||||
@ -8,8 +8,8 @@ Convert a number to meters from its current units.
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
```js
|
```kcl
|
||||||
toMeters(@num: number(m)): number(m)
|
units::toMeters(@num: number(m)): number(m)
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
|||||||
---
|
---
|
||||||
title: "std::toMillimeters"
|
title: "std::units::toMillimeters"
|
||||||
excerpt: "Convert a number to millimeters from its current units."
|
excerpt: "Convert a number to millimeters from its current units."
|
||||||
layout: manual
|
layout: manual
|
||||||
---
|
---
|
||||||
@ -8,8 +8,8 @@ Convert a number to millimeters from its current units.
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
```js
|
```kcl
|
||||||
toMillimeters(@num: number(mm)): number(mm)
|
units::toMillimeters(@num: number(mm)): number(mm)
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user