Compare commits

..

29 Commits

Author SHA1 Message Date
9b901dfe51 test: verify useCalculateKclExpression cancellation 2025-05-16 19:53:57 -07:00
416de9a9fb allow more than one tool (#6945)
* allow more than one tool

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* update tests

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* fmt

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* bump kcl

Signed-off-by: Jess Frazelle <github@jessfraz.com>

---------

Signed-off-by: Jess Frazelle <github@jessfraz.com>
2025-05-16 23:22:50 +00:00
da65426ddc Fix to account for cached body items when computing NodePath (#7030) 2025-05-16 23:22:01 +00:00
585b485852 Revert "stupid paths filtering" (#7028)
Revert "stupid paths filtering (#7027)"

This reverts commit e85f16ff9c.
2025-05-16 22:29:34 +00:00
e85f16ff9c stupid paths filtering (#7027)
Signed-off-by: Jess Frazelle <github@jessfraz.com>
2025-05-16 15:02:58 -07:00
e7d2289a14 Revolve adjacency info (#7008)
* check edge colinear

* cleanup

* revert cargo.toml

* revert cargo.toml properly

* undo yarn.lock

* clippy

* add new sim test

* move tolerance2

* typo

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* fmt

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* update snap

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* push real snap

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* update tests

Signed-off-by: Jess Frazelle <github@jessfraz.com>

---------

Signed-off-by: Jess Frazelle <github@jessfraz.com>
Co-authored-by: Jess Frazelle <jessfraz@users.noreply.github.com>
Co-authored-by: Jess Frazelle <github@jessfraz.com>
2025-05-16 22:02:30 +00:00
d35531758d fix read_to_string to give error (#7022)
updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>
2025-05-16 16:56:19 -04:00
729e0a7949 add a subtract regression test (#7018)
* add a subtraact regression test

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* also rename some github actions job so we can require them;

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* artifacts

Signed-off-by: Jess Frazelle <github@jessfraz.com>

---------

Signed-off-by: Jess Frazelle <github@jessfraz.com>
2025-05-16 20:06:56 +00:00
620b7401aa Update Rust tests to use internal KCL samples on CI (#7014)
* Update Rust tests to use internal KCL samples on CI

* Regenerate manifest with internal KCL samples

* try again

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* remove the needs

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* features

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* features

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* secret

Signed-off-by: Jess Frazelle <github@jessfraz.com>

---------

Signed-off-by: Jess Frazelle <github@jessfraz.com>
Co-authored-by: Jess Frazelle <github@jessfraz.com>
2025-05-16 19:38:55 +00:00
e3e67b00d5 Run the component tests on CI (#7009)
* Run the component tests on CI

* Share WASM build

* Add basic token permissions
2025-05-16 15:51:43 +00:00
49d4f8e5c3 Remove the warningMessage field for command args (#7005) 2025-05-16 10:41:33 -05:00
47b159c605 Remove check on the Start Sketch button (#7004) 2025-05-16 10:38:18 -05:00
c7b086fa69 Change warning message on Chamfer for a more discreet note in tooltip (#7002) 2025-05-16 14:00:31 +00:00
203db79204 Fix light mode code mirror tooltip (#7001)
A CSS selector just needed `.dark` prepended to it
2025-05-16 13:37:41 +00:00
48a4fd8373 Organization and Pro tier link sharing features exposure (#6986)
* Improve url sharing for orgs and pros

* Remove sharing via menu item

* fmt

* Not sure what's different but it is

* fmt & lint

* whoops

* Update snapshots

* Typos from codespell

* Fix alignment

* Update snapshots

* Prune

---------

Co-authored-by: Pierre Jacquier <pierrejacquier39@gmail.com>
Co-authored-by: Pierre Jacquier <pierre@zoo.dev>
2025-05-16 09:51:08 +00:00
17eb84325f Quick follow up fixing up experimetal progress/submit button colors (#6999) 2025-05-16 19:44:10 +10:00
ebf048478d Make Modify with Text-to-CAD selection arg optional by honoring skip: false on non-required args (#6992)
* Make "skip = false" non-required args appear in header

* Make non-required, unskippable selection args work

* Make prompt-to-edit's selection arg optional but non-skippable

* Update src/components/CommandBar/CommandBarSelectionInput.tsx

Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>

* Fix dumb logic bug

Thanks for user testing @Irev-dev

* Update mixed input to show selection

Feel free to revert @Irev-Dev if this is the wrong move, but I found it
odd that this component doesn't show the current selection in the text
like the other selection input does, so I copied that over.

* Merge branch 'main' into franknoirot/adhoc/optional-selection-args

* Merge branch 'main' into franknoirot/adhoc/optional-selection-args

* Merge remote-tracking branch 'origin' into franknoirot/adhoc/optional-selection-args

* fix tests

* change copy again

* Update src/components/CommandBar/CommandBarSelectionMixedInput.tsx

Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>
2025-05-16 05:15:52 -04:00
28a8cd2421 [Bug] fix big screen boot up bug (#6998)
fix big screen boot up bug
2025-05-16 04:55:09 -04:00
1506de92f5 ML commands green branding and experimental badge (#6989)
* Remove tan warning from ml commands, move to experimental green branding

* Oops

* Removed unused var

---------

Co-authored-by: Frank Noirot <frankjohnson1993@gmail.com>
2025-05-16 03:42:35 +00:00
8a03413643 Deflake onboarding test (#6996)
1. Remove all `waitFor` hidden states for the post-dismiss toast:
something about Playwright is making toasts hang in a way I've never
seen in real use. Not something I'm worried about, and we still test
that the toast fires the first time we dismiss.
2. Remove all `scene.connectionEstablished()` calls. This has me more
worried because some of the flakiness on this front seems like we're not
able to handle the rapid machine-speed navigation and overwriting that
this test does when it doesn't have to `waitFor` toasts to disappear.
But that is not the point of this test, which is just to ensure the
onboarding plays correctly and initiates correctly.
2025-05-15 23:27:58 -04:00
f59b806a88 Fix to display warnings when there's a fatal error (#6995)
* Fix to display warnings when there's a fatal error

* Fix JSON test
2025-05-16 03:22:21 +00:00
23a0085c78 Change runtime assert to runtime error and debug assert (#6987) 2025-05-15 22:55:16 -04:00
a280a8c3f0 Nickmccleery/i have no idea what im doing (#6967)
* Yeet in alt param structure.

* updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

---------

Signed-off-by: Jess Frazelle <github@jessfraz.com>
Co-authored-by: Jess Frazelle <github@jessfraz.com>
2025-05-16 02:16:32 +00:00
11620dfa6b Fix to display errors at the call site (#6991) 2025-05-15 22:11:37 -04:00
f6e26e0bab test: Add face_code_ref to the mermaid output (#6985)
* Add face_code_ref to the mermaid output

* Update output
2025-05-15 20:14:31 -04:00
f6b3a55cbf fix link (#6990) 2025-05-16 00:04:23 +00:00
74939e5cd6 Fix execution caching to cache artifact graph NodePath (#6978)
* Fix to add NodePaths to SketchOnFace and SketchOnPlane artifacts

* Fix to only compute the new part of the artifact graph

* Change to early-return sooner when in mock mode

* Add another test

* Fix to propagate NodePath for sketch on face

* Update output
2025-05-15 19:18:03 -04:00
9906c9947a Do not coerce unknown numbers and preserve known units if present (#6961)
Signed-off-by: Nick Cameron <nrc@ncameron.org>
2025-05-16 10:58:21 +12:00
48d6a21f0a Accept multiple export toast messages to be visible (#6979)
* Accept multiple export toast messages to be visible

* Wait for the toast to appear

* Wait before counting toasts
2025-05-15 22:48:15 +00:00
790 changed files with 39912 additions and 8164 deletions

56
.github/workflows/build-wasm.yml vendored Normal file
View File

@ -0,0 +1,56 @@
name: Build WASM
on:
workflow_call:
permissions:
contents: read
jobs:
npm-build-wasm:
runs-on: runs-on=${{ github.run_id }}/family=i7ie.2xlarge/image=ubuntu22-full-x64
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'npm'
- name: Install dependencies
run: npm install
- name: Use correct Rust toolchain
shell: bash
run: |
[ -e rust-toolchain.toml ] || cp rust/rust-toolchain.toml ./
- name: Install rust
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
cache: false # configured below
- uses: taiki-e/install-action@d4635f2de61c8b8104d59cd4aede2060638378cc
with:
tool: wasm-pack
- name: Use Rust cache
uses: Swatinem/rust-cache@v2
with:
workspaces: './rust'
- name: Build Wasm
shell: bash
run: npm run build:wasm
- uses: actions/upload-artifact@v4
with:
name: prepared-wasm
path: |
rust/kcl-wasm-lib/pkg/kcl_wasm_lib*
- uses: actions/upload-artifact@v4
with:
name: prepared-ts-rs-bindings
path: |
rust/kcl-lib/bindings/*

View File

@ -155,7 +155,7 @@ jobs:
shell: bash
run: |
[ -e rust-toolchain.toml ] || cp rust/rust-toolchain.toml ./
- name: Install rust
- name: Install Rust
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
cache: false # Configured below.
@ -190,6 +190,54 @@ jobs:
TAB_API_KEY: ${{ secrets.TAB_API_KEY }}
CI_COMMIT_SHA: ${{ github.event.pull_request.head.sha }}
CI_PR_NUMBER: ${{ github.event.pull_request.number }}
run-internal-kcl-samples:
name: cargo test (internal-kcl-samples)
runs-on:
- runs-on=${{ github.run_id }}
- runner=32cpu-linux-x64
- extras=s3-cache
steps:
- uses: runs-on/action@v1
- uses: actions/create-github-app-token@v1
id: app-token
with:
app-id: ${{ secrets.MODELING_APP_GH_APP_ID }}
private-key: ${{ secrets.MODELING_APP_GH_APP_PRIVATE_KEY }}
owner: ${{ github.repository_owner }}
- uses: actions/checkout@v4
with:
token: ${{ steps.app-token.outputs.token }}
- name: Use correct Rust toolchain
shell: bash
run: |
[ -e rust-toolchain.toml ] || cp rust/rust-toolchain.toml ./
- name: Install Rust
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
cache: false # Configured below.
- name: Start Vector
run: .github/ci-cd-scripts/start-vector-ubuntu.sh
env:
GH_ACTIONS_AXIOM_TOKEN: ${{ secrets.GH_ACTIONS_AXIOM_TOKEN }}
OS_NAME: ${{ env.OS_NAME }}
- uses: taiki-e/install-action@nextest
- name: Download internal KCL samples
run: git clone --depth=1 https://x-access-token:${{ secrets.GH_PAT_KCL_SAMPLES_INTERNAL }}@github.com/KittyCAD/kcl-samples-internal public/kcl-samples/internal
- name: Run tests
shell: bash
run: |-
cd rust/kcl-lib
cargo nextest run \
--retries=10 --no-fail-fast --features artifact-graph --profile=ci \
internal \
2>&1 | tee /tmp/github-actions.log
env:
TWENTY_TWENTY: overwrite
INSTA_UPDATE: always
EXPECTORATE: overwrite
KITTYCAD_API_TOKEN: ${{secrets.KITTYCAD_API_TOKEN_DEV}}
ZOO_HOST: https://api.dev.zoo.dev
MODELING_APP_INTERNAL_SAMPLES_SECRET: ${{secrets.MODELING_APP_INTERNAL_SAMPLES_SECRET}}
run-wasm-tests:
name: Run wasm tests
strategy:

View File

@ -21,14 +21,11 @@ on:
- '**.rs'
- .github/workflows/kcl-language-server.yml
workflow_dispatch:
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
env:
CARGO_INCREMENTAL: 0
CARGO_NET_RETRY: 10
@ -38,10 +35,9 @@ env:
MACOSX_DEPLOYMENT_TARGET: 10.15
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER: aarch64-linux-gnu-gcc
CARGO_TARGET_ARM_UNKNOWN_LINUX_GNUEABIHF_LINKER: arm-linux-gnueabihf-gcc
jobs:
test:
name: vscode tests
name: kcl-language-server (vscode tests)
strategy:
fail-fast: false
matrix:
@ -77,22 +73,20 @@ jobs:
include:
- os: windows-latest
target: x86_64-pc-windows-msvc
code-target:
win32-x64
#- os: windows-latest
#target: i686-pc-windows-msvc
#code-target:
#win32-ia32
#- os: windows-latest
#target: aarch64-pc-windows-msvc
#code-target: win32-arm64
code-target: win32-x64
#- os: windows-latest
#target: i686-pc-windows-msvc
#code-target:
#win32-ia32
#- os: windows-latest
#target: aarch64-pc-windows-msvc
#code-target: win32-arm64
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
code-target:
linux-x64
#- os: ubuntu-latest
#target: aarch64-unknown-linux-musl
#code-target: linux-arm64
code-target: linux-x64
#- os: ubuntu-latest
#target: aarch64-unknown-linux-musl
#code-target: linux-arm64
- os: ubuntu-latest
target: aarch64-unknown-linux-gnu
code-target: linux-arm64
@ -105,41 +99,33 @@ jobs:
- os: macos-latest
target: aarch64-apple-darwin
code-target: darwin-arm64
name: build-release (${{ matrix.target }})
name: kcl-language-server build-release (${{ matrix.target }})
runs-on: ${{ matrix.os }}
container: ${{ matrix.container }}
env:
RA_TARGET: ${{ matrix.target }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: ${{ env.FETCH_DEPTH }}
- name: Use correct Rust toolchain
shell: bash
run: |
rm rust/rust-toolchain.toml
- name: Install rust
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
cache: rust
components: rust-src
target: ${{ matrix.target }}
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
- name: Update apt repositories
if: matrix.target == 'aarch64-unknown-linux-gnu' || matrix.target == 'arm-unknown-linux-gnueabihf' || matrix.os == 'ubuntu-latest'
run: sudo apt-get update
- if: ${{ matrix.os == 'ubuntu-latest' }}
name: Install deps
shell: bash
@ -164,64 +150,53 @@ jobs:
zlib1g-dev
cargo install cross
- name: Install AArch64 target toolchain
if: matrix.target == 'aarch64-unknown-linux-gnu'
run: sudo apt-get install gcc-aarch64-linux-gnu
- name: Install ARM target toolchain
if: matrix.target == 'arm-unknown-linux-gnueabihf'
run: sudo apt-get install gcc-arm-linux-gnueabihf
- name: build
run: |
cd rust
cargo kcl-language-server-release build --client-patch-version ${{ github.run_number }}
- name: Install dependencies
run: |
cd rust/kcl-language-server
# npm will symlink which will cause issues w tarballing later
yarn install
- name: Package Extension (release)
if: startsWith(github.event.ref, 'refs/tags/')
run: |
cd rust/kcl-language-server
npx vsce package --yarn -o "../build/kcl-language-server-${{ matrix.code-target }}.vsix" --target ${{ matrix.code-target }}
- name: Package Extension (nightly)
if: startsWith(github.event.ref, 'refs/tags/') == false
run: |
cd rust/kcl-language-server
npx vsce package --yarn -o "../build/kcl-language-server-${{ matrix.code-target }}.vsix" --target ${{ matrix.code-target }} --pre-release
- name: remove server
if: matrix.target == 'x86_64-unknown-linux-gnu'
run: |
cd rust/kcl-language-server
rm -rf server
- name: Package Extension (no server, release)
if: matrix.target == 'x86_64-unknown-linux-gnu' && startsWith(github.event.ref, 'refs/tags/')
run: |
cd rust/kcl-language-server
npx vsce package --yarn -o ../build/kcl-language-server-no-server.vsix
- name: Package Extension (no server, nightly)
if: matrix.target == 'x86_64-unknown-linux-gnu' && startsWith(github.event.ref, 'refs/tags/') == false
run: |
cd rust/kcl-language-server
npx vsce package --yarn -o ../build/kcl-language-server-no-server.vsix --pre-release
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: release-${{ matrix.target }}
path: ./rust/build
build-release-x86_64-unknown-linux-musl:
name: build-release (x86_64-unknown-linux-musl)
name: kcl-language-server build-release (x86_64-unknown-linux-musl)
runs-on: ubuntu-latest
env:
RA_TARGET: x86_64-unknown-linux-musl
@ -231,7 +206,6 @@ jobs:
image: alpine:latest
volumes:
- /usr/local/cargo/registry:/usr/local/cargo/registry
steps:
- name: Install dependencies
run: |
@ -245,55 +219,46 @@ jobs:
nodejs \
npm \
yarn
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: ${{ env.FETCH_DEPTH }}
- name: Use correct Rust toolchain
shell: bash
run: |
rm rust/rust-toolchain.toml
- name: Install rust
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
cache: rust
components: rust-src
target: ${{ matrix.target }}
- name: build
run: |
cd rust
cargo kcl-language-server-release build --client-patch-version ${{ github.run_number }}
- name: Install dependencies
run: |
cd rust/kcl-language-server
# npm will symlink which will cause issues w tarballing later
yarn install
- name: Package Extension (release)
if: startsWith(github.event.ref, 'refs/tags/')
run: |
cd rust/kcl-language-server
npx vsce package --yarn -o "../build/kcl-language-server-alpine-x64.vsix" --target alpine-x64
- name: Package Extension (release)
if: startsWith(github.event.ref, 'refs/tags/') == false
run: |
cd rust/kcl-language-server
npx vsce package --yarn -o "../build/kcl-language-server-alpine-x64.vsix" --target alpine-x64 --pre-release
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: release-x86_64-unknown-linux-musl
path: ./rust/build
publish:
name: publish
name: kcl-language-server (publish)
runs-on: ubuntu-latest
needs: ["build-release", "build-release-x86_64-unknown-linux-musl"]
if: startsWith(github.event.ref, 'refs/tags')
@ -301,22 +266,17 @@ jobs:
contents: write
steps:
- run: echo "TAG=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- run: 'echo "TAG: $TAG"'
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: ${{ env.FETCH_DEPTH }}
- name: Install Nodejs
uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
- run: echo "HEAD_SHA=$(git rev-parse HEAD)" >> $GITHUB_ENV
- run: 'echo "HEAD_SHA: $HEAD_SHA"'
- uses: actions/download-artifact@v4
with:
name: release-aarch64-apple-darwin
@ -344,33 +304,29 @@ jobs:
- uses: actions/download-artifact@v4
with:
name: release-x86_64-pc-windows-msvc
path:
rust/build
#- uses: actions/download-artifact@v4
#with:
#name: release-i686-pc-windows-msvc
#path:
#build
#- uses: actions/download-artifact@v4
#with:
#name: release-aarch64-pc-windows-msvc
#path: rust/build
path: rust/build
#- uses: actions/download-artifact@v4
#with:
#name: release-i686-pc-windows-msvc
#path:
#build
#- uses: actions/download-artifact@v4
#with:
#name: release-aarch64-pc-windows-msvc
#path: rust/build
- run: ls -al ./rust/build
- name: Publish Release
uses: ./.github/actions/github-release
with:
files: "rust/build/*"
name: ${{ env.TAG }}
token: ${{ secrets.GITHUB_TOKEN }}
- name: move files to dir for upload
shell: bash
run: |
cd rust
mkdir -p releases/language-server/${{ env.TAG }}
cp -r build/* releases/language-server/${{ env.TAG }}
- name: "Authenticate to Google Cloud"
uses: "google-github-actions/auth@v2.1.8"
with:
@ -385,15 +341,12 @@ jobs:
with:
path: rust/releases
destination: dl.kittycad.io
- run: rm rust/build/kcl-language-server-no-server.vsix
- name: Publish Extension (Code Marketplace, release)
# token from https://dev.azure.com/kcl-language-server/
run: |
cd rust/kcl-language-server
npx vsce publish --pat ${{ secrets.VSCE_PAT }} --packagePath ../build/kcl-language-server-*.vsix
- name: Publish Extension (OpenVSX, release)
run: |
cd rust/kcl-language-server

View File

@ -4,7 +4,6 @@
# maturin generate-ci github
#
name: kcl-python-bindings
on:
push:
branches:
@ -27,16 +26,14 @@ on:
- '**.rs'
- .github/workflows/kcl-python-bindings.yml
workflow_dispatch:
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
linux-x86_64:
name: kcl-python-bindings (linux-x86_64)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
@ -58,8 +55,8 @@ jobs:
with:
name: wheels-linux-x86_64
path: rust/kcl-python-bindings/dist
windows:
name: kcl-python-bindings (windows)
runs-on: windows-16-cores
strategy:
matrix:
@ -84,8 +81,8 @@ jobs:
with:
name: wheels-windows-${{ matrix.target }}
path: rust/kcl-python-bindings/dist
macos:
name: kcl-python-bindings (macos)
runs-on: macos-latest
strategy:
matrix:
@ -110,8 +107,8 @@ jobs:
with:
name: wheels-macos-${{ matrix.target }}
path: rust/kcl-python-bindings/dist
test:
name: kcl-python-bindings (test)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
@ -127,8 +124,8 @@ jobs:
env:
KITTYCAD_API_TOKEN: ${{ secrets.KITTYCAD_API_TOKEN_DEV }}
ZOO_HOST: https://api.dev.zoo.dev
sdist:
name: kcl-python-bindings (sdist)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
@ -136,10 +133,10 @@ jobs:
uses: astral-sh/setup-uv@v5
- name: Install codespell
run: |
uv venv .venv
echo "VIRTUAL_ENV=.venv" >> $GITHUB_ENV
echo "$PWD/.venv/bin" >> $GITHUB_PATH
uv pip install pip --upgrade
uv venv .venv
echo "VIRTUAL_ENV=.venv" >> $GITHUB_ENV
echo "$PWD/.venv/bin" >> $GITHUB_PATH
uv pip install pip --upgrade
- name: Build sdist
uses: PyO3/maturin-action@v1
with:
@ -151,7 +148,6 @@ jobs:
with:
name: wheels-sdist
path: rust/kcl-python-bindings/dist
release:
name: Release
runs-on: ubuntu-latest
@ -168,11 +164,11 @@ jobs:
uses: astral-sh/setup-uv@v5
- name: do uv things
run: |
cd rust/kcl-python-bindings
uv venv .venv
echo "VIRTUAL_ENV=.venv" >> $GITHUB_ENV
echo "$PWD/.venv/bin" >> $GITHUB_PATH
uv pip install pip --upgrade
cd rust/kcl-python-bindings
uv venv .venv
echo "VIRTUAL_ENV=.venv" >> $GITHUB_ENV
echo "$PWD/.venv/bin" >> $GITHUB_PATH
uv pip install pip --upgrade
- name: Publish to PyPI
uses: PyO3/maturin-action@v1
env:

View File

@ -28,53 +28,7 @@ jobs:
- run: npm run fmt:check
npm-build-wasm:
# Build the wasm blob once on the fastest runner.
runs-on: runs-on=${{ github.run_id }}/family=i7ie.2xlarge/image=ubuntu22-full-x64
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'npm'
- name: Install dependencies
run: npm install
- name: Use correct Rust toolchain
shell: bash
run: |
[ -e rust-toolchain.toml ] || cp rust/rust-toolchain.toml ./
- name: Install rust
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
cache: false # Configured below.
- uses: taiki-e/install-action@d4635f2de61c8b8104d59cd4aede2060638378cc
with:
tool: wasm-pack
- name: Rust Cache
uses: Swatinem/rust-cache@v2
with:
workspaces: './rust'
- name: Build Wasm
shell: bash
run: npm run build:wasm
- uses: actions/upload-artifact@v4
with:
name: prepared-wasm
path: |
rust/kcl-wasm-lib/pkg/kcl_wasm_lib*
- uses: actions/upload-artifact@v4
with:
name: prepared-ts-rs-bindings
path: |
rust/kcl-lib/bindings/*
uses: ./.github/workflows/build-wasm.yml
npm-tsc:
runs-on: ubuntu-latest
@ -173,122 +127,3 @@ jobs:
uses: actions/checkout@v4
- name: Run codespell
uses: crate-ci/typos@v1.32.0
npm-unit-test-kcl-samples:
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
- uses: taiki-e/install-action@d4635f2de61c8b8104d59cd4aede2060638378cc
with:
tool: wasm-pack
- 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 simpleserver:bg
if: ${{ github.event_name != 'release' && github.event_name != 'schedule' }}
- name: Install Chromium Browser
if: ${{ github.event_name != 'release' && github.event_name != 'schedule' }}
run: npm run playwright install chromium --with-deps
- name: Download internal KCL samples
run: git clone --depth=1 https://x-access-token:${{ secrets.GH_PAT_KCL_SAMPLES_INTERNAL }}@github.com/KittyCAD/kcl-samples-internal public/kcl-samples/internal
- name: Regenerate KCL samples manifest
run: cd rust/kcl-lib && EXPECTORATE=overwrite cargo test generate_manifest
- name: Check public and internal KCL samples
if: ${{ github.event_name != 'release' && github.event_name != 'schedule' }}
run: npm run test:unit:kcl-samples
env:
VITE_KC_DEV_TOKEN: ${{ secrets.KITTYCAD_API_TOKEN_DEV }}
npm-unit-test:
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
- uses: taiki-e/install-action@d4635f2de61c8b8104d59cd4aede2060638378cc
with:
tool: wasm-pack
- 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 simpleserver:bg
if: ${{ github.event_name != 'release' && github.event_name != 'schedule' }}
- name: Install Chromium Browser
if: ${{ github.event_name != 'release' && github.event_name != 'schedule' }}
run: npm run playwright install chromium --with-deps
- name: Run unit tests
if: ${{ github.event_name != 'release' && github.event_name != 'schedule' }}
run: xvfb-run -a npm run test:unit
env:
VITE_KC_DEV_TOKEN: ${{ secrets.KITTYCAD_API_TOKEN_DEV }}
- name: Check for changes
if: ${{ github.event_name != 'release' && github.event_name != 'schedule' }}
id: git-check
run: |
git add src/lang/std/artifactMapGraphs
if git status src/lang/std/artifactMapGraphs | grep -q "Changes to be committed"
then echo "modified=true" >> $GITHUB_OUTPUT
else echo "modified=false" >> $GITHUB_OUTPUT
fi
- name: Commit changes, if any
if: ${{ github.event_name != 'release' && github.event_name != 'schedule' && steps.git-check.outputs.modified == 'true' }}
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git remote set-url origin https://${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git
git fetch origin
echo ${{ github.head_ref }}
git checkout ${{ github.head_ref }}
# TODO when webkit works on ubuntu remove the os part of the commit message
git commit -am "Look at this (photo)Graph *in the voice of Nickelback*" || true
git push
git push origin ${{ github.head_ref }}

124
.github/workflows/unit-tests.yml vendored Normal file
View File

@ -0,0 +1,124 @@
name: Unit Tests
on:
pull_request:
push:
branches:
- main
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
permissions:
contents: write
pull-requests: write
actions: read
jobs:
npm-build-wasm:
uses: ./.github/workflows/build-wasm.yml
npm-test-unit:
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
- uses: taiki-e/install-action@d4635f2de61c8b8104d59cd4aede2060638378cc
with:
tool: wasm-pack
- 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 simpleserver:bg
if: ${{ github.event_name != 'release' && github.event_name != 'schedule' }}
- name: Install Chromium Browser
if: ${{ github.event_name != 'release' && github.event_name != 'schedule' }}
run: npm run playwright install chromium --with-deps
- name: Run unit tests
if: ${{ github.event_name != 'release' && github.event_name != 'schedule' }}
run: xvfb-run -a npm run test:unit
env:
VITE_KC_DEV_TOKEN: ${{ secrets.KITTYCAD_API_TOKEN_DEV }}
- name: Check for changes
if: ${{ github.event_name != 'release' && github.event_name != 'schedule' }}
id: git-check
run: |
git add src/lang/std/artifactMapGraphs
if git status src/lang/std/artifactMapGraphs | grep -q "Changes to be committed"
then echo "modified=true" >> $GITHUB_OUTPUT
else echo "modified=false" >> $GITHUB_OUTPUT
fi
- name: Commit changes, if any
if: ${{ github.event_name != 'release' && github.event_name != 'schedule' && steps.git-check.outputs.modified == 'true' }}
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git remote set-url origin https://${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git
git fetch origin
echo ${{ github.head_ref }}
git checkout ${{ github.head_ref }}
# TODO when webkit works on ubuntu remove the os part of the commit message
git commit -am "Look at this (photo)Graph *in the voice of Nickelback*" || true
git push
git push origin ${{ github.head_ref }}
npm-test-unit-components:
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
- uses: taiki-e/install-action@d4635f2de61c8b8104d59cd4aede2060638378cc
with:
tool: wasm-pack
- 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/
- name: Run component tests
run: npm run test:unit:components

2
.gitignore vendored
View File

@ -58,6 +58,8 @@ trace.zip
/public/kcl-samples/.github
/public/kcl-samples/screenshots/main.kcl
/public/kcl-samples/step/main.kcl
/public/kcl-samples/internal
/rust/kcl-lib/tests/kcl_samples/internal
/test-results/
/playwright-report/
/blob-report/

View File

@ -114,7 +114,6 @@ test-unit: install ## Run the unit tests
npm run test:unit:components
@ curl -fs localhost:3000 >/dev/null || ( echo "Error: localhost:3000 not available, 'make run-web' first" && exit 1 )
npm run test:unit
npm run test:unit:kcl-samples
.PHONY: test-e2e
test-e2e: test-e2e-$(TARGET)

View File

@ -21,7 +21,7 @@ extend-exclude = [
]
[default.extend-words]
metalness = "metalness" # appearance API
metalness = "metalness" # appearance API
Hom = "Hom" # short for homogenous
typ = "typ" # used to declare a variable named 'type' which is a reserved keyword in Rust
ue = "ue" # short for UnaryExpression
@ -29,6 +29,7 @@ THRE = "THRE" # Weird bug that wrongly detects THREEjs as a typo
nwo = "nwo" # don't know what this is about tbh
"ot" = "ot" # some abbreviation, idk what
"oe" = "oe" # some abbreviation, idk what
"colinear" = "colinear" # some engine shit, kidding
[default]
extend-ignore-identifiers-re = [

View File

@ -46,7 +46,7 @@ angledLine(
exampleSketch = startSketchOn(XZ)
|> startProfile(at = [0, 0])
|> yLine(endAbsolute = 15)
|> angledLine(angle = 30deg, length = 15)
|> angledLine(angle = 30, length = 15)
|> line(end = [8, -10])
|> yLine(endAbsolute = 0)
|> close()

View File

@ -42,7 +42,7 @@ exampleSketch = startSketchOn(XZ)
|> line(endAbsolute = [5, 10])
|> line(endAbsolute = [-10, 10], tag = $lineToIntersect)
|> line(endAbsolute = [0, 20])
|> angledLineThatIntersects(angle = 80deg, intersectTag = lineToIntersect, offset = 10)
|> angledLineThatIntersects(angle = 80, intersectTag = lineToIntersect, offset = 10)
|> close()
example = extrude(exampleSketch, length = 10)

View File

@ -54,7 +54,7 @@ example = extrude(exampleSketch, length = 5)
// Add color to a revolved solid.
sketch001 = startSketchOn(XY)
|> circle(center = [15, 0], radius = 5)
|> revolve(angle = 360deg, axis = Y)
|> revolve(angle = 360, axis = Y)
|> appearance(color = '#ff0000', metalness = 90, roughness = 90)
```
@ -171,7 +171,7 @@ exampleSketch = startSketchOn(XZ)
|> patternCircular2d(
center = [0, 0],
instances = 13,
arcDegrees = 360deg,
arcDegrees = 360,
rotateDuplicates = true,
)
@ -188,9 +188,9 @@ example = extrude(exampleSketch, length = 1)
sweepPath = startSketchOn(XZ)
|> startProfile(at = [0.05, 0.05])
|> line(end = [0, 7])
|> tangentialArc(angle = 90deg, radius = 5)
|> tangentialArc(angle = 90, radius = 5)
|> line(end = [-3, 0])
|> tangentialArc(angle = -90deg, radius = 5)
|> tangentialArc(angle = -90, radius = 5)
|> line(end = [0, 7])
pipeHole = startSketchOn(XY)

View File

@ -46,7 +46,7 @@ Unless this makes a lot of sense and feels like what you're looking for to const
exampleSketch = startSketchOn(XZ)
|> startProfile(at = [0, 0])
|> line(end = [10, 0])
|> arc(angleStart = 0deg, angleEnd = 280deg, radius = 16)
|> arc(angleStart = 0, angleEnd = 280, radius = 16)
|> close()
example = extrude(exampleSketch, length = 10)
```

View File

@ -19,7 +19,7 @@ E: number = 2.71828182845904523536028747135266250_
exampleSketch = startSketchOn(XZ)
|> startProfile(at = [0, 0])
|> angledLine(
angle = 30deg,
angle = 30,
length = 2 * E ^ 2,
)
|> yLine(endAbsolute = 0)

View File

@ -19,7 +19,7 @@ TAU: number = 6.28318530717958647692528676655900577_
exampleSketch = startSketchOn(XZ)
|> startProfile(at = [0, 0])
|> angledLine(
angle = 50deg,
angle = 50,
length = 10 * TAU,
)
|> yLine(endAbsolute = 0)

View File

@ -42,7 +42,7 @@ You can provide more than one sketch to extrude, and they will all be extruded i
example = startSketchOn(XZ)
|> startProfile(at = [0, 0])
|> line(end = [10, 0])
|> arc(angleStart = 120deg, angleEnd = 0deg, radius = 5)
|> arc(angleStart = 120, angleEnd = 0, radius = 5)
|> line(end = [5, 0])
|> line(end = [0, 10])
|> bezierCurve(control1 = [-10, 0], control2 = [2, 10], end = [-5, 10])
@ -56,7 +56,7 @@ example = startSketchOn(XZ)
```kcl
exampleSketch = startSketchOn(XZ)
|> startProfile(at = [-10, 0])
|> arc(angleStart = 120deg, angleEnd = -60deg, radius = 5)
|> arc(angleStart = 120, angleEnd = -60, radius = 5)
|> line(end = [10, 0])
|> line(end = [5, 0])
|> bezierCurve(control1 = [-3, 0], control2 = [2, 10], end = [-5, 10])
@ -72,7 +72,7 @@ example = extrude(exampleSketch, length = 10)
```kcl
exampleSketch = startSketchOn(XZ)
|> startProfile(at = [-10, 0])
|> arc(angleStart = 120deg, angleEnd = -60deg, radius = 5)
|> arc(angleStart = 120, angleEnd = -60, radius = 5)
|> line(end = [10, 0])
|> line(end = [5, 0])
|> bezierCurve(control1 = [-3, 0], control2 = [2, 10], end = [-5, 10])
@ -88,7 +88,7 @@ example = extrude(exampleSketch, length = 20, symmetric = true)
```kcl
exampleSketch = startSketchOn(XZ)
|> startProfile(at = [-10, 0])
|> arc(angleStart = 120deg, angleEnd = -60deg, radius = 5)
|> arc(angleStart = 120, angleEnd = -60, radius = 5)
|> line(end = [10, 0])
|> line(end = [5, 0])
|> bezierCurve(control1 = [-3, 0], control2 = [2, 10], end = [-5, 10])

View File

@ -80,7 +80,7 @@ fn decagon(@radius) {
// Start the decagon sketch at this point.
startOfDecagonSketch = startSketchOn(XY)
|> startProfile(at = [(cos(0deg)*radius), (sin(0deg) * radius)])
|> startProfile(at = [(cos(0)*radius), (sin(0) * radius)])
// Use a `reduce` to draw the remaining decagon sides.
// For each number in the array 1..10, run the given function,

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 @@ abs(@input: number): number
### Examples
```kcl
myAngle = -120deg
myAngle = -120
sketch001 = startSketchOn(XZ)
|> startProfile(at = [0, 0])

View File

@ -30,7 +30,7 @@ cos(@num: number(Angle)): number(_)
exampleSketch = startSketchOn(XZ)
|> startProfile(at = [0, 0])
|> angledLine(
angle = 30deg,
angle = 30,
length = 3 / cos(30deg),
)
|> yLine(endAbsolute = 0)

View File

@ -30,7 +30,7 @@ max(@input: [number; 1+]): number
exampleSketch = startSketchOn(XZ)
|> startProfile(at = [0, 0])
|> angledLine(
angle = 70deg,
angle = 70,
length = max([15, 31, 4, 13, 22])
)
|> line(end = [20, 0])

View File

@ -30,7 +30,7 @@ min(@input: [number; 1+]): number
exampleSketch = startSketchOn(XZ)
|> startProfile(at = [0, 0])
|> angledLine(
angle = 70deg,
angle = 70,
length = min([15, 31, 4, 13, 22])
)
|> line(end = [20, 0])

View File

@ -34,7 +34,7 @@ cartesian (x/y/z grid) coordinates.
```kcl
exampleSketch = startSketchOn(XZ)
|> startProfile(at = [0, 0])
|> line(end = polar(angle = 30deg, length = 5), tag = $thing)
|> line(end = polar(angle = 30, length = 5), tag = $thing)
|> line(end = [0, 5])
|> line(end = [segEndX(thing), 0])
|> line(end = [-20, 10])

View File

@ -34,7 +34,7 @@ pow(
exampleSketch = startSketchOn(XZ)
|> startProfile(at = [0, 0])
|> angledLine(
angle = 50deg,
angle = 50,
length = pow(5, exp = 2),
)
|> yLine(endAbsolute = 0)

View File

@ -30,7 +30,7 @@ sin(@num: number(Angle)): number(_)
exampleSketch = startSketchOn(XZ)
|> startProfile(at = [0, 0])
|> angledLine(
angle = 50deg,
angle = 50,
length = 15 / sin(135deg),
)
|> yLine(endAbsolute = 0)

View File

@ -30,7 +30,7 @@ sqrt(@input: number): number
exampleSketch = startSketchOn(XZ)
|> startProfile(at = [0, 0])
|> angledLine(
angle = 50deg,
angle = 50,
length = sqrt(2500),
)
|> yLine(endAbsolute = 0)

View File

@ -30,7 +30,7 @@ tan(@num: number(Angle)): number(_)
exampleSketch = startSketchOn(XZ)
|> startProfile(at = [0, 0])
|> angledLine(
angle = 50deg,
angle = 50,
length = 50 * tan((1/2): number(rad)),
)
|> yLine(endAbsolute = 0)

File diff suppressed because one or more lines are too long

View File

@ -30,7 +30,7 @@ units::toDegrees(@num: number(Angle)): number(deg)
exampleSketch = startSketchOn(XZ)
|> startProfile(at = [0, 0])
|> angledLine(
angle = 50deg,
angle = 50,
length = 70 * cos(units::toDegrees((PI/4): number(rad))),
)
|> yLine(endAbsolute = 0)

View File

@ -30,8 +30,8 @@ units::toRadians(@num: number(Angle)): number(rad)
exampleSketch = startSketchOn(XZ)
|> startProfile(at = [0, 0])
|> angledLine(
angle = 50deg,
length = 70 * cos(units::toRadians(45deg)),
angle = 50,
length = 70 * cos(units::toRadians(45)),
)
|> yLine(endAbsolute = 0)
|> close()

View File

@ -30,10 +30,10 @@ getNextAdjacentEdge(@edge: TagIdentifier): Uuid
exampleSketch = startSketchOn(XZ)
|> startProfile(at = [0, 0])
|> line(end = [10, 0])
|> angledLine(angle = 60deg, length = 10)
|> angledLine(angle = 120deg, length = 10)
|> angledLine(angle = 60, length = 10)
|> angledLine(angle = 120, length = 10)
|> line(end = [-10, 0])
|> angledLine(angle = 240deg, length = 10, tag = $referenceEdge)
|> angledLine(angle = 240, length = 10, tag = $referenceEdge)
|> close()
example = extrude(exampleSketch, length = 5)

View File

@ -30,10 +30,10 @@ getOppositeEdge(@edge: TagIdentifier): Uuid
exampleSketch = startSketchOn(XZ)
|> startProfile(at = [0, 0])
|> line(end = [10, 0])
|> angledLine(angle = 60deg, length = 10)
|> angledLine(angle = 120deg, length = 10)
|> angledLine(angle = 60, length = 10)
|> angledLine(angle = 120, length = 10)
|> line(end = [-10, 0])
|> angledLine(angle = 240deg, length = 10, tag = $referenceEdge)
|> angledLine(angle = 240, length = 10, tag = $referenceEdge)
|> close()
example = extrude(exampleSketch, length = 5)

View File

@ -30,10 +30,10 @@ getPreviousAdjacentEdge(@edge: TagIdentifier): Uuid
exampleSketch = startSketchOn(XZ)
|> startProfile(at = [0, 0])
|> line(end = [10, 0])
|> angledLine(angle = 60deg, length = 10)
|> angledLine(angle = 120deg, length = 10)
|> angledLine(angle = 60, length = 10)
|> angledLine(angle = 120, length = 10)
|> line(end = [-10, 0])
|> angledLine(angle = 240deg, length = 10, tag = $referenceEdge)
|> angledLine(angle = 240, length = 10, tag = $referenceEdge)
|> close()
example = extrude(exampleSketch, length = 5)

View File

@ -43,11 +43,11 @@ a = 10
b = 14
startSketchOn(XZ)
|> startProfile(at = [0, 0])
|> involuteCircular(startRadius = a, endRadius = b, angle = 60deg)
|> involuteCircular(startRadius = a, endRadius = b, angle = 60)
|> involuteCircular(
startRadius = a,
endRadius = b,
angle = 60deg,
angle = 60,
reverse = true,
)
```

View File

@ -48,7 +48,7 @@ exampleSketch = startSketchOn(XZ)
|> patternCircular2d(
center = [0, 0],
instances = 13,
arcDegrees = 360deg,
arcDegrees = 360,
rotateDuplicates = true,
)

View File

@ -49,7 +49,7 @@ example = extrude(exampleSketch, length = -5)
axis = [1, -1, 0],
center = [10, -20, 0],
instances = 11,
arcDegrees = 360deg,
arcDegrees = 360,
rotateDuplicates = true,
)
```

View File

@ -123,7 +123,7 @@ fn transform(@i) {
pow(0.9, exp = i)
],
// Turn by 15 degrees each time.
rotation = { angle = 15deg * i, origin = "local" }
rotation = { angle = 15 * i, origin = "local" }
}
}
@ -158,7 +158,7 @@ fn transform(@i) {
return {
translate = [0, 0, -i * width],
rotation = {
angle = 90deg * i,
angle = 90 * i,
// Rotate around the overall scene's origin.
origin = "global"
}
@ -204,7 +204,7 @@ fn transform(@i) {
// Transform functions can return multiple transforms. They'll be applied in order.
return [
{ translate = [30 * i, 0, 0] },
{ rotation = { angle = 45deg * i } }
{ rotation = { angle = 45 * i } }
]
}
startSketchOn(XY)

View File

@ -29,8 +29,8 @@ profileStart(@profile: Sketch): [number]
```kcl
sketch001 = startSketchOn(XY)
|> startProfile(at = [5, 2])
|> angledLine(angle = 120deg, length = 50, tag = $seg01)
|> angledLine(angle = segAng(seg01) + 120deg, length = 50)
|> angledLine(angle = 120, length = 50, tag = $seg01)
|> angledLine(angle = segAng(seg01) + 120, length = 50)
|> line(end = profileStart(%))
|> close()
|> extrude(length = 20)

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -49,9 +49,9 @@ If you want to apply the transform in global space, set `global` to `true`. The
sweepPath = startSketchOn(XZ)
|> startProfile(at = [0.05, 0.05])
|> line(end = [0, 7])
|> tangentialArc(angle = 90deg, radius = 5)
|> tangentialArc(angle = 90, radius = 5)
|> line(end = [-3, 0])
|> tangentialArc(angle = -90deg, radius = 5)
|> tangentialArc(angle = -90, radius = 5)
|> line(end = [0, 7])
// Create a hole for the pipe.
@ -85,8 +85,8 @@ cube
sketch001 = startSketchOn(XY)
rectangleSketch = startProfile(sketch001, at = [-200, 23.86])
|> angledLine(angle = 0deg, length = 73.47, tag = $rectangleSegmentA001)
|> angledLine(angle = segAng(rectangleSegmentA001) - 90deg, length = 50.61)
|> angledLine(angle = 0, length = 73.47, tag = $rectangleSegmentA001)
|> angledLine(angle = segAng(rectangleSegmentA001) - 90, length = 50.61)
|> angledLine(angle = segAng(rectangleSegmentA001), length = -segLen(rectangleSegmentA001))
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close()
@ -96,7 +96,7 @@ circleSketch = circle(sketch001, center = [200, -30.29], radius = 32.63)
sketch002 = startSketchOn(YZ)
sweepPath = startProfile(sketch002, at = [0, 0])
|> yLine(length = 231.81)
|> tangentialArc(radius = 80, angle = -90deg)
|> tangentialArc(radius = 80, angle = -90)
|> xLine(length = 384.93)
parts = sweep([rectangleSketch, circleSketch], path = sweepPath)

View File

@ -29,9 +29,9 @@ segLen(@tag: TagIdentifier): number
```kcl
exampleSketch = startSketchOn(XZ)
|> startProfile(at = [0, 0])
|> angledLine(angle = 60deg, length = 10, tag = $thing)
|> tangentialArc(angle = -120deg, radius = 5)
|> angledLine(angle = -60deg, length = segLen(thing))
|> angledLine(angle = 60, length = 10, tag = $thing)
|> tangentialArc(angle = -120, radius = 5)
|> angledLine(angle = -60, length = segLen(thing))
|> close()
example = extrude(exampleSketch, length = 5)

View File

@ -146,7 +146,7 @@ exampleSketch = startSketchOn(XY)
|> line(end = [-2, 0])
|> close()
example = revolve(exampleSketch, axis = Y, angle = 180deg)
example = revolve(exampleSketch, axis = Y, angle = 180)
exampleSketch002 = startSketchOn(example, face = END)
|> startProfile(at = [4.5, -5])
@ -178,7 +178,7 @@ exampleSketch = startSketchOn(XY)
example = revolve(
exampleSketch,
axis = Y,
angle = 180deg,
angle = 180,
tagEnd = $end01,
)

View File

@ -14595,7 +14595,7 @@
"deprecated": false,
"examples": [
[
"exampleSketch = startSketchOn(XZ)\n |> startProfile(at = [0, 0])\n |> yLine(endAbsolute = 15)\n |> angledLine(angle = 30deg, length = 15)\n |> line(end = [8, -10])\n |> yLine(endAbsolute = 0)\n |> close()\n\nexample = extrude(exampleSketch, length = 10)",
"exampleSketch = startSketchOn(XZ)\n |> startProfile(at = [0, 0])\n |> yLine(endAbsolute = 15)\n |> angledLine(angle = 30, length = 15)\n |> line(end = [8, -10])\n |> yLine(endAbsolute = 0)\n |> close()\n\nexample = extrude(exampleSketch, length = 10)",
false
]
]
@ -24376,7 +24376,7 @@
"deprecated": false,
"examples": [
[
"exampleSketch = startSketchOn(XZ)\n |> startProfile(at = [0, 0])\n |> line(endAbsolute = [5, 10])\n |> line(endAbsolute = [-10, 10], tag = $lineToIntersect)\n |> line(endAbsolute = [0, 20])\n |> angledLineThatIntersects(angle = 80deg, intersectTag = lineToIntersect, offset = 10)\n |> close()\n\nexample = extrude(exampleSketch, length = 10)",
"exampleSketch = startSketchOn(XZ)\n |> startProfile(at = [0, 0])\n |> line(endAbsolute = [5, 10])\n |> line(endAbsolute = [-10, 10], tag = $lineToIntersect)\n |> line(endAbsolute = [0, 20])\n |> angledLineThatIntersects(angle = 80, intersectTag = lineToIntersect, offset = 10)\n |> close()\n\nexample = extrude(exampleSketch, length = 10)",
false
]
]
@ -32520,7 +32520,7 @@
false
],
[
"// Add color to a revolved solid.\nsketch001 = startSketchOn(XY)\n |> circle(center = [15, 0], radius = 5)\n |> revolve(angle = 360deg, axis = Y)\n |> appearance(color = '#ff0000', metalness = 90, roughness = 90)",
"// Add color to a revolved solid.\nsketch001 = startSketchOn(XY)\n |> circle(center = [15, 0], radius = 5)\n |> revolve(angle = 360, axis = Y)\n |> appearance(color = '#ff0000', metalness = 90, roughness = 90)",
false
],
[
@ -32544,11 +32544,11 @@
false
],
[
"// Color the result of a 2D pattern that was extruded.\nexampleSketch = startSketchOn(XZ)\n |> startProfile(at = [.5, 25])\n |> line(end = [0, 5])\n |> line(end = [-1, 0])\n |> line(end = [0, -5])\n |> close()\n |> patternCircular2d(\n center = [0, 0],\n instances = 13,\n arcDegrees = 360deg,\n rotateDuplicates = true,\n )\n\nexample = extrude(exampleSketch, length = 1)\n |> appearance(color = '#ff0000', metalness = 90, roughness = 90)",
"// Color the result of a 2D pattern that was extruded.\nexampleSketch = startSketchOn(XZ)\n |> startProfile(at = [.5, 25])\n |> line(end = [0, 5])\n |> line(end = [-1, 0])\n |> line(end = [0, -5])\n |> close()\n |> patternCircular2d(\n center = [0, 0],\n instances = 13,\n arcDegrees = 360,\n rotateDuplicates = true,\n )\n\nexample = extrude(exampleSketch, length = 1)\n |> appearance(color = '#ff0000', metalness = 90, roughness = 90)",
false
],
[
"// Color the result of a sweep.\n\n// Create a path for the sweep.\nsweepPath = startSketchOn(XZ)\n |> startProfile(at = [0.05, 0.05])\n |> line(end = [0, 7])\n |> tangentialArc(angle = 90deg, radius = 5)\n |> line(end = [-3, 0])\n |> tangentialArc(angle = -90deg, radius = 5)\n |> line(end = [0, 7])\n\npipeHole = startSketchOn(XY)\n |> circle(center = [0, 0], radius = 1.5)\n\nsweepSketch = startSketchOn(XY)\n |> circle(center = [0, 0], radius = 2)\n |> subtract2d(tool = pipeHole)\n |> sweep(path = sweepPath)\n |> appearance(color = \"#ff0000\", metalness = 50, roughness = 50)",
"// Color the result of a sweep.\n\n// Create a path for the sweep.\nsweepPath = startSketchOn(XZ)\n |> startProfile(at = [0.05, 0.05])\n |> line(end = [0, 7])\n |> tangentialArc(angle = 90, radius = 5)\n |> line(end = [-3, 0])\n |> tangentialArc(angle = -90, radius = 5)\n |> line(end = [0, 7])\n\npipeHole = startSketchOn(XY)\n |> circle(center = [0, 0], radius = 1.5)\n\nsweepSketch = startSketchOn(XY)\n |> circle(center = [0, 0], radius = 2)\n |> subtract2d(tool = pipeHole)\n |> sweep(path = sweepPath)\n |> appearance(color = \"#ff0000\", metalness = 50, roughness = 50)",
false
],
[
@ -45553,7 +45553,7 @@
"deprecated": false,
"examples": [
[
"exampleSketch = startSketchOn(XZ)\n |> startProfile(at = [0, 0])\n |> line(end = [10, 0])\n |> arc(angleStart = 0deg, angleEnd = 280deg, radius = 16)\n |> close()\nexample = extrude(exampleSketch, length = 10)",
"exampleSketch = startSketchOn(XZ)\n |> startProfile(at = [0, 0])\n |> line(end = [10, 0])\n |> arc(angleStart = 0, angleEnd = 280, radius = 16)\n |> close()\nexample = extrude(exampleSketch, length = 10)",
false
],
[
@ -81551,19 +81551,19 @@
"deprecated": false,
"examples": [
[
"example = startSketchOn(XZ)\n |> startProfile(at = [0, 0])\n |> line(end = [10, 0])\n |> arc(angleStart = 120deg, angleEnd = 0deg, radius = 5)\n |> line(end = [5, 0])\n |> line(end = [0, 10])\n |> bezierCurve(control1 = [-10, 0], control2 = [2, 10], end = [-5, 10])\n |> line(end = [-5, -2])\n |> close()\n |> extrude(length = 10)",
"example = startSketchOn(XZ)\n |> startProfile(at = [0, 0])\n |> line(end = [10, 0])\n |> arc(angleStart = 120, angleEnd = 0, radius = 5)\n |> line(end = [5, 0])\n |> line(end = [0, 10])\n |> bezierCurve(control1 = [-10, 0], control2 = [2, 10], end = [-5, 10])\n |> line(end = [-5, -2])\n |> close()\n |> extrude(length = 10)",
false
],
[
"exampleSketch = startSketchOn(XZ)\n |> startProfile(at = [-10, 0])\n |> arc(angleStart = 120deg, angleEnd = -60deg, radius = 5)\n |> line(end = [10, 0])\n |> line(end = [5, 0])\n |> bezierCurve(control1 = [-3, 0], control2 = [2, 10], end = [-5, 10])\n |> line(end = [-4, 10])\n |> line(end = [-5, -2])\n |> close()\n\nexample = extrude(exampleSketch, length = 10)",
"exampleSketch = startSketchOn(XZ)\n |> startProfile(at = [-10, 0])\n |> arc(angleStart = 120, angleEnd = -60, radius = 5)\n |> line(end = [10, 0])\n |> line(end = [5, 0])\n |> bezierCurve(control1 = [-3, 0], control2 = [2, 10], end = [-5, 10])\n |> line(end = [-4, 10])\n |> line(end = [-5, -2])\n |> close()\n\nexample = extrude(exampleSketch, length = 10)",
false
],
[
"exampleSketch = startSketchOn(XZ)\n |> startProfile(at = [-10, 0])\n |> arc(angleStart = 120deg, angleEnd = -60deg, radius = 5)\n |> line(end = [10, 0])\n |> line(end = [5, 0])\n |> bezierCurve(control1 = [-3, 0], control2 = [2, 10], end = [-5, 10])\n |> line(end = [-4, 10])\n |> line(end = [-5, -2])\n |> close()\n\nexample = extrude(exampleSketch, length = 20, symmetric = true)",
"exampleSketch = startSketchOn(XZ)\n |> startProfile(at = [-10, 0])\n |> arc(angleStart = 120, angleEnd = -60, radius = 5)\n |> line(end = [10, 0])\n |> line(end = [5, 0])\n |> bezierCurve(control1 = [-3, 0], control2 = [2, 10], end = [-5, 10])\n |> line(end = [-4, 10])\n |> line(end = [-5, -2])\n |> close()\n\nexample = extrude(exampleSketch, length = 20, symmetric = true)",
false
],
[
"exampleSketch = startSketchOn(XZ)\n |> startProfile(at = [-10, 0])\n |> arc(angleStart = 120deg, angleEnd = -60deg, radius = 5)\n |> line(end = [10, 0])\n |> line(end = [5, 0])\n |> bezierCurve(control1 = [-3, 0], control2 = [2, 10], end = [-5, 10])\n |> line(end = [-4, 10])\n |> line(end = [-5, -2])\n |> close()\n\nexample = extrude(exampleSketch, length = 10, bidirectionalLength = 50)",
"exampleSketch = startSketchOn(XZ)\n |> startProfile(at = [-10, 0])\n |> arc(angleStart = 120, angleEnd = -60, radius = 5)\n |> line(end = [10, 0])\n |> line(end = [5, 0])\n |> bezierCurve(control1 = [-3, 0], control2 = [2, 10], end = [-5, 10])\n |> line(end = [-4, 10])\n |> line(end = [-5, -2])\n |> close()\n\nexample = extrude(exampleSketch, length = 10, bidirectionalLength = 50)",
false
]
]
@ -81677,7 +81677,7 @@
"deprecated": false,
"examples": [
[
"exampleSketch = startSketchOn(XZ)\n |> startProfile(at = [0, 0])\n |> line(end = [10, 0])\n |> angledLine(angle = 60deg, length = 10)\n |> angledLine(angle = 120deg, length = 10)\n |> line(end = [-10, 0])\n |> angledLine(angle = 240deg, length = 10, tag = $referenceEdge)\n |> close()\n\nexample = extrude(exampleSketch, length = 5)\n |> fillet(radius = 3, tags = [getNextAdjacentEdge(referenceEdge)])",
"exampleSketch = startSketchOn(XZ)\n |> startProfile(at = [0, 0])\n |> line(end = [10, 0])\n |> angledLine(angle = 60, length = 10)\n |> angledLine(angle = 120, length = 10)\n |> line(end = [-10, 0])\n |> angledLine(angle = 240, length = 10, tag = $referenceEdge)\n |> close()\n\nexample = extrude(exampleSketch, length = 5)\n |> fillet(radius = 3, tags = [getNextAdjacentEdge(referenceEdge)])",
false
]
]
@ -81730,7 +81730,7 @@
"deprecated": false,
"examples": [
[
"exampleSketch = startSketchOn(XZ)\n |> startProfile(at = [0, 0])\n |> line(end = [10, 0])\n |> angledLine(angle = 60deg, length = 10)\n |> angledLine(angle = 120deg, length = 10)\n |> line(end = [-10, 0])\n |> angledLine(angle = 240deg, length = 10, tag = $referenceEdge)\n |> close()\n\nexample = extrude(exampleSketch, length = 5)\n |> fillet(radius = 3, tags = [getOppositeEdge(referenceEdge)])",
"exampleSketch = startSketchOn(XZ)\n |> startProfile(at = [0, 0])\n |> line(end = [10, 0])\n |> angledLine(angle = 60, length = 10)\n |> angledLine(angle = 120, length = 10)\n |> line(end = [-10, 0])\n |> angledLine(angle = 240, length = 10, tag = $referenceEdge)\n |> close()\n\nexample = extrude(exampleSketch, length = 5)\n |> fillet(radius = 3, tags = [getOppositeEdge(referenceEdge)])",
false
]
]
@ -81783,7 +81783,7 @@
"deprecated": false,
"examples": [
[
"exampleSketch = startSketchOn(XZ)\n |> startProfile(at = [0, 0])\n |> line(end = [10, 0])\n |> angledLine(angle = 60deg, length = 10)\n |> angledLine(angle = 120deg, length = 10)\n |> line(end = [-10, 0])\n |> angledLine(angle = 240deg, length = 10, tag = $referenceEdge)\n |> close()\n\nexample = extrude(exampleSketch, length = 5)\n |> fillet(radius = 3, tags = [getPreviousAdjacentEdge(referenceEdge)])",
"exampleSketch = startSketchOn(XZ)\n |> startProfile(at = [0, 0])\n |> line(end = [10, 0])\n |> angledLine(angle = 60, length = 10)\n |> angledLine(angle = 120, length = 10)\n |> line(end = [-10, 0])\n |> angledLine(angle = 240, length = 10, tag = $referenceEdge)\n |> close()\n\nexample = extrude(exampleSketch, length = 5)\n |> fillet(radius = 3, tags = [getPreviousAdjacentEdge(referenceEdge)])",
false
]
]
@ -98002,7 +98002,7 @@
"deprecated": false,
"examples": [
[
"a = 10\nb = 14\nstartSketchOn(XZ)\n |> startProfile(at = [0, 0])\n |> involuteCircular(startRadius = a, endRadius = b, angle = 60deg)\n |> involuteCircular(\n startRadius = a,\n endRadius = b,\n angle = 60deg,\n reverse = true,\n )",
"a = 10\nb = 14\nstartSketchOn(XZ)\n |> startProfile(at = [0, 0])\n |> involuteCircular(startRadius = a, endRadius = b, angle = 60)\n |> involuteCircular(\n startRadius = a,\n endRadius = b,\n angle = 60,\n reverse = true,\n )",
false
]
]
@ -133783,7 +133783,7 @@
"deprecated": false,
"examples": [
[
"exampleSketch = startSketchOn(XZ)\n |> startProfile(at = [.5, 25])\n |> line(end = [0, 5])\n |> line(end = [-1, 0])\n |> line(end = [0, -5])\n |> close()\n |> patternCircular2d(\n center = [0, 0],\n instances = 13,\n arcDegrees = 360deg,\n rotateDuplicates = true,\n )\n\nexample = extrude(exampleSketch, length = 1)",
"exampleSketch = startSketchOn(XZ)\n |> startProfile(at = [.5, 25])\n |> line(end = [0, 5])\n |> line(end = [-1, 0])\n |> line(end = [0, -5])\n |> close()\n |> patternCircular2d(\n center = [0, 0],\n instances = 13,\n arcDegrees = 360,\n rotateDuplicates = true,\n )\n\nexample = extrude(exampleSketch, length = 1)",
false
]
]
@ -146653,7 +146653,7 @@
"deprecated": false,
"examples": [
[
"exampleSketch = startSketchOn(XZ)\n |> circle(center = [0, 0], radius = 1)\n\nexample = extrude(exampleSketch, length = -5)\n |> patternCircular3d(\n axis = [1, -1, 0],\n center = [10, -20, 0],\n instances = 11,\n arcDegrees = 360deg,\n rotateDuplicates = true,\n )",
"exampleSketch = startSketchOn(XZ)\n |> circle(center = [0, 0], radius = 1)\n\nexample = extrude(exampleSketch, length = -5)\n |> patternCircular3d(\n axis = [1, -1, 0],\n center = [10, -20, 0],\n instances = 11,\n arcDegrees = 360,\n rotateDuplicates = true,\n )",
false
]
]
@ -174025,11 +174025,11 @@
false
],
[
"fn cube(length, center) {\n l = length / 2\n x = center[0]\n y = center[1]\n p0 = [-l + x, -l + y]\n p1 = [-l + x, l + y]\n p2 = [l + x, l + y]\n p3 = [l + x, -l + y]\n\n return startSketchOn(XY)\n |> startProfile(at = p0)\n |> line(endAbsolute = p1)\n |> line(endAbsolute = p2)\n |> line(endAbsolute = p3)\n |> line(endAbsolute = p0)\n |> close()\n |> extrude(length = length)\n}\n\nwidth = 20\nfn transform(@i) {\n return {\n // Move down each time.\n translate = [0, 0, -i * width],\n // Make the cube longer, wider and flatter each time.\n scale = [\n pow(1.1, exp = i),\n pow(1.1, exp = i),\n pow(0.9, exp = i)\n ],\n // Turn by 15 degrees each time.\n rotation = { angle = 15deg * i, origin = \"local\" }\n }\n}\n\nmyCubes = cube(length = width, center = [100, 0])\n |> patternTransform(instances = 25, transform = transform)",
"fn cube(length, center) {\n l = length / 2\n x = center[0]\n y = center[1]\n p0 = [-l + x, -l + y]\n p1 = [-l + x, l + y]\n p2 = [l + x, l + y]\n p3 = [l + x, -l + y]\n\n return startSketchOn(XY)\n |> startProfile(at = p0)\n |> line(endAbsolute = p1)\n |> line(endAbsolute = p2)\n |> line(endAbsolute = p3)\n |> line(endAbsolute = p0)\n |> close()\n |> extrude(length = length)\n}\n\nwidth = 20\nfn transform(@i) {\n return {\n // Move down each time.\n translate = [0, 0, -i * width],\n // Make the cube longer, wider and flatter each time.\n scale = [\n pow(1.1, exp = i),\n pow(1.1, exp = i),\n pow(0.9, exp = i)\n ],\n // Turn by 15 degrees each time.\n rotation = { angle = 15 * i, origin = \"local\" }\n }\n}\n\nmyCubes = cube(length = width, center = [100, 0])\n |> patternTransform(instances = 25, transform = transform)",
false
],
[
"fn cube(length, center) {\n l = length / 2\n x = center[0]\n y = center[1]\n p0 = [-l + x, -l + y]\n p1 = [-l + x, l + y]\n p2 = [l + x, l + y]\n p3 = [l + x, -l + y]\n\n return startSketchOn(XY)\n |> startProfile(at = p0)\n |> line(endAbsolute = p1)\n |> line(endAbsolute = p2)\n |> line(endAbsolute = p3)\n |> line(endAbsolute = p0)\n |> close()\n |> extrude(length = length)\n}\n\nwidth = 20\nfn transform(@i) {\n return {\n translate = [0, 0, -i * width],\n rotation = {\n angle = 90deg * i,\n // Rotate around the overall scene's origin.\n origin = \"global\"\n }\n }\n}\nmyCubes = cube(length = width, center = [100, 100])\n |> patternTransform(instances = 4, transform = transform)",
"fn cube(length, center) {\n l = length / 2\n x = center[0]\n y = center[1]\n p0 = [-l + x, -l + y]\n p1 = [-l + x, l + y]\n p2 = [l + x, l + y]\n p3 = [l + x, -l + y]\n\n return startSketchOn(XY)\n |> startProfile(at = p0)\n |> line(endAbsolute = p1)\n |> line(endAbsolute = p2)\n |> line(endAbsolute = p3)\n |> line(endAbsolute = p0)\n |> close()\n |> extrude(length = length)\n}\n\nwidth = 20\nfn transform(@i) {\n return {\n translate = [0, 0, -i * width],\n rotation = {\n angle = 90 * i,\n // Rotate around the overall scene's origin.\n origin = \"global\"\n }\n }\n}\nmyCubes = cube(length = width, center = [100, 100])\n |> patternTransform(instances = 4, transform = transform)",
false
],
[
@ -174037,7 +174037,7 @@
false
],
[
"fn transform(@i) {\n // Transform functions can return multiple transforms. They'll be applied in order.\n return [\n { translate = [30 * i, 0, 0] },\n { rotation = { angle = 45deg * i } }\n ]\n}\nstartSketchOn(XY)\n |> startProfile(at = [0, 0])\n |> polygon(\n radius = 10,\n numSides = 4,\n center = [0, 0],\n inscribed = false,\n )\n |> extrude(length = 4)\n |> patternTransform(instances = 3, transform = transform)",
"fn transform(@i) {\n // Transform functions can return multiple transforms. They'll be applied in order.\n return [\n { translate = [30 * i, 0, 0] },\n { rotation = { angle = 45 * i } }\n ]\n}\nstartSketchOn(XY)\n |> startProfile(at = [0, 0])\n |> polygon(\n radius = 10,\n numSides = 4,\n center = [0, 0],\n inscribed = false,\n )\n |> extrude(length = 4)\n |> patternTransform(instances = 3, transform = transform)",
false
]
]
@ -193508,7 +193508,7 @@
"deprecated": false,
"examples": [
[
"sketch001 = startSketchOn(XY)\n |> startProfile(at = [5, 2])\n |> angledLine(angle = 120deg, length = 50, tag = $seg01)\n |> angledLine(angle = segAng(seg01) + 120deg, length = 50)\n |> line(end = profileStart(%))\n |> close()\n |> extrude(length = 20)",
"sketch001 = startSketchOn(XY)\n |> startProfile(at = [5, 2])\n |> angledLine(angle = 120, length = 50, tag = $seg01)\n |> angledLine(angle = segAng(seg01) + 120, length = 50)\n |> line(end = profileStart(%))\n |> close()\n |> extrude(length = 20)",
false
]
]
@ -195205,7 +195205,7 @@
"deprecated": false,
"examples": [
[
"sketch001 = startSketchOn(XY)\n |> startProfile(at = [5, 2])\n |> angledLine(angle = -26.6deg, length = 50)\n |> angledLine(angle = 90deg, length = 50)\n |> angledLine(angle = 30deg, endAbsoluteX = profileStartX(%))",
"sketch001 = startSketchOn(XY)\n |> startProfile(at = [5, 2])\n |> angledLine(angle = -26.6, length = 50)\n |> angledLine(angle = 90, length = 50)\n |> angledLine(angle = 30, endAbsoluteX = profileStartX(%))",
false
]
]
@ -196902,7 +196902,7 @@
"deprecated": false,
"examples": [
[
"sketch001 = startSketchOn(XY)\n |> startProfile(at = [5, 2])\n |> angledLine(angle = -60deg, length = 14)\n |> angledLine(angle = 30deg, endAbsoluteY = profileStartY(%))",
"sketch001 = startSketchOn(XY)\n |> startProfile(at = [5, 2])\n |> angledLine(angle = -60, length = 14)\n |> angledLine(angle = 30, endAbsoluteY = profileStartY(%))",
false
]
]
@ -209907,27 +209907,27 @@
"deprecated": false,
"examples": [
[
"// Rotate a pipe with roll, pitch, and yaw.\n\n// Create a path for the sweep.\nsweepPath = startSketchOn(XZ)\n |> startProfile(at = [0.05, 0.05])\n |> line(end = [0, 7])\n |> tangentialArc(angle = 90deg, radius = 5)\n |> line(end = [-3, 0])\n |> tangentialArc(angle = -90deg, radius = 5)\n |> line(end = [0, 7])\n\n// Create a hole for the pipe.\npipeHole = startSketchOn(XY)\n |> circle(center = [0, 0], radius = 1.5)\n\nsweepSketch = startSketchOn(XY)\n |> circle(center = [0, 0], radius = 2)\n |> subtract2d(tool = pipeHole)\n |> sweep(path = sweepPath)\n |> rotate(roll = 10deg, pitch = 10deg, yaw = 90deg)",
"// Rotate a pipe with roll, pitch, and yaw.\n\n// Create a path for the sweep.\nsweepPath = startSketchOn(XZ)\n |> startProfile(at = [0.05, 0.05])\n |> line(end = [0, 7])\n |> tangentialArc(angle = 90, radius = 5)\n |> line(end = [-3, 0])\n |> tangentialArc(angle = -90, radius = 5)\n |> line(end = [0, 7])\n\n// Create a hole for the pipe.\npipeHole = startSketchOn(XY)\n |> circle(center = [0, 0], radius = 1.5)\n\nsweepSketch = startSketchOn(XY)\n |> circle(center = [0, 0], radius = 2)\n |> subtract2d(tool = pipeHole)\n |> sweep(path = sweepPath)\n |> rotate(roll = 10, pitch = 10, yaw = 90)",
false
],
[
"// Rotate a pipe with just roll.\n\n// Create a path for the sweep.\nsweepPath = startSketchOn(XZ)\n |> startProfile(at = [0.05, 0.05])\n |> line(end = [0, 7])\n |> tangentialArc(angle = 90deg, radius = 5)\n |> line(end = [-3, 0])\n |> tangentialArc(angle = -90deg, radius = 5)\n |> line(end = [0, 7])\n\n// Create a hole for the pipe.\npipeHole = startSketchOn(XY)\n |> circle(center = [0, 0], radius = 1.5)\n\nsweepSketch = startSketchOn(XY)\n |> circle(center = [0, 0], radius = 2)\n |> subtract2d(tool = pipeHole)\n |> sweep(path = sweepPath)\n |> rotate(roll = 10deg)",
"// Rotate a pipe with just roll.\n\n// Create a path for the sweep.\nsweepPath = startSketchOn(XZ)\n |> startProfile(at = [0.05, 0.05])\n |> line(end = [0, 7])\n |> tangentialArc(angle = 90, radius = 5)\n |> line(end = [-3, 0])\n |> tangentialArc(angle = -90, radius = 5)\n |> line(end = [0, 7])\n\n// Create a hole for the pipe.\npipeHole = startSketchOn(XY)\n |> circle(center = [0, 0], radius = 1.5)\n\nsweepSketch = startSketchOn(XY)\n |> circle(center = [0, 0], radius = 2)\n |> subtract2d(tool = pipeHole)\n |> sweep(path = sweepPath)\n |> rotate(roll = 10)",
false
],
[
"// Rotate a pipe about an axis with an angle.\n\n// Create a path for the sweep.\nsweepPath = startSketchOn(XZ)\n |> startProfile(at = [0.05, 0.05])\n |> line(end = [0, 7])\n |> tangentialArc(angle = 90deg, radius = 5)\n |> line(end = [-3, 0])\n |> tangentialArc(angle = -90deg, radius = 5)\n |> line(end = [0, 7])\n\n// Create a hole for the pipe.\npipeHole = startSketchOn(XY)\n |> circle(center = [0, 0], radius = 1.5)\n\nsweepSketch = startSketchOn(XY)\n |> circle(center = [0, 0], radius = 2)\n |> subtract2d(tool = pipeHole)\n |> sweep(path = sweepPath)\n |> rotate(axis = [0, 0, 1.0], angle = 90deg)",
"// Rotate a pipe about an axis with an angle.\n\n// Create a path for the sweep.\nsweepPath = startSketchOn(XZ)\n |> startProfile(at = [0.05, 0.05])\n |> line(end = [0, 7])\n |> tangentialArc(angle = 90, radius = 5)\n |> line(end = [-3, 0])\n |> tangentialArc(angle = -90, radius = 5)\n |> line(end = [0, 7])\n\n// Create a hole for the pipe.\npipeHole = startSketchOn(XY)\n |> circle(center = [0, 0], radius = 1.5)\n\nsweepSketch = startSketchOn(XY)\n |> circle(center = [0, 0], radius = 2)\n |> subtract2d(tool = pipeHole)\n |> sweep(path = sweepPath)\n |> rotate(axis = [0, 0, 1.0], angle = 90)",
false
],
[
"// Rotate an imported model.\n\n\nimport \"tests/inputs/cube.sldprt\" as cube\n\ncube\n |> rotate(axis = [0, 0, 1.0], angle = 9deg)",
"// Rotate an imported model.\n\n\nimport \"tests/inputs/cube.sldprt\" as cube\n\ncube\n |> rotate(axis = [0, 0, 1.0], angle = 9)",
false
],
[
"// Sweep two sketches along the same path.\n\n\nsketch001 = startSketchOn(XY)\nrectangleSketch = startProfile(sketch001, at = [-200, 23.86])\n |> angledLine(angle = 0deg, length = 73.47, tag = $rectangleSegmentA001)\n |> angledLine(angle = segAng(rectangleSegmentA001) - 90deg, length = 50.61)\n |> angledLine(angle = segAng(rectangleSegmentA001), length = -segLen(rectangleSegmentA001))\n |> line(endAbsolute = [profileStartX(%), profileStartY(%)])\n |> close()\n\ncircleSketch = circle(sketch001, center = [200, -30.29], radius = 32.63)\n\nsketch002 = startSketchOn(YZ)\nsweepPath = startProfile(sketch002, at = [0, 0])\n |> yLine(length = 231.81)\n |> tangentialArc(radius = 80, angle = -90deg)\n |> xLine(length = 384.93)\n\nparts = sweep([rectangleSketch, circleSketch], path = sweepPath)\n\n// Rotate the sweeps.\nrotate(parts, axis = [0, 0, 1.0], angle = 90deg)",
"// Sweep two sketches along the same path.\n\n\nsketch001 = startSketchOn(XY)\nrectangleSketch = startProfile(sketch001, at = [-200, 23.86])\n |> angledLine(angle = 0, length = 73.47, tag = $rectangleSegmentA001)\n |> angledLine(angle = segAng(rectangleSegmentA001) - 90, length = 50.61)\n |> angledLine(angle = segAng(rectangleSegmentA001), length = -segLen(rectangleSegmentA001))\n |> line(endAbsolute = [profileStartX(%), profileStartY(%)])\n |> close()\n\ncircleSketch = circle(sketch001, center = [200, -30.29], radius = 32.63)\n\nsketch002 = startSketchOn(YZ)\nsweepPath = startProfile(sketch002, at = [0, 0])\n |> yLine(length = 231.81)\n |> tangentialArc(radius = 80, angle = -90)\n |> xLine(length = 384.93)\n\nparts = sweep([rectangleSketch, circleSketch], path = sweepPath)\n\n// Rotate the sweeps.\nrotate(parts, axis = [0, 0, 1.0], angle = 90)",
false
],
[
"// Translate and rotate a sketch to create a loft.\nsketch001 = startSketchOn(XY)\n\nfn square() {\n return startProfile(sketch001, at = [-10, 10])\n |> xLine(length = 20)\n |> yLine(length = -20)\n |> xLine(length = -20)\n |> line(endAbsolute = [profileStartX(%), profileStartY(%)])\n |> close()\n}\n\nprofile001 = square()\n\nprofile002 = square()\n |> translate(x = 0, y = 0, z = 20)\n |> rotate(axis = [0, 0, 1.0], angle = 45deg)\n\nloft([profile001, profile002])",
"// Translate and rotate a sketch to create a loft.\nsketch001 = startSketchOn(XY)\n\nfn square() {\n return startProfile(sketch001, at = [-10, 10])\n |> xLine(length = 20)\n |> yLine(length = -20)\n |> xLine(length = -20)\n |> line(endAbsolute = [profileStartX(%), profileStartY(%)])\n |> close()\n}\n\nprofile001 = square()\n\nprofile002 = square()\n |> translate(x = 0, y = 0, z = 20)\n |> rotate(axis = [0, 0, 1.0], angle = 45)\n\nloft([profile001, profile002])",
false
]
]
@ -219717,7 +219717,7 @@
"deprecated": false,
"examples": [
[
"// Scale a pipe.\n\n// Create a path for the sweep.\nsweepPath = startSketchOn(XZ)\n |> startProfile(at = [0.05, 0.05])\n |> line(end = [0, 7])\n |> tangentialArc(angle = 90deg, radius = 5)\n |> line(end = [-3, 0])\n |> tangentialArc(angle = -90deg, radius = 5)\n |> line(end = [0, 7])\n\n// Create a hole for the pipe.\npipeHole = startSketchOn(XY)\n |> circle(center = [0, 0], radius = 1.5)\n\nsweepSketch = startSketchOn(XY)\n |> circle(center = [0, 0], radius = 2)\n |> subtract2d(tool = pipeHole)\n |> sweep(path = sweepPath)\n |> scale(z = 2.5)",
"// Scale a pipe.\n\n// Create a path for the sweep.\nsweepPath = startSketchOn(XZ)\n |> startProfile(at = [0.05, 0.05])\n |> line(end = [0, 7])\n |> tangentialArc(angle = 90, radius = 5)\n |> line(end = [-3, 0])\n |> tangentialArc(angle = -90, radius = 5)\n |> line(end = [0, 7])\n\n// Create a hole for the pipe.\npipeHole = startSketchOn(XY)\n |> circle(center = [0, 0], radius = 1.5)\n\nsweepSketch = startSketchOn(XY)\n |> circle(center = [0, 0], radius = 2)\n |> subtract2d(tool = pipeHole)\n |> sweep(path = sweepPath)\n |> scale(z = 2.5)",
false
],
[
@ -219725,7 +219725,7 @@
false
],
[
"// Sweep two sketches along the same path.\n\n\nsketch001 = startSketchOn(XY)\nrectangleSketch = startProfile(sketch001, at = [-200, 23.86])\n |> angledLine(angle = 0deg, length = 73.47, tag = $rectangleSegmentA001)\n |> angledLine(angle = segAng(rectangleSegmentA001) - 90deg, length = 50.61)\n |> angledLine(angle = segAng(rectangleSegmentA001), length = -segLen(rectangleSegmentA001))\n |> line(endAbsolute = [profileStartX(%), profileStartY(%)])\n |> close()\n\ncircleSketch = circle(sketch001, center = [200, -30.29], radius = 32.63)\n\nsketch002 = startSketchOn(YZ)\nsweepPath = startProfile(sketch002, at = [0, 0])\n |> yLine(length = 231.81)\n |> tangentialArc(radius = 80, angle = -90deg)\n |> xLine(length = 384.93)\n\nparts = sweep([rectangleSketch, circleSketch], path = sweepPath)\n\n// Scale the sweep.\nscale(parts, z = 0.5)",
"// Sweep two sketches along the same path.\n\n\nsketch001 = startSketchOn(XY)\nrectangleSketch = startProfile(sketch001, at = [-200, 23.86])\n |> angledLine(angle = 0, length = 73.47, tag = $rectangleSegmentA001)\n |> angledLine(angle = segAng(rectangleSegmentA001) - 90, length = 50.61)\n |> angledLine(angle = segAng(rectangleSegmentA001), length = -segLen(rectangleSegmentA001))\n |> line(endAbsolute = [profileStartX(%), profileStartY(%)])\n |> close()\n\ncircleSketch = circle(sketch001, center = [200, -30.29], radius = 32.63)\n\nsketch002 = startSketchOn(YZ)\nsweepPath = startProfile(sketch002, at = [0, 0])\n |> yLine(length = 231.81)\n |> tangentialArc(radius = 80, angle = -90)\n |> xLine(length = 384.93)\n\nparts = sweep([rectangleSketch, circleSketch], path = sweepPath)\n\n// Scale the sweep.\nscale(parts, z = 0.5)",
false
]
]
@ -220000,7 +220000,7 @@
"deprecated": false,
"examples": [
[
"exampleSketch = startSketchOn(XZ)\n |> startProfile(at = [0, 0])\n |> angledLine(angle = 60deg, length = 10, tag = $thing)\n |> tangentialArc(angle = -120deg, radius = 5)\n |> angledLine(angle = -60deg, length = segLen(thing))\n |> close()\n\nexample = extrude(exampleSketch, length = 5)",
"exampleSketch = startSketchOn(XZ)\n |> startProfile(at = [0, 0])\n |> angledLine(angle = 60, length = 10, tag = $thing)\n |> tangentialArc(angle = -120, radius = 5)\n |> angledLine(angle = -60, length = segLen(thing))\n |> close()\n\nexample = extrude(exampleSketch, length = 5)",
false
]
]
@ -232122,11 +232122,11 @@
false
],
[
"exampleSketch = startSketchOn(XY)\n |> startProfile(at = [4, 12])\n |> line(end = [2, 0])\n |> line(end = [0, -6])\n |> line(end = [4, -6])\n |> line(end = [0, -6])\n |> line(end = [-3.75, -4.5])\n |> line(end = [0, -5.5])\n |> line(end = [-2, 0])\n |> close()\n\nexample = revolve(exampleSketch, axis = Y, angle = 180deg)\n\nexampleSketch002 = startSketchOn(example, face = END)\n |> startProfile(at = [4.5, -5])\n |> line(end = [0, 5])\n |> line(end = [5, 0])\n |> line(end = [0, -5])\n |> close()\n\nexample002 = extrude(exampleSketch002, length = 5)",
"exampleSketch = startSketchOn(XY)\n |> startProfile(at = [4, 12])\n |> line(end = [2, 0])\n |> line(end = [0, -6])\n |> line(end = [4, -6])\n |> line(end = [0, -6])\n |> line(end = [-3.75, -4.5])\n |> line(end = [0, -5.5])\n |> line(end = [-2, 0])\n |> close()\n\nexample = revolve(exampleSketch, axis = Y, angle = 180)\n\nexampleSketch002 = startSketchOn(example, face = END)\n |> startProfile(at = [4.5, -5])\n |> line(end = [0, 5])\n |> line(end = [5, 0])\n |> line(end = [0, -5])\n |> close()\n\nexample002 = extrude(exampleSketch002, length = 5)",
false
],
[
"// Sketch on the end of a revolved face by tagging the end face.\n\n\nexampleSketch = startSketchOn(XY)\n |> startProfile(at = [4, 12])\n |> line(end = [2, 0])\n |> line(end = [0, -6])\n |> line(end = [4, -6])\n |> line(end = [0, -6])\n |> line(end = [-3.75, -4.5])\n |> line(end = [0, -5.5])\n |> line(end = [-2, 0])\n |> close()\n\nexample = revolve(\n exampleSketch,\n axis = Y,\n angle = 180deg,\n tagEnd = $end01,\n)\n\nexampleSketch002 = startSketchOn(example, face = end01)\n |> startProfile(at = [4.5, -5])\n |> line(end = [0, 5])\n |> line(end = [5, 0])\n |> line(end = [0, -5])\n |> close()\n\nexample002 = extrude(exampleSketch002, length = 5)",
"// Sketch on the end of a revolved face by tagging the end face.\n\n\nexampleSketch = startSketchOn(XY)\n |> startProfile(at = [4, 12])\n |> line(end = [2, 0])\n |> line(end = [0, -6])\n |> line(end = [4, -6])\n |> line(end = [0, -6])\n |> line(end = [-3.75, -4.5])\n |> line(end = [0, -5.5])\n |> line(end = [-2, 0])\n |> close()\n\nexample = revolve(\n exampleSketch,\n axis = Y,\n angle = 180,\n tagEnd = $end01,\n)\n\nexampleSketch002 = startSketchOn(example, face = end01)\n |> startProfile(at = [4.5, -5])\n |> line(end = [0, 5])\n |> line(end = [5, 0])\n |> line(end = [0, -5])\n |> close()\n\nexample002 = extrude(exampleSketch002, length = 5)",
false
],
[
@ -256716,19 +256716,19 @@
"deprecated": false,
"examples": [
[
"// Create a pipe using a sweep.\n\n// Create a path for the sweep.\nsweepPath = startSketchOn(XZ)\n |> startProfile(at = [0.05, 0.05])\n |> line(end = [0, 7])\n |> tangentialArc(angle = 90deg, radius = 5)\n |> line(end = [-3, 0])\n |> tangentialArc(angle = -90deg, radius = 5)\n |> line(end = [0, 7])\n\n// Create a hole for the pipe.\npipeHole = startSketchOn(XY)\n |> circle(center = [0, 0], radius = 1.5)\n\nsweepSketch = startSketchOn(XY)\n |> circle(center = [0, 0], radius = 2)\n |> subtract2d(tool = pipeHole)\n |> sweep(path = sweepPath)",
"// Create a pipe using a sweep.\n\n// Create a path for the sweep.\nsweepPath = startSketchOn(XZ)\n |> startProfile(at = [0.05, 0.05])\n |> line(end = [0, 7])\n |> tangentialArc(angle = 90, radius = 5)\n |> line(end = [-3, 0])\n |> tangentialArc(angle = -90, radius = 5)\n |> line(end = [0, 7])\n\n// Create a hole for the pipe.\npipeHole = startSketchOn(XY)\n |> circle(center = [0, 0], radius = 1.5)\n\nsweepSketch = startSketchOn(XY)\n |> circle(center = [0, 0], radius = 2)\n |> subtract2d(tool = pipeHole)\n |> sweep(path = sweepPath)",
false
],
[
"// Create a spring by sweeping around a helix path.\n\n// Create a helix around the Z axis.\nhelixPath = helix(\n angleStart = 0deg,\n ccw = true,\n revolutions = 4,\n length = 10,\n radius = 5,\n axis = Z,\n)\n\n// Create a spring by sweeping around the helix path.\nspringSketch = startSketchOn(YZ)\n |> circle(center = [0, 0], radius = 1)\n |> sweep(path = helixPath, relativeTo = \"sketchPlane\")",
"// Create a spring by sweeping around a helix path.\n\n// Create a helix around the Z axis.\nhelixPath = helix(\n angleStart = 0,\n ccw = true,\n revolutions = 4,\n length = 10,\n radius = 5,\n axis = Z,\n)\n\n// Create a spring by sweeping around the helix path.\nspringSketch = startSketchOn(XZ)\n |> circle(center = [5, 0], radius = 1)\n |> sweep(path = helixPath)",
false
],
[
"// Sweep two sketches along the same path.\n\n\nsketch001 = startSketchOn(XY)\nrectangleSketch = startProfile(sketch001, at = [-200, 23.86])\n |> angledLine(angle = 0deg, length = 73.47, tag = $rectangleSegmentA001)\n |> angledLine(angle = segAng(rectangleSegmentA001) - 90deg, length = 50.61)\n |> angledLine(angle = segAng(rectangleSegmentA001), length = -segLen(rectangleSegmentA001))\n |> line(endAbsolute = [profileStartX(%), profileStartY(%)])\n |> close()\n\ncircleSketch = circle(sketch001, center = [200, -30.29], radius = 32.63)\n\nsketch002 = startSketchOn(YZ)\nsweepPath = startProfile(sketch002, at = [0, 0])\n |> yLine(length = 231.81)\n |> tangentialArc(radius = 80, angle = -90deg)\n |> xLine(length = 384.93)\n\nsweep([rectangleSketch, circleSketch], path = sweepPath)",
"// Sweep two sketches along the same path.\n\n\nsketch001 = startSketchOn(XY)\nrectangleSketch = startProfile(sketch001, at = [-200, 23.86])\n |> angledLine(angle = 0, length = 73.47, tag = $rectangleSegmentA001)\n |> angledLine(angle = segAng(rectangleSegmentA001) - 90, length = 50.61)\n |> angledLine(angle = segAng(rectangleSegmentA001), length = -segLen(rectangleSegmentA001))\n |> line(endAbsolute = [profileStartX(%), profileStartY(%)])\n |> close()\n\ncircleSketch = circle(sketch001, center = [200, -30.29], radius = 32.63)\n\nsketch002 = startSketchOn(YZ)\nsweepPath = startProfile(sketch002, at = [0, 0])\n |> yLine(length = 231.81)\n |> tangentialArc(radius = 80, angle = -90)\n |> xLine(length = 384.93)\n\nsweep([rectangleSketch, circleSketch], path = sweepPath)",
false
],
[
"// Sectionally sweep one sketch along the path\n\n\nsketch001 = startSketchOn(XY)\ncircleSketch = circle(sketch001, center = [200, -30.29], radius = 32.63)\n\nsketch002 = startSketchOn(YZ)\nsweepPath = startProfile(sketch002, at = [0, 0])\n |> yLine(length = 231.81)\n |> tangentialArc(radius = 80, angle = -90deg)\n |> xLine(length = 384.93)\n\nsweep(circleSketch, path = sweepPath, sectional = true)",
"// Sectionally sweep one sketch along the path\n\n\nsketch001 = startSketchOn(XY)\ncircleSketch = circle(sketch001, center = [200, -30.29], radius = 32.63)\n\nsketch002 = startSketchOn(YZ)\nsweepPath = startProfile(sketch002, at = [0, 0])\n |> yLine(length = 231.81)\n |> tangentialArc(radius = 80, angle = -90)\n |> xLine(length = 384.93)\n\nsweep(circleSketch, path = sweepPath, sectional = true)",
false
]
]
@ -268188,15 +268188,15 @@
"deprecated": false,
"examples": [
[
"exampleSketch = startSketchOn(XZ)\n |> startProfile(at = [0, 0])\n |> angledLine(angle = 45deg, length = 10)\n |> tangentialArc(end = [0, -10])\n |> line(end = [-10, 0])\n |> close()\n\nexample = extrude(exampleSketch, length = 10)",
"exampleSketch = startSketchOn(XZ)\n |> startProfile(at = [0, 0])\n |> angledLine(angle = 45, length = 10)\n |> tangentialArc(end = [0, -10])\n |> line(end = [-10, 0])\n |> close()\n\nexample = extrude(exampleSketch, length = 10)",
false
],
[
"exampleSketch = startSketchOn(XZ)\n |> startProfile(at = [0, 0])\n |> angledLine(angle = 60deg, length = 10)\n |> tangentialArc(endAbsolute = [15, 15])\n |> line(end = [10, -15])\n |> close()\n\nexample = extrude(exampleSketch, length = 10)",
"exampleSketch = startSketchOn(XZ)\n |> startProfile(at = [0, 0])\n |> angledLine(angle = 60, length = 10)\n |> tangentialArc(endAbsolute = [15, 15])\n |> line(end = [10, -15])\n |> close()\n\nexample = extrude(exampleSketch, length = 10)",
false
],
[
"exampleSketch = startSketchOn(XZ)\n |> startProfile(at = [0, 0])\n |> angledLine(angle = 60deg, length = 10)\n |> tangentialArc(radius = 10, angle = -120deg)\n |> angledLine(angle = -60deg, length = 10)\n |> close()\n\nexample = extrude(exampleSketch, length = 10)",
"exampleSketch = startSketchOn(XZ)\n |> startProfile(at = [0, 0])\n |> angledLine(angle = 60, length = 10)\n |> tangentialArc(radius = 10, angle = -120)\n |> angledLine(angle = -60, length = 10)\n |> close()\n\nexample = extrude(exampleSketch, length = 10)",
false
]
]
@ -277995,7 +277995,7 @@
"deprecated": false,
"examples": [
[
"// Move a pipe.\n\n// Create a path for the sweep.\nsweepPath = startSketchOn(XZ)\n |> startProfile(at = [0.05, 0.05])\n |> line(end = [0, 7])\n |> tangentialArc(angle = 90deg, radius = 5)\n |> line(end = [-3, 0])\n |> tangentialArc(angle = -90deg, radius = 5)\n |> line(end = [0, 7])\n\n// Create a hole for the pipe.\npipeHole = startSketchOn(XY)\n |> circle(center = [0, 0], radius = 1.5)\n\nsweepSketch = startSketchOn(XY)\n |> circle(center = [0, 0], radius = 2)\n |> subtract2d(tool = pipeHole)\n |> sweep(path = sweepPath)\n |> translate(x = 1.0, y = 1.0, z = 2.5)",
"// Move a pipe.\n\n// Create a path for the sweep.\nsweepPath = startSketchOn(XZ)\n |> startProfile(at = [0.05, 0.05])\n |> line(end = [0, 7])\n |> tangentialArc(angle = 90, radius = 5)\n |> line(end = [-3, 0])\n |> tangentialArc(angle = -90, radius = 5)\n |> line(end = [0, 7])\n\n// Create a hole for the pipe.\npipeHole = startSketchOn(XY)\n |> circle(center = [0, 0], radius = 1.5)\n\nsweepSketch = startSketchOn(XY)\n |> circle(center = [0, 0], radius = 2)\n |> subtract2d(tool = pipeHole)\n |> sweep(path = sweepPath)\n |> translate(x = 1.0, y = 1.0, z = 2.5)",
false
],
[
@ -278003,7 +278003,7 @@
false
],
[
"// Sweep two sketches along the same path.\n\n\nsketch001 = startSketchOn(XY)\nrectangleSketch = startProfile(sketch001, at = [-200, 23.86])\n |> angledLine(angle = 0deg, length = 73.47, tag = $rectangleSegmentA001)\n |> angledLine(angle = segAng(rectangleSegmentA001) - 90deg, length = 50.61)\n |> angledLine(angle = segAng(rectangleSegmentA001), length = -segLen(rectangleSegmentA001))\n |> line(endAbsolute = [profileStartX(%), profileStartY(%)])\n |> close()\n\ncircleSketch = circle(sketch001, center = [200, -30.29], radius = 32.63)\n\nsketch002 = startSketchOn(YZ)\nsweepPath = startProfile(sketch002, at = [0, 0])\n |> yLine(length = 231.81)\n |> tangentialArc(radius = 80, angle = -90deg)\n |> xLine(length = 384.93)\n\nparts = sweep([rectangleSketch, circleSketch], path = sweepPath)\n\n// Move the sweeps.\ntranslate(\n parts,\n x = 1.0,\n y = 1.0,\n z = 2.5,\n)",
"// Sweep two sketches along the same path.\n\n\nsketch001 = startSketchOn(XY)\nrectangleSketch = startProfile(sketch001, at = [-200, 23.86])\n |> angledLine(angle = 0, length = 73.47, tag = $rectangleSegmentA001)\n |> angledLine(angle = segAng(rectangleSegmentA001) - 90, length = 50.61)\n |> angledLine(angle = segAng(rectangleSegmentA001), length = -segLen(rectangleSegmentA001))\n |> line(endAbsolute = [profileStartX(%), profileStartY(%)])\n |> close()\n\ncircleSketch = circle(sketch001, center = [200, -30.29], radius = 32.63)\n\nsketch002 = startSketchOn(YZ)\nsweepPath = startProfile(sketch002, at = [0, 0])\n |> yLine(length = 231.81)\n |> tangentialArc(radius = 80, angle = -90)\n |> xLine(length = 384.93)\n\nparts = sweep([rectangleSketch, circleSketch], path = sweepPath)\n\n// Move the sweeps.\ntranslate(\n parts,\n x = 1.0,\n y = 1.0,\n z = 2.5,\n)",
false
],
[
@ -278011,7 +278011,7 @@
false
],
[
"// Translate and rotate a sketch to create a loft.\nsketch001 = startSketchOn(XY)\n\nfn square() {\n return startProfile(sketch001, at = [-10, 10])\n |> xLine(length = 20)\n |> yLine(length = -20)\n |> xLine(length = -20)\n |> line(endAbsolute = [profileStartX(%), profileStartY(%)])\n |> close()\n}\n\nprofile001 = square()\n\nprofile002 = square()\n |> translate(z = 20)\n |> rotate(axis = [0, 0, 1.0], angle = 45deg)\n\nloft([profile001, profile002])",
"// Translate and rotate a sketch to create a loft.\nsketch001 = startSketchOn(XY)\n\nfn square() {\n return startProfile(sketch001, at = [-10, 10])\n |> xLine(length = 20)\n |> yLine(length = -20)\n |> xLine(length = -20)\n |> line(endAbsolute = [profileStartX(%), profileStartY(%)])\n |> close()\n}\n\nprofile001 = square()\n\nprofile002 = square()\n |> translate(z = 20)\n |> rotate(axis = [0, 0, 1.0], angle = 45)\n\nloft([profile001, profile002])",
false
]
]
@ -291032,7 +291032,7 @@
"deprecated": false,
"examples": [
[
"exampleSketch = startSketchOn(XZ)\n |> startProfile(at = [0, 0])\n |> xLine(length = 15)\n |> angledLine(angle = 80deg, length = 15)\n |> line(end = [8, -10])\n |> xLine(length = 10)\n |> angledLine(angle = 120deg, length = 30)\n |> xLine(length = -15)\n |> close()\n\nexample = extrude(exampleSketch, length = 10)",
"exampleSketch = startSketchOn(XZ)\n |> startProfile(at = [0, 0])\n |> xLine(length = 15)\n |> angledLine(angle = 80, length = 15)\n |> line(end = [8, -10])\n |> xLine(length = 10)\n |> angledLine(angle = 120, length = 30)\n |> xLine(length = -15)\n |> close()\n\nexample = extrude(exampleSketch, length = 10)",
false
]
]
@ -299205,7 +299205,7 @@
"deprecated": false,
"examples": [
[
"exampleSketch = startSketchOn(XZ)\n |> startProfile(at = [0, 0])\n |> yLine(length = 15)\n |> angledLine(angle = 30deg, length = 15)\n |> line(end = [8, -10])\n |> yLine(length = -5)\n |> close()\n\nexample = extrude(exampleSketch, length = 10)",
"exampleSketch = startSketchOn(XZ)\n |> startProfile(at = [0, 0])\n |> yLine(length = 15)\n |> angledLine(angle = 30, length = 15)\n |> line(end = [8, -10])\n |> yLine(length = -5)\n |> close()\n\nexample = extrude(exampleSketch, length = 10)",
false
]
]

File diff suppressed because one or more lines are too long

View File

@ -41,7 +41,7 @@ When using radius and angle, draw a curved line segment along part of an imagina
```kcl
exampleSketch = startSketchOn(XZ)
|> startProfile(at = [0, 0])
|> angledLine(angle = 45deg, length = 10)
|> angledLine(angle = 45, length = 10)
|> tangentialArc(end = [0, -10])
|> line(end = [-10, 0])
|> close()
@ -54,7 +54,7 @@ example = extrude(exampleSketch, length = 10)
```kcl
exampleSketch = startSketchOn(XZ)
|> startProfile(at = [0, 0])
|> angledLine(angle = 60deg, length = 10)
|> angledLine(angle = 60, length = 10)
|> tangentialArc(endAbsolute = [15, 15])
|> line(end = [10, -15])
|> close()
@ -67,9 +67,9 @@ example = extrude(exampleSketch, length = 10)
```kcl
exampleSketch = startSketchOn(XZ)
|> startProfile(at = [0, 0])
|> angledLine(angle = 60deg, length = 10)
|> tangentialArc(radius = 10, angle = -120deg)
|> angledLine(angle = -60deg, length = 10)
|> angledLine(angle = 60, length = 10)
|> tangentialArc(radius = 10, angle = -120)
|> angledLine(angle = -60, length = 10)
|> close()
example = extrude(exampleSketch, length = 10)

View File

@ -45,9 +45,9 @@ Translate is really useful for sketches if you want to move a sketch and then ro
sweepPath = startSketchOn(XZ)
|> startProfile(at = [0.05, 0.05])
|> line(end = [0, 7])
|> tangentialArc(angle = 90deg, radius = 5)
|> tangentialArc(angle = 90, radius = 5)
|> line(end = [-3, 0])
|> tangentialArc(angle = -90deg, radius = 5)
|> tangentialArc(angle = -90, radius = 5)
|> line(end = [0, 7])
// Create a hole for the pipe.
@ -86,8 +86,8 @@ cube
sketch001 = startSketchOn(XY)
rectangleSketch = startProfile(sketch001, at = [-200, 23.86])
|> angledLine(angle = 0deg, length = 73.47, tag = $rectangleSegmentA001)
|> angledLine(angle = segAng(rectangleSegmentA001) - 90deg, length = 50.61)
|> angledLine(angle = 0, length = 73.47, tag = $rectangleSegmentA001)
|> angledLine(angle = segAng(rectangleSegmentA001) - 90, length = 50.61)
|> angledLine(angle = segAng(rectangleSegmentA001), length = -segLen(rectangleSegmentA001))
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close()
@ -97,7 +97,7 @@ circleSketch = circle(sketch001, center = [200, -30.29], radius = 32.63)
sketch002 = startSketchOn(YZ)
sweepPath = startProfile(sketch002, at = [0, 0])
|> yLine(length = 231.81)
|> tangentialArc(radius = 80, angle = -90deg)
|> tangentialArc(radius = 80, angle = -90)
|> xLine(length = 384.93)
parts = sweep([rectangleSketch, circleSketch], path = sweepPath)
@ -156,7 +156,7 @@ profile001 = square()
profile002 = square()
|> translate(z = 20)
|> rotate(axis = [0, 0, 1.0], angle = 45deg)
|> rotate(axis = [0, 0, 1.0], angle = 45)
loft([profile001, profile002])
```

View File

@ -15,9 +15,9 @@ way:
```js
startSketchOn(XZ)
|> startProfile(at = origin)
|> angledLine(angle = 0deg, length = 191.26, tag = $rectangleSegmentA001)
|> angledLine(angle = 0, length = 191.26, tag = $rectangleSegmentA001)
|> angledLine(
angle = segAng(rectangleSegmentA001) - 90deg,
angle = segAng(rectangleSegmentA001) - 90,
length = 196.99,
tag = $rectangleSegmentB001,
)
@ -49,9 +49,9 @@ However if the code was written like this:
fn rect(origin) {
return startSketchOn(XZ)
|> startProfile(at = origin)
|> angledLine(angle = 0deg, length = 191.26, tag = $rectangleSegmentA001)
|> angledLine(angle = 0, length = 191.26, tag = $rectangleSegmentA001)
|> angledLine(
angle = segAng(rectangleSegmentA001) - 90deg,
angle = segAng(rectangleSegmentA001) - 90,
length = 196.99,
tag = $rectangleSegmentB001)
|> angledLine(
@ -78,9 +78,9 @@ For example the following code works.
fn rect(origin) {
return startSketchOn(XZ)
|> startProfile(at = origin)
|> angledLine(angle = 0deg, length = 191.26, tag = $rectangleSegmentA001)
|> angledLine(angle = 0, length = 191.26, tag = $rectangleSegmentA001)
|> angledLine(
angle = segAng(rectangleSegmentA001) - 90deg,
angle = segAng(rectangleSegmentA001) - 90,
length = 196.99
tag = $rectangleSegmentB001,
)

View File

@ -38,10 +38,10 @@ xLine(
exampleSketch = startSketchOn(XZ)
|> startProfile(at = [0, 0])
|> xLine(length = 15)
|> angledLine(angle = 80deg, length = 15)
|> angledLine(angle = 80, length = 15)
|> line(end = [8, -10])
|> xLine(length = 10)
|> angledLine(angle = 120deg, length = 30)
|> angledLine(angle = 120, length = 30)
|> xLine(length = -15)
|> close()

View File

@ -38,7 +38,7 @@ yLine(
exampleSketch = startSketchOn(XZ)
|> startProfile(at = [0, 0])
|> yLine(length = 15)
|> angledLine(angle = 30deg, length = 15)
|> angledLine(angle = 30, length = 15)
|> line(end = [8, -10])
|> yLine(length = -5)
|> close()

View File

@ -65,7 +65,9 @@ test(
await expect(engineErrorToastMessage).not.toBeVisible()
const successToastMessage = page.getByText(`Exported successfully`)
await expect(successToastMessage).toBeVisible()
await page.waitForTimeout(1_000)
const count = await successToastMessage.count()
await expect(count).toBeGreaterThanOrEqual(1)
// Check for the exported file
const firstFileFullPath = path.resolve(
@ -134,7 +136,9 @@ test(
await expect(engineErrorToastMessage).not.toBeVisible()
const successToastMessage = page.getByText(`Exported successfully`)
await expect(successToastMessage).toBeVisible()
await page.waitForTimeout(1_000)
const count = await successToastMessage.count()
await expect(count).toBeGreaterThanOrEqual(1)
await expect(exportingToastMessage).not.toBeVisible()
// Check for the exported file=

View File

@ -912,7 +912,7 @@ a1 = startSketchOn(offsetPlane(XY, offset = 10))
|> close()
|> revolve(
axis = revolveAxis,
angle = 90deg
angle = 90
)
`
)

View File

@ -38,7 +38,7 @@ extrude001 = extrude(sketch002, length = 10)
const FEATURE_TREE_SKETCH_CODE = `sketch001 = startSketchOn(XZ)
|> startProfile(at = [0, 0])
|> angledLine(angle = 0deg, length = 4, tag = $rectangleSegmentA001)
|> angledLine(angle = 0, length = 4, tag = $rectangleSegmentA001)
|> angledLine(angle = segAng(rectangleSegmentA001) - 90, length = 2, tag = $rectangleSegmentB001)
|> angledLine(angle = segAng(rectangleSegmentA001), length = -segLen(rectangleSegmentA001), tag = $rectangleSegmentC001)
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])

View File

@ -16,7 +16,7 @@ test.describe('Import UI tests', () => {
path.join(projectDir, 'toBeImported.kcl'),
`sketch001 = startSketchOn(XZ)
profile001 = startProfile(sketch001, at = [281.54, 305.81])
|> angledLine(angle = 0deg, length = 123.43, tag = $rectangleSegmentA001)
|> angledLine(angle = 0, length = 123.43, tag = $rectangleSegmentA001)
|> angledLine(angle = segAng(rectangleSegmentA001) - 90, length = 85.99)
|> angledLine(angle = segAng(rectangleSegmentA001), length = -segLen(rectangleSegmentA001))
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
@ -33,7 +33,7 @@ importedCube
sketch001 = startSketchOn(XZ)
profile001 = startProfile(sketch001, at = [-134.53, -56.17])
|> angledLine(angle = 0deg, length = 79.05, tag = $rectangleSegmentA001)
|> angledLine(angle = 0, length = 79.05, tag = $rectangleSegmentA001)
|> angledLine(angle = segAng(rectangleSegmentA001) - 90, length = 76.28)
|> angledLine(angle = segAng(rectangleSegmentA001), length = -segLen(rectangleSegmentA001), tag = $seg01)
|> line(endAbsolute = [profileStartX(%), profileStartY(%)], tag = $seg02)

View File

@ -197,18 +197,6 @@ test.describe(
await clickElectronNativeMenuById(tronApp, 'File.Export current part')
await cmdBar.expectCommandName('Export')
})
await test.step('Modeling.File.Share part via Zoo link', async () => {
await page.waitForTimeout(250)
await clickElectronNativeMenuById(
tronApp,
'File.Share part via Zoo link'
)
const textToCheck =
'Link copied to clipboard. Anyone who clicks this link will get a copy of this file. Share carefully!'
// Check if text appears anywhere in the page
const isTextVisible = page.getByText(textToCheck)
await expect(isTextVisible).toBeVisible({ timeout: 10000 })
})
await test.step('Modeling.File.Preferences.Project settings', async () => {
await page.waitForTimeout(250)
await clickElectronNativeMenuById(

View File

@ -6,7 +6,6 @@ test.describe('Onboarding tests', () => {
homePage,
toolbar,
editor,
scene,
tronApp,
}) => {
if (!tronApp) {
@ -62,7 +61,6 @@ test.describe('Onboarding tests', () => {
await editor.expectEditor.toContain('@settings(defaultLengthUnit = in)', {
shouldNormalise: true,
})
await scene.connectionEstablished()
})
await test.step('Go home and verify we still see the tutorial button, then begin it.', async () => {
@ -132,9 +130,7 @@ test.describe('Onboarding tests', () => {
})
await test.step('Dismiss the onboarding', async () => {
await postDismissToast.waitFor({ state: 'hidden' })
await page.keyboard.press('Escape')
await expect(postDismissToast).toBeVisible()
await expect(page.getByTestId('onboarding-content')).not.toBeVisible()
await expect.poll(() => page.url()).not.toContain('/onboarding')
})
@ -162,13 +158,10 @@ test.describe('Onboarding tests', () => {
await test.step('Gets to the onboarding start', async () => {
await expect(toolbar.projectName).toContainText('tutorial-project')
await expect(tutorialWelcomeHeading).toBeVisible()
await scene.connectionEstablished()
})
await test.step('Dismiss the onboarding', async () => {
await postDismissToast.waitFor({ state: 'hidden' })
await page.keyboard.press('Escape')
await expect(postDismissToast).toBeVisible()
await expect(page.getByTestId('onboarding-content')).not.toBeVisible()
await expect.poll(() => page.url()).not.toContain('/onboarding')
})

View File

@ -365,7 +365,7 @@ test.describe('Point-and-click tests', () => {
clickCoords: { x: 677, y: 87 },
cameraPos: { x: -6200, y: 1500, z: 6200 },
cameraTarget: { x: 8300, y: 1100, z: 4800 },
beforeChamferSnippet: `angledLine(angle = 0deg, length = 268.43, tag = $rectangleSegmentA001)chamfer(
beforeChamferSnippet: `angledLine(angle = 0, length = 268.43, tag = $rectangleSegmentA001)chamfer(
length = 30,
tags = [
getNextAdjacentEdge(yo),
@ -407,7 +407,7 @@ test.describe('Point-and-click tests', () => {
sketch001 = startSketchOn(XZ)
|> startProfile(at = [75.8, 317.2]) // [$startCapTag, $EndCapTag]
|> angledLine(angle = 0deg, length = 268.43, tag = $rectangleSegmentA001)
|> angledLine(angle = 0, length = 268.43, tag = $rectangleSegmentA001)
|> angledLine(angle = segAng(rectangleSegmentA001) - 90, length = 217.26, tag = $seg01)
|> angledLine(angle = segAng(rectangleSegmentA001), length = -segLen(rectangleSegmentA001), tag = $yo)
|> line(endAbsolute = [profileStartX(%), profileStartY(%)], tag = $seg02)
@ -419,28 +419,28 @@ extrude001 = extrude(sketch001, length = 100)
|> chamfer(length = 30, tags = [getNextAdjacentEdge(yo)], tag = $seg06)
sketch002 = startSketchOn(extrude001, face = seg03)
profile001 = startProfile(sketch002, at = [205.96, 254.59])
|> angledLine(angle = 0deg, length = 11.39, tag = $rectangleSegmentA002)
|> angledLine(angle = 0, length = 11.39, tag = $rectangleSegmentA002)
|> angledLine(angle = segAng(rectangleSegmentA002) - 90, length = 105.26)
|> angledLine(angle = segAng(rectangleSegmentA002), length = -segLen(rectangleSegmentA002))
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close()
sketch003 = startSketchOn(extrude001, face = seg04)
profile002 = startProfile(sketch003, at = [-209.64, 255.28])
|> angledLine(angle = 0deg, length = 11.56, tag = $rectangleSegmentA003)
|> angledLine(angle = 0, length = 11.56, tag = $rectangleSegmentA003)
|> angledLine(angle = segAng(rectangleSegmentA003) - 90, length = 106.84)
|> angledLine(angle = segAng(rectangleSegmentA003), length = -segLen(rectangleSegmentA003))
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close()
sketch004 = startSketchOn(extrude001, face = seg05)
profile003 = startProfile(sketch004, at = [82.57, 322.96])
|> angledLine(angle = 0deg, length = 11.16, tag = $rectangleSegmentA004)
|> angledLine(angle = 0, length = 11.16, tag = $rectangleSegmentA004)
|> angledLine(angle = segAng(rectangleSegmentA004) - 90, length = 103.07)
|> angledLine(angle = segAng(rectangleSegmentA004), length = -segLen(rectangleSegmentA004))
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close()
sketch005 = startSketchOn(extrude001, face = seg06)
profile004 = startProfile(sketch005, at = [-23.43, 19.69])
|> angledLine(angle = 0deg, length = 9.1, tag = $rectangleSegmentA005)
|> angledLine(angle = 0, length = 9.1, tag = $rectangleSegmentA005)
|> angledLine(angle = segAng(rectangleSegmentA005) - 90, length = 84.07)
|> angledLine(angle = segAng(rectangleSegmentA005), length = -segLen(rectangleSegmentA005))
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
@ -504,7 +504,7 @@ profile004 = startProfile(sketch005, at = [-23.43, 19.69])
`@settings(defaultLengthUnit = in)
sketch001 = startSketchOn(XZ)
|> startProfile(at = [75.8, 317.2])
|> angledLine(angle = 0deg, length = 268.43, tag = $rectangleSegmentA001)
|> angledLine(angle = 0, length = 268.43, tag = $rectangleSegmentA001)
|> angledLine(angle = segAng(rectangleSegmentA001) - 90, length = 217.26, tag = $seg01)
|> angledLine(angle = segAng(rectangleSegmentA001), length = -segLen(rectangleSegmentA001), tag = $yo)
|> line(endAbsolute = [profileStartX(%), profileStartY(%)], tag = $seg02)
@ -526,7 +526,7 @@ chamf = chamfer(
)
sketch002 = startSketchOn(extrude001, face = seg03)
profile001 = startProfile(sketch002, at = [205.96, 254.59])
|> angledLine(angle = 0deg, length = 11.39, tag = $rectangleSegmentA002)
|> angledLine(angle = 0, length = 11.39, tag = $rectangleSegmentA002)
|> angledLine(angle = segAng(rectangleSegmentA002) - 90, length = 105.26)
|> angledLine(angle = segAng(rectangleSegmentA002), length = -segLen(rectangleSegmentA002))
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
@ -1776,7 +1776,7 @@ sketch002 = startSketchOn(XZ)
initialCode: `@settings(defaultLengthUnit = in)
sketch001 = startSketchOn(YZ)
profile001 = startProfile(sketch001, at = [-400, -400])
|> angledLine(angle = 0deg, length = 800, tag = $rectangleSegmentA001)
|> angledLine(angle = 0, length = 800, tag = $rectangleSegmentA001)
|> angledLine(angle = segAng(rectangleSegmentA001) + 90, length = 800)
|> angledLine(angle = segAng(rectangleSegmentA001), length = -segLen(rectangleSegmentA001))
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
@ -3656,7 +3656,7 @@ profile001 = startProfile(sketch001, at = [-20, 20])
const initialCode = `
sketch001 = startSketchOn(XZ)
|> startProfile(at = [-100.0, 100.0])
|> angledLine(angle = 0deg, length = 200.0, tag = $rectangleSegmentA001)
|> angledLine(angle = 0, length = 200.0, tag = $rectangleSegmentA001)
|> angledLine(angle = segAng(rectangleSegmentA001) - 90, length = 200, tag = $rectangleSegmentB001)
|> angledLine(
angle=segAng(rectangleSegmentA001),
@ -3668,7 +3668,7 @@ tag=$rectangleSegmentC001,
extrude001 = extrude(sketch001, length = 200)
sketch002 = startSketchOn(extrude001, face = rectangleSegmentA001)
|> startProfile(at = [-66.77, 84.81])
|> angledLine(angle = 180deg, length = 27.08, tag = $rectangleSegmentA002)
|> angledLine(angle = 180, length = 27.08, tag = $rectangleSegmentA002)
|> angledLine(
angle=segAng(rectangleSegmentA002) - 90,
length=27.8,
@ -3702,7 +3702,7 @@ tag=$rectangleSegmentC002,
await cmdBar.progressCmdBar()
await cmdBar.progressCmdBar()
const newCodeToFind = `revolve001 = revolve(sketch002, angle = 360deg, axis = X)`
const newCodeToFind = `revolve001 = revolve(sketch002, angle = 360, axis = X)`
expect(editor.expectEditor.toContain(newCodeToFind)).toBeTruthy()
// Edit flow
@ -3735,7 +3735,7 @@ tag=$rectangleSegmentC002,
await cmdBar.progressCmdBar()
await toolbar.closePane('feature-tree')
await editor.expectEditor.toContain(
newCodeToFind.replace('angle = 360deg', 'angle = ' + newAngle)
newCodeToFind.replace('angle = 360', 'angle = ' + newAngle)
)
})
test('revolve surface around edge from an extruded solid2d', async ({
@ -3749,7 +3749,7 @@ tag=$rectangleSegmentC002,
}) => {
const initialCode = `sketch001 = startSketchOn(XZ)
|> startProfile(at = [-102.57, 101.72])
|> angledLine(angle = 0deg, length = 202.6, tag = $rectangleSegmentA001)
|> angledLine(angle = 0, length = 202.6, tag = $rectangleSegmentA001)
|> angledLine(angle = segAng(rectangleSegmentA001) - 90, length = 202.6, tag = $rectangleSegmentB001)
|> angledLine(angle = segAng(rectangleSegmentA001), length = -segLen(rectangleSegmentA001), tag = $rectangleSegmentC001)
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
@ -3775,13 +3775,13 @@ sketch002 = startSketchOn(extrude001, face = rectangleSegmentA001)
await toolbar.revolveButton.click()
await cmdBar.progressCmdBar()
await page.getByText('Edge', { exact: true }).click()
const lineCodeToSelection = `angledLine(angle = 0deg, length = 202.6, tag = $rectangleSegmentA001)`
const lineCodeToSelection = `angledLine(angle = 0, length = 202.6, tag = $rectangleSegmentA001)`
await page.getByText(lineCodeToSelection).click()
await cmdBar.progressCmdBar()
await cmdBar.progressCmdBar()
await cmdBar.progressCmdBar()
const newCodeToFind = `revolve001 = revolve(sketch002, angle = 360deg, axis = rectangleSegmentA001)`
const newCodeToFind = `revolve001 = revolve(sketch002, angle = 360, axis = rectangleSegmentA001)`
await editor.expectEditor.toContain(newCodeToFind)
// Edit flow
@ -3819,7 +3819,7 @@ sketch002 = startSketchOn(extrude001, face = rectangleSegmentA001)
await toolbar.closePane('feature-tree')
await editor.expectEditor.toContain('angle001 = ' + newAngle)
await editor.expectEditor.toContain(
newCodeToFind.replace('angle = 360deg', 'angle = angle001')
newCodeToFind.replace('angle = 360', 'angle = angle001')
)
expect(editor.expectEditor.toContain(newCodeToFind)).toBeTruthy()
})
@ -3838,7 +3838,7 @@ sketch002 = startSketchOn(extrude001, face = rectangleSegmentA001)
|> xLine(length = 2.6)
sketch001 = startSketchOn(-XY)
|> startProfile(at = [-0.48, 1.25])
|> angledLine(angle = 0deg, length = 2.38, tag = $rectangleSegmentA001)
|> angledLine(angle = 0, length = 2.38, tag = $rectangleSegmentA001)
|> angledLine(angle = segAng(rectangleSegmentA001) - 90, length = 2.4, tag = $rectangleSegmentB001)
|> angledLine(angle = segAng(rectangleSegmentA001), length = -segLen(rectangleSegmentA001), tag = $rectangleSegmentC001)
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
@ -3876,7 +3876,7 @@ sketch002 = startSketchOn(extrude001, face = rectangleSegmentA001)
await cmdBar.progressCmdBar()
await cmdBar.progressCmdBar()
const newCodeToFind = `revolve001 = revolve(sketch003, angle = 360deg, axis = seg01)`
const newCodeToFind = `revolve001 = revolve(sketch003, angle = 360, axis = seg01)`
expect(editor.expectEditor.toContain(newCodeToFind)).toBeTruthy()
// Edit flow
@ -3909,7 +3909,7 @@ sketch002 = startSketchOn(extrude001, face = rectangleSegmentA001)
await cmdBar.progressCmdBar()
await toolbar.closePane('feature-tree')
await editor.expectEditor.toContain(
newCodeToFind.replace('angle = 360deg', 'angle = ' + newAngle)
newCodeToFind.replace('angle = 360', 'angle = ' + newAngle)
)
})
})
@ -4893,7 +4893,7 @@ path001 = startProfile(sketch001, at = [0, 0])
await page.getByTestId('context-menu-delete').click()
await scene.settled(cmdBar)
await editor.expectEditor.not.toContain(
`revolve001 = revolve([profile001, profile002], axis = XY, angle = 180deg)`,
`revolve001 = revolve([profile001, profile002], axis = XY, angle = 180)`,
{ shouldNormalise: true }
)
})

View File

@ -47,7 +47,7 @@ b
const importedFile = `sketch003 = startSketchOn(XY)
|> startProfile(at = [52.92, 157.81])
|> angledLine(angle = 0deg, length = 176.4, tag = $rectangleSegmentA001)
|> angledLine(angle = 0, length = 176.4, tag = $rectangleSegmentA001)
|> angledLine(
angle = segAng(rectangleSegmentA001) - 90,
length = 53.4,
@ -99,6 +99,8 @@ test.describe('edit with AI example snapshots', () => {
await test.step('fire off edit prompt', async () => {
await cmdBar.captureTextToCadRequestSnapshot(test.info())
await cmdBar.openCmdBar('promptToEdit')
await page.waitForTimeout(100)
await cmdBar.progressCmdBar()
// being specific about the color with a hex means asserting pixel color is more stable
await page
.getByTestId('cmd-bar-arg-value')

View File

@ -23,7 +23,7 @@ sketch002 = startSketchOn(XZ)
extrude002 = extrude(sketch002, length = 50)
sketch003 = startSketchOn(XY)
|> startProfile(at = [52.92, 157.81])
|> angledLine(angle = 0deg, length = 176.4, tag = $rectangleSegmentA001)
|> angledLine(angle = 0, length = 176.4, tag = $rectangleSegmentA001)
|> angledLine(angle = segAng(rectangleSegmentA001) - 90, length = 53.4, tag = $rectangleSegmentB001)
|> angledLine(angle = segAng(rectangleSegmentA001), length = -segLen(rectangleSegmentA001), tag = $rectangleSegmentC001)
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
@ -88,6 +88,8 @@ test.describe('Prompt-to-edit tests', () => {
await test.step('fire off edit prompt', async () => {
await cmdBar.openCmdBar('promptToEdit')
await page.waitForTimeout(100)
await cmdBar.progressCmdBar()
// being specific about the color with a hex means asserting pixel color is more stable
await page
.getByTestId('cmd-bar-arg-value')
@ -165,6 +167,8 @@ test.describe('Prompt-to-edit tests', () => {
await test.step('fire of bad prompt', async () => {
await cmdBar.openCmdBar('promptToEdit')
await page.waitForTimeout(100)
await cmdBar.progressCmdBar()
await page
.getByTestId('cmd-bar-arg-value')
.fill('ansheusha asnthuatshoeuhtaoetuhthaeu laughs in dvorak')

View File

@ -72,7 +72,7 @@ Internal engine error on request`
'persistCode',
`sketch001 = startSketchOn(XY)
|> startProfile(at = [82.33, 238.21])
|> angledLine(angle = 0deg, length = 288.63, tag = $rectangleSegmentA001)
|> angledLine(angle = 0, length = 288.63, tag = $rectangleSegmentA001)
|> angledLine(angle = segAng(rectangleSegmentA001) - 90, length = 197.97, tag = $rectangleSegmentB001)
|> angledLine(angle = segAng(rectangleSegmentA001), length = -segLen(rectangleSegmentA001), tag = $rectangleSegmentC001)
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
@ -245,7 +245,7 @@ extrude001 = extrude(sketch001, length = 50)
'persistCode',
`exampleSketch = startSketchOn(XZ)
|> startProfile(at = [0, 0])
|> angledLine(angle = 50deg, length = 45 )
|> angledLine(angle = 50, length = 45 )
|> yLine(endAbsolute = 0)
|> close()
|>
@ -301,7 +301,7 @@ extrude001 = extrude(sketch001, length = 50)
page.locator('.cm-content')
).toContainText(`exampleSketch = startSketchOn(XZ)
|> startProfile(at = [0, 0])
|> angledLine(angle = 50deg, length = 45 )
|> angledLine(angle = 50, length = 45 )
|> yLine(endAbsolute = 0)
|> close()
@ -321,7 +321,7 @@ extrude001 = extrude(sketch001, length = 50)
`@settings(defaultLengthUnit = mm)
sketch002 = startSketchOn(XY)
profile002 = startProfile(sketch002, at = [72.24, -52.05])
|> angledLine(angle = 0deg, length = 181.26, tag = $rectangleSegmentA001)
|> angledLine(angle = 0, length = 181.26, tag = $rectangleSegmentA001)
|> angledLine(angle = segAng(rectangleSegmentA001) - 90, length = 21.54)
|> angledLine(angle = segAng(rectangleSegmentA001), length = -segLen(rectangleSegmentA001))
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
@ -458,12 +458,10 @@ extrude002 = extrude(profile002, length = 150)
// Click the stl.
await expect(stlOption).toBeVisible()
await page.keyboard.press('Enter')
// Click the checkbox
await expect(submitButton).toBeVisible()
await page.keyboard.press('Enter')
// Find the toast.
@ -471,11 +469,13 @@ extrude002 = extrude(profile002, length = 150)
await expect(exportingToastMessage).toBeVisible()
// Expect it to succeed.
await expect(exportingToastMessage).not.toBeVisible({ timeout: 15_000 })
await expect(exportingToastMessage).not.toBeVisible()
await expect(engineErrorToastMessage).not.toBeVisible()
const successToastMessage = page.getByText(`Exported successfully`)
await expect(successToastMessage).toBeVisible()
await page.waitForTimeout(1_000)
const count = await successToastMessage.count()
await expect(count).toBeGreaterThanOrEqual(1)
}
)
// We updated this test such that you can have multiple exports going at once.

View File

@ -1222,7 +1222,7 @@ profile001 = startProfile(sketch001, at = [299.72, 230.82])
fn lug(origin, length, diameter, plane) {
lugSketch = startSketchOn(plane)
|> startProfile(at = [origin[0] + lugDiameter / 2, origin[1]])
|> angledLine(angle = 60deg, lengthY = lugHeadLength)
|> angledLine(angle = 60, lengthY = lugHeadLength)
|> xLine(endAbsolute = 0 + .001)
|> yLine(endAbsolute = 0)
|> close()
@ -1287,7 +1287,7 @@ extrude001 = extrude(profile001, length = 200)
|> translate(x = 3.14, y = 3.14, z = -50.154)
sketch002 = startSketchOn(XY)
profile002 = startProfile(sketch002, at = [72.2, -52.05])
|> angledLine(angle = 0deg, length = 181.26, tag = $rectangleSegmentA001)
|> angledLine(angle = 0, length = 181.26, tag = $rectangleSegmentA001)
|> angledLine(angle = segAng(rectangleSegmentA001) - 90, length = 21.54)
|> angledLine(angle = segAng(rectangleSegmentA001), length = -segLen(rectangleSegmentA001), tag = $mySeg)
|> line(endAbsolute = [profileStartX(%), profileStartY(%)], tag = $seg01)
@ -2058,7 +2058,7 @@ profile003 = startProfile(sketch001, at = [206.63, -56.73])
)
await crnRect1point2()
await editor.expectEditor.toContain(
`|> angledLine(angle = 0deg, length = 2.37, tag = $rectangleSegmentA001)
`|> angledLine(angle = 0, length = 2.37, tag = $rectangleSegmentA001)
|> angledLine(angle = segAng(rectangleSegmentA001) - 90, length = 7.8)
|> angledLine(angle = segAng(rectangleSegmentA001), length = -segLen(rectangleSegmentA001))
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
@ -2073,7 +2073,7 @@ profile003 = startProfile(sketch001, at = [206.63, -56.73])
await crnRect2point2()
await page.waitForTimeout(300)
await editor.expectEditor.toContain(
`|> angledLine(angle = 0deg, length = 5.49, tag = $rectangleSegmentA002)
`|> angledLine(angle = 0, length = 5.49, tag = $rectangleSegmentA002)
|> angledLine(angle = segAng(rectangleSegmentA002) - 90, length = 4.14)
|> angledLine(angle = segAng(rectangleSegmentA002), length = -segLen(rectangleSegmentA002))
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
@ -2092,7 +2092,7 @@ profile003 = startProfile(sketch001, at = [206.63, -56.73])
await cntrRect1point2()
await page.waitForTimeout(300)
await editor.expectEditor.toContain(
`|> angledLine(angle = 0deg, length = 7.06, tag = $rectangleSegmentA003)
`|> angledLine(angle = 0, length = 7.06, tag = $rectangleSegmentA003)
|> angledLine(angle = segAng(rectangleSegmentA003) + 90, length = 4.34)
|> angledLine(angle = segAng(rectangleSegmentA003), length = -segLen(rectangleSegmentA003))
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
@ -2108,7 +2108,7 @@ profile003 = startProfile(sketch001, at = [206.63, -56.73])
await cntrRect2point2()
await page.waitForTimeout(300)
await editor.expectEditor.toContain(
`|> angledLine(angle = 0deg, length = 3.12, tag = $rectangleSegmentA004)
`|> angledLine(angle = 0, length = 3.12, tag = $rectangleSegmentA004)
|> angledLine(angle = segAng(rectangleSegmentA004) + 90, length = 6.24)
|> angledLine(angle = segAng(rectangleSegmentA004), length = -segLen(rectangleSegmentA004))
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
@ -2258,7 +2258,7 @@ profile001 = startProfile(sketch001, at = [6.24, 4.54])
|> line(end = [8.61, 0.74])
|> line(end = [10.99, -5.22])
profile002 = startProfile(sketch001, at = [11.19, 5.02])
|> angledLine(angle = 0deg, length = 10.78, tag = $rectangleSegmentA001)
|> angledLine(angle = 0, length = 10.78, tag = $rectangleSegmentA001)
|> angledLine(angle = segAng(rectangleSegmentA001) - 90, length = 4.14)
|> angledLine(angle = segAng(rectangleSegmentA001), length = -segLen(rectangleSegmentA001))
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
@ -2370,7 +2370,7 @@ profile004 = circleThreePoint(sketch001, p1 = [13.44, -6.8], p2 = [13.39, -2.07]
await page.waitForTimeout(100)
await rectEnd()
await editor.expectEditor.toContain(
`|> angledLine(angle = 180deg, length = 1.97, tag = $rectangleSegmentA002)
`|> angledLine(angle = 180, length = 1.97, tag = $rectangleSegmentA002)
|> angledLine(angle = segAng(rectangleSegmentA002) + 90, length = 3.89)
|> angledLine(angle = segAng(rectangleSegmentA002), length = -segLen(rectangleSegmentA002))
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
@ -2396,7 +2396,7 @@ profile001 = startProfile(sketch001, at = [6.24, 4.54])
|> line(end = [8.61, 0.74])
|> line(end = [10.99, -5.22])
profile002 = startProfile(sketch001, at = [11.19, 5.02])
|> angledLine(angle = 0deg, length = 10.78, tag = $rectangleSegmentA001)
|> angledLine(angle = 0, length = 10.78, tag = $rectangleSegmentA001)
|> angledLine(angle = segAng(rectangleSegmentA001) - 90, length = 4.14)
|> angledLine(angle = segAng(rectangleSegmentA001), length = -segLen(rectangleSegmentA001))
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
@ -2501,7 +2501,7 @@ profile001 = startProfile(sketch001, at = [-63.43, 193.08])
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close()
profile003 = startProfile(sketch001, at = [16.79, 38.24])
|> angledLine(angle = 0deg, length = 182.82, tag = $rectangleSegmentA001)
|> angledLine(angle = 0, length = 182.82, tag = $rectangleSegmentA001)
|> angledLine(angle = segAng(rectangleSegmentA001) - 90, length = 105.71)
|> angledLine(angle = segAng(rectangleSegmentA001), length = -segLen(rectangleSegmentA001))
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
@ -2726,7 +2726,7 @@ profile002 = startProfile(sketch002, at = [0.75, 13.46])
|> line(end = [4.52, 3.79])
|> line(end = [5.98, -2.81])
profile003 = startProfile(sketch002, at = [3.19, 13.3])
|> angledLine(angle = 0deg, length = 6.64, tag = $rectangleSegmentA001)
|> angledLine(angle = 0, length = 6.64, tag = $rectangleSegmentA001)
|> angledLine(angle = segAng(rectangleSegmentA001) - 90, length = 2.81)
|> angledLine(angle = segAng(rectangleSegmentA001), length = -segLen(rectangleSegmentA001))
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
@ -2744,7 +2744,7 @@ profile006 = startProfile(sketch002, at = [9.65, 3.82])
|> close()
revolve001 = revolve(
profile004,
angle = 45deg,
angle = 45,
axis = getNextAdjacentEdge(seg01)
)
extrude002 = extrude(profile006, length = 4)
@ -2768,14 +2768,14 @@ profile010 = circle(
radius = 2.67
)
profile011 = startProfile(sketch003, at = [5.07, -6.39])
|> angledLine(angle = 0deg, length = 4.54, tag = $rectangleSegmentA002)
|> angledLine(angle = 0, length = 4.54, tag = $rectangleSegmentA002)
|> angledLine(angle = segAng(rectangleSegmentA002) - 90, length = 4.17)
|> angledLine(angle = segAng(rectangleSegmentA002), length = -segLen(rectangleSegmentA002))
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close()
extrude003 = extrude(profile011, length = 2.5)
// TODO this breaks the test,
// revolve002 = revolve(profile008, angle = 45deg, axis = seg02)
// revolve002 = revolve(profile008, angle = 45, axis = seg02)
`
)
})
@ -2921,7 +2921,7 @@ loft([profile001, profile002])
)
await rect1Crn2()
await editor.expectEditor.toContain(
`angledLine(angle = 0deg, length = 113.01, tag = $rectangleSegmentA001)`
`angledLine(angle = 0, length = 113.01, tag = $rectangleSegmentA001)`
)
})
test('Can enter sketch loft edges offsetPlane and continue sketch', async ({
@ -2990,7 +2990,7 @@ loft([profile001, profile002])
)
await rect1Crn2()
await editor.expectEditor.toContain(
`angledLine(angle = 0deg, length = 106.42], tag = $rectangleSegmentA001)`
`angledLine(angle = 0, length = 106.42], tag = $rectangleSegmentA001)`
)
await page.waitForTimeout(100)
})
@ -3212,7 +3212,7 @@ test.describe('manual edits during sketch mode', () => {
extrude001 = extrude(profile001, length = 500)
sketch002 = startSketchOn(extrude001, face = seg01)
profile002 = startProfile(sketch002, at = [83.39, 329.15])
|> angledLine(angle = 0deg, length = 119.61, tag = $rectangleSegmentA001)
|> angledLine(angle = 0, length = 119.61, tag = $rectangleSegmentA001)
|> angledLine(length = 156.54, angle = -28)
|> angledLine(
angle = -151,
@ -3348,7 +3348,7 @@ profile001 = startProfile(sketch001, at = [106.68, 89.77])
extrude001 = extrude(profile001, length = 500)
sketch002 = startSketchOn(extrude001, face = seg01)
profile002 = startProfile(sketch002, at = [83.39, 329.15])
|> angledLine(angle = 0deg, length = 119.61, tag = $rectangleSegmentA001)
|> angledLine(angle = 0, length = 119.61, tag = $rectangleSegmentA001)
|> angledLine(length = 219.2, angle = -56)
|> angledLine(angle = -151, length = 116.27)
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
@ -3387,7 +3387,7 @@ profile003 = startProfile(sketch002, at = [-201.08, 254.17])
extrude001 = extrude(profile001, length = 500)
sketch002 = startSketchOn(extrude001, face = seg01)
profile002 = startProfile(sketch002, at = [83.39, 329.15])
|> angledLine(angle = 0deg, length = 119.61, tag = $rectangleSegmentA001)
|> angledLine(angle = 0, length = 119.61, tag = $rectangleSegmentA001)
|> angledLine(length = 156.54, angle = -28)
|> angledLine(
angle = -151,

View File

@ -845,7 +845,7 @@ test.describe('code color goober', { tag: '@snapshot' }, () => {
sweepPath = startSketchOn(XZ)
|> startProfile(at = [0.05, 0.05])
|> line(end = [0, 7])
|> tangentialArc(angle = 90deg, radius = 5)
|> tangentialArc(angle = 90, radius = 5)
|> line(end = [-3, 0])
|> tangentialArc(angle = -90, radius = 5)
|> line(end = [0, 7])
@ -889,7 +889,7 @@ sweepSketch = startSketchOn(XY)
sweepPath = startSketchOn(XZ)
|> startProfile(at = [0.05, 0.05])
|> line(end = [0, 7])
|> tangentialArc(angle = 90deg, radius = 5)
|> tangentialArc(angle = 90, radius = 5)
|> line(end = [-3, 0])
|> tangentialArc(angle = -90, radius = 5)
|> line(end = [0, 7])
@ -934,7 +934,7 @@ sweepSketch = startSketchOn(XY)
sweepPath = startSketchOn(XZ)
|> startProfile(at = [0.05, 0.05])
|> line(end = [0, 7])
|> tangentialArc(angle = 90deg, radius = 5)
|> tangentialArc(angle = 90, radius = 5)
|> line(end = [-3, 0])
|> tangentialArc(angle = -90, radius = 5)
|> line(end = [0, 7])

Binary file not shown.

Before

Width:  |  Height:  |  Size: 56 KiB

After

Width:  |  Height:  |  Size: 56 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 49 KiB

After

Width:  |  Height:  |  Size: 48 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 56 KiB

After

Width:  |  Height:  |  Size: 56 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 49 KiB

After

Width:  |  Height:  |  Size: 48 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 48 KiB

After

Width:  |  Height:  |  Size: 48 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 47 KiB

After

Width:  |  Height:  |  Size: 47 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 43 KiB

After

Width:  |  Height:  |  Size: 43 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 46 KiB

After

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 52 KiB

After

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 58 KiB

After

Width:  |  Height:  |  Size: 58 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 74 KiB

After

Width:  |  Height:  |  Size: 74 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 46 KiB

After

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 58 KiB

After

Width:  |  Height:  |  Size: 58 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 132 KiB

After

Width:  |  Height:  |  Size: 132 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 116 KiB

After

Width:  |  Height:  |  Size: 116 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 132 KiB

After

Width:  |  Height:  |  Size: 132 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 65 KiB

After

Width:  |  Height:  |  Size: 65 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 68 KiB

After

Width:  |  Height:  |  Size: 68 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

After

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 67 KiB

After

Width:  |  Height:  |  Size: 66 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 67 KiB

After

Width:  |  Height:  |  Size: 67 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 63 KiB

After

Width:  |  Height:  |  Size: 63 KiB

View File

@ -62,16 +62,16 @@ export const TEST_CODE_GIZMO = `@settings(defaultLengthUnit = in)
part001 = startSketchOn(XZ)
|> startProfile(at = [20, 0])
|> line(end = [7.13, 4 + 0])
|> angledLine(angle = 3deg + 0, length = 3.14 + 0 )
|> angledLine(angle = 3 + 0, length = 3.14 + 0 )
|> line(endAbsolute = [20.14 + 0, -0.14 + 0])
|> xLine(endAbsolute = 29 + 0)
|> yLine(length = -3.14 + 0, tag = $a)
|> xLine(length = 1.63)
|> angledLine(angle = 3deg + 0, lengthX = 3.14 )
|> angledLine(angle = 30deg, lengthY = 3 + 0 )
|> angledLine(angle = 22.14deg + 0, endAbsoluteX = 12)
|> angledLine(angle = 30deg, endAbsoluteY = 11.14)
|> angledLineThatIntersects(angle = 3.14deg, intersectTag = a, offset = 0)
|> angledLine(angle = 3 + 0, lengthX = 3.14 )
|> angledLine(angle = 30, lengthY = 3 + 0 )
|> angledLine(angle = 22.14 + 0, endAbsoluteX = 12)
|> angledLine(angle = 30, endAbsoluteY = 11.14)
|> angledLineThatIntersects(angle = 3.14, intersectTag = a, offset = 0)
|> tangentialArc(endAbsolute = [13.14 + 0, 13.14])
|> close()
|> extrude(length = 5 + 7)
@ -122,7 +122,7 @@ sketch001 = startSketchOn(box, face = revolveAxis)
|> close()
|> revolve(
axis = revolveAxis,
angle = 90deg
angle = 90
)
sketch001 = startSketchOn(XZ)

View File

@ -551,11 +551,6 @@ export async function getUtils(page: Page, test_?: typeof test) {
createNewFile: async (name: string) => {
return test?.step(`Create a file named ${name}`, async () => {
// If the application is in the middle of connecting a stream
// then creating a new file won't work in the end.
await expect(
page.getByRole('button', { name: 'Start Sketch' })
).not.toBeDisabled()
await page.getByTestId('create-file-button').click()
await page.getByTestId('tree-input-field').fill(name)
await page.keyboard.press('Enter')

View File

@ -57,7 +57,7 @@ test.describe('Testing constraints', () => {
.click()
await expect(page.locator('.cm-content')).toHaveText(
`length001 = 20sketch001 = startSketchOn(XY) |> startProfile(at = [-10, -10]) |> line(end = [20, 0]) |> angledLine(angle = 90deg, length = length001) |> xLine(length = -20)`
`length001 = 20sketch001 = startSketchOn(XY) |> startProfile(at = [-10, -10]) |> line(end = [20, 0]) |> angledLine(angle = 90, length = length001) |> xLine(length = -20)`
)
// Make sure we didn't pop out of sketch mode.
@ -852,7 +852,7 @@ part002 = startSketchOn(XZ)
test.describe('Two segment - no modal constraints', () => {
const cases = [
{
codeAfter: `|> angledLine(angle = 83deg, length = segLen(seg01))`,
codeAfter: `|> angledLine(angle = 83, length = segLen(seg01))`,
constraintName: 'Equal Length',
},
{
@ -1174,7 +1174,7 @@ test.describe('Electron constraint tests', () => {
await cmdBar.progressCmdBar()
await editor.expectEditor.toContain('length001 = 15.3')
await editor.expectEditor.toContain(
'|> angledLine(angle = 9deg, length = length001)'
'|> angledLine(angle = 9, length = length001)'
)
})

View File

@ -259,7 +259,7 @@ test.describe(`Testing gizmo, fixture-based`, () => {
`@settings(defaultLengthUnit = in)
sketch002 = startSketchOn(XZ)
|> startProfile(at = [-108.83, -57.48])
|> angledLine(angle = 0deg, length = 105.13, tag = $rectangleSegmentA001)
|> angledLine(angle = 0, length = 105.13, tag = $rectangleSegmentA001)
|> angledLine(angle = segAng(rectangleSegmentA001) - 90, length = 77.9)
|> angledLine(angle = segAng(rectangleSegmentA001), length = -segLen(rectangleSegmentA001))
|> close()

View File

@ -207,17 +207,17 @@ test.describe('Testing segment overlays', () => {
part001 = startSketchOn(XZ)
|> startProfile(at = [5 + 0, 20 + 0])
|> line(end = [0.5, -14 + 0])
|> angledLine(angle = 3deg + 0, length = 32 + 0)
|> angledLine(angle = 3 + 0, length = 32 + 0)
|> line(endAbsolute = [5 + 33, 20 + 11.5 + 0])
|> xLine(endAbsolute = 5 + 9 - 5)
|> yLine(endAbsolute = 20 + -10.77, tag = $a)
|> xLine(length = 26.04)
|> yLine(length = 21.14 + 0)
|> angledLine(angle = 181deg + 0, lengthX = 23.14)
|> angledLine(angle = 181 + 0, lengthX = 23.14)
|> angledLine(angle = -91, lengthY = 19 + 0)
|> angledLine(angle = 3deg + 0, endAbsoluteX = 5 + 26)
|> angledLine(angle = 89deg, endAbsoluteY = 20 + 9.14 + 0)
|> angledLineThatIntersects(angle = 4.14deg, intersectTag = a, offset = 9)
|> angledLine(angle = 3 + 0, endAbsoluteX = 5 + 26)
|> angledLine(angle = 89, endAbsoluteY = 20 + 9.14 + 0)
|> angledLineThatIntersects(angle = 4.14, intersectTag = a, offset = 9)
|> tangentialArc(endAbsolute = [5 + 3.14 + 13, 20 + 3.14])
`
)
@ -295,9 +295,8 @@ test.describe('Testing segment overlays', () => {
await clickConstrained({
hoverPos: { x: angledLine.x, y: angledLine.y },
constraintType: 'angle',
expectBeforeUnconstrained:
'angledLine(angle = 3deg + 0, length = 32 + 0)',
expectAfterUnconstrained: 'angledLine(angle = 3deg, length = 32 + 0)',
expectBeforeUnconstrained: 'angledLine(angle = 3 + 0, length = 32 + 0)',
expectAfterUnconstrained: 'angledLine(angle = 3, length = 32 + 0)',
expectFinal: 'angledLine(angle = angle001, length = 32 + 0)',
ang: ang + 180,
locator: '[data-overlay-toolbar-index="1"]',
@ -384,7 +383,7 @@ test.describe('Testing segment overlays', () => {
|> yLine(endAbsolute = -10.77, tag = $a)
|> xLine(length = 26.04)
|> yLine(length = 21.14 + 0)
|> angledLine(angle = 181deg + 0, lengthX = 23.14)
|> angledLine(angle = 181 + 0, lengthX = 23.14)
`
)
})
@ -451,17 +450,17 @@ test.describe('Testing segment overlays', () => {
part001 = startSketchOn(XZ)
|> startProfile(at = [0, 0])
|> line(end = [0.5, -14 + 0])
|> angledLine(angle = 3deg + 0, length = 32 + 0)
|> angledLine(angle = 3 + 0, length = 32 + 0)
|> line(endAbsolute = [33, 11.5 + 0])
|> xLine(endAbsolute = 9 - 5)
|> yLine(endAbsolute = -10.77, tag = $a)
|> xLine(length = 26.04)
|> yLine(length = 21.14 + 0)
|> angledLine(angle = 181deg + 0, lengthX = 23.14)
|> angledLine(angle = 181 + 0, lengthX = 23.14)
|> angledLine(angle = -91, lengthY = 19 + 0)
|> angledLine(angle = 3deg + 0, endAbsoluteX = 26)
|> angledLine(angle = 89deg, endAbsoluteY = 9.14 + 0)
|> angledLineThatIntersects(angle = 4.14deg, intersectTag = a, offset = 9)
|> angledLine(angle = 3 + 0, endAbsoluteX = 26)
|> angledLine(angle = 89, endAbsoluteY = 9.14 + 0)
|> angledLineThatIntersects(angle = 4.14, intersectTag = a, offset = 9)
|> tangentialArc(endAbsolute = [3.14 + 13, 3.14])
`
)
@ -512,7 +511,7 @@ test.describe('Testing segment overlays', () => {
hoverPos: { x: angledLineOfXLength.x, y: angledLineOfXLength.y },
constraintType: 'angle',
expectBeforeUnconstrained:
'angledLine(angle = 181deg + 0, lengthX = 23.14)',
'angledLine(angle = 181 + 0, lengthX = 23.14)',
expectAfterUnconstrained: 'angledLine(angle = -179, lengthX = 23.14)',
expectFinal: 'angledLine(angle = angle001, lengthX = 23.14)',
ang: ang + 180,
@ -572,17 +571,17 @@ test.describe('Testing segment overlays', () => {
part001 = startSketchOn(XZ)
|> startProfile(at = [0, 0])
|> line(end = [0.5, -14 + 0])
|> angledLine(angle = 3deg + 0, length = 32 + 0)
|> angledLine(angle = 3 + 0, length = 32 + 0)
|> line(endAbsolute = [33, 11.5 + 0])
|> xLine(endAbsolute = 9 - 5)
|> yLine(endAbsolute = -10.77, tag = $a)
|> xLine(length = 26.04)
|> yLine(length = 21.14 + 0)
|> angledLine(angle = 181deg + 0, lengthX = 23.14)
|> angledLine(angle = 181 + 0, lengthX = 23.14)
|> angledLine(angle = -91, lengthY = 19 + 0)
|> angledLine(angle = 3deg + 0, endAbsoluteX = 26)
|> angledLine(angle = 89deg, endAbsoluteY = 9.14 + 0)
|> angledLineThatIntersects(angle = 4.14deg, intersectTag = a, offset = 9)
|> angledLine(angle = 3 + 0, endAbsoluteX = 26)
|> angledLine(angle = 89, endAbsoluteY = 9.14 + 0)
|> angledLineThatIntersects(angle = 4.14, intersectTag = a, offset = 9)
|> tangentialArc(endAbsolute = [3.14 + 13, 1.14])
`
)
@ -617,8 +616,8 @@ test.describe('Testing segment overlays', () => {
hoverPos: { x: angledLineToX.x, y: angledLineToX.y },
constraintType: 'angle',
expectBeforeUnconstrained:
'angledLine(angle = 3deg + 0, endAbsoluteX = 26)',
expectAfterUnconstrained: 'angledLine(angle = 3deg, endAbsoluteX = 26)',
'angledLine(angle = 3 + 0, endAbsoluteX = 26)',
expectAfterUnconstrained: 'angledLine(angle = 3, endAbsoluteX = 26)',
expectFinal: 'angledLine(angle = angle001, endAbsoluteX = 26)',
ang: ang + 180,
locator: '[data-overlay-toolbar-index="9"]',
@ -642,9 +641,9 @@ test.describe('Testing segment overlays', () => {
await clickUnconstrained({
hoverPos: { x: angledLineToY.x, y: angledLineToY.y },
constraintType: 'angle',
expectBeforeUnconstrained: 'angledLine(angle = 89deg, to = 9.14 + 0)',
expectBeforeUnconstrained: 'angledLine(angle = 89, to = 9.14 + 0)',
expectAfterUnconstrained: 'angledLine(angle = angle002, to = 9.14 + 0)',
expectFinal: 'angledLine(angle = 89deg, to = 9.14 + 0)',
expectFinal: 'angledLine(angle = 89, to = 9.14 + 0)',
steps: process.platform === 'darwin' ? 8 : 9,
ang: ang + 180,
locator: '[data-overlay-toolbar-index="10"]',
@ -654,10 +653,9 @@ test.describe('Testing segment overlays', () => {
hoverPos: { x: angledLineToY.x, y: angledLineToY.y },
constraintType: 'yAbsolute',
expectBeforeUnconstrained:
'angledLine(angle = 89deg, endAbsoluteY = 9.14 + 0)',
expectAfterUnconstrained:
'angledLine(angle = 89deg, endAbsoluteY = 9.14)',
expectFinal: 'angledLine(angle = 89deg, endAbsoluteY = yAbs001)',
'angledLine(angle = 89, endAbsoluteY = 9.14 + 0)',
expectAfterUnconstrained: 'angledLine(angle = 89, endAbsoluteY = 9.14)',
expectFinal: 'angledLine(angle = 89, endAbsoluteY = yAbs001)',
ang: ang + 180,
locator: '[data-overlay-toolbar-index="10"]',
})
@ -673,7 +671,7 @@ test.describe('Testing segment overlays', () => {
y: angledLineThatIntersects.y,
},
constraintType: 'angle',
expectBeforeUnconstrained: `angledLineThatIntersects(angle = 4.14deg, intersectTag = a, offset = 9)`,
expectBeforeUnconstrained: `angledLineThatIntersects(angle = 4.14, intersectTag = a, offset = 9)`,
expectAfterUnconstrained: `angledLineThatIntersects(angle = angle003, intersectTag = a,offset = 9)`,
expectFinal: `angledLineThatIntersects(angle = -176, offset = 9, intersectTag = a)`,
ang: ang + 180,
@ -707,17 +705,17 @@ test.describe('Testing segment overlays', () => {
part001 = startSketchOn(XZ)
|> startProfile(at = [0, 0])
|> line(end = [0.5, -14 + 0])
|> angledLine(angle = 3deg + 0, length = 32 + 0)
|> angledLine(angle = 3 + 0, length = 32 + 0)
|> line(endAbsolute = [33, 11.5 + 0])
|> xLine(endAbsolute = 9 - 5)
|> yLine(endAbsolute = -10.77, tag = $a)
|> xLine(length = 26.04)
|> yLine(length = 21.14 + 0)
|> angledLine(angle = 181deg + 0, lengthX = 23.14)
|> angledLine(angle = 181 + 0, lengthX = 23.14)
|> angledLine(angle = -91, lengthY = 19 + 0)
|> angledLine(angle = 3deg + 0, endAbsoluteX = 26)
|> angledLine(angle = 89deg, endAbsoluteY = 9.14 + 0)
|> angledLineThatIntersects(angle = 4.14deg, intersectTag = a, offset = 9)
|> angledLine(angle = 3 + 0, endAbsoluteX = 26)
|> angledLine(angle = 89, endAbsoluteY = 9.14 + 0)
|> angledLineThatIntersects(angle = 4.14, intersectTag = a, offset = 9)
|> tangentialArc(endAbsolute = [3.14 + 13, -3.14])
`
)
@ -994,17 +992,17 @@ part001 = startSketchOn(XZ)
part001 = startSketchOn(XZ)
|> startProfile(at = [0, 0])
|> line(end = [0.5, -14 + 0])
|> angledLine(angle = 3deg + 0, length = 32 + 0)
|> angledLine(angle = 3 + 0, length = 32 + 0)
|> line(endAbsolute = [33, 11.5 + 0])
|> xLine(endAbsolute = 9 - 5)
|> yLine(endAbsolute = -10.77, tag = $a)
|> xLine(length = 26.04)
|> yLine(length = 21.14 + 0)
|> angledLine(angle = 181deg + 0, lengthX = 23.14)
|> angledLine(angle = 181 + 0, lengthX = 23.14)
|> angledLine(angle = -91, lengthY = 19 + 0)
|> angledLine(angle = 3deg + 0, endAbsoluteX = 26)
|> angledLine(angle = 89deg, endAbsoluteY = 9.14 + 0)
|> angledLineThatIntersects(angle = 4.14deg, intersectTag = a, offset = 9)
|> angledLine(angle = 3 + 0, endAbsoluteX = 26)
|> angledLine(angle = 89, endAbsoluteY = 9.14 + 0)
|> angledLineThatIntersects(angle = 4.14, intersectTag = a, offset = 9)
|> tangentialArc(endAbsolute = [3.14 + 13, 1.14])
|> arc(interiorAbsolute = [16.25, 5.12], endAbsolute = [21.61, 4.15])
|> arc(angleStart = 40.27, angleEnd = -38.05, radius = 9.03)
@ -1080,7 +1078,7 @@ part001 = startSketchOn(XZ)
ang = await u.getAngle(`[data-overlay-index="${overlayIndex}"]`)
await deleteSegmentSequence({
hoverPos: { x: segmentToDelete.x, y: segmentToDelete.y },
codeToBeDeleted: `angledLineThatIntersects(angle = 4.14deg, intersectTag = a, offset = 9)`,
codeToBeDeleted: `angledLineThatIntersects(angle = 4.14, intersectTag = a, offset = 9)`,
stdLibFnName: 'angledLineThatIntersects',
ang: ang + 180,
steps: 7,
@ -1093,7 +1091,7 @@ part001 = startSketchOn(XZ)
ang = await u.getAngle(`[data-overlay-index="${overlayIndex}"]`)
await deleteSegmentSequence({
hoverPos: { x: segmentToDelete.x, y: segmentToDelete.y },
codeToBeDeleted: 'angledLine(angle = 89deg, endAbsoluteY = 9.14 + 0)',
codeToBeDeleted: 'angledLine(angle = 89, endAbsoluteY = 9.14 + 0)',
stdLibFnName: 'angledLineToY',
ang: ang + 180,
locator: `[data-overlay-toolbar-index="${overlayIndex}"]`,
@ -1105,7 +1103,7 @@ part001 = startSketchOn(XZ)
ang = await u.getAngle(`[data-overlay-index="${overlayIndex}"]`)
await deleteSegmentSequence({
hoverPos: { x: segmentToDelete.x, y: segmentToDelete.y },
codeToBeDeleted: 'angledLine(angle = 3deg + 0, endAbsoluteX = 26)',
codeToBeDeleted: 'angledLine(angle = 3 + 0, endAbsoluteX = 26)',
stdLibFnName: 'angledLineToX',
ang: ang + 180,
locator: `[data-overlay-toolbar-index="${overlayIndex}"]`,
@ -1129,7 +1127,7 @@ part001 = startSketchOn(XZ)
ang = await u.getAngle(`[data-overlay-index="${overlayIndex}"]`)
await deleteSegmentSequence({
hoverPos: { x: segmentToDelete.x, y: segmentToDelete.y },
codeToBeDeleted: 'angledLine(angle = 181deg + 0, lengthX = 23.14)',
codeToBeDeleted: 'angledLine(angle = 181 + 0, lengthX = 23.14)',
stdLibFnName: 'angledLineOfXLength',
ang: ang + 180,
locator: `[data-overlay-toolbar-index="${overlayIndex}"]`,
@ -1224,7 +1222,7 @@ part001 = startSketchOn(XZ)
ang = await u.getAngle(`[data-overlay-index="${overlayIndex}"]`)
await deleteSegmentSequence({
hoverPos: { x: segmentToDelete.x, y: segmentToDelete.y },
codeToBeDeleted: 'angledLine(angle = 3deg + 0, length = 32 + 0)',
codeToBeDeleted: 'angledLine(angle = 3 + 0, length = 32 + 0)',
stdLibFnName: 'angledLine',
ang: ang + 180,
locator: `[data-overlay-toolbar-index="${overlayIndex}"]`,
@ -1247,19 +1245,19 @@ part001 = startSketchOn(XZ)
test.describe('Testing delete with dependent segments', () => {
const cases = [
'line(end = [22, 2], tag = $seg01)',
'angledLine(angle = 5deg, length = 23.03, tag = $seg01)',
'angledLine(angle = 5, length = 23.03, tag = $seg01)',
'xLine(length = 23, tag = $seg01)',
'yLine(length = -8, tag = $seg01)',
'xLine(endAbsolute = 30, tag = $seg01)',
'yLine(endAbsolute = -4, tag = $seg01)',
'angledLine(angle = 3deg, lengthX = 30, tag = $seg01)',
'angledLine(angle = 3deg, lengthY = 1.5, tag = $seg01)',
'angledLine(angle = 3deg, endAbsoluteX = 30, tag = $seg01)',
'angledLine(angle = 3deg, endAbsoluteY = 7, tag = $seg01)',
'angledLine(angle = 3, lengthX = 30, tag = $seg01)',
'angledLine(angle = 3, lengthY = 1.5, tag = $seg01)',
'angledLine(angle = 3, endAbsoluteX = 30, tag = $seg01)',
'angledLine(angle = 3, endAbsoluteY = 7, tag = $seg01)',
]
for (const doesHaveTagOutsideSketch of [true, false]) {
for (const lineOfInterest of cases) {
const isObj = lineOfInterest.includes('{ angle = 3deg,')
const isObj = lineOfInterest.includes('{ angle = 3,')
test(`${lineOfInterest}${isObj ? '-[obj-input]' : ''}${
doesHaveTagOutsideSketch ? '-[tagOutsideSketch]' : ''
}`, async ({ page, editor, homePage }) => {
@ -1385,7 +1383,7 @@ part001 = startSketchOn(XZ)
},
{
before: `angledLine(angle = 5deg + 0, length = 23.03 + 0, tag = $seg01)`,
before: `angledLine(angle = 5 + 0, length = 23.03 + 0, tag = $seg01)`,
after: `line(end = [22.94, 2.01], tag = $seg01)`,
},
{
@ -1405,19 +1403,19 @@ part001 = startSketchOn(XZ)
after: `line(end = [0, -10], tag = $seg01)`,
},
{
before: `angledLine(angle = 3deg + 0, lengthX = 30 + 0, tag = $seg01)`,
before: `angledLine(angle = 3 + 0, lengthX = 30 + 0, tag = $seg01)`,
after: `line(end = [30, 1.57], tag = $seg01)`,
},
{
before: `angledLine(angle = 3deg + 0, lengthY = 1.5 + 0, tag = $seg01)`,
before: `angledLine(angle = 3 + 0, lengthY = 1.5 + 0, tag = $seg01)`,
after: `line(end = [28.62, 1.5], tag = $seg01)`,
},
{
before: `angledLine(angle = 3deg + 0, endAbsoluteX = 30 + 0, tag = $seg01)`,
before: `angledLine(angle = 3 + 0, endAbsoluteX = 30 + 0, tag = $seg01)`,
after: `line(end = [25, 1.31], tag = $seg01)`,
},
{
before: `angledLine(angle = 3deg + 0, endAbsoluteY = 7 + 0, tag = $seg01)`,
before: `angledLine(angle = 3 + 0, endAbsoluteY = 7 + 0, tag = $seg01)`,
after: `line(end = [19.08, 1], tag = $seg01)`,
},
]

View File

@ -307,15 +307,15 @@ part009 = startSketchOn(XY)
|> startProfile(at = [pipeLargeDia - (thickness / 2), 38])
|> line(end = [thickness, 0])
|> line(end = [0, -1])
|> angledLine(angle = 60deg, endAbsoluteX = pipeSmallDia + thickness)
|> angledLine(angle = 60, endAbsoluteX = pipeSmallDia + thickness)
|> line(end = [0, -pipeLength])
|> angledLine(angle = -60, endAbsoluteX = pipeLargeDia + thickness)
|> line(end = [0, -1])
|> line(end = [-thickness, 0])
|> line(end = [0, 1])
|> angledLine(angle = 120deg, endAbsoluteX = pipeSmallDia)
|> angledLine(angle = 120, endAbsoluteX = pipeSmallDia)
|> line(end = [0, pipeLength])
|> angledLine(angle = 60deg, endAbsoluteX = pipeLargeDia)
|> angledLine(angle = 60, endAbsoluteX = pipeLargeDia)
|> close()
rev = revolve(part009, axis = Y)
sketch006 = startSketchOn(XY)
@ -325,7 +325,7 @@ profile001 = circle(
radius = 17.96
)
profile002 = startProfile(sketch006, at = [86.92, -63.81])
|> angledLine(angle = 0deg, length = 63.81, tag = $rectangleSegmentA001)
|> angledLine(angle = 0, length = 63.81, tag = $rectangleSegmentA001)
|> angledLine(angle = segAng(rectangleSegmentA001) - 90, length = 17.05)
|> angledLine(angle = segAng(rectangleSegmentA001), length = -segLen(rectangleSegmentA001))
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
@ -464,7 +464,7 @@ profile002 = startProfile(sketch002, at = [-11.08, 2.39])
|> close()
extrude001 = extrude(profile002, length = 15)
profile001 = startProfile(sketch001, at = [7.49, 9.96])
|> angledLine(angle = 0deg, length = 5.05, tag = $rectangleSegmentA001)
|> angledLine(angle = 0, length = 5.05, tag = $rectangleSegmentA001)
|> angledLine(angle = segAng(rectangleSegmentA001) - 90, length = 4.81)
|> angledLine(angle = segAng(rectangleSegmentA001), length = -segLen(rectangleSegmentA001))
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
@ -513,16 +513,16 @@ profile001 = startProfile(sketch001, at = [7.49, 9.96])
part001 = startSketchOn(XZ)
|> startProfile(at = [20, 0])
|> line(end = [7.13, 4 + 0])
|> angledLine(angle = 3deg + 0, length = 3.14 + 0 )
|> angledLine(angle = 3 + 0, length = 3.14 + 0 )
|> line(endAbsolute = [20.14 + 0, -0.14 + 0])
|> xLine(endAbsolute = 29 + 0)
|> yLine(length = -3.14 + 0, tag = $a)
|> xLine(length = 1.63)
|> angledLine(angle = 3deg + 0, lengthX = 3.14)
|> angledLine(angle = 30deg, lengthY = 3 + 0)
|> angledLine(angle = 22.14deg + 0, endAbsoluteX = 12)
|> angledLine(angle = 30deg, endAbsoluteY = 11.14)
|> angledLineThatIntersects(angle = 3.14deg, intersectTag = a, offset = 0)
|> angledLine(angle = 3 + 0, lengthX = 3.14)
|> angledLine(angle = 30, lengthY = 3 + 0)
|> angledLine(angle = 22.14 + 0, endAbsoluteX = 12)
|> angledLine(angle = 30, endAbsoluteY = 11.14)
|> angledLineThatIntersects(angle = 3.14, intersectTag = a, offset = 0)
|> tangentialArc(endAbsolute = [13.14 + 0, 13.14])
|> close()
|> extrude(length = 5 + 7)
@ -655,7 +655,7 @@ part001 = startSketchOn(XZ)
'flatExtrusionFace',
flatExtrusionFace,
`angledLineThatIntersects(angle=3.14,intersectTag=a,offset=0)extrude(length=5+7)`,
'angledLineThatIntersects(angle = 3.14deg, intersectTag = a, offset = 0)'
'angledLineThatIntersects(angle = 3.14, intersectTag = a, offset = 0)'
)
await checkCodeAtHoverPosition(
@ -707,19 +707,19 @@ part001 = startSketchOn(XZ)
'straightSegmentEdge',
straightSegmentEdge,
`angledLine(angle=30,endAbsoluteY=11.14)`,
'angledLine(angle = 30deg, endAbsoluteY = 11.14)'
'angledLine(angle = 30, endAbsoluteY = 11.14)'
)
await checkCodeAtHoverPosition(
'straightSegmentOppositeEdge',
straightSegmentOppositeEdge,
`angledLine(angle=30,endAbsoluteY=11.14)`,
'angledLine(angle = 30deg, endAbsoluteY = 11.14)'
'angledLine(angle = 30, endAbsoluteY = 11.14)'
)
await checkCodeAtHoverPosition(
'straightSegmentAdjacentEdge',
straightSegmentAdjacentEdge,
`angledLineThatIntersects(angle=3.14,intersectTag=a,offset=0)`,
'angledLineThatIntersects(angle = 3.14deg, intersectTag = a, offset = 0)'
'angledLineThatIntersects(angle = 3.14, intersectTag = a, offset = 0)'
)
await page.waitForTimeout(200)
@ -728,7 +728,7 @@ part001 = startSketchOn(XZ)
await u.codeLocator.fill(`@settings(defaultLengthUnit = in)
sketch001 = startSketchOn(XZ)
|> startProfile(at = [75.8, 317.2]) // [$startCapTag, $EndCapTag]
|> angledLine(angle = 0deg, length = 268.43, tag = $rectangleSegmentA001)
|> angledLine(angle = 0, length = 268.43, tag = $rectangleSegmentA001)
|> angledLine(angle = segAng(rectangleSegmentA001) - 90, length = 217.26, tag = $seg01)
|> angledLine(angle = segAng(rectangleSegmentA001), length = -segLen(rectangleSegmentA001), tag = $yo)
|> line(endAbsolute = [profileStartX(%), profileStartY(%)], tag = $seg02)

View File

@ -94,7 +94,6 @@
"build:wasm:dev": "./scripts/build-wasm-dev.sh",
"build:wasm:dev:windows": "powershell -ExecutionPolicy Bypass -File ./scripts/build-wasm-dev.ps1",
"pretest": "npm run remove-importmeta",
"test:rust": "(cd rust && just test && just lint)",
"simpleserver": "npm run pretest && http-server ./public --cors -p 3000",
"simpleserver:ci": "npm run pretest && http-server ./public --cors -p 3000 &",
"simpleserver:bg": "npm run pretest && http-server ./public --cors -p 3000 &",
@ -130,15 +129,14 @@
"tronb:package:prod": "npm run tronb:vite:prod && electron-builder --config electron-builder.yml --publish always",
"test-setup": "npm install && npm run build:wasm",
"test": "vitest --mode development",
"test:rust": "(cd rust && just test && just lint)",
"test:snapshots": "PLATFORM=web NODE_ENV=development playwright test --config=playwright.config.ts --grep=@snapshot --trace=on --shard=1/1",
"test:unit": "vitest run --mode development --exclude **/kclSamples.test.ts --exclude **/jest-component-unit-tests/*",
"test:unit": "vitest run --mode development --exclude **/jest-component-unit-tests/*",
"test:unit:components": "jest -c jest-component-unit-tests/jest.config.ts --rootDir jest-component-unit-tests/",
"test:unit:kcl-samples": "vitest run --mode development ./src/lang/kclSamples.test.ts",
"test:playwright:electron": "playwright test --config=playwright.electron.config.ts --grep-invert=@snapshot",
"test:playwright:electron:local": "npm run tronb:vite:dev && playwright test --config=playwright.electron.config.ts --grep-invert=@snapshot --grep-invert=\"$(curl --silent https://test-analysis-bot.hawk-dinosaur.ts.net/projects/KittyCAD/modeling-app/tests/disabled/regex)\"",
"test:playwright:electron:local-engine": "npm run tronb:vite:dev && playwright test --config=playwright.electron.config.ts --grep-invert='@snapshot|@skipLocalEngine' --grep-invert=\"$(curl --silent https://test-analysis-bot.hawk-dinosaur.ts.net/projects/KittyCAD/modeling-app/tests/disabled/regex)\"",
"test:unit:local": "npm run simpleserver:bg && npm run test:unit; kill-port 3000",
"test:unit:kcl-samples:local": "npm run simpleserver:bg && npm run test:unit:kcl-samples; kill-port 3000"
"test:unit:local": "npm run simpleserver:bg && npm run test:unit; kill-port 3000"
},
"browserslist": {
"production": [

View File

@ -19,7 +19,7 @@ fn rail8020(originStart, railHeight, railLength) {
|> xLine(length = 0.06 * railHeight, tag = $edge1)
|> yLine(length = 0.087 * railHeight, tag = $edge2)
|> xLine(length = -0.183 * railHeight, tag = $edge3)
|> angledLine(angle = 45deg, endAbsoluteY = (1 - 0.356) / 2 * railHeight + originStart[1], tag = $edge4)
|> angledLine(angle = 45, endAbsoluteY = (1 - 0.356) / 2 * railHeight + originStart[1], tag = $edge4)
|> xLine(length = 0.232 * railHeight, tag = $edge5)
|> angledLine(angle = -45, endAbsoluteY = 0.087 * railHeight + originStart[1], tag = $edge6)
|> xLine(length = -0.183 * railHeight, tag = $edge7)
@ -37,9 +37,9 @@ fn rail8020(originStart, railHeight, railLength) {
|> yLine(length = 0.06 * railHeight, tag = $edge9)
|> xLine(length = -0.087 * railHeight, tag = $edge10)
|> yLine(length = -0.183 * railHeight, tag = $edge11) // edge11
|> angledLine(angle = 135deg, endAbsoluteX = ((1 - 0.356) / 2 + 0.356) * railHeight + originStart[0], tag = $edge12) // edge12
|> angledLine(angle = 135, endAbsoluteX = ((1 - 0.356) / 2 + 0.356) * railHeight + originStart[0], tag = $edge12) // edge12
|> yLine(length = 0.232 * railHeight, tag = $edge13) // 13
|> angledLine(angle = 45deg, endAbsoluteX = (1 - 0.087) * railHeight + originStart[0], tag = $edge14) // 14
|> angledLine(angle = 45, endAbsoluteX = (1 - 0.087) * railHeight + originStart[0], tag = $edge14) // 14
|> yLine(length = -0.183 * railHeight, tag = $edge15) // 15
|> xLine(length = 0.087 * railHeight, tag = $edge16)
|> yLine(length = 0.06 * railHeight)
@ -55,9 +55,9 @@ fn rail8020(originStart, railHeight, railLength) {
|> xLine(length = -0.06 * railHeight, tag = $edge17)
|> yLine(length = -0.087 * railHeight, tag = $edge18)
|> xLine(length = 0.183 * railHeight, tag = $edge19)
|> angledLine(angle = 45deg, endAbsoluteY = ((1 - 0.356) / 2 + 0.356) * railHeight + originStart[1], tag = $edge20)
|> angledLine(angle = 45, endAbsoluteY = ((1 - 0.356) / 2 + 0.356) * railHeight + originStart[1], tag = $edge20)
|> xLine(length = -0.232 * railHeight, tag = $edge21)
|> angledLine(angle = 135deg, endAbsoluteY = (1 - 0.087) * railHeight + originStart[1], tag = $edge22)
|> angledLine(angle = 135, endAbsoluteY = (1 - 0.087) * railHeight + originStart[1], tag = $edge22)
|> xLine(length = 0.183 * railHeight, tag = $edge23)
|> yLine(length = 0.087 * railHeight, tag = $edge24)
|> xLine(length = -0.06 * railHeight)
@ -73,9 +73,9 @@ fn rail8020(originStart, railHeight, railLength) {
|> yLine(length = -0.06 * railHeight, tag = $edge25)
|> xLine(length = 0.087 * railHeight, tag = $edge26)
|> yLine(length = 0.183 * railHeight, tag = $edge27)
|> angledLine(angle = 135deg, endAbsoluteX = (1 - 0.356) / 2 * railHeight + originStart[0], tag = $edge28)
|> angledLine(angle = 135, endAbsoluteX = (1 - 0.356) / 2 * railHeight + originStart[0], tag = $edge28)
|> yLine(length = -0.232 * railHeight, tag = $edge29)
|> angledLine(angle = 45deg, endAbsoluteX = 0.087 * railHeight + originStart[0], tag = $edge30)
|> angledLine(angle = 45, endAbsoluteX = 0.087 * railHeight + originStart[0], tag = $edge30)
|> yLine(length = 0.183 * railHeight, tag = $edge31)
|> xLine(length = -0.087 * railHeight, tag = $edge32)
|> yLine(length = -0.06 * railHeight)

View File

@ -11,8 +11,8 @@ import * from "parameters.kcl"
// Bottom mounting face
bottomFaceSketch = startSketchOn(XY)
|> startProfile(at = [-fanSize / 2, -fanSize / 2])
|> angledLine(angle = 0deg, length = fanSize, tag = $rectangleSegmentA001)
|> angledLine(angle = segAng(rectangleSegmentA001) + 90deg, length = fanSize, tag = $rectangleSegmentB001)
|> angledLine(angle = 0, length = fanSize, tag = $rectangleSegmentA001)
|> angledLine(angle = segAng(rectangleSegmentA001) + 90, length = fanSize, tag = $rectangleSegmentB001)
|> angledLine(angle = segAng(rectangleSegmentA001), length = -segLen(rectangleSegmentA001), tag = $rectangleSegmentC001)
|> line(endAbsolute = [profileStartX(%), profileStartY(%)], tag = $rectangleSegmentD001)
|> close()
@ -50,12 +50,12 @@ bottomFaceSketch = startSketchOn(XY)
// Add large openings to the bottom face to allow airflow through the fan
airflowPattern = startSketchOn(bottomFaceSketch, face = END)
|> startProfile(at = [fanSize * 7 / 25, -fanSize * 9 / 25])
|> angledLine(angle = 140deg, length = fanSize * 12 / 25, tag = $seg01)
|> tangentialArc(radius = fanSize * 1 / 50, angle = 90deg)
|> angledLine(angle = -130deg, length = fanSize * 8 / 25)
|> tangentialArc(radius = fanSize * 1 / 50, angle = 90deg)
|> angledLine(angle = segAng(seg01) + 180deg, length = fanSize * 2 / 25)
|> tangentialArc(radius = fanSize * 8 / 25, angle = 40deg)
|> angledLine(angle = 140, length = fanSize * 12 / 25, tag = $seg01)
|> tangentialArc(radius = fanSize * 1 / 50, angle = 90)
|> angledLine(angle = -130, length = fanSize * 8 / 25)
|> tangentialArc(radius = fanSize * 1 / 50, angle = 90)
|> angledLine(angle = segAng(seg01) + 180, length = fanSize * 2 / 25)
|> tangentialArc(radius = fanSize * 8 / 25, angle = 40)
|> xLine(length = fanSize * 3 / 25)
|> tangentialArc(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close()
@ -75,13 +75,13 @@ bodyMiddle = startSketchOn(bottomFaceSketch, face = END)
housingMiddleLength / 2,
-housingMiddleLength / 2 - housingMiddleRadius
])
|> tangentialArc(radius = housingMiddleRadius, angle = 90deg)
|> tangentialArc(radius = housingMiddleRadius, angle = 90)
|> yLine(length = housingMiddleLength)
|> tangentialArc(radius = housingMiddleRadius, angle = 90deg)
|> tangentialArc(radius = housingMiddleRadius, angle = 90)
|> xLine(length = -housingMiddleLength)
|> tangentialArc(radius = housingMiddleRadius, angle = 90deg)
|> tangentialArc(radius = housingMiddleRadius, angle = 90)
|> yLine(length = -housingMiddleLength)
|> tangentialArc(radius = housingMiddleRadius, angle = 90deg)
|> tangentialArc(radius = housingMiddleRadius, angle = 90)
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> extrude(length = fanHeight - 4 - 4)
@ -93,8 +93,8 @@ bodyFanHole = startSketchOn(bodyMiddle, face = END)
// Top mounting face. Cut a hole in the face to accommodate the fan
topFaceSketch = startSketchOn(bodyMiddle, face = END)
topHoles = startProfile(topFaceSketch, at = [-fanSize / 2, -fanSize / 2])
|> angledLine(angle = 0deg, length = fanSize, tag = $rectangleSegmentA002)
|> angledLine(angle = segAng(rectangleSegmentA002) + 90deg, length = fanSize, tag = $rectangleSegmentB002)
|> angledLine(angle = 0, length = fanSize, tag = $rectangleSegmentA002)
|> angledLine(angle = segAng(rectangleSegmentA002) + 90, length = fanSize, tag = $rectangleSegmentB002)
|> angledLine(angle = segAng(rectangleSegmentA002), length = -segLen(rectangleSegmentA002), tag = $rectangleSegmentC002)
|> line(endAbsolute = [profileStartX(%), profileStartY(%)], tag = $rectangleSegmentD002)
|> close()

View File

@ -11,11 +11,11 @@ import * from "parameters.kcl"
fanCenter = startSketchOn(XZ)
|> startProfile(at = [-0.0001, fanHeight])
|> xLine(endAbsolute = -15 + 1.5)
|> tangentialArc(radius = 1.5, angle = 90deg)
|> tangentialArc(radius = 1.5, angle = 90)
|> yLine(endAbsolute = 4.5)
|> xLine(endAbsolute = -13)
|> yLine(endAbsolute = profileStartY(%) - 5)
|> tangentialArc(radius = 1, angle = -90deg)
|> tangentialArc(radius = 1, angle = -90)
|> xLine(endAbsolute = -1)
|> yLine(length = 2)
|> xLine(length = -0.15)
@ -39,32 +39,32 @@ fn fanBlade(offsetHeight, startAngle: number(deg)) {
15 * cos(startAngle),
15 * sin(startAngle)
])
|> arc(angleStart = startAngle, angleEnd = startAngle + 1deg, radius = 15)
|> arc(angleStart = startAngle, angleEnd = startAngle + 14, radius = 15)
|> arc(
endAbsolute = [
fanSize * 22 / 50 * cos(startAngle - 20deg),
fanSize * 22 / 50 * sin(startAngle - 20deg)
fanSize * 22 / 50 * cos(startAngle - 20),
fanSize * 22 / 50 * sin(startAngle - 20)
],
interiorAbsolute = [
fanSize * 11 / 50 * cos(startAngle + 3deg),
fanSize * 11 / 50 * sin(startAngle + 3deg)
fanSize * 11 / 50 * cos(startAngle + 3),
fanSize * 11 / 50 * sin(startAngle + 3)
],
)
|> arc(
endAbsolute = [
fanSize * 22 / 50 * cos(startAngle - 24deg),
fanSize * 22 / 50 * sin(startAngle - 24deg)
fanSize * 22 / 50 * cos(startAngle - 24),
fanSize * 22 / 50 * sin(startAngle - 24)
],
interiorAbsolute = [
fanSize * 22 / 50 * cos(startAngle - 22deg),
fanSize * 22 / 50 * sin(startAngle - 22deg)
fanSize * 22 / 50 * cos(startAngle - 22),
fanSize * 22 / 50 * sin(startAngle - 22)
],
)
|> arc(
endAbsolute = [profileStartX(%), profileStartY(%)],
interiorAbsolute = [
fanSize * 11 / 50 * cos(startAngle - 5deg),
fanSize * 11 / 50 * sin(startAngle - 5deg)
fanSize * 11 / 50 * cos(startAngle - 5),
fanSize * 11 / 50 * sin(startAngle - 5)
],
)
|> close()
@ -73,9 +73,9 @@ fn fanBlade(offsetHeight, startAngle: number(deg)) {
// Loft the fan blade cross sections into a single blade, then pattern them about the fan center
crossSections = [
fanBlade(offsetHeight = 4.5, startAngle = 50deg),
fanBlade(offsetHeight = (fanHeight - 2 - 4) / 2, startAngle = 30deg),
fanBlade(offsetHeight = fanHeight - 2, startAngle = 0deg)
fanBlade(offsetHeight = 4.5, startAngle = 50),
fanBlade(offsetHeight = (fanHeight - 2 - 4) / 2, startAngle = 30),
fanBlade(offsetHeight = fanHeight - 2, startAngle = 0)
]
loft(crossSections)
|> appearance(color = "#f3e2d8")
@ -83,6 +83,6 @@ loft(crossSections)
instances = 9,
axis = [0, 0, 1],
center = [0, 0, 0],
arcDegrees = 360deg,
arcDegrees = 360,
rotateDuplicates = true,
)

View File

@ -27,13 +27,13 @@ insideWall = extrude(insideWallSketch, length = overallThickness)
// Create the sketch of one of the balls
ballsSketch = startSketchOn(XY)
|> startProfile(at = [shaftDia / 2 + wallThickness, 0.001])
|> arc(angleStart = 180deg, angleEnd = 0deg, radius = sphereDia / 2)
|> arc(angleStart = 180, angleEnd = 0, radius = sphereDia / 2)
|> close()
// Revolve the ball to make a sphere and pattern around the inside wall
balls = revolve(ballsSketch, axis = X)
|> patternCircular3d(
arcDegrees = 360deg,
arcDegrees = 360,
axis = [0, 0, 1],
center = [0, 0, 0],
instances = nBalls,
@ -44,9 +44,9 @@ balls = revolve(ballsSketch, axis = X)
chainSketch = startSketchOn(XY)
|> startProfile(at = [
shaftDia / 2 + wallThickness + sphereDia / 2 - (chainWidth / 2),
0.125 * sin(60deg)
0.125 * sin(60)
])
|> arc(angleStart = 120deg, angleEnd = 60deg, radius = sphereDia / 2)
|> arc(angleStart = 120, angleEnd = 60, radius = sphereDia / 2)
|> line(end = [0, chainThickness])
|> line(end = [-chainWidth, 0])
|> close()
@ -54,7 +54,7 @@ chainSketch = startSketchOn(XY)
// Revolve the chain sketch
chainHead = revolve(chainSketch, axis = X)
|> patternCircular3d(
arcDegrees = 360deg,
arcDegrees = 360,
axis = [0, 0, 1],
center = [0, 0, 0],
instances = nBalls,
@ -72,9 +72,9 @@ linkSketch = startSketchOn(XZ)
)
// Revolve the link sketch
linkRevolve = revolve(linkSketch, axis = Y, angle = 360deg / nBalls)
linkRevolve = revolve(linkSketch, axis = Y, angle = 360 / nBalls)
|> patternCircular3d(
arcDegrees = 360deg,
arcDegrees = 360,
axis = [0, 0, 1],
center = [0, 0, 0],
instances = nBalls,

View File

@ -86,11 +86,11 @@ export fn seatSlats(@plane, length) {
fn backSlatsSketch(@plane) {
sketch004 = startSketchOn(plane)
|> startProfile(at = [22, 38.5])
|> angledLine(angle = 173deg, length = 2)
|> angledLine(angle = 173, length = 2)
|> line(end = [-1.74, 2.03])
|> angledLine(angle = 82deg, length = 6.6)
|> angledLine(angle = 82, length = 6.6)
|> line(end = [2.23, 1.42])
|> angledLine(angle = -7deg, length = 2)
|> angledLine(angle = -7, length = 2)
|> line(endAbsolute = profileStart(%))
|> close()
|> patternLinear2d(instances = 2, distance = 11, axis = [-0.137, -1])
@ -107,7 +107,7 @@ fn armRestPath(@plane) {
sketch005 = startSketchOn(plane)
|> startProfile(at = [20, 33])
|> xLine(length = -20)
|> arc(angleStart = 90deg, angleEnd = 180deg, radius = 10)
|> arc(angleStart = 90, angleEnd = 180, radius = 10)
return sketch005
}

View File

@ -10,13 +10,13 @@ boltSize = 4.5
// Revolve the profile of a compression plate designed to fit a bone
plateRevolve = startSketchOn(YZ)
|> startProfile(at = [22.9, 0])
|> arc(angleStart = 180deg, angleEnd = 176deg, radius = 120)
|> arc(angleStart = -60deg, angleEnd = 54deg, radius = 5)
|> arc(angleStart = 180deg, angleEnd = 176deg, radius = 120)
|> arc(angleStart = -60deg, angleEnd = 54deg, radius = 5)
|> arc(angleStart = 180deg, angleEnd = 176deg, radius = 120)
|> arc(angleStart = -60deg, angleEnd = 54deg, radius = 5)
|> arc(angleStart = 180deg, angleEnd = 174deg, radius = 170)
|> arc(angleStart = 180, angleEnd = 176, radius = 120)
|> arc(angleStart = -60, angleEnd = 54, radius = 5)
|> arc(angleStart = 180, angleEnd = 176, radius = 120)
|> arc(angleStart = -60, angleEnd = 54, radius = 5)
|> arc(angleStart = 180, angleEnd = 176, radius = 120)
|> arc(angleStart = -60, angleEnd = 54, radius = 5)
|> arc(angleStart = 180, angleEnd = 174, radius = 170)
|> tangentialArc(endAbsolute = [41.8, 91.88])
|> tangentialArc(endAbsolute = [56.92, 117.08], tag = $seg01)
|> angledLine(angle = tangentToEnd(seg01), length = 23.16)
@ -27,7 +27,7 @@ plateRevolve = startSketchOn(YZ)
|> angledLine(angle = tangentToEnd(seg03), length = 49.06)
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close()
|> revolve(axis = Y, angle = 65deg, symmetric = true)
|> revolve(axis = Y, angle = 65, symmetric = true)
// Create a hole sketch with the size and location of each bolt hole
holeSketch = startSketchOn(XZ)

View File

@ -17,44 +17,44 @@ brakeCaliperSketch = startSketchOn(XY)
0,
rotorTotalThickness + caliperTolerance - caliperInnerEdgeRadius
])
|> tangentialArc(angle = 90deg, radius = caliperInnerEdgeRadius)
|> tangentialArc(angle = 90, radius = caliperInnerEdgeRadius)
|> line(end = [
-caliperPadLength + 2 * caliperInnerEdgeRadius,
0
])
|> tangentialArc(angle = -90deg, radius = caliperInnerEdgeRadius)
|> tangentialArc(angle = -90, radius = caliperInnerEdgeRadius)
|> line(end = [
0,
caliperThickness - (caliperInnerEdgeRadius * 2)
])
|> tangentialArc(angle = -90deg, radius = caliperInnerEdgeRadius)
|> tangentialArc(angle = -90, radius = caliperInnerEdgeRadius)
|> line(end = [
caliperPadLength + caliperThickness - caliperOuterEdgeRadius - caliperInnerEdgeRadius,
0
])
|> tangentialArc(angle = -90deg, radius = caliperOuterEdgeRadius)
|> tangentialArc(angle = -90, radius = caliperOuterEdgeRadius)
|> line(end = [
0,
-2 * caliperTolerance - (2 * caliperThickness) - rotorTotalThickness + 2 * caliperOuterEdgeRadius
])
|> tangentialArc(angle = -90deg, radius = caliperOuterEdgeRadius)
|> tangentialArc(angle = -90, radius = caliperOuterEdgeRadius)
|> line(end = [
-caliperPadLength - caliperThickness + caliperOuterEdgeRadius + caliperInnerEdgeRadius,
0
])
|> tangentialArc(angle = -90deg, radius = caliperInnerEdgeRadius)
|> tangentialArc(angle = -90, radius = caliperInnerEdgeRadius)
|> line(end = [
0,
caliperThickness - (2 * caliperInnerEdgeRadius)
])
|> tangentialArc(angle = -90deg, radius = caliperInnerEdgeRadius)
|> tangentialArc(angle = -90, radius = caliperInnerEdgeRadius)
|> line(end = [
caliperPadLength - (2 * caliperInnerEdgeRadius),
0
])
|> tangentialArc(angle = 90deg, radius = caliperInnerEdgeRadius)
|> tangentialArc(angle = 90, radius = caliperInnerEdgeRadius)
|> close()
// Revolve the brake caliper sketch
revolve(brakeCaliperSketch, axis = Y, angle = -70deg)
revolve(brakeCaliperSketch, axis = Y, angle = -70)
|> appearance(color = "#c82d2d", metalness = 90, roughness = 90)

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