Compare commits
61 Commits
kurt-web-a
...
andrewvarg
Author | SHA1 | Date | |
---|---|---|---|
ba9d060338 | |||
1fb3e373f2 | |||
29d16d1df6 | |||
20d6f9e253 | |||
25b9a34640 | |||
b2152a5684 | |||
832bf77c92 | |||
9b0f74e3a0 | |||
6d0d89e4a8 | |||
acb43fc82c | |||
7486d25cf1 | |||
1a4a030671 | |||
3049d939e1 | |||
ad9822e8ac | |||
aae34cf1e5 | |||
d6278cf075 | |||
4159cc0047 | |||
c9dde2d96c | |||
ad7174915b | |||
a7b634e7b7 | |||
1b65614c48 | |||
3936017f10 | |||
5054672190 | |||
2b0ced179a | |||
c2f6ce065d | |||
b3bdc35da2 | |||
896a4c6072 | |||
68ba613d0e | |||
8fe4f67a29 | |||
c6b1d11700 | |||
82b7924362 | |||
2ef84382a6 | |||
af8d1330fd | |||
939c2c77b0 | |||
31ec0184a1 | |||
62c4546658 | |||
383b38c2d2 | |||
e0025f7fad | |||
2a13888c54 | |||
1443f3ab39 | |||
bf87c23ea8 | |||
5d23b0e487 | |||
df6c81b0b4 | |||
5f1f579d4b | |||
9a549ff379 | |||
851ea28bd3 | |||
ff15c7b9db | |||
f304577d5d | |||
b03b0d3b53 | |||
dd4d0f6d98 | |||
1cd742df5d | |||
6460ed8ea8 | |||
5c51b27f29 | |||
77690b4419 | |||
6996670020 | |||
1fd4e93091 | |||
a1ac029333 | |||
29cf16d744 | |||
9b3afccf53 | |||
231ca0fa35 | |||
4608c02442 |
3
.github/CODEOWNERS
vendored
Normal file
3
.github/CODEOWNERS
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
* @KittyCAD/frontend
|
||||
/src/ @KittyCAD/frontend
|
||||
/rust/ @KittyCAD/kcl
|
38
.github/ISSUE_TEMPLATE/release.md
vendored
Normal file
38
.github/ISSUE_TEMPLATE/release.md
vendored
Normal file
@ -0,0 +1,38 @@
|
||||
---
|
||||
name: Release
|
||||
about: Create a new release for the Zoo Design Studio
|
||||
title: "Cut release v1.?.?"
|
||||
labels: [release]
|
||||
---
|
||||
|
||||
> Instructions: https://github.com/KittyCAD/modeling-app/blob/main/CONTRIBUTING.md#shipping-releases
|
||||
|
||||
---
|
||||
|
||||
# Manual Checklist
|
||||
|
||||
Release builds URL: ???
|
||||
|
||||
## Windows via ???
|
||||
|
||||
* [ ] Download the release build for this platform
|
||||
* [ ] Confirm the application opens (dismiss the updater)
|
||||
* [ ] Create a project with a basic Text-to-CAD prompt
|
||||
* [ ] Confirm the result is viewable in an engine stream
|
||||
* [ ] Open the application again and confirm the updater can downgrade
|
||||
|
||||
## macOS via ???
|
||||
|
||||
* [ ] Download the release build for this platform
|
||||
* [ ] Confirm the application opens (dismiss the updater)
|
||||
* [ ] Create a project with a basic Text-to-CAD prompt
|
||||
* [ ] Confirm the result is viewable in an engine stream
|
||||
* [ ] Open the application again and confirm the updater can downgrade
|
||||
|
||||
## Linux via ???
|
||||
|
||||
* [ ] Download the release build for this platform
|
||||
* [ ] Confirm the application opens (dismiss the updater)
|
||||
* [ ] Create a project with a basic Text-to-CAD prompt
|
||||
* [ ] Confirm the result is viewable in an engine stream
|
||||
* [ ] Open the application again and confirm the updater can downgrade
|
71
.github/workflows/build-apps.yml
vendored
71
.github/workflows/build-apps.yml
vendored
@ -10,7 +10,7 @@ on:
|
||||
|
||||
env:
|
||||
IS_RELEASE: ${{ github.ref_type == 'tag' && startsWith(github.ref_name, 'v') }}
|
||||
IS_NIGHTLY: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
|
||||
IS_STAGING: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
@ -91,14 +91,14 @@ jobs:
|
||||
if: ${{ steps.wasm.outputs.should-build-wasm == 'true' }}
|
||||
run: "npm run build:wasm"
|
||||
|
||||
- name: Set nightly version, product name, release notes, and icons
|
||||
if: ${{ env.IS_NIGHTLY == 'true' }}
|
||||
- name: Set staging version, product name, release notes, and icons
|
||||
if: ${{ env.IS_STAGING == 'true' }}
|
||||
run: |
|
||||
COMMIT=$(git rev-parse --short HEAD)
|
||||
DATE=$(date +'%-y.%-m.%-d')
|
||||
export VERSION=$DATE-main.$COMMIT
|
||||
npm run files:set-version
|
||||
npm run files:flip-to-nightly
|
||||
npm run files:flip-to-staging
|
||||
|
||||
- name: Set release version
|
||||
if: ${{ env.IS_RELEASE == 'true' }}
|
||||
@ -130,13 +130,14 @@ jobs:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- os: macos-14
|
||||
platform: mac
|
||||
- os: windows-2022
|
||||
platform: win
|
||||
- os: namespace-profile-macos-6-cores
|
||||
platform: macos
|
||||
- os: namespace-profile-windows-4-cores
|
||||
platform: windows
|
||||
- os: ubuntu-22.04
|
||||
platform: linux
|
||||
runs-on: ${{ matrix.os }}
|
||||
name: build-apps (${{ matrix.platform }})
|
||||
env:
|
||||
VERSION_NO_V: ${{ needs.prepare-files.outputs.version }}
|
||||
steps:
|
||||
@ -166,14 +167,14 @@ jobs:
|
||||
- run: npm install
|
||||
|
||||
- name: Prepare certificate and variables (Windows only)
|
||||
if: ${{ (env.IS_RELEASE == 'true' || env.IS_NIGHTLY == 'true') && matrix.os == 'windows-2022' }}
|
||||
if: ${{ (env.IS_RELEASE == 'true' || env.IS_STAGING == 'true') && matrix.platform == 'windows' }}
|
||||
run: |
|
||||
echo "${{secrets.SM_CLIENT_CERT_FILE_B64 }}" | base64 --decode > /d/Certificate_pkcs12.p12
|
||||
cat /d/Certificate_pkcs12.p12
|
||||
echo "${{secrets.SM_CLIENT_CERT_FILE_B64 }}" | base64 --decode > /c/Certificate_pkcs12.p12
|
||||
cat /c/Certificate_pkcs12.p12
|
||||
echo "::set-output name=version::${GITHUB_REF#refs/tags/v}"
|
||||
echo "SM_HOST=${{ secrets.SM_HOST }}" >> "$GITHUB_ENV"
|
||||
echo "SM_API_KEY=${{ secrets.SM_API_KEY }}" >> "$GITHUB_ENV"
|
||||
echo "SM_CLIENT_CERT_FILE=D:\\Certificate_pkcs12.p12" >> "$GITHUB_ENV"
|
||||
echo "SM_CLIENT_CERT_FILE=C:\\Certificate_pkcs12.p12" >> "$GITHUB_ENV"
|
||||
echo "SM_CLIENT_CERT_PASSWORD=${{ secrets.SM_CLIENT_CERT_PASSWORD }}" >> "$GITHUB_ENV"
|
||||
echo "C:\Program Files (x86)\Windows Kits\10\App Certification Kit" >> $GITHUB_PATH
|
||||
echo "C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.8 Tools" >> $GITHUB_PATH
|
||||
@ -181,7 +182,7 @@ jobs:
|
||||
shell: bash
|
||||
|
||||
- name: Setup certicate with SSM KSP (Windows only)
|
||||
if: ${{ (env.IS_RELEASE == 'true' || env.IS_NIGHTLY == 'true') && matrix.os == 'windows-2022' }}
|
||||
if: ${{ (env.IS_RELEASE == 'true' || env.IS_STAGING == 'true') && matrix.platform == 'windows' }}
|
||||
run: |
|
||||
curl -X GET https://one.digicert.com/signingmanager/api-ui/v1/releases/smtools-windows-x64.msi/download -H "x-api-key:%SM_API_KEY%" -o smtools-windows-x64.msi
|
||||
msiexec /i smtools-windows-x64.msi /quiet /qn
|
||||
@ -191,7 +192,7 @@ jobs:
|
||||
smksp_cert_sync.exe
|
||||
smctl windows certsync
|
||||
# This last line `smctl windows certsync` was added after windows codesign failures started happening
|
||||
# with nightly-v25.4.10. It looks like `smksp_cert_sync.exe` used to do the sync to the local cert store,
|
||||
# with staging-v25.4.10. It looks like `smksp_cert_sync.exe` used to do the sync to the local cert store,
|
||||
# but stopped doing it overnight. This extra call that I randomly got from this azure-related doc page
|
||||
# https://docs.digicert.com/en/digicert-keylocker/code-signing/sign-with-third-party-signing-tools/windows-applications/sign-azure-apps-with-signtool-using-ksp-library.html#sync-certificates--windows-only--618365
|
||||
# seems to be doing that extra sync that we need for scripts/sign-win.js to work.
|
||||
@ -199,13 +200,13 @@ jobs:
|
||||
shell: cmd
|
||||
|
||||
- name: Build the app (debug)
|
||||
if: ${{ env.IS_RELEASE == 'false' && env.IS_NIGHTLY == 'false' }}
|
||||
if: ${{ env.IS_RELEASE == 'false' && env.IS_STAGING == 'false' }}
|
||||
# electron-builder doesn't have a concept of release vs debug,
|
||||
# this is just not doing any codesign or release yml generation, and points to dev infra
|
||||
run: npm run tronb:package:dev
|
||||
|
||||
- name: Build the app (release)
|
||||
if: ${{ env.IS_RELEASE == 'true' || env.IS_NIGHTLY == 'true' }}
|
||||
if: ${{ env.IS_RELEASE == 'true' || env.IS_STAGING == 'true' }}
|
||||
env:
|
||||
APPLE_ID: ${{ secrets.APPLE_ID }}
|
||||
APPLE_PASSWORD: ${{ secrets.APPLE_PASSWORD }}
|
||||
@ -215,7 +216,7 @@ jobs:
|
||||
CSC_KEY_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }}
|
||||
CSC_KEYCHAIN: ${{ secrets.APPLE_SIGNING_IDENTITY }}
|
||||
WINDOWS_CERTIFICATE_THUMBPRINT: ${{ secrets.WINDOWS_CERTIFICATE_THUMBPRINT }}
|
||||
run: npm run tronb:package:prod
|
||||
run: npm run tronb:package:${{ env.IS_STAGING == 'true' && 'dev' || 'prod' }}
|
||||
|
||||
- name: List artifacts in out/
|
||||
run: ls -R out
|
||||
@ -239,20 +240,20 @@ jobs:
|
||||
out/*-x86_64-linux.*
|
||||
|
||||
- uses: actions/upload-artifact@v4
|
||||
if: ${{ env.IS_RELEASE == 'true' || env.IS_NIGHTLY == 'true' }}
|
||||
if: ${{ env.IS_RELEASE == 'true' || env.IS_STAGING == 'true' }}
|
||||
with:
|
||||
name: out-yml-${{ matrix.platform }}
|
||||
path: |
|
||||
out/latest*.yml
|
||||
|
||||
# TODO: add the 'Build for Mac TestFlight (nightly)' stage back
|
||||
# TODO: add the 'Build for Mac TestFlight' stage back
|
||||
|
||||
|
||||
upload-apps-release:
|
||||
runs-on: ubuntu-22.04
|
||||
permissions:
|
||||
contents: write
|
||||
# Equivalent to IS_RELEASE || IS_NIGHTLY (but we can't access those env vars here)
|
||||
# Equivalent to IS_RELEASE || IS_STAGING (but we can't access those env vars here)
|
||||
if: ${{ (github.ref_type == 'tag' && startsWith(github.ref_name, 'v')) || (github.event_name == 'push' && github.ref == 'refs/heads/main') }}
|
||||
env:
|
||||
VERSION_NO_V: ${{ needs.prepare-files.outputs.version }}
|
||||
@ -263,32 +264,32 @@ jobs:
|
||||
|
||||
- uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: out-arm64-win
|
||||
name: out-arm64-windows
|
||||
path: out
|
||||
|
||||
- uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: out-x64-win
|
||||
name: out-x64-windows
|
||||
path: out
|
||||
|
||||
- uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: out-yml-win
|
||||
name: out-yml-windows
|
||||
path: out
|
||||
|
||||
- uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: out-arm64-mac
|
||||
name: out-arm64-macos
|
||||
path: out
|
||||
|
||||
- uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: out-x64-mac
|
||||
name: out-x64-macos
|
||||
path: out
|
||||
|
||||
- uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: out-yml-mac
|
||||
name: out-yml-macos
|
||||
path: out
|
||||
|
||||
- uses: actions/download-artifact@v4
|
||||
@ -310,8 +311,8 @@ jobs:
|
||||
env:
|
||||
NOTES: ${{ needs.prepare-files.outputs.notes }}
|
||||
PUB_DATE: ${{ github.event.repository.updated_at }}
|
||||
WEBSITE_DIR: ${{ env.IS_NIGHTLY == 'true' && 'dl.zoo.dev/releases/modeling-app/nightly' || 'dl.zoo.dev/releases/modeling-app' }}
|
||||
URL_CODED_NAME: ${{ env.IS_NIGHTLY == 'true' && 'Zoo%20Design%20Studio%20%28Nightly%29' || 'Zoo%20Design%20Studio' }}
|
||||
WEBSITE_DIR: ${{ env.IS_STAGING == 'true' && 'dl.zoo.dev/releases/modeling-app/staging' || 'dl.zoo.dev/releases/modeling-app' }}
|
||||
URL_CODED_NAME: ${{ env.IS_STAGING == 'true' && 'Zoo%20Design%20Studio%20%28Staging%29' || 'Zoo%20Design%20Studio' }}
|
||||
run: |
|
||||
RELEASE_DIR=https://${WEBSITE_DIR}
|
||||
jq --null-input \
|
||||
@ -360,26 +361,26 @@ jobs:
|
||||
run: "ls -R out"
|
||||
|
||||
- name: Authenticate to Google Cloud
|
||||
if: ${{ env.IS_NIGHTLY == 'true' }}
|
||||
if: ${{ env.IS_STAGING == 'true' }}
|
||||
uses: 'google-github-actions/auth@v2.1.8'
|
||||
with:
|
||||
credentials_json: '${{ secrets.GOOGLE_CLOUD_DL_SA }}'
|
||||
|
||||
- name: Set up Google Cloud SDK
|
||||
if: ${{ env.IS_NIGHTLY == 'true' }}
|
||||
if: ${{ env.IS_STAGING == 'true' }}
|
||||
uses: google-github-actions/setup-gcloud@v2.1.4
|
||||
with:
|
||||
project_id: ${{ env.GOOGLE_CLOUD_PROJECT_ID }}
|
||||
|
||||
- name: Upload nightly files to public bucket
|
||||
if: ${{ env.IS_NIGHTLY == 'true' }}
|
||||
- name: Upload staging files to public bucket
|
||||
if: ${{ env.IS_STAGING == 'true' }}
|
||||
uses: google-github-actions/upload-cloud-storage@v2.2.2
|
||||
with:
|
||||
path: out
|
||||
glob: '*'
|
||||
parent: false
|
||||
destination: 'dl.kittycad.io/releases/modeling-app/nightly'
|
||||
destination: 'dl.kittycad.io/releases/modeling-app/staging'
|
||||
|
||||
- name: Invalidate bucket cache on latest*.yml and last_download.json files
|
||||
if: ${{ env.IS_NIGHTLY == 'true' }}
|
||||
run: npm run files:invalidate-bucket:nightly
|
||||
if: ${{ env.IS_STAGING == 'true' }}
|
||||
run: npm run files:invalidate-bucket:staging
|
||||
|
35
.github/workflows/e2e-tests.yml
vendored
35
.github/workflows/e2e-tests.yml
vendored
@ -95,7 +95,8 @@ jobs:
|
||||
shell: bash
|
||||
run: npm run build:wasm
|
||||
|
||||
- uses: actions/upload-artifact@v4
|
||||
- name: Upload compiled wasm artifacts
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: prepared-wasm
|
||||
path: |
|
||||
@ -176,17 +177,18 @@ jobs:
|
||||
CI_SUITE: e2e:snapshots
|
||||
TARGET: web
|
||||
|
||||
- uses: actions/upload-artifact@v4
|
||||
if: ${{ !cancelled() && (success() || failure()) }}
|
||||
- name: Upload playwright report
|
||||
uses: actions/upload-artifact@v4
|
||||
if: ${{ !cancelled() }}
|
||||
with:
|
||||
name: playwright-report-ubuntu-snapshot-${{ github.sha }}
|
||||
name: playwright-report-snapshot-${{ github.sha }}
|
||||
path: playwright-report/
|
||||
include-hidden-files: true
|
||||
retention-days: 30
|
||||
overwrite: true
|
||||
|
||||
- name: Check diff
|
||||
if: ${{ github.ref != 'refs/heads/main' }}
|
||||
if: ${{ always() && github.ref != 'refs/heads/main' }}
|
||||
shell: bash
|
||||
id: git-check
|
||||
run: |
|
||||
@ -197,7 +199,7 @@ jobs:
|
||||
fi
|
||||
|
||||
- name: Commit changes
|
||||
if: ${{ steps.git-check.outputs.modified == 'true' }}
|
||||
if: ${{ always() && steps.git-check.outputs.modified == 'true' }}
|
||||
shell: bash
|
||||
run: |
|
||||
git add e2e/playwright/snapshot-tests.spec.ts-snapshots e2e/playwright/snapshots
|
||||
@ -220,7 +222,7 @@ jobs:
|
||||
include:
|
||||
- os: "runs-on=${{ github.run_id }}/family=i7ie.2xlarge/image=ubuntu22-full-x64"
|
||||
- os: namespace-profile-macos-8-cores
|
||||
- os: windows-latest-8-cores
|
||||
- os: namespace-profile-windows-8-cores
|
||||
runs-on: ${{ matrix.os }}
|
||||
name: e2e:web (${{ contains(matrix.os, 'ubuntu') && 'ubuntu' || (contains(matrix.os, 'windows') && 'windows' || 'macos') }})
|
||||
env:
|
||||
@ -290,9 +292,11 @@ jobs:
|
||||
CI_SUITE: e2e:web
|
||||
TARGET: web
|
||||
|
||||
- uses: actions/upload-artifact@v4
|
||||
- name: Upload playwright report
|
||||
uses: actions/upload-artifact@v4
|
||||
if: ${{ !cancelled() && (success() || failure()) }}
|
||||
with:
|
||||
name: playwright-report-web-${{ env.OS_NAME }}-${{ matrix.shardIndex }}-${{ github.sha }}
|
||||
path: playwright-report/
|
||||
include-hidden-files: true
|
||||
retention-days: 30
|
||||
@ -304,7 +308,6 @@ jobs:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
# TODO: enable namespace-profile-windows-latest once available
|
||||
include:
|
||||
- os: "runs-on=${{ github.run_id }}/family=i7ie.2xlarge/image=ubuntu22-full-x64"
|
||||
shardIndex: 1
|
||||
@ -336,10 +339,10 @@ jobs:
|
||||
- os: namespace-profile-macos-8-cores
|
||||
shardIndex: 2
|
||||
shardTotal: 2
|
||||
- os: windows-latest-8-cores
|
||||
- os: namespace-profile-windows-8-cores
|
||||
shardIndex: 1
|
||||
shardTotal: 2
|
||||
- os: windows-latest-8-cores
|
||||
- os: namespace-profile-windows-8-cores
|
||||
shardIndex: 2
|
||||
shardTotal: 2
|
||||
runs-on: ${{ matrix.os }}
|
||||
@ -415,19 +418,21 @@ jobs:
|
||||
CI_SUITE: e2e:desktop
|
||||
TARGET: desktop
|
||||
|
||||
- uses: actions/upload-artifact@v4
|
||||
- name: Upload test report
|
||||
uses: actions/upload-artifact@v4
|
||||
if: always()
|
||||
with:
|
||||
name: test-results-${{ env.OS_NAME }}-${{ matrix.shardIndex }}-${{ github.sha }}
|
||||
name: test-results-desktop-${{ env.OS_NAME }}-${{ matrix.shardIndex }}-${{ github.sha }}
|
||||
path: test-results/
|
||||
include-hidden-files: true
|
||||
retention-days: 30
|
||||
overwrite: true
|
||||
|
||||
- uses: actions/upload-artifact@v4
|
||||
- name: Upload playwright report
|
||||
uses: actions/upload-artifact@v4
|
||||
if: always()
|
||||
with:
|
||||
name: playwright-report-${{ env.OS_NAME }}-${{ matrix.shardIndex }}-${{ github.sha }}
|
||||
name: playwright-report-desktop-${{ env.OS_NAME }}-${{ matrix.shardIndex }}-${{ github.sha }}
|
||||
path: playwright-report/
|
||||
include-hidden-files: true
|
||||
retention-days: 30
|
||||
|
12
.github/workflows/publish-apps-release.yml
vendored
12
.github/workflows/publish-apps-release.yml
vendored
@ -31,42 +31,42 @@ jobs:
|
||||
|
||||
- uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: out-arm64-win
|
||||
name: out-arm64-windows
|
||||
path: out
|
||||
run-id: ${{ steps.tag_workflow_id.outputs.id }}
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: out-x64-win
|
||||
name: out-x64-windows
|
||||
path: out
|
||||
run-id: ${{ steps.tag_workflow_id.outputs.id }}
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: out-yml-win
|
||||
name: out-yml-windows
|
||||
path: out
|
||||
run-id: ${{ steps.tag_workflow_id.outputs.id }}
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: out-arm64-mac
|
||||
name: out-arm64-macos
|
||||
path: out
|
||||
run-id: ${{ steps.tag_workflow_id.outputs.id }}
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: out-x64-mac
|
||||
name: out-x64-macos
|
||||
path: out
|
||||
run-id: ${{ steps.tag_workflow_id.outputs.id }}
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: out-yml-mac
|
||||
name: out-yml-macos
|
||||
path: out
|
||||
run-id: ${{ steps.tag_workflow_id.outputs.id }}
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
@ -251,7 +251,8 @@ Before you submit a contribution PR to this repo, please ensure that:
|
||||
|
||||
#### 1. Create a 'Cut release $VERSION' issue
|
||||
|
||||
It will be used to document changelog discussions and release testing.
|
||||
Use the **Release** issue template.
|
||||
This will be used to facilitate changelog discussions and release testing.
|
||||
|
||||
https://github.com/KittyCAD/modeling-app/issues/new
|
||||
|
||||
@ -270,27 +271,9 @@ The workflow should be listed right away [in this list](https://github.com/Kitty
|
||||
|
||||
#### 3. Manually test artifacts
|
||||
|
||||
##### Release builds
|
||||
|
||||
The release builds can be found under the `out-{arch}-{platform}` zip files, at the very bottom of the `build-apps` summary page for the workflow (triggered by the tag in step 2).
|
||||
|
||||
Manually test against [this list](https://github.com/KittyCAD/modeling-app/issues/3588) across Windows, MacOS, Linux and posting results as comments in the issue.
|
||||
|
||||
A prompt should show up asking for a downgrade to the last release version. Running through that at the end of testing
|
||||
and making sure the current release candidate has the ability to be updated to what electron-updater points to is critical,
|
||||
but what is actually being downloaded and installed isn't.
|
||||
If the prompt doesn't show up, start the app in command line to grab the electron-updater logs. This is likely an issue with the current build that needs addressing.
|
||||
|
||||
```
|
||||
# Windows (PowerShell)
|
||||
& 'C:\Program Files\Zoo Design Studio\Zoo Design Studio.exe'
|
||||
|
||||
# macOS
|
||||
/Applications/Zoo\ Modeling\ App.app/Contents/MacOS/Zoo\ Modeling\ App
|
||||
|
||||
# Linux
|
||||
./Zoo Design Studio-{version}-{arch}-linux.AppImage
|
||||
```
|
||||
Assign someone to each section of the manual checklist generated by the issue template.
|
||||
|
||||
#### 4. Bump the KCL version
|
||||
|
||||
|
Before Width: | Height: | Size: 119 KiB After Width: | Height: | Size: 119 KiB |
Before Width: | Height: | Size: 259 KiB After Width: | Height: | Size: 259 KiB |
@ -46,3 +46,7 @@ KCL has no support for area, volume, or other higher dimension units. When inter
|
||||
## Explicit conversions
|
||||
|
||||
You might sometimes need to convert from one unit to another for some calculation. You can do this implicitly when calling a function (see above), but if you can't or don't want to, then you can use the explicit conversion functions in the [`std::units`](/docs/kcl-std/modules/std-units) module.
|
||||
|
||||
KCL cannot know about changes to units caused by arithmetic. For example, you may intend for `10in * 25.4` to be the value `254mm` (i.e., `10in` in mm), however, the result of that computation in KCL is `254in`. It is always better to rely on automatic conversion or to use the explicit conversion functions, where possible.
|
||||
|
||||
Converting between degrees and radians using π ([`PI`](/docs/kcl-std/consts/std-math-PI) in KCL) is especially prone to this error and so the `PI` constant always requires specifying units of any computation it is used with. E.g., `radius = (circumference / (2 * PI)): number(mm)`.
|
||||
|
@ -4,8 +4,6 @@ excerpt: "Project specific settings for the app. These live in `project.toml` in
|
||||
layout: manual
|
||||
---
|
||||
|
||||
# Project Settings
|
||||
|
||||
Project specific settings for the app. These live in `project.toml` in the base of the project directory. Updating the settings for the project in the app will update this file automatically. Do not edit this file manually, as it may be overwritten by the app. Manual edits can cause corruption of the settings file.
|
||||
|
||||
## Project Configuration Structure
|
||||
@ -184,4 +182,4 @@ color = 240.0
|
||||
# Use inches as the default measurement unit
|
||||
base_unit = "in"
|
||||
|
||||
```
|
||||
```
|
||||
|
@ -4,8 +4,6 @@ excerpt: "User specific settings for the app. These live in `user.toml` in the a
|
||||
layout: manual
|
||||
---
|
||||
|
||||
# User Settings
|
||||
|
||||
User specific settings for the app. These live in `user.toml` in the app's configuration directory. Updating the settings in the app will update this file automatically. Do not edit this file manually, as it may be overwritten by the app. Manual edits can cause corruption of the settings file.
|
||||
|
||||
## User Configuration Structure
|
||||
@ -234,4 +232,4 @@ base_unit = "mm"
|
||||
# Disable text wrapping in the editor
|
||||
text_wrapping = false
|
||||
|
||||
```
|
||||
```
|
||||
|
@ -44,7 +44,7 @@ detail on importing geometry.
|
||||
|
||||
Tags are used to give a name (tag) to a specific path.
|
||||
|
||||
### `TagDeclarator`
|
||||
### Tag declarations - `TagDecl`
|
||||
|
||||
The syntax for declaring a tag is `$myTag` you would use it in the following
|
||||
way:
|
||||
@ -67,24 +67,28 @@ startSketchOn(XZ)
|
||||
|> close()
|
||||
```
|
||||
|
||||
### `TagIdentifier`
|
||||
When a function requires declaring a new tag (using the `$` syntax), the argument has type [`TagDecl`](/docs/kcl-std/types/std-types-TagDecl).
|
||||
|
||||
As per the example above you can use the tag identifier to get a reference to the
|
||||
tagged object. The syntax for this is `myTag`.
|
||||
### Tag identifiers
|
||||
|
||||
In the example above we use the tag identifier to get the angle of the segment
|
||||
`segAng(rectangleSegmentA001)`.
|
||||
A tag created using a tag declarator can be used by writing its name without the `$`, e.g., `myTag`.
|
||||
Where necessary to disambiguate from tag declarations, we call these tag identifiers.
|
||||
|
||||
### `Start`
|
||||
In the example above we use the tag identifier `rectangleSegmentA001` to get the angle of the segment
|
||||
using `segAng(rectangleSegmentA001)`.
|
||||
|
||||
There is a special tag, `START` (with type `Start`, although under the cover, it's a string)
|
||||
for identifying the face of a solid which was the start of an extrusion (i.e., the surface which
|
||||
is extruded).
|
||||
Tags can identify either an edge or face of a solid, or a line or other edge of a sketch. Functions
|
||||
which take a tag identifier as an argument will use either [`TaggedEdge`](/docs/kcl-std/types/std-types-TaggedEdge) (for the edge of a
|
||||
solid or sketch) or [`TaggedFace`](/docs/kcl-std/types/std-types-TaggedFace).
|
||||
|
||||
### `End`
|
||||
If a line in a sketch is tagged and then the sketch is extruded, the tag is a `TaggedEdge` before
|
||||
extrusion and a `TaggedFace` after extrusion.
|
||||
|
||||
#### `START` and `END`
|
||||
|
||||
[`START`](/docs/kcl-std/consts/std-START) and [`END`](/docs/kcl-std/consts/std-END) are special tags
|
||||
for identifying the starting and ending faces of an extruded solid.
|
||||
|
||||
There is a special tag, `END` (with type `End`, although under the cover, it's a string)
|
||||
for identifying the face of a solid which was finishes an extrusion.
|
||||
|
||||
### Tag Scope
|
||||
|
||||
|
File diff suppressed because one or more lines are too long
@ -1,33 +0,0 @@
|
||||
---
|
||||
title: "KCL Constants"
|
||||
excerpt: "Documentation for the KCL constants."
|
||||
layout: manual
|
||||
---
|
||||
|
||||
## Table of Contents
|
||||
|
||||
|
||||
### `std`
|
||||
|
||||
- [`END`](/docs/kcl/consts/std-END)
|
||||
- [`START`](/docs/kcl/consts/std-START)
|
||||
- [`X`](/docs/kcl/consts/std-X)
|
||||
- [`XY`](/docs/kcl/consts/std-XY)
|
||||
- [`XZ`](/docs/kcl/consts/std-XZ)
|
||||
- [`Y`](/docs/kcl/consts/std-Y)
|
||||
- [`YZ`](/docs/kcl/consts/std-YZ)
|
||||
- [`Z`](/docs/kcl/consts/std-Z)
|
||||
|
||||
### `std::math`
|
||||
|
||||
- [`E`](/docs/kcl/consts/std-math-E)
|
||||
- [`PI`](/docs/kcl/consts/std-math-PI)
|
||||
- [`TAU`](/docs/kcl/consts/std-math-TAU)
|
||||
|
||||
### `std::turns`
|
||||
|
||||
- [`HALF_TURN`](/docs/kcl/consts/std-turns-HALF_TURN)
|
||||
- [`QUARTER_TURN`](/docs/kcl/consts/std-turns-QUARTER_TURN)
|
||||
- [`THREE_QUARTER_TURN`](/docs/kcl/consts/std-turns-THREE_QUARTER_TURN)
|
||||
- [`ZERO`](/docs/kcl/consts/std-turns-ZERO)
|
||||
|
@ -8,9 +8,13 @@ layout: manual
|
||||
Identifies the ending face of an extrusion. I.e., the new face created by an extrusion.
|
||||
|
||||
```kcl
|
||||
END: string = 'end'
|
||||
END: TaggedFace
|
||||
```
|
||||
|
||||
|
||||
|
||||
### Type
|
||||
|
||||
[`TaggedFace`](/docs/kcl-std/types/std-types-TaggedFace) - A tag which references a face of a solid, including the distinguished tags `START` and `END`.
|
||||
|
||||
|
||||
|
@ -8,9 +8,13 @@ layout: manual
|
||||
Identifies the starting face of an extrusion. I.e., the face which is extruded.
|
||||
|
||||
```kcl
|
||||
START: string = 'start'
|
||||
START: TaggedFace
|
||||
```
|
||||
|
||||
|
||||
|
||||
### Type
|
||||
|
||||
[`TaggedFace`](/docs/kcl-std/types/std-types-TaggedFace) - A tag which references a face of a solid, including the distinguished tags `START` and `END`.
|
||||
|
||||
|
||||
|
@ -8,9 +8,13 @@ layout: manual
|
||||
The X-axis (can be used in both 2d and 3d contexts).
|
||||
|
||||
```kcl
|
||||
X
|
||||
X: Axis3d
|
||||
```
|
||||
|
||||
|
||||
|
||||
### Type
|
||||
|
||||
[`Axis3d`](/docs/kcl-std/types/std-types-Axis3d) - An abstract and infinite line in 3d space.
|
||||
|
||||
|
||||
|
@ -8,9 +8,13 @@ layout: manual
|
||||
An abstract 3d plane aligned with the X and Y axes. Its normal is the positive Z axis.
|
||||
|
||||
```kcl
|
||||
XY
|
||||
XY: Plane
|
||||
```
|
||||
|
||||
|
||||
|
||||
### Type
|
||||
|
||||
[`Plane`](/docs/kcl-std/types/std-types-Plane) - An abstract plane.
|
||||
|
||||
|
||||
|
@ -8,9 +8,13 @@ layout: manual
|
||||
An abstract 3d plane aligned with the X and Z axes. Its normal is the negative Y axis.
|
||||
|
||||
```kcl
|
||||
XZ
|
||||
XZ: Plane
|
||||
```
|
||||
|
||||
|
||||
|
||||
### Type
|
||||
|
||||
[`Plane`](/docs/kcl-std/types/std-types-Plane) - An abstract plane.
|
||||
|
||||
|
||||
|
@ -8,9 +8,13 @@ layout: manual
|
||||
The Y-axis (can be used in both 2d and 3d contexts).
|
||||
|
||||
```kcl
|
||||
Y
|
||||
Y: Axis3d
|
||||
```
|
||||
|
||||
|
||||
|
||||
### Type
|
||||
|
||||
[`Axis3d`](/docs/kcl-std/types/std-types-Axis3d) - An abstract and infinite line in 3d space.
|
||||
|
||||
|
||||
|
@ -8,9 +8,13 @@ layout: manual
|
||||
An abstract 3d plane aligned with the Y and Z axes. Its normal is the positive X axis.
|
||||
|
||||
```kcl
|
||||
YZ
|
||||
YZ: Plane
|
||||
```
|
||||
|
||||
|
||||
|
||||
### Type
|
||||
|
||||
[`Plane`](/docs/kcl-std/types/std-types-Plane) - An abstract plane.
|
||||
|
||||
|
||||
|
@ -8,9 +8,13 @@ layout: manual
|
||||
The 3D Z-axis.
|
||||
|
||||
```kcl
|
||||
Z
|
||||
Z: Axis3d
|
||||
```
|
||||
|
||||
|
||||
|
||||
### Type
|
||||
|
||||
[`Axis3d`](/docs/kcl-std/types/std-types-Axis3d) - An abstract and infinite line in 3d space.
|
||||
|
||||
|
||||
|
@ -13,12 +13,16 @@ E: number = 2.71828182845904523536028747135266250_
|
||||
|
||||
|
||||
|
||||
### Type
|
||||
|
||||
[`number`](/docs/kcl-std/types/std-types-number) - A number.
|
||||
|
||||
### Examples
|
||||
|
||||
```kcl
|
||||
exampleSketch = startSketchOn(XZ)
|
||||
|> startProfile(at = [0, 0])
|
||||
|> angledLine(angle = 30, length = 2 * E ^ 2)
|
||||
|> angledLine(angle = 30deg, length = 2 * E ^ 2)
|
||||
|> yLine(endAbsolute = 0)
|
||||
|> close()
|
||||
|
||||
|
@ -11,13 +11,17 @@ The value of `pi`, Archimedes’ constant (π).
|
||||
PI: number(_?) = 3.14159265358979323846264338327950288_?
|
||||
```
|
||||
|
||||
`PI` is a number and is technically a ratio, so you might expect it to have type `number(_)`.
|
||||
`PI` is a number and is technically a ratio, so you might expect it to have type [`number(_)`](/docs/kcl-std/types/std-types-number).
|
||||
However, `PI` is nearly always used for converting between different units - usually degrees to or
|
||||
from radians. Therefore, `PI` is treated a bit specially by KCL and always has unknown units. This
|
||||
means that if you use `PI`, you will need to give KCL some extra information about the units of numbers.
|
||||
Usually you should use type ascription on the result of calculations, e.g., `(2 * PI): number(rad)`.
|
||||
You might prefer to use `units::toRadians` or `units::toDegrees` to convert between angles with
|
||||
different units.
|
||||
It is better to use `units::toRadians` or `units::toDegrees` to convert between angles with
|
||||
different units where possible.
|
||||
|
||||
### Type
|
||||
|
||||
[`number(_?)`](/docs/kcl-std/types/std-types-number) - A number.
|
||||
|
||||
### Examples
|
||||
|
||||
|
@ -13,12 +13,16 @@ TAU: number = 6.28318530717958647692528676655900577_
|
||||
|
||||
|
||||
|
||||
### Type
|
||||
|
||||
[`number`](/docs/kcl-std/types/std-types-number) - A number.
|
||||
|
||||
### Examples
|
||||
|
||||
```kcl
|
||||
exampleSketch = startSketchOn(XZ)
|
||||
|> startProfile(at = [0, 0])
|
||||
|> angledLine(angle = 50, length = 10 * TAU)
|
||||
|> angledLine(angle = 50deg, length = 10 * TAU)
|
||||
|> yLine(endAbsolute = 0)
|
||||
|> close()
|
||||
|
||||
|
@ -13,4 +13,8 @@ sweep::SKETCH_PLANE: string = 'sketchPlane'
|
||||
|
||||
|
||||
|
||||
### Type
|
||||
|
||||
[`string`](/docs/kcl-std/types/std-types-string) - A sequence of characters
|
||||
|
||||
|
||||
|
@ -13,4 +13,8 @@ sweep::TRAJECTORY: string = 'trajectoryCurve'
|
||||
|
||||
|
||||
|
||||
### Type
|
||||
|
||||
[`string`](/docs/kcl-std/types/std-types-string) - A sequence of characters
|
||||
|
||||
|
||||
|
@ -13,4 +13,8 @@ turns::HALF_TURN: number(deg) = 180deg
|
||||
|
||||
|
||||
|
||||
### Type
|
||||
|
||||
[`number(deg)`](/docs/kcl-std/types/std-types-number) - A number.
|
||||
|
||||
|
||||
|
@ -13,4 +13,8 @@ turns::QUARTER_TURN: number(deg) = 90deg
|
||||
|
||||
|
||||
|
||||
### Type
|
||||
|
||||
[`number(deg)`](/docs/kcl-std/types/std-types-number) - A number.
|
||||
|
||||
|
||||
|
@ -13,4 +13,8 @@ turns::THREE_QUARTER_TURN: number(deg) = 270deg
|
||||
|
||||
|
||||
|
||||
### Type
|
||||
|
||||
[`number(deg)`](/docs/kcl-std/types/std-types-number) - A number.
|
||||
|
||||
|
||||
|
@ -8,9 +8,13 @@ layout: manual
|
||||
No turn, zero degrees/radians.
|
||||
|
||||
```kcl
|
||||
turns::ZERO: number = 0
|
||||
turns::ZERO: number(Angle)
|
||||
```
|
||||
|
||||
|
||||
|
||||
### Type
|
||||
|
||||
[`number(Angle)`](/docs/kcl-std/types/std-types-number) - A number.
|
||||
|
||||
|
||||
|
@ -27,7 +27,7 @@ abs(@input: number): number
|
||||
### Examples
|
||||
|
||||
```kcl
|
||||
myAngle = -120
|
||||
myAngle = -120deg
|
||||
|
||||
sketch001 = startSketchOn(XZ)
|
||||
|> startProfile(at = [0, 0])
|
||||
|
@ -8,7 +8,7 @@ layout: manual
|
||||
Compute the cosine of a number.
|
||||
|
||||
```kcl
|
||||
cos(@num: number(Angle)): number(_)
|
||||
cos(@num: number(Angle)): number
|
||||
```
|
||||
|
||||
|
||||
@ -21,7 +21,7 @@ cos(@num: number(Angle)): number(_)
|
||||
|
||||
### Returns
|
||||
|
||||
[`number(_)`](/docs/kcl-std/types/std-types-number) - A number.
|
||||
[`number`](/docs/kcl-std/types/std-types-number) - A number.
|
||||
|
||||
|
||||
### Examples
|
||||
@ -29,7 +29,7 @@ cos(@num: number(Angle)): number(_)
|
||||
```kcl
|
||||
exampleSketch = startSketchOn(XZ)
|
||||
|> startProfile(at = [0, 0])
|
||||
|> angledLine(angle = 30, length = 3 / cos(30deg))
|
||||
|> angledLine(angle = 30deg, length = 3 / cos(30deg))
|
||||
|> yLine(endAbsolute = 0)
|
||||
|> close()
|
||||
|
||||
|
@ -29,7 +29,7 @@ max(@input: [number; 1+]): number
|
||||
```kcl
|
||||
exampleSketch = startSketchOn(XZ)
|
||||
|> startProfile(at = [0, 0])
|
||||
|> angledLine(angle = 70, length = max([15, 31, 4, 13, 22]))
|
||||
|> angledLine(angle = 70deg, length = max([15, 31, 4, 13, 22]))
|
||||
|> line(end = [20, 0])
|
||||
|> close()
|
||||
|
||||
|
@ -29,7 +29,7 @@ min(@input: [number; 1+]): number
|
||||
```kcl
|
||||
exampleSketch = startSketchOn(XZ)
|
||||
|> startProfile(at = [0, 0])
|
||||
|> angledLine(angle = 70, length = min([15, 31, 4, 13, 22]))
|
||||
|> angledLine(angle = 70deg, length = min([15, 31, 4, 13, 22]))
|
||||
|> line(end = [20, 0])
|
||||
|> close()
|
||||
|
||||
|
@ -33,7 +33,7 @@ polar(
|
||||
```kcl
|
||||
exampleSketch = startSketchOn(XZ)
|
||||
|> startProfile(at = [0, 0])
|
||||
|> line(end = polar(angle = 30, length = 5), tag = $thing)
|
||||
|> line(end = polar(angle = 30deg, length = 5), tag = $thing)
|
||||
|> line(end = [0, 5])
|
||||
|> line(end = [segEndX(thing), 0])
|
||||
|> line(end = [-20, 10])
|
||||
|
@ -33,7 +33,7 @@ pow(
|
||||
```kcl
|
||||
exampleSketch = startSketchOn(XZ)
|
||||
|> startProfile(at = [0, 0])
|
||||
|> angledLine(angle = 50, length = pow(5, exp = 2))
|
||||
|> angledLine(angle = 50deg, length = pow(5, exp = 2))
|
||||
|> yLine(endAbsolute = 0)
|
||||
|> close()
|
||||
|
||||
|
@ -8,7 +8,7 @@ layout: manual
|
||||
Compute the sine of a number.
|
||||
|
||||
```kcl
|
||||
sin(@num: number(Angle)): number(_)
|
||||
sin(@num: number(Angle)): number
|
||||
```
|
||||
|
||||
|
||||
@ -21,7 +21,7 @@ sin(@num: number(Angle)): number(_)
|
||||
|
||||
### Returns
|
||||
|
||||
[`number(_)`](/docs/kcl-std/types/std-types-number) - A number.
|
||||
[`number`](/docs/kcl-std/types/std-types-number) - A number.
|
||||
|
||||
|
||||
### Examples
|
||||
@ -29,7 +29,7 @@ sin(@num: number(Angle)): number(_)
|
||||
```kcl
|
||||
exampleSketch = startSketchOn(XZ)
|
||||
|> startProfile(at = [0, 0])
|
||||
|> angledLine(angle = 50, length = 15 / sin(135deg))
|
||||
|> angledLine(angle = 50deg, length = 15 / sin(135deg))
|
||||
|> yLine(endAbsolute = 0)
|
||||
|> close()
|
||||
|
||||
|
@ -29,7 +29,7 @@ sqrt(@input: number): number
|
||||
```kcl
|
||||
exampleSketch = startSketchOn(XZ)
|
||||
|> startProfile(at = [0, 0])
|
||||
|> angledLine(angle = 50, length = sqrt(2500))
|
||||
|> angledLine(angle = 50deg, length = sqrt(2500))
|
||||
|> yLine(endAbsolute = 0)
|
||||
|> close()
|
||||
|
||||
|
@ -8,7 +8,7 @@ layout: manual
|
||||
Compute the tangent of a number.
|
||||
|
||||
```kcl
|
||||
tan(@num: number(Angle)): number(_)
|
||||
tan(@num: number(Angle)): number
|
||||
```
|
||||
|
||||
|
||||
@ -21,7 +21,7 @@ tan(@num: number(Angle)): number(_)
|
||||
|
||||
### Returns
|
||||
|
||||
[`number(_)`](/docs/kcl-std/types/std-types-number) - A number.
|
||||
[`number`](/docs/kcl-std/types/std-types-number) - A number.
|
||||
|
||||
|
||||
### Examples
|
||||
@ -29,7 +29,7 @@ tan(@num: number(Angle)): number(_)
|
||||
```kcl
|
||||
exampleSketch = startSketchOn(XZ)
|
||||
|> startProfile(at = [0, 0])
|
||||
|> angledLine(angle = 50, length = 50 * tan((1 / 2): number(rad)))
|
||||
|> angledLine(angle = 50deg, length = 50 * tan((1 / 2): number(rad)))
|
||||
|> yLine(endAbsolute = 0)
|
||||
|> close()
|
||||
|
||||
|
@ -16,7 +16,7 @@ angledLine(
|
||||
lengthY?: number(Length),
|
||||
endAbsoluteX?: number(Length),
|
||||
endAbsoluteY?: number(Length),
|
||||
tag?: tag,
|
||||
tag?: TagDecl,
|
||||
): Sketch
|
||||
```
|
||||
|
||||
@ -33,7 +33,7 @@ angledLine(
|
||||
| `lengthY` | [`number(Length)`](/docs/kcl-std/types/std-types-number) | Draw the line this distance along the Y axis. Only one of `length`, `lengthX`, `lengthY`, `endAbsoluteX`, `endAbsoluteY` can be given. | No |
|
||||
| `endAbsoluteX` | [`number(Length)`](/docs/kcl-std/types/std-types-number) | Draw the line along the given angle until it reaches this point along the X axis. Only one of `length`, `lengthX`, `lengthY`, `endAbsoluteX`, `endAbsoluteY` can be given. | No |
|
||||
| `endAbsoluteY` | [`number(Length)`](/docs/kcl-std/types/std-types-number) | Draw the line along the given angle until it reaches this point along the Y axis. Only one of `length`, `lengthX`, `lengthY`, `endAbsoluteX`, `endAbsoluteY` can be given. | No |
|
||||
| [`tag`](/docs/kcl-std/types/std-types-tag) | [`tag`](/docs/kcl-std/types/std-types-tag) | Create a new tag which refers to this line. | No |
|
||||
| `tag` | [`TagDecl`](/docs/kcl-std/types/std-types-TagDecl) | Create a new tag which refers to this line. | No |
|
||||
|
||||
### Returns
|
||||
|
||||
@ -46,7 +46,7 @@ angledLine(
|
||||
exampleSketch = startSketchOn(XZ)
|
||||
|> startProfile(at = [0, 0])
|
||||
|> yLine(endAbsolute = 15)
|
||||
|> angledLine(angle = 30, length = 15)
|
||||
|> angledLine(angle = 30deg, length = 15)
|
||||
|> line(end = [8, -10])
|
||||
|> yLine(endAbsolute = 0)
|
||||
|> close()
|
||||
|
@ -11,9 +11,9 @@ Draw an angled line from the current origin, constructing a line segment such th
|
||||
angledLineThatIntersects(
|
||||
@sketch: Sketch,
|
||||
angle: number(Angle),
|
||||
intersectTag: tag,
|
||||
intersectTag: TaggedEdge,
|
||||
offset?: number(Length),
|
||||
tag?: tag,
|
||||
tag?: TagDecl,
|
||||
): Sketch
|
||||
```
|
||||
|
||||
@ -25,9 +25,9 @@ angledLineThatIntersects(
|
||||
|----------|------|-------------|----------|
|
||||
| `sketch` | [`Sketch`](/docs/kcl-std/types/std-types-Sketch) | Which sketch should this path be added to? | Yes |
|
||||
| `angle` | [`number(Angle)`](/docs/kcl-std/types/std-types-number) | Which angle should the line be drawn at? | Yes |
|
||||
| `intersectTag` | [`tag`](/docs/kcl-std/types/std-types-tag) | The tag of the line to intersect with. | Yes |
|
||||
| `intersectTag` | [`TaggedEdge`](/docs/kcl-std/types/std-types-TaggedEdge) | The tag of the line to intersect with. | Yes |
|
||||
| `offset` | [`number(Length)`](/docs/kcl-std/types/std-types-number) | The offset from the intersecting line. | No |
|
||||
| [`tag`](/docs/kcl-std/types/std-types-tag) | [`tag`](/docs/kcl-std/types/std-types-tag) | Create a new tag which refers to this line. | No |
|
||||
| `tag` | [`TagDecl`](/docs/kcl-std/types/std-types-TagDecl) | Create a new tag which refers to this line. | No |
|
||||
|
||||
### Returns
|
||||
|
||||
@ -42,7 +42,7 @@ exampleSketch = startSketchOn(XZ)
|
||||
|> line(endAbsolute = [5, 10])
|
||||
|> line(endAbsolute = [-10, 10], tag = $lineToIntersect)
|
||||
|> line(endAbsolute = [0, 20])
|
||||
|> angledLineThatIntersects(angle = 80, intersectTag = lineToIntersect, offset = 10)
|
||||
|> angledLineThatIntersects(angle = 80deg, intersectTag = lineToIntersect, offset = 10)
|
||||
|> close()
|
||||
|
||||
example = extrude(exampleSketch, length = 10)
|
||||
|
@ -16,7 +16,7 @@ arc(
|
||||
diameter?: number(Length),
|
||||
interiorAbsolute?: Point2d,
|
||||
endAbsolute?: Point2d,
|
||||
tag?: tag,
|
||||
tag?: TagDecl,
|
||||
): Sketch
|
||||
```
|
||||
|
||||
@ -40,7 +40,7 @@ for to construct your shape, you're likely looking for tangentialArc.
|
||||
| `diameter` | [`number(Length)`](/docs/kcl-std/types/std-types-number) | How large should the circle be? Incompatible with `radius`. | No |
|
||||
| `interiorAbsolute` | [`Point2d`](/docs/kcl-std/types/std-types-Point2d) | Any point between the arc's start and end? Requires `endAbsolute`. Incompatible with `angleStart` or `angleEnd`. | No |
|
||||
| `endAbsolute` | [`Point2d`](/docs/kcl-std/types/std-types-Point2d) | Where should this arc end? Requires `interiorAbsolute`. Incompatible with `angleStart` or `angleEnd`. | No |
|
||||
| [`tag`](/docs/kcl-std/types/std-types-tag) | [`tag`](/docs/kcl-std/types/std-types-tag) | Create a new tag which refers to this arc. | No |
|
||||
| `tag` | [`TagDecl`](/docs/kcl-std/types/std-types-TagDecl) | Create a new tag which refers to this arc. | No |
|
||||
|
||||
### Returns
|
||||
|
||||
@ -53,7 +53,7 @@ for to construct your shape, you're likely looking for tangentialArc.
|
||||
exampleSketch = startSketchOn(XZ)
|
||||
|> startProfile(at = [0, 0])
|
||||
|> line(end = [10, 0])
|
||||
|> arc(angleStart = 0, angleEnd = 280, radius = 16)
|
||||
|> arc(angleStart = 0, angleEnd = 280deg, radius = 16)
|
||||
|> close()
|
||||
example = extrude(exampleSketch, length = 10)
|
||||
|
||||
|
@ -16,7 +16,7 @@ bezierCurve(
|
||||
control1Absolute?: Point2d,
|
||||
control2Absolute?: Point2d,
|
||||
endAbsolute?: Point2d,
|
||||
tag?: tag,
|
||||
tag?: TagDecl,
|
||||
): Sketch
|
||||
```
|
||||
|
||||
@ -33,7 +33,7 @@ bezierCurve(
|
||||
| `control1Absolute` | [`Point2d`](/docs/kcl-std/types/std-types-Point2d) | First control point for the cubic. Absolute point. | No |
|
||||
| `control2Absolute` | [`Point2d`](/docs/kcl-std/types/std-types-Point2d) | Second control point for the cubic. Absolute point. | No |
|
||||
| `endAbsolute` | [`Point2d`](/docs/kcl-std/types/std-types-Point2d) | Coordinate on the plane at which this line should end. | No |
|
||||
| [`tag`](/docs/kcl-std/types/std-types-tag) | [`tag`](/docs/kcl-std/types/std-types-tag) | Create a new tag which refers to this line. | No |
|
||||
| `tag` | [`TagDecl`](/docs/kcl-std/types/std-types-TagDecl) | Create a new tag which refers to this line. | No |
|
||||
|
||||
### Returns
|
||||
|
||||
|
@ -13,7 +13,7 @@ circle(
|
||||
center: Point2d,
|
||||
radius?: number(Length),
|
||||
diameter?: number(Length),
|
||||
tag?: tag,
|
||||
tag?: TagDecl,
|
||||
): Sketch
|
||||
```
|
||||
|
||||
@ -27,7 +27,7 @@ circle(
|
||||
| `center` | [`Point2d`](/docs/kcl-std/types/std-types-Point2d) | The center of the circle. | Yes |
|
||||
| `radius` | [`number(Length)`](/docs/kcl-std/types/std-types-number) | The radius of the circle. Incompatible with `diameter`. | No |
|
||||
| `diameter` | [`number(Length)`](/docs/kcl-std/types/std-types-number) | The diameter of the circle. Incompatible with `radius`. | No |
|
||||
| [`tag`](/docs/kcl-std/types/std-types-tag) | [`tag`](/docs/kcl-std/types/std-types-tag) | Create a new tag which refers to this circle. | No |
|
||||
| `tag` | [`TagDecl`](/docs/kcl-std/types/std-types-TagDecl) | Create a new tag which refers to this circle. | No |
|
||||
|
||||
### Returns
|
||||
|
||||
|
@ -13,7 +13,7 @@ circleThreePoint(
|
||||
p1: Point2d,
|
||||
p2: Point2d,
|
||||
p3: Point2d,
|
||||
tag?: tag,
|
||||
tag?: TagDecl,
|
||||
): Sketch
|
||||
```
|
||||
|
||||
@ -27,7 +27,7 @@ circleThreePoint(
|
||||
| `p1` | [`Point2d`](/docs/kcl-std/types/std-types-Point2d) | 1st point to derive the circle. | Yes |
|
||||
| `p2` | [`Point2d`](/docs/kcl-std/types/std-types-Point2d) | 2nd point to derive the circle. | Yes |
|
||||
| `p3` | [`Point2d`](/docs/kcl-std/types/std-types-Point2d) | 3rd point to derive the circle. | Yes |
|
||||
| [`tag`](/docs/kcl-std/types/std-types-tag) | [`tag`](/docs/kcl-std/types/std-types-tag) | Identifier for the circle to reference elsewhere. | No |
|
||||
| `tag` | [`TagDecl`](/docs/kcl-std/types/std-types-TagDecl) | Identifier for the circle to reference elsewhere. | No |
|
||||
|
||||
### Returns
|
||||
|
||||
|
@ -10,7 +10,7 @@ Construct a line segment from the current origin back to the profile's origin, e
|
||||
```kcl
|
||||
close(
|
||||
@sketch: Sketch,
|
||||
tag?: tag,
|
||||
tag?: TagDecl,
|
||||
): Sketch
|
||||
```
|
||||
|
||||
@ -24,7 +24,7 @@ starting point.
|
||||
| Name | Type | Description | Required |
|
||||
|----------|------|-------------|----------|
|
||||
| `sketch` | [`Sketch`](/docs/kcl-std/types/std-types-Sketch) | The sketch you want to close. | Yes |
|
||||
| [`tag`](/docs/kcl-std/types/std-types-tag) | [`tag`](/docs/kcl-std/types/std-types-tag) | Create a new tag which refers to this line. | No |
|
||||
| `tag` | [`TagDecl`](/docs/kcl-std/types/std-types-TagDecl) | Create a new tag which refers to this line. | No |
|
||||
|
||||
### Returns
|
||||
|
||||
|
File diff suppressed because one or more lines are too long
53
docs/kcl-std/functions/std-sketch-extrudeTwist.md
Normal file
53
docs/kcl-std/functions/std-sketch-extrudeTwist.md
Normal file
File diff suppressed because one or more lines are too long
@ -8,7 +8,7 @@ layout: manual
|
||||
Get the shared edge between two faces.
|
||||
|
||||
```kcl
|
||||
getCommonEdge(faces: [tag; 2]): Edge
|
||||
getCommonEdge(faces: [TaggedFace; 2]): Edge
|
||||
```
|
||||
|
||||
|
||||
@ -17,7 +17,7 @@ getCommonEdge(faces: [tag; 2]): Edge
|
||||
|
||||
| Name | Type | Description | Required |
|
||||
|----------|------|-------------|----------|
|
||||
| `faces` | `[tag; 2]` | The tags of the faces you want to find the common edge between. | Yes |
|
||||
| `faces` | `[TaggedFace; 2]` | The tags of the faces you want to find the common edge between. | Yes |
|
||||
|
||||
### Returns
|
||||
|
||||
|
@ -8,7 +8,7 @@ layout: manual
|
||||
Get the next adjacent edge to the edge given.
|
||||
|
||||
```kcl
|
||||
getNextAdjacentEdge(@edge: tag): Edge
|
||||
getNextAdjacentEdge(@edge: TaggedEdge): Edge
|
||||
```
|
||||
|
||||
|
||||
@ -17,7 +17,7 @@ getNextAdjacentEdge(@edge: tag): Edge
|
||||
|
||||
| Name | Type | Description | Required |
|
||||
|----------|------|-------------|----------|
|
||||
| `edge` | [`tag`](/docs/kcl-std/types/std-types-tag) | The tag of the edge you want to find the next adjacent edge of. | Yes |
|
||||
| `edge` | [`TaggedEdge`](/docs/kcl-std/types/std-types-TaggedEdge) | The tag of the edge you want to find the next adjacent edge of. | Yes |
|
||||
|
||||
### Returns
|
||||
|
||||
@ -30,10 +30,10 @@ getNextAdjacentEdge(@edge: tag): Edge
|
||||
exampleSketch = startSketchOn(XZ)
|
||||
|> startProfile(at = [0, 0])
|
||||
|> line(end = [10, 0])
|
||||
|> angledLine(angle = 60, length = 10)
|
||||
|> angledLine(angle = 120, length = 10)
|
||||
|> angledLine(angle = 60deg, length = 10)
|
||||
|> angledLine(angle = 120deg, length = 10)
|
||||
|> line(end = [-10, 0])
|
||||
|> angledLine(angle = 240, length = 10, tag = $referenceEdge)
|
||||
|> angledLine(angle = 240deg, length = 10, tag = $referenceEdge)
|
||||
|> close()
|
||||
|
||||
example = extrude(exampleSketch, length = 5)
|
||||
|
@ -8,7 +8,7 @@ layout: manual
|
||||
Get the opposite edge to the edge given.
|
||||
|
||||
```kcl
|
||||
getOppositeEdge(@edge: tag): Edge
|
||||
getOppositeEdge(@edge: TaggedEdge): Edge
|
||||
```
|
||||
|
||||
|
||||
@ -17,7 +17,7 @@ getOppositeEdge(@edge: tag): Edge
|
||||
|
||||
| Name | Type | Description | Required |
|
||||
|----------|------|-------------|----------|
|
||||
| `edge` | [`tag`](/docs/kcl-std/types/std-types-tag) | The tag of the edge you want to find the opposite edge of. | Yes |
|
||||
| `edge` | [`TaggedEdge`](/docs/kcl-std/types/std-types-TaggedEdge) | The tag of the edge you want to find the opposite edge of. | Yes |
|
||||
|
||||
### Returns
|
||||
|
||||
@ -30,10 +30,10 @@ getOppositeEdge(@edge: tag): Edge
|
||||
exampleSketch = startSketchOn(XZ)
|
||||
|> startProfile(at = [0, 0])
|
||||
|> line(end = [10, 0])
|
||||
|> angledLine(angle = 60, length = 10)
|
||||
|> angledLine(angle = 120, length = 10)
|
||||
|> angledLine(angle = 60deg, length = 10)
|
||||
|> angledLine(angle = 120deg, length = 10)
|
||||
|> line(end = [-10, 0])
|
||||
|> angledLine(angle = 240, length = 10, tag = $referenceEdge)
|
||||
|> angledLine(angle = 240deg, length = 10, tag = $referenceEdge)
|
||||
|> close()
|
||||
|
||||
example = extrude(exampleSketch, length = 5)
|
||||
|
@ -8,7 +8,7 @@ layout: manual
|
||||
Get the previous adjacent edge to the edge given.
|
||||
|
||||
```kcl
|
||||
getPreviousAdjacentEdge(@edge: tag): Edge
|
||||
getPreviousAdjacentEdge(@edge: TaggedEdge): Edge
|
||||
```
|
||||
|
||||
|
||||
@ -17,7 +17,7 @@ getPreviousAdjacentEdge(@edge: tag): Edge
|
||||
|
||||
| Name | Type | Description | Required |
|
||||
|----------|------|-------------|----------|
|
||||
| `edge` | [`tag`](/docs/kcl-std/types/std-types-tag) | The tag of the edge you want to find the previous adjacent edge of. | Yes |
|
||||
| `edge` | [`TaggedEdge`](/docs/kcl-std/types/std-types-TaggedEdge) | The tag of the edge you want to find the previous adjacent edge of. | Yes |
|
||||
|
||||
### Returns
|
||||
|
||||
@ -30,10 +30,10 @@ getPreviousAdjacentEdge(@edge: tag): Edge
|
||||
exampleSketch = startSketchOn(XZ)
|
||||
|> startProfile(at = [0, 0])
|
||||
|> line(end = [10, 0])
|
||||
|> angledLine(angle = 60, length = 10)
|
||||
|> angledLine(angle = 120, length = 10)
|
||||
|> angledLine(angle = 60deg, length = 10)
|
||||
|> angledLine(angle = 120deg, length = 10)
|
||||
|> line(end = [-10, 0])
|
||||
|> angledLine(angle = 240, length = 10, tag = $referenceEdge)
|
||||
|> angledLine(angle = 240deg, length = 10, tag = $referenceEdge)
|
||||
|> close()
|
||||
|
||||
example = extrude(exampleSketch, length = 5)
|
||||
|
@ -14,7 +14,7 @@ involuteCircular(
|
||||
endRadius: number(Length),
|
||||
angle: number(Angle),
|
||||
reverse?: bool,
|
||||
tag?: tag,
|
||||
tag?: TagDecl,
|
||||
): Sketch
|
||||
```
|
||||
|
||||
@ -29,7 +29,7 @@ involuteCircular(
|
||||
| `endRadius` | [`number(Length)`](/docs/kcl-std/types/std-types-number) | The involute is described between two circles, end_radius is the radius of the outer circle. | Yes |
|
||||
| `angle` | [`number(Angle)`](/docs/kcl-std/types/std-types-number) | The angle to rotate the involute by. A value of zero will produce a curve with a tangent along the x-axis at the start point of the curve. | Yes |
|
||||
| `reverse` | [`bool`](/docs/kcl-std/types/std-types-bool) | If reverse is true, the segment will start from the end of the involute, otherwise it will start from that start. | No |
|
||||
| [`tag`](/docs/kcl-std/types/std-types-tag) | [`tag`](/docs/kcl-std/types/std-types-tag) | Create a new tag which refers to this line. | No |
|
||||
| `tag` | [`TagDecl`](/docs/kcl-std/types/std-types-TagDecl) | Create a new tag which refers to this line. | No |
|
||||
|
||||
### Returns
|
||||
|
||||
@ -43,11 +43,11 @@ a = 10
|
||||
b = 14
|
||||
startSketchOn(XZ)
|
||||
|> startProfile(at = [0, 0])
|
||||
|> involuteCircular(startRadius = a, endRadius = b, angle = 60)
|
||||
|> involuteCircular(startRadius = a, endRadius = b, angle = 60deg)
|
||||
|> involuteCircular(
|
||||
startRadius = a,
|
||||
endRadius = b,
|
||||
angle = 60,
|
||||
angle = 60deg,
|
||||
reverse = true,
|
||||
)
|
||||
|
||||
|
@ -12,7 +12,7 @@ line(
|
||||
@sketch: Sketch,
|
||||
endAbsolute?: Point2d,
|
||||
end?: Point2d,
|
||||
tag?: tag,
|
||||
tag?: TagDecl,
|
||||
): Sketch
|
||||
```
|
||||
|
||||
@ -25,7 +25,7 @@ line(
|
||||
| `sketch` | [`Sketch`](/docs/kcl-std/types/std-types-Sketch) | Which sketch should this path be added to? | Yes |
|
||||
| `endAbsolute` | [`Point2d`](/docs/kcl-std/types/std-types-Point2d) | Which absolute point should this line go to? Incompatible with `end`. | No |
|
||||
| `end` | [`Point2d`](/docs/kcl-std/types/std-types-Point2d) | How far away (along the X and Y axes) should this line go? Incompatible with `endAbsolute`. | No |
|
||||
| [`tag`](/docs/kcl-std/types/std-types-tag) | [`tag`](/docs/kcl-std/types/std-types-tag) | Create a new tag which refers to this line. | No |
|
||||
| `tag` | [`TagDecl`](/docs/kcl-std/types/std-types-TagDecl) | Create a new tag which refers to this line. | No |
|
||||
|
||||
### Returns
|
||||
|
||||
|
@ -14,8 +14,8 @@ loft(
|
||||
bezApproximateRational?: bool,
|
||||
baseCurveIndex?: number(_),
|
||||
tolerance?: number(Length),
|
||||
tagStart?: tag,
|
||||
tagEnd?: tag,
|
||||
tagStart?: TagDecl,
|
||||
tagEnd?: TagDecl,
|
||||
): Solid
|
||||
```
|
||||
|
||||
@ -30,8 +30,8 @@ The sketches need to be closed and on different planes that are parallel.
|
||||
| `bezApproximateRational` | [`bool`](/docs/kcl-std/types/std-types-bool) | Attempt to approximate rational curves (such as arcs) using a bezier. This will remove banding around interpolations between arcs and non-arcs. It may produce errors in other scenarios. Over time, this field won't be necessary. | No |
|
||||
| `baseCurveIndex` | [`number(_)`](/docs/kcl-std/types/std-types-number) | This can be set to override the automatically determined topological base curve, which is usually the first section encountered. | No |
|
||||
| `tolerance` | [`number(Length)`](/docs/kcl-std/types/std-types-number) | Tolerance for the loft operation. | No |
|
||||
| `tagStart` | [`tag`](/docs/kcl-std/types/std-types-tag) | A named tag for the face at the start of the loft, i.e. the original sketch. | No |
|
||||
| `tagEnd` | [`tag`](/docs/kcl-std/types/std-types-tag) | A named tag for the face at the end of the loft. | No |
|
||||
| `tagStart` | [`TagDecl`](/docs/kcl-std/types/std-types-TagDecl) | A named tag for the face at the start of the loft, i.e. the original sketch. | No |
|
||||
| `tagEnd` | [`TagDecl`](/docs/kcl-std/types/std-types-TagDecl) | A named tag for the face at the end of the loft. | No |
|
||||
|
||||
### Returns
|
||||
|
||||
|
@ -30,7 +30,7 @@ profileStart(@profile: Sketch): Point2d
|
||||
sketch001 = startSketchOn(XY)
|
||||
|> startProfile(at = [5, 2])
|
||||
|> angledLine(angle = 120, length = 50, tag = $seg01)
|
||||
|> angledLine(angle = segAng(seg01) + 120, length = 50)
|
||||
|> angledLine(angle = segAng(seg01) + 120deg, length = 50)
|
||||
|> line(end = profileStart(%))
|
||||
|> close()
|
||||
|> extrude(length = 20)
|
||||
|
@ -30,8 +30,8 @@ profileStartX(@profile: Sketch): number(Length)
|
||||
sketch001 = startSketchOn(XY)
|
||||
|> startProfile(at = [5, 2])
|
||||
|> angledLine(angle = -26.6, length = 50)
|
||||
|> angledLine(angle = 90, length = 50)
|
||||
|> angledLine(angle = 30, endAbsoluteX = profileStartX(%))
|
||||
|> angledLine(angle = 90deg, length = 50)
|
||||
|> angledLine(angle = 30deg, endAbsoluteX = profileStartX(%))
|
||||
|
||||
```
|
||||
|
||||
|
@ -29,8 +29,8 @@ profileStartY(@profile: Sketch): number(Length)
|
||||
```kcl
|
||||
sketch001 = startSketchOn(XY)
|
||||
|> startProfile(at = [5, 2])
|
||||
|> angledLine(angle = -60, length = 14)
|
||||
|> angledLine(angle = 30, endAbsoluteY = profileStartY(%))
|
||||
|> angledLine(angle = -60deg, length = 14)
|
||||
|> angledLine(angle = 30deg, endAbsoluteY = profileStartY(%))
|
||||
|
||||
```
|
||||
|
||||
|
@ -15,8 +15,8 @@ revolve(
|
||||
tolerance?: number(Length),
|
||||
symmetric?: bool,
|
||||
bidirectionalAngle?: number(Angle),
|
||||
tagStart?: tag,
|
||||
tagEnd?: tag,
|
||||
tagStart?: TagDecl,
|
||||
tagEnd?: TagDecl,
|
||||
): [Solid; 1+]
|
||||
```
|
||||
|
||||
@ -41,8 +41,8 @@ revolved around the same axis.
|
||||
| `tolerance` | [`number(Length)`](/docs/kcl-std/types/std-types-number) | Tolerance for the revolve operation. | No |
|
||||
| `symmetric` | [`bool`](/docs/kcl-std/types/std-types-bool) | If true, the extrusion will happen symmetrically around the sketch. Otherwise, the extrusion will happen on only one side of the sketch. | No |
|
||||
| `bidirectionalAngle` | [`number(Angle)`](/docs/kcl-std/types/std-types-number) | If specified, will also revolve in the opposite direction to 'angle' to the specified angle. If 'symmetric' is true, this value is ignored. | No |
|
||||
| `tagStart` | [`tag`](/docs/kcl-std/types/std-types-tag) | A named tag for the face at the start of the revolve, i.e. the original sketch. | No |
|
||||
| `tagEnd` | [`tag`](/docs/kcl-std/types/std-types-tag) | A named tag for the face at the end of the revolve. | No |
|
||||
| `tagStart` | [`TagDecl`](/docs/kcl-std/types/std-types-TagDecl) | A named tag for the face at the start of the revolve, i.e. the original sketch. | No |
|
||||
| `tagEnd` | [`TagDecl`](/docs/kcl-std/types/std-types-TagDecl) | A named tag for the face at the end of the revolve. | No |
|
||||
|
||||
### Returns
|
||||
|
||||
@ -62,7 +62,7 @@ part001 = startSketchOn(XY)
|
||||
|> line(end = [0, -5.5])
|
||||
|> line(end = [-2, 0])
|
||||
|> close()
|
||||
|> revolve(axis = Y) // default angle is 360
|
||||
|> revolve(axis = Y) // default angle is 360deg
|
||||
|
||||
```
|
||||
|
||||
@ -72,7 +72,7 @@ part001 = startSketchOn(XY)
|
||||
// A donut shape.
|
||||
sketch001 = startSketchOn(XY)
|
||||
|> circle(center = [15, 0], radius = 5)
|
||||
|> revolve(angle = 360, axis = Y)
|
||||
|> revolve(angle = 360deg, axis = Y)
|
||||
|
||||
```
|
||||
|
||||
@ -89,7 +89,7 @@ part001 = startSketchOn(XY)
|
||||
|> line(end = [0, -5.5])
|
||||
|> line(end = [-2, 0])
|
||||
|> close()
|
||||
|> revolve(axis = Y, angle = 180)
|
||||
|> revolve(axis = Y, angle = 180deg)
|
||||
|
||||
```
|
||||
|
||||
@ -106,7 +106,7 @@ part001 = startSketchOn(XY)
|
||||
|> line(end = [0, -5.5])
|
||||
|> line(end = [-2, 0])
|
||||
|> close()
|
||||
|> revolve(axis = Y, angle = 180)
|
||||
|> revolve(axis = Y, angle = 180deg)
|
||||
|
||||
part002 = startSketchOn(part001, face = END)
|
||||
|> startProfile(at = [4.5, -5])
|
||||
@ -131,7 +131,7 @@ box = startSketchOn(XY)
|
||||
|
||||
sketch001 = startSketchOn(box, face = END)
|
||||
|> circle(center = [10, 10], radius = 4)
|
||||
|> revolve(angle = -90, axis = Y)
|
||||
|> revolve(angle = -90deg, axis = Y)
|
||||
|
||||
```
|
||||
|
||||
@ -148,7 +148,7 @@ box = startSketchOn(XY)
|
||||
|
||||
sketch001 = startSketchOn(box, face = END)
|
||||
|> circle(center = [10, 10], radius = 4)
|
||||
|> revolve(angle = 90, axis = getOppositeEdge(revolveAxis))
|
||||
|> revolve(angle = 90deg, axis = getOppositeEdge(revolveAxis))
|
||||
|
||||
```
|
||||
|
||||
@ -165,7 +165,7 @@ box = startSketchOn(XY)
|
||||
|
||||
sketch001 = startSketchOn(box, face = END)
|
||||
|> circle(center = [10, 10], radius = 4)
|
||||
|> revolve(angle = 90, axis = getOppositeEdge(revolveAxis), tolerance = 0.0001)
|
||||
|> revolve(angle = 90deg, axis = getOppositeEdge(revolveAxis), tolerance = 0.0001)
|
||||
|
||||
```
|
||||
|
||||
@ -229,7 +229,7 @@ profile001 = startSketchOn(XY)
|
||||
|
||||
sketch001 = startSketchOn(XY)
|
||||
|> circle(center = [-10, 10], radius = 4)
|
||||
|> revolve(angle = 90, axis = revolveAxis)
|
||||
|> revolve(angle = 90deg, axis = revolveAxis)
|
||||
|
||||
```
|
||||
|
||||
@ -246,7 +246,7 @@ profile001 = startSketchOn(XY)
|
||||
|
||||
sketch001 = startSketchOn(XY)
|
||||
|> circle(center = [-10, 10], radius = 4)
|
||||
|> revolve(angle = 90, axis = revolveAxis)
|
||||
|> revolve(angle = 90deg, axis = revolveAxis)
|
||||
|
||||
```
|
||||
|
||||
@ -263,7 +263,7 @@ profile001 = startSketchOn(XY)
|
||||
|
||||
sketch001 = startSketchOn(XY)
|
||||
|> circle(center = [-10, 10], radius = 4)
|
||||
|> revolve(angle = 90, axis = revolveAxis, symmetric = true)
|
||||
|> revolve(angle = 90deg, axis = revolveAxis, symmetric = true)
|
||||
|
||||
```
|
||||
|
||||
@ -280,7 +280,7 @@ profile001 = startSketchOn(XY)
|
||||
|
||||
sketch001 = startSketchOn(XY)
|
||||
|> circle(center = [-10, 10], radius = 4)
|
||||
|> revolve(angle = 90, axis = revolveAxis, bidirectionalAngle = 50)
|
||||
|> revolve(angle = 90deg, axis = revolveAxis, bidirectionalAngle = 50)
|
||||
|
||||
```
|
||||
|
||||
|
@ -8,7 +8,7 @@ layout: manual
|
||||
Compute the angle (in degrees) of the provided line segment.
|
||||
|
||||
```kcl
|
||||
segAng(@tag: tag): number(Angle)
|
||||
segAng(@tag: TaggedEdge): number(Angle)
|
||||
```
|
||||
|
||||
|
||||
@ -17,7 +17,7 @@ segAng(@tag: tag): number(Angle)
|
||||
|
||||
| Name | Type | Description | Required |
|
||||
|----------|------|-------------|----------|
|
||||
| [`tag`](/docs/kcl-std/types/std-types-tag) | [`tag`](/docs/kcl-std/types/std-types-tag) | The line segment being queried by its tag. | Yes |
|
||||
| `tag` | [`TaggedEdge`](/docs/kcl-std/types/std-types-TaggedEdge) | The line segment being queried by its tag. | Yes |
|
||||
|
||||
### Returns
|
||||
|
||||
|
@ -8,7 +8,7 @@ layout: manual
|
||||
Compute the ending point of the provided line segment.
|
||||
|
||||
```kcl
|
||||
segEnd(@tag: tag): Point2d
|
||||
segEnd(@tag: TaggedEdge): Point2d
|
||||
```
|
||||
|
||||
|
||||
@ -17,7 +17,7 @@ segEnd(@tag: tag): Point2d
|
||||
|
||||
| Name | Type | Description | Required |
|
||||
|----------|------|-------------|----------|
|
||||
| [`tag`](/docs/kcl-std/types/std-types-tag) | [`tag`](/docs/kcl-std/types/std-types-tag) | The line segment being queried by its tag. | Yes |
|
||||
| `tag` | [`TaggedEdge`](/docs/kcl-std/types/std-types-TaggedEdge) | The line segment being queried by its tag. | Yes |
|
||||
|
||||
### Returns
|
||||
|
||||
|
@ -8,7 +8,7 @@ layout: manual
|
||||
Compute the ending point of the provided line segment along the 'x' axis.
|
||||
|
||||
```kcl
|
||||
segEndX(@tag: tag): number(Length)
|
||||
segEndX(@tag: TaggedEdge): number(Length)
|
||||
```
|
||||
|
||||
|
||||
@ -17,7 +17,7 @@ segEndX(@tag: tag): number(Length)
|
||||
|
||||
| Name | Type | Description | Required |
|
||||
|----------|------|-------------|----------|
|
||||
| [`tag`](/docs/kcl-std/types/std-types-tag) | [`tag`](/docs/kcl-std/types/std-types-tag) | The line segment being queried by its tag. | Yes |
|
||||
| `tag` | [`TaggedEdge`](/docs/kcl-std/types/std-types-TaggedEdge) | The line segment being queried by its tag. | Yes |
|
||||
|
||||
### Returns
|
||||
|
||||
|
@ -8,7 +8,7 @@ layout: manual
|
||||
Compute the ending point of the provided line segment along the 'y' axis.
|
||||
|
||||
```kcl
|
||||
segEndY(@tag: tag): number(Length)
|
||||
segEndY(@tag: TaggedEdge): number(Length)
|
||||
```
|
||||
|
||||
|
||||
@ -17,7 +17,7 @@ segEndY(@tag: tag): number(Length)
|
||||
|
||||
| Name | Type | Description | Required |
|
||||
|----------|------|-------------|----------|
|
||||
| [`tag`](/docs/kcl-std/types/std-types-tag) | [`tag`](/docs/kcl-std/types/std-types-tag) | The line segment being queried by its tag. | Yes |
|
||||
| `tag` | [`TaggedEdge`](/docs/kcl-std/types/std-types-TaggedEdge) | The line segment being queried by its tag. | Yes |
|
||||
|
||||
### Returns
|
||||
|
||||
|
@ -8,7 +8,7 @@ layout: manual
|
||||
Compute the length of the provided line segment.
|
||||
|
||||
```kcl
|
||||
segLen(@tag: tag): number(Length)
|
||||
segLen(@tag: TaggedEdge): number(Length)
|
||||
```
|
||||
|
||||
|
||||
@ -17,7 +17,7 @@ segLen(@tag: tag): number(Length)
|
||||
|
||||
| Name | Type | Description | Required |
|
||||
|----------|------|-------------|----------|
|
||||
| [`tag`](/docs/kcl-std/types/std-types-tag) | [`tag`](/docs/kcl-std/types/std-types-tag) | The line segment being queried by its tag. | Yes |
|
||||
| `tag` | [`TaggedEdge`](/docs/kcl-std/types/std-types-TaggedEdge) | The line segment being queried by its tag. | Yes |
|
||||
|
||||
### Returns
|
||||
|
||||
@ -30,8 +30,8 @@ segLen(@tag: tag): number(Length)
|
||||
exampleSketch = startSketchOn(XZ)
|
||||
|> startProfile(at = [0, 0])
|
||||
|> angledLine(angle = 60, length = 10, tag = $thing)
|
||||
|> tangentialArc(angle = -120, radius = 5)
|
||||
|> angledLine(angle = -60, length = segLen(thing))
|
||||
|> tangentialArc(angle = -120deg, radius = 5)
|
||||
|> angledLine(angle = -60deg, length = segLen(thing))
|
||||
|> close()
|
||||
|
||||
example = extrude(exampleSketch, length = 5)
|
||||
|
@ -8,7 +8,7 @@ layout: manual
|
||||
Compute the starting point of the provided line segment.
|
||||
|
||||
```kcl
|
||||
segStart(@tag: tag): Point2d
|
||||
segStart(@tag: TaggedEdge): Point2d
|
||||
```
|
||||
|
||||
|
||||
@ -17,7 +17,7 @@ segStart(@tag: tag): Point2d
|
||||
|
||||
| Name | Type | Description | Required |
|
||||
|----------|------|-------------|----------|
|
||||
| [`tag`](/docs/kcl-std/types/std-types-tag) | [`tag`](/docs/kcl-std/types/std-types-tag) | The line segment being queried by its tag. | Yes |
|
||||
| `tag` | [`TaggedEdge`](/docs/kcl-std/types/std-types-TaggedEdge) | The line segment being queried by its tag. | Yes |
|
||||
|
||||
### Returns
|
||||
|
||||
|
@ -8,7 +8,7 @@ layout: manual
|
||||
Compute the starting point of the provided line segment along the 'x' axis.
|
||||
|
||||
```kcl
|
||||
segStartX(@tag: tag): number(Length)
|
||||
segStartX(@tag: TaggedEdge): number(Length)
|
||||
```
|
||||
|
||||
|
||||
@ -17,7 +17,7 @@ segStartX(@tag: tag): number(Length)
|
||||
|
||||
| Name | Type | Description | Required |
|
||||
|----------|------|-------------|----------|
|
||||
| [`tag`](/docs/kcl-std/types/std-types-tag) | [`tag`](/docs/kcl-std/types/std-types-tag) | The line segment being queried by its tag. | Yes |
|
||||
| `tag` | [`TaggedEdge`](/docs/kcl-std/types/std-types-TaggedEdge) | The line segment being queried by its tag. | Yes |
|
||||
|
||||
### Returns
|
||||
|
||||
|
@ -8,7 +8,7 @@ layout: manual
|
||||
Compute the starting point of the provided line segment along the 'y' axis.
|
||||
|
||||
```kcl
|
||||
segStartY(@tag: tag): number(Length)
|
||||
segStartY(@tag: TaggedEdge): number(Length)
|
||||
```
|
||||
|
||||
|
||||
@ -17,7 +17,7 @@ segStartY(@tag: tag): number(Length)
|
||||
|
||||
| Name | Type | Description | Required |
|
||||
|----------|------|-------------|----------|
|
||||
| [`tag`](/docs/kcl-std/types/std-types-tag) | [`tag`](/docs/kcl-std/types/std-types-tag) | The line segment being queried by its tag. | Yes |
|
||||
| `tag` | [`TaggedEdge`](/docs/kcl-std/types/std-types-TaggedEdge) | The line segment being queried by its tag. | Yes |
|
||||
|
||||
### Returns
|
||||
|
||||
|
@ -11,7 +11,7 @@ Start a new profile at a given point.
|
||||
startProfile(
|
||||
@startProfileOn: Plane | Face,
|
||||
at: Point2d,
|
||||
tag?: tag,
|
||||
tag?: TagDecl,
|
||||
): Sketch
|
||||
```
|
||||
|
||||
@ -23,7 +23,7 @@ startProfile(
|
||||
|----------|------|-------------|----------|
|
||||
| `startProfileOn` | [`Plane`](/docs/kcl-std/types/std-types-Plane) or [`Face`](/docs/kcl-std/types/std-types-Face) | What to start the profile on. | Yes |
|
||||
| `at` | [`Point2d`](/docs/kcl-std/types/std-types-Point2d) | Where to start the profile. An absolute point. | Yes |
|
||||
| [`tag`](/docs/kcl-std/types/std-types-tag) | [`tag`](/docs/kcl-std/types/std-types-tag) | Tag this first starting point. | No |
|
||||
| `tag` | [`TagDecl`](/docs/kcl-std/types/std-types-TagDecl) | Tag this first starting point. | No |
|
||||
|
||||
### Returns
|
||||
|
||||
|
@ -10,7 +10,7 @@ Start a new 2-dimensional sketch on a specific plane or face.
|
||||
```kcl
|
||||
startSketchOn(
|
||||
@planeOrSolid: Solid | Plane,
|
||||
face?: tag,
|
||||
face?: TaggedFace,
|
||||
): Plane | Face
|
||||
```
|
||||
|
||||
@ -36,7 +36,7 @@ face, since it will include all the parent faces and Solids.
|
||||
| Name | Type | Description | Required |
|
||||
|----------|------|-------------|----------|
|
||||
| `planeOrSolid` | [`Solid`](/docs/kcl-std/types/std-types-Solid) or [`Plane`](/docs/kcl-std/types/std-types-Plane) | Profile whose start is being used. | Yes |
|
||||
| `face` | [`tag`](/docs/kcl-std/types/std-types-tag) | Identify a face of a solid if a solid is specified as the input argument (`planeOrSolid`). | No |
|
||||
| `face` | [`TaggedFace`](/docs/kcl-std/types/std-types-TaggedFace) | Identify a face of a solid if a solid is specified as the input argument (`planeOrSolid`). | No |
|
||||
|
||||
### Returns
|
||||
|
||||
@ -156,7 +156,7 @@ exampleSketch = startSketchOn(XY)
|
||||
|> line(end = [-2, 0])
|
||||
|> close()
|
||||
|
||||
example = revolve(exampleSketch, axis = Y, angle = 180)
|
||||
example = revolve(exampleSketch, axis = Y, angle = 180deg)
|
||||
|
||||
exampleSketch002 = startSketchOn(example, face = END)
|
||||
|> startProfile(at = [4.5, -5])
|
||||
@ -189,7 +189,7 @@ exampleSketch = startSketchOn(XY)
|
||||
example = revolve(
|
||||
exampleSketch,
|
||||
axis = Y,
|
||||
angle = 180,
|
||||
angle = 180deg,
|
||||
tagEnd = $end01,
|
||||
)
|
||||
|
||||
|
@ -14,8 +14,8 @@ sweep(
|
||||
sectional?: bool,
|
||||
tolerance?: number(Length),
|
||||
relativeTo?: string,
|
||||
tagStart?: tag,
|
||||
tagEnd?: tag,
|
||||
tagStart?: TagDecl,
|
||||
tagEnd?: TagDecl,
|
||||
): [Solid; 1+]
|
||||
```
|
||||
|
||||
@ -37,8 +37,8 @@ swept along the same path.
|
||||
| `sectional` | [`bool`](/docs/kcl-std/types/std-types-bool) | If true, the sweep will be broken up into sub-sweeps (extrusions, revolves, sweeps) based on the trajectory path components. | No |
|
||||
| `tolerance` | [`number(Length)`](/docs/kcl-std/types/std-types-number) | Tolerance for this operation. | No |
|
||||
| `relativeTo` | [`string`](/docs/kcl-std/types/std-types-string) | What is the sweep relative to? Can be either 'sketchPlane' or 'trajectoryCurve'. | No |
|
||||
| `tagStart` | [`tag`](/docs/kcl-std/types/std-types-tag) | A named tag for the face at the start of the sweep, i.e. the original sketch. | No |
|
||||
| `tagEnd` | [`tag`](/docs/kcl-std/types/std-types-tag) | A named tag for the face at the end of the sweep. | No |
|
||||
| `tagStart` | [`TagDecl`](/docs/kcl-std/types/std-types-TagDecl) | A named tag for the face at the start of the sweep, i.e. the original sketch. | No |
|
||||
| `tagEnd` | [`TagDecl`](/docs/kcl-std/types/std-types-TagDecl) | A named tag for the face at the end of the sweep. | No |
|
||||
|
||||
### Returns
|
||||
|
||||
@ -54,9 +54,9 @@ swept along the same path.
|
||||
sweepPath = startSketchOn(XZ)
|
||||
|> startProfile(at = [0.05, 0.05])
|
||||
|> line(end = [0, 7])
|
||||
|> tangentialArc(angle = 90, radius = 5)
|
||||
|> tangentialArc(angle = 90deg, radius = 5)
|
||||
|> line(end = [-3, 0])
|
||||
|> tangentialArc(angle = -90, radius = 5)
|
||||
|> tangentialArc(angle = -90deg, radius = 5)
|
||||
|> line(end = [0, 7])
|
||||
|
||||
// Create a hole for the pipe.
|
||||
@ -101,7 +101,7 @@ springSketch = startSketchOn(XZ)
|
||||
sketch001 = startSketchOn(XY)
|
||||
rectangleSketch = startProfile(sketch001, at = [-200, 23.86])
|
||||
|> angledLine(angle = 0, length = 73.47, tag = $rectangleSegmentA001)
|
||||
|> angledLine(angle = segAng(rectangleSegmentA001) - 90, length = 50.61)
|
||||
|> angledLine(angle = segAng(rectangleSegmentA001) - 90deg, length = 50.61)
|
||||
|> angledLine(angle = segAng(rectangleSegmentA001), length = -segLen(rectangleSegmentA001))
|
||||
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|
||||
|> close()
|
||||
@ -111,7 +111,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 = -90)
|
||||
|> tangentialArc(radius = 80, angle = -90deg)
|
||||
|> xLine(length = 384.93)
|
||||
|
||||
sweep([rectangleSketch, circleSketch], path = sweepPath)
|
||||
@ -130,7 +130,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 = -90)
|
||||
|> tangentialArc(radius = 80, angle = -90deg)
|
||||
|> xLine(length = 384.93)
|
||||
|
||||
sweep(circleSketch, path = sweepPath, sectional = true)
|
||||
|
@ -8,7 +8,7 @@ layout: manual
|
||||
Returns the angle coming out of the end of the segment in degrees.
|
||||
|
||||
```kcl
|
||||
tangentToEnd(@tag: tag): number(Angle)
|
||||
tangentToEnd(@tag: TaggedEdge): number(Angle)
|
||||
```
|
||||
|
||||
|
||||
@ -17,7 +17,7 @@ tangentToEnd(@tag: tag): number(Angle)
|
||||
|
||||
| Name | Type | Description | Required |
|
||||
|----------|------|-------------|----------|
|
||||
| [`tag`](/docs/kcl-std/types/std-types-tag) | [`tag`](/docs/kcl-std/types/std-types-tag) | The line segment being queried by its tag. | Yes |
|
||||
| `tag` | [`TaggedEdge`](/docs/kcl-std/types/std-types-TaggedEdge) | The line segment being queried by its tag. | Yes |
|
||||
|
||||
### Returns
|
||||
|
||||
|
@ -15,7 +15,7 @@ tangentialArc(
|
||||
radius?: number(Length),
|
||||
diameter?: number(Length),
|
||||
angle?: number(Angle),
|
||||
tag?: tag,
|
||||
tag?: TagDecl,
|
||||
): Sketch
|
||||
```
|
||||
|
||||
@ -35,7 +35,7 @@ for 'angle' degrees along the imaginary circle.
|
||||
| `radius` | [`number(Length)`](/docs/kcl-std/types/std-types-number) | Radius of the imaginary circle. `angle` must be given. Incompatible with `end` and `endAbsolute` and `diameter`. | No |
|
||||
| `diameter` | [`number(Length)`](/docs/kcl-std/types/std-types-number) | Diameter of the imaginary circle. `angle` must be given. Incompatible with `end` and `endAbsolute` and `radius`. | No |
|
||||
| `angle` | [`number(Angle)`](/docs/kcl-std/types/std-types-number) | Offset of the arc. `radius` must be given. Incompatible with `end` and `endAbsolute`. | No |
|
||||
| [`tag`](/docs/kcl-std/types/std-types-tag) | [`tag`](/docs/kcl-std/types/std-types-tag) | Create a new tag which refers to this arc. | No |
|
||||
| `tag` | [`TagDecl`](/docs/kcl-std/types/std-types-TagDecl) | Create a new tag which refers to this arc. | No |
|
||||
|
||||
### Returns
|
||||
|
||||
@ -47,7 +47,7 @@ for 'angle' degrees along the imaginary circle.
|
||||
```kcl
|
||||
exampleSketch = startSketchOn(XZ)
|
||||
|> startProfile(at = [0, 0])
|
||||
|> angledLine(angle = 45, length = 10)
|
||||
|> angledLine(angle = 45deg, length = 10)
|
||||
|> tangentialArc(end = [0, -10])
|
||||
|> line(end = [-10, 0])
|
||||
|> close()
|
||||
@ -61,7 +61,7 @@ example = extrude(exampleSketch, length = 10)
|
||||
```kcl
|
||||
exampleSketch = startSketchOn(XZ)
|
||||
|> startProfile(at = [0, 0])
|
||||
|> angledLine(angle = 60, length = 10)
|
||||
|> angledLine(angle = 60deg, length = 10)
|
||||
|> tangentialArc(endAbsolute = [15, 15])
|
||||
|> line(end = [10, -15])
|
||||
|> close()
|
||||
@ -75,9 +75,9 @@ example = extrude(exampleSketch, length = 10)
|
||||
```kcl
|
||||
exampleSketch = startSketchOn(XZ)
|
||||
|> startProfile(at = [0, 0])
|
||||
|> angledLine(angle = 60, length = 10)
|
||||
|> tangentialArc(radius = 10, angle = -120)
|
||||
|> angledLine(angle = -60, length = 10)
|
||||
|> angledLine(angle = 60deg, length = 10)
|
||||
|> tangentialArc(radius = 10, angle = -120deg)
|
||||
|> angledLine(angle = -60deg, length = 10)
|
||||
|> close()
|
||||
|
||||
example = extrude(exampleSketch, length = 10)
|
||||
|
@ -12,7 +12,7 @@ xLine(
|
||||
@sketch: Sketch,
|
||||
length?: number(Length),
|
||||
endAbsolute?: number(Length),
|
||||
tag?: tag,
|
||||
tag?: TagDecl,
|
||||
): Sketch
|
||||
```
|
||||
|
||||
@ -25,7 +25,7 @@ xLine(
|
||||
| `sketch` | [`Sketch`](/docs/kcl-std/types/std-types-Sketch) | Which sketch should this path be added to? | Yes |
|
||||
| `length` | [`number(Length)`](/docs/kcl-std/types/std-types-number) | How far away along the X axis should this line go? Incompatible with `endAbsolute`. | No |
|
||||
| `endAbsolute` | [`number(Length)`](/docs/kcl-std/types/std-types-number) | Which absolute X value should this line go to? Incompatible with `length`. | No |
|
||||
| [`tag`](/docs/kcl-std/types/std-types-tag) | [`tag`](/docs/kcl-std/types/std-types-tag) | Create a new tag which refers to this line. | No |
|
||||
| `tag` | [`TagDecl`](/docs/kcl-std/types/std-types-TagDecl) | Create a new tag which refers to this line. | No |
|
||||
|
||||
### Returns
|
||||
|
||||
@ -38,10 +38,10 @@ xLine(
|
||||
exampleSketch = startSketchOn(XZ)
|
||||
|> startProfile(at = [0, 0])
|
||||
|> xLine(length = 15)
|
||||
|> angledLine(angle = 80, length = 15)
|
||||
|> angledLine(angle = 80deg, length = 15)
|
||||
|> line(end = [8, -10])
|
||||
|> xLine(length = 10)
|
||||
|> angledLine(angle = 120, length = 30)
|
||||
|> angledLine(angle = 120deg, length = 30)
|
||||
|> xLine(length = -15)
|
||||
|> close()
|
||||
|
||||
|
@ -12,7 +12,7 @@ yLine(
|
||||
@sketch: Sketch,
|
||||
length?: number(Length),
|
||||
endAbsolute?: number(Length),
|
||||
tag?: tag,
|
||||
tag?: TagDecl,
|
||||
): Sketch
|
||||
```
|
||||
|
||||
@ -25,7 +25,7 @@ yLine(
|
||||
| `sketch` | [`Sketch`](/docs/kcl-std/types/std-types-Sketch) | Which sketch should this path be added to? | Yes |
|
||||
| `length` | [`number(Length)`](/docs/kcl-std/types/std-types-number) | How far away along the Y axis should this line go? Incompatible with `endAbsolute`. | No |
|
||||
| `endAbsolute` | [`number(Length)`](/docs/kcl-std/types/std-types-number) | Which absolute Y value should this line go to? Incompatible with `length`. | No |
|
||||
| [`tag`](/docs/kcl-std/types/std-types-tag) | [`tag`](/docs/kcl-std/types/std-types-tag) | Create a new tag which refers to this line. | No |
|
||||
| `tag` | [`TagDecl`](/docs/kcl-std/types/std-types-TagDecl) | Create a new tag which refers to this line. | No |
|
||||
|
||||
### Returns
|
||||
|
||||
@ -38,7 +38,7 @@ yLine(
|
||||
exampleSketch = startSketchOn(XZ)
|
||||
|> startProfile(at = [0, 0])
|
||||
|> yLine(length = 15)
|
||||
|> angledLine(angle = 30, length = 15)
|
||||
|> angledLine(angle = 30deg, length = 15)
|
||||
|> line(end = [8, -10])
|
||||
|> yLine(length = -5)
|
||||
|> close()
|
||||
|
@ -55,7 +55,7 @@ example = extrude(exampleSketch, length = 5)
|
||||
// Add color to a revolved solid.
|
||||
sketch001 = startSketchOn(XY)
|
||||
|> circle(center = [15, 0], radius = 5)
|
||||
|> revolve(angle = 360, axis = Y)
|
||||
|> revolve(angle = 360deg, axis = Y)
|
||||
|> appearance(color = '#ff0000', metalness = 90, roughness = 90)
|
||||
|
||||
```
|
||||
@ -196,9 +196,9 @@ example = extrude(exampleSketch, length = 1)
|
||||
sweepPath = startSketchOn(XZ)
|
||||
|> startProfile(at = [0.05, 0.05])
|
||||
|> line(end = [0, 7])
|
||||
|> tangentialArc(angle = 90, radius = 5)
|
||||
|> tangentialArc(angle = 90deg, radius = 5)
|
||||
|> line(end = [-3, 0])
|
||||
|> tangentialArc(angle = -90, radius = 5)
|
||||
|> tangentialArc(angle = -90deg, radius = 5)
|
||||
|> line(end = [0, 7])
|
||||
|
||||
pipeHole = startSketchOn(XY)
|
||||
|
@ -12,7 +12,7 @@ chamfer(
|
||||
@solid: Solid,
|
||||
length: number(Length),
|
||||
tags: [Edge; 1+],
|
||||
tag?: tag,
|
||||
tag?: TagDecl,
|
||||
): Solid
|
||||
```
|
||||
|
||||
@ -27,7 +27,7 @@ a sharp, straight transitional edge.
|
||||
| `solid` | [`Solid`](/docs/kcl-std/types/std-types-Solid) | The solid whose edges should be chamfered | Yes |
|
||||
| `length` | [`number(Length)`](/docs/kcl-std/types/std-types-number) | The length of the chamfer | Yes |
|
||||
| `tags` | [`[Edge; 1+]`](/docs/kcl-std/types/std-types-Edge) | The paths you want to chamfer | Yes |
|
||||
| [`tag`](/docs/kcl-std/types/std-types-tag) | [`tag`](/docs/kcl-std/types/std-types-tag) | Create a new tag which refers to this chamfer | No |
|
||||
| `tag` | [`TagDecl`](/docs/kcl-std/types/std-types-TagDecl) | Create a new tag which refers to this chamfer | No |
|
||||
|
||||
### Returns
|
||||
|
||||
|
@ -13,7 +13,7 @@ fillet(
|
||||
radius: number(Length),
|
||||
tags: [Edge; 1+],
|
||||
tolerance?: number(Length),
|
||||
tag?: tag,
|
||||
tag?: TagDecl,
|
||||
): Solid
|
||||
```
|
||||
|
||||
@ -29,7 +29,7 @@ will smoothly blend the transition.
|
||||
| `radius` | [`number(Length)`](/docs/kcl-std/types/std-types-number) | The radius of the fillet | Yes |
|
||||
| `tags` | [`[Edge; 1+]`](/docs/kcl-std/types/std-types-Edge) | The paths you want to fillet | Yes |
|
||||
| `tolerance` | [`number(Length)`](/docs/kcl-std/types/std-types-number) | The tolerance for this fillet | No |
|
||||
| [`tag`](/docs/kcl-std/types/std-types-tag) | [`tag`](/docs/kcl-std/types/std-types-tag) | Create a new tag which refers to this fillet | No |
|
||||
| `tag` | [`TagDecl`](/docs/kcl-std/types/std-types-TagDecl) | Create a new tag which refers to this fillet | No |
|
||||
|
||||
### Returns
|
||||
|
||||
|
@ -50,7 +50,7 @@ Its properties are:
|
||||
|
||||
- `rotation.axis` (a 3D point, defaults to the Z axis)
|
||||
|
||||
- `rotation.angle` (number of degrees)
|
||||
- `rotation.angle`
|
||||
|
||||
- `rotation.origin` (either "local" i.e. rotate around its own center, "global" i.e. rotate around the scene's center, or a 3D point, defaults to "local")
|
||||
|
||||
@ -135,7 +135,7 @@ fn transform(@i) {
|
||||
pow(0.9, exp = i)
|
||||
],
|
||||
// Turn by 15 degrees each time.
|
||||
rotation = { angle = 15 * i, origin = "local" }
|
||||
rotation = { angle = 15deg * i, origin = "local" }
|
||||
}
|
||||
}
|
||||
|
||||
@ -171,7 +171,7 @@ fn transform(@i) {
|
||||
return {
|
||||
translate = [0, 0, -i * width],
|
||||
rotation = {
|
||||
angle = 90 * i,
|
||||
angle = 90deg * i,
|
||||
// Rotate around the overall scene's origin.
|
||||
origin = "global"
|
||||
}
|
||||
@ -219,7 +219,7 @@ fn transform(@i) {
|
||||
// Transform functions can return multiple transforms. They'll be applied in order.
|
||||
return [
|
||||
{ translate = [30 * i, 0, 0] },
|
||||
{ rotation = { angle = 45 * i } }
|
||||
{ rotation = { angle = 45deg * i } }
|
||||
]
|
||||
}
|
||||
startSketchOn(XY)
|
||||
|
@ -11,7 +11,7 @@ Remove volume from a 3-dimensional shape such that a wall of the provided thickn
|
||||
shell(
|
||||
@solids: [Solid; 1+],
|
||||
thickness: number(Length),
|
||||
faces: [tag; 1+],
|
||||
faces: [TaggedFace; 1+],
|
||||
): [Solid]
|
||||
```
|
||||
|
||||
@ -23,7 +23,7 @@ shell(
|
||||
|----------|------|-------------|----------|
|
||||
| `solids` | [`[Solid; 1+]`](/docs/kcl-std/types/std-types-Solid) | Which solid (or solids) to shell out | Yes |
|
||||
| `thickness` | [`number(Length)`](/docs/kcl-std/types/std-types-number) | The thickness of the shell | Yes |
|
||||
| `faces` | [`[tag; 1+]`](/docs/kcl-std/types/std-types-tag) | The faces you want removed | Yes |
|
||||
| `faces` | [`[TaggedFace; 1+]`](/docs/kcl-std/types/std-types-TaggedFace) | The faces you want removed | Yes |
|
||||
|
||||
### Returns
|
||||
|
||||
|
@ -72,9 +72,9 @@ rotation.
|
||||
sweepPath = startSketchOn(XZ)
|
||||
|> startProfile(at = [0.05, 0.05])
|
||||
|> line(end = [0, 7])
|
||||
|> tangentialArc(angle = 90, radius = 5)
|
||||
|> tangentialArc(angle = 90deg, radius = 5)
|
||||
|> line(end = [-3, 0])
|
||||
|> tangentialArc(angle = -90, radius = 5)
|
||||
|> tangentialArc(angle = -90deg, radius = 5)
|
||||
|> line(end = [0, 7])
|
||||
|
||||
// Create a hole for the pipe.
|
||||
@ -98,9 +98,9 @@ sweepSketch = startSketchOn(XY)
|
||||
sweepPath = startSketchOn(XZ)
|
||||
|> startProfile(at = [0.05, 0.05])
|
||||
|> line(end = [0, 7])
|
||||
|> tangentialArc(angle = 90, radius = 5)
|
||||
|> tangentialArc(angle = 90deg, radius = 5)
|
||||
|> line(end = [-3, 0])
|
||||
|> tangentialArc(angle = -90, radius = 5)
|
||||
|> tangentialArc(angle = -90deg, radius = 5)
|
||||
|> line(end = [0, 7])
|
||||
|
||||
// Create a hole for the pipe.
|
||||
@ -124,9 +124,9 @@ sweepSketch = startSketchOn(XY)
|
||||
sweepPath = startSketchOn(XZ)
|
||||
|> startProfile(at = [0.05, 0.05])
|
||||
|> line(end = [0, 7])
|
||||
|> tangentialArc(angle = 90, radius = 5)
|
||||
|> tangentialArc(angle = 90deg, radius = 5)
|
||||
|> line(end = [-3, 0])
|
||||
|> tangentialArc(angle = -90, radius = 5)
|
||||
|> tangentialArc(angle = -90deg, radius = 5)
|
||||
|> line(end = [0, 7])
|
||||
|
||||
// Create a hole for the pipe.
|
||||
@ -137,7 +137,7 @@ sweepSketch = startSketchOn(XY)
|
||||
|> circle(center = [0, 0], radius = 2)
|
||||
|> subtract2d(tool = pipeHole)
|
||||
|> sweep(path = sweepPath)
|
||||
|> rotate(axis = Z, angle = 90)
|
||||
|> rotate(axis = Z, angle = 90deg)
|
||||
|
||||
```
|
||||
|
||||
@ -150,7 +150,7 @@ sweepSketch = startSketchOn(XY)
|
||||
import "tests/inputs/cube.sldprt" as cube
|
||||
|
||||
cube
|
||||
|> rotate(axis = [0, 0, 1.0], angle = 9)
|
||||
|> rotate(axis = [0, 0, 1.0], angle = 9deg)
|
||||
|
||||
```
|
||||
|
||||
@ -163,9 +163,9 @@ cube
|
||||
sweepPath = startSketchOn(XZ)
|
||||
|> startProfile(at = [0.05, 0.05])
|
||||
|> line(end = [0, 7])
|
||||
|> tangentialArc(angle = 90, radius = 5)
|
||||
|> tangentialArc(angle = 90deg, radius = 5)
|
||||
|> line(end = [-3, 0])
|
||||
|> tangentialArc(angle = -90, radius = 5)
|
||||
|> tangentialArc(angle = -90deg, radius = 5)
|
||||
|> line(end = [0, 7])
|
||||
|
||||
// Create a hole for the pipe.
|
||||
@ -176,7 +176,7 @@ sweepSketch = startSketchOn(XY)
|
||||
|> circle(center = [0, 0], radius = 2)
|
||||
|> subtract2d(tool = pipeHole)
|
||||
|> sweep(path = sweepPath)
|
||||
|> rotate(axis = [0, 0, 1.0], angle = 90)
|
||||
|> rotate(axis = [0, 0, 1.0], angle = 90deg)
|
||||
|
||||
```
|
||||
|
||||
@ -199,13 +199,13 @@ 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 = -90)
|
||||
|> tangentialArc(radius = 80, angle = -90deg)
|
||||
|> xLine(length = 384.93)
|
||||
|
||||
parts = sweep([rectangleSketch, circleSketch], path = sweepPath)
|
||||
|
||||
// Rotate the sweeps.
|
||||
rotate(parts, axis = [0, 0, 1.0], angle = 90)
|
||||
rotate(parts, axis = [0, 0, 1.0], angle = 90deg)
|
||||
|
||||
```
|
||||
|
||||
@ -228,7 +228,7 @@ profile001 = square()
|
||||
|
||||
profile002 = square()
|
||||
|> translate(x = 0, y = 0, z = 20)
|
||||
|> rotate(axis = [0, 0, 1.0], angle = 45)
|
||||
|> rotate(axis = [0, 0, 1.0], angle = 45deg)
|
||||
|
||||
loft([profile001, profile002])
|
||||
|
||||
|
@ -54,9 +54,9 @@ look like the model moves and gets bigger at the same time. Say you have a squar
|
||||
sweepPath = startSketchOn(XZ)
|
||||
|> startProfile(at = [0.05, 0.05])
|
||||
|> line(end = [0, 7])
|
||||
|> tangentialArc(angle = 90, radius = 5)
|
||||
|> tangentialArc(angle = 90deg, radius = 5)
|
||||
|> line(end = [-3, 0])
|
||||
|> tangentialArc(angle = -90, radius = 5)
|
||||
|> tangentialArc(angle = -90deg, radius = 5)
|
||||
|> line(end = [0, 7])
|
||||
|
||||
// Create a hole for the pipe.
|
||||
@ -93,7 +93,7 @@ cube
|
||||
sketch001 = startSketchOn(XY)
|
||||
rectangleSketch = startProfile(sketch001, at = [-200, 23.86])
|
||||
|> angledLine(angle = 0, length = 73.47, tag = $rectangleSegmentA001)
|
||||
|> angledLine(angle = segAng(rectangleSegmentA001) - 90, length = 50.61)
|
||||
|> angledLine(angle = segAng(rectangleSegmentA001) - 90deg, length = 50.61)
|
||||
|> angledLine(angle = segAng(rectangleSegmentA001), length = -segLen(rectangleSegmentA001))
|
||||
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|
||||
|> close()
|
||||
@ -103,7 +103,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 = -90)
|
||||
|> tangentialArc(radius = 80, angle = -90deg)
|
||||
|> xLine(length = 384.93)
|
||||
|
||||
parts = sweep([rectangleSketch, circleSketch], path = sweepPath)
|
||||
|
@ -47,9 +47,9 @@ and then rotate it using the `rotate` function to create a loft.
|
||||
sweepPath = startSketchOn(XZ)
|
||||
|> startProfile(at = [0.05, 0.05])
|
||||
|> line(end = [0, 7])
|
||||
|> tangentialArc(angle = 90, radius = 5)
|
||||
|> tangentialArc(angle = 90deg, radius = 5)
|
||||
|> line(end = [-3, 0])
|
||||
|> tangentialArc(angle = -90, radius = 5)
|
||||
|> tangentialArc(angle = -90deg, radius = 5)
|
||||
|> line(end = [0, 7])
|
||||
|
||||
// Create a hole for the pipe.
|
||||
@ -91,7 +91,7 @@ cube
|
||||
sketch001 = startSketchOn(XY)
|
||||
rectangleSketch = startProfile(sketch001, at = [-200, 23.86])
|
||||
|> angledLine(angle = 0, length = 73.47, tag = $rectangleSegmentA001)
|
||||
|> angledLine(angle = segAng(rectangleSegmentA001) - 90, length = 50.61)
|
||||
|> angledLine(angle = segAng(rectangleSegmentA001) - 90deg, length = 50.61)
|
||||
|> angledLine(angle = segAng(rectangleSegmentA001), length = -segLen(rectangleSegmentA001))
|
||||
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|
||||
|> close()
|
||||
@ -101,7 +101,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 = -90)
|
||||
|> tangentialArc(radius = 80, angle = -90deg)
|
||||
|> xLine(length = 384.93)
|
||||
|
||||
parts = sweep([rectangleSketch, circleSketch], path = sweepPath)
|
||||
@ -162,7 +162,7 @@ profile001 = square()
|
||||
|
||||
profile002 = square()
|
||||
|> translate(z = 20)
|
||||
|> rotate(axis = [0, 0, 1.0], angle = 45)
|
||||
|> rotate(axis = [0, 0, 1.0], angle = 45deg)
|
||||
|
||||
loft([profile001, profile002])
|
||||
|
||||
|
@ -29,7 +29,7 @@ units::toDegrees(@num: number(Angle)): number(deg)
|
||||
```kcl
|
||||
exampleSketch = startSketchOn(XZ)
|
||||
|> startProfile(at = [0, 0])
|
||||
|> angledLine(angle = 50, length = 70 * cos(units::toDegrees((PI / 4): number(rad))))
|
||||
|> angledLine(angle = 50deg, length = 70 * cos(units::toDegrees((PI / 4): number(rad))))
|
||||
|> yLine(endAbsolute = 0)
|
||||
|> close()
|
||||
|
||||
|
@ -29,7 +29,7 @@ units::toRadians(@num: number(Angle)): number(rad)
|
||||
```kcl
|
||||
exampleSketch = startSketchOn(XZ)
|
||||
|> startProfile(at = [0, 0])
|
||||
|> angledLine(angle = 50, length = 70 * cos(units::toRadians(45)))
|
||||
|> angledLine(angle = 50deg, length = 70 * cos(units::toRadians(45deg)))
|
||||
|> yLine(endAbsolute = 0)
|
||||
|> close()
|
||||
|
||||
|
@ -145,12 +145,12 @@ See also the [types overview](/docs/kcl-lang/types)
|
||||
|
||||
* [**Primitive types**](/docs/kcl-lang/types)
|
||||
* [`ImportedGeometry`](/docs/kcl-std/types/std-types-ImportedGeometry)
|
||||
* [`TagDecl`](/docs/kcl-std/types/std-types-TagDecl)
|
||||
* [`any`](/docs/kcl-std/types/std-types-any)
|
||||
* [`bool`](/docs/kcl-std/types/std-types-bool)
|
||||
* [`fn`](/docs/kcl-std/types/std-types-fn)
|
||||
* [`number`](/docs/kcl-std/types/std-types-number)
|
||||
* [`string`](/docs/kcl-std/types/std-types-string)
|
||||
* [`tag`](/docs/kcl-std/types/std-types-tag)
|
||||
* [**std::types**](/docs/kcl-std/modules/std-types)
|
||||
* [`Axis2d`](/docs/kcl-std/types/std-types-Axis2d)
|
||||
* [`Axis3d`](/docs/kcl-std/types/std-types-Axis3d)
|
||||
@ -162,3 +162,5 @@ See also the [types overview](/docs/kcl-lang/types)
|
||||
* [`Point3d`](/docs/kcl-std/types/std-types-Point3d)
|
||||
* [`Sketch`](/docs/kcl-std/types/std-types-Sketch)
|
||||
* [`Solid`](/docs/kcl-std/types/std-types-Solid)
|
||||
* [`TaggedEdge`](/docs/kcl-std/types/std-types-TaggedEdge)
|
||||
* [`TaggedFace`](/docs/kcl-std/types/std-types-TaggedFace)
|
||||
|
@ -24,6 +24,9 @@ Types can (optionally) be used to describe a function's arguments and returned v
|
||||
* [`Point3d`](/docs/kcl-std/types/std-types-Point3d)
|
||||
* [`Sketch`](/docs/kcl-std/types/std-types-Sketch)
|
||||
* [`Solid`](/docs/kcl-std/types/std-types-Solid)
|
||||
* [`TagDecl`](/docs/kcl-std/types/std-types-TagDecl)
|
||||
* [`TaggedEdge`](/docs/kcl-std/types/std-types-TaggedEdge)
|
||||
* [`TaggedFace`](/docs/kcl-std/types/std-types-TaggedFace)
|
||||
* [`any`](/docs/kcl-std/types/std-types-any)
|
||||
* [`bool`](/docs/kcl-std/types/std-types-bool)
|
||||
* [`fn`](/docs/kcl-std/types/std-types-fn)
|
||||
|
File diff suppressed because one or more lines are too long
102
docs/kcl-std/types/std-types-TagDecl.md
Normal file
102
docs/kcl-std/types/std-types-TagDecl.md
Normal file
@ -0,0 +1,102 @@
|
||||
---
|
||||
title: "TagDecl"
|
||||
subtitle: "Type in std::types"
|
||||
excerpt: "Tags are used to give a name (tag) to a specific path."
|
||||
layout: manual
|
||||
---
|
||||
|
||||
Tags are used to give a name (tag) to a specific path.
|
||||
|
||||
### Tag Declaration
|
||||
|
||||
The syntax for declaring a tag is `$myTag`. You would use it in the following
|
||||
way:
|
||||
|
||||
```js
|
||||
startSketchOn(XZ)
|
||||
|> startProfile(at = origin)
|
||||
|> angledLine(angle = 0, length = 191.26, tag = $rectangleSegmentA001)
|
||||
|> angledLine(
|
||||
angle = segAng(rectangleSegmentA001) - 90deg,
|
||||
length = 196.99,
|
||||
tag = $rectangleSegmentB001,
|
||||
)
|
||||
|> angledLine(
|
||||
angle = segAng(rectangleSegmentA001),
|
||||
length = -segLen(rectangleSegmentA001),
|
||||
tag = $rectangleSegmentC001,
|
||||
)
|
||||
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|
||||
|> close()
|
||||
```
|
||||
|
||||
### Tag Scope
|
||||
|
||||
Tags are scoped globally if in the root context meaning in this example you can
|
||||
use the tag `rectangleSegmentA001` in any function or expression in the file.
|
||||
|
||||
However if the code was written like this:
|
||||
|
||||
```js
|
||||
fn rect(origin) {
|
||||
return startSketchOn(XZ)
|
||||
|> startProfile(at = origin)
|
||||
|> angledLine(angle = 0, length = 191.26, tag = $rectangleSegmentA001)
|
||||
|> angledLine(
|
||||
angle = segAng(rectangleSegmentA001) - 90,
|
||||
length = 196.99,
|
||||
tag = $rectangleSegmentB001
|
||||
)
|
||||
|> angledLine(
|
||||
angle = segAng(rectangleSegmentA001),
|
||||
length = -segLen(rectangleSegmentA001),
|
||||
tag = $rectangleSegmentC001
|
||||
)
|
||||
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|
||||
|> close()
|
||||
}
|
||||
|
||||
rect(origin = [0, 0])
|
||||
rect(origin = [20, 0])
|
||||
```
|
||||
|
||||
Those tags would only be available in the `rect` function and not globally.
|
||||
|
||||
However you likely want to use those tags somewhere outside the `rect` function.
|
||||
|
||||
Tags are accessible through the sketch group they are declared in.
|
||||
For example the following code works.
|
||||
|
||||
```js
|
||||
fn rect(origin) {
|
||||
return startSketchOn(XZ)
|
||||
|> startProfile(at = origin)
|
||||
|> angledLine(angle = 0, length = 191.26, tag = $rectangleSegmentA001)
|
||||
|> angledLine(
|
||||
angle = segAng(rectangleSegmentA001) - 90deg,
|
||||
length = 196.99,
|
||||
tag = $rectangleSegmentB001,
|
||||
)
|
||||
|> angledLine(
|
||||
angle = segAng(rectangleSegmentA001),
|
||||
length = -segLen(rectangleSegmentA001),
|
||||
tag = $rectangleSegmentC001,
|
||||
)
|
||||
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|
||||
|> close()
|
||||
}
|
||||
|
||||
rect(origin = [0, 0])
|
||||
myRect = rect(origin = [20, 0])
|
||||
|
||||
myRect
|
||||
|> extrude(length = 10)
|
||||
|> fillet(radius = 0.5, tags = [myRect.tags.rectangleSegmentA001])
|
||||
```
|
||||
|
||||
See how we use the tag `rectangleSegmentA001` in the `fillet` function outside
|
||||
the `rect` function. This is because the `rect` function is returning the
|
||||
sketch group that contains the tags.
|
||||
|
||||
|
||||
|
17
docs/kcl-std/types/std-types-TaggedEdge.md
Normal file
17
docs/kcl-std/types/std-types-TaggedEdge.md
Normal file
@ -0,0 +1,17 @@
|
||||
---
|
||||
title: "TaggedEdge"
|
||||
subtitle: "Type in std::types"
|
||||
excerpt: "A tag which references a line, arc, or other edge in a sketch or an edge of a solid."
|
||||
layout: manual
|
||||
---
|
||||
|
||||
A tag which references a line, arc, or other edge in a sketch or an edge of a solid.
|
||||
|
||||
Created by using a tag declarator (see the docs for [`TagDecl`](/docs/kcl-std/types/std-types-TagDecl)). Can be used where an [`Edge`](/docs/kcl-std/types/std-types-Edge) is
|
||||
required.
|
||||
|
||||
If a line in a sketch is tagged and then the sketch is extruded, the tag is a [`TaggedEdge`](/docs/kcl-std/types/std-types-TaggedEdge) before
|
||||
extrusion and a [`TaggedFace`](/docs/kcl-std/types/std-types-TaggedFace) after extrusion.
|
||||
|
||||
|
||||
|
16
docs/kcl-std/types/std-types-TaggedFace.md
Normal file
16
docs/kcl-std/types/std-types-TaggedFace.md
Normal file
@ -0,0 +1,16 @@
|
||||
---
|
||||
title: "TaggedFace"
|
||||
subtitle: "Type in std::types"
|
||||
excerpt: "A tag which references a face of a solid, including the distinguished tags `START` and `END`."
|
||||
layout: manual
|
||||
---
|
||||
|
||||
A tag which references a face of a solid, including the distinguished tags `START` and `END`.
|
||||
|
||||
Created by using a tag declarator (see the docs for [`TagDecl`](/docs/kcl-std/types/std-types-TagDecl)).
|
||||
|
||||
If a line in a sketch is tagged and then the sketch is extruded, the tag is a [`TaggedEdge`](/docs/kcl-std/types/std-types-TaggedEdge) before
|
||||
extrusion and a [`TaggedFace`](/docs/kcl-std/types/std-types-TaggedFace) after extrusion.
|
||||
|
||||
|
||||
|
@ -1,109 +1,19 @@
|
||||
---
|
||||
title: "tag"
|
||||
subtitle: "Type in std::types"
|
||||
excerpt: "Tags are used to give a name (tag) to a specific path."
|
||||
excerpt: "Reference a previously created tag. Used much like a variable."
|
||||
layout: manual
|
||||
---
|
||||
|
||||
Tags are used to give a name (tag) to a specific path.
|
||||
**WARNING:** This type is deprecated.
|
||||
|
||||
### Tag Declaration
|
||||
Reference a previously created tag. Used much like a variable.
|
||||
|
||||
The syntax for declaring a tag is `$myTag` you would use it in the following
|
||||
way:
|
||||
|
||||
```js
|
||||
startSketchOn(XZ)
|
||||
|> startProfile(at = origin)
|
||||
|> angledLine(angle = 0, length = 191.26, tag = $rectangleSegmentA001)
|
||||
|> angledLine(
|
||||
angle = segAng(rectangleSegmentA001) - 90,
|
||||
length = 196.99,
|
||||
tag = $rectangleSegmentB001,
|
||||
)
|
||||
|> angledLine(
|
||||
angle = segAng(rectangleSegmentA001),
|
||||
length = -segLen(rectangleSegmentA001),
|
||||
tag = $rectangleSegmentC001,
|
||||
)
|
||||
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|
||||
|> close()
|
||||
```kcl
|
||||
type tag = TaggedEdge
|
||||
```
|
||||
|
||||
### Tag Identifier
|
||||
|
||||
As per the example above you can use the tag identifier to get a reference to the
|
||||
tagged object. The syntax for this is `myTag`.
|
||||
|
||||
In the example above we use the tag identifier to get the angle of the segment
|
||||
`segAng(rectangleSegmentA001)`.
|
||||
|
||||
### Tag Scope
|
||||
|
||||
Tags are scoped globally if in the root context meaning in this example you can
|
||||
use the tag `rectangleSegmentA001` in any function or expression in the file.
|
||||
|
||||
However if the code was written like this:
|
||||
|
||||
```js
|
||||
fn rect(origin) {
|
||||
return startSketchOn(XZ)
|
||||
|> startProfile(at = origin)
|
||||
|> angledLine(angle = 0, length = 191.26, tag = $rectangleSegmentA001)
|
||||
|> angledLine(
|
||||
angle = segAng(rectangleSegmentA001) - 90,
|
||||
length = 196.99,
|
||||
tag = $rectangleSegmentB001)
|
||||
|> angledLine(
|
||||
angle = segAng(rectangleSegmentA001),
|
||||
length = -segLen(rectangleSegmentA001),
|
||||
tag = $rectangleSegmentC001
|
||||
)
|
||||
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|
||||
|> close()
|
||||
}
|
||||
|
||||
rect(origin = [0, 0])
|
||||
rect(origin = [20, 0])
|
||||
```
|
||||
|
||||
Those tags would only be available in the `rect` function and not globally.
|
||||
|
||||
However you likely want to use those tags somewhere outside the `rect` function.
|
||||
|
||||
Tags are accessible through the sketch group they are declared in.
|
||||
For example the following code works.
|
||||
|
||||
```js
|
||||
fn rect(origin) {
|
||||
return startSketchOn(XZ)
|
||||
|> startProfile(at = origin)
|
||||
|> angledLine(angle = 0, length = 191.26, tag = $rectangleSegmentA001)
|
||||
|> angledLine(
|
||||
angle = segAng(rectangleSegmentA001) - 90,
|
||||
length = 196.99
|
||||
tag = $rectangleSegmentB001,
|
||||
)
|
||||
|> angledLine(
|
||||
angle = segAng(rectangleSegmentA001),
|
||||
length = -segLen(rectangleSegmentA001)
|
||||
tag = $rectangleSegmentC001,
|
||||
)
|
||||
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|
||||
|> close()
|
||||
}
|
||||
|
||||
rect(origin = [0, 0])
|
||||
myRect = rect(origin = [20, 0])
|
||||
|
||||
myRect
|
||||
|> extrude(length = 10)
|
||||
|> fillet(radius = 0.5, tags = [myRect.tags.rectangleSegmentA001])
|
||||
```
|
||||
|
||||
See how we use the tag `rectangleSegmentA001` in the `fillet` function outside
|
||||
the `rect` function. This is because the `rect` function is returning the
|
||||
sketch group that contains the tags.
|
||||
Prefer to use [`TaggedEdge`](/docs/kcl-std/types/std-types-TaggedEdge) or [`TaggedFace`](/docs/kcl-std/types/std-types-TaggedFace). For more details on tags, see the docs for [`TagDecl`](/docs/kcl-std/types/std-types-TagDecl).
|
||||
|
||||
|
||||
|
||||
|
@ -4,7 +4,6 @@ import * as fsp from 'fs/promises'
|
||||
|
||||
import { executorInputPath, getUtils } from '@e2e/playwright/test-utils'
|
||||
import { expect, test } from '@e2e/playwright/zoo-test'
|
||||
import { expectPixelColor } from '@e2e/playwright/fixtures/sceneFixture'
|
||||
|
||||
test.describe('Command bar tests', () => {
|
||||
test('Extrude from command bar selects extrude line after', async ({
|
||||
@ -302,7 +301,7 @@ test.describe('Command bar tests', () => {
|
||||
|
||||
// Assert that the an alternative variable name is chosen,
|
||||
// since the default variable name is already in use (distance)
|
||||
await page.getByRole('button', { name: 'Create new variable' }).click()
|
||||
await cmdBar.variableCheckbox.click()
|
||||
await expect(page.getByPlaceholder('Variable name')).toHaveValue(
|
||||
'length001'
|
||||
)
|
||||
@ -515,47 +514,6 @@ test.describe('Command bar tests', () => {
|
||||
})
|
||||
})
|
||||
|
||||
test(
|
||||
`Zoom to fit to shared model on web`,
|
||||
{ tag: ['@web'] },
|
||||
async ({ page, scene }) => {
|
||||
if (process.env.TARGET !== 'web') {
|
||||
// This test is web-only
|
||||
// TODO: re-enable on CI as part of a new @web test suite
|
||||
return
|
||||
}
|
||||
await test.step(`Prepare and navigate to home page with query params`, async () => {
|
||||
// a quad in the top left corner of the XZ plane (which is out of the current view)
|
||||
const code = `sketch001 = startSketchOn(XZ)
|
||||
profile001 = startProfile(sketch001, at = [-484.34, 484.95])
|
||||
|> yLine(length = -69.1)
|
||||
|> xLine(length = 66.84)
|
||||
|> yLine(length = 71.37)
|
||||
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|
||||
|> close()
|
||||
`
|
||||
const targetURL = `?create-file=true&name=test&units=mm&code=${encodeURIComponent(btoa(code))}&ask-open-desktop=true`
|
||||
await page.goto(page.url() + targetURL)
|
||||
expect(page.url()).toContain(targetURL)
|
||||
})
|
||||
|
||||
await test.step(`Submit the command`, async () => {
|
||||
await page.getByTestId('continue-to-web-app-button').click()
|
||||
|
||||
await scene.connectionEstablished()
|
||||
|
||||
// This makes SystemIOMachineActors.createKCLFile run after EngineStream/firstPlay
|
||||
await page.waitForTimeout(3000)
|
||||
|
||||
await page.getByTestId('command-bar-submit').click()
|
||||
})
|
||||
|
||||
await test.step(`Ensure we created the project and are in the modeling scene`, async () => {
|
||||
await expectPixelColor(page, [252, 252, 252], { x: 600, y: 260 }, 8)
|
||||
})
|
||||
}
|
||||
)
|
||||
|
||||
test(`Can add and edit a named parameter or constant`, async ({
|
||||
page,
|
||||
homePage,
|
||||
|
@ -281,10 +281,7 @@ test.describe('Feature Tree pane', () => {
|
||||
|
||||
await test.step('Add a named constant for distance argument and submit', async () => {
|
||||
await expect(cmdBar.currentArgumentInput).toBeVisible()
|
||||
const addVariableButton = page.getByRole('button', {
|
||||
name: 'Create new variable',
|
||||
})
|
||||
await addVariableButton.click()
|
||||
await cmdBar.variableCheckbox.click()
|
||||
await cmdBar.progressCmdBar()
|
||||
await cmdBar.expectState({
|
||||
stage: 'review',
|
||||
|
@ -172,6 +172,10 @@ export class CmdBarFixture {
|
||||
return this.page.getByTestId('cmd-bar-arg-value')
|
||||
}
|
||||
|
||||
get variableCheckbox() {
|
||||
return this.page.getByTestId('cmd-bar-variable-checkbox')
|
||||
}
|
||||
|
||||
get cmdOptions() {
|
||||
return this.page.getByTestId('cmd-bar-option')
|
||||
}
|
||||
@ -191,7 +195,7 @@ export class CmdBarFixture {
|
||||
* Clicks the Create new variable button for kcl input
|
||||
*/
|
||||
createNewVariable = async () => {
|
||||
await this.page.getByRole('button', { name: 'Create new variable' }).click()
|
||||
await this.variableCheckbox.click()
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -183,14 +183,15 @@ export class EditorFixture {
|
||||
scrollToText(text: string, placeCursor?: boolean) {
|
||||
return this.page.evaluate(
|
||||
(args: { text: string; placeCursor?: boolean }) => {
|
||||
const editorView = window.editorManager.getEditorView()
|
||||
// error TS2339: Property 'docView' does not exist on type 'EditorView'.
|
||||
// Except it does so :shrug:
|
||||
// @ts-ignore
|
||||
let index = window.editorManager._editorView?.docView.view.state.doc
|
||||
const index = editorView?.docView.view.state.doc
|
||||
.toString()
|
||||
.indexOf(args.text)
|
||||
window.editorManager._editorView?.focus()
|
||||
window.editorManager._editorView?.dispatch({
|
||||
editorView?.focus()
|
||||
editorView?.dispatch({
|
||||
selection: window.EditorSelection.create([
|
||||
window.EditorSelection.cursor(index),
|
||||
]),
|
||||
|
@ -3807,7 +3807,7 @@ sketch002 = startSketchOn(extrude001, face = rectangleSegmentA001)
|
||||
stage: 'arguments',
|
||||
})
|
||||
await page.keyboard.insertText(newAngle)
|
||||
await page.getByRole('button', { name: 'Create new variable' }).click()
|
||||
await cmdBar.variableCheckbox.click()
|
||||
await expect(page.getByPlaceholder('Variable name')).toHaveValue(
|
||||
'angle001'
|
||||
)
|
||||
|
@ -170,7 +170,7 @@ test(
|
||||
// error text on hover
|
||||
await page.hover('.cm-lint-marker-error')
|
||||
const crypticErrorText =
|
||||
'tag requires a value with type `tag`, but found string'
|
||||
'tag requires a value with type `TagDecl`, but found a value with type `string`.'
|
||||
await expect(page.getByText(crypticErrorText).first()).toBeVisible()
|
||||
|
||||
// black pixel means the scene has been cleared.
|
||||
@ -369,7 +369,7 @@ test(
|
||||
// error text on hover
|
||||
await page.hover('.cm-lint-marker-error')
|
||||
const crypticErrorText =
|
||||
'tag requires a value with type `tag`, but found string'
|
||||
'tag requires a value with type `TagDecl`, but found a value with type `string`.'
|
||||
await expect(page.getByText(crypticErrorText).first()).toBeVisible()
|
||||
|
||||
// black pixel means the scene has been cleared.
|
||||
@ -408,7 +408,7 @@ test(
|
||||
// error text on hover
|
||||
await page.hover('.cm-lint-marker-error')
|
||||
const crypticErrorText =
|
||||
'tag requires a value with type `tag`, but found string'
|
||||
'tag requires a value with type `TagDecl`, but found a value with type `string`.'
|
||||
await expect(page.getByText(crypticErrorText).first()).toBeVisible()
|
||||
}
|
||||
)
|
||||
|
@ -1,45 +1,54 @@
|
||||
import { expect, test } from '@e2e/playwright/zoo-test'
|
||||
import type { Page } from '@playwright/test'
|
||||
|
||||
async function navigateAndClickOpenInDesktopApp(
|
||||
page: Page,
|
||||
codeLength: number
|
||||
) {
|
||||
const code = Array(codeLength).fill('0').join('')
|
||||
const targetURL = `?create-file=true&browser=test&code=${code}&ask-open-desktop=true`
|
||||
expect(targetURL.length).toEqual(codeLength + 58)
|
||||
await page.goto(page.url() + targetURL)
|
||||
expect(page.url()).toContain(targetURL)
|
||||
const button = page.getByRole('button', { name: 'Open in desktop app' })
|
||||
await button.click()
|
||||
}
|
||||
|
||||
function getToastError(page: Page) {
|
||||
return page.getByText('The URL is too long to open in the desktop app')
|
||||
}
|
||||
|
||||
const isWindows =
|
||||
navigator.platform === 'Windows' || navigator.platform === 'Win32'
|
||||
test.describe('Share link tests', () => {
|
||||
;[
|
||||
{
|
||||
codeLength: 1000,
|
||||
showsErrorOnWindows: false,
|
||||
},
|
||||
{
|
||||
codeLength: 2000,
|
||||
showsErrorOnWindows: true,
|
||||
},
|
||||
].forEach(({ codeLength, showsErrorOnWindows }) => {
|
||||
test(
|
||||
`Open in desktop app with ${codeLength}-long code ${isWindows && showsErrorOnWindows ? 'shows error' : "doesn't show error"}`,
|
||||
{ tag: ['@web'] },
|
||||
async ({ page }) => {
|
||||
if (process.env.TARGET !== 'web') {
|
||||
// This test is web-only
|
||||
// TODO: re-enable on CI as part of a new @web test suite
|
||||
return
|
||||
}
|
||||
test(
|
||||
`Open in desktop app with 2000-long code works non-Windows`,
|
||||
{ tag: ['@web', '@macos', '@linux'] },
|
||||
async ({ page }) => {
|
||||
test.skip(process.platform === 'win32')
|
||||
const codeLength = 2000
|
||||
await navigateAndClickOpenInDesktopApp(page, codeLength)
|
||||
await expect(getToastError(page)).not.toBeVisible()
|
||||
}
|
||||
)
|
||||
|
||||
const code = Array(codeLength).fill('0').join('')
|
||||
const targetURL = `?create-file=true&browser=test&code=${code}&ask-open-desktop=true`
|
||||
expect(targetURL.length).toEqual(codeLength + 58)
|
||||
await page.goto(page.url() + targetURL)
|
||||
expect(page.url()).toContain(targetURL)
|
||||
const button = page.getByRole('button', { name: 'Open in desktop app' })
|
||||
await button.click()
|
||||
const toastError = page.getByText(
|
||||
'The URL is too long to open in the desktop app on Windows'
|
||||
)
|
||||
if (isWindows && showsErrorOnWindows) {
|
||||
await expect(toastError).toBeVisible()
|
||||
} else {
|
||||
await expect(toastError).not.toBeVisible()
|
||||
// TODO: check if we could verify the deep link dialog shows up
|
||||
}
|
||||
}
|
||||
)
|
||||
})
|
||||
test(
|
||||
`Open in desktop app with 1000-long code works on Windows`,
|
||||
{ tag: ['@web', '@windows'] },
|
||||
async ({ page }) => {
|
||||
test.skip(process.platform !== 'win32')
|
||||
const codeLength = 1000
|
||||
await navigateAndClickOpenInDesktopApp(page, codeLength)
|
||||
await expect(getToastError(page)).not.toBeVisible()
|
||||
}
|
||||
)
|
||||
|
||||
test(
|
||||
`Open in desktop app with 2000-long code doesn't work on Windows`,
|
||||
{ tag: ['@web', '@windows'] },
|
||||
async ({ page }) => {
|
||||
test.skip(process.platform !== 'win32')
|
||||
const codeLength = 2000
|
||||
await navigateAndClickOpenInDesktopApp(page, codeLength)
|
||||
await expect(getToastError(page)).toBeVisible()
|
||||
}
|
||||
)
|
||||
})
|
||||
|
@ -1445,6 +1445,48 @@ solid001 = subtract([extrude001], tools = [extrude002])
|
||||
await u.closeDebugPanel()
|
||||
})
|
||||
|
||||
test('Can edit a tangentialArc defined by angle and radius', async ({
|
||||
page,
|
||||
homePage,
|
||||
editor,
|
||||
toolbar,
|
||||
scene,
|
||||
cmdBar,
|
||||
}) => {
|
||||
const viewportSize = { width: 1500, height: 750 }
|
||||
await page.setBodyDimensions(viewportSize)
|
||||
|
||||
await page.addInitScript(async () => {
|
||||
localStorage.setItem(
|
||||
'persistCode',
|
||||
`@settings(defaultLengthUnit=in)
|
||||
sketch001 = startSketchOn(XZ)
|
||||
|> startProfile(at = [-10, -10])
|
||||
|> line(end = [20.0, 10.0])
|
||||
|> tangentialArc(angle = 60deg, radius=10.0)`
|
||||
)
|
||||
})
|
||||
|
||||
await homePage.goToModelingScene()
|
||||
await toolbar.waitForFeatureTreeToBeBuilt()
|
||||
await scene.settled(cmdBar)
|
||||
|
||||
await (await toolbar.getFeatureTreeOperation('Sketch', 0)).dblclick()
|
||||
|
||||
await page.waitForTimeout(1000)
|
||||
|
||||
await page.mouse.move(1200, 139)
|
||||
await page.mouse.down()
|
||||
await page.mouse.move(870, 250)
|
||||
|
||||
await page.waitForTimeout(200)
|
||||
|
||||
await editor.expectEditor.toContain(
|
||||
`tangentialArc(angle = 234.01deg, radius = 4.08)`,
|
||||
{ shouldNormalise: true }
|
||||
)
|
||||
})
|
||||
|
||||
test('Can delete a single segment line with keyboard', async ({
|
||||
page,
|
||||
scene,
|
||||
@ -3433,6 +3475,71 @@ profile003 = startProfile(sketch002, at = [-201.08, 254.17])
|
||||
).toBeVisible()
|
||||
})
|
||||
})
|
||||
test('Will exit out of sketch mode when all code is nuked', async ({
|
||||
page,
|
||||
context,
|
||||
homePage,
|
||||
scene,
|
||||
editor,
|
||||
toolbar,
|
||||
cmdBar,
|
||||
}) => {
|
||||
const initialCode = `myVar1 = 5
|
||||
myVar2 = 6
|
||||
|
||||
sketch001 = startSketchOn(XZ)
|
||||
profile001 = startProfile(sketch001, at = [106.68, 89.77])
|
||||
|> line(end = [132.34, 157.8])
|
||||
|> line(end = [67.65, -460.55], tag = $seg01)
|
||||
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|
||||
|> close()
|
||||
extrude001 = extrude(profile001, length = 500)
|
||||
sketch002 = startSketchOn(extrude001, face = seg01)
|
||||
profile002 = startProfile(sketch002, at = [83.39, 329.15])
|
||||
|> angledLine(angle = 0, length = 119.61, tag = $rectangleSegmentA001)
|
||||
|> angledLine(length = 156.54, angle = -28)
|
||||
|> angledLine(
|
||||
angle = -151,
|
||||
length = 116.27,
|
||||
)
|
||||
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|
||||
|> close()
|
||||
profile003 = startProfile(sketch002, at = [-201.08, 254.17])
|
||||
|> line(end = [103.55, 33.32])
|
||||
|> line(end = [48.8, -153.54])`
|
||||
|
||||
await context.addInitScript((initialCode) => {
|
||||
localStorage.setItem('persistCode', initialCode)
|
||||
}, initialCode)
|
||||
|
||||
await homePage.goToModelingScene()
|
||||
await scene.connectionEstablished()
|
||||
await scene.settled(cmdBar)
|
||||
const expectSketchOriginToBeDrawn = async () => {
|
||||
await scene.expectPixelColor(TEST_COLORS.WHITE, { x: 672, y: 193 }, 15)
|
||||
}
|
||||
|
||||
await test.step('Open feature tree and edit second sketch', async () => {
|
||||
await toolbar.openFeatureTreePane()
|
||||
const sketchButton = await toolbar.getFeatureTreeOperation('Sketch', 1)
|
||||
await sketchButton.dblclick()
|
||||
await page.waitForTimeout(700) // Wait for engine animation
|
||||
await expectSketchOriginToBeDrawn()
|
||||
})
|
||||
|
||||
await test.step('clear editor content while in sketch mode', async () => {
|
||||
await editor.replaceCode('', '')
|
||||
await page.waitForTimeout(100)
|
||||
await expect(
|
||||
page.getByText('Unable to maintain sketch mode')
|
||||
).toBeVisible()
|
||||
await scene.expectPixelColorNotToBe(
|
||||
TEST_COLORS.WHITE,
|
||||
{ x: 672, y: 193 },
|
||||
15
|
||||
)
|
||||
})
|
||||
})
|
||||
test('empty draft sketch is cleaned up properly', async ({
|
||||
scene,
|
||||
toolbar,
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user