Compare commits

..

9 Commits

1011 changed files with 216492 additions and 345440 deletions

View File

@ -1,4 +1,5 @@
NODE_ENV=production NODE_ENV=production
DEV=false
VITE_KC_API_WS_MODELING_URL=wss://api.zoo.dev/ws/modeling/commands VITE_KC_API_WS_MODELING_URL=wss://api.zoo.dev/ws/modeling/commands
VITE_KC_API_BASE_URL=https://api.zoo.dev VITE_KC_API_BASE_URL=https://api.zoo.dev
VITE_KC_SITE_BASE_URL=https://zoo.dev VITE_KC_SITE_BASE_URL=https://zoo.dev

13
.gitattributes vendored
View File

@ -1,13 +0,0 @@
# Set default behavior to automatically normalize line endings.
* text=auto
# Force batch scripts to always use CRLF line endings so that if a repo is accessed
# in Windows via a file share from Linux, the scripts will work.
*.{cmd,[cC][mM][dD]} text working-tree-encoding=UTF-16LE eol=CRLF
*.{bat,[bB][aA][tT]} text working-tree-encoding=UTF-16LE eol=CRLF
*.{ics,[iI][cC][sS]} text working-tree-encoding=UTF-16LE eol=CRLF
*.{ps1,[iP][sS][1]} text working-tree-encoding=UTF-16LE eol=CRLF
# Force bash scripts to always use LF line endings so that if a repo is accessed
# in Unix via a file share from Windows, the scripts will work.
*.sh text eol=lfol=lf

View File

@ -1,8 +1,9 @@
name: E2E Tests name: E2E Flow Tests
on: on:
push: push:
branches: [ main ] branches: [ main ]
pull_request: pull_request:
branches: [ main ]
concurrency: concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
@ -32,7 +33,7 @@ jobs:
rust: rust:
- 'src/wasm-lib/**' - 'src/wasm-lib/**'
electron: flow-tests:
timeout-minutes: 60 timeout-minutes: 60
name: playwright:electron:${{ matrix.os }} ${{ matrix.shardIndex }} ${{ matrix.shardTotal }} name: playwright:electron:${{ matrix.os }} ${{ matrix.shardIndex }} ${{ matrix.shardTotal }}
strategy: strategy:
@ -45,32 +46,30 @@ jobs:
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
needs: check-rust-changes needs: check-rust-changes
steps: 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 - uses: actions/checkout@v4
with:
token: ${{ steps.app-token.outputs.token }}
- uses: actions/setup-node@v4 - uses: actions/setup-node@v4
with: with:
node-version-file: '.nvmrc' node-version-file: '.nvmrc'
cache: 'yarn' cache: 'yarn'
- uses: KittyCAD/action-install-cli@main - uses: KittyCAD/action-install-cli@main
- name: Install dependencies - name: Install dependencies
shell: bash shell: bash
run: yarn run: yarn
- name: Cache Playwright Browsers - name: Cache Playwright Browsers
uses: actions/cache@v4 uses: actions/cache@v4
with: with:
path: | path: |
~/.cache/ms-playwright/ ~/.cache/ms-playwright/
key: ${{ runner.os }}-playwright-${{ hashFiles('yarn.lock') }} key: ${{ runner.os }}-playwright-${{ hashFiles('yarn.lock') }}
- name: Install Playwright Browsers - name: Install Playwright Browsers
shell: bash shell: bash
run: yarn playwright install --with-deps run: yarn playwright install --with-deps
- name: Download Wasm Cache - name: Download Wasm Cache
id: download-wasm id: download-wasm
if: needs.check-rust-changes.outputs.rust-changed == 'false' if: needs.check-rust-changes.outputs.rust-changed == 'false'
@ -82,29 +81,35 @@ jobs:
workflow: build-and-store-wasm.yml workflow: build-and-store-wasm.yml
branch: main branch: main
path: src/wasm-lib/pkg path: src/wasm-lib/pkg
- name: copy wasm blob - name: copy wasm blob
if: needs.check-rust-changes.outputs.rust-changed == 'false' if: needs.check-rust-changes.outputs.rust-changed == 'false'
shell: bash shell: bash
run: cp src/wasm-lib/pkg/wasm_lib_bg.wasm public run: cp src/wasm-lib/pkg/wasm_lib_bg.wasm public
continue-on-error: true continue-on-error: true
- name: Setup Rust - name: Setup Rust
uses: dtolnay/rust-toolchain@stable uses: dtolnay/rust-toolchain@stable
- name: Cache Wasm (because rust diff) - name: Cache Wasm (because rust diff)
if: needs.check-rust-changes.outputs.rust-changed == 'true' if: needs.check-rust-changes.outputs.rust-changed == 'true'
uses: Swatinem/rust-cache@v2 uses: Swatinem/rust-cache@v2
with: with:
workspaces: './src/wasm-lib' workspaces: './src/wasm-lib'
- name: OR Cache Wasm (because wasm cache failed) - name: OR Cache Wasm (because wasm cache failed)
if: steps.download-wasm.outcome == 'failure' if: steps.download-wasm.outcome == 'failure'
uses: Swatinem/rust-cache@v2 uses: Swatinem/rust-cache@v2
with: with:
workspaces: './src/wasm-lib' workspaces: './src/wasm-lib'
- name: install good sed - name: install good sed
if: ${{ startsWith(matrix.os, 'macos') }} if: ${{ startsWith(matrix.os, 'macos') }}
shell: bash shell: bash
run: | run: |
brew install gnu-sed brew install gnu-sed
echo "/opt/homebrew/opt/gnu-sed/libexec/gnubin" >> $GITHUB_PATH echo "/opt/homebrew/opt/gnu-sed/libexec/gnubin" >> $GITHUB_PATH
- name: Install vector - name: Install vector
shell: bash shell: bash
# TODO: figure out what to do with this, it's failing # TODO: figure out what to do with this, it's failing
@ -122,81 +127,33 @@ jobs:
sed -i "s#GH_ACTIONS_AXIOM_TOKEN#${{secrets.GH_ACTIONS_AXIOM_TOKEN}}#g" /tmp/vector.toml sed -i "s#GH_ACTIONS_AXIOM_TOKEN#${{secrets.GH_ACTIONS_AXIOM_TOKEN}}#g" /tmp/vector.toml
cat /tmp/vector.toml cat /tmp/vector.toml
${HOME}/.vector/bin/vector --config /tmp/vector.toml & ${HOME}/.vector/bin/vector --config /tmp/vector.toml &
- name: Build Wasm (because rust diff) - name: Build Wasm (because rust diff)
if: needs.check-rust-changes.outputs.rust-changed == 'true' if: needs.check-rust-changes.outputs.rust-changed == 'true'
shell: bash shell: bash
run: yarn build:wasm run: yarn build:wasm
- name: OR Build Wasm (because wasm cache failed) - name: OR Build Wasm (because wasm cache failed)
if: steps.download-wasm.outcome == 'failure' if: steps.download-wasm.outcome == 'failure'
shell: bash shell: bash
run: yarn build:wasm run: yarn build:wasm
- name: build web - name: build web
shell: bash shell: bash
run: yarn tronb:vite:dev run: yarn tronb:vite:dev
- name: Run ubuntu/chrome snapshots
if: ${{ matrix.os == 'namespace-profile-ubuntu-8-cores' && matrix.shardIndex == 1 }}
shell: bash
# TODO: break this in its own job, for now it's not slowing down the overall execution as ubuntu is the quickest,
# but we could do better. This forces a large 1/1 shard of all 20 snapshot tests that runs in about 3 minutes.
run: |
PLATFORM=web yarn playwright test --config=playwright.config.ts --retries="3" --update-snapshots --grep=@snapshot --shard=1/1
env:
CI: true
NODE_ENV: development
VITE_KC_DEV_TOKEN: ${{ secrets.KITTYCAD_API_TOKEN_DEV }}
VITE_KC_SKIP_AUTH: true
token: ${{ secrets.KITTYCAD_API_TOKEN_DEV }}
snapshottoken: ${{ secrets.KITTYCAD_API_TOKEN }}
- uses: actions/upload-artifact@v4
if: ${{ !cancelled() && (success() || failure()) }}
with:
name: playwright-report-${{ matrix.os }}-snapshot-${{ matrix.shardIndex }}-${{ github.sha }}
path: playwright-report/
include-hidden-files: true
retention-days: 30
overwrite: true
- name: Clean up test-results - name: Clean up test-results
if: ${{ !cancelled() && (success() || failure()) }} if: ${{ !cancelled() && (success() || failure()) }}
continue-on-error: true continue-on-error: true
run: rm -r test-results run: rm -r test-results
- name: check for changes
if: ${{ matrix.os == 'namespace-profile-ubuntu-8-cores' && matrix.shardIndex == 1 && github.ref != 'refs/heads/main' }}
shell: bash
id: git-check
run: |
git add e2e/playwright/snapshot-tests.spec.ts-snapshots
if git status | grep -q "Changes to be committed"
then echo "modified=true" >> $GITHUB_OUTPUT
else echo "modified=false" >> $GITHUB_OUTPUT
fi
- name: Commit changes, if any
if: steps.git-check.outputs.modified == 'true'
shell: bash
run: |
git add e2e/playwright/snapshot-tests.spec.ts-snapshots
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git remote set-url origin https://${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git
git fetch origin
echo ${{ github.head_ref }}
git checkout ${{ github.head_ref }}
git commit -m "A snapshot a day keeps the bugs away! 📷🐛 (OS: ${{matrix.os}})" || true
git push
git push origin ${{ github.head_ref }}
# only upload artifacts if there's actually changes
- uses: actions/upload-artifact@v4
if: steps.git-check.outputs.modified == 'true'
with:
name: playwright-report-${{ matrix.os }}-${{ matrix.shardIndex }}-${{ github.sha }}
path: playwright-report/
include-hidden-files: true
retention-days: 30
- uses: actions/download-artifact@v4 - uses: actions/download-artifact@v4
if: ${{ !cancelled() && (success() || failure()) }} if: ${{ !cancelled() && (success() || failure()) }}
continue-on-error: true continue-on-error: true
with: with:
name: test-results-${{ matrix.os }}-${{ matrix.shardIndex }}-${{ github.sha }} name: test-results-${{ matrix.os }}-${{ matrix.shardIndex }}-${{ github.sha }}
path: test-results/ path: test-results/
- name: Run playwright/electron flow (with retries) - name: Run playwright/electron flow (with retries)
id: retry id: retry
if: ${{ !cancelled() && (success() || failure()) }} if: ${{ !cancelled() && (success() || failure()) }}
@ -210,6 +167,7 @@ jobs:
VITE_KC_DEV_TOKEN: ${{ secrets.KITTYCAD_API_TOKEN_DEV }} VITE_KC_DEV_TOKEN: ${{ secrets.KITTYCAD_API_TOKEN_DEV }}
VITE_KC_SKIP_AUTH: true VITE_KC_SKIP_AUTH: true
token: ${{ secrets.KITTYCAD_API_TOKEN_DEV }} token: ${{ secrets.KITTYCAD_API_TOKEN_DEV }}
- uses: actions/upload-artifact@v4 - uses: actions/upload-artifact@v4
if: always() if: always()
with: with:
@ -218,6 +176,7 @@ jobs:
include-hidden-files: true include-hidden-files: true
retention-days: 30 retention-days: 30
overwrite: true overwrite: true
- uses: actions/upload-artifact@v4 - uses: actions/upload-artifact@v4
if: always() if: always()
with: with:
@ -226,4 +185,3 @@ jobs:
include-hidden-files: true include-hidden-files: true
retention-days: 30 retention-days: 30
overwrite: true overwrite: true

145
.github/workflows/e2e-snapshot-tests.yml vendored Normal file
View File

@ -0,0 +1,145 @@
name: E2E Snapshot Tests
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
permissions:
contents: write
pull-requests: write
actions: read
jobs:
check-rust-changes:
runs-on: ubuntu-latest
outputs:
rust-changed: ${{ steps.filter.outputs.rust }}
steps:
- uses: actions/checkout@v4
- id: filter
name: Check for Rust changes
uses: dorny/paths-filter@v3
with:
filters: |
rust:
- 'src/wasm-lib/**'
snapshot-tests:
runs-on: ubuntu-22.04
needs: check-rust-changes
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'yarn'
- name: Install dependencies
run: yarn
- name: Cache Playwright Browsers
uses: actions/cache@v4
with:
path: |
~/.cache/ms-playwright/
key: ${{ runner.os }}-playwright-${{ hashFiles('yarn.lock') }}
- name: Install Playwright Browsers
run: yarn playwright install --with-deps
- name: Download Wasm Cache
id: download-wasm
if: needs.check-rust-changes.outputs.rust-changed == 'false'
uses: dawidd6/action-download-artifact@v7
continue-on-error: true
with:
github_token: ${{secrets.GITHUB_TOKEN}}
name: wasm-bundle
workflow: build-and-store-wasm.yml
branch: main
path: src/wasm-lib/pkg
- name: copy wasm blob
if: needs.check-rust-changes.outputs.rust-changed == 'false'
run: cp src/wasm-lib/pkg/wasm_lib_bg.wasm public
continue-on-error: true
- name: Setup Rust
if: needs.check-rust-changes.outputs.rust-changed == 'true'
uses: dtolnay/rust-toolchain@stable
- name: Cache Wasm (because rust diff)
if: needs.check-rust-changes.outputs.rust-changed == 'true'
uses: Swatinem/rust-cache@v2
with:
workspaces: './src/wasm-lib'
- name: OR Cache Wasm (because wasm cache failed)
if: steps.download-wasm.outcome == 'failure'
uses: Swatinem/rust-cache@v2
with:
workspaces: './src/wasm-lib'
- name: Build Wasm (because rust diff)
if: needs.check-rust-changes.outputs.rust-changed == 'true'
run: yarn build:wasm
- name: OR Build Wasm (because wasm cache failed)
if: steps.download-wasm.outcome == 'failure'
run: yarn build:wasm
- name: build web
run: yarn tronb:vite:dev
- name: Run chrome snapshots
run: |
PLATFORM=web yarn playwright test --config=playwright.config.ts --retries="3" --update-snapshots --grep=@snapshot
env:
CI: true
NODE_ENV: development
VITE_KC_DEV_TOKEN: ${{ secrets.KITTYCAD_API_TOKEN_DEV }}
VITE_KC_SKIP_AUTH: true
token: ${{ secrets.KITTYCAD_API_TOKEN_DEV }}
snapshottoken: ${{ secrets.KITTYCAD_API_TOKEN }}
- name: check for changes
id: git-check
run: |
{
echo 'changes<<EOF'
git diff --name-only e2e/playwright/snapshot-tests.spec.ts-snapshots
echo EOF
} >> "$GITHUB_OUTPUT"
# only upload artifacts if there's actually changes
- name: Upload changes, if any
if: steps.git-check.outputs.changes != ''
uses: actions/upload-artifact@v4
with:
name: playwright-snapshots-${{ runner.os }}-${{ github.sha }}
path: ${{ steps.git-check.outputs.changes }}
- name: Upload report, if any
uses: actions/upload-artifact@v4
if: steps.git-check.outputs.changes != ''
with:
name: playwright-report-${{ runner.os }}-${{ github.sha }}
path: playwright-report/
include-hidden-files: true
retention-days: 30
- name: Fail the run if we have snapshot updates
if: steps.git-check.outputs.changes != ''
run: exit 1
# TODO: check if we could comment on the PR as well

View File

@ -1,15 +0,0 @@
---
title: "HALF_TURN"
excerpt: ""
layout: manual
---
```js
HALF_TURN: number(deg) = 180deg
```

View File

@ -1,15 +0,0 @@
---
title: "QUARTER_TURN"
excerpt: ""
layout: manual
---
```js
QUARTER_TURN: number(deg) = 90deg
```

View File

@ -1,15 +0,0 @@
---
title: "THREE_QUARTER_TURN"
excerpt: ""
layout: manual
---
```js
THREE_QUARTER_TURN: number(deg) = 270deg
```

View File

@ -1,15 +0,0 @@
---
title: "ZERO"
excerpt: ""
layout: manual
---
```js
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

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

View File

@ -22,7 +22,7 @@ assert(data: bool, message: string) -> ()
### Returns ### Returns
`()` `()`
### Examples ### Examples

View File

@ -24,7 +24,7 @@ assertEqual(left: number, right: number, epsilon: number, message: string) -> ()
### Returns ### Returns
`()` `()`
### Examples ### Examples

View File

@ -23,7 +23,7 @@ assertGreaterThan(left: number, right: number, message: string) -> ()
### Returns ### Returns
`()` `()`
### Examples ### Examples

View File

@ -23,7 +23,7 @@ assertGreaterThanOrEq(left: number, right: number, message: string) -> ()
### Returns ### Returns
`()` `()`
### Examples ### Examples

View File

@ -23,7 +23,7 @@ assertLessThan(left: number, right: number, message: string) -> ()
### Returns ### Returns
`()` `()`
### Examples ### Examples

View File

@ -23,7 +23,7 @@ assertLessThanOrEq(left: number, right: number, message: string) -> ()
### Returns ### Returns
`()` `()`
### Examples ### Examples

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

View File

@ -26,7 +26,7 @@ cm() -> number
### Returns ### Returns
`number` `number`
### Examples ### Examples

File diff suppressed because one or more lines are too long

View File

@ -1,15 +0,0 @@
---
title: "HALF_TURN"
excerpt: ""
layout: manual
---
```js
HALF_TURN: number(deg) = 180deg
```

File diff suppressed because one or more lines are too long

View File

@ -1,15 +0,0 @@
---
title: "QUARTER_TURN"
excerpt: ""
layout: manual
---
```js
QUARTER_TURN: number(deg) = 90deg
```

File diff suppressed because one or more lines are too long

View File

@ -1,15 +0,0 @@
---
title: "THREE_QUARTER_TURN"
excerpt: ""
layout: manual
---
```js
THREE_QUARTER_TURN: number(deg) = 270deg
```

View File

@ -1,15 +0,0 @@
---
title: "ZERO"
excerpt: ""
layout: manual
---
```js
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

View File

@ -1,15 +0,0 @@
---
title: "std::prelude::HALF_TURN"
excerpt: ""
layout: manual
---
```js
std::prelude::HALF_TURN: number(deg) = 180deg
```

View File

@ -1,15 +0,0 @@
---
title: "std::prelude::QUARTER_TURN"
excerpt: ""
layout: manual
---
```js
std::prelude::QUARTER_TURN: number(deg) = 90deg
```

View File

@ -1,15 +0,0 @@
---
title: "std::prelude::THREE_QUARTER_TURN"
excerpt: ""
layout: manual
---
```js
std::prelude::THREE_QUARTER_TURN: number(deg) = 270deg
```

View File

@ -1,15 +0,0 @@
---
title: "std::prelude::ZERO"
excerpt: ""
layout: manual
---
```js
std::prelude::ZERO: number = 0
```

48
docs/kcl/cos.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

File diff suppressed because one or more lines are too long

View File

@ -26,7 +26,7 @@ ft() -> number
### Returns ### Returns
`number` `number`
### Examples ### Examples

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

View File

@ -26,7 +26,7 @@ inch() -> number
### Returns ### Returns
`number` `number`
### Examples ### Examples

View File

@ -9,117 +9,110 @@ layout: manual
* [Types](kcl/types) * [Types](kcl/types)
* [Modules](kcl/modules) * [Modules](kcl/modules)
* [Known Issues](kcl/KNOWN-ISSUES) * [Known Issues](kcl/KNOWN-ISSUES)
* **`std`** * [`abs`](kcl/abs)
* [`abs`](kcl/abs) * [`acos`](kcl/acos)
* [`acos`](kcl/acos) * [`angleToMatchLengthX`](kcl/angleToMatchLengthX)
* [`angleToMatchLengthX`](kcl/angleToMatchLengthX) * [`angleToMatchLengthY`](kcl/angleToMatchLengthY)
* [`angleToMatchLengthY`](kcl/angleToMatchLengthY) * [`angledLine`](kcl/angledLine)
* [`angledLine`](kcl/angledLine) * [`angledLineOfXLength`](kcl/angledLineOfXLength)
* [`angledLineOfXLength`](kcl/angledLineOfXLength) * [`angledLineOfYLength`](kcl/angledLineOfYLength)
* [`angledLineOfYLength`](kcl/angledLineOfYLength) * [`angledLineThatIntersects`](kcl/angledLineThatIntersects)
* [`angledLineThatIntersects`](kcl/angledLineThatIntersects) * [`angledLineToX`](kcl/angledLineToX)
* [`angledLineToX`](kcl/angledLineToX) * [`angledLineToY`](kcl/angledLineToY)
* [`angledLineToY`](kcl/angledLineToY) * [`appearance`](kcl/appearance)
* [`appearance`](kcl/appearance) * [`arc`](kcl/arc)
* [`arc`](kcl/arc) * [`arcTo`](kcl/arcTo)
* [`arcTo`](kcl/arcTo) * [`asin`](kcl/asin)
* [`asin`](kcl/asin) * [`assert`](kcl/assert)
* [`assert`](kcl/assert) * [`assertEqual`](kcl/assertEqual)
* [`assertEqual`](kcl/assertEqual) * [`assertGreaterThan`](kcl/assertGreaterThan)
* [`assertGreaterThan`](kcl/assertGreaterThan) * [`assertGreaterThanOrEq`](kcl/assertGreaterThanOrEq)
* [`assertGreaterThanOrEq`](kcl/assertGreaterThanOrEq) * [`assertLessThan`](kcl/assertLessThan)
* [`assertLessThan`](kcl/assertLessThan) * [`assertLessThanOrEq`](kcl/assertLessThanOrEq)
* [`assertLessThanOrEq`](kcl/assertLessThanOrEq) * [`atan`](kcl/atan)
* [`atan`](kcl/atan) * [`atan2`](kcl/atan2)
* [`atan2`](kcl/atan2) * [`bezierCurve`](kcl/bezierCurve)
* [`bezierCurve`](kcl/bezierCurve) * [`ceil`](kcl/ceil)
* [`ceil`](kcl/ceil) * [`chamfer`](kcl/chamfer)
* [`chamfer`](kcl/chamfer) * [`circle`](kcl/circle)
* [`circle`](kcl/circle) * [`circleThreePoint`](kcl/circleThreePoint)
* [`circleThreePoint`](kcl/circleThreePoint) * [`close`](kcl/close)
* [`close`](kcl/close) * [`cm`](kcl/cm)
* [`cm`](kcl/cm) * [`cos`](kcl/cos)
* [`extrude`](kcl/extrude) * [`e`](kcl/e)
* [`fillet`](kcl/fillet) * [`extrude`](kcl/extrude)
* [`floor`](kcl/floor) * [`fillet`](kcl/fillet)
* [`ft`](kcl/ft) * [`floor`](kcl/floor)
* [`getNextAdjacentEdge`](kcl/getNextAdjacentEdge) * [`ft`](kcl/ft)
* [`getOppositeEdge`](kcl/getOppositeEdge) * [`getNextAdjacentEdge`](kcl/getNextAdjacentEdge)
* [`getPreviousAdjacentEdge`](kcl/getPreviousAdjacentEdge) * [`getOppositeEdge`](kcl/getOppositeEdge)
* [`helix`](kcl/helix) * [`getPreviousAdjacentEdge`](kcl/getPreviousAdjacentEdge)
* [`helixRevolutions`](kcl/helixRevolutions) * [`helix`](kcl/helix)
* [`hole`](kcl/hole) * [`helixRevolutions`](kcl/helixRevolutions)
* [`hollow`](kcl/hollow) * [`hole`](kcl/hole)
* [`inch`](kcl/inch) * [`hollow`](kcl/hollow)
* [`lastSegX`](kcl/lastSegX) * [`inch`](kcl/inch)
* [`lastSegY`](kcl/lastSegY) * [`lastSegX`](kcl/lastSegX)
* [`legAngX`](kcl/legAngX) * [`lastSegY`](kcl/lastSegY)
* [`legAngY`](kcl/legAngY) * [`legAngX`](kcl/legAngX)
* [`legLen`](kcl/legLen) * [`legAngY`](kcl/legAngY)
* [`line`](kcl/line) * [`legLen`](kcl/legLen)
* [`ln`](kcl/ln) * [`line`](kcl/line)
* [`loft`](kcl/loft) * [`ln`](kcl/ln)
* [`log`](kcl/log) * [`loft`](kcl/loft)
* [`log10`](kcl/log10) * [`log`](kcl/log)
* [`log2`](kcl/log2) * [`log10`](kcl/log10)
* [`m`](kcl/m) * [`log2`](kcl/log2)
* [`map`](kcl/map) * [`m`](kcl/m)
* [`max`](kcl/max) * [`map`](kcl/map)
* [`min`](kcl/min) * [`max`](kcl/max)
* [`mirror2d`](kcl/mirror2d) * [`min`](kcl/min)
* [`mm`](kcl/mm) * [`mirror2d`](kcl/mirror2d)
* [`offsetPlane`](kcl/offsetPlane) * [`mm`](kcl/mm)
* [`patternCircular2d`](kcl/patternCircular2d) * [`offsetPlane`](kcl/offsetPlane)
* [`patternCircular3d`](kcl/patternCircular3d) * [`patternCircular2d`](kcl/patternCircular2d)
* [`patternLinear2d`](kcl/patternLinear2d) * [`patternCircular3d`](kcl/patternCircular3d)
* [`patternLinear3d`](kcl/patternLinear3d) * [`patternLinear2d`](kcl/patternLinear2d)
* [`patternTransform`](kcl/patternTransform) * [`patternLinear3d`](kcl/patternLinear3d)
* [`patternTransform2d`](kcl/patternTransform2d) * [`patternTransform`](kcl/patternTransform)
* [`polar`](kcl/polar) * [`patternTransform2d`](kcl/patternTransform2d)
* [`polygon`](kcl/polygon) * [`pi`](kcl/pi)
* [`pop`](kcl/pop) * [`polar`](kcl/polar)
* [`pow`](kcl/pow) * [`polygon`](kcl/polygon)
* [`profileStart`](kcl/profileStart) * [`pop`](kcl/pop)
* [`profileStartX`](kcl/profileStartX) * [`pow`](kcl/pow)
* [`profileStartY`](kcl/profileStartY) * [`profileStart`](kcl/profileStart)
* [`push`](kcl/push) * [`profileStartX`](kcl/profileStartX)
* [`reduce`](kcl/reduce) * [`profileStartY`](kcl/profileStartY)
* [`rem`](kcl/rem) * [`push`](kcl/push)
* [`revolve`](kcl/revolve) * [`reduce`](kcl/reduce)
* [`round`](kcl/round) * [`rem`](kcl/rem)
* [`segAng`](kcl/segAng) * [`revolve`](kcl/revolve)
* [`segEnd`](kcl/segEnd) * [`round`](kcl/round)
* [`segEndX`](kcl/segEndX) * [`segAng`](kcl/segAng)
* [`segEndY`](kcl/segEndY) * [`segEnd`](kcl/segEnd)
* [`segLen`](kcl/segLen) * [`segEndX`](kcl/segEndX)
* [`segStart`](kcl/segStart) * [`segEndY`](kcl/segEndY)
* [`segStartX`](kcl/segStartX) * [`segLen`](kcl/segLen)
* [`segStartY`](kcl/segStartY) * [`segStart`](kcl/segStart)
* [`shell`](kcl/shell) * [`segStartX`](kcl/segStartX)
* [`sqrt`](kcl/sqrt) * [`segStartY`](kcl/segStartY)
* [`startProfileAt`](kcl/startProfileAt) * [`shell`](kcl/shell)
* [`startSketchOn`](kcl/startSketchOn) * [`sin`](kcl/sin)
* [`sweep`](kcl/sweep) * [`sqrt`](kcl/sqrt)
* [`tangentToEnd`](kcl/tangentToEnd) * [`startProfileAt`](kcl/startProfileAt)
* [`tangentialArc`](kcl/tangentialArc) * [`startSketchOn`](kcl/startSketchOn)
* [`tangentialArcTo`](kcl/tangentialArcTo) * [`sweep`](kcl/sweep)
* [`tangentialArcToRelative`](kcl/tangentialArcToRelative) * [`tan`](kcl/tan)
* [`toDegrees`](kcl/toDegrees) * [`tangentToEnd`](kcl/tangentToEnd)
* [`toRadians`](kcl/toRadians) * [`tangentialArc`](kcl/tangentialArc)
* [`xLine`](kcl/xLine) * [`tangentialArcTo`](kcl/tangentialArcTo)
* [`xLineTo`](kcl/xLineTo) * [`tangentialArcToRelative`](kcl/tangentialArcToRelative)
* [`yLine`](kcl/yLine) * [`tau`](kcl/tau)
* [`yLineTo`](kcl/yLineTo) * [`toDegrees`](kcl/toDegrees)
* [`yd`](kcl/yd) * [`toRadians`](kcl/toRadians)
* **`std::math`** * [`xLine`](kcl/xLine)
* [`E`](kcl/const_std-math-E) * [`xLineTo`](kcl/xLineTo)
* [`PI`](kcl/const_std-math-PI) * [`yLine`](kcl/yLine)
* [`TAU`](kcl/const_std-math-TAU) * [`yLineTo`](kcl/yLineTo)
* [`cos`](kcl/std-math-cos) * [`yd`](kcl/yd)
* [`sin`](kcl/std-math-sin)
* [`tan`](kcl/std-math-tan)
* **`std::prelude`**
* [`HALF_TURN`](kcl/const_std-prelude-HALF_TURN)
* [`QUARTER_TURN`](kcl/const_std-prelude-QUARTER_TURN)
* [`THREE_QUARTER_TURN`](kcl/const_std-prelude-THREE_QUARTER_TURN)
* [`ZERO`](kcl/const_std-prelude-ZERO)

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

View File

@ -26,7 +26,7 @@ legAngX(hypotenuse: number, leg: number) -> number
### Returns ### Returns
`number` `number`
### Examples ### Examples

View File

@ -26,7 +26,7 @@ legAngY(hypotenuse: number, leg: number) -> number
### Returns ### Returns
`number` `number`
### Examples ### Examples

View File

@ -26,7 +26,7 @@ legLen(hypotenuse: number, leg: number) -> number
### Returns ### Returns
`number` `number`
### Examples ### Examples

File diff suppressed because one or more lines are too long

44
docs/kcl/lineTo.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

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -26,7 +26,7 @@ m() -> number
### Returns ### Returns
`number` `number`
### Examples ### Examples

View File

@ -22,7 +22,7 @@ map(array: [KclValue], map_fn: FunctionParam) -> [KclValue]
### Returns ### Returns
[`[KclValue]`](/docs/kcl/types/KclValue) [`[KclValue]`](/docs/kcl/types/KclValue)
### Examples ### Examples

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

View File

@ -26,7 +26,7 @@ mm() -> number
### Returns ### Returns
`number` `number`
### Examples ### Examples

View File

@ -57,55 +57,3 @@ Imported symbols can be renamed for convenience or to avoid name collisions.
``` ```
import increment as inc, decrement as dec from "util.kcl" import increment as inc, decrement as dec from "util.kcl"
``` ```
## 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.,
```
import "tests/inputs/cube.obj"
// Use `cube` just like a KCL object.
```
```
import "tests/inputs/cube-2.sldprt" as cube
// Use `cube` just like a KCL object.
```
You can make the file format explicit using a format attribute (useful if using a different
extension), e.g.,
```
@(format = obj)
import "tests/inputs/cube"
```
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 attirbute. Likewise, you can also specify a coordinate system. E.g.,
```
@(unitLength = 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 Modeling App, 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

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

File diff suppressed because one or more lines are too long

View File

@ -21,7 +21,7 @@ profileStartX(sketch: Sketch) -> number
### Returns ### Returns
`number` `number`
### Examples ### Examples

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