Compare commits
14 Commits
pierremtb/
...
franknoiro
Author | SHA1 | Date | |
---|---|---|---|
6fc81cd433 | |||
6fa12e70a4 | |||
4ed0f08c69 | |||
f6e437793f | |||
31f2332c72 | |||
af1f15a7f7 | |||
cb285141d5 | |||
3e7036898f | |||
980c139060 | |||
4ee1c96e78 | |||
5e89683801 | |||
e2dd6e742a | |||
b3acb348d9 | |||
0aed462360 |
13
.gitattributes
vendored
13
.gitattributes
vendored
@ -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
|
|
2
.github/ci-cd-scripts/playwright-electron.sh
vendored
2
.github/ci-cd-scripts/playwright-electron.sh
vendored
@ -21,7 +21,7 @@ if [[ ! -f "test-results/.last-run.json" ]]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
retry=1
|
retry=1
|
||||||
max_retrys=1
|
max_retrys=5
|
||||||
|
|
||||||
# retry failed tests, doing our own retries because using inbuilt playwright retries causes connection issues
|
# retry failed tests, doing our own retries because using inbuilt playwright retries causes connection issues
|
||||||
while [[ $retry -le $max_retrys ]]; do
|
while [[ $retry -le $max_retrys ]]; do
|
||||||
|
3
.github/workflows/build-and-store-wasm.yml
vendored
3
.github/workflows/build-and-store-wasm.yml
vendored
@ -22,9 +22,6 @@ jobs:
|
|||||||
uses: Swatinem/rust-cache@v2
|
uses: Swatinem/rust-cache@v2
|
||||||
with:
|
with:
|
||||||
workspaces: './src/wasm-lib'
|
workspaces: './src/wasm-lib'
|
||||||
- uses: taiki-e/install-action@2dbeb927f58939d3aa13bf06ba0c0a34b76b9bfb
|
|
||||||
with:
|
|
||||||
tool: wasm-pack
|
|
||||||
- name: build wasm
|
- name: build wasm
|
||||||
run: yarn build:wasm
|
run: yarn build:wasm
|
||||||
|
|
||||||
|
15
.github/workflows/build-apps.yml
vendored
15
.github/workflows/build-apps.yml
vendored
@ -32,6 +32,7 @@ jobs:
|
|||||||
- uses: actions/setup-node@v4
|
- uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version-file: '.nvmrc'
|
node-version-file: '.nvmrc'
|
||||||
|
cache: 'yarn'
|
||||||
|
|
||||||
- run: yarn install
|
- run: yarn install
|
||||||
|
|
||||||
@ -43,10 +44,6 @@ jobs:
|
|||||||
workspaces: './src/wasm-lib'
|
workspaces: './src/wasm-lib'
|
||||||
|
|
||||||
# TODO: see if we can fetch from main instead if no diff at src/wasm-lib
|
# TODO: see if we can fetch from main instead if no diff at src/wasm-lib
|
||||||
- uses: taiki-e/install-action@2dbeb927f58939d3aa13bf06ba0c0a34b76b9bfb
|
|
||||||
with:
|
|
||||||
tool: wasm-pack
|
|
||||||
|
|
||||||
- name: Run build:wasm
|
- name: Run build:wasm
|
||||||
run: "yarn build:wasm"
|
run: "yarn build:wasm"
|
||||||
|
|
||||||
@ -123,13 +120,15 @@ jobs:
|
|||||||
cp prepared-files/assets/icon.ico assets/icon.ico
|
cp prepared-files/assets/icon.ico assets/icon.ico
|
||||||
cp prepared-files/assets/icon.png assets/icon.png
|
cp prepared-files/assets/icon.png assets/icon.png
|
||||||
|
|
||||||
- uses: actions/setup-node@v4
|
- name: Sync node version and setup cache
|
||||||
|
uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version-file: '.nvmrc'
|
node-version-file: '.nvmrc'
|
||||||
|
cache: 'yarn' # Set this to npm, yarn or pnpm.
|
||||||
|
|
||||||
- name: yarn install
|
- name: yarn install
|
||||||
# Windows is picky sometimes and fails on fetch. Step takes about ~30s
|
# Windows is picky sometimes and fails on fetch. Step takes about ~30s
|
||||||
uses: nick-fields/retry@v3.0.1
|
uses: nick-fields/retry@v3.0.0
|
||||||
with:
|
with:
|
||||||
timeout_minutes: 2
|
timeout_minutes: 2
|
||||||
max_attempts: 3
|
max_attempts: 3
|
||||||
@ -180,7 +179,7 @@ jobs:
|
|||||||
WINDOWS_CERTIFICATE_THUMBPRINT: ${{ secrets.WINDOWS_CERTIFICATE_THUMBPRINT }}
|
WINDOWS_CERTIFICATE_THUMBPRINT: ${{ secrets.WINDOWS_CERTIFICATE_THUMBPRINT }}
|
||||||
DEBUG: "electron-notarize*"
|
DEBUG: "electron-notarize*"
|
||||||
# TODO: Fix electron-notarize flakes. The logs above should help gather more data on failures
|
# TODO: Fix electron-notarize flakes. The logs above should help gather more data on failures
|
||||||
uses: nick-fields/retry@v3.0.1
|
uses: nick-fields/retry@v3.0.0
|
||||||
with:
|
with:
|
||||||
timeout_minutes: 10
|
timeout_minutes: 10
|
||||||
max_attempts: 3
|
max_attempts: 3
|
||||||
@ -241,7 +240,7 @@ jobs:
|
|||||||
WINDOWS_CERTIFICATE_THUMBPRINT: ${{ secrets.WINDOWS_CERTIFICATE_THUMBPRINT }}
|
WINDOWS_CERTIFICATE_THUMBPRINT: ${{ secrets.WINDOWS_CERTIFICATE_THUMBPRINT }}
|
||||||
DEBUG: "electron-notarize*"
|
DEBUG: "electron-notarize*"
|
||||||
# TODO: Fix electron-notarize flakes. The logs above should help gather more data on failures
|
# TODO: Fix electron-notarize flakes. The logs above should help gather more data on failures
|
||||||
uses: nick-fields/retry@v3.0.1
|
uses: nick-fields/retry@v3.0.0
|
||||||
with:
|
with:
|
||||||
timeout_minutes: 10
|
timeout_minutes: 10
|
||||||
max_attempts: 3
|
max_attempts: 3
|
||||||
|
2
.github/workflows/cargo-test.yml
vendored
2
.github/workflows/cargo-test.yml
vendored
@ -46,7 +46,7 @@ jobs:
|
|||||||
shell: bash
|
shell: bash
|
||||||
run: |-
|
run: |-
|
||||||
cd "${{ matrix.dir }}"
|
cd "${{ matrix.dir }}"
|
||||||
cargo llvm-cov nextest --workspace --lcov --output-path lcov.info --test-threads=1 --retries=2 --no-fail-fast -P ci 2>&1 | tee /tmp/github-actions.log
|
cargo llvm-cov nextest --workspace --lcov --output-path lcov.info --test-threads=1 --no-fail-fast -P ci 2>&1 | tee /tmp/github-actions.log
|
||||||
env:
|
env:
|
||||||
KITTYCAD_API_TOKEN: ${{secrets.KITTYCAD_API_TOKEN}}
|
KITTYCAD_API_TOKEN: ${{secrets.KITTYCAD_API_TOKEN}}
|
||||||
RUST_MIN_STACK: 10485760000
|
RUST_MIN_STACK: 10485760000
|
||||||
|
22
.github/workflows/check-exampleKcl.yml
vendored
22
.github/workflows/check-exampleKcl.yml
vendored
@ -26,21 +26,11 @@ jobs:
|
|||||||
const issue_number = context.payload.pull_request.number;
|
const issue_number = context.payload.pull_request.number;
|
||||||
const owner = context.repo.owner;
|
const owner = context.repo.owner;
|
||||||
const repo = context.repo.repo;
|
const repo = context.repo.repo;
|
||||||
|
|
||||||
const { data: comments } = await github.rest.issues.listComments({
|
// Post a comment on the PR
|
||||||
|
await github.rest.issues.createComment({
|
||||||
owner,
|
owner,
|
||||||
repo,
|
repo,
|
||||||
issue_number
|
issue_number,
|
||||||
});
|
body: message,
|
||||||
|
});
|
||||||
const commentExists = comments.some(comment => comment.body === message);
|
|
||||||
|
|
||||||
if (!commentExists) {
|
|
||||||
// Post a comment on the PR
|
|
||||||
await github.rest.issues.createComment({
|
|
||||||
owner,
|
|
||||||
repo,
|
|
||||||
issue_number,
|
|
||||||
body: message,
|
|
||||||
});
|
|
||||||
}
|
|
11
.github/workflows/e2e-tests.yml
vendored
11
.github/workflows/e2e-tests.yml
vendored
@ -89,9 +89,6 @@ jobs:
|
|||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
- name: Setup Rust
|
- name: Setup Rust
|
||||||
uses: dtolnay/rust-toolchain@stable
|
uses: dtolnay/rust-toolchain@stable
|
||||||
- uses: taiki-e/install-action@2dbeb927f58939d3aa13bf06ba0c0a34b76b9bfb
|
|
||||||
with:
|
|
||||||
tool: wasm-pack
|
|
||||||
- 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
|
||||||
@ -203,11 +200,9 @@ jobs:
|
|||||||
- 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()) }}
|
||||||
uses: nick-fields/retry@v3.0.1
|
shell: bash
|
||||||
with:
|
run: |
|
||||||
command: .github/ci-cd-scripts/playwright-electron.sh ${{matrix.shardIndex}} ${{matrix.shardTotal}} ${{matrix.os}}
|
.github/ci-cd-scripts/playwright-electron.sh ${{matrix.shardIndex}} ${{matrix.shardTotal}} ${{matrix.os}}
|
||||||
timeout_minutes: 30
|
|
||||||
max_attempts: 25
|
|
||||||
env:
|
env:
|
||||||
CI: true
|
CI: true
|
||||||
FAIL_ON_CONSOLE_ERRORS: true
|
FAIL_ON_CONSOLE_ERRORS: true
|
||||||
|
12
.github/workflows/static-analysis.yml
vendored
12
.github/workflows/static-analysis.yml
vendored
@ -37,9 +37,6 @@ jobs:
|
|||||||
node-version-file: '.nvmrc'
|
node-version-file: '.nvmrc'
|
||||||
cache: 'yarn'
|
cache: 'yarn'
|
||||||
- run: yarn install
|
- run: yarn install
|
||||||
- uses: taiki-e/install-action@2dbeb927f58939d3aa13bf06ba0c0a34b76b9bfb
|
|
||||||
with:
|
|
||||||
tool: wasm-pack
|
|
||||||
- run: yarn build:wasm
|
- run: yarn build:wasm
|
||||||
|
|
||||||
yarn-tsc:
|
yarn-tsc:
|
||||||
@ -56,9 +53,6 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
workspaces: './src/wasm-lib'
|
workspaces: './src/wasm-lib'
|
||||||
|
|
||||||
- uses: taiki-e/install-action@2dbeb927f58939d3aa13bf06ba0c0a34b76b9bfb
|
|
||||||
with:
|
|
||||||
tool: wasm-pack
|
|
||||||
- run: yarn build:wasm
|
- run: yarn build:wasm
|
||||||
- run: yarn tsc
|
- run: yarn tsc
|
||||||
|
|
||||||
@ -98,9 +92,6 @@ jobs:
|
|||||||
cache: 'yarn'
|
cache: 'yarn'
|
||||||
|
|
||||||
- run: yarn install
|
- run: yarn install
|
||||||
- uses: taiki-e/install-action@2dbeb927f58939d3aa13bf06ba0c0a34b76b9bfb
|
|
||||||
with:
|
|
||||||
tool: wasm-pack
|
|
||||||
- run: yarn build:wasm
|
- run: yarn build:wasm
|
||||||
|
|
||||||
- run: yarn simpleserver:bg
|
- run: yarn simpleserver:bg
|
||||||
@ -127,9 +118,6 @@ jobs:
|
|||||||
cache: 'yarn'
|
cache: 'yarn'
|
||||||
|
|
||||||
- run: yarn install
|
- run: yarn install
|
||||||
- uses: taiki-e/install-action@2dbeb927f58939d3aa13bf06ba0c0a34b76b9bfb
|
|
||||||
with:
|
|
||||||
tool: wasm-pack
|
|
||||||
- run: yarn build:wasm
|
- run: yarn build:wasm
|
||||||
|
|
||||||
- run: yarn simpleserver:bg
|
- run: yarn simpleserver:bg
|
||||||
|
5
.gitignore
vendored
5
.gitignore
vendored
@ -24,7 +24,7 @@ yarn-debug.log*
|
|||||||
yarn-error.log*
|
yarn-error.log*
|
||||||
|
|
||||||
.idea
|
.idea
|
||||||
# .vscode
|
.vscode
|
||||||
.helix
|
.helix
|
||||||
src/wasm-lib/.idea
|
src/wasm-lib/.idea
|
||||||
src/wasm-lib/.vscode
|
src/wasm-lib/.vscode
|
||||||
@ -41,12 +41,9 @@ e2e/playwright/playwright-secrets.env
|
|||||||
e2e/playwright/temp1.png
|
e2e/playwright/temp1.png
|
||||||
e2e/playwright/temp2.png
|
e2e/playwright/temp2.png
|
||||||
e2e/playwright/temp3.png
|
e2e/playwright/temp3.png
|
||||||
# this will be overridden for specific directories
|
|
||||||
e2e/playwright/**/*.png
|
|
||||||
# exports from snapshot-tests.spec.ts "exports of each format should work"
|
# exports from snapshot-tests.spec.ts "exports of each format should work"
|
||||||
e2e/playwright/export-snapshots/*
|
e2e/playwright/export-snapshots/*
|
||||||
!e2e/playwright/export-snapshots/*.png
|
!e2e/playwright/export-snapshots/*.png
|
||||||
!e2e/playwright/snapshot-tests.spec.ts-snapshots/*.png
|
|
||||||
|
|
||||||
/kcl-samples
|
/kcl-samples
|
||||||
/test-results/
|
/test-results/
|
||||||
|
5
.vscode/settings.json
vendored
5
.vscode/settings.json
vendored
@ -1,5 +0,0 @@
|
|||||||
{
|
|
||||||
"rust-analyzer.linkedProjects": [
|
|
||||||
"src/wasm-lib/Cargo.toml"
|
|
||||||
]
|
|
||||||
}
|
|
39
README.md
39
README.md
@ -48,49 +48,22 @@ We recommend downloading the latest application binary from [our Releases page](
|
|||||||
|
|
||||||
## Running a development build
|
## Running a development build
|
||||||
|
|
||||||
Install a node version manager such as [fnm](https://github.com/Schniz/fnm?tab=readme-ov-#installation).
|
First, [install Rust via `rustup`](https://www.rust-lang.org/tools/install). This project uses a lot of Rust compiled to [WASM](https://webassembly.org/) within it. We always use the latest stable version of Rust, so you may need to run `rustup update stable`. Then, run:
|
||||||
|
|
||||||
On Windows, it's also recommended to [upgrade your PowerShell version](https://learn.microsoft.com/en-us/powershell/scripting/install/installing-powershell-on-windows?view=powershell-7.5#winget), we're using 7.
|
|
||||||
|
|
||||||
Then in the repo run the following to install and use the node version specified in `.nvmrc`. You might need to specify your processor architecture with `--arch arm64` or `--arch x64` if it's not autodetected.
|
|
||||||
```
|
|
||||||
fnm install --corepack-enabled
|
|
||||||
fnm use
|
|
||||||
```
|
|
||||||
|
|
||||||
Install the NPM dependencies with:
|
|
||||||
```
|
```
|
||||||
yarn install
|
yarn install
|
||||||
```
|
```
|
||||||
|
|
||||||
This project uses a lot of Rust compiled to [WASM](https://webassembly.org/) within it. We have package scripts to run rustup, see `package.json` for reference:
|
followed by:
|
||||||
```
|
|
||||||
# macOS/Linux
|
|
||||||
yarn install:rust
|
|
||||||
yarn install:wasm-pack:sh
|
|
||||||
|
|
||||||
# Windows
|
|
||||||
yarn install:rust:windows
|
|
||||||
yarn install:wasm-pack:cargo
|
|
||||||
```
|
```
|
||||||
|
|
||||||
Then to build the WASM layer, run:
|
|
||||||
```
|
|
||||||
# macOS/Linux
|
|
||||||
yarn build:wasm
|
yarn build:wasm
|
||||||
|
|
||||||
# Windows
|
|
||||||
yarn build:wasm:windows
|
|
||||||
```
|
```
|
||||||
|
|
||||||
Or if you have the `gh` cli installed and want to download the latest main wasm bundle. Note that on Windows, you need to associate .ps1 files with PowerShell, which can be done via the right click menu, selecting `C:\Program Files\PowerShell\7\pwsh.exe`, and you can install tools like `gh` via `yarn install:tools:windows`.
|
or if you have the gh cli installed
|
||||||
|
|
||||||
```
|
```
|
||||||
# macOS/Linux
|
./get-latest-wasm-bundle.sh # this will download the latest main wasm bundle
|
||||||
yarn fetch:wasm
|
|
||||||
|
|
||||||
# Windows
|
|
||||||
yarn fetch:wasm:windows
|
|
||||||
```
|
```
|
||||||
|
|
||||||
That will build the WASM binary and put in the `public` dir (though gitignored).
|
That will build the WASM binary and put in the `public` dir (though gitignored).
|
||||||
@ -101,7 +74,7 @@ Finally, to run the web app only, run:
|
|||||||
yarn start
|
yarn start
|
||||||
```
|
```
|
||||||
|
|
||||||
If you're not a Zoo employee you won't be able to access the dev environment, you should copy everything from `.env.production` to `.env.development` to make it point to production instead, then when you navigate to `localhost:3000` the easiest way to sign in is to paste `localStorage.setItem('TOKEN_PERSIST_KEY', "your-token-from-https://zoo.dev/account/api-tokens")` replacing the with a real token from https://zoo.dev/account/api-tokens of course, then navigate to localhost:3000 again. Note that navigating to `localhost:3000/signin` removes your token so you will need to set the token again.
|
If you're not an KittyCAD employee you won't be able to access the dev environment, you should copy everything from `.env.production` to `.env.development` to make it point to production instead, then when you navigate to `localhost:3000` the easiest way to sign in is to paste `localStorage.setItem('TOKEN_PERSIST_KEY', "your-token-from-https://zoo.dev/account/api-tokens")` replacing the with a real token from https://zoo.dev/account/api-tokens of course, then navigate to localhost:3000 again. Note that navigating to `localhost:3000/signin` removes your token so you will need to set the token again.
|
||||||
|
|
||||||
### Development environment variables
|
### Development environment variables
|
||||||
|
|
||||||
@ -128,7 +101,7 @@ This will start the application and hot-reload on changes.
|
|||||||
|
|
||||||
Devtools can be opened with the usual Cmd-Opt-I (Mac) or Ctrl-Shift-I (Linux and Windows).
|
Devtools can be opened with the usual Cmd-Opt-I (Mac) or Ctrl-Shift-I (Linux and Windows).
|
||||||
|
|
||||||
To package the app for your platform with electron-builder, run `yarn tronb:package:dev` (or `yarn tronb:package:prod` to point to the .env.production variables)
|
To build with electron-builder, run `yarn tronb:package:dev` (or `yarn tronb:package:prod` to point to the .env.production variables)
|
||||||
|
|
||||||
## Checking out commits / Bisecting
|
## Checking out commits / Bisecting
|
||||||
|
|
||||||
|
@ -1,15 +0,0 @@
|
|||||||
---
|
|
||||||
title: "HALF_TURN"
|
|
||||||
excerpt: ""
|
|
||||||
layout: manual
|
|
||||||
---
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
```js
|
|
||||||
HALF_TURN: number(deg) = 180deg
|
|
||||||
```
|
|
||||||
|
|
||||||
|
|
@ -1,15 +0,0 @@
|
|||||||
---
|
|
||||||
title: "QUARTER_TURN"
|
|
||||||
excerpt: ""
|
|
||||||
layout: manual
|
|
||||||
---
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
```js
|
|
||||||
QUARTER_TURN: number(deg) = 90deg
|
|
||||||
```
|
|
||||||
|
|
||||||
|
|
@ -1,15 +0,0 @@
|
|||||||
---
|
|
||||||
title: "THREE_QUARTER_TURN"
|
|
||||||
excerpt: ""
|
|
||||||
layout: manual
|
|
||||||
---
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
```js
|
|
||||||
THREE_QUARTER_TURN: number(deg) = 270deg
|
|
||||||
```
|
|
||||||
|
|
||||||
|
|
@ -1,15 +0,0 @@
|
|||||||
---
|
|
||||||
title: "ZERO"
|
|
||||||
excerpt: ""
|
|
||||||
layout: manual
|
|
||||||
---
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
```js
|
|
||||||
ZERO: number = 0
|
|
||||||
```
|
|
||||||
|
|
||||||
|
|
@ -25,7 +25,7 @@ abs(num: number) -> number
|
|||||||
|
|
||||||
### Returns
|
### Returns
|
||||||
|
|
||||||
`number`
|
`number`
|
||||||
|
|
||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
@ -25,7 +25,7 @@ acos(num: number) -> number
|
|||||||
|
|
||||||
### Returns
|
### Returns
|
||||||
|
|
||||||
`number`
|
`number`
|
||||||
|
|
||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
@ -23,7 +23,7 @@ angleToMatchLengthX(tag: TagIdentifier, to: number, sketch: Sketch) -> number
|
|||||||
|
|
||||||
### Returns
|
### Returns
|
||||||
|
|
||||||
`number`
|
`number`
|
||||||
|
|
||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
@ -23,7 +23,7 @@ angleToMatchLengthY(tag: TagIdentifier, to: number, sketch: Sketch) -> number
|
|||||||
|
|
||||||
### Returns
|
### Returns
|
||||||
|
|
||||||
`number`
|
`number`
|
||||||
|
|
||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
@ -9,7 +9,7 @@ Set the appearance of a solid. This only works on solids, not sketches or indivi
|
|||||||
This will work on any solid, including extruded solids, revolved solids, and shelled solids.
|
This will work on any solid, including extruded solids, revolved solids, and shelled solids.
|
||||||
|
|
||||||
```js
|
```js
|
||||||
appearance(solidSet: SolidSet, color: String, metalness?: number, roughness?: number) -> SolidSet
|
appearance(solid_set: SolidSet, color: String, metalness?: number, roughness?: number) -> SolidSet
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -17,7 +17,7 @@ appearance(solidSet: SolidSet, color: String, metalness?: number, roughness?: nu
|
|||||||
|
|
||||||
| Name | Type | Description | Required |
|
| Name | Type | Description | Required |
|
||||||
|----------|------|-------------|----------|
|
|----------|------|-------------|----------|
|
||||||
| `solidSet` | [`SolidSet`](/docs/kcl/types/SolidSet) | The solid(s) whose appearance is being set | Yes |
|
| `solid_set` | [`SolidSet`](/docs/kcl/types/SolidSet) | The solid(s) whose appearance is being set | Yes |
|
||||||
| `color` | `String` | Color of the new material, a hex string like '#ff0000' | Yes |
|
| `color` | `String` | Color of the new material, a hex string like '#ff0000' | Yes |
|
||||||
| `metalness` | `number` | Metalness of the new material, a percentage like 95.7. | No |
|
| `metalness` | `number` | Metalness of the new material, a percentage like 95.7. | No |
|
||||||
| `roughness` | `number` | Roughness of the new material, a percentage like 95.7. | No |
|
| `roughness` | `number` | Roughness of the new material, a percentage like 95.7. | No |
|
||||||
|
@ -25,7 +25,7 @@ asin(num: number) -> number
|
|||||||
|
|
||||||
### Returns
|
### Returns
|
||||||
|
|
||||||
`number`
|
`number`
|
||||||
|
|
||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
@ -22,7 +22,7 @@ assert(data: bool, message: string) -> ()
|
|||||||
|
|
||||||
### Returns
|
### Returns
|
||||||
|
|
||||||
`()`
|
`()`
|
||||||
|
|
||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
@ -24,7 +24,7 @@ assertEqual(left: number, right: number, epsilon: number, message: string) -> ()
|
|||||||
|
|
||||||
### Returns
|
### Returns
|
||||||
|
|
||||||
`()`
|
`()`
|
||||||
|
|
||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
@ -23,7 +23,7 @@ assertGreaterThan(left: number, right: number, message: string) -> ()
|
|||||||
|
|
||||||
### Returns
|
### Returns
|
||||||
|
|
||||||
`()`
|
`()`
|
||||||
|
|
||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
@ -23,7 +23,7 @@ assertGreaterThanOrEq(left: number, right: number, message: string) -> ()
|
|||||||
|
|
||||||
### Returns
|
### Returns
|
||||||
|
|
||||||
`()`
|
`()`
|
||||||
|
|
||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
@ -23,7 +23,7 @@ assertLessThan(left: number, right: number, message: string) -> ()
|
|||||||
|
|
||||||
### Returns
|
### Returns
|
||||||
|
|
||||||
`()`
|
`()`
|
||||||
|
|
||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
@ -23,7 +23,7 @@ assertLessThanOrEq(left: number, right: number, message: string) -> ()
|
|||||||
|
|
||||||
### Returns
|
### Returns
|
||||||
|
|
||||||
`()`
|
`()`
|
||||||
|
|
||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
@ -25,7 +25,7 @@ atan(num: number) -> number
|
|||||||
|
|
||||||
### Returns
|
### Returns
|
||||||
|
|
||||||
`number`
|
`number`
|
||||||
|
|
||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
@ -26,7 +26,7 @@ atan2(y: number, x: number) -> number
|
|||||||
|
|
||||||
### Returns
|
### Returns
|
||||||
|
|
||||||
`number`
|
`number`
|
||||||
|
|
||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
@ -25,7 +25,7 @@ ceil(num: number) -> number
|
|||||||
|
|
||||||
### Returns
|
### Returns
|
||||||
|
|
||||||
`number`
|
`number`
|
||||||
|
|
||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
File diff suppressed because one or more lines are too long
@ -9,7 +9,7 @@ Construct a 2-dimensional circle, of the specified radius, centered at
|
|||||||
the provided (x, y) origin point.
|
the provided (x, y) origin point.
|
||||||
|
|
||||||
```js
|
```js
|
||||||
circle(data: CircleData, sketchSurfaceOrGroup: SketchOrSurface, tag?: TagDeclarator) -> Sketch
|
circle(data: CircleData, sketch_surface_or_group: SketchOrSurface, tag?: TagDeclarator) -> Sketch
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -18,7 +18,7 @@ circle(data: CircleData, sketchSurfaceOrGroup: SketchOrSurface, tag?: TagDeclara
|
|||||||
| Name | Type | Description | Required |
|
| Name | Type | Description | Required |
|
||||||
|----------|------|-------------|----------|
|
|----------|------|-------------|----------|
|
||||||
| `data` | [`CircleData`](/docs/kcl/types/CircleData) | Data for drawing an circle | Yes |
|
| `data` | [`CircleData`](/docs/kcl/types/CircleData) | Data for drawing an circle | Yes |
|
||||||
| `sketchSurfaceOrGroup` | [`SketchOrSurface`](/docs/kcl/types/SketchOrSurface) | A sketch surface or a sketch. | Yes |
|
| `sketch_surface_or_group` | [`SketchOrSurface`](/docs/kcl/types/SketchOrSurface) | A sketch surface or a sketch. | Yes |
|
||||||
| `tag` | [`TagDeclarator`](/docs/kcl/types#tag-declaration) | | No |
|
| `tag` | [`TagDeclarator`](/docs/kcl/types#tag-declaration) | | No |
|
||||||
|
|
||||||
### Returns
|
### Returns
|
||||||
|
@ -9,7 +9,7 @@ Construct a circle derived from 3 points.
|
|||||||
|
|
||||||
|
|
||||||
```js
|
```js
|
||||||
circleThreePoint(p1: [number], p2: [number], p3: [number], sketchSurfaceOrGroup: SketchOrSurface, tag?: TagDeclarator) -> Sketch
|
circleThreePoint(p1: [number], p2: [number], p3: [number], sketch_surface_or_group: SketchOrSurface, tag?: TagDeclarator) -> Sketch
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -20,7 +20,7 @@ circleThreePoint(p1: [number], p2: [number], p3: [number], sketchSurfaceOrGroup:
|
|||||||
| `p1` | `[number]` | 1st point to derive the circle. | Yes |
|
| `p1` | `[number]` | 1st point to derive the circle. | Yes |
|
||||||
| `p2` | `[number]` | 2nd point to derive the circle. | Yes |
|
| `p2` | `[number]` | 2nd point to derive the circle. | Yes |
|
||||||
| `p3` | `[number]` | 3rd point to derive the circle. | Yes |
|
| `p3` | `[number]` | 3rd point to derive the circle. | Yes |
|
||||||
| `sketchSurfaceOrGroup` | [`SketchOrSurface`](/docs/kcl/types/SketchOrSurface) | Plane or surface to sketch on. | Yes |
|
| `sketch_surface_or_group` | [`SketchOrSurface`](/docs/kcl/types/SketchOrSurface) | Plane or surface to sketch on. | Yes |
|
||||||
| `tag` | [`TagDeclarator`](/docs/kcl/types#tag-declaration) | Identifier for the circle to reference elsewhere. | No |
|
| `tag` | [`TagDeclarator`](/docs/kcl/types#tag-declaration) | Identifier for the circle to reference elsewhere. | No |
|
||||||
|
|
||||||
### Returns
|
### Returns
|
||||||
|
@ -26,7 +26,7 @@ cm() -> number
|
|||||||
|
|
||||||
### Returns
|
### Returns
|
||||||
|
|
||||||
`number`
|
`number`
|
||||||
|
|
||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
File diff suppressed because one or more lines are too long
@ -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
@ -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
@ -1,15 +0,0 @@
|
|||||||
---
|
|
||||||
title: "THREE_QUARTER_TURN"
|
|
||||||
excerpt: ""
|
|
||||||
layout: manual
|
|
||||||
---
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
```js
|
|
||||||
THREE_QUARTER_TURN: number(deg) = 270deg
|
|
||||||
```
|
|
||||||
|
|
||||||
|
|
@ -1,15 +0,0 @@
|
|||||||
---
|
|
||||||
title: "ZERO"
|
|
||||||
excerpt: ""
|
|
||||||
layout: manual
|
|
||||||
---
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
```js
|
|
||||||
ZERO: number = 0
|
|
||||||
```
|
|
||||||
|
|
||||||
|
|
@ -1,15 +0,0 @@
|
|||||||
---
|
|
||||||
title: "std::HALF_TURN"
|
|
||||||
excerpt: ""
|
|
||||||
layout: manual
|
|
||||||
---
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
```js
|
|
||||||
std::HALF_TURN: number(deg) = 180deg
|
|
||||||
```
|
|
||||||
|
|
||||||
|
|
@ -1,15 +0,0 @@
|
|||||||
---
|
|
||||||
title: "std::QUARTER_TURN"
|
|
||||||
excerpt: ""
|
|
||||||
layout: manual
|
|
||||||
---
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
```js
|
|
||||||
std::QUARTER_TURN: number(deg) = 90deg
|
|
||||||
```
|
|
||||||
|
|
||||||
|
|
@ -1,15 +0,0 @@
|
|||||||
---
|
|
||||||
title: "std::THREE_QUARTER_TURN"
|
|
||||||
excerpt: ""
|
|
||||||
layout: manual
|
|
||||||
---
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
```js
|
|
||||||
std::THREE_QUARTER_TURN: number(deg) = 270deg
|
|
||||||
```
|
|
||||||
|
|
||||||
|
|
@ -1,15 +0,0 @@
|
|||||||
---
|
|
||||||
title: "std::ZERO"
|
|
||||||
excerpt: ""
|
|
||||||
layout: manual
|
|
||||||
---
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
```js
|
|
||||||
std::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
48
docs/kcl/cos.md
Normal file
48
docs/kcl/cos.md
Normal file
File diff suppressed because one or more lines are too long
@ -4,11 +4,9 @@ excerpt: "Return the value of Euler’s number `e`."
|
|||||||
layout: manual
|
layout: manual
|
||||||
---
|
---
|
||||||
|
|
||||||
**WARNING:** This function is deprecated.
|
|
||||||
|
|
||||||
Return the value of Euler’s number `e`.
|
Return the value of Euler’s number `e`.
|
||||||
|
|
||||||
**DEPRECATED** use the constant E
|
|
||||||
|
|
||||||
```js
|
```js
|
||||||
e() -> number
|
e() -> number
|
||||||
@ -22,7 +20,7 @@ e() -> number
|
|||||||
|
|
||||||
### Returns
|
### Returns
|
||||||
|
|
||||||
`number`
|
`number`
|
||||||
|
|
||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
@ -9,7 +9,7 @@ Extend a 2-dimensional sketch through a third dimension in order to
|
|||||||
create new 3-dimensional volume, or if extruded into an existing volume, cut into an existing solid.
|
create new 3-dimensional volume, or if extruded into an existing volume, cut into an existing solid.
|
||||||
|
|
||||||
```js
|
```js
|
||||||
extrude(sketchSet: SketchSet, length: number) -> SolidSet
|
extrude(sketch_set: SketchSet, length: number) -> SolidSet
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -17,7 +17,7 @@ extrude(sketchSet: SketchSet, length: number) -> SolidSet
|
|||||||
|
|
||||||
| Name | Type | Description | Required |
|
| Name | Type | Description | Required |
|
||||||
|----------|------|-------------|----------|
|
|----------|------|-------------|----------|
|
||||||
| `sketchSet` | [`SketchSet`](/docs/kcl/types/SketchSet) | Which sketches should be extruded | Yes |
|
| `sketch_set` | [`SketchSet`](/docs/kcl/types/SketchSet) | Which sketches should be extruded | Yes |
|
||||||
| `length` | `number` | How far to extrude the given sketches | Yes |
|
| `length` | `number` | How far to extrude the given sketches | Yes |
|
||||||
|
|
||||||
### Returns
|
### Returns
|
||||||
|
File diff suppressed because one or more lines are too long
@ -25,7 +25,7 @@ floor(num: number) -> number
|
|||||||
|
|
||||||
### Returns
|
### Returns
|
||||||
|
|
||||||
`number`
|
`number`
|
||||||
|
|
||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
@ -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
@ -9,7 +9,7 @@ Create a helix.
|
|||||||
|
|
||||||
|
|
||||||
```js
|
```js
|
||||||
helix(revolutions: number, angleStart: number, ccw?: bool, radius: number, axis: Axis3dOrEdgeReference, length?: number) -> HelixValue
|
helix(revolutions: number, angle_start: number, ccw?: bool, radius: number, axis: Axis3dOrEdgeReference, length?: number) -> HelixValue
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -18,7 +18,7 @@ helix(revolutions: number, angleStart: number, ccw?: bool, radius: number, axis:
|
|||||||
| Name | Type | Description | Required |
|
| Name | Type | Description | Required |
|
||||||
|----------|------|-------------|----------|
|
|----------|------|-------------|----------|
|
||||||
| `revolutions` | `number` | Number of revolutions. | Yes |
|
| `revolutions` | `number` | Number of revolutions. | Yes |
|
||||||
| `angleStart` | `number` | Start angle (in degrees). | Yes |
|
| `angle_start` | `number` | Start angle (in degrees). | Yes |
|
||||||
| `ccw` | `bool` | Is the helix rotation counter clockwise? The default is `false`. | No |
|
| `ccw` | `bool` | Is the helix rotation counter clockwise? The default is `false`. | No |
|
||||||
| `radius` | `number` | Radius of the helix. | Yes |
|
| `radius` | `number` | Radius of the helix. | Yes |
|
||||||
| `axis` | [`Axis3dOrEdgeReference`](/docs/kcl/types/Axis3dOrEdgeReference) | Axis to use for the helix. | Yes |
|
| `axis` | [`Axis3dOrEdgeReference`](/docs/kcl/types/Axis3dOrEdgeReference) | Axis to use for the helix. | Yes |
|
||||||
@ -82,11 +82,11 @@ helixPath = helix(
|
|||||||
length = 10,
|
length = 10,
|
||||||
radius = 5,
|
radius = 5,
|
||||||
axis = {
|
axis = {
|
||||||
custom = {
|
custom = {
|
||||||
axis = [0, 0, 1.0],
|
axis = [0, 0, 1.0],
|
||||||
origin = [0, 0.25, 0]
|
origin = [0, 0.25, 0]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
// Create a spring by sweeping around the helix path.
|
// Create a spring by sweeping around the helix path.
|
||||||
|
@ -18,11 +18,11 @@ helixRevolutions(data: HelixRevolutionsData, solid: Solid) -> Solid
|
|||||||
| Name | Type | Description | Required |
|
| Name | Type | Description | Required |
|
||||||
|----------|------|-------------|----------|
|
|----------|------|-------------|----------|
|
||||||
| `data` | [`HelixRevolutionsData`](/docs/kcl/types/HelixRevolutionsData) | Data for helix revolutions. | Yes |
|
| `data` | [`HelixRevolutionsData`](/docs/kcl/types/HelixRevolutionsData) | Data for helix revolutions. | Yes |
|
||||||
| `solid` | [`Solid`](/docs/kcl/types/Solid) | A solid is a collection of extrude surfaces. | Yes |
|
| `solid` | [`Solid`](/docs/kcl/types/Solid) | An solid is a collection of extrude surfaces. | Yes |
|
||||||
|
|
||||||
### Returns
|
### Returns
|
||||||
|
|
||||||
[`Solid`](/docs/kcl/types/Solid) - A solid is a collection of extrude surfaces.
|
[`Solid`](/docs/kcl/types/Solid) - An solid is a collection of extrude surfaces.
|
||||||
|
|
||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
@ -9,7 +9,7 @@ Use a 2-dimensional sketch to cut a hole in another 2-dimensional sketch.
|
|||||||
|
|
||||||
|
|
||||||
```js
|
```js
|
||||||
hole(holeSketch: SketchSet, sketch: Sketch) -> Sketch
|
hole(hole_sketch: SketchSet, sketch: Sketch) -> Sketch
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -17,7 +17,7 @@ hole(holeSketch: SketchSet, sketch: Sketch) -> Sketch
|
|||||||
|
|
||||||
| Name | Type | Description | Required |
|
| Name | Type | Description | Required |
|
||||||
|----------|------|-------------|----------|
|
|----------|------|-------------|----------|
|
||||||
| `holeSketch` | [`SketchSet`](/docs/kcl/types/SketchSet) | A sketch or a group of sketches. | Yes |
|
| `hole_sketch` | [`SketchSet`](/docs/kcl/types/SketchSet) | A sketch or a group of sketches. | Yes |
|
||||||
| `sketch` | [`Sketch`](/docs/kcl/types/Sketch) | A sketch is a collection of paths. | Yes |
|
| `sketch` | [`Sketch`](/docs/kcl/types/Sketch) | A sketch is a collection of paths. | Yes |
|
||||||
|
|
||||||
### Returns
|
### Returns
|
||||||
|
@ -18,11 +18,11 @@ hollow(thickness: number, solid: Solid) -> Solid
|
|||||||
| Name | Type | Description | Required |
|
| Name | Type | Description | Required |
|
||||||
|----------|------|-------------|----------|
|
|----------|------|-------------|----------|
|
||||||
| `thickness` | `number` | | Yes |
|
| `thickness` | `number` | | Yes |
|
||||||
| `solid` | [`Solid`](/docs/kcl/types/Solid) | A solid is a collection of extrude surfaces. | Yes |
|
| `solid` | [`Solid`](/docs/kcl/types/Solid) | An solid is a collection of extrude surfaces. | Yes |
|
||||||
|
|
||||||
### Returns
|
### Returns
|
||||||
|
|
||||||
[`Solid`](/docs/kcl/types/Solid) - A solid is a collection of extrude surfaces.
|
[`Solid`](/docs/kcl/types/Solid) - An solid is a collection of extrude surfaces.
|
||||||
|
|
||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
@ -15,7 +15,7 @@ For formats lacking unit data (such as STL, OBJ, or PLY files), the default unit
|
|||||||
Note: The import command currently only works when using the native Modeling App.
|
Note: The import command currently only works when using the native Modeling App.
|
||||||
|
|
||||||
```js
|
```js
|
||||||
import(filePath: String, options?: ImportFormat) -> ImportedGeometry
|
import(file_path: String, options?: ImportFormat) -> ImportedGeometry
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -23,7 +23,7 @@ import(filePath: String, options?: ImportFormat) -> ImportedGeometry
|
|||||||
|
|
||||||
| Name | Type | Description | Required |
|
| Name | Type | Description | Required |
|
||||||
|----------|------|-------------|----------|
|
|----------|------|-------------|----------|
|
||||||
| `filePath` | `String` | | Yes |
|
| `file_path` | `String` | | Yes |
|
||||||
| `options` | [`ImportFormat`](/docs/kcl/types/ImportFormat) | Import format specifier | No |
|
| `options` | [`ImportFormat`](/docs/kcl/types/ImportFormat) | Import format specifier | No |
|
||||||
|
|
||||||
### Returns
|
### Returns
|
||||||
|
@ -26,7 +26,7 @@ inch() -> number
|
|||||||
|
|
||||||
### Returns
|
### Returns
|
||||||
|
|
||||||
`number`
|
`number`
|
||||||
|
|
||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
@ -9,116 +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)
|
||||||
* [`HALF_TURN`](kcl/const_std-HALF_TURN)
|
* [`acos`](kcl/acos)
|
||||||
* [`QUARTER_TURN`](kcl/const_std-QUARTER_TURN)
|
* [`angleToMatchLengthX`](kcl/angleToMatchLengthX)
|
||||||
* [`THREE_QUARTER_TURN`](kcl/const_std-THREE_QUARTER_TURN)
|
* [`angleToMatchLengthY`](kcl/angleToMatchLengthY)
|
||||||
* [`ZERO`](kcl/const_std-ZERO)
|
* [`angledLine`](kcl/angledLine)
|
||||||
* [`abs`](kcl/abs)
|
* [`angledLineOfXLength`](kcl/angledLineOfXLength)
|
||||||
* [`acos`](kcl/acos)
|
* [`angledLineOfYLength`](kcl/angledLineOfYLength)
|
||||||
* [`angleToMatchLengthX`](kcl/angleToMatchLengthX)
|
* [`angledLineThatIntersects`](kcl/angledLineThatIntersects)
|
||||||
* [`angleToMatchLengthY`](kcl/angleToMatchLengthY)
|
* [`angledLineToX`](kcl/angledLineToX)
|
||||||
* [`angledLine`](kcl/angledLine)
|
* [`angledLineToY`](kcl/angledLineToY)
|
||||||
* [`angledLineOfXLength`](kcl/angledLineOfXLength)
|
* [`appearance`](kcl/appearance)
|
||||||
* [`angledLineOfYLength`](kcl/angledLineOfYLength)
|
* [`arc`](kcl/arc)
|
||||||
* [`angledLineThatIntersects`](kcl/angledLineThatIntersects)
|
* [`arcTo`](kcl/arcTo)
|
||||||
* [`angledLineToX`](kcl/angledLineToX)
|
* [`asin`](kcl/asin)
|
||||||
* [`angledLineToY`](kcl/angledLineToY)
|
* [`assert`](kcl/assert)
|
||||||
* [`appearance`](kcl/appearance)
|
* [`assertEqual`](kcl/assertEqual)
|
||||||
* [`arc`](kcl/arc)
|
* [`assertGreaterThan`](kcl/assertGreaterThan)
|
||||||
* [`arcTo`](kcl/arcTo)
|
* [`assertGreaterThanOrEq`](kcl/assertGreaterThanOrEq)
|
||||||
* [`asin`](kcl/asin)
|
* [`assertLessThan`](kcl/assertLessThan)
|
||||||
* [`assert`](kcl/assert)
|
* [`assertLessThanOrEq`](kcl/assertLessThanOrEq)
|
||||||
* [`assertEqual`](kcl/assertEqual)
|
* [`atan`](kcl/atan)
|
||||||
* [`assertGreaterThan`](kcl/assertGreaterThan)
|
* [`atan2`](kcl/atan2)
|
||||||
* [`assertGreaterThanOrEq`](kcl/assertGreaterThanOrEq)
|
* [`bezierCurve`](kcl/bezierCurve)
|
||||||
* [`assertLessThan`](kcl/assertLessThan)
|
* [`ceil`](kcl/ceil)
|
||||||
* [`assertLessThanOrEq`](kcl/assertLessThanOrEq)
|
* [`chamfer`](kcl/chamfer)
|
||||||
* [`atan`](kcl/atan)
|
* [`circle`](kcl/circle)
|
||||||
* [`atan2`](kcl/atan2)
|
* [`circleThreePoint`](kcl/circleThreePoint)
|
||||||
* [`bezierCurve`](kcl/bezierCurve)
|
* [`close`](kcl/close)
|
||||||
* [`ceil`](kcl/ceil)
|
* [`cm`](kcl/cm)
|
||||||
* [`chamfer`](kcl/chamfer)
|
* [`cos`](kcl/cos)
|
||||||
* [`circle`](kcl/circle)
|
* [`e`](kcl/e)
|
||||||
* [`circleThreePoint`](kcl/circleThreePoint)
|
* [`extrude`](kcl/extrude)
|
||||||
* [`close`](kcl/close)
|
* [`fillet`](kcl/fillet)
|
||||||
* [`cm`](kcl/cm)
|
* [`floor`](kcl/floor)
|
||||||
* [`extrude`](kcl/extrude)
|
* [`ft`](kcl/ft)
|
||||||
* [`fillet`](kcl/fillet)
|
* [`getNextAdjacentEdge`](kcl/getNextAdjacentEdge)
|
||||||
* [`floor`](kcl/floor)
|
* [`getOppositeEdge`](kcl/getOppositeEdge)
|
||||||
* [`ft`](kcl/ft)
|
* [`getPreviousAdjacentEdge`](kcl/getPreviousAdjacentEdge)
|
||||||
* [`getNextAdjacentEdge`](kcl/getNextAdjacentEdge)
|
* [`helix`](kcl/helix)
|
||||||
* [`getOppositeEdge`](kcl/getOppositeEdge)
|
* [`helixRevolutions`](kcl/helixRevolutions)
|
||||||
* [`getPreviousAdjacentEdge`](kcl/getPreviousAdjacentEdge)
|
* [`hole`](kcl/hole)
|
||||||
* [`helix`](kcl/helix)
|
* [`hollow`](kcl/hollow)
|
||||||
* [`helixRevolutions`](kcl/helixRevolutions)
|
* [`inch`](kcl/inch)
|
||||||
* [`hole`](kcl/hole)
|
* [`lastSegX`](kcl/lastSegX)
|
||||||
* [`hollow`](kcl/hollow)
|
* [`lastSegY`](kcl/lastSegY)
|
||||||
* [`inch`](kcl/inch)
|
* [`legAngX`](kcl/legAngX)
|
||||||
* [`lastSegX`](kcl/lastSegX)
|
* [`legAngY`](kcl/legAngY)
|
||||||
* [`lastSegY`](kcl/lastSegY)
|
* [`legLen`](kcl/legLen)
|
||||||
* [`legAngX`](kcl/legAngX)
|
* [`line`](kcl/line)
|
||||||
* [`legAngY`](kcl/legAngY)
|
* [`ln`](kcl/ln)
|
||||||
* [`legLen`](kcl/legLen)
|
* [`loft`](kcl/loft)
|
||||||
* [`line`](kcl/line)
|
* [`log`](kcl/log)
|
||||||
* [`ln`](kcl/ln)
|
* [`log10`](kcl/log10)
|
||||||
* [`loft`](kcl/loft)
|
* [`log2`](kcl/log2)
|
||||||
* [`log`](kcl/log)
|
* [`m`](kcl/m)
|
||||||
* [`log10`](kcl/log10)
|
* [`map`](kcl/map)
|
||||||
* [`log2`](kcl/log2)
|
* [`max`](kcl/max)
|
||||||
* [`m`](kcl/m)
|
* [`min`](kcl/min)
|
||||||
* [`map`](kcl/map)
|
* [`mirror2d`](kcl/mirror2d)
|
||||||
* [`max`](kcl/max)
|
* [`mm`](kcl/mm)
|
||||||
* [`min`](kcl/min)
|
* [`offsetPlane`](kcl/offsetPlane)
|
||||||
* [`mirror2d`](kcl/mirror2d)
|
* [`patternCircular2d`](kcl/patternCircular2d)
|
||||||
* [`mm`](kcl/mm)
|
* [`patternCircular3d`](kcl/patternCircular3d)
|
||||||
* [`offsetPlane`](kcl/offsetPlane)
|
* [`patternLinear2d`](kcl/patternLinear2d)
|
||||||
* [`patternCircular2d`](kcl/patternCircular2d)
|
* [`patternLinear3d`](kcl/patternLinear3d)
|
||||||
* [`patternCircular3d`](kcl/patternCircular3d)
|
* [`patternTransform`](kcl/patternTransform)
|
||||||
* [`patternLinear2d`](kcl/patternLinear2d)
|
* [`patternTransform2d`](kcl/patternTransform2d)
|
||||||
* [`patternLinear3d`](kcl/patternLinear3d)
|
* [`pi`](kcl/pi)
|
||||||
* [`patternTransform`](kcl/patternTransform)
|
* [`polar`](kcl/polar)
|
||||||
* [`patternTransform2d`](kcl/patternTransform2d)
|
* [`polygon`](kcl/polygon)
|
||||||
* [`polar`](kcl/polar)
|
* [`pop`](kcl/pop)
|
||||||
* [`polygon`](kcl/polygon)
|
* [`pow`](kcl/pow)
|
||||||
* [`pop`](kcl/pop)
|
* [`profileStart`](kcl/profileStart)
|
||||||
* [`pow`](kcl/pow)
|
* [`profileStartX`](kcl/profileStartX)
|
||||||
* [`profileStart`](kcl/profileStart)
|
* [`profileStartY`](kcl/profileStartY)
|
||||||
* [`profileStartX`](kcl/profileStartX)
|
* [`push`](kcl/push)
|
||||||
* [`profileStartY`](kcl/profileStartY)
|
* [`reduce`](kcl/reduce)
|
||||||
* [`push`](kcl/push)
|
* [`rem`](kcl/rem)
|
||||||
* [`reduce`](kcl/reduce)
|
* [`revolve`](kcl/revolve)
|
||||||
* [`rem`](kcl/rem)
|
* [`round`](kcl/round)
|
||||||
* [`revolve`](kcl/revolve)
|
* [`segAng`](kcl/segAng)
|
||||||
* [`round`](kcl/round)
|
* [`segEnd`](kcl/segEnd)
|
||||||
* [`segAng`](kcl/segAng)
|
* [`segEndX`](kcl/segEndX)
|
||||||
* [`segEnd`](kcl/segEnd)
|
* [`segEndY`](kcl/segEndY)
|
||||||
* [`segEndX`](kcl/segEndX)
|
* [`segLen`](kcl/segLen)
|
||||||
* [`segEndY`](kcl/segEndY)
|
* [`segStart`](kcl/segStart)
|
||||||
* [`segLen`](kcl/segLen)
|
* [`segStartX`](kcl/segStartX)
|
||||||
* [`segStart`](kcl/segStart)
|
* [`segStartY`](kcl/segStartY)
|
||||||
* [`segStartX`](kcl/segStartX)
|
* [`shell`](kcl/shell)
|
||||||
* [`segStartY`](kcl/segStartY)
|
* [`sin`](kcl/sin)
|
||||||
* [`shell`](kcl/shell)
|
* [`sqrt`](kcl/sqrt)
|
||||||
* [`sqrt`](kcl/sqrt)
|
* [`startProfileAt`](kcl/startProfileAt)
|
||||||
* [`startProfileAt`](kcl/startProfileAt)
|
* [`startSketchOn`](kcl/startSketchOn)
|
||||||
* [`startSketchOn`](kcl/startSketchOn)
|
* [`sweep`](kcl/sweep)
|
||||||
* [`sweep`](kcl/sweep)
|
* [`tan`](kcl/tan)
|
||||||
* [`tangentToEnd`](kcl/tangentToEnd)
|
* [`tangentToEnd`](kcl/tangentToEnd)
|
||||||
* [`tangentialArc`](kcl/tangentialArc)
|
* [`tangentialArc`](kcl/tangentialArc)
|
||||||
* [`tangentialArcTo`](kcl/tangentialArcTo)
|
* [`tangentialArcTo`](kcl/tangentialArcTo)
|
||||||
* [`tangentialArcToRelative`](kcl/tangentialArcToRelative)
|
* [`tangentialArcToRelative`](kcl/tangentialArcToRelative)
|
||||||
* [`toDegrees`](kcl/toDegrees)
|
* [`tau`](kcl/tau)
|
||||||
* [`toRadians`](kcl/toRadians)
|
* [`toDegrees`](kcl/toDegrees)
|
||||||
* [`xLine`](kcl/xLine)
|
* [`toRadians`](kcl/toRadians)
|
||||||
* [`xLineTo`](kcl/xLineTo)
|
* [`xLine`](kcl/xLine)
|
||||||
* [`yLine`](kcl/yLine)
|
* [`xLineTo`](kcl/xLineTo)
|
||||||
* [`yLineTo`](kcl/yLineTo)
|
* [`yLine`](kcl/yLine)
|
||||||
* [`yd`](kcl/yd)
|
* [`yLineTo`](kcl/yLineTo)
|
||||||
* **`std::math`**
|
* [`yd`](kcl/yd)
|
||||||
* [`E`](kcl/const_std-math-E)
|
|
||||||
* [`PI`](kcl/const_std-math-PI)
|
|
||||||
* [`TAU`](kcl/const_std-math-TAU)
|
|
||||||
* [`cos`](kcl/std-math-cos)
|
|
||||||
* [`sin`](kcl/std-math-sin)
|
|
||||||
* [`tan`](kcl/std-math-tan)
|
|
||||||
|
File diff suppressed because one or more lines are too long
@ -21,7 +21,7 @@ lastSegX(sketch: Sketch) -> number
|
|||||||
|
|
||||||
### Returns
|
### Returns
|
||||||
|
|
||||||
`number`
|
`number`
|
||||||
|
|
||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
@ -21,7 +21,7 @@ lastSegY(sketch: Sketch) -> number
|
|||||||
|
|
||||||
### Returns
|
### Returns
|
||||||
|
|
||||||
`number`
|
`number`
|
||||||
|
|
||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
@ -26,7 +26,7 @@ legAngX(hypotenuse: number, leg: number) -> number
|
|||||||
|
|
||||||
### Returns
|
### Returns
|
||||||
|
|
||||||
`number`
|
`number`
|
||||||
|
|
||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
@ -26,7 +26,7 @@ legAngY(hypotenuse: number, leg: number) -> number
|
|||||||
|
|
||||||
### Returns
|
### Returns
|
||||||
|
|
||||||
`number`
|
`number`
|
||||||
|
|
||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
@ -26,7 +26,7 @@ legLen(hypotenuse: number, leg: number) -> number
|
|||||||
|
|
||||||
### Returns
|
### Returns
|
||||||
|
|
||||||
`number`
|
`number`
|
||||||
|
|
||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
@ -9,7 +9,7 @@ Extend the current sketch with a new straight line.
|
|||||||
|
|
||||||
|
|
||||||
```js
|
```js
|
||||||
line(sketch: Sketch, endAbsolute?: [number], end?: [number], tag?: TagDeclarator) -> Sketch
|
line(sketch: Sketch, end_absolute?: [number], end?: [number], tag?: TagDeclarator) -> Sketch
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -18,7 +18,7 @@ line(sketch: Sketch, endAbsolute?: [number], end?: [number], tag?: TagDeclarator
|
|||||||
| 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/Sketch) | Which sketch should this path be added to? | Yes |
|
||||||
| `endAbsolute` | `[number]` | Which absolute point should this line go to? Incompatible with `end`. | No |
|
| `end_absolute` | `[number]` | Which absolute point should this line go to? Incompatible with `end`. | No |
|
||||||
| `end` | `[number]` | How far away (along the X and Y axes) should this line go? Incompatible with `endAbsolute`. | No |
|
| `end` | `[number]` | How far away (along the X and Y axes) should this line go? Incompatible with `endAbsolute`. | No |
|
||||||
| `tag` | [`TagDeclarator`](/docs/kcl/types#tag-declaration) | Create a new tag which refers to this line | No |
|
| `tag` | [`TagDeclarator`](/docs/kcl/types#tag-declaration) | Create a new tag which refers to this line | No |
|
||||||
|
|
||||||
|
@ -25,7 +25,7 @@ ln(num: number) -> number
|
|||||||
|
|
||||||
### Returns
|
### Returns
|
||||||
|
|
||||||
`number`
|
`number`
|
||||||
|
|
||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
@ -9,7 +9,7 @@ Create a 3D surface or solid by interpolating between two or more sketches.
|
|||||||
The sketches need to closed and on the same plane.
|
The sketches need to closed and on the same plane.
|
||||||
|
|
||||||
```js
|
```js
|
||||||
loft(sketches: [Sketch], vDegree: NonZeroU32, bezApproximateRational: bool, baseCurveIndex?: integer, tolerance?: number) -> Solid
|
loft(sketches: [Sketch], v_degree: NonZeroU32, bez_approximate_rational: bool, base_curve_index?: integer, tolerance?: number) -> Solid
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -18,14 +18,14 @@ loft(sketches: [Sketch], vDegree: NonZeroU32, bezApproximateRational: bool, base
|
|||||||
| Name | Type | Description | Required |
|
| Name | Type | Description | Required |
|
||||||
|----------|------|-------------|----------|
|
|----------|------|-------------|----------|
|
||||||
| `sketches` | [`[Sketch]`](/docs/kcl/types/Sketch) | Which sketches to loft. Must include at least 2 sketches. | Yes |
|
| `sketches` | [`[Sketch]`](/docs/kcl/types/Sketch) | Which sketches to loft. Must include at least 2 sketches. | Yes |
|
||||||
| `vDegree` | `NonZeroU32` | Degree of the interpolation. Must be greater than zero. For example, use 2 for quadratic, or 3 for cubic interpolation in the V direction. This defaults to 2, if not specified. | Yes |
|
| `v_degree` | `NonZeroU32` | Degree of the interpolation. Must be greater than zero. For example, use 2 for quadratic, or 3 for cubic interpolation in the V direction. This defaults to 2, if not specified. | Yes |
|
||||||
| `bezApproximateRational` | `bool` | Attempt to approximate rational curves (such as arcs) using a bezier. This will remove banding around interpolations between arcs and non-arcs. It may produce errors in other scenarios Over time, this field won't be necessary. | Yes |
|
| `bez_approximate_rational` | `bool` | Attempt to approximate rational curves (such as arcs) using a bezier. This will remove banding around interpolations between arcs and non-arcs. It may produce errors in other scenarios Over time, this field won't be necessary. | Yes |
|
||||||
| `baseCurveIndex` | `integer` | This can be set to override the automatically determined topological base curve, which is usually the first section encountered. | No |
|
| `base_curve_index` | `integer` | This can be set to override the automatically determined topological base curve, which is usually the first section encountered. | No |
|
||||||
| `tolerance` | `number` | Tolerance for the loft operation. | No |
|
| `tolerance` | `number` | Tolerance for the loft operation. | No |
|
||||||
|
|
||||||
### Returns
|
### Returns
|
||||||
|
|
||||||
[`Solid`](/docs/kcl/types/Solid) - A solid is a collection of extrude surfaces.
|
[`Solid`](/docs/kcl/types/Solid) - An solid is a collection of extrude surfaces.
|
||||||
|
|
||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
@ -95,10 +95,10 @@ circleSketch1 = startSketchOn(offsetPlane('XY', offset = 150))
|
|||||||
|
|
||||||
loft(
|
loft(
|
||||||
[
|
[
|
||||||
squareSketch,
|
squareSketch,
|
||||||
circleSketch0,
|
circleSketch0,
|
||||||
circleSketch1
|
circleSketch1
|
||||||
],
|
],
|
||||||
baseCurveIndex = 0,
|
baseCurveIndex = 0,
|
||||||
bezApproximateRational = false,
|
bezApproximateRational = false,
|
||||||
tolerance = 0.000001,
|
tolerance = 0.000001,
|
||||||
|
@ -26,7 +26,7 @@ log(num: number, base: number) -> number
|
|||||||
|
|
||||||
### Returns
|
### Returns
|
||||||
|
|
||||||
`number`
|
`number`
|
||||||
|
|
||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
@ -25,7 +25,7 @@ log10(num: number) -> number
|
|||||||
|
|
||||||
### Returns
|
### Returns
|
||||||
|
|
||||||
`number`
|
`number`
|
||||||
|
|
||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
@ -25,7 +25,7 @@ log2(num: number) -> number
|
|||||||
|
|
||||||
### Returns
|
### Returns
|
||||||
|
|
||||||
`number`
|
`number`
|
||||||
|
|
||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
@ -26,7 +26,7 @@ m() -> number
|
|||||||
|
|
||||||
### Returns
|
### Returns
|
||||||
|
|
||||||
`number`
|
`number`
|
||||||
|
|
||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
@ -9,7 +9,7 @@ Apply a function to every element of a list.
|
|||||||
Given a list like `[a, b, c]`, and a function like `f`, returns `[f(a), f(b), f(c)]`
|
Given a list like `[a, b, c]`, and a function like `f`, returns `[f(a), f(b), f(c)]`
|
||||||
|
|
||||||
```js
|
```js
|
||||||
map(array: [KclValue], mapFn: FunctionSource) -> [KclValue]
|
map(array: [KclValue], map_fn: FunctionParam) -> [KclValue]
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -18,11 +18,11 @@ map(array: [KclValue], mapFn: FunctionSource) -> [KclValue]
|
|||||||
| Name | Type | Description | Required |
|
| Name | Type | Description | Required |
|
||||||
|----------|------|-------------|----------|
|
|----------|------|-------------|----------|
|
||||||
| `array` | [`[KclValue]`](/docs/kcl/types/KclValue) | | Yes |
|
| `array` | [`[KclValue]`](/docs/kcl/types/KclValue) | | Yes |
|
||||||
| `mapFn` | `FunctionSource` | | Yes |
|
| `map_fn` | `FunctionParam` | | Yes |
|
||||||
|
|
||||||
### Returns
|
### Returns
|
||||||
|
|
||||||
[`[KclValue]`](/docs/kcl/types/KclValue)
|
[`[KclValue]`](/docs/kcl/types/KclValue)
|
||||||
|
|
||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
@ -25,7 +25,7 @@ max(args: [number]) -> number
|
|||||||
|
|
||||||
### Returns
|
### Returns
|
||||||
|
|
||||||
`number`
|
`number`
|
||||||
|
|
||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
@ -25,7 +25,7 @@ min(args: [number]) -> number
|
|||||||
|
|
||||||
### Returns
|
### Returns
|
||||||
|
|
||||||
`number`
|
`number`
|
||||||
|
|
||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
@ -11,7 +11,7 @@ Only works on unclosed sketches for now.
|
|||||||
Mirror occurs around a local sketch axis rather than a global axis.
|
Mirror occurs around a local sketch axis rather than a global axis.
|
||||||
|
|
||||||
```js
|
```js
|
||||||
mirror2d(data: Mirror2dData, sketchSet: SketchSet) -> [Sketch]
|
mirror2d(data: Mirror2dData, sketch_set: SketchSet) -> [Sketch]
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -20,11 +20,11 @@ mirror2d(data: Mirror2dData, sketchSet: SketchSet) -> [Sketch]
|
|||||||
| Name | Type | Description | Required |
|
| Name | Type | Description | Required |
|
||||||
|----------|------|-------------|----------|
|
|----------|------|-------------|----------|
|
||||||
| `data` | [`Mirror2dData`](/docs/kcl/types/Mirror2dData) | Data for a mirror. | Yes |
|
| `data` | [`Mirror2dData`](/docs/kcl/types/Mirror2dData) | Data for a mirror. | Yes |
|
||||||
| `sketchSet` | [`SketchSet`](/docs/kcl/types/SketchSet) | A sketch or a group of sketches. | Yes |
|
| `sketch_set` | [`SketchSet`](/docs/kcl/types/SketchSet) | A sketch or a group of sketches. | Yes |
|
||||||
|
|
||||||
### Returns
|
### Returns
|
||||||
|
|
||||||
[`[Sketch]`](/docs/kcl/types/Sketch)
|
[`[Sketch]`](/docs/kcl/types/Sketch)
|
||||||
|
|
||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
@ -26,7 +26,7 @@ mm() -> number
|
|||||||
|
|
||||||
### Returns
|
### Returns
|
||||||
|
|
||||||
`number`
|
`number`
|
||||||
|
|
||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
@ -9,7 +9,7 @@ Offset a plane by a distance along its normal.
|
|||||||
For example, if you offset the 'XZ' plane by 10, the new plane will be parallel to the 'XZ' plane and 10 units away from it.
|
For example, if you offset the 'XZ' plane by 10, the new plane will be parallel to the 'XZ' plane and 10 units away from it.
|
||||||
|
|
||||||
```js
|
```js
|
||||||
offsetPlane(plane: PlaneData, offset: number) -> Plane
|
offsetPlane(std_plane: StandardPlane, offset: number) -> Plane
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -17,7 +17,7 @@ offsetPlane(plane: PlaneData, offset: number) -> Plane
|
|||||||
|
|
||||||
| Name | Type | Description | Required |
|
| Name | Type | Description | Required |
|
||||||
|----------|------|-------------|----------|
|
|----------|------|-------------|----------|
|
||||||
| `plane` | [`PlaneData`](/docs/kcl/types/PlaneData) | The plane (e.g. 'XY') which this new plane is created from. | Yes |
|
| `std_plane` | [`StandardPlane`](/docs/kcl/types/StandardPlane) | Which standard plane (e.g. XY) should this new plane be created from? | Yes |
|
||||||
| `offset` | `number` | Distance from the standard plane this new plane will be created at. | Yes |
|
| `offset` | `number` | Distance from the standard plane this new plane will be created at. | Yes |
|
||||||
|
|
||||||
### Returns
|
### Returns
|
||||||
|
@ -9,7 +9,7 @@ Repeat a 2-dimensional sketch some number of times along a partial or
|
|||||||
complete circle some specified number of times. Each object may additionally be rotated along the circle, ensuring orentation of the solid with respect to the center of the circle is maintained.
|
complete circle some specified number of times. Each object may additionally be rotated along the circle, ensuring orentation of the solid with respect to the center of the circle is maintained.
|
||||||
|
|
||||||
```js
|
```js
|
||||||
patternCircular2d(sketchSet: SketchSet, instances: integer, center: [number], arcDegrees: number, rotateDuplicates: bool, useOriginal?: bool) -> [Sketch]
|
patternCircular2d(sketch_set: SketchSet, instances: integer, center: [number], arc_degrees: number, rotate_duplicates: bool, use_original?: bool) -> [Sketch]
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -17,16 +17,16 @@ patternCircular2d(sketchSet: SketchSet, instances: integer, center: [number], ar
|
|||||||
|
|
||||||
| Name | Type | Description | Required |
|
| Name | Type | Description | Required |
|
||||||
|----------|------|-------------|----------|
|
|----------|------|-------------|----------|
|
||||||
| `sketchSet` | [`SketchSet`](/docs/kcl/types/SketchSet) | Which sketch(es) to pattern | Yes |
|
| `sketch_set` | [`SketchSet`](/docs/kcl/types/SketchSet) | Which sketch(es) to pattern | Yes |
|
||||||
| `instances` | `integer` | The number of total instances. Must be greater than or equal to 1. This includes the original entity. For example, if instances is 2, there will be two copies -- the original, and one new copy. If instances is 1, this has no effect. | Yes |
|
| `instances` | `integer` | The number of total instances. Must be greater than or equal to 1. This includes the original entity. For example, if instances is 2, there will be two copies -- the original, and one new copy. If instances is 1, this has no effect. | Yes |
|
||||||
| `center` | `[number]` | The center about which to make the pattern. This is a 2D vector. | Yes |
|
| `center` | `[number]` | The center about which to make the pattern. This is a 2D vector. | Yes |
|
||||||
| `arcDegrees` | `number` | The arc angle (in degrees) to place the repetitions. Must be greater than 0. | Yes |
|
| `arc_degrees` | `number` | The arc angle (in degrees) to place the repetitions. Must be greater than 0. | Yes |
|
||||||
| `rotateDuplicates` | `bool` | Whether or not to rotate the duplicates as they are copied. | Yes |
|
| `rotate_duplicates` | `bool` | Whether or not to rotate the duplicates as they are copied. | Yes |
|
||||||
| `useOriginal` | `bool` | If the target was sketched on an extrusion, setting this will use the original sketch as the target, not the entire joined solid. Defaults to false. | No |
|
| `use_original` | `bool` | If the target was sketched on an extrusion, setting this will use the original sketch as the target, not the entire joined solid. Defaults to false. | No |
|
||||||
|
|
||||||
### Returns
|
### Returns
|
||||||
|
|
||||||
[`[Sketch]`](/docs/kcl/types/Sketch)
|
[`[Sketch]`](/docs/kcl/types/Sketch)
|
||||||
|
|
||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
@ -9,7 +9,7 @@ Repeat a 3-dimensional solid some number of times along a partial or
|
|||||||
complete circle some specified number of times. Each object may additionally be rotated along the circle, ensuring orentation of the solid with respect to the center of the circle is maintained.
|
complete circle some specified number of times. Each object may additionally be rotated along the circle, ensuring orentation of the solid with respect to the center of the circle is maintained.
|
||||||
|
|
||||||
```js
|
```js
|
||||||
patternCircular3d(solidSet: SolidSet, instances: integer, axis: [number], center: [number], arcDegrees: number, rotateDuplicates: bool, useOriginal?: bool) -> [Solid]
|
patternCircular3d(solid_set: SolidSet, instances: integer, axis: [number], center: [number], arc_degrees: number, rotate_duplicates: bool, use_original?: bool) -> [Solid]
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -17,17 +17,17 @@ patternCircular3d(solidSet: SolidSet, instances: integer, axis: [number], center
|
|||||||
|
|
||||||
| Name | Type | Description | Required |
|
| Name | Type | Description | Required |
|
||||||
|----------|------|-------------|----------|
|
|----------|------|-------------|----------|
|
||||||
| `solidSet` | [`SolidSet`](/docs/kcl/types/SolidSet) | Which solid(s) to pattern | Yes |
|
| `solid_set` | [`SolidSet`](/docs/kcl/types/SolidSet) | Which solid(s) to pattern | Yes |
|
||||||
| `instances` | `integer` | The number of total instances. Must be greater than or equal to 1. This includes the original entity. For example, if instances is 2, there will be two copies -- the original, and one new copy. If instances is 1, this has no effect. | Yes |
|
| `instances` | `integer` | The number of total instances. Must be greater than or equal to 1. This includes the original entity. For example, if instances is 2, there will be two copies -- the original, and one new copy. If instances is 1, this has no effect. | Yes |
|
||||||
| `axis` | `[number]` | The axis around which to make the pattern. This is a 3D vector | Yes |
|
| `axis` | `[number]` | The axis around which to make the pattern. This is a 3D vector | Yes |
|
||||||
| `center` | `[number]` | The center about which to make the pattern. This is a 3D vector. | Yes |
|
| `center` | `[number]` | The center about which to make the pattern. This is a 3D vector. | Yes |
|
||||||
| `arcDegrees` | `number` | The arc angle (in degrees) to place the repetitions. Must be greater than 0. | Yes |
|
| `arc_degrees` | `number` | The arc angle (in degrees) to place the repetitions. Must be greater than 0. | Yes |
|
||||||
| `rotateDuplicates` | `bool` | Whether or not to rotate the duplicates as they are copied. | Yes |
|
| `rotate_duplicates` | `bool` | Whether or not to rotate the duplicates as they are copied. | Yes |
|
||||||
| `useOriginal` | `bool` | If the target was sketched on an extrusion, setting this will use the original sketch as the target, not the entire joined solid. Defaults to false. | No |
|
| `use_original` | `bool` | If the target was sketched on an extrusion, setting this will use the original sketch as the target, not the entire joined solid. Defaults to false. | No |
|
||||||
|
|
||||||
### Returns
|
### Returns
|
||||||
|
|
||||||
[`[Solid]`](/docs/kcl/types/Solid)
|
[`[Solid]`](/docs/kcl/types/Solid)
|
||||||
|
|
||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
@ -9,7 +9,7 @@ Repeat a 2-dimensional sketch along some dimension, with a dynamic amount
|
|||||||
of distance between each repetition, some specified number of times.
|
of distance between each repetition, some specified number of times.
|
||||||
|
|
||||||
```js
|
```js
|
||||||
patternLinear2d(sketchSet: SketchSet, instances: integer, distance: number, axis: [number], useOriginal?: bool) -> [Sketch]
|
patternLinear2d(sketch_set: SketchSet, instances: integer, distance: number, axis: [number], use_original?: bool) -> [Sketch]
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -17,15 +17,15 @@ patternLinear2d(sketchSet: SketchSet, instances: integer, distance: number, axis
|
|||||||
|
|
||||||
| Name | Type | Description | Required |
|
| Name | Type | Description | Required |
|
||||||
|----------|------|-------------|----------|
|
|----------|------|-------------|----------|
|
||||||
| `sketchSet` | [`SketchSet`](/docs/kcl/types/SketchSet) | The sketch(es) to duplicate | Yes |
|
| `sketch_set` | [`SketchSet`](/docs/kcl/types/SketchSet) | The sketch(es) to duplicate | Yes |
|
||||||
| `instances` | `integer` | The number of total instances. Must be greater than or equal to 1. This includes the original entity. For example, if instances is 2, there will be two copies -- the original, and one new copy. If instances is 1, this has no effect. | Yes |
|
| `instances` | `integer` | The number of total instances. Must be greater than or equal to 1. This includes the original entity. For example, if instances is 2, there will be two copies -- the original, and one new copy. If instances is 1, this has no effect. | Yes |
|
||||||
| `distance` | `number` | Distance between each repetition. Also known as 'spacing'. | Yes |
|
| `distance` | `number` | Distance between each repetition. Also known as 'spacing'. | Yes |
|
||||||
| `axis` | `[number]` | The axis of the pattern. A 2D vector. | Yes |
|
| `axis` | `[number]` | The axis of the pattern. A 2D vector. | Yes |
|
||||||
| `useOriginal` | `bool` | If the target was sketched on an extrusion, setting this will use the original sketch as the target, not the entire joined solid. Defaults to false. | No |
|
| `use_original` | `bool` | If the target was sketched on an extrusion, setting this will use the original sketch as the target, not the entire joined solid. Defaults to false. | No |
|
||||||
|
|
||||||
### Returns
|
### Returns
|
||||||
|
|
||||||
[`[Sketch]`](/docs/kcl/types/Sketch)
|
[`[Sketch]`](/docs/kcl/types/Sketch)
|
||||||
|
|
||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
@ -9,7 +9,7 @@ Repeat a 3-dimensional solid along a linear path, with a dynamic amount
|
|||||||
of distance between each repetition, some specified number of times.
|
of distance between each repetition, some specified number of times.
|
||||||
|
|
||||||
```js
|
```js
|
||||||
patternLinear3d(solidSet: SolidSet, instances: integer, distance: number, axis: [number], useOriginal?: bool) -> [Solid]
|
patternLinear3d(solid_set: SolidSet, instances: integer, distance: number, axis: [number], use_original?: bool) -> [Solid]
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -17,15 +17,15 @@ patternLinear3d(solidSet: SolidSet, instances: integer, distance: number, axis:
|
|||||||
|
|
||||||
| Name | Type | Description | Required |
|
| Name | Type | Description | Required |
|
||||||
|----------|------|-------------|----------|
|
|----------|------|-------------|----------|
|
||||||
| `solidSet` | [`SolidSet`](/docs/kcl/types/SolidSet) | The solid(s) to duplicate | Yes |
|
| `solid_set` | [`SolidSet`](/docs/kcl/types/SolidSet) | The solid(s) to duplicate | Yes |
|
||||||
| `instances` | `integer` | The number of total instances. Must be greater than or equal to 1. This includes the original entity. For example, if instances is 2, there will be two copies -- the original, and one new copy. If instances is 1, this has no effect. | Yes |
|
| `instances` | `integer` | The number of total instances. Must be greater than or equal to 1. This includes the original entity. For example, if instances is 2, there will be two copies -- the original, and one new copy. If instances is 1, this has no effect. | Yes |
|
||||||
| `distance` | `number` | Distance between each repetition. Also known as 'spacing'. | Yes |
|
| `distance` | `number` | Distance between each repetition. Also known as 'spacing'. | Yes |
|
||||||
| `axis` | `[number]` | The axis of the pattern. A 2D vector. | Yes |
|
| `axis` | `[number]` | The axis of the pattern. A 2D vector. | Yes |
|
||||||
| `useOriginal` | `bool` | If the target was sketched on an extrusion, setting this will use the original sketch as the target, not the entire joined solid. Defaults to false. | No |
|
| `use_original` | `bool` | If the target was sketched on an extrusion, setting this will use the original sketch as the target, not the entire joined solid. Defaults to false. | No |
|
||||||
|
|
||||||
### Returns
|
### Returns
|
||||||
|
|
||||||
[`[Solid]`](/docs/kcl/types/Solid)
|
[`[Solid]`](/docs/kcl/types/Solid)
|
||||||
|
|
||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
@ -35,7 +35,7 @@ The transform function returns a transform object. All properties of the object
|
|||||||
- `rotation.origin` (either "local" i.e. rotate around its own center, "global" i.e. rotate around the scene's center, or a 3D point, defaults to "local")
|
- `rotation.origin` (either "local" i.e. rotate around its own center, "global" i.e. rotate around the scene's center, or a 3D point, defaults to "local")
|
||||||
|
|
||||||
```js
|
```js
|
||||||
patternTransform(solidSet: SolidSet, instances: integer, transform: FunctionSource, useOriginal?: bool) -> [Solid]
|
patternTransform(solid_set: SolidSet, instances: integer, transform: FunctionParam, use_original?: bool) -> [Solid]
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -43,14 +43,14 @@ patternTransform(solidSet: SolidSet, instances: integer, transform: FunctionSour
|
|||||||
|
|
||||||
| Name | Type | Description | Required |
|
| Name | Type | Description | Required |
|
||||||
|----------|------|-------------|----------|
|
|----------|------|-------------|----------|
|
||||||
| `solidSet` | [`SolidSet`](/docs/kcl/types/SolidSet) | The solid(s) to duplicate | Yes |
|
| `solid_set` | [`SolidSet`](/docs/kcl/types/SolidSet) | The solid(s) to duplicate | Yes |
|
||||||
| `instances` | `integer` | The number of total instances. Must be greater than or equal to 1. This includes the original entity. For example, if instances is 2, there will be two copies -- the original, and one new copy. If instances is 1, this has no effect. | Yes |
|
| `instances` | `integer` | The number of total instances. Must be greater than or equal to 1. This includes the original entity. For example, if instances is 2, there will be two copies -- the original, and one new copy. If instances is 1, this has no effect. | Yes |
|
||||||
| `transform` | `FunctionSource` | How each replica should be transformed. The transform function takes a single parameter: an integer representing which number replication the transform is for. E.g. the first replica to be transformed will be passed the argument `1`. This simplifies your math: the transform function can rely on id `0` being the original instance passed into the `patternTransform`. See the examples. | Yes |
|
| `transform` | `FunctionParam` | How each replica should be transformed. The transform function takes a single parameter: an integer representing which number replication the transform is for. E.g. the first replica to be transformed will be passed the argument `1`. This simplifies your math: the transform function can rely on id `0` being the original instance passed into the `patternTransform`. See the examples. | Yes |
|
||||||
| `useOriginal` | `bool` | If the target was sketched on an extrusion, setting this will use the original sketch as the target, not the entire joined solid. Defaults to false. | No |
|
| `use_original` | `bool` | If the target was sketched on an extrusion, setting this will use the original sketch as the target, not the entire joined solid. Defaults to false. | No |
|
||||||
|
|
||||||
### Returns
|
### Returns
|
||||||
|
|
||||||
[`[Solid]`](/docs/kcl/types/Solid)
|
[`[Solid]`](/docs/kcl/types/Solid)
|
||||||
|
|
||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
@ -9,7 +9,7 @@ Just like patternTransform, but works on 2D sketches not 3D solids.
|
|||||||
|
|
||||||
|
|
||||||
```js
|
```js
|
||||||
patternTransform2d(sketchSet: SketchSet, instances: integer, transform: FunctionSource, useOriginal?: bool) -> [Sketch]
|
patternTransform2d(sketch_set: SketchSet, instances: integer, transform: FunctionParam, use_original?: bool) -> [Sketch]
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -17,14 +17,14 @@ patternTransform2d(sketchSet: SketchSet, instances: integer, transform: Function
|
|||||||
|
|
||||||
| Name | Type | Description | Required |
|
| Name | Type | Description | Required |
|
||||||
|----------|------|-------------|----------|
|
|----------|------|-------------|----------|
|
||||||
| `sketchSet` | [`SketchSet`](/docs/kcl/types/SketchSet) | The sketch(es) to duplicate | Yes |
|
| `sketch_set` | [`SketchSet`](/docs/kcl/types/SketchSet) | The sketch(es) to duplicate | Yes |
|
||||||
| `instances` | `integer` | The number of total instances. Must be greater than or equal to 1. This includes the original entity. For example, if instances is 2, there will be two copies -- the original, and one new copy. If instances is 1, this has no effect. | Yes |
|
| `instances` | `integer` | The number of total instances. Must be greater than or equal to 1. This includes the original entity. For example, if instances is 2, there will be two copies -- the original, and one new copy. If instances is 1, this has no effect. | Yes |
|
||||||
| `transform` | `FunctionSource` | How each replica should be transformed. The transform function takes a single parameter: an integer representing which number replication the transform is for. E.g. the first replica to be transformed will be passed the argument `1`. This simplifies your math: the transform function can rely on id `0` being the original instance passed into the `patternTransform`. See the examples. | Yes |
|
| `transform` | `FunctionParam` | How each replica should be transformed. The transform function takes a single parameter: an integer representing which number replication the transform is for. E.g. the first replica to be transformed will be passed the argument `1`. This simplifies your math: the transform function can rely on id `0` being the original instance passed into the `patternTransform`. See the examples. | Yes |
|
||||||
| `useOriginal` | `bool` | If the target was sketched on an extrusion, setting this will use the original sketch as the target, not the entire joined solid. Defaults to false. | No |
|
| `use_original` | `bool` | If the target was sketched on an extrusion, setting this will use the original sketch as the target, not the entire joined solid. Defaults to false. | No |
|
||||||
|
|
||||||
### Returns
|
### Returns
|
||||||
|
|
||||||
[`[Sketch]`](/docs/kcl/types/Sketch)
|
[`[Sketch]`](/docs/kcl/types/Sketch)
|
||||||
|
|
||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
@ -4,11 +4,9 @@ excerpt: "Return the value of `pi`. Archimedes’ constant (π)."
|
|||||||
layout: manual
|
layout: manual
|
||||||
---
|
---
|
||||||
|
|
||||||
**WARNING:** This function is deprecated.
|
|
||||||
|
|
||||||
Return the value of `pi`. Archimedes’ constant (π).
|
Return the value of `pi`. Archimedes’ constant (π).
|
||||||
|
|
||||||
**DEPRECATED** use the constant PI
|
|
||||||
|
|
||||||
```js
|
```js
|
||||||
pi() -> number
|
pi() -> number
|
||||||
@ -22,7 +20,7 @@ pi() -> number
|
|||||||
|
|
||||||
### Returns
|
### Returns
|
||||||
|
|
||||||
`number`
|
`number`
|
||||||
|
|
||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
@ -21,7 +21,7 @@ polar(data: PolarCoordsData) -> [number]
|
|||||||
|
|
||||||
### Returns
|
### Returns
|
||||||
|
|
||||||
`[number]`
|
`[number]`
|
||||||
|
|
||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
@ -9,7 +9,7 @@ Create a regular polygon with the specified number of sides that is either inscr
|
|||||||
|
|
||||||
|
|
||||||
```js
|
```js
|
||||||
polygon(data: PolygonData, sketchSurfaceOrGroup: SketchOrSurface, tag?: TagDeclarator) -> Sketch
|
polygon(data: PolygonData, sketch_surface_or_group: SketchOrSurface, tag?: TagDeclarator) -> Sketch
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -18,7 +18,7 @@ polygon(data: PolygonData, sketchSurfaceOrGroup: SketchOrSurface, tag?: TagDecla
|
|||||||
| Name | Type | Description | Required |
|
| Name | Type | Description | Required |
|
||||||
|----------|------|-------------|----------|
|
|----------|------|-------------|----------|
|
||||||
| `data` | [`PolygonData`](/docs/kcl/types/PolygonData) | Data for drawing a polygon | Yes |
|
| `data` | [`PolygonData`](/docs/kcl/types/PolygonData) | Data for drawing a polygon | Yes |
|
||||||
| `sketchSurfaceOrGroup` | [`SketchOrSurface`](/docs/kcl/types/SketchOrSurface) | A sketch surface or a sketch. | Yes |
|
| `sketch_surface_or_group` | [`SketchOrSurface`](/docs/kcl/types/SketchOrSurface) | A sketch surface or a sketch. | Yes |
|
||||||
| `tag` | [`TagDeclarator`](/docs/kcl/types#tag-declaration) | | No |
|
| `tag` | [`TagDeclarator`](/docs/kcl/types#tag-declaration) | | No |
|
||||||
|
|
||||||
### Returns
|
### Returns
|
||||||
|
@ -26,7 +26,7 @@ pow(num: number, pow: number) -> number
|
|||||||
|
|
||||||
### Returns
|
### Returns
|
||||||
|
|
||||||
`number`
|
`number`
|
||||||
|
|
||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
@ -21,7 +21,7 @@ profileStart(sketch: Sketch) -> [number]
|
|||||||
|
|
||||||
### Returns
|
### Returns
|
||||||
|
|
||||||
`[number]`
|
`[number]`
|
||||||
|
|
||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
@ -21,7 +21,7 @@ profileStartX(sketch: Sketch) -> number
|
|||||||
|
|
||||||
### Returns
|
### Returns
|
||||||
|
|
||||||
`number`
|
`number`
|
||||||
|
|
||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
@ -21,7 +21,7 @@ profileStartY(sketch: Sketch) -> number
|
|||||||
|
|
||||||
### Returns
|
### Returns
|
||||||
|
|
||||||
`number`
|
`number`
|
||||||
|
|
||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
@ -9,7 +9,7 @@ Take a starting value. Then, for each element of an array, calculate the next va
|
|||||||
using the previous value and the element.
|
using the previous value and the element.
|
||||||
|
|
||||||
```js
|
```js
|
||||||
reduce(array: [KclValue], start: KclValue, reduceFn: FunctionSource) -> KclValue
|
reduce(array: [KclValue], start: KclValue, reduce_fn: FunctionParam) -> KclValue
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -19,7 +19,7 @@ reduce(array: [KclValue], start: KclValue, reduceFn: FunctionSource) -> KclValue
|
|||||||
|----------|------|-------------|----------|
|
|----------|------|-------------|----------|
|
||||||
| `array` | [`[KclValue]`](/docs/kcl/types/KclValue) | | Yes |
|
| `array` | [`[KclValue]`](/docs/kcl/types/KclValue) | | Yes |
|
||||||
| `start` | [`KclValue`](/docs/kcl/types/KclValue) | Any KCL value. | Yes |
|
| `start` | [`KclValue`](/docs/kcl/types/KclValue) | Any KCL value. | Yes |
|
||||||
| `reduceFn` | `FunctionSource` | | Yes |
|
| `reduce_fn` | `FunctionParam` | | Yes |
|
||||||
|
|
||||||
### Returns
|
### Returns
|
||||||
|
|
||||||
@ -76,7 +76,7 @@ assertEqual(sum, 6, 0.00001, "1 + 2 + 3 summed is 6")
|
|||||||
// Declare a function that sketches a decagon.
|
// Declare a function that sketches a decagon.
|
||||||
fn decagon(radius) {
|
fn decagon(radius) {
|
||||||
// Each side of the decagon is turned this many degrees from the previous angle.
|
// Each side of the decagon is turned this many degrees from the previous angle.
|
||||||
stepAngle = 1 / 10 * TAU
|
stepAngle = 1 / 10 * tau()
|
||||||
|
|
||||||
// Start the decagon sketch at this point.
|
// Start the decagon sketch at this point.
|
||||||
startOfDecagonSketch = startSketchOn('XY')
|
startOfDecagonSketch = startSketchOn('XY')
|
||||||
@ -97,7 +97,7 @@ fn decagon(radius) {
|
|||||||
|
|
||||||
/* The `decagon` above is basically like this pseudo-code:
|
/* The `decagon` above is basically like this pseudo-code:
|
||||||
fn decagon(radius):
|
fn decagon(radius):
|
||||||
stepAngle = (1/10) * TAU
|
stepAngle = (1/10) * tau()
|
||||||
plane = startSketchOn('XY')
|
plane = startSketchOn('XY')
|
||||||
startOfDecagonSketch = startProfileAt([(cos(0)*radius), (sin(0) * radius)], plane)
|
startOfDecagonSketch = startProfileAt([(cos(0)*radius), (sin(0) * radius)], plane)
|
||||||
|
|
||||||
|
@ -26,7 +26,7 @@ rem(num: number, divisor: number) -> number
|
|||||||
|
|
||||||
### Returns
|
### Returns
|
||||||
|
|
||||||
`number`
|
`number`
|
||||||
|
|
||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
@ -24,7 +24,7 @@ revolve(data: RevolveData, sketch: Sketch) -> Solid
|
|||||||
|
|
||||||
### Returns
|
### Returns
|
||||||
|
|
||||||
[`Solid`](/docs/kcl/types/Solid) - A solid is a collection of extrude surfaces.
|
[`Solid`](/docs/kcl/types/Solid) - An solid is a collection of extrude surfaces.
|
||||||
|
|
||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
@ -25,7 +25,7 @@ round(num: number) -> number
|
|||||||
|
|
||||||
### Returns
|
### Returns
|
||||||
|
|
||||||
`number`
|
`number`
|
||||||
|
|
||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user