Compare commits
113 Commits
derive-doc
...
pierremtb/
Author | SHA1 | Date | |
---|---|---|---|
6c78dbd4c8 | |||
059593372a | |||
1ba8c5af00 | |||
410b4e81eb | |||
30275d86cc | |||
39c40b2cde | |||
907102a8fa | |||
353eca110e | |||
fb56820811 | |||
fb37bb83a8 | |||
f90811695d | |||
5c1dfe0c8e | |||
f06873a0e2 | |||
09025179f9 | |||
521a593451 | |||
87c4e6c74e | |||
82cd106898 | |||
e14cc4ace3 | |||
2a2a31d0ef | |||
f2669223c5 | |||
c3bc1fad6d | |||
96ff1dd55b | |||
82bd04631a | |||
abec2d6d66 | |||
6089b1932a | |||
074fd2b5c7 | |||
b2485b804c | |||
e753082653 | |||
634745bb81 | |||
e3660c75fc | |||
ef61d10615 | |||
c208e16c76 | |||
585ca7e80f | |||
f7bae1d221 | |||
339de00e68 | |||
4f02e45da3 | |||
1908383f0e | |||
68204bb23d | |||
5438a987ab | |||
fa3f934948 | |||
08e714080e | |||
df01c233e4 | |||
b30a37a0b3 | |||
82aefec34d | |||
679b65f643 | |||
d64270d494 | |||
c06b2b4029 | |||
8b8a2bc4e2 | |||
af702ae1b2 | |||
83e72dafa3 | |||
e417e60053 | |||
ebc6b6460d | |||
91f0cfe467 | |||
a2ff0aeceb | |||
f05acf92cc | |||
670faac1e8 | |||
ca09224c92 | |||
5cbd11cec8 | |||
28eb99f655 | |||
c29be6e341 | |||
2193d563c5 | |||
570d159c29 | |||
713886b274 | |||
2aa4a01cb7 | |||
2048c26b9f | |||
cbb8df5904 | |||
bb67a9e9cf | |||
b84d5951b7 | |||
1e5954e5ed | |||
d58a147b7d | |||
96b06247a4 | |||
36d49b1bcb | |||
4748c2d1e0 | |||
698ce671df | |||
a2330a0dbc | |||
c882e34ea9 | |||
1ce3d8ccd0 | |||
15bedd56f4 | |||
746ebf80d1 | |||
02b249bd31 | |||
524fcb03ad | |||
3a9e0c72a8 | |||
5dc983ad7b | |||
81411033d7 | |||
30a24c8ae6 | |||
403cee5f16 | |||
14eeafb70a | |||
f4ecd16ffa | |||
48380be480 | |||
80e32b337f | |||
9378d9862b | |||
1f515b712b | |||
372f2eebcc | |||
e22a9edde8 | |||
75e3f843eb | |||
f0136a5939 | |||
3d2e48732c | |||
7545b61b49 | |||
d1be6d7b64 | |||
8ab24ceee7 | |||
f163870b86 | |||
3fc707a2a4 | |||
238163d7db | |||
bfccb79c1c | |||
fe6d1f8119 | |||
f496d94258 | |||
5d8f3f988a | |||
4f06524776 | |||
d7fe827a9e | |||
049e487ac4 | |||
5bd89047b2 | |||
5822321f35 | |||
401dcf8152 |
@ -2,8 +2,8 @@ NODE_ENV=development
|
|||||||
DEV=true
|
DEV=true
|
||||||
VITE_KC_API_WS_MODELING_URL=wss://api.dev.zoo.dev/ws/modeling/commands
|
VITE_KC_API_WS_MODELING_URL=wss://api.dev.zoo.dev/ws/modeling/commands
|
||||||
VITE_KC_API_BASE_URL=https://api.dev.zoo.dev
|
VITE_KC_API_BASE_URL=https://api.dev.zoo.dev
|
||||||
|
BASE_URL=https://api.dev.zoo.dev
|
||||||
VITE_KC_SITE_BASE_URL=https://dev.zoo.dev
|
VITE_KC_SITE_BASE_URL=https://dev.zoo.dev
|
||||||
VITE_KC_SITE_APP_URL=https://app.dev.zoo.dev
|
|
||||||
VITE_KC_SKIP_AUTH=false
|
VITE_KC_SKIP_AUTH=false
|
||||||
VITE_KC_CONNECTION_TIMEOUT_MS=5000
|
VITE_KC_CONNECTION_TIMEOUT_MS=5000
|
||||||
# ONLY add your token in .env.development.local if you want to skip auth, otherwise this token takes precedence!
|
# ONLY add your token in .env.development.local if you want to skip auth, otherwise this token takes precedence!
|
||||||
|
@ -1,7 +1,5 @@
|
|||||||
NODE_ENV=production
|
|
||||||
VITE_KC_API_WS_MODELING_URL=wss://api.zoo.dev/ws/modeling/commands
|
VITE_KC_API_WS_MODELING_URL=wss://api.zoo.dev/ws/modeling/commands
|
||||||
VITE_KC_API_BASE_URL=https://api.zoo.dev
|
VITE_KC_API_BASE_URL=https://api.zoo.dev
|
||||||
VITE_KC_SITE_BASE_URL=https://zoo.dev
|
VITE_KC_SITE_BASE_URL=https://zoo.dev
|
||||||
VITE_KC_SITE_APP_URL=https://app.zoo.dev
|
|
||||||
VITE_KC_SKIP_AUTH=false
|
VITE_KC_SKIP_AUTH=false
|
||||||
VITE_KC_CONNECTION_TIMEOUT_MS=15000
|
VITE_KC_CONNECTION_TIMEOUT_MS=15000
|
||||||
|
@ -29,13 +29,6 @@
|
|||||||
{
|
{
|
||||||
"name": "isNaN",
|
"name": "isNaN",
|
||||||
"message": "Use Number.isNaN() instead."
|
"message": "Use Number.isNaN() instead."
|
||||||
},
|
|
||||||
],
|
|
||||||
"no-restricted-syntax": [
|
|
||||||
"error",
|
|
||||||
{
|
|
||||||
"selector": "CallExpression[callee.object.name='Array'][callee.property.name='isArray']",
|
|
||||||
"message": "Use isArray() in lib/utils.ts instead of Array.isArray()."
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"semi": [
|
"semi": [
|
||||||
|
17
.github/workflows/build-apps.yml
vendored
17
.github/workflows/build-apps.yml
vendored
@ -5,6 +5,7 @@ on:
|
|||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
|
- pierremtb/4088/create-file-url
|
||||||
tags:
|
tags:
|
||||||
- 'v[0-9]+.[0-9]+.[0-9]+'
|
- 'v[0-9]+.[0-9]+.[0-9]+'
|
||||||
schedule:
|
schedule:
|
||||||
@ -134,6 +135,8 @@ jobs:
|
|||||||
max_attempts: 3
|
max_attempts: 3
|
||||||
command: yarn install
|
command: yarn install
|
||||||
|
|
||||||
|
- run: yarn tronb:vite
|
||||||
|
|
||||||
- name: Prepare certificate and variables (Windows only)
|
- 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_NIGHTLY == 'true') && matrix.os == 'windows-2022' }}
|
||||||
run: |
|
run: |
|
||||||
@ -163,8 +166,8 @@ jobs:
|
|||||||
- name: Build the app (debug)
|
- name: Build the app (debug)
|
||||||
if: ${{ env.IS_RELEASE == 'false' && env.IS_NIGHTLY == 'false' }}
|
if: ${{ env.IS_RELEASE == 'false' && env.IS_NIGHTLY == 'false' }}
|
||||||
# electron-builder doesn't have a concept of release vs debug,
|
# 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
|
# this is just not doing any codesign or release yml generation
|
||||||
run: yarn tronb:package:dev
|
run: yarn electron-builder --config
|
||||||
|
|
||||||
- name: Build the app (release)
|
- name: Build the app (release)
|
||||||
if: ${{ env.IS_RELEASE == 'true' || env.IS_NIGHTLY == 'true' }}
|
if: ${{ env.IS_RELEASE == 'true' || env.IS_NIGHTLY == 'true' }}
|
||||||
@ -183,7 +186,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
timeout_minutes: 10
|
timeout_minutes: 10
|
||||||
max_attempts: 3
|
max_attempts: 3
|
||||||
command: yarn tronb:package:prod
|
command: yarn electron-builder --config --publish always
|
||||||
|
|
||||||
- name: List artifacts in out/
|
- name: List artifacts in out/
|
||||||
run: ls -R out
|
run: ls -R out
|
||||||
@ -244,7 +247,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
timeout_minutes: 10
|
timeout_minutes: 10
|
||||||
max_attempts: 3
|
max_attempts: 3
|
||||||
command: yarn tronb:package:prod
|
command: yarn electron-builder --config --publish always
|
||||||
|
|
||||||
- uses: actions/upload-artifact@v4
|
- uses: actions/upload-artifact@v4
|
||||||
if: ${{ env.IS_RELEASE == 'true' }}
|
if: ${{ env.IS_RELEASE == 'true' }}
|
||||||
@ -388,19 +391,19 @@ jobs:
|
|||||||
|
|
||||||
- name: Authenticate to Google Cloud
|
- name: Authenticate to Google Cloud
|
||||||
if: ${{ env.IS_NIGHTLY == 'true' }}
|
if: ${{ env.IS_NIGHTLY == 'true' }}
|
||||||
uses: 'google-github-actions/auth@v2.1.8'
|
uses: 'google-github-actions/auth@v2.1.7'
|
||||||
with:
|
with:
|
||||||
credentials_json: '${{ secrets.GOOGLE_CLOUD_DL_SA }}'
|
credentials_json: '${{ secrets.GOOGLE_CLOUD_DL_SA }}'
|
||||||
|
|
||||||
- name: Set up Google Cloud SDK
|
- name: Set up Google Cloud SDK
|
||||||
if: ${{ env.IS_NIGHTLY == 'true' }}
|
if: ${{ env.IS_NIGHTLY == 'true' }}
|
||||||
uses: google-github-actions/setup-gcloud@v2.1.4
|
uses: google-github-actions/setup-gcloud@v2.1.2
|
||||||
with:
|
with:
|
||||||
project_id: ${{ env.GOOGLE_CLOUD_PROJECT_ID }}
|
project_id: ${{ env.GOOGLE_CLOUD_PROJECT_ID }}
|
||||||
|
|
||||||
- name: Upload nightly files to public bucket
|
- name: Upload nightly files to public bucket
|
||||||
if: ${{ env.IS_NIGHTLY == 'true' }}
|
if: ${{ env.IS_NIGHTLY == 'true' }}
|
||||||
uses: google-github-actions/upload-cloud-storage@v2.2.2
|
uses: google-github-actions/upload-cloud-storage@v2.2.1
|
||||||
with:
|
with:
|
||||||
path: out
|
path: out
|
||||||
glob: '*'
|
glob: '*'
|
||||||
|
21
.github/workflows/e2e-tests.yml
vendored
21
.github/workflows/e2e-tests.yml
vendored
@ -3,6 +3,7 @@ on:
|
|||||||
push:
|
push:
|
||||||
branches: [ main ]
|
branches: [ main ]
|
||||||
pull_request:
|
pull_request:
|
||||||
|
branches: [ main ]
|
||||||
|
|
||||||
concurrency:
|
concurrency:
|
||||||
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
|
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
|
||||||
@ -45,15 +46,7 @@ jobs:
|
|||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
needs: check-rust-changes
|
needs: check-rust-changes
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/create-github-app-token@v1
|
|
||||||
id: app-token
|
|
||||||
with:
|
|
||||||
app-id: ${{ secrets.MODELING_APP_GH_APP_ID }}
|
|
||||||
private-key: ${{ secrets.MODELING_APP_GH_APP_PRIVATE_KEY }}
|
|
||||||
owner: ${{ github.repository_owner }}
|
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
with:
|
|
||||||
token: ${{ steps.app-token.outputs.token }}
|
|
||||||
- uses: actions/setup-node@v4
|
- uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version-file: '.nvmrc'
|
node-version-file: '.nvmrc'
|
||||||
@ -130,9 +123,9 @@ jobs:
|
|||||||
if: steps.download-wasm.outcome == 'failure'
|
if: steps.download-wasm.outcome == 'failure'
|
||||||
shell: bash
|
shell: bash
|
||||||
run: yarn build:wasm
|
run: yarn build:wasm
|
||||||
- name: build web
|
- name: build electron
|
||||||
shell: bash
|
shell: bash
|
||||||
run: yarn tronb:vite:dev
|
run: yarn tron:package
|
||||||
- name: Run ubuntu/chrome snapshots
|
- name: Run ubuntu/chrome snapshots
|
||||||
if: ${{ matrix.os == 'namespace-profile-ubuntu-8-cores' && matrix.shardIndex == 1 }}
|
if: ${{ matrix.os == 'namespace-profile-ubuntu-8-cores' && matrix.shardIndex == 1 }}
|
||||||
shell: bash
|
shell: bash
|
||||||
@ -160,11 +153,11 @@ jobs:
|
|||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
run: rm -r test-results
|
run: rm -r test-results
|
||||||
- name: check for changes
|
- name: check for changes
|
||||||
if: ${{ matrix.os == 'namespace-profile-ubuntu-8-cores' && matrix.shardIndex == 1 && github.ref != 'refs/heads/main' }}
|
if: ${{ matrix.os == 'namespace-profile-ubuntu-8-cores' && matrix.shardIndex == 1 }}
|
||||||
shell: bash
|
shell: bash
|
||||||
id: git-check
|
id: git-check
|
||||||
run: |
|
run: |
|
||||||
git add e2e/playwright/snapshot-tests.spec.ts-snapshots
|
git add .
|
||||||
if git status | grep -q "Changes to be committed"
|
if git status | grep -q "Changes to be committed"
|
||||||
then echo "modified=true" >> $GITHUB_OUTPUT
|
then echo "modified=true" >> $GITHUB_OUTPUT
|
||||||
else echo "modified=false" >> $GITHUB_OUTPUT
|
else echo "modified=false" >> $GITHUB_OUTPUT
|
||||||
@ -173,14 +166,14 @@ jobs:
|
|||||||
if: steps.git-check.outputs.modified == 'true'
|
if: steps.git-check.outputs.modified == 'true'
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
git add e2e/playwright/snapshot-tests.spec.ts-snapshots
|
git add .
|
||||||
git config --local user.email "github-actions[bot]@users.noreply.github.com"
|
git config --local user.email "github-actions[bot]@users.noreply.github.com"
|
||||||
git config --local user.name "github-actions[bot]"
|
git config --local user.name "github-actions[bot]"
|
||||||
git remote set-url origin https://${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git
|
git remote set-url origin https://${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git
|
||||||
git fetch origin
|
git fetch origin
|
||||||
echo ${{ github.head_ref }}
|
echo ${{ github.head_ref }}
|
||||||
git checkout ${{ github.head_ref }}
|
git checkout ${{ github.head_ref }}
|
||||||
git commit -m "A snapshot a day keeps the bugs away! 📷🐛 (OS: ${{matrix.os}})" || true
|
git commit -am "A snapshot a day keeps the bugs away! 📷🐛 (OS: ${{matrix.os}})" || true
|
||||||
git push
|
git push
|
||||||
git push origin ${{ github.head_ref }}
|
git push origin ${{ github.head_ref }}
|
||||||
# only upload artifacts if there's actually changes
|
# only upload artifacts if there's actually changes
|
||||||
|
6
.github/workflows/publish-apps-release.yml
vendored
6
.github/workflows/publish-apps-release.yml
vendored
@ -108,17 +108,17 @@ jobs:
|
|||||||
run: yarn files:set-notes
|
run: yarn files:set-notes
|
||||||
|
|
||||||
- name: Authenticate to Google Cloud
|
- name: Authenticate to Google Cloud
|
||||||
uses: 'google-github-actions/auth@v2.1.8'
|
uses: 'google-github-actions/auth@v2.1.7'
|
||||||
with:
|
with:
|
||||||
credentials_json: '${{ secrets.GOOGLE_CLOUD_DL_SA }}'
|
credentials_json: '${{ secrets.GOOGLE_CLOUD_DL_SA }}'
|
||||||
|
|
||||||
- name: Set up Google Cloud SDK
|
- name: Set up Google Cloud SDK
|
||||||
uses: google-github-actions/setup-gcloud@v2.1.4
|
uses: google-github-actions/setup-gcloud@v2.1.2
|
||||||
with:
|
with:
|
||||||
project_id: ${{ env.GOOGLE_CLOUD_PROJECT_ID }}
|
project_id: ${{ env.GOOGLE_CLOUD_PROJECT_ID }}
|
||||||
|
|
||||||
- name: Upload release files to public bucket
|
- name: Upload release files to public bucket
|
||||||
uses: google-github-actions/upload-cloud-storage@v2.2.2
|
uses: google-github-actions/upload-cloud-storage@v2.2.1
|
||||||
with:
|
with:
|
||||||
path: out
|
path: out
|
||||||
glob: '*'
|
glob: '*'
|
||||||
|
3
.gitignore
vendored
3
.gitignore
vendored
@ -25,7 +25,6 @@ yarn-error.log*
|
|||||||
|
|
||||||
.idea
|
.idea
|
||||||
.vscode
|
.vscode
|
||||||
.helix
|
|
||||||
src/wasm-lib/.idea
|
src/wasm-lib/.idea
|
||||||
src/wasm-lib/.vscode
|
src/wasm-lib/.vscode
|
||||||
|
|
||||||
@ -45,7 +44,7 @@ e2e/playwright/temp3.png
|
|||||||
e2e/playwright/export-snapshots/*
|
e2e/playwright/export-snapshots/*
|
||||||
!e2e/playwright/export-snapshots/*.png
|
!e2e/playwright/export-snapshots/*.png
|
||||||
|
|
||||||
/kcl-samples
|
|
||||||
/test-results/
|
/test-results/
|
||||||
/playwright-report/
|
/playwright-report/
|
||||||
/blob-report/
|
/blob-report/
|
||||||
|
@ -1,2 +0,0 @@
|
|||||||
[editor]
|
|
||||||
auto-format = true
|
|
@ -1,10 +0,0 @@
|
|||||||
[language-server.eslint]
|
|
||||||
args = ["--stdio"]
|
|
||||||
command = "vscode-eslint-language-server"
|
|
||||||
|
|
||||||
[[language]]
|
|
||||||
name = "typescript"
|
|
||||||
auto-format = true
|
|
||||||
formatter = { command = "node_modules/.bin/prettier", args = ["--parser", "typescript"] }
|
|
||||||
language-servers = [ { name = "eslint", only-features = [ "diagnostics" ] }, "typescript-language-server" ]
|
|
||||||
|
|
@ -101,7 +101,7 @@ This will start the application and hot-reload on changes.
|
|||||||
|
|
||||||
Devtools can be opened with the usual Cmd-Opt-I (Mac) or Ctrl-Shift-I (Linux and Windows).
|
Devtools can be opened with the usual Cmd-Opt-I (Mac) or Ctrl-Shift-I (Linux and Windows).
|
||||||
|
|
||||||
To build with electron-builder, run `yarn tronb:package:dev` (or `yarn tronb:package:prod` to point to the .env.production variables)
|
To build, run `yarn tron:package`.
|
||||||
|
|
||||||
## Checking out commits / Bisecting
|
## Checking out commits / Bisecting
|
||||||
|
|
||||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -36,12 +36,12 @@ filletRadius = 2
|
|||||||
|
|
||||||
mountingPlateSketch = startSketchOn("XY")
|
mountingPlateSketch = startSketchOn("XY")
|
||||||
|> startProfileAt([-width / 2, -length / 2], %)
|
|> startProfileAt([-width / 2, -length / 2], %)
|
||||||
|> line(endAbsolute = [width / 2, -length / 2], tag = $edge1)
|
|> lineTo([width / 2, -length / 2], %, $edge1)
|
||||||
|> line(endAbsolute = [width / 2, length / 2], tag = $edge2)
|
|> lineTo([width / 2, length / 2], %, $edge2)
|
||||||
|> line(endAbsolute = [-width / 2, length / 2], tag = $edge3)
|
|> lineTo([-width / 2, length / 2], %, $edge3)
|
||||||
|> close(tag = $edge4)
|
|> close(%, $edge4)
|
||||||
|
|
||||||
mountingPlate = extrude(mountingPlateSketch, length = thickness)
|
mountingPlate = extrude(thickness, mountingPlateSketch)
|
||||||
|> fillet({
|
|> fillet({
|
||||||
radius = filletRadius,
|
radius = filletRadius,
|
||||||
tags = [
|
tags = [
|
||||||
@ -63,12 +63,12 @@ filletRadius = 1
|
|||||||
|
|
||||||
mountingPlateSketch = startSketchOn("XY")
|
mountingPlateSketch = startSketchOn("XY")
|
||||||
|> startProfileAt([-width / 2, -length / 2], %)
|
|> startProfileAt([-width / 2, -length / 2], %)
|
||||||
|> line(endAbsolute = [width / 2, -length / 2], tag = $edge1)
|
|> lineTo([width / 2, -length / 2], %, $edge1)
|
||||||
|> line(endAbsolute = [width / 2, length / 2], tag = $edge2)
|
|> lineTo([width / 2, length / 2], %, $edge2)
|
||||||
|> line(endAbsolute = [-width / 2, length / 2], tag = $edge3)
|
|> lineTo([-width / 2, length / 2], %, $edge3)
|
||||||
|> close(tag = $edge4)
|
|> close(%, $edge4)
|
||||||
|
|
||||||
mountingPlate = extrude(mountingPlateSketch, length = thickness)
|
mountingPlate = extrude(thickness, mountingPlateSketch)
|
||||||
|> fillet({
|
|> fillet({
|
||||||
radius = filletRadius,
|
radius = filletRadius,
|
||||||
tolerance = 0.000001,
|
tolerance = 0.000001,
|
||||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -4,16 +4,14 @@ excerpt: "Import a CAD file."
|
|||||||
layout: manual
|
layout: manual
|
||||||
---
|
---
|
||||||
|
|
||||||
**WARNING:** This function is deprecated.
|
|
||||||
|
|
||||||
Import a CAD file.
|
Import a CAD file.
|
||||||
|
|
||||||
**DEPRECATED** Prefer to use import statements.
|
|
||||||
|
|
||||||
For formats lacking unit data (such as STL, OBJ, or PLY files), the default unit of measurement is millimeters. Alternatively you may specify the unit by passing your desired measurement unit in the options parameter. When importing a GLTF file, the bin file will be imported as well. Import paths are relative to the current project directory.
|
For formats lacking unit data (such as STL, OBJ, or PLY files), the default unit of measurement is millimeters. Alternatively you may specify the unit by passing your desired measurement unit in the options parameter. When importing a GLTF file, the bin file will be imported as well. Import paths are relative to the current project directory.
|
||||||
|
|
||||||
Note: The import command currently only works when using the native Modeling App.
|
Note: The import command currently only works when using the native Modeling App.
|
||||||
|
|
||||||
|
For importing KCL functions using the `import` statement, see the docs on [KCL modules](/docs/kcl/modules).
|
||||||
|
|
||||||
```js
|
```js
|
||||||
import(file_path: String, options?: ImportFormat) -> ImportedGeometry
|
import(file_path: String, options?: ImportFormat) -> ImportedGeometry
|
||||||
```
|
```
|
||||||
|
@ -51,6 +51,7 @@ layout: manual
|
|||||||
* [`helixRevolutions`](kcl/helixRevolutions)
|
* [`helixRevolutions`](kcl/helixRevolutions)
|
||||||
* [`hole`](kcl/hole)
|
* [`hole`](kcl/hole)
|
||||||
* [`hollow`](kcl/hollow)
|
* [`hollow`](kcl/hollow)
|
||||||
|
* [`import`](kcl/import)
|
||||||
* [`inch`](kcl/inch)
|
* [`inch`](kcl/inch)
|
||||||
* [`lastSegX`](kcl/lastSegX)
|
* [`lastSegX`](kcl/lastSegX)
|
||||||
* [`lastSegY`](kcl/lastSegY)
|
* [`lastSegY`](kcl/lastSegY)
|
||||||
@ -58,6 +59,7 @@ layout: manual
|
|||||||
* [`legAngY`](kcl/legAngY)
|
* [`legAngY`](kcl/legAngY)
|
||||||
* [`legLen`](kcl/legLen)
|
* [`legLen`](kcl/legLen)
|
||||||
* [`line`](kcl/line)
|
* [`line`](kcl/line)
|
||||||
|
* [`lineTo`](kcl/lineTo)
|
||||||
* [`ln`](kcl/ln)
|
* [`ln`](kcl/ln)
|
||||||
* [`loft`](kcl/loft)
|
* [`loft`](kcl/loft)
|
||||||
* [`log`](kcl/log)
|
* [`log`](kcl/log)
|
||||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
44
docs/kcl/lineTo.md
Normal file
44
docs/kcl/lineTo.md
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -9,7 +9,7 @@ Just like patternTransform, but works on 2D sketches not 3D solids.
|
|||||||
|
|
||||||
|
|
||||||
```js
|
```js
|
||||||
patternTransform2d(total_instances: integer, transform_function: FunctionParam, solid_set: SketchSet, use_original?: bool) -> [Sketch]
|
patternTransform2d(total_instances: integer, transform_function: FunctionParam, solid_set: SketchSet) -> [Sketch]
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -20,7 +20,6 @@ patternTransform2d(total_instances: integer, transform_function: FunctionParam,
|
|||||||
| `total_instances` | `integer` | | Yes |
|
| `total_instances` | `integer` | | Yes |
|
||||||
| `transform_function` | `FunctionParam` | | Yes |
|
| `transform_function` | `FunctionParam` | | Yes |
|
||||||
| `solid_set` | [`SketchSet`](/docs/kcl/types/SketchSet) | A sketch or a group of sketches. | Yes |
|
| `solid_set` | [`SketchSet`](/docs/kcl/types/SketchSet) | A sketch or a group of sketches. | Yes |
|
||||||
| `use_original` | `bool` | | No |
|
|
||||||
|
|
||||||
### Returns
|
### Returns
|
||||||
|
|
||||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
41308
docs/kcl/std.json
41308
docs/kcl/std.json
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -47,19 +47,6 @@ myObj = { a = 0, b = "thing" }
|
|||||||
We support two different ways of getting properties from objects, you can call
|
We support two different ways of getting properties from objects, you can call
|
||||||
`myObj.a` or `myObj["a"]` both work.
|
`myObj.a` or `myObj["a"]` both work.
|
||||||
|
|
||||||
## Binary expressions
|
|
||||||
|
|
||||||
You can also do math! Let's show an example below:
|
|
||||||
|
|
||||||
```
|
|
||||||
myMathExpression = 3 + 1 * 2 / 3 - 7
|
|
||||||
```
|
|
||||||
|
|
||||||
You can nest expressions in parenthesis as well:
|
|
||||||
|
|
||||||
```
|
|
||||||
myMathExpression = 3 + (1 * 2 / (3 - 7))
|
|
||||||
```
|
|
||||||
|
|
||||||
## Functions
|
## Functions
|
||||||
|
|
||||||
@ -74,107 +61,21 @@ fn myFn(x) {
|
|||||||
|
|
||||||
As you can see above `myFn` just returns whatever it is given.
|
As you can see above `myFn` just returns whatever it is given.
|
||||||
|
|
||||||
KCL's early drafts used positional arguments, but we now use keyword arguments. If you declare a
|
|
||||||
function like this:
|
## Binary expressions
|
||||||
|
|
||||||
|
You can also do math! Let's show an example below:
|
||||||
|
|
||||||
```
|
```
|
||||||
fn add(left, right) {
|
myMathExpression = 3 + 1 * 2 / 3 - 7
|
||||||
return left + right
|
|
||||||
}
|
|
||||||
```
|
```
|
||||||
|
|
||||||
You can call it like this:
|
You can nest expressions in parenthesis as well:
|
||||||
|
|
||||||
```
|
```
|
||||||
total = add(left = 1, right = 2)
|
myMathExpression = 3 + (1 * 2 / (3 - 7))
|
||||||
```
|
```
|
||||||
|
|
||||||
Functions can also declare one *unlabeled* arg. If you do want to declare an unlabeled arg, it must
|
|
||||||
be the first arg declared.
|
|
||||||
|
|
||||||
```
|
|
||||||
// The @ indicates an argument can be used without a label.
|
|
||||||
// Note that only the first argument can use @.
|
|
||||||
fn increment(@x) {
|
|
||||||
return x + 1
|
|
||||||
}
|
|
||||||
|
|
||||||
fn add(@x, delta) {
|
|
||||||
return x + delta
|
|
||||||
}
|
|
||||||
|
|
||||||
two = increment(1)
|
|
||||||
three = add(1, delta = 2)
|
|
||||||
```
|
|
||||||
|
|
||||||
## Pipelines
|
|
||||||
|
|
||||||
It can be hard to read repeated function calls, because of all the nested brackets.
|
|
||||||
|
|
||||||
```
|
|
||||||
i = 1
|
|
||||||
x = h(g(f(i)))
|
|
||||||
```
|
|
||||||
|
|
||||||
You can make this easier to read by breaking it into many declarations, but that is a bit annoying.
|
|
||||||
|
|
||||||
```
|
|
||||||
i = 1
|
|
||||||
x0 = f(i)
|
|
||||||
x1 = g(x0)
|
|
||||||
x = h(x1)
|
|
||||||
```
|
|
||||||
|
|
||||||
Instead, you can use the pipeline operator (`|>`) to simplify this.
|
|
||||||
|
|
||||||
Basically, `x |> f(%)` is a shorthand for `f(x)`. The left-hand side of the `|>` gets put into
|
|
||||||
the `%` in the right-hand side.
|
|
||||||
|
|
||||||
So, this means `x |> f(%) |> g(%)` is shorthand for `g(f(x))`. The code example above, with its
|
|
||||||
somewhat-clunky `x0` and `x1` constants could be rewritten as
|
|
||||||
|
|
||||||
```
|
|
||||||
i = 1
|
|
||||||
x = i
|
|
||||||
|> f(%)
|
|
||||||
|> g(%)
|
|
||||||
|> h(%)
|
|
||||||
```
|
|
||||||
|
|
||||||
This helps keep your code neat and avoid unnecessary declarations.
|
|
||||||
|
|
||||||
## Pipelines and keyword arguments
|
|
||||||
|
|
||||||
Say you have a long pipeline of sketch functions, like this:
|
|
||||||
|
|
||||||
```
|
|
||||||
startSketch()
|
|
||||||
|> line(%, end = [3, 4])
|
|
||||||
|> line(%, end = [10, 10])
|
|
||||||
|> line(%, end = [-13, -14])
|
|
||||||
|> close(%)
|
|
||||||
```
|
|
||||||
|
|
||||||
In this example, each function call outputs a sketch, and it gets put into the next function call via
|
|
||||||
the `%`, into the first (unlabeled) argument.
|
|
||||||
|
|
||||||
If a function call uses an unlabeled first parameter, it will default to `%` if it's not given. This
|
|
||||||
means that `|> line(%, end = [3, 4])` and `|> line(end = [3, 4])` are equivalent! So the above
|
|
||||||
could be rewritten as
|
|
||||||
|
|
||||||
```
|
|
||||||
startSketch()
|
|
||||||
|> line(end = [3, 4])
|
|
||||||
|> line(end = [10, 10])
|
|
||||||
|> line(end = [-13, -14])
|
|
||||||
|> close()
|
|
||||||
```
|
|
||||||
|
|
||||||
Note that we are still in the process of migrating KCL's standard library to use keyword arguments. So some
|
|
||||||
functions are still unfortunately using positional arguments. We're moving them over, so keep checking back.
|
|
||||||
Some functions like `angledLine`, `startProfileAt` etc are still using the old positional argument syntax.
|
|
||||||
Check the docs page for each function and look at its examples to see.
|
|
||||||
|
|
||||||
## Tags
|
## Tags
|
||||||
|
|
||||||
Tags are used to give a name (tag) to a specific path.
|
Tags are used to give a name (tag) to a specific path.
|
||||||
@ -187,17 +88,17 @@ way:
|
|||||||
```
|
```
|
||||||
startSketchOn('XZ')
|
startSketchOn('XZ')
|
||||||
|> startProfileAt(origin, %)
|
|> startProfileAt(origin, %)
|
||||||
|> angledLine({angle = 0, length = 191.26}, %, $rectangleSegmentA001)
|
|> angledLine([0, 191.26], %, $rectangleSegmentA001)
|
||||||
|> angledLine({
|
|> angledLine([
|
||||||
angle = segAng(rectangleSegmentA001) - 90,
|
segAng(rectangleSegmentA001) - 90,
|
||||||
length = 196.99,
|
196.99
|
||||||
}, %, $rectangleSegmentB001)
|
], %, $rectangleSegmentB001)
|
||||||
|> angledLine({
|
|> angledLine([
|
||||||
angle = segAng(rectangleSegmentA001),
|
segAng(rectangleSegmentA001),
|
||||||
length = -segLen(rectangleSegmentA001),
|
-segLen(rectangleSegmentA001)
|
||||||
}, %, $rectangleSegmentC001)
|
], %, $rectangleSegmentC001)
|
||||||
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|
|> lineTo([profileStartX(%), profileStartY(%)], %)
|
||||||
|> close()
|
|> close(%)
|
||||||
```
|
```
|
||||||
|
|
||||||
### Tag Identifier
|
### Tag Identifier
|
||||||
@ -220,17 +121,17 @@ However if the code was written like this:
|
|||||||
fn rect(origin) {
|
fn rect(origin) {
|
||||||
return startSketchOn('XZ')
|
return startSketchOn('XZ')
|
||||||
|> startProfileAt(origin, %)
|
|> startProfileAt(origin, %)
|
||||||
|> angledLine({angle = 0, length = 191.26}, %, $rectangleSegmentA001)
|
|> angledLine([0, 191.26], %, $rectangleSegmentA001)
|
||||||
|> angledLine({
|
|> angledLine([
|
||||||
angle = segAng(rectangleSegmentA001) - 90,
|
segAng(rectangleSegmentA001) - 90,
|
||||||
length = 196.99
|
196.99
|
||||||
}, %, $rectangleSegmentB001)
|
], %, $rectangleSegmentB001)
|
||||||
|> angledLine({
|
|> angledLine([
|
||||||
angle = segAng(rectangleSegmentA001),
|
segAng(rectangleSegmentA001),
|
||||||
length = -segLen(rectangleSegmentA001)
|
-segLen(rectangleSegmentA001)
|
||||||
}, %, $rectangleSegmentC001)
|
], %, $rectangleSegmentC001)
|
||||||
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|
|> lineTo([profileStartX(%), profileStartY(%)], %)
|
||||||
|> close()
|
|> close(%)
|
||||||
}
|
}
|
||||||
|
|
||||||
rect([0, 0])
|
rect([0, 0])
|
||||||
@ -248,17 +149,17 @@ For example the following code works.
|
|||||||
fn rect(origin) {
|
fn rect(origin) {
|
||||||
return startSketchOn('XZ')
|
return startSketchOn('XZ')
|
||||||
|> startProfileAt(origin, %)
|
|> startProfileAt(origin, %)
|
||||||
|> angledLine({angle = 0, length = 191.26}, %, $rectangleSegmentA001)
|
|> angledLine([0, 191.26], %, $rectangleSegmentA001)
|
||||||
|> angledLine({
|
|> angledLine([
|
||||||
angle = segAng(rectangleSegmentA001) - 90,
|
segAng(rectangleSegmentA001) - 90,
|
||||||
length = 196.99
|
196.99
|
||||||
}, %, $rectangleSegmentB001)
|
], %, $rectangleSegmentB001)
|
||||||
|> angledLine({
|
|> angledLine([
|
||||||
angle = segAng(rectangleSegmentA001),
|
segAng(rectangleSegmentA001),
|
||||||
length = -segLen(rectangleSegmentA001)
|
-segLen(rectangleSegmentA001)
|
||||||
}, %, $rectangleSegmentC001)
|
], %, $rectangleSegmentC001)
|
||||||
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|
|> lineTo([profileStartX(%), profileStartY(%)], %)
|
||||||
|> close()
|
|> close(%)
|
||||||
}
|
}
|
||||||
|
|
||||||
rect([0, 0])
|
rect([0, 0])
|
||||||
|
@ -1,15 +0,0 @@
|
|||||||
---
|
|
||||||
title: "ArtifactId"
|
|
||||||
excerpt: ""
|
|
||||||
layout: manual
|
|
||||||
---
|
|
||||||
|
|
||||||
|
|
||||||
**Type:** `string` (`uuid`)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user