Compare commits

..

2 Commits

1518 changed files with 97865 additions and 228998 deletions

View File

@ -9,7 +9,6 @@ VITE_KC_SITE_BASE_URL=https://dev.zoo.dev
VITE_KC_SITE_APP_URL=https://app.dev.zoo.dev VITE_KC_SITE_APP_URL=https://app.dev.zoo.dev
VITE_KC_SKIP_AUTH=false VITE_KC_SKIP_AUTH=false
VITE_KC_CONNECTION_TIMEOUT_MS=5000 VITE_KC_CONNECTION_TIMEOUT_MS=5000
#VITE_WASM_URL="optional way of overriding the wasm url, particular for unit tests which need this if you running not on the default 3000 port"
#VITE_KC_DEV_TOKEN="optional token to skip auth in the app" #VITE_KC_DEV_TOKEN="optional token to skip auth in the app"
#token="required token for playwright. TODO: clean up env vars in #3973" #token="required token for playwright. TODO: clean up env vars in #3973"

3
.github/CODEOWNERS vendored
View File

@ -1,3 +0,0 @@
* @KittyCAD/frontend
/src/ @KittyCAD/frontend
/rust/ @KittyCAD/kcl

View File

@ -2,7 +2,7 @@
name: Release name: Release
about: Create a new release for the Zoo Design Studio about: Create a new release for the Zoo Design Studio
title: "Cut release v1.?.?" title: "Cut release v1.?.?"
labels: [meta/release] labels: [release]
--- ---
> Instructions: https://github.com/KittyCAD/modeling-app/blob/main/CONTRIBUTING.md#shipping-releases > Instructions: https://github.com/KittyCAD/modeling-app/blob/main/CONTRIBUTING.md#shipping-releases
@ -19,8 +19,7 @@ Release builds URL: ???
* [ ] Confirm the application opens (dismiss the updater) * [ ] Confirm the application opens (dismiss the updater)
* [ ] Create a project with a basic Text-to-CAD prompt * [ ] Create a project with a basic Text-to-CAD prompt
* [ ] Confirm the result is viewable in an engine stream * [ ] Confirm the result is viewable in an engine stream
* [ ] Use 'Check for updates' to bring back the updater toast * [ ] Open the application again and confirm the updater can downgrade
* [ ] Confirm the app can update to the previous release
## macOS via ??? ## macOS via ???
@ -28,8 +27,7 @@ Release builds URL: ???
* [ ] Confirm the application opens (dismiss the updater) * [ ] Confirm the application opens (dismiss the updater)
* [ ] Create a project with a basic Text-to-CAD prompt * [ ] Create a project with a basic Text-to-CAD prompt
* [ ] Confirm the result is viewable in an engine stream * [ ] Confirm the result is viewable in an engine stream
* [ ] Use 'Check for updates' to bring back the updater toast * [ ] Open the application again and confirm the updater can downgrade
* [ ] Confirm the app can update to the previous release
## Linux via ??? ## Linux via ???
@ -37,5 +35,4 @@ Release builds URL: ???
* [ ] Confirm the application opens (dismiss the updater) * [ ] Confirm the application opens (dismiss the updater)
* [ ] Create a project with a basic Text-to-CAD prompt * [ ] Create a project with a basic Text-to-CAD prompt
* [ ] Confirm the result is viewable in an engine stream * [ ] Confirm the result is viewable in an engine stream
* [ ] Use 'Check for updates' to bring back the updater toast * [ ] Open the application again and confirm the updater can downgrade
* [ ] Confirm the app can update to the previous release

View File

@ -43,7 +43,7 @@ jobs:
- name: Download Wasm Cache - name: Download Wasm Cache
id: download-wasm id: download-wasm
if: ${{ github.event_name == 'pull_request' && steps.filter.outputs.rust == 'false' }} if: ${{ github.event_name == 'pull_request' && steps.filter.outputs.rust == 'false' }}
uses: dawidd6/action-download-artifact@v11 uses: dawidd6/action-download-artifact@v7
continue-on-error: true continue-on-error: true
with: with:
github_token: ${{secrets.GITHUB_TOKEN}} github_token: ${{secrets.GITHUB_TOKEN}}
@ -362,7 +362,7 @@ jobs:
- name: Authenticate to Google Cloud - name: Authenticate to Google Cloud
if: ${{ env.IS_STAGING == 'true' }} if: ${{ env.IS_STAGING == 'true' }}
uses: 'google-github-actions/auth@v2.1.10' uses: 'google-github-actions/auth@v2.1.8'
with: with:
credentials_json: '${{ secrets.GOOGLE_CLOUD_DL_SA }}' credentials_json: '${{ secrets.GOOGLE_CLOUD_DL_SA }}'

View File

@ -31,15 +31,15 @@ jobs:
- name: Use correct Rust toolchain - name: Use correct Rust toolchain
shell: bash shell: bash
run: | run: |
cp .github/workflows/nightly-rust-toolchain.toml rust-toolchain.toml [ -e rust-toolchain.toml ] || cp rust/rust-toolchain.toml ./
- name: Install rust - name: Install rust
uses: actions-rust-lang/setup-rust-toolchain@v1 uses: actions-rust-lang/setup-rust-toolchain@v1
with: with:
cache-workspaces: rust cache-workspaces: rust
components: rustfmt components: rustfmt
- name: Run nightly cargo fmt - name: Run cargo fmt
run: | run: |
cd rust cd rust
cargo +nightly fmt -- --check cargo fmt -- --check
shell: bash shell: bash

View File

@ -25,8 +25,8 @@ jobs:
- runner=8cpu-linux-x64 - runner=8cpu-linux-x64
- extras=s3-cache - extras=s3-cache
steps: steps:
- uses: runs-on/action@v2 - uses: runs-on/action@v1
- uses: actions/create-github-app-token@v2 - uses: actions/create-github-app-token@v1
id: app-token id: app-token
with: with:
app-id: ${{ secrets.MODELING_APP_GH_APP_ID }} app-id: ${{ secrets.MODELING_APP_GH_APP_ID }}
@ -149,8 +149,8 @@ jobs:
partitionIndex: [1, 2, 3, 4, 5, 6] partitionIndex: [1, 2, 3, 4, 5, 6]
partitionTotal: [6] partitionTotal: [6]
steps: steps:
- uses: runs-on/action@v2 - uses: runs-on/action@v1
- uses: actions/create-github-app-token@v2 - uses: actions/create-github-app-token@v1
id: app-token id: app-token
with: with:
app-id: ${{ secrets.MODELING_APP_GH_APP_ID }} app-id: ${{ secrets.MODELING_APP_GH_APP_ID }}
@ -207,8 +207,8 @@ jobs:
- runner=32cpu-linux-x64 - runner=32cpu-linux-x64
- extras=s3-cache - extras=s3-cache
steps: steps:
- uses: runs-on/action@v2 - uses: runs-on/action@v1
- uses: actions/create-github-app-token@v2 - uses: actions/create-github-app-token@v1
id: app-token id: app-token
with: with:
app-id: ${{ secrets.MODELING_APP_GH_APP_ID }} app-id: ${{ secrets.MODELING_APP_GH_APP_ID }}

View File

@ -46,7 +46,7 @@ jobs:
- name: Download Wasm cache - name: Download Wasm cache
id: download-wasm id: download-wasm
if: ${{ github.event_name != 'schedule' && steps.filter.outputs.rust == 'false' }} if: ${{ github.event_name != 'schedule' && steps.filter.outputs.rust == 'false' }}
uses: dawidd6/action-download-artifact@v11 uses: dawidd6/action-download-artifact@v7
continue-on-error: true continue-on-error: true
with: with:
github_token: ${{secrets.GITHUB_TOKEN}} github_token: ${{secrets.GITHUB_TOKEN}}
@ -95,8 +95,7 @@ jobs:
shell: bash shell: bash
run: npm run build:wasm run: npm run build:wasm
- name: Upload compiled wasm artifacts - uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v4
with: with:
name: prepared-wasm name: prepared-wasm
path: | path: |
@ -110,7 +109,7 @@ jobs:
steps: steps:
- uses: actions/create-github-app-token@v2 - uses: actions/create-github-app-token@v1
id: app-token id: app-token
with: with:
app-id: ${{ secrets.MODELING_APP_GH_APP_ID }} app-id: ${{ secrets.MODELING_APP_GH_APP_ID }}
@ -177,8 +176,7 @@ jobs:
CI_SUITE: e2e:snapshots CI_SUITE: e2e:snapshots
TARGET: web TARGET: web
- name: Upload playwright report - uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v4
if: ${{ !cancelled() }} if: ${{ !cancelled() }}
with: with:
name: playwright-report-snapshot-${{ github.sha }} name: playwright-report-snapshot-${{ github.sha }}
@ -230,7 +228,7 @@ jobs:
steps: steps:
- uses: actions/create-github-app-token@v2 - uses: actions/create-github-app-token@v1
id: app-token id: app-token
with: with:
app-id: ${{ secrets.MODELING_APP_GH_APP_ID }} app-id: ${{ secrets.MODELING_APP_GH_APP_ID }}
@ -292,8 +290,7 @@ jobs:
CI_SUITE: e2e:web CI_SUITE: e2e:web
TARGET: web TARGET: web
- name: Upload playwright report - uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v4
if: ${{ !cancelled() && (success() || failure()) }} if: ${{ !cancelled() && (success() || failure()) }}
with: with:
name: playwright-report-web-${{ env.OS_NAME }}-${{ matrix.shardIndex }}-${{ github.sha }} name: playwright-report-web-${{ env.OS_NAME }}-${{ matrix.shardIndex }}-${{ github.sha }}
@ -418,8 +415,7 @@ jobs:
CI_SUITE: e2e:desktop CI_SUITE: e2e:desktop
TARGET: desktop TARGET: desktop
- name: Upload test report - uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v4
if: always() if: always()
with: with:
name: test-results-desktop-${{ env.OS_NAME }}-${{ matrix.shardIndex }}-${{ github.sha }} name: test-results-desktop-${{ env.OS_NAME }}-${{ matrix.shardIndex }}-${{ github.sha }}
@ -428,8 +424,7 @@ jobs:
retention-days: 30 retention-days: 30
overwrite: true overwrite: true
- name: Upload playwright report - uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v4
if: always() if: always()
with: with:
name: playwright-report-desktop-${{ env.OS_NAME }}-${{ matrix.shardIndex }}-${{ github.sha }} name: playwright-report-desktop-${{ env.OS_NAME }}-${{ matrix.shardIndex }}-${{ github.sha }}

View File

@ -20,7 +20,7 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- uses: actions/create-github-app-token@v2 - uses: actions/create-github-app-token@v1
id: app-token id: app-token
with: with:
# required # required

View File

@ -328,7 +328,7 @@ jobs:
mkdir -p releases/language-server/${{ env.TAG }} mkdir -p releases/language-server/${{ env.TAG }}
cp -r build/* releases/language-server/${{ env.TAG }} cp -r build/* releases/language-server/${{ env.TAG }}
- name: "Authenticate to Google Cloud" - name: "Authenticate to Google Cloud"
uses: "google-github-actions/auth@v2.1.10" uses: "google-github-actions/auth@v2.1.8"
with: with:
credentials_json: "${{ secrets.GOOGLE_CLOUD_DL_SA }}" credentials_json: "${{ secrets.GOOGLE_CLOUD_DL_SA }}"
- name: Set up Cloud SDK - name: Set up Cloud SDK

View File

@ -113,7 +113,7 @@ jobs:
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- name: Install uv - name: Install uv
uses: astral-sh/setup-uv@v6 uses: astral-sh/setup-uv@v5
- uses: actions-rust-lang/setup-rust-toolchain@v1 - uses: actions-rust-lang/setup-rust-toolchain@v1
- uses: taiki-e/install-action@just - uses: taiki-e/install-action@just
- name: Run tests - name: Run tests
@ -130,7 +130,7 @@ jobs:
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- name: Install the latest version of uv - name: Install the latest version of uv
uses: astral-sh/setup-uv@v6 uses: astral-sh/setup-uv@v5
- name: Install codespell - name: Install codespell
run: | run: |
uv venv .venv uv venv .venv
@ -161,7 +161,7 @@ jobs:
with: with:
path: rust/kcl-python-bindings path: rust/kcl-python-bindings
- name: Install the latest version of uv - name: Install the latest version of uv
uses: astral-sh/setup-uv@v6 uses: astral-sh/setup-uv@v5
- name: do uv things - name: do uv things
run: | run: |
cd rust/kcl-python-bindings cd rust/kcl-python-bindings

View File

@ -1,3 +0,0 @@
[toolchain]
channel = "nightly"
components = ["rustfmt"]

View File

@ -108,7 +108,7 @@ jobs:
run: npm run files:set-notes run: npm run files:set-notes
- name: Authenticate to Google Cloud - name: Authenticate to Google Cloud
uses: 'google-github-actions/auth@v2.1.10' uses: 'google-github-actions/auth@v2.1.8'
with: with:
credentials_json: '${{ secrets.GOOGLE_CLOUD_DL_SA }}' credentials_json: '${{ secrets.GOOGLE_CLOUD_DL_SA }}'

View File

@ -120,36 +120,6 @@ jobs:
- run: npm run circular-deps:diff - run: npm run circular-deps:diff
npm-url-checker:
runs-on: ubuntu-latest
needs: npm-build-wasm
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'npm'
- run: npm install
- name: Download all artifacts
uses: actions/download-artifact@v4
- name: Copy prepared wasm
run: |
ls -R prepared-wasm
cp prepared-wasm/kcl_wasm_lib_bg.wasm public
mkdir rust/kcl-wasm-lib/pkg
cp prepared-wasm/kcl_wasm_lib* rust/kcl-wasm-lib/pkg
- name: Copy prepared ts-rs bindings
run: |
ls -R prepared-ts-rs-bindings
mkdir rust/kcl-lib/bindings
cp -r prepared-ts-rs-bindings/* rust/kcl-lib/bindings/
- run: npm run url-checker:diff
python-codespell: python-codespell:
runs-on: ubuntu-22.04 runs-on: ubuntu-22.04
steps: steps:

View File

@ -235,47 +235,6 @@ To display logging (to the terminal or console) set `ZOO_LOG=1`. This will log s
To enable memory metrics, build with `--features dhat-heap`. To enable memory metrics, build with `--features dhat-heap`.
## Running scripts
There are multiple scripts under the folder path `./scripts` which can be used in various settings.
### Pattern for a static file, npm run commands, and CI-CD checks
If you want to implement a static checker follow this pattern. Two static checkers we have are circular dependency checks in our typescript code and url checker to see if any hard coded URL is the typescript application 404s. We have a set of known files in `./scripts/known/*.txt` which is the baseline.
If you improve the baseline, run the overwrite command and commit the new smaller baseline. Try not to make the baseline bigger, the CI CD will complain.
These baselines are to hold us to higher standards and help implement automated testing against the repository
#### Output result to stdout
- `npm run circular-deps`
- `npm run url-checker`
- create a `<name>.sh` file that will run the static checker then output the result to `stdout`
#### Overwrite result to known .txt file on disk
If the application needs to overwrite the known file on disk use this pattern. This known .txt file will be source controlled as the baseline
- `npm run circular-deps:overwrite`
- `npm run url-checker:overwrite`
#### Diff baseline and current
These commands will write a /tmp/ file on disk and compare it to the known file in the repository. This command will also be used in the CI CD pipeline for automated checks
- create a `diff-<name>.sh` file that is the script to diff your tmp file to the baseline
e.g. `diff-url-checker.sh`
```bash
#!/bin/bash
set -euo pipefail
npm run url-checker > /tmp/urls.txt
diff --ignore-blank-lines -w /tmp/urls.txt ./scripts/known/urls.txt
```
- `npm run circular-deps:diff`
- `npm run url-checker:diff`
## Proposing changes ## Proposing changes
Before you submit a contribution PR to this repo, please ensure that: Before you submit a contribution PR to this repo, please ensure that:
@ -321,9 +280,6 @@ Assign someone to each section of the manual checklist generated by the issue te
Follow the instructions [here](./rust/README.md) to publish new crates. Follow the instructions [here](./rust/README.md) to publish new crates.
This ensures that the KCL accepted by the app is also accepted by the CLI. This ensures that the KCL accepted by the app is also accepted by the CLI.
If there are documentation changes, merge the corresponding Dependabot PRs [here](https://github.com/KittyCAD/website/pulls/app%2Fdependabot) for the website.
You can trigger Dependabot to check for updates [here](https://github.com/KittyCAD/website/network/updates/17261214/jobs).
#### 5. Publish the release #### 5. Publish the release
Head over to https://github.com/KittyCAD/modeling-app/releases/new, pick the newly created tag and type it in the **Release title** field as well. Head over to https://github.com/KittyCAD/modeling-app/releases/new, pick the newly created tag and type it in the **Release title** field as well.

View File

@ -62,10 +62,7 @@ else
endif endif
public/kcl-samples/manifest.json: $(KCL_SOURCES) public/kcl-samples/manifest.json: $(KCL_SOURCES)
ifndef WINDOWS
cd rust/kcl-lib && EXPECTORATE=overwrite cargo test generate_manifest cd rust/kcl-lib && EXPECTORATE=overwrite cargo test generate_manifest
@ touch $@
endif
.vite/build/main.js: $(REACT_SOURCES) $(TYPESCRIPT_SOURCES) $(VITE_SOURCES) .vite/build/main.js: $(REACT_SOURCES) $(TYPESCRIPT_SOURCES) $(VITE_SOURCES)
npm run tronb:vite:dev npm run tronb:vite:dev

View File

@ -83,13 +83,6 @@ Allow orbiting in sketch mode.
Whether to show the debug panel, which lets you see various states of the app to aid in development. Whether to show the debug panel, which lets you see various states of the app to aid in development.
**Default:** None
##### fixed_size_grid
If true, the grid cells will be fixed-size, where the width is your default length unit. If false, the grid will get larger as you zoom out, and smaller as you zoom in.
**Default:** None **Default:** None

View File

@ -44,7 +44,7 @@ detail on importing geometry.
Tags are used to give a name (tag) to a specific path. Tags are used to give a name (tag) to a specific path.
### Tag declarations - `TagDecl` ### `TagDeclarator`
The syntax for declaring a tag is `$myTag` you would use it in the following The syntax for declaring a tag is `$myTag` you would use it in the following
way: way:
@ -67,28 +67,24 @@ startSketchOn(XZ)
|> close() |> close()
``` ```
When a function requires declaring a new tag (using the `$` syntax), the argument has type [`TagDecl`](/docs/kcl-std/types/std-types-TagDecl). ### `TagIdentifier`
### Tag identifiers As per the example above you can use the tag identifier to get a reference to the
tagged object. The syntax for this is `myTag`.
A tag created using a tag declarator can be used by writing its name without the `$`, e.g., `myTag`. In the example above we use the tag identifier to get the angle of the segment
Where necessary to disambiguate from tag declarations, we call these tag identifiers. `segAng(rectangleSegmentA001)`.
In the example above we use the tag identifier `rectangleSegmentA001` to get the angle of the segment ### `Start`
using `segAng(rectangleSegmentA001)`.
Tags can identify either an edge or face of a solid, or a line or other edge of a sketch. Functions There is a special tag, `START` (with type `Start`, although under the cover, it's a string)
which take a tag identifier as an argument will use either [`TaggedEdge`](/docs/kcl-std/types/std-types-TaggedEdge) (for the edge of a for identifying the face of a solid which was the start of an extrusion (i.e., the surface which
solid or sketch) or [`TaggedFace`](/docs/kcl-std/types/std-types-TaggedFace). is extruded).
If a line in a sketch is tagged and then the sketch is extruded, the tag is a `TaggedEdge` before ### `End`
extrusion and a `TaggedFace` after extrusion.
#### `START` and `END`
[`START`](/docs/kcl-std/consts/std-START) and [`END`](/docs/kcl-std/consts/std-END) are special tags
for identifying the starting and ending faces of an extruded solid.
There is a special tag, `END` (with type `End`, although under the cover, it's a string)
for identifying the face of a solid which was finishes an extrusion.
### Tag Scope ### Tag Scope

View File

@ -8,13 +8,9 @@ layout: manual
Identifies the ending face of an extrusion. I.e., the new face created by an extrusion. Identifies the ending face of an extrusion. I.e., the new face created by an extrusion.
```kcl ```kcl
END: TaggedFace END: string = 'end'
``` ```
### Type
[`TaggedFace`](/docs/kcl-std/types/std-types-TaggedFace) - A tag which references a face of a solid, including the distinguished tags `START` and `END`.

View File

@ -8,13 +8,9 @@ layout: manual
Identifies the starting face of an extrusion. I.e., the face which is extruded. Identifies the starting face of an extrusion. I.e., the face which is extruded.
```kcl ```kcl
START: TaggedFace START: string = 'start'
``` ```
### Type
[`TaggedFace`](/docs/kcl-std/types/std-types-TaggedFace) - A tag which references a face of a solid, including the distinguished tags `START` and `END`.

View File

@ -8,13 +8,9 @@ layout: manual
The X-axis (can be used in both 2d and 3d contexts). The X-axis (can be used in both 2d and 3d contexts).
```kcl ```kcl
X: Axis3d X
``` ```
### Type
[`Axis3d`](/docs/kcl-std/types/std-types-Axis3d) - An abstract and infinite line in 3d space.

View File

@ -8,13 +8,9 @@ layout: manual
An abstract 3d plane aligned with the X and Y axes. Its normal is the positive Z axis. An abstract 3d plane aligned with the X and Y axes. Its normal is the positive Z axis.
```kcl ```kcl
XY: Plane XY
``` ```
### Type
[`Plane`](/docs/kcl-std/types/std-types-Plane) - An abstract plane.

View File

@ -8,13 +8,9 @@ layout: manual
An abstract 3d plane aligned with the X and Z axes. Its normal is the negative Y axis. An abstract 3d plane aligned with the X and Z axes. Its normal is the negative Y axis.
```kcl ```kcl
XZ: Plane XZ
``` ```
### Type
[`Plane`](/docs/kcl-std/types/std-types-Plane) - An abstract plane.

View File

@ -8,13 +8,9 @@ layout: manual
The Y-axis (can be used in both 2d and 3d contexts). The Y-axis (can be used in both 2d and 3d contexts).
```kcl ```kcl
Y: Axis3d Y
``` ```
### Type
[`Axis3d`](/docs/kcl-std/types/std-types-Axis3d) - An abstract and infinite line in 3d space.

View File

@ -8,13 +8,9 @@ layout: manual
An abstract 3d plane aligned with the Y and Z axes. Its normal is the positive X axis. An abstract 3d plane aligned with the Y and Z axes. Its normal is the positive X axis.
```kcl ```kcl
YZ: Plane YZ
``` ```
### Type
[`Plane`](/docs/kcl-std/types/std-types-Plane) - An abstract plane.

View File

@ -8,13 +8,9 @@ layout: manual
The 3D Z-axis. The 3D Z-axis.
```kcl ```kcl
Z: Axis3d Z
``` ```
### Type
[`Axis3d`](/docs/kcl-std/types/std-types-Axis3d) - An abstract and infinite line in 3d space.

View File

@ -13,10 +13,6 @@ E: number = 2.71828182845904523536028747135266250_
### Type
[`number`](/docs/kcl-std/types/std-types-number) - A number.
### Examples ### Examples
```kcl ```kcl

View File

@ -11,7 +11,7 @@ The value of `pi`, Archimedes constant (π).
PI: number(_?) = 3.14159265358979323846264338327950288_? PI: number(_?) = 3.14159265358979323846264338327950288_?
``` ```
`PI` is a number and is technically a ratio, so you might expect it to have type [`number(_)`](/docs/kcl-std/types/std-types-number). `PI` is a number and is technically a ratio, so you might expect it to have type `number(_)`.
However, `PI` is nearly always used for converting between different units - usually degrees to or However, `PI` is nearly always used for converting between different units - usually degrees to or
from radians. Therefore, `PI` is treated a bit specially by KCL and always has unknown units. This from radians. Therefore, `PI` is treated a bit specially by KCL and always has unknown units. This
means that if you use `PI`, you will need to give KCL some extra information about the units of numbers. means that if you use `PI`, you will need to give KCL some extra information about the units of numbers.
@ -19,10 +19,6 @@ Usually you should use type ascription on the result of calculations, e.g., `(2
It is better to use `units::toRadians` or `units::toDegrees` to convert between angles with It is better to use `units::toRadians` or `units::toDegrees` to convert between angles with
different units where possible. different units where possible.
### Type
[`number(_?)`](/docs/kcl-std/types/std-types-number) - A number.
### Examples ### Examples
```kcl ```kcl

View File

@ -13,10 +13,6 @@ TAU: number = 6.28318530717958647692528676655900577_
### Type
[`number`](/docs/kcl-std/types/std-types-number) - A number.
### Examples ### Examples
```kcl ```kcl

View File

@ -13,8 +13,4 @@ sweep::SKETCH_PLANE: string = 'sketchPlane'
### Type
[`string`](/docs/kcl-std/types/std-types-string) - A sequence of characters

View File

@ -13,8 +13,4 @@ sweep::TRAJECTORY: string = 'trajectoryCurve'
### Type
[`string`](/docs/kcl-std/types/std-types-string) - A sequence of characters

View File

@ -13,8 +13,4 @@ turns::HALF_TURN: number(deg) = 180deg
### Type
[`number(deg)`](/docs/kcl-std/types/std-types-number) - A number.

View File

@ -13,8 +13,4 @@ turns::QUARTER_TURN: number(deg) = 90deg
### Type
[`number(deg)`](/docs/kcl-std/types/std-types-number) - A number.

View File

@ -13,8 +13,4 @@ turns::THREE_QUARTER_TURN: number(deg) = 270deg
### Type
[`number(deg)`](/docs/kcl-std/types/std-types-number) - A number.

View File

@ -8,13 +8,9 @@ layout: manual
No turn, zero degrees/radians. No turn, zero degrees/radians.
```kcl ```kcl
turns::ZERO: number(Angle) turns::ZERO
``` ```
### Type
[`number(Angle)`](/docs/kcl-std/types/std-types-number) - A number.

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -16,7 +16,7 @@ angledLine(
lengthY?: number(Length), lengthY?: number(Length),
endAbsoluteX?: number(Length), endAbsoluteX?: number(Length),
endAbsoluteY?: number(Length), endAbsoluteY?: number(Length),
tag?: TagDecl, tag?: tag,
): Sketch ): Sketch
``` ```
@ -33,7 +33,7 @@ angledLine(
| `lengthY` | [`number(Length)`](/docs/kcl-std/types/std-types-number) | Draw the line this distance along the Y axis. Only one of `length`, `lengthX`, `lengthY`, `endAbsoluteX`, `endAbsoluteY` can be given. | No | | `lengthY` | [`number(Length)`](/docs/kcl-std/types/std-types-number) | Draw the line this distance along the Y axis. Only one of `length`, `lengthX`, `lengthY`, `endAbsoluteX`, `endAbsoluteY` can be given. | No |
| `endAbsoluteX` | [`number(Length)`](/docs/kcl-std/types/std-types-number) | Draw the line along the given angle until it reaches this point along the X axis. Only one of `length`, `lengthX`, `lengthY`, `endAbsoluteX`, `endAbsoluteY` can be given. | No | | `endAbsoluteX` | [`number(Length)`](/docs/kcl-std/types/std-types-number) | Draw the line along the given angle until it reaches this point along the X axis. Only one of `length`, `lengthX`, `lengthY`, `endAbsoluteX`, `endAbsoluteY` can be given. | No |
| `endAbsoluteY` | [`number(Length)`](/docs/kcl-std/types/std-types-number) | Draw the line along the given angle until it reaches this point along the Y axis. Only one of `length`, `lengthX`, `lengthY`, `endAbsoluteX`, `endAbsoluteY` can be given. | No | | `endAbsoluteY` | [`number(Length)`](/docs/kcl-std/types/std-types-number) | Draw the line along the given angle until it reaches this point along the Y axis. Only one of `length`, `lengthX`, `lengthY`, `endAbsoluteX`, `endAbsoluteY` can be given. | No |
| `tag` | [`TagDecl`](/docs/kcl-std/types/std-types-TagDecl) | Create a new tag which refers to this line. | 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 line. | No |
### Returns ### Returns

View File

@ -11,9 +11,9 @@ Draw an angled line from the current origin, constructing a line segment such th
angledLineThatIntersects( angledLineThatIntersects(
@sketch: Sketch, @sketch: Sketch,
angle: number(Angle), angle: number(Angle),
intersectTag: TaggedEdge, intersectTag: tag,
offset?: number(Length), offset?: number(Length),
tag?: TagDecl, tag?: tag,
): Sketch ): Sketch
``` ```
@ -25,9 +25,9 @@ angledLineThatIntersects(
|----------|------|-------------|----------| |----------|------|-------------|----------|
| `sketch` | [`Sketch`](/docs/kcl-std/types/std-types-Sketch) | Which sketch should this path be added to? | Yes | | `sketch` | [`Sketch`](/docs/kcl-std/types/std-types-Sketch) | Which sketch should this path be added to? | Yes |
| `angle` | [`number(Angle)`](/docs/kcl-std/types/std-types-number) | Which angle should the line be drawn at? | Yes | | `angle` | [`number(Angle)`](/docs/kcl-std/types/std-types-number) | Which angle should the line be drawn at? | Yes |
| `intersectTag` | [`TaggedEdge`](/docs/kcl-std/types/std-types-TaggedEdge) | The tag of the line to intersect with. | Yes | | `intersectTag` | [`tag`](/docs/kcl-std/types/std-types-tag) | The tag of the line to intersect with. | Yes |
| `offset` | [`number(Length)`](/docs/kcl-std/types/std-types-number) | The offset from the intersecting line. | No | | `offset` | [`number(Length)`](/docs/kcl-std/types/std-types-number) | The offset from the intersecting line. | No |
| `tag` | [`TagDecl`](/docs/kcl-std/types/std-types-TagDecl) | Create a new tag which refers to this line. | 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 line. | No |
### Returns ### Returns

View File

@ -16,7 +16,7 @@ arc(
diameter?: number(Length), diameter?: number(Length),
interiorAbsolute?: Point2d, interiorAbsolute?: Point2d,
endAbsolute?: Point2d, endAbsolute?: Point2d,
tag?: TagDecl, tag?: tag,
): Sketch ): Sketch
``` ```
@ -40,7 +40,7 @@ for to construct your shape, you're likely looking for tangentialArc.
| `diameter` | [`number(Length)`](/docs/kcl-std/types/std-types-number) | How large should the circle be? Incompatible with `radius`. | No | | `diameter` | [`number(Length)`](/docs/kcl-std/types/std-types-number) | How large should the circle be? Incompatible with `radius`. | No |
| `interiorAbsolute` | [`Point2d`](/docs/kcl-std/types/std-types-Point2d) | Any point between the arc's start and end? Requires `endAbsolute`. Incompatible with `angleStart` or `angleEnd`. | No | | `interiorAbsolute` | [`Point2d`](/docs/kcl-std/types/std-types-Point2d) | Any point between the arc's start and end? Requires `endAbsolute`. Incompatible with `angleStart` or `angleEnd`. | No |
| `endAbsolute` | [`Point2d`](/docs/kcl-std/types/std-types-Point2d) | Where should this arc end? Requires `interiorAbsolute`. Incompatible with `angleStart` or `angleEnd`. | No | | `endAbsolute` | [`Point2d`](/docs/kcl-std/types/std-types-Point2d) | Where should this arc end? Requires `interiorAbsolute`. Incompatible with `angleStart` or `angleEnd`. | No |
| `tag` | [`TagDecl`](/docs/kcl-std/types/std-types-TagDecl) | Create a new tag which refers to this arc. | 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 arc. | No |
### Returns ### Returns

File diff suppressed because one or more lines are too long

View File

@ -13,7 +13,7 @@ circle(
center: Point2d, center: Point2d,
radius?: number(Length), radius?: number(Length),
diameter?: number(Length), diameter?: number(Length),
tag?: TagDecl, tag?: tag,
): Sketch ): Sketch
``` ```
@ -27,7 +27,7 @@ circle(
| `center` | [`Point2d`](/docs/kcl-std/types/std-types-Point2d) | The center of the circle. | Yes | | `center` | [`Point2d`](/docs/kcl-std/types/std-types-Point2d) | The center of the circle. | Yes |
| `radius` | [`number(Length)`](/docs/kcl-std/types/std-types-number) | The radius of the circle. Incompatible with `diameter`. | No | | `radius` | [`number(Length)`](/docs/kcl-std/types/std-types-number) | The radius of the circle. Incompatible with `diameter`. | No |
| `diameter` | [`number(Length)`](/docs/kcl-std/types/std-types-number) | The diameter of the circle. Incompatible with `radius`. | No | | `diameter` | [`number(Length)`](/docs/kcl-std/types/std-types-number) | The diameter of the circle. Incompatible with `radius`. | No |
| `tag` | [`TagDecl`](/docs/kcl-std/types/std-types-TagDecl) | Create a new tag which refers to this circle. | No | | [`tag`](/docs/kcl-std/types/std-types-tag) | [`tag`](/docs/kcl-std/types/std-types-tag) | Create a new tag which refers to this circle. | No |
### Returns ### Returns

View File

@ -13,7 +13,7 @@ circleThreePoint(
p1: Point2d, p1: Point2d,
p2: Point2d, p2: Point2d,
p3: Point2d, p3: Point2d,
tag?: TagDecl, tag?: tag,
): Sketch ): Sketch
``` ```
@ -27,7 +27,7 @@ circleThreePoint(
| `p1` | [`Point2d`](/docs/kcl-std/types/std-types-Point2d) | 1st point to derive the circle. | Yes | | `p1` | [`Point2d`](/docs/kcl-std/types/std-types-Point2d) | 1st point to derive the circle. | Yes |
| `p2` | [`Point2d`](/docs/kcl-std/types/std-types-Point2d) | 2nd point to derive the circle. | Yes | | `p2` | [`Point2d`](/docs/kcl-std/types/std-types-Point2d) | 2nd point to derive the circle. | Yes |
| `p3` | [`Point2d`](/docs/kcl-std/types/std-types-Point2d) | 3rd point to derive the circle. | Yes | | `p3` | [`Point2d`](/docs/kcl-std/types/std-types-Point2d) | 3rd point to derive the circle. | Yes |
| `tag` | [`TagDecl`](/docs/kcl-std/types/std-types-TagDecl) | Identifier for the circle to reference elsewhere. | No | | [`tag`](/docs/kcl-std/types/std-types-tag) | [`tag`](/docs/kcl-std/types/std-types-tag) | Identifier for the circle to reference elsewhere. | No |
### Returns ### Returns

View File

@ -10,7 +10,7 @@ Construct a line segment from the current origin back to the profile's origin, e
```kcl ```kcl
close( close(
@sketch: Sketch, @sketch: Sketch,
tag?: TagDecl, tag?: tag,
): Sketch ): Sketch
``` ```
@ -24,7 +24,7 @@ starting point.
| Name | Type | Description | Required | | Name | Type | Description | Required |
|----------|------|-------------|----------| |----------|------|-------------|----------|
| `sketch` | [`Sketch`](/docs/kcl-std/types/std-types-Sketch) | The sketch you want to close. | Yes | | `sketch` | [`Sketch`](/docs/kcl-std/types/std-types-Sketch) | The sketch you want to close. | Yes |
| `tag` | [`TagDecl`](/docs/kcl-std/types/std-types-TagDecl) | Create a new tag which refers to this line. | 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 line. | No |
### Returns ### Returns

File diff suppressed because one or more lines are too long

View File

@ -8,7 +8,7 @@ layout: manual
Get the shared edge between two faces. Get the shared edge between two faces.
```kcl ```kcl
getCommonEdge(faces: [TaggedFace; 2]): Edge getCommonEdge(faces: [tag; 2]): Edge
``` ```
@ -17,7 +17,7 @@ getCommonEdge(faces: [TaggedFace; 2]): Edge
| Name | Type | Description | Required | | Name | Type | Description | Required |
|----------|------|-------------|----------| |----------|------|-------------|----------|
| `faces` | `[TaggedFace; 2]` | The tags of the faces you want to find the common edge between. | Yes | | `faces` | `[tag; 2]` | The tags of the faces you want to find the common edge between. | Yes |
### Returns ### Returns

View File

@ -8,7 +8,7 @@ layout: manual
Get the next adjacent edge to the edge given. Get the next adjacent edge to the edge given.
```kcl ```kcl
getNextAdjacentEdge(@edge: TaggedEdge): Edge getNextAdjacentEdge(@edge: tag): Edge
``` ```
@ -17,7 +17,7 @@ getNextAdjacentEdge(@edge: TaggedEdge): Edge
| Name | Type | Description | Required | | Name | Type | Description | Required |
|----------|------|-------------|----------| |----------|------|-------------|----------|
| `edge` | [`TaggedEdge`](/docs/kcl-std/types/std-types-TaggedEdge) | The tag of the edge you want to find the next adjacent edge of. | Yes | | `edge` | [`tag`](/docs/kcl-std/types/std-types-tag) | The tag of the edge you want to find the next adjacent edge of. | Yes |
### Returns ### Returns

View File

@ -8,7 +8,7 @@ layout: manual
Get the opposite edge to the edge given. Get the opposite edge to the edge given.
```kcl ```kcl
getOppositeEdge(@edge: TaggedEdge): Edge getOppositeEdge(@edge: tag): Edge
``` ```
@ -17,7 +17,7 @@ getOppositeEdge(@edge: TaggedEdge): Edge
| Name | Type | Description | Required | | Name | Type | Description | Required |
|----------|------|-------------|----------| |----------|------|-------------|----------|
| `edge` | [`TaggedEdge`](/docs/kcl-std/types/std-types-TaggedEdge) | The tag of the edge you want to find the opposite edge of. | Yes | | `edge` | [`tag`](/docs/kcl-std/types/std-types-tag) | The tag of the edge you want to find the opposite edge of. | Yes |
### Returns ### Returns

View File

@ -8,7 +8,7 @@ layout: manual
Get the previous adjacent edge to the edge given. Get the previous adjacent edge to the edge given.
```kcl ```kcl
getPreviousAdjacentEdge(@edge: TaggedEdge): Edge getPreviousAdjacentEdge(@edge: tag): Edge
``` ```
@ -17,7 +17,7 @@ getPreviousAdjacentEdge(@edge: TaggedEdge): Edge
| Name | Type | Description | Required | | Name | Type | Description | Required |
|----------|------|-------------|----------| |----------|------|-------------|----------|
| `edge` | [`TaggedEdge`](/docs/kcl-std/types/std-types-TaggedEdge) | The tag of the edge you want to find the previous adjacent edge of. | Yes | | `edge` | [`tag`](/docs/kcl-std/types/std-types-tag) | The tag of the edge you want to find the previous adjacent edge of. | Yes |
### Returns ### Returns

View File

@ -10,13 +10,11 @@ Extend the current sketch with a new involute circular curve.
```kcl ```kcl
involuteCircular( involuteCircular(
@sketch: Sketch, @sketch: Sketch,
startRadius: number(Length),
endRadius: number(Length),
angle: number(Angle), angle: number(Angle),
startRadius?: number(Length),
endRadius?: number(Length),
startDiameter?: number(Length),
endDiameter?: number(Length),
reverse?: bool, reverse?: bool,
tag?: TagDecl, tag?: tag,
): Sketch ): Sketch
``` ```
@ -27,13 +25,11 @@ involuteCircular(
| Name | Type | Description | Required | | Name | Type | Description | Required |
|----------|------|-------------|----------| |----------|------|-------------|----------|
| `sketch` | [`Sketch`](/docs/kcl-std/types/std-types-Sketch) | Which sketch should this path be added to? | Yes | | `sketch` | [`Sketch`](/docs/kcl-std/types/std-types-Sketch) | Which sketch should this path be added to? | Yes |
| `startRadius` | [`number(Length)`](/docs/kcl-std/types/std-types-number) | The involute is described between two circles, start_radius is the radius of the inner circle. | Yes |
| `endRadius` | [`number(Length)`](/docs/kcl-std/types/std-types-number) | The involute is described between two circles, end_radius is the radius of the outer circle. | Yes |
| `angle` | [`number(Angle)`](/docs/kcl-std/types/std-types-number) | The angle to rotate the involute by. A value of zero will produce a curve with a tangent along the x-axis at the start point of the curve. | Yes | | `angle` | [`number(Angle)`](/docs/kcl-std/types/std-types-number) | The angle to rotate the involute by. A value of zero will produce a curve with a tangent along the x-axis at the start point of the curve. | Yes |
| `startRadius` | [`number(Length)`](/docs/kcl-std/types/std-types-number) | The involute is described between two circles, startRadius is the radius of the inner circle. Either `startRadius` or `startDiameter` must be given (but not both). | No |
| `endRadius` | [`number(Length)`](/docs/kcl-std/types/std-types-number) | The involute is described between two circles, endRadius is the radius of the outer circle. Either `endRadius` or `endDiameter` must be given (but not both). | No |
| `startDiameter` | [`number(Length)`](/docs/kcl-std/types/std-types-number) | The involute is described between two circles, startDiameter describes the inner circle. Either `startRadius` or `startDiameter` must be given (but not both). | No |
| `endDiameter` | [`number(Length)`](/docs/kcl-std/types/std-types-number) | The involute is described between two circles, endDiameter describes the outer circle. Either `endRadius` or `endDiameter` must be given (but not both). | No |
| `reverse` | [`bool`](/docs/kcl-std/types/std-types-bool) | If reverse is true, the segment will start from the end of the involute, otherwise it will start from that start. | No | | `reverse` | [`bool`](/docs/kcl-std/types/std-types-bool) | If reverse is true, the segment will start from the end of the involute, otherwise it will start from that start. | No |
| `tag` | [`TagDecl`](/docs/kcl-std/types/std-types-TagDecl) | Create a new tag which refers to this line. | 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 line. | No |
### Returns ### Returns

View File

@ -12,7 +12,7 @@ line(
@sketch: Sketch, @sketch: Sketch,
endAbsolute?: Point2d, endAbsolute?: Point2d,
end?: Point2d, end?: Point2d,
tag?: TagDecl, tag?: tag,
): Sketch ): Sketch
``` ```
@ -25,7 +25,7 @@ line(
| `sketch` | [`Sketch`](/docs/kcl-std/types/std-types-Sketch) | Which sketch should this path be added to? | Yes | | `sketch` | [`Sketch`](/docs/kcl-std/types/std-types-Sketch) | Which sketch should this path be added to? | Yes |
| `endAbsolute` | [`Point2d`](/docs/kcl-std/types/std-types-Point2d) | Which absolute point should this line go to? Incompatible with `end`. | No | | `endAbsolute` | [`Point2d`](/docs/kcl-std/types/std-types-Point2d) | Which absolute point should this line go to? Incompatible with `end`. | No |
| `end` | [`Point2d`](/docs/kcl-std/types/std-types-Point2d) | How far away (along the X and Y axes) should this line go? Incompatible with `endAbsolute`. | No | | `end` | [`Point2d`](/docs/kcl-std/types/std-types-Point2d) | How far away (along the X and Y axes) should this line go? Incompatible with `endAbsolute`. | No |
| `tag` | [`TagDecl`](/docs/kcl-std/types/std-types-TagDecl) | Create a new tag which refers to this line. | 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 line. | No |
### Returns ### Returns

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -15,8 +15,8 @@ revolve(
tolerance?: number(Length), tolerance?: number(Length),
symmetric?: bool, symmetric?: bool,
bidirectionalAngle?: number(Angle), bidirectionalAngle?: number(Angle),
tagStart?: TagDecl, tagStart?: tag,
tagEnd?: TagDecl, tagEnd?: tag,
): [Solid; 1+] ): [Solid; 1+]
``` ```
@ -38,11 +38,11 @@ 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 | | `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 | | `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)`](/docs/kcl-std/types/std-types-number) | Angle to revolve (in degrees). Default is 360. | 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) | Defines the smallest distance below which two entities are considered coincident, intersecting, coplanar, or similar. For most use cases, it should not be changed from its default value of 10^-7 millimeters. | 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 | | `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)`](/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 | | `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` | [`TagDecl`](/docs/kcl-std/types/std-types-TagDecl) | A named tag for the face at the start of the revolve, i.e. the original sketch. | No | | `tagStart` | [`tag`](/docs/kcl-std/types/std-types-tag) | A named tag for the face at the start of the revolve, i.e. the original sketch. | No |
| `tagEnd` | [`TagDecl`](/docs/kcl-std/types/std-types-TagDecl) | A named tag for the face at the end of the revolve. | No | | `tagEnd` | [`tag`](/docs/kcl-std/types/std-types-tag) | A named tag for the face at the end of the revolve. | No |
### Returns ### Returns

View File

@ -8,7 +8,7 @@ layout: manual
Compute the angle (in degrees) of the provided line segment. Compute the angle (in degrees) of the provided line segment.
```kcl ```kcl
segAng(@tag: TaggedEdge): number(Angle) segAng(@tag: tag): number(Angle)
``` ```
@ -17,7 +17,7 @@ segAng(@tag: TaggedEdge): number(Angle)
| Name | Type | Description | Required | | Name | Type | Description | Required |
|----------|------|-------------|----------| |----------|------|-------------|----------|
| `tag` | [`TaggedEdge`](/docs/kcl-std/types/std-types-TaggedEdge) | The line segment being queried by its tag. | Yes | | [`tag`](/docs/kcl-std/types/std-types-tag) | [`tag`](/docs/kcl-std/types/std-types-tag) | The line segment being queried by its tag. | Yes |
### Returns ### Returns

View File

@ -8,7 +8,7 @@ layout: manual
Compute the ending point of the provided line segment. Compute the ending point of the provided line segment.
```kcl ```kcl
segEnd(@tag: TaggedEdge): Point2d segEnd(@tag: tag): Point2d
``` ```
@ -17,7 +17,7 @@ segEnd(@tag: TaggedEdge): Point2d
| Name | Type | Description | Required | | Name | Type | Description | Required |
|----------|------|-------------|----------| |----------|------|-------------|----------|
| `tag` | [`TaggedEdge`](/docs/kcl-std/types/std-types-TaggedEdge) | The line segment being queried by its tag. | Yes | | [`tag`](/docs/kcl-std/types/std-types-tag) | [`tag`](/docs/kcl-std/types/std-types-tag) | The line segment being queried by its tag. | Yes |
### Returns ### Returns

View File

@ -8,7 +8,7 @@ layout: manual
Compute the ending point of the provided line segment along the 'x' axis. Compute the ending point of the provided line segment along the 'x' axis.
```kcl ```kcl
segEndX(@tag: TaggedEdge): number(Length) segEndX(@tag: tag): number(Length)
``` ```
@ -17,7 +17,7 @@ segEndX(@tag: TaggedEdge): number(Length)
| Name | Type | Description | Required | | Name | Type | Description | Required |
|----------|------|-------------|----------| |----------|------|-------------|----------|
| `tag` | [`TaggedEdge`](/docs/kcl-std/types/std-types-TaggedEdge) | The line segment being queried by its tag. | Yes | | [`tag`](/docs/kcl-std/types/std-types-tag) | [`tag`](/docs/kcl-std/types/std-types-tag) | The line segment being queried by its tag. | Yes |
### Returns ### Returns

View File

@ -8,7 +8,7 @@ layout: manual
Compute the ending point of the provided line segment along the 'y' axis. Compute the ending point of the provided line segment along the 'y' axis.
```kcl ```kcl
segEndY(@tag: TaggedEdge): number(Length) segEndY(@tag: tag): number(Length)
``` ```
@ -17,7 +17,7 @@ segEndY(@tag: TaggedEdge): number(Length)
| Name | Type | Description | Required | | Name | Type | Description | Required |
|----------|------|-------------|----------| |----------|------|-------------|----------|
| `tag` | [`TaggedEdge`](/docs/kcl-std/types/std-types-TaggedEdge) | The line segment being queried by its tag. | Yes | | [`tag`](/docs/kcl-std/types/std-types-tag) | [`tag`](/docs/kcl-std/types/std-types-tag) | The line segment being queried by its tag. | Yes |
### Returns ### Returns

View File

@ -8,7 +8,7 @@ layout: manual
Compute the length of the provided line segment. Compute the length of the provided line segment.
```kcl ```kcl
segLen(@tag: TaggedEdge): number(Length) segLen(@tag: tag): number(Length)
``` ```
@ -17,7 +17,7 @@ segLen(@tag: TaggedEdge): number(Length)
| Name | Type | Description | Required | | Name | Type | Description | Required |
|----------|------|-------------|----------| |----------|------|-------------|----------|
| `tag` | [`TaggedEdge`](/docs/kcl-std/types/std-types-TaggedEdge) | The line segment being queried by its tag. | Yes | | [`tag`](/docs/kcl-std/types/std-types-tag) | [`tag`](/docs/kcl-std/types/std-types-tag) | The line segment being queried by its tag. | Yes |
### Returns ### Returns

View File

@ -8,7 +8,7 @@ layout: manual
Compute the starting point of the provided line segment. Compute the starting point of the provided line segment.
```kcl ```kcl
segStart(@tag: TaggedEdge): Point2d segStart(@tag: tag): Point2d
``` ```
@ -17,7 +17,7 @@ segStart(@tag: TaggedEdge): Point2d
| Name | Type | Description | Required | | Name | Type | Description | Required |
|----------|------|-------------|----------| |----------|------|-------------|----------|
| `tag` | [`TaggedEdge`](/docs/kcl-std/types/std-types-TaggedEdge) | The line segment being queried by its tag. | Yes | | [`tag`](/docs/kcl-std/types/std-types-tag) | [`tag`](/docs/kcl-std/types/std-types-tag) | The line segment being queried by its tag. | Yes |
### Returns ### Returns

View File

@ -8,7 +8,7 @@ layout: manual
Compute the starting point of the provided line segment along the 'x' axis. Compute the starting point of the provided line segment along the 'x' axis.
```kcl ```kcl
segStartX(@tag: TaggedEdge): number(Length) segStartX(@tag: tag): number(Length)
``` ```
@ -17,7 +17,7 @@ segStartX(@tag: TaggedEdge): number(Length)
| Name | Type | Description | Required | | Name | Type | Description | Required |
|----------|------|-------------|----------| |----------|------|-------------|----------|
| `tag` | [`TaggedEdge`](/docs/kcl-std/types/std-types-TaggedEdge) | The line segment being queried by its tag. | Yes | | [`tag`](/docs/kcl-std/types/std-types-tag) | [`tag`](/docs/kcl-std/types/std-types-tag) | The line segment being queried by its tag. | Yes |
### Returns ### Returns

View File

@ -8,7 +8,7 @@ layout: manual
Compute the starting point of the provided line segment along the 'y' axis. Compute the starting point of the provided line segment along the 'y' axis.
```kcl ```kcl
segStartY(@tag: TaggedEdge): number(Length) segStartY(@tag: tag): number(Length)
``` ```
@ -17,7 +17,7 @@ segStartY(@tag: TaggedEdge): number(Length)
| Name | Type | Description | Required | | Name | Type | Description | Required |
|----------|------|-------------|----------| |----------|------|-------------|----------|
| `tag` | [`TaggedEdge`](/docs/kcl-std/types/std-types-TaggedEdge) | The line segment being queried by its tag. | Yes | | [`tag`](/docs/kcl-std/types/std-types-tag) | [`tag`](/docs/kcl-std/types/std-types-tag) | The line segment being queried by its tag. | Yes |
### Returns ### Returns

View File

@ -11,7 +11,7 @@ Start a new profile at a given point.
startProfile( startProfile(
@startProfileOn: Plane | Face, @startProfileOn: Plane | Face,
at: Point2d, at: Point2d,
tag?: TagDecl, tag?: tag,
): Sketch ): Sketch
``` ```
@ -23,7 +23,7 @@ startProfile(
|----------|------|-------------|----------| |----------|------|-------------|----------|
| `startProfileOn` | [`Plane`](/docs/kcl-std/types/std-types-Plane) or [`Face`](/docs/kcl-std/types/std-types-Face) | What to start the profile on. | Yes | | `startProfileOn` | [`Plane`](/docs/kcl-std/types/std-types-Plane) or [`Face`](/docs/kcl-std/types/std-types-Face) | What to start the profile on. | Yes |
| `at` | [`Point2d`](/docs/kcl-std/types/std-types-Point2d) | Where to start the profile. An absolute point. | Yes | | `at` | [`Point2d`](/docs/kcl-std/types/std-types-Point2d) | Where to start the profile. An absolute point. | Yes |
| `tag` | [`TagDecl`](/docs/kcl-std/types/std-types-TagDecl) | Tag this first starting point. | No | | [`tag`](/docs/kcl-std/types/std-types-tag) | [`tag`](/docs/kcl-std/types/std-types-tag) | Tag this first starting point. | No |
### Returns ### Returns

View File

@ -10,7 +10,7 @@ Start a new 2-dimensional sketch on a specific plane or face.
```kcl ```kcl
startSketchOn( startSketchOn(
@planeOrSolid: Solid | Plane, @planeOrSolid: Solid | Plane,
face?: TaggedFace, face?: tag,
): Plane | Face ): Plane | Face
``` ```
@ -36,7 +36,7 @@ face, since it will include all the parent faces and Solids.
| Name | Type | Description | Required | | Name | Type | Description | Required |
|----------|------|-------------|----------| |----------|------|-------------|----------|
| `planeOrSolid` | [`Solid`](/docs/kcl-std/types/std-types-Solid) or [`Plane`](/docs/kcl-std/types/std-types-Plane) | Profile whose start is being used. | Yes | | `planeOrSolid` | [`Solid`](/docs/kcl-std/types/std-types-Solid) or [`Plane`](/docs/kcl-std/types/std-types-Plane) | Profile whose start is being used. | Yes |
| `face` | [`TaggedFace`](/docs/kcl-std/types/std-types-TaggedFace) | Identify a face of a solid if a solid is specified as the input argument (`planeOrSolid`). | No | | `face` | [`tag`](/docs/kcl-std/types/std-types-tag) | Identify a face of a solid if a solid is specified as the input argument (`planeOrSolid`). | No |
### Returns ### Returns

File diff suppressed because one or more lines are too long

View File

@ -8,7 +8,7 @@ layout: manual
Returns the angle coming out of the end of the segment in degrees. Returns the angle coming out of the end of the segment in degrees.
```kcl ```kcl
tangentToEnd(@tag: TaggedEdge): number(Angle) tangentToEnd(@tag: tag): number(Angle)
``` ```
@ -17,7 +17,7 @@ tangentToEnd(@tag: TaggedEdge): number(Angle)
| Name | Type | Description | Required | | Name | Type | Description | Required |
|----------|------|-------------|----------| |----------|------|-------------|----------|
| `tag` | [`TaggedEdge`](/docs/kcl-std/types/std-types-TaggedEdge) | The line segment being queried by its tag. | Yes | | [`tag`](/docs/kcl-std/types/std-types-tag) | [`tag`](/docs/kcl-std/types/std-types-tag) | The line segment being queried by its tag. | Yes |
### Returns ### Returns

View File

@ -15,7 +15,7 @@ tangentialArc(
radius?: number(Length), radius?: number(Length),
diameter?: number(Length), diameter?: number(Length),
angle?: number(Angle), angle?: number(Angle),
tag?: TagDecl, tag?: tag,
): Sketch ): Sketch
``` ```
@ -35,7 +35,7 @@ for 'angle' degrees along the imaginary circle.
| `radius` | [`number(Length)`](/docs/kcl-std/types/std-types-number) | Radius of the imaginary circle. `angle` must be given. Incompatible with `end` and `endAbsolute` and `diameter`. | No | | `radius` | [`number(Length)`](/docs/kcl-std/types/std-types-number) | Radius of the imaginary circle. `angle` must be given. Incompatible with `end` and `endAbsolute` and `diameter`. | No |
| `diameter` | [`number(Length)`](/docs/kcl-std/types/std-types-number) | Diameter of the imaginary circle. `angle` must be given. Incompatible with `end` and `endAbsolute` and `radius`. | No | | `diameter` | [`number(Length)`](/docs/kcl-std/types/std-types-number) | Diameter of the imaginary circle. `angle` must be given. Incompatible with `end` and `endAbsolute` and `radius`. | No |
| `angle` | [`number(Angle)`](/docs/kcl-std/types/std-types-number) | Offset of the arc. `radius` must be given. Incompatible with `end` and `endAbsolute`. | No | | `angle` | [`number(Angle)`](/docs/kcl-std/types/std-types-number) | Offset of the arc. `radius` must be given. Incompatible with `end` and `endAbsolute`. | No |
| `tag` | [`TagDecl`](/docs/kcl-std/types/std-types-TagDecl) | Create a new tag which refers to this arc. | 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 arc. | No |
### Returns ### Returns

View File

@ -12,7 +12,7 @@ xLine(
@sketch: Sketch, @sketch: Sketch,
length?: number(Length), length?: number(Length),
endAbsolute?: number(Length), endAbsolute?: number(Length),
tag?: TagDecl, tag?: tag,
): Sketch ): Sketch
``` ```
@ -25,7 +25,7 @@ xLine(
| `sketch` | [`Sketch`](/docs/kcl-std/types/std-types-Sketch) | Which sketch should this path be added to? | Yes | | `sketch` | [`Sketch`](/docs/kcl-std/types/std-types-Sketch) | Which sketch should this path be added to? | Yes |
| `length` | [`number(Length)`](/docs/kcl-std/types/std-types-number) | How far away along the X axis should this line go? Incompatible with `endAbsolute`. | No | | `length` | [`number(Length)`](/docs/kcl-std/types/std-types-number) | How far away along the X axis should this line go? Incompatible with `endAbsolute`. | No |
| `endAbsolute` | [`number(Length)`](/docs/kcl-std/types/std-types-number) | Which absolute X value should this line go to? Incompatible with `length`. | No | | `endAbsolute` | [`number(Length)`](/docs/kcl-std/types/std-types-number) | Which absolute X value should this line go to? Incompatible with `length`. | No |
| `tag` | [`TagDecl`](/docs/kcl-std/types/std-types-TagDecl) | Create a new tag which refers to this line. | 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 line. | No |
### Returns ### Returns

View File

@ -12,7 +12,7 @@ yLine(
@sketch: Sketch, @sketch: Sketch,
length?: number(Length), length?: number(Length),
endAbsolute?: number(Length), endAbsolute?: number(Length),
tag?: TagDecl, tag?: tag,
): Sketch ): Sketch
``` ```
@ -25,7 +25,7 @@ yLine(
| `sketch` | [`Sketch`](/docs/kcl-std/types/std-types-Sketch) | Which sketch should this path be added to? | Yes | | `sketch` | [`Sketch`](/docs/kcl-std/types/std-types-Sketch) | Which sketch should this path be added to? | Yes |
| `length` | [`number(Length)`](/docs/kcl-std/types/std-types-number) | How far away along the Y axis should this line go? Incompatible with `endAbsolute`. | No | | `length` | [`number(Length)`](/docs/kcl-std/types/std-types-number) | How far away along the Y axis should this line go? Incompatible with `endAbsolute`. | No |
| `endAbsolute` | [`number(Length)`](/docs/kcl-std/types/std-types-number) | Which absolute Y value should this line go to? Incompatible with `length`. | No | | `endAbsolute` | [`number(Length)`](/docs/kcl-std/types/std-types-number) | Which absolute Y value should this line go to? Incompatible with `length`. | No |
| `tag` | [`TagDecl`](/docs/kcl-std/types/std-types-TagDecl) | Create a new tag which refers to this line. | 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 line. | No |
### Returns ### Returns

File diff suppressed because one or more lines are too long

View File

@ -13,7 +13,7 @@ fillet(
radius: number(Length), radius: number(Length),
tags: [Edge; 1+], tags: [Edge; 1+],
tolerance?: number(Length), tolerance?: number(Length),
tag?: TagDecl, tag?: tag,
): Solid ): Solid
``` ```
@ -28,8 +28,8 @@ will smoothly blend the transition.
| `solid` | [`Solid`](/docs/kcl-std/types/std-types-Solid) | The solid whose edges should be filletted | Yes | | `solid` | [`Solid`](/docs/kcl-std/types/std-types-Solid) | The solid whose edges should be filletted | Yes |
| `radius` | [`number(Length)`](/docs/kcl-std/types/std-types-number) | 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 | | `tags` | [`[Edge; 1+]`](/docs/kcl-std/types/std-types-Edge) | The paths you want to fillet | Yes |
| `tolerance` | [`number(Length)`](/docs/kcl-std/types/std-types-number) | Defines the smallest distance below which two entities are considered coincident, intersecting, coplanar, or similar. For most use cases, it should not be changed from its default value of 10^-7 millimeters. | No | | `tolerance` | [`number(Length)`](/docs/kcl-std/types/std-types-number) | The tolerance for this fillet | No |
| `tag` | [`TagDecl`](/docs/kcl-std/types/std-types-TagDecl) | Create a new tag which refers to this fillet | No | | [`tag`](/docs/kcl-std/types/std-types-tag) | [`tag`](/docs/kcl-std/types/std-types-tag) | Create a new tag which refers to this fillet | No |
### Returns ### Returns

File diff suppressed because one or more lines are too long

View File

@ -24,7 +24,7 @@ verifying fit, and analyzing overlapping geometries in assemblies.
| Name | Type | Description | Required | | Name | Type | Description | Required |
|----------|------|-------------|----------| |----------|------|-------------|----------|
| `solids` | `[Solid; 2+]` | The solids to intersect. | Yes | | `solids` | `[Solid; 2+]` | The solids to intersect. | Yes |
| `tolerance` | [`number(Length)`](/docs/kcl-std/types/std-types-number) | Defines the smallest distance below which two entities are considered coincident, intersecting, coplanar, or similar. For most use cases, it should not be changed from its default value of 10^-7 millimeters. | No | | `tolerance` | [`number(Length)`](/docs/kcl-std/types/std-types-number) | The tolerance to use for the intersection operation. | No |
### Returns ### Returns

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -27,7 +27,7 @@ and complex multi-body part modeling.
|----------|------|-------------|----------| |----------|------|-------------|----------|
| `solids` | [`[Solid; 1+]`](/docs/kcl-std/types/std-types-Solid) | The solids to use as the base to subtract from. | Yes | | `solids` | [`[Solid; 1+]`](/docs/kcl-std/types/std-types-Solid) | The solids to use as the base to subtract from. | Yes |
| `tools` | [`[Solid]`](/docs/kcl-std/types/std-types-Solid) | The solids to subtract. | Yes | | `tools` | [`[Solid]`](/docs/kcl-std/types/std-types-Solid) | The solids to subtract. | Yes |
| `tolerance` | [`number(Length)`](/docs/kcl-std/types/std-types-number) | Defines the smallest distance below which two entities are considered coincident, intersecting, coplanar, or similar. For most use cases, it should not be changed from its default value of 10^-7 millimeters. | No | | `tolerance` | [`number(Length)`](/docs/kcl-std/types/std-types-number) | The tolerance to use for the subtraction operation. | No |
### Returns ### Returns

View File

@ -21,7 +21,7 @@ union(
| Name | Type | Description | Required | | Name | Type | Description | Required |
|----------|------|-------------|----------| |----------|------|-------------|----------|
| `solids` | `[Solid; 2+]` | The solids to union. | Yes | | `solids` | `[Solid; 2+]` | The solids to union. | Yes |
| `tolerance` | [`number(Length)`](/docs/kcl-std/types/std-types-number) | Defines the smallest distance below which two entities are considered coincident, intersecting, coplanar, or similar. For most use cases, it should not be changed from its default value of 10^-7 millimeters. | No | | `tolerance` | [`number(Length)`](/docs/kcl-std/types/std-types-number) | The tolerance to use for the union operation. | No |
### Returns ### Returns

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -67,12 +67,10 @@ layout: manual
* [`patternCircular2d`](/docs/kcl-std/functions/std-sketch-patternCircular2d) * [`patternCircular2d`](/docs/kcl-std/functions/std-sketch-patternCircular2d)
* [`patternLinear2d`](/docs/kcl-std/functions/std-sketch-patternLinear2d) * [`patternLinear2d`](/docs/kcl-std/functions/std-sketch-patternLinear2d)
* [`patternTransform2d`](/docs/kcl-std/functions/std-sketch-patternTransform2d) * [`patternTransform2d`](/docs/kcl-std/functions/std-sketch-patternTransform2d)
* [`planeOf`](/docs/kcl-std/functions/std-sketch-planeOf)
* [`polygon`](/docs/kcl-std/functions/std-sketch-polygon) * [`polygon`](/docs/kcl-std/functions/std-sketch-polygon)
* [`profileStart`](/docs/kcl-std/functions/std-sketch-profileStart) * [`profileStart`](/docs/kcl-std/functions/std-sketch-profileStart)
* [`profileStartX`](/docs/kcl-std/functions/std-sketch-profileStartX) * [`profileStartX`](/docs/kcl-std/functions/std-sketch-profileStartX)
* [`profileStartY`](/docs/kcl-std/functions/std-sketch-profileStartY) * [`profileStartY`](/docs/kcl-std/functions/std-sketch-profileStartY)
* [`rectangle`](/docs/kcl-std/functions/std-sketch-rectangle)
* [`revolve`](/docs/kcl-std/functions/std-sketch-revolve) * [`revolve`](/docs/kcl-std/functions/std-sketch-revolve)
* [`segAng`](/docs/kcl-std/functions/std-sketch-segAng) * [`segAng`](/docs/kcl-std/functions/std-sketch-segAng)
* [`segEnd`](/docs/kcl-std/functions/std-sketch-segEnd) * [`segEnd`](/docs/kcl-std/functions/std-sketch-segEnd)
@ -147,12 +145,12 @@ See also the [types overview](/docs/kcl-lang/types)
* [**Primitive types**](/docs/kcl-lang/types) * [**Primitive types**](/docs/kcl-lang/types)
* [`ImportedGeometry`](/docs/kcl-std/types/std-types-ImportedGeometry) * [`ImportedGeometry`](/docs/kcl-std/types/std-types-ImportedGeometry)
* [`TagDecl`](/docs/kcl-std/types/std-types-TagDecl)
* [`any`](/docs/kcl-std/types/std-types-any) * [`any`](/docs/kcl-std/types/std-types-any)
* [`bool`](/docs/kcl-std/types/std-types-bool) * [`bool`](/docs/kcl-std/types/std-types-bool)
* [`fn`](/docs/kcl-std/types/std-types-fn) * [`fn`](/docs/kcl-std/types/std-types-fn)
* [`number`](/docs/kcl-std/types/std-types-number) * [`number`](/docs/kcl-std/types/std-types-number)
* [`string`](/docs/kcl-std/types/std-types-string) * [`string`](/docs/kcl-std/types/std-types-string)
* [`tag`](/docs/kcl-std/types/std-types-tag)
* [**std::types**](/docs/kcl-std/modules/std-types) * [**std::types**](/docs/kcl-std/modules/std-types)
* [`Axis2d`](/docs/kcl-std/types/std-types-Axis2d) * [`Axis2d`](/docs/kcl-std/types/std-types-Axis2d)
* [`Axis3d`](/docs/kcl-std/types/std-types-Axis3d) * [`Axis3d`](/docs/kcl-std/types/std-types-Axis3d)
@ -164,5 +162,3 @@ See also the [types overview](/docs/kcl-lang/types)
* [`Point3d`](/docs/kcl-std/types/std-types-Point3d) * [`Point3d`](/docs/kcl-std/types/std-types-Point3d)
* [`Sketch`](/docs/kcl-std/types/std-types-Sketch) * [`Sketch`](/docs/kcl-std/types/std-types-Sketch)
* [`Solid`](/docs/kcl-std/types/std-types-Solid) * [`Solid`](/docs/kcl-std/types/std-types-Solid)
* [`TaggedEdge`](/docs/kcl-std/types/std-types-TaggedEdge)
* [`TaggedFace`](/docs/kcl-std/types/std-types-TaggedFace)

View File

@ -32,12 +32,10 @@ This module contains functions for creating and manipulating sketches, and makin
* [`patternCircular2d`](/docs/kcl-std/functions/std-sketch-patternCircular2d) * [`patternCircular2d`](/docs/kcl-std/functions/std-sketch-patternCircular2d)
* [`patternLinear2d`](/docs/kcl-std/functions/std-sketch-patternLinear2d) * [`patternLinear2d`](/docs/kcl-std/functions/std-sketch-patternLinear2d)
* [`patternTransform2d`](/docs/kcl-std/functions/std-sketch-patternTransform2d) * [`patternTransform2d`](/docs/kcl-std/functions/std-sketch-patternTransform2d)
* [`planeOf`](/docs/kcl-std/functions/std-sketch-planeOf)
* [`polygon`](/docs/kcl-std/functions/std-sketch-polygon) * [`polygon`](/docs/kcl-std/functions/std-sketch-polygon)
* [`profileStart`](/docs/kcl-std/functions/std-sketch-profileStart) * [`profileStart`](/docs/kcl-std/functions/std-sketch-profileStart)
* [`profileStartX`](/docs/kcl-std/functions/std-sketch-profileStartX) * [`profileStartX`](/docs/kcl-std/functions/std-sketch-profileStartX)
* [`profileStartY`](/docs/kcl-std/functions/std-sketch-profileStartY) * [`profileStartY`](/docs/kcl-std/functions/std-sketch-profileStartY)
* [`rectangle`](/docs/kcl-std/functions/std-sketch-rectangle)
* [`revolve`](/docs/kcl-std/functions/std-sketch-revolve) * [`revolve`](/docs/kcl-std/functions/std-sketch-revolve)
* [`segAng`](/docs/kcl-std/functions/std-sketch-segAng) * [`segAng`](/docs/kcl-std/functions/std-sketch-segAng)
* [`segEnd`](/docs/kcl-std/functions/std-sketch-segEnd) * [`segEnd`](/docs/kcl-std/functions/std-sketch-segEnd)

View File

@ -24,9 +24,6 @@ Types can (optionally) be used to describe a function's arguments and returned v
* [`Point3d`](/docs/kcl-std/types/std-types-Point3d) * [`Point3d`](/docs/kcl-std/types/std-types-Point3d)
* [`Sketch`](/docs/kcl-std/types/std-types-Sketch) * [`Sketch`](/docs/kcl-std/types/std-types-Sketch)
* [`Solid`](/docs/kcl-std/types/std-types-Solid) * [`Solid`](/docs/kcl-std/types/std-types-Solid)
* [`TagDecl`](/docs/kcl-std/types/std-types-TagDecl)
* [`TaggedEdge`](/docs/kcl-std/types/std-types-TaggedEdge)
* [`TaggedFace`](/docs/kcl-std/types/std-types-TaggedFace)
* [`any`](/docs/kcl-std/types/std-types-any) * [`any`](/docs/kcl-std/types/std-types-any)
* [`bool`](/docs/kcl-std/types/std-types-bool) * [`bool`](/docs/kcl-std/types/std-types-bool)
* [`fn`](/docs/kcl-std/types/std-types-fn) * [`fn`](/docs/kcl-std/types/std-types-fn)

View File

@ -1,102 +0,0 @@
---
title: "TagDecl"
subtitle: "Type in std::types"
excerpt: "Tags are used to give a name (tag) to a specific path."
layout: manual
---
Tags are used to give a name (tag) to a specific path.
### Tag Declaration
The syntax for declaring a tag is `$myTag`. You would use it in the following
way:
```js
startSketchOn(XZ)
|> startProfile(at = origin)
|> angledLine(angle = 0, length = 191.26, tag = $rectangleSegmentA001)
|> angledLine(
angle = segAng(rectangleSegmentA001) - 90deg,
length = 196.99,
tag = $rectangleSegmentB001,
)
|> angledLine(
angle = segAng(rectangleSegmentA001),
length = -segLen(rectangleSegmentA001),
tag = $rectangleSegmentC001,
)
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close()
```
### Tag Scope
Tags are scoped globally if in the root context meaning in this example you can
use the tag `rectangleSegmentA001` in any function or expression in the file.
However if the code was written like this:
```js
fn rect(origin) {
return startSketchOn(XZ)
|> startProfile(at = origin)
|> angledLine(angle = 0, length = 191.26, tag = $rectangleSegmentA001)
|> angledLine(
angle = segAng(rectangleSegmentA001) - 90,
length = 196.99,
tag = $rectangleSegmentB001
)
|> angledLine(
angle = segAng(rectangleSegmentA001),
length = -segLen(rectangleSegmentA001),
tag = $rectangleSegmentC001
)
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close()
}
rect(origin = [0, 0])
rect(origin = [20, 0])
```
Those tags would only be available in the `rect` function and not globally.
However you likely want to use those tags somewhere outside the `rect` function.
Tags are accessible through the sketch group they are declared in.
For example the following code works.
```js
fn rect(origin) {
return startSketchOn(XZ)
|> startProfile(at = origin)
|> angledLine(angle = 0, length = 191.26, tag = $rectangleSegmentA001)
|> angledLine(
angle = segAng(rectangleSegmentA001) - 90deg,
length = 196.99,
tag = $rectangleSegmentB001,
)
|> angledLine(
angle = segAng(rectangleSegmentA001),
length = -segLen(rectangleSegmentA001),
tag = $rectangleSegmentC001,
)
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close()
}
rect(origin = [0, 0])
myRect = rect(origin = [20, 0])
myRect
|> extrude(length = 10)
|> fillet(radius = 0.5, tags = [myRect.tags.rectangleSegmentA001])
```
See how we use the tag `rectangleSegmentA001` in the `fillet` function outside
the `rect` function. This is because the `rect` function is returning the
sketch group that contains the tags.

View File

@ -1,17 +0,0 @@
---
title: "TaggedEdge"
subtitle: "Type in std::types"
excerpt: "A tag which references a line, arc, or other edge in a sketch or an edge of a solid."
layout: manual
---
A tag which references a line, arc, or other edge in a sketch or an edge of a solid.
Created by using a tag declarator (see the docs for [`TagDecl`](/docs/kcl-std/types/std-types-TagDecl)). Can be used where an [`Edge`](/docs/kcl-std/types/std-types-Edge) is
required.
If a line in a sketch is tagged and then the sketch is extruded, the tag is a [`TaggedEdge`](/docs/kcl-std/types/std-types-TaggedEdge) before
extrusion and a [`TaggedFace`](/docs/kcl-std/types/std-types-TaggedFace) after extrusion.

View File

@ -1,16 +0,0 @@
---
title: "TaggedFace"
subtitle: "Type in std::types"
excerpt: "A tag which references a face of a solid, including the distinguished tags `START` and `END`."
layout: manual
---
A tag which references a face of a solid, including the distinguished tags `START` and `END`.
Created by using a tag declarator (see the docs for [`TagDecl`](/docs/kcl-std/types/std-types-TagDecl)).
If a line in a sketch is tagged and then the sketch is extruded, the tag is a [`TaggedEdge`](/docs/kcl-std/types/std-types-TaggedEdge) before
extrusion and a [`TaggedFace`](/docs/kcl-std/types/std-types-TaggedFace) after extrusion.

View File

@ -1,19 +1,109 @@
--- ---
title: "tag" title: "tag"
subtitle: "Type in std::types" subtitle: "Type in std::types"
excerpt: "Reference a previously created tag. Used much like a variable." excerpt: "Tags are used to give a name (tag) to a specific path."
layout: manual layout: manual
--- ---
**WARNING:** This type is deprecated. Tags are used to give a name (tag) to a specific path.
Reference a previously created tag. Used much like a variable. ### Tag Declaration
```kcl The syntax for declaring a tag is `$myTag` you would use it in the following
type tag = TaggedEdge way:
```js
startSketchOn(XZ)
|> startProfile(at = origin)
|> angledLine(angle = 0, length = 191.26, tag = $rectangleSegmentA001)
|> angledLine(
angle = segAng(rectangleSegmentA001) - 90deg,
length = 196.99,
tag = $rectangleSegmentB001,
)
|> angledLine(
angle = segAng(rectangleSegmentA001),
length = -segLen(rectangleSegmentA001),
tag = $rectangleSegmentC001,
)
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close()
``` ```
Prefer to use [`TaggedEdge`](/docs/kcl-std/types/std-types-TaggedEdge) or [`TaggedFace`](/docs/kcl-std/types/std-types-TaggedFace). For more details on tags, see the docs for [`TagDecl`](/docs/kcl-std/types/std-types-TagDecl). ### Tag Identifier
As per the example above you can use the tag identifier to get a reference to the
tagged object. The syntax for this is `myTag`.
In the example above we use the tag identifier to get the angle of the segment
`segAng(rectangleSegmentA001)`.
### Tag Scope
Tags are scoped globally if in the root context meaning in this example you can
use the tag `rectangleSegmentA001` in any function or expression in the file.
However if the code was written like this:
```js
fn rect(origin) {
return startSketchOn(XZ)
|> startProfile(at = origin)
|> angledLine(angle = 0, length = 191.26, tag = $rectangleSegmentA001)
|> angledLine(
angle = segAng(rectangleSegmentA001) - 90,
length = 196.99,
tag = $rectangleSegmentB001)
|> angledLine(
angle = segAng(rectangleSegmentA001),
length = -segLen(rectangleSegmentA001),
tag = $rectangleSegmentC001
)
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close()
}
rect(origin = [0, 0])
rect(origin = [20, 0])
```
Those tags would only be available in the `rect` function and not globally.
However you likely want to use those tags somewhere outside the `rect` function.
Tags are accessible through the sketch group they are declared in.
For example the following code works.
```js
fn rect(origin) {
return startSketchOn(XZ)
|> startProfile(at = origin)
|> angledLine(angle = 0, length = 191.26, tag = $rectangleSegmentA001)
|> angledLine(
angle = segAng(rectangleSegmentA001) - 90deg,
length = 196.99
tag = $rectangleSegmentB001,
)
|> angledLine(
angle = segAng(rectangleSegmentA001),
length = -segLen(rectangleSegmentA001)
tag = $rectangleSegmentC001,
)
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close()
}
rect(origin = [0, 0])
myRect = rect(origin = [20, 0])
myRect
|> extrude(length = 10)
|> fillet(radius = 0.5, tags = [myRect.tags.rectangleSegmentA001])
```
See how we use the tag `rectangleSegmentA001` in the `fillet` function outside
the `rect` function. This is because the `rect` function is returning the
sketch group that contains the tags.

View File

@ -12,7 +12,7 @@ test.describe('Point and click for boolean workflows', () => {
}, },
{ {
name: 'subtract', name: 'subtract',
code: 'subtract(extrude001, tools = extrude006)', code: 'subtract([extrude001], tools = [extrude006])',
}, },
{ {
name: 'intersect', name: 'intersect',
@ -81,8 +81,6 @@ test.describe('Point and click for boolean workflows', () => {
if (operationName !== 'subtract') { if (operationName !== 'subtract') {
// should down shift key to select multiple objects // should down shift key to select multiple objects
await page.keyboard.down('Shift') await page.keyboard.down('Shift')
} else {
await cmdBar.progressCmdBar()
} }
// Select second object // Select second object
@ -105,8 +103,8 @@ test.describe('Point and click for boolean workflows', () => {
await cmdBar.expectState({ await cmdBar.expectState({
stage: 'review', stage: 'review',
headerArguments: { headerArguments: {
Solids: '1 path', Tool: '1 path',
Tools: '1 path', Target: '1 path',
}, },
commandName, commandName,
}) })

View File

@ -5,7 +5,6 @@ import { uuidv4 } from '@src/lib/utils'
import type { HomePageFixture } from '@e2e/playwright/fixtures/homePageFixture' import type { HomePageFixture } from '@e2e/playwright/fixtures/homePageFixture'
import type { SceneFixture } from '@e2e/playwright/fixtures/sceneFixture' import type { SceneFixture } from '@e2e/playwright/fixtures/sceneFixture'
import type { ToolbarFixture } from '@e2e/playwright/fixtures/toolbarFixture' import type { ToolbarFixture } from '@e2e/playwright/fixtures/toolbarFixture'
import type { CmdBarFixture } from '@e2e/playwright/fixtures/cmdBarFixture'
import { getUtils } from '@e2e/playwright/test-utils' import { getUtils } from '@e2e/playwright/test-utils'
import { expect, test } from '@e2e/playwright/zoo-test' import { expect, test } from '@e2e/playwright/zoo-test'
@ -15,18 +14,13 @@ test.describe('Can create sketches on all planes and their back sides', () => {
homePage: HomePageFixture, homePage: HomePageFixture,
scene: SceneFixture, scene: SceneFixture,
toolbar: ToolbarFixture, toolbar: ToolbarFixture,
cmdBar: CmdBarFixture,
plane: string, plane: string,
clickCoords: { x: number; y: number } clickCoords: { x: number; y: number }
) => { ) => {
const u = await getUtils(page) const u = await getUtils(page)
// await page.addInitScript(() => {
// localStorage.setItem('persistCode', '@settings(defaultLengthUnit = in)')
// })
await page.setBodyDimensions({ width: 1200, height: 500 }) await page.setBodyDimensions({ width: 1200, height: 500 })
await homePage.goToModelingScene() await homePage.goToModelingScene()
// await scene.settled(cmdBar)
const XYPlanRed: [number, number, number] = [98, 50, 51] const XYPlanRed: [number, number, number] = [98, 50, 51]
await scene.expectPixelColor(XYPlanRed, { x: 700, y: 300 }, 15) await scene.expectPixelColor(XYPlanRed, { x: 700, y: 300 }, 15)
@ -125,166 +119,12 @@ test.describe('Can create sketches on all planes and their back sides', () => {
] ]
for (const config of planeConfigs) { for (const config of planeConfigs) {
test(config.plane, async ({ page, homePage, scene, toolbar, cmdBar }) => { test(config.plane, async ({ page, homePage, scene, toolbar }) => {
await sketchOnPlaneAndBackSideTest( await sketchOnPlaneAndBackSideTest(
page, page,
homePage, homePage,
scene, scene,
toolbar, toolbar,
cmdBar,
config.plane,
config.coords
)
})
}
})
test.describe('Can create sketches on offset planes and their back sides', () => {
const sketchOnPlaneAndBackSideTest = async (
page: Page,
homePage: HomePageFixture,
scene: SceneFixture,
toolbar: ToolbarFixture,
cmdbar: CmdBarFixture,
plane: string,
clickCoords: { x: number; y: number }
) => {
const u = await getUtils(page)
await page.addInitScript(() => {
localStorage.setItem(
'persistCode',
`@settings(defaultLengthUnit = in)
xyPlane = offsetPlane(XY, offset = 0.05)
xzPlane = offsetPlane(XZ, offset = 0.05)
yzPlane = offsetPlane(YZ, offset = 0.05)
`
)
})
await page.setBodyDimensions({ width: 1200, height: 500 })
await homePage.goToModelingScene()
// await scene.settled(cmdbar)
const XYPlanRed: [number, number, number] = [74, 74, 74]
await scene.expectPixelColor(XYPlanRed, { x: 700, y: 300 }, 15)
await u.openDebugPanel()
const coord =
plane === '-XY' || plane === '-YZ' || plane === 'XZ' ? -100 : 100
const camCommand: EngineCommand = {
type: 'modeling_cmd_req',
cmd_id: uuidv4(),
cmd: {
type: 'default_camera_look_at',
center: { x: 0, y: 0, z: 0 },
vantage: { x: coord, y: coord, z: coord },
up: { x: 0, y: 0, z: 1 },
},
}
const updateCamCommand: EngineCommand = {
type: 'modeling_cmd_req',
cmd_id: uuidv4(),
cmd: {
type: 'default_camera_get_settings',
},
}
const prefix = plane.length === 3 ? '-' : ''
const planeName = plane
.slice(plane.length === 3 ? 1 : 0)
.toLocaleLowerCase()
const codeLine1 = `sketch001 = startSketchOn(${prefix}${planeName}Plane)`
const codeLine2 = `profile001 = startProfile(sketch001, at = [${0.91 + (plane[0] === '-' ? 0.01 : 0)}, -${1.21 + (plane[0] === '-' ? 0.01 : 0)}])`
await u.openDebugPanel()
await u.clearCommandLogs()
await page.getByRole('button', { name: 'Start Sketch' }).click()
await u.sendCustomCmd(camCommand)
await page.waitForTimeout(100)
await u.sendCustomCmd(updateCamCommand)
await u.closeDebugPanel()
await toolbar.openFeatureTreePane()
await toolbar.getDefaultPlaneVisibilityButton('XY').click()
await toolbar.getDefaultPlaneVisibilityButton('XZ').click()
await toolbar.getDefaultPlaneVisibilityButton('YZ').click()
await expect(
toolbar
.getDefaultPlaneVisibilityButton('YZ')
.locator('[aria-label="eye crossed out"]')
).toBeVisible()
await page.mouse.click(clickCoords.x, clickCoords.y)
await page.waitForTimeout(600) // wait for animation
await toolbar.waitUntilSketchingReady()
await expect(
page.getByRole('button', { name: 'line Line', exact: true })
).toBeVisible()
await u.closeDebugPanel()
await page.mouse.click(707, 393)
await expect(page.locator('.cm-content')).toContainText(codeLine1)
await expect(page.locator('.cm-content')).toContainText(codeLine2)
await page
.getByRole('button', { name: 'line Line', exact: true })
.first()
.click()
await u.openAndClearDebugPanel()
await page.getByRole('button', { name: 'Exit Sketch' }).click()
await u.expectCmdLog('[data-message-type="execution-done"]')
await u.clearCommandLogs()
await u.removeCurrentCode()
}
const planeConfigs = [
{
plane: 'XY',
coords: { x: 600, y: 388 },
description: 'red plane',
},
{
plane: 'YZ',
coords: { x: 700, y: 250 },
description: 'green plane',
},
{
plane: 'XZ',
coords: { x: 684, y: 427 },
description: 'blue plane',
},
{
plane: '-XY',
coords: { x: 600, y: 118 },
description: 'back of red plane',
},
{
plane: '-YZ',
coords: { x: 700, y: 219 },
description: 'back of green plane',
},
{
plane: '-XZ',
coords: { x: 700, y: 80 },
description: 'back of blue plane',
},
]
for (const config of planeConfigs) {
test(config.plane, async ({ page, homePage, scene, toolbar, cmdBar }) => {
await sketchOnPlaneAndBackSideTest(
page,
homePage,
scene,
toolbar,
cmdBar,
config.plane, config.plane,
config.coords config.coords
) )

View File

@ -265,8 +265,6 @@ middle(0)
}) })
await expect( await expect(
page.getByText(`assert failed: Expected 0 to be greater than 0 but it wasn't page.getByText(`assert failed: Expected 0 to be greater than 0 but it wasn't
Backtrace:
assert() assert()
check() check()
middle()`) middle()`)

View File

@ -4,6 +4,7 @@ import * as fsp from 'fs/promises'
import { executorInputPath, getUtils } from '@e2e/playwright/test-utils' import { executorInputPath, getUtils } from '@e2e/playwright/test-utils'
import { expect, test } from '@e2e/playwright/zoo-test' import { expect, test } from '@e2e/playwright/zoo-test'
import { expectPixelColor } from '@e2e/playwright/fixtures/sceneFixture'
test.describe('Command bar tests', () => { test.describe('Command bar tests', () => {
test('Extrude from command bar selects extrude line after', async ({ test('Extrude from command bar selects extrude line after', async ({
@ -307,7 +308,7 @@ test.describe('Command bar tests', () => {
) )
const continueButton = page.getByRole('button', { name: 'Continue' }) const continueButton = page.getByRole('button', { name: 'Continue' })
const submitButton = page.getByTestId('command-bar-submit') const submitButton = page.getByRole('button', { name: 'Submit command' })
await continueButton.click() await continueButton.click()
// Review step and argument hotkeys // Review step and argument hotkeys
@ -514,6 +515,47 @@ test.describe('Command bar tests', () => {
}) })
}) })
test(
`Zoom to fit to shared model on web`,
{ tag: ['@web'] },
async ({ page, scene }) => {
if (process.env.TARGET !== '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)
|> yLine(length = 71.37)
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close()
`
const targetURL = `?create-file=true&name=test&units=mm&code=${encodeURIComponent(btoa(code))}&ask-open-desktop=true`
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 scene.connectionEstablished()
// This makes SystemIOMachineActors.createKCLFile run after EngineStream/firstPlay
await page.waitForTimeout(3000)
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)
})
}
)
test(`Can add and edit a named parameter or constant`, async ({ test(`Can add and edit a named parameter or constant`, async ({
page, page,
homePage, homePage,
@ -525,9 +567,7 @@ test.describe('Command bar tests', () => {
const projectName = 'test' const projectName = 'test'
const beforeKclCode = `a = 5 const beforeKclCode = `a = 5
b = a * a b = a * a
c = 3 + a c = 3 + a`
theta = 45deg
`
await context.folderSetupFn(async (dir) => { await context.folderSetupFn(async (dir) => {
const testProject = join(dir, projectName) const testProject = join(dir, projectName)
await fsp.mkdir(testProject, { recursive: true }) await fsp.mkdir(testProject, { recursive: true })
@ -617,45 +657,9 @@ theta = 45deg
stage: 'commandBarClosed', stage: 'commandBarClosed',
}) })
}) })
await test.step(`Edit a parameter with explicit units via command bar`, async () => {
await cmdBar.cmdBarOpenBtn.click()
await cmdBar.chooseCommand('edit parameter')
await cmdBar
.selectOption({
name: 'theta',
})
.click()
await cmdBar.expectState({
stage: 'arguments',
commandName: 'Edit parameter',
currentArgKey: 'value',
currentArgValue: '45deg',
headerArguments: {
Name: 'theta',
Value: '',
},
highlightedHeaderArg: 'value',
})
await cmdBar.argumentInput
.locator('[contenteditable]')
.fill('45deg + 1deg')
await cmdBar.progressCmdBar()
await cmdBar.expectState({
stage: 'review',
commandName: 'Edit parameter',
headerArguments: {
Name: 'theta',
Value: '46deg',
},
})
await cmdBar.progressCmdBar()
await cmdBar.expectState({
stage: 'commandBarClosed',
})
})
await editor.expectEditor.toContain( await editor.expectEditor.toContain(
`a = 5b = a * amyParameter001 = ${newValue}c = 3 + atheta = 45deg + 1deg` `a = 5b = a * amyParameter001 = ${newValue}c = 3 + a`
) )
}) })

View File

@ -54,7 +54,9 @@ test(
await page.keyboard.press('Enter') await page.keyboard.press('Enter')
// Click the checkbox // Click the checkbox
await cmdBar.submit() const submitButton = page.getByText('Confirm Export')
await expect(submitButton).toBeVisible()
await page.keyboard.press('Enter')
// Expect it to succeed // Expect it to succeed
const errorToastMessage = page.getByText(`Error while exporting`) const errorToastMessage = page.getByText(`Error while exporting`)
@ -117,7 +119,9 @@ test(
await page.keyboard.press('Enter') await page.keyboard.press('Enter')
// Click the checkbox // Click the checkbox
await cmdBar.submit() const submitButton = page.getByText('Confirm Export')
await expect(submitButton).toBeVisible()
await page.keyboard.press('Enter')
// Look out for the toast message // Look out for the toast message
const exportingToastMessage = page.getByText(`Exporting...`) const exportingToastMessage = page.getByText(`Exporting...`)

View File

@ -288,7 +288,7 @@ a1 = startSketchOn(offsetPlane(XY, offset = 10))
// error text on hover // error text on hover
await page.hover('.cm-lint-marker-info') await page.hover('.cm-lint-marker-info')
await expect( await expect(
page.getByText('Identifiers should be lowerCamelCase').first() page.getByText('Identifiers must be lowerCamelCase').first()
).toBeVisible() ).toBeVisible()
await page.locator('#code-pane button:first-child').click() await page.locator('#code-pane button:first-child').click()
@ -314,7 +314,7 @@ sketch_001 = startSketchOn(XY)
// error text on hover // error text on hover
await page.hover('.cm-lint-marker-info') await page.hover('.cm-lint-marker-info')
await expect( await expect(
page.getByText('Identifiers should be lowerCamelCase').first() page.getByText('Identifiers must be lowerCamelCase').first()
).toBeVisible() ).toBeVisible()
}) })
@ -511,7 +511,7 @@ sketch_001 = startSketchOn(XY)
// error text on hover // error text on hover
await page.hover('.cm-lint-marker-info') await page.hover('.cm-lint-marker-info')
await expect( await expect(
page.getByText('Identifiers should be lowerCamelCase').first() page.getByText('Identifiers must be lowerCamelCase').first()
).toBeVisible() ).toBeVisible()
// focus the editor // focus the editor
@ -539,7 +539,7 @@ sketch_001 = startSketchOn(XY)
// error text on hover // error text on hover
await page.hover('.cm-lint-marker-info') await page.hover('.cm-lint-marker-info')
await expect( await expect(
page.getByText('Identifiers should be lowerCamelCase').first() page.getByText('Identifiers must be lowerCamelCase').first()
).toBeVisible() ).toBeVisible()
}) })
@ -681,7 +681,7 @@ a1 = startSketchOn(offsetPlane(XY, offset = 10))
// error text on hover // error text on hover
await page.hover('.cm-lint-marker-info') await page.hover('.cm-lint-marker-info')
await expect( await expect(
page.getByText('Identifiers should be lowerCamelCase').first() page.getByText('Identifiers must be lowerCamelCase').first()
).toBeVisible() ).toBeVisible()
// select the line that's causing the error and delete it // select the line that's causing the error and delete it
@ -1617,33 +1617,4 @@ sketch001 = startSketchOn(XZ)
// Verify error is still visible // Verify error is still visible
await expect(page.locator('.cm-lint-marker-error')).toHaveCount(1) await expect(page.locator('.cm-lint-marker-error')).toHaveCount(1)
}) })
test('Core dump hotkey', async ({ page, scene, cmdBar, homePage }) => {
await page.addInitScript(async () => {
localStorage.setItem(
'persistCode',
`sketch001 = startSketchOn(XZ)
profile001 = circle(sketch001, center = [-100.0, -100.0], radius = 50.0)
`
)
})
const viewportSize = { width: 1200, height: 800 }
await page.setBodyDimensions(viewportSize)
await homePage.goToModelingScene()
await scene.connectionEstablished()
await scene.settled(cmdBar)
const modifier = process.platform === 'darwin' ? 'Meta' : 'Control'
await page.keyboard.press(`${modifier}+Shift+.`)
const toast1 = page.getByText('Starting core dump...')
await expect(toast1).toBeVisible()
const toast2 = page.getByText('Core dump completed')
await expect(toast2).toBeVisible()
})
}) })

View File

@ -229,12 +229,11 @@ test.describe('Feature Tree pane', () => {
const initialCode = `sketch001 = startSketchOn(XZ) const initialCode = `sketch001 = startSketchOn(XZ)
|> circle(center = [0, 0], radius = 5) |> circle(center = [0, 0], radius = 5)
renamedExtrude = extrude(sketch001, length = ${initialInput})` renamedExtrude = extrude(sketch001, length = ${initialInput})`
const newParameterName = 'length001' const newConstantName = 'length001'
const expectedCode = `${newParameterName} = 23 const expectedCode = `${newConstantName} = 23
sketch001 = startSketchOn(XZ) sketch001 = startSketchOn(XZ)
|> circle(center = [0, 0], radius = 5) |> circle(center = [0, 0], radius = 5)
renamedExtrude = extrude(sketch001, length = ${newParameterName})` renamedExtrude = extrude(sketch001, length = ${newConstantName})`
const editedParameterValue = '23 * 2'
await context.folderSetupFn(async (dir) => { await context.folderSetupFn(async (dir) => {
const testDir = join(dir, 'test-sample') const testDir = join(dir, 'test-sample')
@ -280,7 +279,7 @@ test.describe('Feature Tree pane', () => {
}) })
}) })
await test.step('Add a parameter for distance argument and submit', async () => { await test.step('Add a named constant for distance argument and submit', async () => {
await expect(cmdBar.currentArgumentInput).toBeVisible() await expect(cmdBar.currentArgumentInput).toBeVisible()
await cmdBar.variableCheckbox.click() await cmdBar.variableCheckbox.click()
await cmdBar.progressCmdBar() await cmdBar.progressCmdBar()
@ -297,43 +296,13 @@ test.describe('Feature Tree pane', () => {
highlightedCode: '', highlightedCode: '',
diagnostics: [], diagnostics: [],
activeLines: [ activeLines: [
`renamedExtrude = extrude(sketch001, length = ${newParameterName})`, `renamedExtrude = extrude(sketch001, length = ${newConstantName})`,
], ],
}) })
await editor.expectEditor.toContain(expectedCode, { await editor.expectEditor.toContain(expectedCode, {
shouldNormalise: true, shouldNormalise: true,
}) })
}) })
await test.step('Edit the parameter via the feature tree', async () => {
const parameter = await toolbar.getFeatureTreeOperation('Parameter', 0)
await parameter.dblclick()
await cmdBar.expectState({
commandName: 'Edit parameter',
currentArgKey: 'value',
currentArgValue: '23',
headerArguments: {
Name: newParameterName,
Value: '23',
},
stage: 'arguments',
highlightedHeaderArg: 'value',
})
await cmdBar.argumentInput
.locator('[contenteditable]')
.fill(editedParameterValue)
await cmdBar.progressCmdBar()
await cmdBar.expectState({
stage: 'review',
commandName: 'Edit parameter',
headerArguments: {
Name: newParameterName,
Value: '46', // Shows calculated result
},
})
await cmdBar.progressCmdBar()
await editor.expectEditor.toContain(editedParameterValue)
})
}) })
test(`User can edit an offset plane operation from the feature tree`, async ({ test(`User can edit an offset plane operation from the feature tree`, async ({
context, context,

View File

@ -118,11 +118,15 @@ export class CmdBarFixture {
return return
} }
const arrowButton = this.page.getByTestId('command-bar-continue') const arrowButton = this.page.getByRole('button', {
name: 'arrow right Continue',
})
if (await arrowButton.isVisible()) { if (await arrowButton.isVisible()) {
await this.continue() await arrowButton.click()
} else { } else {
await this.submit() await this.page
.getByRole('button', { name: 'checkmark Submit command' })
.click()
} }
} }
@ -187,13 +191,6 @@ export class CmdBarFixture {
return this.page.getByRole('option', options) return this.page.getByRole('option', options)
} }
/**
* Select an optional argument from the command bar during review
*/
clickOptionalArgument = async (argName: string) => {
await this.page.getByTestId(`cmd-bar-add-optional-arg-${argName}`).click()
}
/** /**
* Clicks the Create new variable button for kcl input * Clicks the Create new variable button for kcl input
*/ */

View File

@ -183,15 +183,14 @@ export class EditorFixture {
scrollToText(text: string, placeCursor?: boolean) { scrollToText(text: string, placeCursor?: boolean) {
return this.page.evaluate( return this.page.evaluate(
(args: { text: string; placeCursor?: boolean }) => { (args: { text: string; placeCursor?: boolean }) => {
const editorView = window.editorManager.getEditorView()
// error TS2339: Property 'docView' does not exist on type 'EditorView'. // error TS2339: Property 'docView' does not exist on type 'EditorView'.
// Except it does so :shrug: // Except it does so :shrug:
// @ts-ignore // @ts-ignore
const index = editorView?.docView.view.state.doc let index = window.editorManager._editorView?.docView.view.state.doc
.toString() .toString()
.indexOf(args.text) .indexOf(args.text)
editorView?.focus() window.editorManager._editorView?.focus()
editorView?.dispatch({ window.editorManager._editorView?.dispatch({
selection: window.EditorSelection.create([ selection: window.EditorSelection.create([
window.EditorSelection.cursor(index), window.EditorSelection.cursor(index),
]), ]),

View File

@ -274,13 +274,6 @@ export class ToolbarFixture {
.nth(operationIndex) .nth(operationIndex)
} }
getDefaultPlaneVisibilityButton(plane: 'XY' | 'XZ' | 'YZ' = 'XY') {
const index = plane === 'XZ' ? 0 : plane === 'XY' ? 1 : 2
return this.featureTreePane
.getByTestId('feature-tree-visibility-toggle')
.nth(index)
}
/** /**
* View source on a specific operation in the Feature Tree pane. * View source on a specific operation in the Feature Tree pane.
* @param operationName The name of the operation type * @param operationName The name of the operation type

View File

@ -5,7 +5,7 @@ import type {
FullResult, FullResult,
} from '@playwright/test/reporter' } from '@playwright/test/reporter'
class APIReporter implements Reporter { class MyAPIReporter implements Reporter {
private pendingRequests: Promise<void>[] = [] private pendingRequests: Promise<void>[] = []
private allResults: Record<string, any>[] = [] private allResults: Record<string, any>[] = []
private blockingResults: Record<string, any>[] = [] private blockingResults: Record<string, any>[] = []
@ -32,7 +32,7 @@ class APIReporter implements Reporter {
'X-API-Key': process.env.TAB_API_KEY || '', 'X-API-Key': process.env.TAB_API_KEY || '',
}), }),
body: JSON.stringify({ body: JSON.stringify({
project: `${process.env.GITHUB_SERVER_URL}/${process.env.GITHUB_REPOSITORY}`, project: 'https://github.com/KittyCAD/modeling-app',
branch: branch:
process.env.GITHUB_HEAD_REF || process.env.GITHUB_REF_NAME || '', process.env.GITHUB_HEAD_REF || process.env.GITHUB_REF_NAME || '',
commit: process.env.CI_COMMIT_SHA || process.env.GITHUB_SHA || '', commit: process.env.CI_COMMIT_SHA || process.env.GITHUB_SHA || '',
@ -60,7 +60,7 @@ class APIReporter implements Reporter {
const payload = { const payload = {
// Required information // Required information
project: `${process.env.GITHUB_SERVER_URL}/${process.env.GITHUB_REPOSITORY}`, project: 'https://github.com/KittyCAD/modeling-app',
suite: process.env.CI_SUITE || 'e2e', suite: process.env.CI_SUITE || 'e2e',
branch: process.env.GITHUB_HEAD_REF || process.env.GITHUB_REF_NAME || '', branch: process.env.GITHUB_HEAD_REF || process.env.GITHUB_REF_NAME || '',
commit: process.env.CI_COMMIT_SHA || process.env.GITHUB_SHA || '', commit: process.env.CI_COMMIT_SHA || process.env.GITHUB_SHA || '',
@ -124,4 +124,4 @@ class APIReporter implements Reporter {
} }
} }
export default APIReporter export default MyAPIReporter

File diff suppressed because it is too large Load Diff

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