Compare commits
44 Commits
test-windo
...
franknoiro
Author | SHA1 | Date | |
---|---|---|---|
7d6427ab64 | |||
4abbe0d57a | |||
a631ff689f | |||
e1d401adfe | |||
6f49c88382 | |||
374d07b995 | |||
3481252082 | |||
035f3b6aed | |||
923feadfa5 | |||
1ea66d6f23 | |||
3b7b4f85a1 | |||
9853353512 | |||
7b8585f3c3 | |||
fc3ce4cda8 | |||
a7f5c56ba1 | |||
c8747bd55a | |||
e2fd3948f5 | |||
e960d4d8a4 | |||
1ccf8d4dd4 | |||
b65ea8e0a9 | |||
90cb26c6d9 | |||
3562076b83 | |||
6230747b51 | |||
479179dd9b | |||
67f9dba77b | |||
89c345649d | |||
0550eef701 | |||
1c21198499 | |||
8ac232414d | |||
91e306f447 | |||
f01957edc7 | |||
e9f6ebb6d1 | |||
2fee3a424c | |||
43d5a72514 | |||
f938364d54 | |||
998dbdc6ff | |||
2b3dfaf023 | |||
f8a33a63ac | |||
af50422544 | |||
6e21c486e8 | |||
c6ee10cd50 | |||
6170319428 | |||
e373d285fe | |||
17c326e654 |
@ -1,3 +1,5 @@
|
||||
# DO NOT commit secrets, overrides go in the ignored `.env.development.local`
|
||||
|
||||
NODE_ENV=development
|
||||
DEV=true
|
||||
|
||||
@ -7,7 +9,11 @@ VITE_KC_SITE_BASE_URL=https://dev.zoo.dev
|
||||
VITE_KC_SITE_APP_URL=https://app.dev.zoo.dev
|
||||
VITE_KC_SKIP_AUTH=false
|
||||
VITE_KC_CONNECTION_TIMEOUT_MS=5000
|
||||
# ONLY add your token in .env.development.local if you want to skip auth, otherwise this token takes precedence!
|
||||
#VITE_KC_DEV_TOKEN="your token from dev.zoo.dev should go in .env.development.local"
|
||||
#VITE_KC_DEV_TOKEN="optional token to skip auth in the app"
|
||||
#token="required token for playwright. TODO: clean up env vars in #3973"
|
||||
|
||||
RUST_BACKTRACE=1
|
||||
PYO3_PYTHON=/usr/local/bin/python3
|
||||
#KITTYCAD_API_TOKEN="required token for engine testing"
|
||||
|
||||
FAIL_ON_CONSOLE_ERRORS=true
|
||||
|
40
.github/workflows/cargo-test.yml
vendored
40
.github/workflows/cargo-test.yml
vendored
@ -2,7 +2,6 @@ on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
|
||||
pull_request:
|
||||
workflow_dispatch:
|
||||
permissions:
|
||||
@ -131,7 +130,6 @@ jobs:
|
||||
with:
|
||||
name: nextest-archive
|
||||
path: rust/nextest-archive.tar.zst
|
||||
|
||||
run-test-artifacts:
|
||||
name: cargo test (shard ${{ matrix.partitionIndex}})
|
||||
runs-on:
|
||||
@ -186,4 +184,40 @@ jobs:
|
||||
env:
|
||||
KITTYCAD_API_TOKEN: ${{secrets.KITTYCAD_API_TOKEN_DEV}}
|
||||
ZOO_HOST: https://api.dev.zoo.dev
|
||||
|
||||
run-wasm-tests:
|
||||
name: Run wasm tests
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ubuntu-latest, macos-latest]
|
||||
fail-fast: false
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Use correct Rust toolchain
|
||||
shell: bash
|
||||
run: |
|
||||
[ -e rust-toolchain.toml ] || cp rust/rust-toolchain.toml ./
|
||||
- name: Install rust
|
||||
uses: actions-rust-lang/setup-rust-toolchain@v1
|
||||
with:
|
||||
cache: false # Configured below.
|
||||
- uses: taiki-e/install-action@d4635f2de61c8b8104d59cd4aede2060638378cc
|
||||
with:
|
||||
tool: wasm-pack
|
||||
- name: Rust Cache
|
||||
uses: Swatinem/rust-cache@v2
|
||||
with:
|
||||
workspaces: './rust'
|
||||
- name: Build Wasm
|
||||
shell: bash
|
||||
run: |
|
||||
npm install
|
||||
npm run build:wasm
|
||||
- name: Run wasm tests
|
||||
run: |
|
||||
cd rust
|
||||
cd kcl-wasm-lib
|
||||
#wasm-pack test --headless --chrome
|
||||
env:
|
||||
KITTYCAD_API_TOKEN: ${{ secrets.KITTYCAD_API_TOKEN_DEV }}
|
||||
NODE_ENV: development
|
||||
|
1
.github/workflows/e2e-tests.yml
vendored
1
.github/workflows/e2e-tests.yml
vendored
@ -229,7 +229,6 @@ jobs:
|
||||
max_attempts: 5
|
||||
env:
|
||||
token: ${{ secrets.KITTYCAD_API_TOKEN_DEV }}
|
||||
snapshottoken: ${{ secrets.KITTYCAD_API_TOKEN }}
|
||||
TAB_API_URL: ${{ secrets.TAB_API_URL }}
|
||||
TAB_API_KEY: ${{ secrets.TAB_API_KEY }}
|
||||
CI_COMMIT_SHA: ${{ github.event.pull_request.head.sha }}
|
||||
|
7
.github/workflows/static-analysis.yml
vendored
7
.github/workflows/static-analysis.yml
vendored
@ -171,13 +171,8 @@ jobs:
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v5
|
||||
- name: Install codespell
|
||||
run: |
|
||||
python -m pip install codespell
|
||||
- name: Run codespell
|
||||
run: codespell --config .codespellrc # Edit this file to tweak the typo list and other configuration.
|
||||
uses: crate-ci/typos@v1.32.0
|
||||
|
||||
npm-unit-test-kcl-samples:
|
||||
runs-on: ubuntu-latest
|
||||
|
136
CONTRIBUTING.md
136
CONTRIBUTING.md
@ -63,7 +63,7 @@ If you're not a Zoo employee you won't be able to access the dev environment, yo
|
||||
|
||||
### Development environment variables
|
||||
|
||||
The Copilot LSP plugin in the editor requires a Zoo API token to run. In production, we authenticate this with a token via cookie in the browser and device auth token in the desktop environment, but this token is inaccessible in the dev browser version because the cookie is considered "cross-site" (from `localhost` to `dev.zoo.dev`). There is an optional environment variable called `VITE_KC_DEV_TOKEN` that you can populate with a dev token in a `.env.development.local` file to not check it into Git, which will use that token instead of other methods for the LSP service.
|
||||
The Copilot LSP plugin in the editor requires a Zoo API token to run. In production, we authenticate this with a token via cookie in the browser and device auth token in the desktop environment, but this token is inaccessible in the dev browser version because the cookie is considered "cross-site" (from `localhost` to `zoo.dev`). There is an optional environment variable called `VITE_KC_DEV_TOKEN` that you can populate with a dev token in a `.env.development.local` file to not check it into Git, which will use that token instead of other methods for the LSP service.
|
||||
|
||||
### Developing in Chrome
|
||||
|
||||
@ -198,15 +198,9 @@ For more information on fuzzing you can check out
|
||||
|
||||
### Playwright tests
|
||||
|
||||
You will need a `./e2e/playwright/playwright-secrets.env` file:
|
||||
Prepare these system dependencies:
|
||||
|
||||
```bash
|
||||
$ touch ./e2e/playwright/playwright-secrets.env
|
||||
$ cat ./e2e/playwright/playwright-secrets.env
|
||||
token=<dev.zoo.dev/account/api-tokens>
|
||||
snapshottoken=<zoo.dev/account/api-tokens>
|
||||
```
|
||||
or use `export` to set the environment variables `token` and `snapshottoken`.
|
||||
- Set $token from https://zoo.dev/account/api-tokens
|
||||
|
||||
#### Snapshot tests (Google Chrome on Ubuntu only)
|
||||
|
||||
@ -300,131 +294,17 @@ Which will run our suite of [Vitest unit](https://vitest.dev/) and [React Testin
|
||||
|
||||
### Rust tests
|
||||
|
||||
**Dependencies**
|
||||
Prepare these system dependencies:
|
||||
|
||||
- `KITTYCAD_API_TOKEN`
|
||||
- `cargo-nextest`
|
||||
- `just`
|
||||
- Set `$KITTYCAD_API_TOKEN` from https://zoo.dev/account/api-tokens
|
||||
- Install `just` following [these instructions](https://just.systems/man/en/packages.html)
|
||||
|
||||
#### Setting KITTYCAD_API_TOKEN
|
||||
|
||||
Use the production zoo.dev token, set this environment variable before running the tests
|
||||
|
||||
#### Installing cargonextest
|
||||
then run tests that target the KCL language:
|
||||
|
||||
```
|
||||
cd rust
|
||||
cargo search cargo-nextest
|
||||
cargo install cargo-nextest
|
||||
npm run test:rust
|
||||
```
|
||||
|
||||
#### just
|
||||
|
||||
install [`just`](https://github.com/casey/just?tab=readme-ov-file#pre-built-binaries)
|
||||
|
||||
#### Running the tests
|
||||
|
||||
```bash
|
||||
# With just
|
||||
# Make sure KITTYCAD_API_TOKEN=<prod zoo.dev token> is set
|
||||
# Make sure you installed cargo-nextest
|
||||
# Make sure you installed just
|
||||
cd rust
|
||||
just test
|
||||
```
|
||||
|
||||
```bash
|
||||
# Without just
|
||||
# Make sure KITTYCAD_API_TOKEN=<prod zoo.dev token> is set
|
||||
# Make sure you installed cargo-nextest
|
||||
cd rust
|
||||
export RUST_BRACKTRACE="full" && cargo nextest run --workspace --test-threads=1
|
||||
```
|
||||
|
||||
Where `XXX` is an API token from the production engine (NOT the dev environment).
|
||||
|
||||
We recommend using [nextest](https://nexte.st/) to run the Rust tests (its faster and is used in CI). Once installed, run the tests using
|
||||
|
||||
```
|
||||
cd rust
|
||||
KITTYCAD_API_TOKEN=XXX cargo run nextest
|
||||
```
|
||||
|
||||
### Mapping CI CD jobs to local commands
|
||||
|
||||
When you see the CI CD fail on jobs you may wonder three things
|
||||
|
||||
- Do I have a bug in my code?
|
||||
- Is the test flaky?
|
||||
- Is there a bug in `main`?
|
||||
|
||||
To answer these questions the following commands will give you confidence to locate the issue.
|
||||
|
||||
#### Static Analysis
|
||||
|
||||
Part of the CI CD pipeline performs static analysis on the code. Use the following commands to mimic the CI CD jobs.
|
||||
|
||||
The following set of commands should get us closer to one and done commands to instantly retest issues.
|
||||
|
||||
```
|
||||
npm run test-setup
|
||||
```
|
||||
|
||||
> Gotcha, are packages up to date and is the wasm built?
|
||||
|
||||
```
|
||||
npm run tsc
|
||||
npm run fmt:check
|
||||
npm run lint
|
||||
npm run test:unit:local
|
||||
```
|
||||
|
||||
> Gotcha: Our unit tests have integration tests in them. You need to run a localhost server to run the unit tests.
|
||||
|
||||
#### E2E Tests
|
||||
|
||||
**Playwright Electron**
|
||||
|
||||
These E2E tests run in electron. There are tests that are skipped if they are ran in a windows, linux, or macos environment. We can use playwright tags to implement test skipping.
|
||||
|
||||
```
|
||||
npm run test:playwright:electron:local
|
||||
npm run test:playwright:electron:windows:local
|
||||
npm run test:playwright:electron:macos:local
|
||||
npm run test:playwright:electron:ubuntu:local
|
||||
```
|
||||
|
||||
> Why does it say local? The CI CD commands that run in the pipeline cannot be ran locally. A single command will not properly setup the testing environment locally.
|
||||
|
||||
#### Some notes on CI
|
||||
|
||||
The tests are broken into snapshot tests and non-snapshot tests, and they run in that order, they automatically commit new snap shots, so if you see an image commit check it was an intended change. If we have non-determinism in the snapshots such that they are always committing new images, hopefully this annoyance makes us fix them asap, if you notice this happening let Kurt know. But for the odd occasion `git reset --hard HEAD~ && git push -f` is your friend.
|
||||
|
||||
How to interpret failing playwright tests?
|
||||
If your tests fail, click through to the action and see that the tests failed on a line that includes `await page.getByTestId('loading').waitFor({ state: 'detached' })`, this means the test fail because the stream never started. It's you choice if you want to re-run the test, or ignore the failure.
|
||||
|
||||
We run on ubuntu and macos, because safari doesn't work on linux because of the dreaded "no RTCPeerConnection variable" error. But linux runs first and then macos for the same reason that we limit the number of parallel tests to 1 because we limit stream connections per user, so tests would start failing we if let them run together.
|
||||
|
||||
If something fails on CI you can download the artifact, unzip it and then open `playwright-report/data/<UUID>.zip` with https://trace.playwright.dev/ to see what happened.
|
||||
|
||||
#### Getting started writing a playwright test in our app
|
||||
|
||||
Besides following the instructions above and using the playwright docs, our app is weird because of the whole stream thing, which means our testing is weird. Because we've just figured out this stuff and therefore docs might go stale quick here's a 15min vid/tutorial
|
||||
|
||||
https://github.com/KittyCAD/modeling-app/assets/29681384/6f5e8e85-1003-4fd9-be7f-f36ce833942d
|
||||
|
||||
<details>
|
||||
|
||||
<summary>
|
||||
PS: for the debug panel, the following JSON is useful for snapping the camera
|
||||
</summary>
|
||||
|
||||
```JSON
|
||||
{"type":"modeling_cmd_req","cmd_id":"054e5472-e5e9-4071-92d7-1ce3bac61956","cmd":{"type":"default_camera_look_at","center":{"x":15,"y":0,"z":0},"up":{"x":0,"y":0,"z":1},"vantage":{"x":30,"y":30,"z":30}}}
|
||||
```
|
||||
|
||||
</details>
|
||||
|
||||
### Logging
|
||||
|
||||
To display logging (to the terminal or console) set `ZOO_LOG=1`. This will log some warnings and simple performance metrics. To view these in test runs, use `-- --nocapture`.
|
||||
|
3
Makefile
3
Makefile
@ -1,5 +1,5 @@
|
||||
.PHONY: all
|
||||
all: install build check
|
||||
all: install check build
|
||||
|
||||
###############################################################################
|
||||
# INSTALL
|
||||
@ -106,6 +106,7 @@ test: test-unit test-e2e
|
||||
|
||||
.PHONY: test-unit
|
||||
test-unit: install ## Run the unit tests
|
||||
npm run test:rust
|
||||
@ curl -fs localhost:3000 >/dev/null || ( echo "Error: localhost:3000 not available, 'make run-web' first" && exit 1 )
|
||||
npm run test:unit
|
||||
|
||||
|
39
_typos.toml
Normal file
39
_typos.toml
Normal file
@ -0,0 +1,39 @@
|
||||
[files]
|
||||
extend-exclude = [
|
||||
"**/target",
|
||||
"node_modules",
|
||||
"build",
|
||||
"dist",
|
||||
"out",
|
||||
"**/Cargo.lock",
|
||||
"docs/**/*.md",
|
||||
"docs/**/*.json",
|
||||
"e2e/playwright/lib/console-error-whitelist.ts",
|
||||
".package-lock.json",
|
||||
"**/package-lock.json",
|
||||
"openapi/*.json",
|
||||
"packages/codemirror-lang-kcl/test/all.test.ts",
|
||||
"public/kcl-samples",
|
||||
"rust/kcl-lib/tests/kcl_samples",
|
||||
"tsconfig.tsbuildinfo",
|
||||
"src/lib/machine-api.d.ts",
|
||||
"kcl-book/book",
|
||||
]
|
||||
|
||||
[default.extend-words]
|
||||
metalness = "metalness" # appearance API
|
||||
Hom = "Hom" # short for homogenous
|
||||
typ = "typ" # used to declare a variable named 'type' which is a reserved keyword in Rust
|
||||
ue = "ue" # short for UnaryExpression
|
||||
THRE = "THRE" # Weird bug that wrongly detects THREEjs as a typo
|
||||
nwo = "nwo" # don't know what this is about tbh
|
||||
"ot" = "ot" # some abbreviation, idk what
|
||||
"oe" = "oe" # some abbreviation, idk what
|
||||
|
||||
[default]
|
||||
extend-ignore-identifiers-re = [
|
||||
"\\dnd", # e.g. 2nd
|
||||
]
|
||||
extend-ignore-re = [
|
||||
"@xstate-layout .*",
|
||||
]
|
@ -1,5 +1,5 @@
|
||||
---
|
||||
title: "KCL Known Issues"
|
||||
title: "Known Issues"
|
||||
excerpt: "Known issues with the KCL standard library for the Zoo Design Studio."
|
||||
layout: manual
|
||||
---
|
||||
@ -15,12 +15,6 @@ once fixed in engine will just start working here with no language changes.
|
||||
- **Import**: Right now you can import a file, even if that file has brep data
|
||||
you cannot edit it, after v1, the engine will account for this.
|
||||
|
||||
- **Fillets**: Fillets cannot intersect, you will get an error. Only simple fillet
|
||||
cases work currently.
|
||||
|
||||
- **Chamfers**: Chamfers cannot intersect, you will get an error. Only simple
|
||||
chamfer cases work currently.
|
||||
|
||||
- **Appearance**: Changing the appearance on a loft does not work.
|
||||
|
||||
- **CSG Booleans**: Coplanar (bodies that share a plane) unions, subtractions, and intersections are not currently supported.
|
||||
|
@ -1,5 +1,5 @@
|
||||
---
|
||||
title: "KCL Modules"
|
||||
title: "Modules"
|
||||
excerpt: "Documentation of modules for the KCL language for the Zoo Design Studio."
|
||||
layout: manual
|
||||
---
|
||||
|
@ -1,5 +1,5 @@
|
||||
---
|
||||
title: "KCL Settings"
|
||||
title: "Settings"
|
||||
excerpt: "Documentation of settings for the KCL language and Zoo Design Studio."
|
||||
layout: manual
|
||||
---
|
||||
@ -8,16 +8,16 @@ layout: manual
|
||||
|
||||
There are three levels of settings available in Zoo Design Studio:
|
||||
|
||||
1. [User Settings](/docs/kcl/settings-user): Global settings that apply to all projects, stored in `user.toml`
|
||||
2. [Project Settings](/docs/kcl/settings-project): Settings specific to a project, stored in `project.toml`
|
||||
1. [User Settings](/docs/kcl-lang/settings/user): Global settings that apply to all projects, stored in `user.toml`
|
||||
2. [Project Settings](/docs/kcl-lang/settings/project): Settings specific to a project, stored in `project.toml`
|
||||
3. Per-file Settings: Settings that apply to a single KCL file, specified using the `@settings` attribute
|
||||
|
||||
## Configuration Files
|
||||
|
||||
Zoo Design Studio uses TOML files for configuration:
|
||||
|
||||
* **User Settings**: `user.toml` - See [complete documentation](/docs/kcl/settings-user)
|
||||
* **Project Settings**: `project.toml` - See [complete documentation](/docs/kcl/settings-project)
|
||||
* **User Settings**: `user.toml` - See [complete documentation](/docs/kcl-lang/settings/user)
|
||||
* **Project Settings**: `project.toml` - See [complete documentation](/docs/kcl-lang/settings/project)
|
||||
|
||||
## Per-file settings
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
---
|
||||
title: "KCL Types"
|
||||
title: "Types"
|
||||
excerpt: "Documentation of types for the KCL standard library for the Zoo Design Studio."
|
||||
layout: manual
|
||||
---
|
||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -1,6 +1,6 @@
|
||||
---
|
||||
title: "END"
|
||||
subtitle: "Constant in prelude"
|
||||
subtitle: "Constant in std"
|
||||
excerpt: "Identifies the ending face of an extrusion. I.e., the new face created by an extrusion."
|
||||
layout: manual
|
||||
---
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
title: "START"
|
||||
subtitle: "Constant in prelude"
|
||||
subtitle: "Constant in std"
|
||||
excerpt: "Identifies the starting face of an extrusion. I.e., the face which is extruded."
|
||||
layout: manual
|
||||
---
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
title: "X"
|
||||
subtitle: "Constant in prelude"
|
||||
subtitle: "Constant in std"
|
||||
excerpt: ""
|
||||
layout: manual
|
||||
---
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
title: "XY"
|
||||
subtitle: "Constant in prelude"
|
||||
subtitle: "Constant in std"
|
||||
excerpt: ""
|
||||
layout: manual
|
||||
---
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
title: "XZ"
|
||||
subtitle: "Constant in prelude"
|
||||
subtitle: "Constant in std"
|
||||
excerpt: ""
|
||||
layout: manual
|
||||
---
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
title: "Y"
|
||||
subtitle: "Constant in prelude"
|
||||
subtitle: "Constant in std"
|
||||
excerpt: ""
|
||||
layout: manual
|
||||
---
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
title: "YZ"
|
||||
subtitle: "Constant in prelude"
|
||||
subtitle: "Constant in std"
|
||||
excerpt: ""
|
||||
layout: manual
|
||||
---
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
title: "Z"
|
||||
subtitle: "Constant in prelude"
|
||||
subtitle: "Constant in std"
|
||||
excerpt: ""
|
||||
layout: manual
|
||||
---
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
title: "E"
|
||||
subtitle: "Constant in math"
|
||||
subtitle: "Constant in std::math"
|
||||
excerpt: "The value of Euler’s number `e`."
|
||||
layout: manual
|
||||
---
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
title: "PI"
|
||||
subtitle: "Constant in math"
|
||||
subtitle: "Constant in std::math"
|
||||
excerpt: "The value of `pi`, Archimedes’ constant (π)."
|
||||
layout: manual
|
||||
---
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
title: "TAU"
|
||||
subtitle: "Constant in math"
|
||||
subtitle: "Constant in std::math"
|
||||
excerpt: "The value of `tau`, the full circle constant (τ). Equal to 2π."
|
||||
layout: manual
|
||||
---
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
title: "turns::HALF_TURN"
|
||||
subtitle: "Constant in turns"
|
||||
subtitle: "Constant in std::turns"
|
||||
excerpt: ""
|
||||
layout: manual
|
||||
---
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
title: "turns::QUARTER_TURN"
|
||||
subtitle: "Constant in turns"
|
||||
subtitle: "Constant in std::turns"
|
||||
excerpt: ""
|
||||
layout: manual
|
||||
---
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
title: "turns::THREE_QUARTER_TURN"
|
||||
subtitle: "Constant in turns"
|
||||
subtitle: "Constant in std::turns"
|
||||
excerpt: ""
|
||||
layout: manual
|
||||
---
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
title: "turns::ZERO"
|
||||
subtitle: "Constant in turns"
|
||||
subtitle: "Constant in std::turns"
|
||||
excerpt: ""
|
||||
layout: manual
|
||||
---
|
||||
|
File diff suppressed because one or more lines are too long
@ -1,6 +1,6 @@
|
||||
---
|
||||
title: "abs"
|
||||
subtitle: "Function in math"
|
||||
subtitle: "Function in std::math"
|
||||
excerpt: "Compute the absolute value of a number."
|
||||
layout: manual
|
||||
---
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
title: "acos"
|
||||
subtitle: "Function in math"
|
||||
subtitle: "Function in std::math"
|
||||
excerpt: "Compute the arccosine of a number."
|
||||
layout: manual
|
||||
---
|
||||
@ -17,11 +17,11 @@ acos(@num: number(_)): number(rad)
|
||||
|
||||
| Name | Type | Description | Required |
|
||||
|----------|------|-------------|----------|
|
||||
| `num` | `number(_)` | | Yes |
|
||||
| `num` | [`number(_)`](/docs/kcl-std/types/std-types-number) | A number | Yes |
|
||||
|
||||
### Returns
|
||||
|
||||
`number(rad)`
|
||||
[`number(rad)`](/docs/kcl-std/types/std-types-number) - A number
|
||||
|
||||
|
||||
### Examples
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
title: "asin"
|
||||
subtitle: "Function in math"
|
||||
subtitle: "Function in std::math"
|
||||
excerpt: "Compute the arcsine of a number."
|
||||
layout: manual
|
||||
---
|
||||
@ -17,11 +17,11 @@ asin(@num: number(_)): number(rad)
|
||||
|
||||
| Name | Type | Description | Required |
|
||||
|----------|------|-------------|----------|
|
||||
| `num` | `number(_)` | | Yes |
|
||||
| `num` | [`number(_)`](/docs/kcl-std/types/std-types-number) | A number | Yes |
|
||||
|
||||
### Returns
|
||||
|
||||
`number(rad)`
|
||||
[`number(rad)`](/docs/kcl-std/types/std-types-number) - A number
|
||||
|
||||
|
||||
### Examples
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
title: "atan"
|
||||
subtitle: "Function in math"
|
||||
subtitle: "Function in std::math"
|
||||
excerpt: "Compute the arctangent of a number."
|
||||
layout: manual
|
||||
---
|
||||
@ -17,11 +17,11 @@ Consider using `atan2()` instead for the true inverse of tangent.
|
||||
|
||||
| Name | Type | Description | Required |
|
||||
|----------|------|-------------|----------|
|
||||
| `num` | `number(_)` | | Yes |
|
||||
| `num` | [`number(_)`](/docs/kcl-std/types/std-types-number) | A number | Yes |
|
||||
|
||||
### Returns
|
||||
|
||||
`number(rad)`
|
||||
[`number(rad)`](/docs/kcl-std/types/std-types-number) - A number
|
||||
|
||||
|
||||
### Examples
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
title: "atan2"
|
||||
subtitle: "Function in math"
|
||||
subtitle: "Function in std::math"
|
||||
excerpt: "Compute the four quadrant arctangent of Y and X."
|
||||
layout: manual
|
||||
---
|
||||
@ -20,12 +20,12 @@ atan2(
|
||||
|
||||
| Name | Type | Description | Required |
|
||||
|----------|------|-------------|----------|
|
||||
| `y` | `number(Length)` | | Yes |
|
||||
| `x` | `number(Length)` | | Yes |
|
||||
| `y` | [`number(Length)`](/docs/kcl-std/types/std-types-number) | A number | Yes |
|
||||
| `x` | [`number(Length)`](/docs/kcl-std/types/std-types-number) | A number | Yes |
|
||||
|
||||
### Returns
|
||||
|
||||
`number(rad)`
|
||||
[`number(rad)`](/docs/kcl-std/types/std-types-number) - A number
|
||||
|
||||
|
||||
### Examples
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
title: "ceil"
|
||||
subtitle: "Function in math"
|
||||
subtitle: "Function in std::math"
|
||||
excerpt: "Compute the smallest integer greater than or equal to a number."
|
||||
layout: manual
|
||||
---
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
title: "cos"
|
||||
subtitle: "Function in math"
|
||||
subtitle: "Function in std::math"
|
||||
excerpt: "Compute the cosine of a number."
|
||||
layout: manual
|
||||
---
|
||||
@ -17,11 +17,11 @@ cos(@num: number(Angle)): number(_)
|
||||
|
||||
| Name | Type | Description | Required |
|
||||
|----------|------|-------------|----------|
|
||||
| `num` | `number(Angle)` | | Yes |
|
||||
| `num` | [`number(Angle)`](/docs/kcl-std/types/std-types-number) | A number | Yes |
|
||||
|
||||
### Returns
|
||||
|
||||
`number(_)`
|
||||
[`number(_)`](/docs/kcl-std/types/std-types-number) - A number
|
||||
|
||||
|
||||
### Examples
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
title: "floor"
|
||||
subtitle: "Function in math"
|
||||
subtitle: "Function in std::math"
|
||||
excerpt: "Compute the largest integer less than or equal to a number."
|
||||
layout: manual
|
||||
---
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
title: "ln"
|
||||
subtitle: "Function in math"
|
||||
subtitle: "Function in std::math"
|
||||
excerpt: "Compute the natural logarithm of the number."
|
||||
layout: manual
|
||||
---
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
title: "log"
|
||||
subtitle: "Function in math"
|
||||
subtitle: "Function in std::math"
|
||||
excerpt: "Compute the logarithm of the number with respect to an arbitrary base."
|
||||
layout: manual
|
||||
---
|
||||
@ -23,7 +23,7 @@ and `log10` can produce more accurate results for base 10.
|
||||
| Name | Type | Description | Required |
|
||||
|----------|------|-------------|----------|
|
||||
| `input` | [`number`](/docs/kcl-std/types/std-types-number) | The number to compute the logarithm of. | Yes |
|
||||
| `base` | `number(_)` | The base of the logarithm. | Yes |
|
||||
| `base` | [`number(_)`](/docs/kcl-std/types/std-types-number) | The base of the logarithm. | Yes |
|
||||
|
||||
### Returns
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
title: "log10"
|
||||
subtitle: "Function in math"
|
||||
subtitle: "Function in std::math"
|
||||
excerpt: "Compute the base 10 logarithm of the number."
|
||||
layout: manual
|
||||
---
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
title: "log2"
|
||||
subtitle: "Function in math"
|
||||
subtitle: "Function in std::math"
|
||||
excerpt: "Compute the base 2 logarithm of the number."
|
||||
layout: manual
|
||||
---
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
title: "max"
|
||||
subtitle: "Function in math"
|
||||
subtitle: "Function in std::math"
|
||||
excerpt: "Compute the maximum of the given arguments."
|
||||
layout: manual
|
||||
---
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
title: "min"
|
||||
subtitle: "Function in math"
|
||||
subtitle: "Function in std::math"
|
||||
excerpt: "Compute the minimum of the given arguments."
|
||||
layout: manual
|
||||
---
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
title: "polar"
|
||||
subtitle: "Function in math"
|
||||
subtitle: "Function in std::math"
|
||||
excerpt: ""
|
||||
layout: manual
|
||||
---
|
||||
@ -21,8 +21,8 @@ cartesian (x/y/z grid) coordinates.
|
||||
|
||||
| Name | Type | Description | Required |
|
||||
|----------|------|-------------|----------|
|
||||
| `angle` | `number(rad)` | | Yes |
|
||||
| `length` | `number(Length)` | | Yes |
|
||||
| `angle` | [`number(rad)`](/docs/kcl-std/types/std-types-number) | A number | Yes |
|
||||
| `length` | [`number(Length)`](/docs/kcl-std/types/std-types-number) | A number | Yes |
|
||||
|
||||
### Returns
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
title: "pow"
|
||||
subtitle: "Function in math"
|
||||
subtitle: "Function in std::math"
|
||||
excerpt: "Compute the number to a power."
|
||||
layout: manual
|
||||
---
|
||||
@ -21,7 +21,7 @@ pow(
|
||||
| Name | Type | Description | Required |
|
||||
|----------|------|-------------|----------|
|
||||
| `input` | [`number`](/docs/kcl-std/types/std-types-number) | The number to raise. | Yes |
|
||||
| `exp` | `number(_)` | The power to raise to. | Yes |
|
||||
| `exp` | [`number(_)`](/docs/kcl-std/types/std-types-number) | The power to raise to. | Yes |
|
||||
|
||||
### Returns
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
title: "rem"
|
||||
subtitle: "Function in math"
|
||||
subtitle: "Function in std::math"
|
||||
excerpt: ""
|
||||
layout: manual
|
||||
---
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
title: "round"
|
||||
subtitle: "Function in math"
|
||||
subtitle: "Function in std::math"
|
||||
excerpt: "Round a number to the nearest integer."
|
||||
layout: manual
|
||||
---
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
title: "sin"
|
||||
subtitle: "Function in math"
|
||||
subtitle: "Function in std::math"
|
||||
excerpt: "Compute the sine of a number."
|
||||
layout: manual
|
||||
---
|
||||
@ -17,11 +17,11 @@ sin(@num: number(Angle)): number(_)
|
||||
|
||||
| Name | Type | Description | Required |
|
||||
|----------|------|-------------|----------|
|
||||
| `num` | `number(Angle)` | | Yes |
|
||||
| `num` | [`number(Angle)`](/docs/kcl-std/types/std-types-number) | A number | Yes |
|
||||
|
||||
### Returns
|
||||
|
||||
`number(_)`
|
||||
[`number(_)`](/docs/kcl-std/types/std-types-number) - A number
|
||||
|
||||
|
||||
### Examples
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
title: "sqrt"
|
||||
subtitle: "Function in math"
|
||||
subtitle: "Function in std::math"
|
||||
excerpt: "Compute the square root of a number."
|
||||
layout: manual
|
||||
---
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
title: "tan"
|
||||
subtitle: "Function in math"
|
||||
subtitle: "Function in std::math"
|
||||
excerpt: "Compute the tangent of a number."
|
||||
layout: manual
|
||||
---
|
||||
@ -17,11 +17,11 @@ tan(@num: number(Angle)): number(_)
|
||||
|
||||
| Name | Type | Description | Required |
|
||||
|----------|------|-------------|----------|
|
||||
| `num` | `number(Angle)` | | Yes |
|
||||
| `num` | [`number(Angle)`](/docs/kcl-std/types/std-types-number) | A number | Yes |
|
||||
|
||||
### Returns
|
||||
|
||||
`number(_)`
|
||||
[`number(_)`](/docs/kcl-std/types/std-types-number) - A number
|
||||
|
||||
|
||||
### Examples
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
title: "offsetPlane"
|
||||
subtitle: "Function in prelude"
|
||||
subtitle: "Function in std"
|
||||
excerpt: "Offset a plane by a distance along its normal."
|
||||
layout: manual
|
||||
---
|
||||
@ -22,7 +22,7 @@ plane and 10 units away from it.
|
||||
| Name | Type | Description | Required |
|
||||
|----------|------|-------------|----------|
|
||||
| `plane` | [`Plane`](/docs/kcl-std/types/std-types-Plane) | The plane (e.g. `XY`) which this new plane is created from. | Yes |
|
||||
| `offset` | `number(Length)` | Distance from the standard plane this new plane will be created at. | Yes |
|
||||
| `offset` | [`number(Length)`](/docs/kcl-std/types/std-types-number) | Distance from the standard plane this new plane will be created at. | Yes |
|
||||
|
||||
### Returns
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
title: "circle"
|
||||
subtitle: "Function in sketch"
|
||||
subtitle: "Function in std::sketch"
|
||||
excerpt: ""
|
||||
layout: manual
|
||||
---
|
||||
@ -25,7 +25,7 @@ the provided (x, y) origin point.
|
||||
|----------|------|-------------|----------|
|
||||
| `sketch_or_surface` | [`Sketch`](/docs/kcl-std/types/std-types-Sketch) or [`Plane`](/docs/kcl-std/types/std-types-Plane) or [`Face`](/docs/kcl-std/types/std-types-Face) | Sketch to extend, or plane or surface to sketch on. | Yes |
|
||||
| `center` | [`Point2d`](/docs/kcl-std/types/std-types-Point2d) | The center of the circle. | Yes |
|
||||
| `radius` | `number(Length)` | The radius of the circle. | Yes |
|
||||
| `radius` | [`number(Length)`](/docs/kcl-std/types/std-types-number) | The radius of the circle. | Yes |
|
||||
| [`tag`](/docs/kcl-std/types/std-types-tag) | [`tag`](/docs/kcl-std/types/std-types-tag) | Create a new tag which refers to this circle. | No |
|
||||
|
||||
### Returns
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
title: "revolve"
|
||||
subtitle: "Function in sketch"
|
||||
subtitle: "Function in std::sketch"
|
||||
excerpt: "Rotate a sketch around some provided axis, creating a solid from its extent."
|
||||
layout: manual
|
||||
---
|
||||
@ -37,10 +37,10 @@ revolved around the same axis.
|
||||
|----------|------|-------------|----------|
|
||||
| `sketches` | [`[Sketch; 1+]`](/docs/kcl-std/types/std-types-Sketch) | The sketch or set of sketches that should be revolved | Yes |
|
||||
| `axis` | [`Axis2d`](/docs/kcl-std/types/std-types-Axis2d) or [`Edge`](/docs/kcl-std/types/std-types-Edge) | Axis of revolution. | Yes |
|
||||
| `angle` | `number(Angle)` | Angle to revolve (in degrees). Default is 360. | No |
|
||||
| `tolerance` | `number(Length)` | Tolerance for the revolve operation. | No |
|
||||
| `angle` | [`number(Angle)`](/docs/kcl-std/types/std-types-number) | Angle to revolve (in degrees). Default is 360. | No |
|
||||
| `tolerance` | [`number(Length)`](/docs/kcl-std/types/std-types-number) | Tolerance for the revolve operation. | No |
|
||||
| `symmetric` | [`bool`](/docs/kcl-std/types/std-types-bool) | If true, the extrusion will happen symmetrically around the sketch. Otherwise, the extrusion will happen on only one side of the sketch. | No |
|
||||
| `bidirectionalAngle` | `number(Angle)` | If specified, will also revolve in the opposite direction to 'angle' to the specified angle. If 'symmetric' is true, this value is ignored. | No |
|
||||
| `bidirectionalAngle` | [`number(Angle)`](/docs/kcl-std/types/std-types-number) | If specified, will also revolve in the opposite direction to 'angle' to the specified angle. If 'symmetric' is true, this value is ignored. | No |
|
||||
| `tagStart` | [`tag`](/docs/kcl-std/types/std-types-tag) | A named tag for the face at the start of the revolve, i.e. the original sketch. | No |
|
||||
| `tagEnd` | [`tag`](/docs/kcl-std/types/std-types-tag) | A named tag for the face at the end of the revolve. | No |
|
||||
|
||||
|
File diff suppressed because one or more lines are too long
@ -1,6 +1,6 @@
|
||||
---
|
||||
title: "fillet"
|
||||
subtitle: "Function in solid"
|
||||
subtitle: "Function in std::solid"
|
||||
excerpt: "Blend a transitional edge along a tagged path, smoothing the sharp edge."
|
||||
layout: manual
|
||||
---
|
||||
@ -26,9 +26,9 @@ will smoothly blend the transition.
|
||||
| Name | Type | Description | Required |
|
||||
|----------|------|-------------|----------|
|
||||
| `solid` | [`Solid`](/docs/kcl-std/types/std-types-Solid) | The solid whose edges should be filletted | Yes |
|
||||
| `radius` | `number(Length)` | The radius of the fillet | Yes |
|
||||
| `radius` | [`number(Length)`](/docs/kcl-std/types/std-types-number) | The radius of the fillet | Yes |
|
||||
| `tags` | [`[Edge; 1+]`](/docs/kcl-std/types/std-types-Edge) | The paths you want to fillet | Yes |
|
||||
| `tolerance` | `number(Length)` | The tolerance for this fillet | No |
|
||||
| `tolerance` | [`number(Length)`](/docs/kcl-std/types/std-types-number) | The tolerance for this fillet | No |
|
||||
| [`tag`](/docs/kcl-std/types/std-types-tag) | [`tag`](/docs/kcl-std/types/std-types-tag) | Create a new tag which refers to this fillet | No |
|
||||
|
||||
### Returns
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
title: "hollow"
|
||||
subtitle: "Function in solid"
|
||||
subtitle: "Function in std::solid"
|
||||
excerpt: "Make the inside of a 3D object hollow."
|
||||
layout: manual
|
||||
---
|
||||
@ -22,7 +22,7 @@ provided thickness remains around the exterior of the shape.
|
||||
| Name | Type | Description | Required |
|
||||
|----------|------|-------------|----------|
|
||||
| `solid` | [`Solid`](/docs/kcl-std/types/std-types-Solid) | Which solid to hollow out | Yes |
|
||||
| `thickness` | `number(Length)` | The thickness of the remaining shell | Yes |
|
||||
| `thickness` | [`number(Length)`](/docs/kcl-std/types/std-types-number) | The thickness of the remaining shell | Yes |
|
||||
|
||||
### Returns
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
title: "shell"
|
||||
subtitle: "Function in solid"
|
||||
subtitle: "Function in std::solid"
|
||||
excerpt: ""
|
||||
layout: manual
|
||||
---
|
||||
@ -23,7 +23,7 @@ provided thickness remains, taking volume starting at the providedface, leaving
|
||||
| Name | Type | Description | Required |
|
||||
|----------|------|-------------|----------|
|
||||
| `solids` | [`[Solid; 1+]`](/docs/kcl-std/types/std-types-Solid) | Which solid (or solids) to shell out | Yes |
|
||||
| `thickness` | `number(Length)` | The thickness of the shell | Yes |
|
||||
| `thickness` | [`number(Length)`](/docs/kcl-std/types/std-types-number) | The thickness of the shell | Yes |
|
||||
| `faces` | [`[tag; 1+]`](/docs/kcl-std/types/std-types-tag) | The faces you want removed | Yes |
|
||||
|
||||
### Returns
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
title: "mirror2d"
|
||||
subtitle: "Function in transform"
|
||||
subtitle: "Function in std::transform"
|
||||
excerpt: "Mirror a sketch."
|
||||
layout: manual
|
||||
---
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
title: "units::toCentimeters"
|
||||
subtitle: "Function in units"
|
||||
subtitle: "Function in std::units"
|
||||
excerpt: "Convert a number to centimeters from its current units."
|
||||
layout: manual
|
||||
---
|
||||
@ -17,11 +17,11 @@ units::toCentimeters(@num: number(cm)): number(cm)
|
||||
|
||||
| Name | Type | Description | Required |
|
||||
|----------|------|-------------|----------|
|
||||
| `num` | `number(cm)` | | Yes |
|
||||
| `num` | [`number(cm)`](/docs/kcl-std/types/std-types-number) | A number | Yes |
|
||||
|
||||
### Returns
|
||||
|
||||
`number(cm)`
|
||||
[`number(cm)`](/docs/kcl-std/types/std-types-number) - A number
|
||||
|
||||
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
title: "units::toDegrees"
|
||||
subtitle: "Function in units"
|
||||
subtitle: "Function in std::units"
|
||||
excerpt: "Converts a number to degrees from its current units."
|
||||
layout: manual
|
||||
---
|
||||
@ -17,11 +17,11 @@ units::toDegrees(@num: number(deg)): number(deg)
|
||||
|
||||
| Name | Type | Description | Required |
|
||||
|----------|------|-------------|----------|
|
||||
| `num` | `number(deg)` | | Yes |
|
||||
| `num` | [`number(deg)`](/docs/kcl-std/types/std-types-number) | A number | Yes |
|
||||
|
||||
### Returns
|
||||
|
||||
`number(deg)`
|
||||
[`number(deg)`](/docs/kcl-std/types/std-types-number) - A number
|
||||
|
||||
|
||||
### Examples
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
title: "units::toFeet"
|
||||
subtitle: "Function in units"
|
||||
subtitle: "Function in std::units"
|
||||
excerpt: "Convert a number to feet from its current units."
|
||||
layout: manual
|
||||
---
|
||||
@ -17,11 +17,11 @@ units::toFeet(@num: number(ft)): number(ft)
|
||||
|
||||
| Name | Type | Description | Required |
|
||||
|----------|------|-------------|----------|
|
||||
| `num` | `number(ft)` | | Yes |
|
||||
| `num` | [`number(ft)`](/docs/kcl-std/types/std-types-number) | A number | Yes |
|
||||
|
||||
### Returns
|
||||
|
||||
`number(ft)`
|
||||
[`number(ft)`](/docs/kcl-std/types/std-types-number) - A number
|
||||
|
||||
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
title: "units::toInches"
|
||||
subtitle: "Function in units"
|
||||
subtitle: "Function in std::units"
|
||||
excerpt: "Convert a number to inches from its current units."
|
||||
layout: manual
|
||||
---
|
||||
@ -17,11 +17,11 @@ units::toInches(@num: number(in)): number(in)
|
||||
|
||||
| Name | Type | Description | Required |
|
||||
|----------|------|-------------|----------|
|
||||
| `num` | `number(in)` | | Yes |
|
||||
| `num` | [`number(in)`](/docs/kcl-std/types/std-types-number) | A number | Yes |
|
||||
|
||||
### Returns
|
||||
|
||||
`number(in)`
|
||||
[`number(in)`](/docs/kcl-std/types/std-types-number) - A number
|
||||
|
||||
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
title: "units::toMeters"
|
||||
subtitle: "Function in units"
|
||||
subtitle: "Function in std::units"
|
||||
excerpt: "Convert a number to meters from its current units."
|
||||
layout: manual
|
||||
---
|
||||
@ -17,11 +17,11 @@ units::toMeters(@num: number(m)): number(m)
|
||||
|
||||
| Name | Type | Description | Required |
|
||||
|----------|------|-------------|----------|
|
||||
| `num` | `number(m)` | | Yes |
|
||||
| `num` | [`number(m)`](/docs/kcl-std/types/std-types-number) | A number | Yes |
|
||||
|
||||
### Returns
|
||||
|
||||
`number(m)`
|
||||
[`number(m)`](/docs/kcl-std/types/std-types-number) - A number
|
||||
|
||||
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
title: "units::toMillimeters"
|
||||
subtitle: "Function in units"
|
||||
subtitle: "Function in std::units"
|
||||
excerpt: "Convert a number to millimeters from its current units."
|
||||
layout: manual
|
||||
---
|
||||
@ -17,11 +17,11 @@ units::toMillimeters(@num: number(mm)): number(mm)
|
||||
|
||||
| Name | Type | Description | Required |
|
||||
|----------|------|-------------|----------|
|
||||
| `num` | `number(mm)` | | Yes |
|
||||
| `num` | [`number(mm)`](/docs/kcl-std/types/std-types-number) | A number | Yes |
|
||||
|
||||
### Returns
|
||||
|
||||
`number(mm)`
|
||||
[`number(mm)`](/docs/kcl-std/types/std-types-number) - A number
|
||||
|
||||
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
title: "units::toRadians"
|
||||
subtitle: "Function in units"
|
||||
subtitle: "Function in std::units"
|
||||
excerpt: "Converts a number to radians from its current units."
|
||||
layout: manual
|
||||
---
|
||||
@ -17,11 +17,11 @@ units::toRadians(@num: number(rad)): number(rad)
|
||||
|
||||
| Name | Type | Description | Required |
|
||||
|----------|------|-------------|----------|
|
||||
| `num` | `number(rad)` | | Yes |
|
||||
| `num` | [`number(rad)`](/docs/kcl-std/types/std-types-number) | A number | Yes |
|
||||
|
||||
### Returns
|
||||
|
||||
`number(rad)`
|
||||
[`number(rad)`](/docs/kcl-std/types/std-types-number) - A number
|
||||
|
||||
|
||||
### Examples
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
title: "units::toYards"
|
||||
subtitle: "Function in units"
|
||||
subtitle: "Function in std::units"
|
||||
excerpt: "Converts a number to yards from its current units."
|
||||
layout: manual
|
||||
---
|
||||
@ -17,11 +17,11 @@ units::toYards(@num: number(yd)): number(yd)
|
||||
|
||||
| Name | Type | Description | Required |
|
||||
|----------|------|-------------|----------|
|
||||
| `num` | `number(yd)` | | Yes |
|
||||
| `num` | [`number(yd)`](/docs/kcl-std/types/std-types-number) | A number | Yes |
|
||||
|
||||
### Returns
|
||||
|
||||
`number(yd)`
|
||||
[`number(yd)`](/docs/kcl-std/types/std-types-number) - A number
|
||||
|
||||
|
||||
|
||||
|
@ -50,7 +50,7 @@ r = 10 // radius
|
||||
// Call `map`, using an anonymous function instead of a named one.
|
||||
circles = map(
|
||||
[1..3],
|
||||
f = fn(id) {
|
||||
f = fn(@id) {
|
||||
return startSketchOn(XY)
|
||||
|> circle(center = [id * 2 * r, 0], radius = r)
|
||||
},
|
||||
|
@ -10,4 +10,10 @@ layout: manual
|
||||
|
||||
|
||||
|
||||
## Functions and constants
|
||||
|
||||
* [`map`](/docs/kcl-std/map)
|
||||
* [`pop`](/docs/kcl-std/pop)
|
||||
* [`push`](/docs/kcl-std/push)
|
||||
* [`reduce`](/docs/kcl-std/reduce)
|
||||
|
||||
|
@ -23,6 +23,9 @@ layout: manual
|
||||
* [`ceil`](/docs/kcl-std/functions/std-math-ceil)
|
||||
* [`cos`](/docs/kcl-std/functions/std-math-cos)
|
||||
* [`floor`](/docs/kcl-std/functions/std-math-floor)
|
||||
* [`legAngX`](/docs/kcl-std/legAngX)
|
||||
* [`legAngY`](/docs/kcl-std/legAngY)
|
||||
* [`legLen`](/docs/kcl-std/legLen)
|
||||
* [`ln`](/docs/kcl-std/functions/std-math-ln)
|
||||
* [`log`](/docs/kcl-std/functions/std-math-log)
|
||||
* [`log10`](/docs/kcl-std/functions/std-math-log10)
|
||||
|
@ -12,6 +12,44 @@ layout: manual
|
||||
|
||||
## Functions and constants
|
||||
|
||||
* [`angledLine`](/docs/kcl-std/angledLine)
|
||||
* [`angledLineThatIntersects`](/docs/kcl-std/angledLineThatIntersects)
|
||||
* [`arc`](/docs/kcl-std/arc)
|
||||
* [`bezierCurve`](/docs/kcl-std/bezierCurve)
|
||||
* [`circle`](/docs/kcl-std/functions/std-sketch-circle)
|
||||
* [`circleThreePoint`](/docs/kcl-std/circleThreePoint)
|
||||
* [`close`](/docs/kcl-std/close)
|
||||
* [`extrude`](/docs/kcl-std/extrude)
|
||||
* [`getCommonEdge`](/docs/kcl-std/getCommonEdge)
|
||||
* [`getNextAdjacentEdge`](/docs/kcl-std/getNextAdjacentEdge)
|
||||
* [`getOppositeEdge`](/docs/kcl-std/getOppositeEdge)
|
||||
* [`getPreviousAdjacentEdge`](/docs/kcl-std/getPreviousAdjacentEdge)
|
||||
* [`involuteCircular`](/docs/kcl-std/involuteCircular)
|
||||
* [`lastSegX`](/docs/kcl-std/lastSegX)
|
||||
* [`lastSegY`](/docs/kcl-std/lastSegY)
|
||||
* [`line`](/docs/kcl-std/line)
|
||||
* [`loft`](/docs/kcl-std/loft)
|
||||
* [`patternCircular2d`](/docs/kcl-std/patternCircular2d)
|
||||
* [`patternTransform2d`](/docs/kcl-std/patternTransform2d)
|
||||
* [`polygon`](/docs/kcl-std/polygon)
|
||||
* [`profileStart`](/docs/kcl-std/profileStart)
|
||||
* [`profileStartX`](/docs/kcl-std/profileStartX)
|
||||
* [`profileStartY`](/docs/kcl-std/profileStartY)
|
||||
* [`revolve`](/docs/kcl-std/functions/std-sketch-revolve)
|
||||
* [`segAng`](/docs/kcl-std/segAng)
|
||||
* [`segEnd`](/docs/kcl-std/segEnd)
|
||||
* [`segEndX`](/docs/kcl-std/segEndX)
|
||||
* [`segEndY`](/docs/kcl-std/segEndY)
|
||||
* [`segLen`](/docs/kcl-std/segLen)
|
||||
* [`segStart`](/docs/kcl-std/segStart)
|
||||
* [`segStartX`](/docs/kcl-std/segStartX)
|
||||
* [`segStartY`](/docs/kcl-std/segStartY)
|
||||
* [`startProfile`](/docs/kcl-std/startProfile)
|
||||
* [`startSketchOn`](/docs/kcl-std/startSketchOn)
|
||||
* [`subtract2d`](/docs/kcl-std/subtract2d)
|
||||
* [`sweep`](/docs/kcl-std/sweep)
|
||||
* [`tangentToEnd`](/docs/kcl-std/tangentToEnd)
|
||||
* [`tangentialArc`](/docs/kcl-std/tangentialArc)
|
||||
* [`xLine`](/docs/kcl-std/xLine)
|
||||
* [`yLine`](/docs/kcl-std/yLine)
|
||||
|
||||
|
@ -15,5 +15,11 @@ layout: manual
|
||||
* [`chamfer`](/docs/kcl-std/functions/std-solid-chamfer)
|
||||
* [`fillet`](/docs/kcl-std/functions/std-solid-fillet)
|
||||
* [`hollow`](/docs/kcl-std/functions/std-solid-hollow)
|
||||
* [`intersect`](/docs/kcl-std/intersect)
|
||||
* [`patternCircular3d`](/docs/kcl-std/patternCircular3d)
|
||||
* [`patternLinear3d`](/docs/kcl-std/patternLinear3d)
|
||||
* [`patternTransform`](/docs/kcl-std/patternTransform)
|
||||
* [`shell`](/docs/kcl-std/functions/std-solid-shell)
|
||||
* [`subtract`](/docs/kcl-std/subtract)
|
||||
* [`union`](/docs/kcl-std/union)
|
||||
|
||||
|
@ -13,4 +13,7 @@ layout: manual
|
||||
## Functions and constants
|
||||
|
||||
* [`mirror2d`](/docs/kcl-std/functions/std-transform-mirror2d)
|
||||
* [`rotate`](/docs/kcl-std/rotate)
|
||||
* [`scale`](/docs/kcl-std/scale)
|
||||
* [`translate`](/docs/kcl-std/translate)
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
title: "prelude"
|
||||
subtitle: "Module in "
|
||||
title: "std"
|
||||
subtitle: "Module in std::"
|
||||
excerpt: "The KCL standard library "
|
||||
layout: manual
|
||||
---
|
||||
@ -30,6 +30,11 @@ Contains frequently used constants, functions for interacting with the KittyCAD
|
||||
* [`Y`](/docs/kcl-std/consts/std-Y)
|
||||
* [`YZ`](/docs/kcl-std/consts/std-YZ)
|
||||
* [`Z`](/docs/kcl-std/consts/std-Z)
|
||||
* [`appearance`](/docs/kcl-std/appearance)
|
||||
* [`assert`](/docs/kcl-std/assert)
|
||||
* [`assertIs`](/docs/kcl-std/assertIs)
|
||||
* [`clone`](/docs/kcl-std/clone)
|
||||
* [`helix`](/docs/kcl-std/functions/std-helix)
|
||||
* [`offsetPlane`](/docs/kcl-std/functions/std-offsetPlane)
|
||||
* [`patternLinear2d`](/docs/kcl-std/patternLinear2d)
|
||||
|
||||
|
@ -1,11 +1,11 @@
|
||||
---
|
||||
title: "patternCircular2d"
|
||||
subtitle: "Function in std::sketch"
|
||||
excerpt: "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."
|
||||
excerpt: "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 orientation of the solid with respect to the center of the circle is maintained."
|
||||
layout: manual
|
||||
---
|
||||
|
||||
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.
|
||||
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 orientation of the solid with respect to the center of the circle is maintained.
|
||||
|
||||
```kcl
|
||||
patternCircular2d(
|
||||
|
@ -1,11 +1,11 @@
|
||||
---
|
||||
title: "patternCircular3d"
|
||||
subtitle: "Function in std::solid"
|
||||
excerpt: "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."
|
||||
excerpt: "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 orientation of the solid with respect to the center of the circle is maintained."
|
||||
layout: manual
|
||||
---
|
||||
|
||||
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.
|
||||
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 orientation of the solid with respect to the center of the circle is maintained.
|
||||
|
||||
```kcl
|
||||
patternCircular3d(
|
||||
|
@ -34,8 +34,8 @@ reduce(
|
||||
|
||||
```kcl
|
||||
// This function adds two numbers.
|
||||
fn add(a, b) {
|
||||
return a + b
|
||||
fn add(@a, accum) {
|
||||
return a + accum
|
||||
}
|
||||
|
||||
// This function adds an array of numbers.
|
||||
@ -49,7 +49,7 @@ fn sum(@arr) {
|
||||
fn sum(arr):
|
||||
sumSoFar = 0
|
||||
for i in arr:
|
||||
sumSoFar = add(sumSoFar, i)
|
||||
sumSoFar = add(i, sumSoFar)
|
||||
return sumSoFar */
|
||||
|
||||
// We use `assert` to check that our `sum` function gives the
|
||||
@ -72,8 +72,8 @@ arr = [1, 2, 3]
|
||||
sum = reduce(
|
||||
arr,
|
||||
initial = 0,
|
||||
f = fn(i, result_so_far) {
|
||||
return i + result_so_far
|
||||
f = fn(@i, accum) {
|
||||
return i + accum
|
||||
},
|
||||
)
|
||||
|
||||
@ -105,11 +105,11 @@ fn decagon(@radius) {
|
||||
fullDecagon = reduce(
|
||||
[1..10],
|
||||
initial = startOfDecagonSketch,
|
||||
f = fn(i, partialDecagon) {
|
||||
f = fn(@i, accum) {
|
||||
// Draw one edge of the decagon.
|
||||
x = cos(stepAngle * i) * radius
|
||||
y = sin(stepAngle * i) * radius
|
||||
return line(partialDecagon, end = [x, y])
|
||||
return line(accum, end = [x, y])
|
||||
},
|
||||
)
|
||||
|
||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -133826,14 +133826,14 @@
|
||||
false
|
||||
],
|
||||
[
|
||||
"r = 10 // radius\n// Call `map`, using an anonymous function instead of a named one.\ncircles = map(\n [1..3],\n f = fn(id) {\n return startSketchOn(XY)\n |> circle(center = [id * 2 * r, 0], radius = r)\n },\n)",
|
||||
"r = 10 // radius\n// Call `map`, using an anonymous function instead of a named one.\ncircles = map(\n [1..3],\n f = fn(@id) {\n return startSketchOn(XY)\n |> circle(center = [id * 2 * r, 0], radius = r)\n },\n)",
|
||||
false
|
||||
]
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "patternCircular2d",
|
||||
"summary": "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.",
|
||||
"summary": "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 orientation of the solid with respect to the center of the circle is maintained.",
|
||||
"description": "",
|
||||
"tags": [
|
||||
"sketch"
|
||||
@ -145093,7 +145093,7 @@
|
||||
},
|
||||
{
|
||||
"name": "patternCircular3d",
|
||||
"summary": "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.",
|
||||
"summary": "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 orientation of the solid with respect to the center of the circle is maintained.",
|
||||
"description": "",
|
||||
"tags": [
|
||||
"solid"
|
||||
@ -232586,15 +232586,15 @@
|
||||
"deprecated": false,
|
||||
"examples": [
|
||||
[
|
||||
"// This function adds two numbers.\nfn add(a, b) {\n return a + b\n}\n\n// This function adds an array of numbers.\n// It uses the `reduce` function, to call the `add` function on every\n// element of the `arr` parameter. The starting value is 0.\nfn sum(@arr) {\n return reduce(arr, initial = 0, f = add)\n}\n\n/* The above is basically like this pseudo-code:\nfn sum(arr):\n sumSoFar = 0\n for i in arr:\n sumSoFar = add(sumSoFar, i)\n return sumSoFar */\n\n// We use `assert` to check that our `sum` function gives the\n// expected result. It's good to check your work!\nassert(\n sum([1, 2, 3]),\n isEqualTo = 6,\n tolerance = 0.1,\n error = \"1 + 2 + 3 summed is 6\",\n)",
|
||||
"// This function adds two numbers.\nfn add(@a, accum) {\n return a + accum\n}\n\n// This function adds an array of numbers.\n// It uses the `reduce` function, to call the `add` function on every\n// element of the `arr` parameter. The starting value is 0.\nfn sum(@arr) {\n return reduce(arr, initial = 0, f = add)\n}\n\n/* The above is basically like this pseudo-code:\nfn sum(arr):\n sumSoFar = 0\n for i in arr:\n sumSoFar = add(i, sumSoFar)\n return sumSoFar */\n\n// We use `assert` to check that our `sum` function gives the\n// expected result. It's good to check your work!\nassert(\n sum([1, 2, 3]),\n isEqualTo = 6,\n tolerance = 0.1,\n error = \"1 + 2 + 3 summed is 6\",\n)",
|
||||
false
|
||||
],
|
||||
[
|
||||
"// This example works just like the previous example above, but it uses\n// an anonymous `add` function as its parameter, instead of declaring a\n// named function outside.\narr = [1, 2, 3]\nsum = reduce(\n arr,\n initial = 0,\n f = fn(i, result_so_far) {\n return i + result_so_far\n },\n)\n\n// We use `assert` to check that our `sum` function gives the\n// expected result. It's good to check your work!\nassert(\n sum,\n isEqualTo = 6,\n tolerance = 0.1,\n error = \"1 + 2 + 3 summed is 6\",\n)",
|
||||
"// This example works just like the previous example above, but it uses\n// an anonymous `add` function as its parameter, instead of declaring a\n// named function outside.\narr = [1, 2, 3]\nsum = reduce(\n arr,\n initial = 0,\n f = fn(@i, accum) {\n return i + accum\n },\n)\n\n// We use `assert` to check that our `sum` function gives the\n// expected result. It's good to check your work!\nassert(\n sum,\n isEqualTo = 6,\n tolerance = 0.1,\n error = \"1 + 2 + 3 summed is 6\",\n)",
|
||||
false
|
||||
],
|
||||
[
|
||||
"// Declare a function that sketches a decagon.\nfn decagon(@radius) {\n // Each side of the decagon is turned this many radians from the previous angle.\n stepAngle = (1 / 10 * TAU): number(rad)\n\n // Start the decagon sketch at this point.\n startOfDecagonSketch = startSketchOn(XY)\n |> startProfile(at = [cos(0) * radius, sin(0) * radius])\n\n // Use a `reduce` to draw the remaining decagon sides.\n // For each number in the array 1..10, run the given function,\n // which takes a partially-sketched decagon and adds one more edge to it.\n fullDecagon = reduce(\n [1..10],\n initial = startOfDecagonSketch,\n f = fn(i, partialDecagon) {\n // Draw one edge of the decagon.\n x = cos(stepAngle * i) * radius\n y = sin(stepAngle * i) * radius\n return line(partialDecagon, end = [x, y])\n },\n )\n\n return fullDecagon\n}\n\n/* The `decagon` above is basically like this pseudo-code:\nfn decagon(radius):\n stepAngle = ((1/10) * TAU): number(rad)\n plane = startSketchOn(XY)\n startOfDecagonSketch = startProfile(plane, at = [(cos(0)*radius), (sin(0) * radius)])\n\n // Here's the reduce part.\n partialDecagon = startOfDecagonSketch\n for i in [1..10]:\n x = cos(stepAngle * i) * radius\n y = sin(stepAngle * i) * radius\n partialDecagon = line(partialDecagon, end = [x, y])\n fullDecagon = partialDecagon // it's now full\n return fullDecagon */\n\n// Use the `decagon` function declared above, to sketch a decagon with radius 5.\ndecagon(5.0)\n |> close()",
|
||||
"// Declare a function that sketches a decagon.\nfn decagon(@radius) {\n // Each side of the decagon is turned this many radians from the previous angle.\n stepAngle = (1 / 10 * TAU): number(rad)\n\n // Start the decagon sketch at this point.\n startOfDecagonSketch = startSketchOn(XY)\n |> startProfile(at = [cos(0) * radius, sin(0) * radius])\n\n // Use a `reduce` to draw the remaining decagon sides.\n // For each number in the array 1..10, run the given function,\n // which takes a partially-sketched decagon and adds one more edge to it.\n fullDecagon = reduce(\n [1..10],\n initial = startOfDecagonSketch,\n f = fn(@i, accum) {\n // Draw one edge of the decagon.\n x = cos(stepAngle * i) * radius\n y = sin(stepAngle * i) * radius\n return line(accum, end = [x, y])\n },\n )\n\n return fullDecagon\n}\n\n/* The `decagon` above is basically like this pseudo-code:\nfn decagon(radius):\n stepAngle = ((1/10) * TAU): number(rad)\n plane = startSketchOn(XY)\n startOfDecagonSketch = startProfile(plane, at = [(cos(0)*radius), (sin(0) * radius)])\n\n // Here's the reduce part.\n partialDecagon = startOfDecagonSketch\n for i in [1..10]:\n x = cos(stepAngle * i) * radius\n y = sin(stepAngle * i) * radius\n partialDecagon = line(partialDecagon, end = [x, y])\n fullDecagon = partialDecagon // it's now full\n return fullDecagon */\n\n// Use the `decagon` function declared above, to sketch a decagon with radius 5.\ndecagon(5.0)\n |> close()",
|
||||
false
|
||||
]
|
||||
]
|
||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -1,6 +1,6 @@
|
||||
---
|
||||
title: "Axis2d"
|
||||
subtitle: "Type in types"
|
||||
subtitle: "Type in std::types"
|
||||
excerpt: "An infinite line in 2d space."
|
||||
layout: manual
|
||||
---
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
title: "Axis3d"
|
||||
subtitle: "Type in types"
|
||||
subtitle: "Type in std::types"
|
||||
excerpt: "An infinite line in 3d space."
|
||||
layout: manual
|
||||
---
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
title: "Edge"
|
||||
subtitle: "Type in types"
|
||||
subtitle: "Type in std::types"
|
||||
excerpt: "The edge of a solid."
|
||||
layout: manual
|
||||
---
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
title: "Face"
|
||||
subtitle: "Type in types"
|
||||
subtitle: "Type in std::types"
|
||||
excerpt: "A face."
|
||||
layout: manual
|
||||
---
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
title: "Helix"
|
||||
subtitle: "Type in types"
|
||||
subtitle: "Type in std::types"
|
||||
excerpt: "A helix."
|
||||
layout: manual
|
||||
---
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
title: "Plane"
|
||||
subtitle: "Type in types"
|
||||
subtitle: "Type in std::types"
|
||||
excerpt: "A plane."
|
||||
layout: manual
|
||||
---
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
title: "Point2d"
|
||||
subtitle: "Type in types"
|
||||
subtitle: "Type in std::types"
|
||||
excerpt: "A point in two dimensional space."
|
||||
layout: manual
|
||||
---
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
title: "Point3d"
|
||||
subtitle: "Type in types"
|
||||
subtitle: "Type in std::types"
|
||||
excerpt: "A point in three dimensional space."
|
||||
layout: manual
|
||||
---
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
title: "Sketch"
|
||||
subtitle: "Type in types"
|
||||
subtitle: "Type in std::types"
|
||||
excerpt: "A sketch is a collection of paths."
|
||||
layout: manual
|
||||
---
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
title: "Solid"
|
||||
subtitle: "Type in types"
|
||||
subtitle: "Type in std::types"
|
||||
excerpt: "A solid is a collection of extrude surfaces."
|
||||
layout: manual
|
||||
---
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
title: "any"
|
||||
subtitle: "Type in types"
|
||||
subtitle: "Type in std::types"
|
||||
excerpt: "Any value."
|
||||
layout: manual
|
||||
---
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
title: "bool"
|
||||
subtitle: "Type in types"
|
||||
subtitle: "Type in std::types"
|
||||
excerpt: "A boolean value."
|
||||
layout: manual
|
||||
---
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
title: "number"
|
||||
subtitle: "Type in types"
|
||||
subtitle: "Type in std::types"
|
||||
excerpt: "A number"
|
||||
layout: manual
|
||||
---
|
||||
@ -9,7 +9,7 @@ A number
|
||||
|
||||
May be signed or unsigned, an integer or decimal value.
|
||||
|
||||
You may see a number type with units, e.g., `number(mm)`. These are currently experimental.
|
||||
You may see a number type with units, e.g., [`number(mm)`](/docs/kcl-std/types/std-types-number). These are currently experimental.
|
||||
|
||||
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
title: "string"
|
||||
subtitle: "Type in types"
|
||||
subtitle: "Type in std::types"
|
||||
excerpt: "A sequence of characters"
|
||||
layout: manual
|
||||
---
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
title: "tag"
|
||||
subtitle: "Type in types"
|
||||
subtitle: "Type in std::types"
|
||||
excerpt: "Tags are used to give a name (tag) to a specific path."
|
||||
layout: manual
|
||||
---
|
||||
|
@ -514,14 +514,18 @@ test.describe('Command bar tests', () => {
|
||||
})
|
||||
})
|
||||
|
||||
test(`Zoom to fit to shared model on web`, async ({ page, scene }) => {
|
||||
if (process.env.PLATFORM !== 'web') {
|
||||
// This test is web-only
|
||||
return
|
||||
}
|
||||
await test.step(`Prepare and navigate to home page with query params`, async () => {
|
||||
// a quad in the top left corner of the XZ plane (which is out of the current view)
|
||||
const code = `sketch001 = startSketchOn(XZ)
|
||||
test(
|
||||
`Zoom to fit to shared model on web`,
|
||||
{ tag: ['@web'] },
|
||||
async ({ page, scene }) => {
|
||||
if (process.env.PLATFORM !== 'web') {
|
||||
// This test is web-only
|
||||
// TODO: re-enable on CI as part of a new @web test suite
|
||||
return
|
||||
}
|
||||
await test.step(`Prepare and navigate to home page with query params`, async () => {
|
||||
// a quad in the top left corner of the XZ plane (which is out of the current view)
|
||||
const code = `sketch001 = startSketchOn(XZ)
|
||||
profile001 = startProfile(sketch001, at = [-484.34, 484.95])
|
||||
|> yLine(length = -69.1)
|
||||
|> xLine(length = 66.84)
|
||||
@ -529,26 +533,27 @@ profile001 = startProfile(sketch001, at = [-484.34, 484.95])
|
||||
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|
||||
|> close()
|
||||
`
|
||||
const targetURL = `?create-file&name=test&units=mm&code=${encodeURIComponent(btoa(code))}&ask-open-desktop`
|
||||
await page.goto(page.url() + targetURL)
|
||||
expect(page.url()).toContain(targetURL)
|
||||
})
|
||||
const targetURL = `?create-file&name=test&units=mm&code=${encodeURIComponent(btoa(code))}&ask-open-desktop`
|
||||
await page.goto(page.url() + targetURL)
|
||||
expect(page.url()).toContain(targetURL)
|
||||
})
|
||||
|
||||
await test.step(`Submit the command`, async () => {
|
||||
await page.getByTestId('continue-to-web-app-button').click()
|
||||
await test.step(`Submit the command`, async () => {
|
||||
await page.getByTestId('continue-to-web-app-button').click()
|
||||
|
||||
await scene.connectionEstablished()
|
||||
await scene.connectionEstablished()
|
||||
|
||||
// This makes SystemIOMachineActors.createKCLFile run after EngineStream/firstPlay
|
||||
await page.waitForTimeout(3000)
|
||||
// This makes SystemIOMachineActors.createKCLFile run after EngineStream/firstPlay
|
||||
await page.waitForTimeout(3000)
|
||||
|
||||
await page.getByTestId('command-bar-submit').click()
|
||||
})
|
||||
await page.getByTestId('command-bar-submit').click()
|
||||
})
|
||||
|
||||
await test.step(`Ensure we created the project and are in the modeling scene`, async () => {
|
||||
await expectPixelColor(page, [252, 252, 252], { x: 600, y: 260 }, 8)
|
||||
})
|
||||
})
|
||||
await test.step(`Ensure we created the project and are in the modeling scene`, async () => {
|
||||
await expectPixelColor(page, [252, 252, 252], { x: 600, y: 260 }, 8)
|
||||
})
|
||||
}
|
||||
)
|
||||
|
||||
test(`Can add and edit a named parameter or constant`, async ({
|
||||
page,
|
||||
|
@ -1355,7 +1355,7 @@ sketch001 = startSketchOn(XZ)
|
||||
const projectLink = page.getByRole('link', { name: 'cube' })
|
||||
const gizmo = page.locator('[aria-label*=gizmo]')
|
||||
const resetCameraButton = page.getByRole('button', { name: 'Reset view' })
|
||||
const locationToHavColor = async (
|
||||
const locationToHaveColor = async (
|
||||
position: { x: number; y: number },
|
||||
color: [number, number, number]
|
||||
) => {
|
||||
@ -1374,7 +1374,7 @@ sketch001 = startSketchOn(XZ)
|
||||
await expect
|
||||
.poll(
|
||||
async () =>
|
||||
locationToHavColor(notTheOrigin, TEST_COLORS.DARK_MODE_PLANE_XZ),
|
||||
locationToHaveColor(notTheOrigin, TEST_COLORS.DARK_MODE_PLANE_XZ),
|
||||
{
|
||||
timeout: 5000,
|
||||
message: 'XZ plane color is visible',
|
||||
@ -1397,7 +1397,7 @@ sketch001 = startSketchOn(XZ)
|
||||
await expect
|
||||
.poll(
|
||||
async () =>
|
||||
locationToHavColor(origin, TEST_COLORS.DARK_MODE_PLANE_XZ),
|
||||
locationToHaveColor(origin, TEST_COLORS.DARK_MODE_PLANE_XZ),
|
||||
{
|
||||
timeout: 3000,
|
||||
message: 'Plane color should not be visible',
|
||||
@ -1406,7 +1406,7 @@ sketch001 = startSketchOn(XZ)
|
||||
.toBeGreaterThan(15)
|
||||
await expect
|
||||
.poll(
|
||||
async () => locationToHavColor(origin, TEST_COLORS.DARK_MODE_BKGD),
|
||||
async () => locationToHaveColor(origin, TEST_COLORS.DARK_MODE_BKGD),
|
||||
{
|
||||
timeout: 3000,
|
||||
message: 'Background color should not be visible',
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user