Compare commits
114 Commits
Author | SHA1 | Date | |
---|---|---|---|
83ca08b26c | |||
ce98218bf0 | |||
2d43399703 | |||
461a2c3ab2 | |||
79be72c5f0 | |||
9ddb4e629f | |||
25e8e7081b | |||
c5164cbee3 | |||
809b333248 | |||
a933646667 | |||
98a68f5cd9 | |||
33dc254e43 | |||
b54295f2f7 | |||
a7e09a89ef | |||
4b6166dc4f | |||
e7d00f148b | |||
d19a7df7e8 | |||
45fae52afc | |||
270f173aad | |||
ddcff1ba63 | |||
cb1b08d6b6 | |||
533fa749b2 | |||
af492d2cb6 | |||
26fba71abf | |||
859bfc7b28 | |||
3b1d1307c4 | |||
f5a2c84ce2 | |||
cccb71fd30 | |||
44be072d04 | |||
86beb6ebf1 | |||
6d72104faa | |||
f2c5661710 | |||
ecb2359bc5 | |||
6e5058bbdc | |||
988a068d6d | |||
0688ce7fe9 | |||
f9e09893e7 | |||
dd1534a61d | |||
e17c6e272c | |||
cb0470a31d | |||
ff6186f4f0 | |||
4dd669bd46 | |||
09131722e3 | |||
87ab8fe78d | |||
bc928a34ef | |||
dca78acdf2 | |||
40f4450995 | |||
178d943423 | |||
e78788482e | |||
e50e9a00d4 | |||
dc82b4c8ea | |||
a8b0e1a771 | |||
75a975b1e1 | |||
3f02bb2065 | |||
9c986d3aa8 | |||
4741d9592b | |||
e9806b83d7 | |||
0229105158 | |||
9e37e13b6b | |||
58e0c0e916 | |||
dd99c27d56 | |||
3cff26b987 | |||
78ac5b0a11 | |||
24d0b14668 | |||
6fb32eeff2 | |||
ec64daa01f | |||
e8886bb358 | |||
05a6313d97 | |||
80f78e1c61 | |||
c441a3ab1c | |||
e894242768 | |||
d8dff03746 | |||
60aee7ddba | |||
6c09da24a4 | |||
b61cd3123f | |||
865bf8ae7a | |||
f8e53c6577 | |||
f31c2c6f81 | |||
e5c05e1980 | |||
6d0da100e5 | |||
b8a0ad7144 | |||
724e65ac97 | |||
b5028f7aa8 | |||
df6b4f4c37 | |||
41eb64925b | |||
fc076173ff | |||
98822869f7 | |||
df0510c199 | |||
fda65bcbd7 | |||
c37e564b59 | |||
d6ad4b6e66 | |||
546b4ea3b8 | |||
310932dc5a | |||
51459bb413 | |||
e00dae11ba | |||
831c7f764a | |||
ec4ad268f7 | |||
be640ea0bd | |||
f8ceab2233 | |||
aea82e004a | |||
bc3a0e3896 | |||
be69039d40 | |||
2c6d69497c | |||
18db3783af | |||
b536040feb | |||
dd45cd4ef9 | |||
25cc5581be | |||
f7c192b64b | |||
faae169154 | |||
c74b9ba940 | |||
6cce3cda36 | |||
5d25f4a0e5 | |||
79d37d360a | |||
69553fded7 |
@ -1,3 +1,3 @@
|
|||||||
[codespell]
|
[codespell]
|
||||||
ignore-words-list: crate,everytime,inout,co-ordinate,ot,nwo,atleast,ue,afterall,ser
|
ignore-words-list: crate,everytime,inout,co-ordinate,ot,nwo,atleast,ue,afterall,ser
|
||||||
skip: **/target,node_modules,build,dist,./out,**/Cargo.lock,./docs/kcl/*.md,.yarn.lock,**/yarn.lock,./openapi/*.json,./packages/codemirror-lang-kcl/test/all.test.ts,tsconfig.tsbuildinfo
|
skip: **/target,node_modules,build,dist,./out,**/Cargo.lock,./docs/kcl/*.md,.yarn.lock,**/yarn.lock,./openapi/*.json,./packages/codemirror-lang-kcl/test/all.test.ts,./public/kcl-samples,./rust/kcl-lib/tests/kcl_samples,tsconfig.tsbuildinfo
|
||||||
|
@ -22,6 +22,13 @@
|
|||||||
"rules": {
|
"rules": {
|
||||||
"@typescript-eslint/no-floating-promises": "error",
|
"@typescript-eslint/no-floating-promises": "error",
|
||||||
"@typescript-eslint/no-misused-promises": "error",
|
"@typescript-eslint/no-misused-promises": "error",
|
||||||
|
"@typescript-eslint/no-unused-vars": ["error", {
|
||||||
|
"varsIgnorePattern": "^_",
|
||||||
|
"argsIgnorePattern": "^_",
|
||||||
|
"ignoreRestSiblings": true,
|
||||||
|
"vars": "all",
|
||||||
|
"args": "none"
|
||||||
|
}],
|
||||||
"jsx-a11y/click-events-have-key-events": "off",
|
"jsx-a11y/click-events-have-key-events": "off",
|
||||||
"jsx-a11y/no-autofocus": "off",
|
"jsx-a11y/no-autofocus": "off",
|
||||||
"jsx-a11y/no-noninteractive-element-interactions": "off",
|
"jsx-a11y/no-noninteractive-element-interactions": "off",
|
||||||
|
314
.github/dependabot.yml
vendored
314
.github/dependabot.yml
vendored
@ -1,50 +1,298 @@
|
|||||||
# To get started with Dependabot version updates, you'll need to specify which
|
# DO NOT EDIT THIS FILE. This dependabot file was generated
|
||||||
# package ecosystems to update and where the package manifests are located.
|
# by https://github.com/KittyCAD/ciso Changes to this file should be addressed in
|
||||||
# Please see the documentation for all configuration options:
|
# the ciso repository.
|
||||||
# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
|
|
||||||
|
|
||||||
version: 2
|
version: 2
|
||||||
updates:
|
updates:
|
||||||
- package-ecosystem: 'npm' # See documentation for possible values
|
- package-ecosystem: github-actions
|
||||||
directories:
|
directory: /
|
||||||
- '/'
|
|
||||||
- '/packages/codemirror-lang-kcl/'
|
|
||||||
- '/packages/codemirror-lsp-client/'
|
|
||||||
- '/rust/kcl-language-server/'
|
|
||||||
schedule:
|
schedule:
|
||||||
interval: weekly
|
interval: weekly
|
||||||
day: monday
|
day: monday
|
||||||
|
time: '03:00'
|
||||||
|
timezone: America/Los_Angeles
|
||||||
|
open-pull-requests-limit: 5
|
||||||
|
groups:
|
||||||
|
security:
|
||||||
|
applies-to: security-updates
|
||||||
|
update-types:
|
||||||
|
- major
|
||||||
|
- minor
|
||||||
|
- patch
|
||||||
|
patch:
|
||||||
|
applies-to: version-updates
|
||||||
|
update-types:
|
||||||
|
- patch
|
||||||
|
major:
|
||||||
|
applies-to: version-updates
|
||||||
|
update-types:
|
||||||
|
- major
|
||||||
|
minor:
|
||||||
|
applies-to: version-updates
|
||||||
|
update-types:
|
||||||
|
- minor
|
||||||
|
- patch
|
||||||
|
- package-ecosystem: cargo
|
||||||
|
directory: /rust
|
||||||
|
schedule:
|
||||||
|
interval: weekly
|
||||||
|
day: monday
|
||||||
|
time: '03:00'
|
||||||
|
timezone: America/Los_Angeles
|
||||||
|
open-pull-requests-limit: 5
|
||||||
reviewers:
|
reviewers:
|
||||||
|
- adamchalmers
|
||||||
- franknoirot
|
- franknoirot
|
||||||
- irev-dev
|
- irev-dev
|
||||||
- package-ecosystem: 'github-actions' # See documentation for possible values
|
|
||||||
directory: '/' # Location of package manifests
|
|
||||||
schedule:
|
|
||||||
interval: weekly
|
|
||||||
day: monday
|
|
||||||
reviewers:
|
|
||||||
- adamchalmers
|
|
||||||
- jessfraz
|
|
||||||
- package-ecosystem: 'cargo' # See documentation for possible values
|
|
||||||
directory: '/rust/' # Location of package manifests
|
|
||||||
schedule:
|
|
||||||
interval: weekly
|
|
||||||
day: monday
|
|
||||||
reviewers:
|
|
||||||
- adamchalmers
|
|
||||||
- jessfraz
|
- jessfraz
|
||||||
groups:
|
groups:
|
||||||
serde-dependencies:
|
security:
|
||||||
patterns:
|
applies-to: security-updates
|
||||||
- "serde*"
|
update-types:
|
||||||
wasm-bindgen-deps:
|
- major
|
||||||
patterns:
|
- minor
|
||||||
- "wasm-bindgen*"
|
- patch
|
||||||
- package-ecosystem: "pip" # See documentation for possible values
|
patch:
|
||||||
directory: "/rust/kcl-python-bindings/" # Location of package manifests
|
applies-to: version-updates
|
||||||
|
update-types:
|
||||||
|
- patch
|
||||||
|
major:
|
||||||
|
applies-to: version-updates
|
||||||
|
update-types:
|
||||||
|
- major
|
||||||
|
minor:
|
||||||
|
applies-to: version-updates
|
||||||
|
update-types:
|
||||||
|
- minor
|
||||||
|
- patch
|
||||||
|
- package-ecosystem: npm
|
||||||
|
directory: /
|
||||||
schedule:
|
schedule:
|
||||||
interval: weekly
|
interval: weekly
|
||||||
day: monday
|
day: monday
|
||||||
|
time: '03:00'
|
||||||
|
timezone: America/Los_Angeles
|
||||||
|
open-pull-requests-limit: 5
|
||||||
reviewers:
|
reviewers:
|
||||||
- adamchalmers
|
- adamchalmers
|
||||||
|
- franknoirot
|
||||||
|
- irev-dev
|
||||||
- jessfraz
|
- jessfraz
|
||||||
|
groups:
|
||||||
|
security:
|
||||||
|
applies-to: security-updates
|
||||||
|
update-types:
|
||||||
|
- major
|
||||||
|
- minor
|
||||||
|
- patch
|
||||||
|
patch:
|
||||||
|
applies-to: version-updates
|
||||||
|
update-types:
|
||||||
|
- patch
|
||||||
|
major:
|
||||||
|
applies-to: version-updates
|
||||||
|
update-types:
|
||||||
|
- major
|
||||||
|
minor:
|
||||||
|
applies-to: version-updates
|
||||||
|
update-types:
|
||||||
|
- minor
|
||||||
|
- patch
|
||||||
|
- package-ecosystem: npm
|
||||||
|
directory: /rust/kcl-language-server
|
||||||
|
schedule:
|
||||||
|
interval: weekly
|
||||||
|
day: monday
|
||||||
|
time: '03:00'
|
||||||
|
timezone: America/Los_Angeles
|
||||||
|
open-pull-requests-limit: 5
|
||||||
|
reviewers:
|
||||||
|
- adamchalmers
|
||||||
|
- franknoirot
|
||||||
|
- irev-dev
|
||||||
|
- jessfraz
|
||||||
|
groups:
|
||||||
|
security:
|
||||||
|
applies-to: security-updates
|
||||||
|
update-types:
|
||||||
|
- major
|
||||||
|
- minor
|
||||||
|
- patch
|
||||||
|
patch:
|
||||||
|
applies-to: version-updates
|
||||||
|
update-types:
|
||||||
|
- patch
|
||||||
|
major:
|
||||||
|
applies-to: version-updates
|
||||||
|
update-types:
|
||||||
|
- major
|
||||||
|
minor:
|
||||||
|
applies-to: version-updates
|
||||||
|
update-types:
|
||||||
|
- minor
|
||||||
|
- patch
|
||||||
|
- package-ecosystem: npm
|
||||||
|
directory: /packages/codemirror-lang-kcl
|
||||||
|
schedule:
|
||||||
|
interval: weekly
|
||||||
|
day: monday
|
||||||
|
time: '03:00'
|
||||||
|
timezone: America/Los_Angeles
|
||||||
|
open-pull-requests-limit: 5
|
||||||
|
reviewers:
|
||||||
|
- adamchalmers
|
||||||
|
- franknoirot
|
||||||
|
- irev-dev
|
||||||
|
- jessfraz
|
||||||
|
groups:
|
||||||
|
security:
|
||||||
|
applies-to: security-updates
|
||||||
|
update-types:
|
||||||
|
- major
|
||||||
|
- minor
|
||||||
|
- patch
|
||||||
|
patch:
|
||||||
|
applies-to: version-updates
|
||||||
|
update-types:
|
||||||
|
- patch
|
||||||
|
major:
|
||||||
|
applies-to: version-updates
|
||||||
|
update-types:
|
||||||
|
- major
|
||||||
|
minor:
|
||||||
|
applies-to: version-updates
|
||||||
|
update-types:
|
||||||
|
- minor
|
||||||
|
- patch
|
||||||
|
- package-ecosystem: npm
|
||||||
|
directory: /packages/codemirror-lsp-client
|
||||||
|
schedule:
|
||||||
|
interval: weekly
|
||||||
|
day: monday
|
||||||
|
time: '03:00'
|
||||||
|
timezone: America/Los_Angeles
|
||||||
|
open-pull-requests-limit: 5
|
||||||
|
reviewers:
|
||||||
|
- adamchalmers
|
||||||
|
- franknoirot
|
||||||
|
- irev-dev
|
||||||
|
- jessfraz
|
||||||
|
groups:
|
||||||
|
security:
|
||||||
|
applies-to: security-updates
|
||||||
|
update-types:
|
||||||
|
- major
|
||||||
|
- minor
|
||||||
|
- patch
|
||||||
|
patch:
|
||||||
|
applies-to: version-updates
|
||||||
|
update-types:
|
||||||
|
- patch
|
||||||
|
major:
|
||||||
|
applies-to: version-updates
|
||||||
|
update-types:
|
||||||
|
- major
|
||||||
|
minor:
|
||||||
|
applies-to: version-updates
|
||||||
|
update-types:
|
||||||
|
- minor
|
||||||
|
- patch
|
||||||
|
- package-ecosystem: npm
|
||||||
|
directory: /.github/actions/github-release
|
||||||
|
schedule:
|
||||||
|
interval: weekly
|
||||||
|
day: monday
|
||||||
|
time: '03:00'
|
||||||
|
timezone: America/Los_Angeles
|
||||||
|
open-pull-requests-limit: 5
|
||||||
|
reviewers:
|
||||||
|
- adamchalmers
|
||||||
|
- franknoirot
|
||||||
|
- irev-dev
|
||||||
|
- jessfraz
|
||||||
|
groups:
|
||||||
|
security:
|
||||||
|
applies-to: security-updates
|
||||||
|
update-types:
|
||||||
|
- major
|
||||||
|
- minor
|
||||||
|
- patch
|
||||||
|
patch:
|
||||||
|
applies-to: version-updates
|
||||||
|
update-types:
|
||||||
|
- patch
|
||||||
|
major:
|
||||||
|
applies-to: version-updates
|
||||||
|
update-types:
|
||||||
|
- major
|
||||||
|
minor:
|
||||||
|
applies-to: version-updates
|
||||||
|
update-types:
|
||||||
|
- minor
|
||||||
|
- patch
|
||||||
|
- package-ecosystem: pip
|
||||||
|
directory: /rust/kcl-python-bindings
|
||||||
|
schedule:
|
||||||
|
interval: weekly
|
||||||
|
day: monday
|
||||||
|
time: '03:00'
|
||||||
|
timezone: America/Los_Angeles
|
||||||
|
open-pull-requests-limit: 5
|
||||||
|
reviewers:
|
||||||
|
- adamchalmers
|
||||||
|
- franknoirot
|
||||||
|
- irev-dev
|
||||||
|
- jessfraz
|
||||||
|
groups:
|
||||||
|
security:
|
||||||
|
applies-to: security-updates
|
||||||
|
update-types:
|
||||||
|
- major
|
||||||
|
- minor
|
||||||
|
- patch
|
||||||
|
patch:
|
||||||
|
applies-to: version-updates
|
||||||
|
update-types:
|
||||||
|
- patch
|
||||||
|
major:
|
||||||
|
applies-to: version-updates
|
||||||
|
update-types:
|
||||||
|
- major
|
||||||
|
minor:
|
||||||
|
applies-to: version-updates
|
||||||
|
update-types:
|
||||||
|
- minor
|
||||||
|
- patch
|
||||||
|
- package-ecosystem: docker
|
||||||
|
directory: /.github/actions/github-release
|
||||||
|
schedule:
|
||||||
|
interval: weekly
|
||||||
|
day: monday
|
||||||
|
time: '03:00'
|
||||||
|
timezone: America/Los_Angeles
|
||||||
|
open-pull-requests-limit: 5
|
||||||
|
reviewers:
|
||||||
|
- adamchalmers
|
||||||
|
- franknoirot
|
||||||
|
- irev-dev
|
||||||
|
- jessfraz
|
||||||
|
groups:
|
||||||
|
security:
|
||||||
|
applies-to: security-updates
|
||||||
|
update-types:
|
||||||
|
- major
|
||||||
|
- minor
|
||||||
|
- patch
|
||||||
|
patch:
|
||||||
|
applies-to: version-updates
|
||||||
|
update-types:
|
||||||
|
- patch
|
||||||
|
major:
|
||||||
|
applies-to: version-updates
|
||||||
|
update-types:
|
||||||
|
- major
|
||||||
|
minor:
|
||||||
|
applies-to: version-updates
|
||||||
|
update-types:
|
||||||
|
- minor
|
||||||
|
- patch
|
||||||
|
16
.github/workflows/build-and-store-wasm.yml
vendored
16
.github/workflows/build-and-store-wasm.yml
vendored
@ -16,15 +16,21 @@ jobs:
|
|||||||
cache: 'yarn'
|
cache: 'yarn'
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: yarn
|
run: yarn
|
||||||
- name: Setup Rust
|
- name: Use correct Rust toolchain
|
||||||
uses: dtolnay/rust-toolchain@stable
|
shell: bash
|
||||||
- name: Cache wasm
|
run: |
|
||||||
uses: Swatinem/rust-cache@v2
|
[ -e rust-toolchain.toml ] || cp rust/rust-toolchain.toml ./
|
||||||
|
- name: Install rust
|
||||||
|
uses: actions-rust-lang/setup-rust-toolchain@v1
|
||||||
with:
|
with:
|
||||||
workspaces: './rust'
|
cache: false # Configured below.
|
||||||
- uses: taiki-e/install-action@955a6ff1416eae278c9f833008a9beb4b7f9afe3
|
- uses: taiki-e/install-action@955a6ff1416eae278c9f833008a9beb4b7f9afe3
|
||||||
with:
|
with:
|
||||||
tool: wasm-pack
|
tool: wasm-pack
|
||||||
|
- name: Rust Cache
|
||||||
|
uses: Swatinem/rust-cache@v2
|
||||||
|
with:
|
||||||
|
workspaces: rust
|
||||||
- name: build wasm
|
- name: build wasm
|
||||||
run: yarn build:wasm
|
run: yarn build:wasm
|
||||||
|
|
||||||
|
56
.github/workflows/build-apps.yml
vendored
56
.github/workflows/build-apps.yml
vendored
@ -33,19 +33,63 @@ jobs:
|
|||||||
|
|
||||||
- run: yarn install
|
- run: yarn install
|
||||||
|
|
||||||
- name: Setup Rust
|
- id: filter
|
||||||
uses: dtolnay/rust-toolchain@stable
|
name: Check for Rust changes
|
||||||
|
uses: dorny/paths-filter@v3
|
||||||
- uses: Swatinem/rust-cache@v2
|
|
||||||
with:
|
with:
|
||||||
workspaces: './rust'
|
filters: |
|
||||||
|
rust:
|
||||||
|
- 'rust/**'
|
||||||
|
|
||||||
|
- name: Download Wasm Cache
|
||||||
|
id: download-wasm
|
||||||
|
if: ${{ github.event_name == 'pull_request' && steps.filter.outputs.rust == 'false' }}
|
||||||
|
uses: dawidd6/action-download-artifact@v7
|
||||||
|
continue-on-error: true
|
||||||
|
with:
|
||||||
|
github_token: ${{secrets.GITHUB_TOKEN}}
|
||||||
|
name: wasm-bundle
|
||||||
|
workflow: build-and-store-wasm.yml
|
||||||
|
branch: main
|
||||||
|
path: rust/kcl-wasm-lib/pkg
|
||||||
|
|
||||||
|
- name: Build WASM condition
|
||||||
|
id: wasm
|
||||||
|
run: |
|
||||||
|
set -euox pipefail
|
||||||
|
# Build wasm if this is a push to main or tag, there are Rust changes, or
|
||||||
|
# downloading from the wasm cache failed.
|
||||||
|
if [[ ${{github.event_name}} == 'push' || ${{steps.filter.outputs.rust}} == 'true' || ${{steps.download-wasm.outcome}} == 'failure' ]]; then
|
||||||
|
echo "should-build-wasm=true" >> $GITHUB_OUTPUT
|
||||||
|
else
|
||||||
|
echo "should-build-wasm=false" >> $GITHUB_OUTPUT
|
||||||
|
fi
|
||||||
|
|
||||||
|
- name: Use correct Rust toolchain
|
||||||
|
if: ${{ steps.wasm.outputs.should-build-wasm == 'true' }}
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
[ -e rust-toolchain.toml ] || cp rust/rust-toolchain.toml ./
|
||||||
|
|
||||||
|
- name: Install rust
|
||||||
|
if: ${{ steps.wasm.outputs.should-build-wasm == 'true' }}
|
||||||
|
uses: actions-rust-lang/setup-rust-toolchain@v1
|
||||||
|
with:
|
||||||
|
cache: false # Configured below.
|
||||||
|
|
||||||
# TODO: see if we can fetch from main instead if no diff at rust
|
|
||||||
- uses: taiki-e/install-action@955a6ff1416eae278c9f833008a9beb4b7f9afe3
|
- uses: taiki-e/install-action@955a6ff1416eae278c9f833008a9beb4b7f9afe3
|
||||||
|
if: ${{ steps.wasm.outputs.should-build-wasm == 'true' }}
|
||||||
with:
|
with:
|
||||||
tool: wasm-pack
|
tool: wasm-pack
|
||||||
|
|
||||||
|
- name: Rust Cache
|
||||||
|
if: ${{ steps.wasm.outputs.should-build-wasm == 'true' }}
|
||||||
|
uses: Swatinem/rust-cache@v2
|
||||||
|
with:
|
||||||
|
workspaces: rust
|
||||||
|
|
||||||
- name: Run build:wasm
|
- name: Run build:wasm
|
||||||
|
if: ${{ steps.wasm.outputs.should-build-wasm == 'true' }}
|
||||||
run: "yarn build:wasm"
|
run: "yarn build:wasm"
|
||||||
|
|
||||||
- name: Set nightly version, product name, release notes, and icons
|
- name: Set nightly version, product name, release notes, and icons
|
||||||
|
62
.github/workflows/cargo-bench.yml
vendored
Normal file
62
.github/workflows/cargo-bench.yml
vendored
Normal file
@ -0,0 +1,62 @@
|
|||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
paths:
|
||||||
|
- '**.rs'
|
||||||
|
- '**/Cargo.toml'
|
||||||
|
- '**/Cargo.lock'
|
||||||
|
- '**/rust-toolchain.toml'
|
||||||
|
- .github/workflows/cargo-bench.yml
|
||||||
|
pull_request:
|
||||||
|
paths:
|
||||||
|
- '**.rs'
|
||||||
|
- '**/Cargo.toml'
|
||||||
|
- '**/Cargo.lock'
|
||||||
|
- '**/rust-toolchain.toml'
|
||||||
|
- .github/workflows/cargo-bench.yml
|
||||||
|
workflow_dispatch:
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
pull-requests: write
|
||||||
|
concurrency:
|
||||||
|
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
|
||||||
|
cancel-in-progress: true
|
||||||
|
name: cargo bench
|
||||||
|
jobs:
|
||||||
|
cargo-bench:
|
||||||
|
name: cargo bench
|
||||||
|
runs-on:
|
||||||
|
- runs-on=${{ github.run_id }}
|
||||||
|
- runner=32cpu-linux-x64
|
||||||
|
- extras=s3-cache
|
||||||
|
steps:
|
||||||
|
- uses: runs-on/action@v1
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- name: Use correct Rust toolchain
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
[ -e rust-toolchain.toml ] || cp rust/rust-toolchain.toml ./
|
||||||
|
- name: Install rust
|
||||||
|
uses: actions-rust-lang/setup-rust-toolchain@v1
|
||||||
|
with:
|
||||||
|
cache: rust
|
||||||
|
- name: Install dependencies
|
||||||
|
run: |
|
||||||
|
cargo install cargo-criterion
|
||||||
|
cargo install cargo-codspeed
|
||||||
|
cd rust/kcl-lib
|
||||||
|
cargo add --dev codspeed-criterion-compat --rename criterion
|
||||||
|
- name: Build the benchmark target(s)
|
||||||
|
run: |
|
||||||
|
cd rust
|
||||||
|
cargo codspeed build --measurement-mode walltime
|
||||||
|
- name: Run the benchmarks
|
||||||
|
uses: CodSpeedHQ/action@v3
|
||||||
|
with:
|
||||||
|
working-directory: rust
|
||||||
|
run: cargo codspeed run
|
||||||
|
token: ${{ secrets.CODSPEED_TOKEN }}
|
||||||
|
mode: walltime
|
||||||
|
env:
|
||||||
|
KITTYCAD_API_TOKEN: ${{ secrets.KITTYCAD_API_TOKEN }}
|
2
.github/workflows/cargo-check.yml
vendored
2
.github/workflows/cargo-check.yml
vendored
@ -22,7 +22,7 @@ jobs:
|
|||||||
- name: Use correct Rust toolchain
|
- name: Use correct Rust toolchain
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
cp --update=none rust/rust-toolchain.toml ./ || true
|
[ -e rust-toolchain.toml ] || cp rust/rust-toolchain.toml ./
|
||||||
- name: Install rust
|
- name: Install rust
|
||||||
uses: actions-rust-lang/setup-rust-toolchain@v1
|
uses: actions-rust-lang/setup-rust-toolchain@v1
|
||||||
with:
|
with:
|
||||||
|
2
.github/workflows/cargo-clippy.yml
vendored
2
.github/workflows/cargo-clippy.yml
vendored
@ -29,7 +29,7 @@ jobs:
|
|||||||
- name: Use correct Rust toolchain
|
- name: Use correct Rust toolchain
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
cp --update=none rust/rust-toolchain.toml ./ || true
|
[ -e rust-toolchain.toml ] || cp rust/rust-toolchain.toml ./
|
||||||
- name: Install rust
|
- name: Install rust
|
||||||
uses: actions-rust-lang/setup-rust-toolchain@v1
|
uses: actions-rust-lang/setup-rust-toolchain@v1
|
||||||
with:
|
with:
|
||||||
|
2
.github/workflows/cargo-fmt.yml
vendored
2
.github/workflows/cargo-fmt.yml
vendored
@ -31,7 +31,7 @@ jobs:
|
|||||||
- name: Use correct Rust toolchain
|
- name: Use correct Rust toolchain
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
cp --update=none rust/rust-toolchain.toml ./ || true
|
[ -e rust-toolchain.toml ] || cp rust/rust-toolchain.toml ./
|
||||||
- name: Install rust
|
- name: Install rust
|
||||||
uses: actions-rust-lang/setup-rust-toolchain@v1
|
uses: actions-rust-lang/setup-rust-toolchain@v1
|
||||||
with:
|
with:
|
||||||
|
92
.github/workflows/cargo-test.yml
vendored
92
.github/workflows/cargo-test.yml
vendored
@ -5,7 +5,9 @@ on:
|
|||||||
|
|
||||||
pull_request:
|
pull_request:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
permissions: read-all
|
permissions:
|
||||||
|
contents: read
|
||||||
|
pull-requests: write
|
||||||
concurrency:
|
concurrency:
|
||||||
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
|
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
|
||||||
cancel-in-progress: true
|
cancel-in-progress: true
|
||||||
@ -15,11 +17,19 @@ jobs:
|
|||||||
name: cargo test
|
name: cargo test
|
||||||
runs-on: ubuntu-latest-8-cores
|
runs-on: ubuntu-latest-8-cores
|
||||||
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 }}
|
||||||
- name: Use correct Rust toolchain
|
- name: Use correct Rust toolchain
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
cp --update=none rust/rust-toolchain.toml ./ || true
|
[ -e rust-toolchain.toml ] || cp rust/rust-toolchain.toml ./
|
||||||
- name: Install rust
|
- name: Install rust
|
||||||
uses: actions-rust-lang/setup-rust-toolchain@v1
|
uses: actions-rust-lang/setup-rust-toolchain@v1
|
||||||
with:
|
with:
|
||||||
@ -40,11 +50,86 @@ jobs:
|
|||||||
${HOME}/.vector/bin/vector --config /tmp/vector.toml &
|
${HOME}/.vector/bin/vector --config /tmp/vector.toml &
|
||||||
- uses: taiki-e/install-action@cargo-llvm-cov
|
- uses: taiki-e/install-action@cargo-llvm-cov
|
||||||
- uses: taiki-e/install-action@nextest
|
- uses: taiki-e/install-action@nextest
|
||||||
|
- name: Install just
|
||||||
|
uses: taiki-e/install-action@just
|
||||||
|
- name: Install cargo-insta
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
cargo install cargo-insta
|
||||||
- name: Rust Cache
|
- name: Rust Cache
|
||||||
uses: Swatinem/rust-cache@v2.6.1
|
uses: Swatinem/rust-cache@v2
|
||||||
with:
|
with:
|
||||||
workspaces: rust
|
workspaces: rust
|
||||||
|
- name: Fetch the base branch
|
||||||
|
if: ${{ github.event_name == 'pull_request' }}
|
||||||
|
run: git fetch origin ${{ github.base_ref }} --depth=1
|
||||||
|
- name: Check for path changes
|
||||||
|
id: path-changes
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
# Manual runs or push should run all tests.
|
||||||
|
if [[ ${{ github.event_name }} != 'pull_request' ]]; then
|
||||||
|
echo "outside-kcl-samples=true" >> $GITHUB_OUTPUT
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
changed_files=$(git diff --name-only origin/${{ github.base_ref }})
|
||||||
|
echo "$changed_files"
|
||||||
|
if grep -Evq '^public/kcl-samples/|^rust/kcl-lib/tests/kcl_samples/' <<< "$changed_files" ; then
|
||||||
|
echo "outside-kcl-samples=true" >> $GITHUB_OUTPUT
|
||||||
|
else
|
||||||
|
echo "outside-kcl-samples=false" >> $GITHUB_OUTPUT
|
||||||
|
fi
|
||||||
|
- name: cargo test only kcl-samples
|
||||||
|
id: cargo-test-kcl-samples
|
||||||
|
if: steps.path-changes.outputs.outside-kcl-samples == 'false'
|
||||||
|
continue-on-error: true
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
set -euo pipefail
|
||||||
|
cd rust
|
||||||
|
cargo nextest run --workspace --retries=2 --no-fail-fast --profile ci simulation_tests::kcl_samples 2>&1 | tee /tmp/github-actions.log
|
||||||
|
env:
|
||||||
|
KITTYCAD_API_TOKEN: ${{secrets.KITTYCAD_API_TOKEN}}
|
||||||
|
RUST_BACKTRACE: full
|
||||||
|
RUST_MIN_STACK: 10485760000
|
||||||
|
- name: Commit differences
|
||||||
|
if: steps.path-changes.outputs.outside-kcl-samples == 'false' && steps.cargo-test-kcl-samples.outcome == 'failure'
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
set -euo pipefail
|
||||||
|
pushd rust
|
||||||
|
just overwrite-sim-test kcl_samples
|
||||||
|
popd
|
||||||
|
git add \
|
||||||
|
rust/kcl-lib/tests \
|
||||||
|
public/kcl-samples/manifest.json \
|
||||||
|
public/kcl-samples/README.md \
|
||||||
|
public/kcl-samples/screenshots
|
||||||
|
git config --local user.email "github-actions[bot]@users.noreply.github.com"
|
||||||
|
git config --local user.name "github-actions[bot]"
|
||||||
|
git remote set-url origin https://${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git
|
||||||
|
git fetch origin
|
||||||
|
echo ${{ github.head_ref }}
|
||||||
|
git checkout ${{ github.head_ref }}
|
||||||
|
if ! git commit -m "Update kcl-samples simulation test output" ; then
|
||||||
|
echo "No changes to commit"
|
||||||
|
# This only runs if tests failed, so we should fail the step.
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
git push origin ${{ github.head_ref }}
|
||||||
|
env:
|
||||||
|
# The default is auto, and insta behaves differently in CI vs. not.
|
||||||
|
INSTA_UPDATE: always
|
||||||
|
KITTYCAD_API_TOKEN: ${{secrets.KITTYCAD_API_TOKEN}}
|
||||||
|
# Configure nextest when it's run by insta (via just).
|
||||||
|
NEXTEST_PROFILE: ci
|
||||||
|
RUST_BACKTRACE: full
|
||||||
|
RUST_MIN_STACK: 10485760000
|
||||||
- name: cargo test
|
- name: cargo test
|
||||||
|
if: steps.path-changes.outputs.outside-kcl-samples == 'true'
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |-
|
run: |-
|
||||||
cd rust
|
cd rust
|
||||||
@ -53,6 +138,7 @@ jobs:
|
|||||||
KITTYCAD_API_TOKEN: ${{secrets.KITTYCAD_API_TOKEN}}
|
KITTYCAD_API_TOKEN: ${{secrets.KITTYCAD_API_TOKEN}}
|
||||||
RUST_MIN_STACK: 10485760000
|
RUST_MIN_STACK: 10485760000
|
||||||
- name: Upload to codecov.io
|
- name: Upload to codecov.io
|
||||||
|
if: steps.path-changes.outputs.outside-kcl-samples == 'true'
|
||||||
uses: codecov/codecov-action@v5
|
uses: codecov/codecov-action@v5
|
||||||
with:
|
with:
|
||||||
token: ${{secrets.CODECOV_TOKEN}}
|
token: ${{secrets.CODECOV_TOKEN}}
|
||||||
|
48
.github/workflows/check-kcl-header.yml
vendored
Normal file
48
.github/workflows/check-kcl-header.yml
vendored
Normal file
@ -0,0 +1,48 @@
|
|||||||
|
name: Check kcl-samples files for proper header structure
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
paths:
|
||||||
|
- 'public/kcl-samples/**/*.kcl'
|
||||||
|
- .github/workflows/check-kcl-header.yml
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
push:
|
||||||
|
paths:
|
||||||
|
- 'public/kcl-samples/**/*.kcl'
|
||||||
|
- .github/workflows/check-kcl-header.yml
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
check-kcl-header:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Check KCL files for header comment block and blank line
|
||||||
|
run: |
|
||||||
|
files=$(find public/kcl-samples -type f -name '*.kcl')
|
||||||
|
failed_files=()
|
||||||
|
|
||||||
|
for file in $files; do
|
||||||
|
if ! awk '
|
||||||
|
NR == 1 && $0 !~ /^\/\// { exit 1 }
|
||||||
|
BEGIN { in_comment = 1 }
|
||||||
|
NF == 0 && in_comment == 1 { in_comment = 0; next }
|
||||||
|
$1 !~ /^\/\// && in_comment == 1 { exit 1 }
|
||||||
|
in_comment == 0 && NF > 0 { exit 0 }
|
||||||
|
END { if (in_comment == 1) exit 1 }
|
||||||
|
' "$file"; then
|
||||||
|
failed_files+=("$file")
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
if [ ${#failed_files[@]} -ne 0 ]; then
|
||||||
|
echo "One or more KCL files do not begin with a header comment block followed by a blank line:"
|
||||||
|
printf '%s\n' "${failed_files[@]}"
|
||||||
|
exit 1
|
||||||
|
fi
|
381
.github/workflows/e2e-tests.yml
vendored
381
.github/workflows/e2e-tests.yml
vendored
@ -17,55 +17,92 @@ permissions:
|
|||||||
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
electron:
|
|
||||||
timeout-minutes: 60
|
conditions:
|
||||||
name: playwright:electron:${{ matrix.os }} ${{ matrix.shardIndex }} ${{ matrix.shardTotal }}
|
runs-on: ubuntu-latest
|
||||||
strategy:
|
outputs:
|
||||||
fail-fast: false
|
significant: ${{ steps.path-changes.outputs.significant }}
|
||||||
matrix:
|
should-run: ${{ steps.should-run.outputs.should-run }}
|
||||||
# TODO: enable self-hosted-windows-8-cores once available
|
|
||||||
os: [namespace-profile-ubuntu-8-cores, namespace-profile-macos-8-cores, windows-16-cores]
|
|
||||||
shardIndex: [1, 2, 3, 4]
|
|
||||||
shardTotal: [4]
|
|
||||||
# TODO: add ref here for main and latest release tag
|
|
||||||
runs-on: ${{ matrix.os }}
|
|
||||||
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 }}
|
- name: Fetch the base branch
|
||||||
|
if: ${{ github.event_name == 'pull_request' }}
|
||||||
|
run: git fetch origin ${{ github.base_ref }} --depth=1
|
||||||
|
|
||||||
|
- name: Check for path changes
|
||||||
|
id: path-changes
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
# Manual runs or push should run all tests.
|
||||||
|
if [[ ${{ github.event_name }} != 'pull_request' ]]; then
|
||||||
|
echo "significant=true" >> $GITHUB_OUTPUT
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
changed_files=$(git diff --name-only origin/${{ github.base_ref }})
|
||||||
|
echo "$changed_files"
|
||||||
|
if grep -Evq '^README.md|^public/kcl-samples/|^rust/kcl-lib/tests/kcl_samples/' <<< "$changed_files" ; then
|
||||||
|
echo "significant=true" >> $GITHUB_OUTPUT
|
||||||
|
else
|
||||||
|
echo "significant=false" >> $GITHUB_OUTPUT
|
||||||
|
fi
|
||||||
|
|
||||||
|
- name: Should run
|
||||||
|
id: should-run
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
set -euo pipefail
|
||||||
|
# We should run when this is a scheduled run or if there are
|
||||||
|
# significant changes in the diff.
|
||||||
|
if [[ ${{ github.event_name }} == 'schedule' || ${{ steps.path-changes.outputs.significant }} == 'true' ]]; then
|
||||||
|
echo "should-run=true" >> $GITHUB_OUTPUT
|
||||||
|
else
|
||||||
|
echo "should-run=false" >> $GITHUB_OUTPUT
|
||||||
|
fi
|
||||||
|
|
||||||
|
- name: Display conditions
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
# For debugging purposes.
|
||||||
|
set -euo pipefail
|
||||||
|
echo "significant: ${{ steps.path-changes.outputs.significant }}"
|
||||||
|
echo "should-run: ${{ steps.should-run.outputs.should-run }}"
|
||||||
|
|
||||||
|
|
||||||
|
prepare-wasm:
|
||||||
|
# seperate job on Ubuntu to build or fetch the wasm blob once on the fastest runner
|
||||||
|
runs-on: runs-on=${{ github.run_id }}/family=i7ie.2xlarge/image=ubuntu22-full-x64
|
||||||
|
needs: conditions
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
if: needs.conditions.outputs.should-run == 'true'
|
||||||
|
|
||||||
- id: filter
|
- id: filter
|
||||||
|
if: needs.conditions.outputs.should-run == 'true'
|
||||||
name: Check for Rust changes
|
name: Check for Rust changes
|
||||||
uses: dorny/paths-filter@v3
|
uses: dorny/paths-filter@v3
|
||||||
with:
|
with:
|
||||||
filters: |
|
filters: |
|
||||||
rust:
|
rust:
|
||||||
- 'rust/**'
|
- 'rust/**'
|
||||||
|
|
||||||
- uses: actions/setup-node@v4
|
- uses: actions/setup-node@v4
|
||||||
|
if: needs.conditions.outputs.should-run == 'true'
|
||||||
with:
|
with:
|
||||||
node-version-file: '.nvmrc'
|
node-version-file: '.nvmrc'
|
||||||
cache: 'yarn'
|
cache: 'yarn'
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
id: deps-install
|
if: needs.conditions.outputs.should-run == 'true'
|
||||||
shell: bash
|
|
||||||
run: yarn
|
run: yarn
|
||||||
- name: Cache Playwright Browsers
|
|
||||||
uses: actions/cache@v4
|
|
||||||
with:
|
|
||||||
path: |
|
|
||||||
~/.cache/ms-playwright/
|
|
||||||
key: ${{ runner.os }}-playwright-${{ hashFiles('yarn.lock') }}
|
|
||||||
- name: Install Playwright Browsers
|
|
||||||
shell: bash
|
|
||||||
run: yarn playwright install --with-deps
|
|
||||||
- name: Download Wasm Cache
|
- name: Download Wasm Cache
|
||||||
id: download-wasm
|
id: download-wasm
|
||||||
if: github.event_name != 'schedule' && steps.filter.outputs.rust == 'false'
|
if: ${{ needs.conditions.outputs.should-run == 'true' && github.event_name != 'schedule' && steps.filter.outputs.rust == 'false' }}
|
||||||
uses: dawidd6/action-download-artifact@v7
|
uses: dawidd6/action-download-artifact@v7
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
with:
|
with:
|
||||||
@ -74,67 +111,121 @@ jobs:
|
|||||||
workflow: build-and-store-wasm.yml
|
workflow: build-and-store-wasm.yml
|
||||||
branch: main
|
branch: main
|
||||||
path: rust/kcl-wasm-lib/pkg
|
path: rust/kcl-wasm-lib/pkg
|
||||||
- name: copy wasm blob
|
|
||||||
if: github.event_name != 'schedule' && steps.filter.outputs.rust == 'false'
|
- name: Build WASM condition
|
||||||
|
id: wasm
|
||||||
|
if: needs.conditions.outputs.should-run == 'true'
|
||||||
|
run: |
|
||||||
|
set -euox pipefail
|
||||||
|
# Build wasm if this is a scheduled run, there are Rust changes, or
|
||||||
|
# downloading from the wasm cache failed.
|
||||||
|
if [[ ${{github.event_name}} == 'schedule' || ${{steps.filter.outputs.rust}} == 'true' || ${{steps.download-wasm.outcome}} == 'failure' ]]; then
|
||||||
|
echo "should-build-wasm=true" >> $GITHUB_OUTPUT
|
||||||
|
else
|
||||||
|
echo "should-build-wasm=false" >> $GITHUB_OUTPUT
|
||||||
|
fi
|
||||||
|
|
||||||
|
- name: Use correct Rust toolchain
|
||||||
|
if: ${{ needs.conditions.outputs.should-run == 'true' && steps.wasm.outputs.should-build-wasm == 'true' }}
|
||||||
shell: bash
|
shell: bash
|
||||||
run: cp rust/kcl-wasm-lib/pkg/kcl_wasm_lib_bg.wasm public
|
run: |
|
||||||
continue-on-error: true
|
[ -e rust-toolchain.toml ] || cp rust/rust-toolchain.toml ./
|
||||||
- name: Setup Rust
|
|
||||||
uses: dtolnay/rust-toolchain@stable
|
- name: Install rust
|
||||||
|
if: ${{ needs.conditions.outputs.should-run == 'true' && steps.wasm.outputs.should-build-wasm == 'true' }}
|
||||||
|
uses: actions-rust-lang/setup-rust-toolchain@v1
|
||||||
|
with:
|
||||||
|
cache: false # Configured below.
|
||||||
|
|
||||||
- uses: taiki-e/install-action@955a6ff1416eae278c9f833008a9beb4b7f9afe3
|
- uses: taiki-e/install-action@955a6ff1416eae278c9f833008a9beb4b7f9afe3
|
||||||
|
if: ${{ needs.conditions.outputs.should-run == 'true' && steps.wasm.outputs.should-build-wasm == 'true' }}
|
||||||
with:
|
with:
|
||||||
tool: wasm-pack
|
tool: wasm-pack
|
||||||
- name: Cache Wasm (because rust diff)
|
|
||||||
if: github.event_name == 'schedule' || steps.filter.outputs.rust == 'true'
|
- name: Rust Cache
|
||||||
|
if: ${{ needs.conditions.outputs.should-run == 'true' && steps.wasm.outputs.should-build-wasm == 'true' }}
|
||||||
uses: Swatinem/rust-cache@v2
|
uses: Swatinem/rust-cache@v2
|
||||||
with:
|
with:
|
||||||
workspaces: './rust'
|
workspaces: './rust'
|
||||||
- name: OR Cache Wasm (because wasm cache failed)
|
|
||||||
if: steps.download-wasm.outcome == 'failure'
|
- name: Build Wasm
|
||||||
uses: Swatinem/rust-cache@v2
|
if: ${{ needs.conditions.outputs.should-run == 'true' && steps.wasm.outputs.should-build-wasm == 'true' }}
|
||||||
|
shell: bash
|
||||||
|
run: yarn build:wasm
|
||||||
|
|
||||||
|
- uses: actions/upload-artifact@v4
|
||||||
|
if: needs.conditions.outputs.should-run == 'true'
|
||||||
with:
|
with:
|
||||||
workspaces: './rust'
|
name: prepared-wasm
|
||||||
- name: install good sed
|
path: |
|
||||||
if: ${{ startsWith(matrix.os, 'macos') }}
|
rust/kcl-wasm-lib/pkg/kcl_wasm_lib*
|
||||||
shell: bash
|
|
||||||
|
|
||||||
|
snapshots:
|
||||||
|
name: playwright:snapshots:ubuntu
|
||||||
|
runs-on: runs-on=${{ github.run_id }}/family=i7ie.2xlarge/image=ubuntu22-full-x64
|
||||||
|
needs: [conditions, prepare-wasm]
|
||||||
|
steps:
|
||||||
|
- uses: actions/create-github-app-token@v1
|
||||||
|
if: needs.conditions.outputs.should-run == 'true'
|
||||||
|
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
|
||||||
|
if: needs.conditions.outputs.should-run == 'true'
|
||||||
|
with:
|
||||||
|
token: ${{ steps.app-token.outputs.token }}
|
||||||
|
|
||||||
|
- uses: actions/download-artifact@v4
|
||||||
|
if: needs.conditions.outputs.should-run == 'true'
|
||||||
|
name: prepared-wasm
|
||||||
|
|
||||||
|
- name: Copy prepared wasm
|
||||||
|
if: needs.conditions.outputs.should-run == 'true'
|
||||||
run: |
|
run: |
|
||||||
brew install gnu-sed
|
ls -R prepared-wasm
|
||||||
echo "/opt/homebrew/opt/gnu-sed/libexec/gnubin" >> $GITHUB_PATH
|
cp prepared-wasm/kcl_wasm_lib_bg.wasm public
|
||||||
- name: Install vector
|
mkdir rust/kcl-wasm-lib/pkg
|
||||||
shell: bash
|
cp prepared-wasm/kcl_wasm_lib* rust/kcl-wasm-lib/pkg
|
||||||
# TODO: figure out what to do with this, it's failing
|
|
||||||
if: false
|
- uses: actions/setup-node@v4
|
||||||
run: |
|
if: needs.conditions.outputs.should-run == 'true'
|
||||||
curl --proto '=https' --tlsv1.2 -sSfL https://sh.vector.dev > /tmp/vector.sh
|
with:
|
||||||
chmod +x /tmp/vector.sh
|
node-version-file: '.nvmrc'
|
||||||
/tmp/vector.sh -y -no-modify-path
|
cache: 'yarn'
|
||||||
mkdir -p /tmp/vector
|
|
||||||
cp .github/workflows/vector.toml /tmp/vector.toml
|
- name: Install dependencies
|
||||||
sed -i "s#GITHUB_WORKFLOW#${GITHUB_WORKFLOW}#g" /tmp/vector.toml
|
id: deps-install
|
||||||
sed -i "s#GITHUB_REPOSITORY#${GITHUB_REPOSITORY}#g" /tmp/vector.toml
|
if: needs.conditions.outputs.should-run == 'true'
|
||||||
sed -i "s#GITHUB_SHA#${GITHUB_SHA}#g" /tmp/vector.toml
|
run: yarn
|
||||||
sed -i "s#GITHUB_REF_NAME#${GITHUB_REF_NAME}#g" /tmp/vector.toml
|
|
||||||
sed -i "s#GH_ACTIONS_AXIOM_TOKEN#${{secrets.GH_ACTIONS_AXIOM_TOKEN}}#g" /tmp/vector.toml
|
- name: Cache Playwright Browsers
|
||||||
cat /tmp/vector.toml
|
if: needs.conditions.outputs.should-run == 'true'
|
||||||
${HOME}/.vector/bin/vector --config /tmp/vector.toml &
|
uses: actions/cache@v4
|
||||||
- name: Build Wasm (because rust diff)
|
with:
|
||||||
if: github.event_name == 'schedule' || steps.filter.outputs.rust == 'true'
|
path: |
|
||||||
shell: bash
|
~/.cache/ms-playwright/
|
||||||
run: yarn build:wasm
|
key: ${{ runner.os }}-playwright-${{ hashFiles('yarn.lock') }}
|
||||||
- name: OR Build Wasm (because wasm cache failed)
|
|
||||||
if: steps.download-wasm.outcome == 'failure'
|
- name: Install Playwright Browsers
|
||||||
shell: bash
|
if: needs.conditions.outputs.should-run == 'true'
|
||||||
run: yarn build:wasm
|
run: yarn playwright install --with-deps
|
||||||
|
|
||||||
- name: build web
|
- name: build web
|
||||||
shell: bash
|
if: needs.conditions.outputs.should-run == 'true'
|
||||||
run: yarn tronb:vite:dev
|
run: yarn tronb:vite:dev
|
||||||
|
|
||||||
- name: Run ubuntu/chrome snapshots
|
- name: Run ubuntu/chrome snapshots
|
||||||
if: ${{ matrix.os == 'namespace-profile-ubuntu-8-cores' && matrix.shardIndex == 1 }}
|
if: needs.conditions.outputs.should-run == 'true'
|
||||||
|
uses: nick-fields/retry@v3.0.2
|
||||||
|
with:
|
||||||
shell: bash
|
shell: bash
|
||||||
# TODO: break this in its own job, for now it's not slowing down the overall execution as ubuntu is the quickest,
|
command: yarn test:snapshots
|
||||||
# but we could do better. This forces a large 1/1 shard of all 20 snapshot tests that runs in about 3 minutes.
|
timeout_minutes: 30
|
||||||
run: |
|
max_attempts: 3
|
||||||
yarn test:snapshots
|
|
||||||
env:
|
env:
|
||||||
CI: true
|
CI: true
|
||||||
NODE_ENV: development
|
NODE_ENV: development
|
||||||
@ -142,20 +233,18 @@ jobs:
|
|||||||
VITE_KC_SKIP_AUTH: true
|
VITE_KC_SKIP_AUTH: true
|
||||||
token: ${{ secrets.KITTYCAD_API_TOKEN_DEV }}
|
token: ${{ secrets.KITTYCAD_API_TOKEN_DEV }}
|
||||||
snapshottoken: ${{ secrets.KITTYCAD_API_TOKEN }}
|
snapshottoken: ${{ secrets.KITTYCAD_API_TOKEN }}
|
||||||
|
|
||||||
- uses: actions/upload-artifact@v4
|
- uses: actions/upload-artifact@v4
|
||||||
if: ${{ !cancelled() && (success() || failure()) }}
|
if: ${{ needs.conditions.outputs.should-run == 'true' && !cancelled() && (success() || failure()) }}
|
||||||
with:
|
with:
|
||||||
name: playwright-report-snapshots-${{ matrix.os }}-snapshot-${{ matrix.shardIndex }}-${{ github.sha }}
|
name: playwright-report-ubuntu-snapshot-${{ github.sha }}
|
||||||
path: playwright-report/
|
path: playwright-report/
|
||||||
include-hidden-files: true
|
include-hidden-files: true
|
||||||
retention-days: 30
|
retention-days: 30
|
||||||
overwrite: true
|
overwrite: true
|
||||||
- name: Clean up test-results
|
|
||||||
if: ${{ !cancelled() && (success() || failure()) }}
|
|
||||||
continue-on-error: true
|
|
||||||
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: ${{ needs.conditions.outputs.should-run == 'true' && github.ref != 'refs/heads/main' }}
|
||||||
shell: bash
|
shell: bash
|
||||||
id: git-check
|
id: git-check
|
||||||
run: |
|
run: |
|
||||||
@ -164,8 +253,9 @@ jobs:
|
|||||||
then echo "modified=true" >> $GITHUB_OUTPUT
|
then echo "modified=true" >> $GITHUB_OUTPUT
|
||||||
else echo "modified=false" >> $GITHUB_OUTPUT
|
else echo "modified=false" >> $GITHUB_OUTPUT
|
||||||
fi
|
fi
|
||||||
|
|
||||||
- name: Commit changes, if any
|
- name: Commit changes, if any
|
||||||
if: steps.git-check.outputs.modified == 'true'
|
if: ${{ needs.conditions.outputs.should-run == 'true' && steps.git-check.outputs.modified == 'true' }}
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
git add e2e/playwright/snapshot-tests.spec.ts-snapshots e2e/playwright/snapshots
|
git add e2e/playwright/snapshot-tests.spec.ts-snapshots e2e/playwright/snapshots
|
||||||
@ -175,32 +265,106 @@ jobs:
|
|||||||
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 -m "A snapshot a day keeps the bugs away! 📷🐛" || 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
|
|
||||||
- uses: actions/upload-artifact@v4
|
electron:
|
||||||
if: steps.git-check.outputs.modified == 'true'
|
needs: [conditions, prepare-wasm]
|
||||||
with:
|
timeout-minutes: 60
|
||||||
name: playwright-report-${{ matrix.os }}-${{ matrix.shardIndex }}-${{ github.sha }}
|
env:
|
||||||
path: playwright-report/
|
OS_NAME: ${{ contains(matrix.os, 'ubuntu') && 'ubuntu' || (contains(matrix.os, 'windows') && 'windows' || 'macos') }}
|
||||||
include-hidden-files: true
|
name: playwright:electron:${{ contains(matrix.os, 'ubuntu') && 'ubuntu' || (contains(matrix.os, 'windows') && 'windows' || 'macos') }}:${{ matrix.shardIndex }}:${{ matrix.shardTotal }}
|
||||||
retention-days: 30
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
# TODO: enable namespace-profile-windows-latest once available
|
||||||
|
os:
|
||||||
|
- "runs-on=${{ github.run_id }}/family=i7ie.2xlarge/image=ubuntu22-full-x64"
|
||||||
|
- namespace-profile-macos-8-cores
|
||||||
|
- windows-latest
|
||||||
|
shardIndex: [1, 2, 3, 4]
|
||||||
|
shardTotal: [4]
|
||||||
|
# Disable macos and windows tests on hourly e2e tests since we only care
|
||||||
|
# about server side changes.
|
||||||
|
# Technique from https://github.com/joaomcteixeira/python-project-skeleton/pull/31/files
|
||||||
|
isScheduled:
|
||||||
|
- ${{ github.event_name == 'schedule' }}
|
||||||
|
exclude:
|
||||||
|
- os: namespace-profile-macos-8-cores
|
||||||
|
isScheduled: true
|
||||||
|
- os: windows-latest
|
||||||
|
isScheduled: true
|
||||||
|
# TODO: add ref here for main and latest release tag
|
||||||
|
runs-on: ${{ matrix.os }}
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
if: needs.conditions.outputs.should-run == 'true'
|
||||||
|
|
||||||
- uses: actions/download-artifact@v4
|
- uses: actions/download-artifact@v4
|
||||||
if: ${{ !cancelled() && (success() || failure()) }}
|
if: needs.conditions.outputs.should-run == 'true'
|
||||||
|
name: prepared-wasm
|
||||||
|
|
||||||
|
- name: Copy prepared wasm
|
||||||
|
if: needs.conditions.outputs.should-run == 'true'
|
||||||
|
run: |
|
||||||
|
ls -R prepared-wasm
|
||||||
|
cp prepared-wasm/kcl_wasm_lib_bg.wasm public
|
||||||
|
mkdir rust/kcl-wasm-lib/pkg
|
||||||
|
cp prepared-wasm/kcl_wasm_lib* rust/kcl-wasm-lib/pkg
|
||||||
|
|
||||||
|
- uses: actions/setup-node@v4
|
||||||
|
if: needs.conditions.outputs.should-run == 'true'
|
||||||
|
with:
|
||||||
|
node-version-file: '.nvmrc'
|
||||||
|
cache: 'yarn'
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
id: deps-install
|
||||||
|
if: needs.conditions.outputs.should-run == 'true'
|
||||||
|
run: yarn
|
||||||
|
|
||||||
|
- name: Cache Playwright Browsers
|
||||||
|
if: needs.conditions.outputs.should-run == 'true'
|
||||||
|
uses: actions/cache@v4
|
||||||
|
with:
|
||||||
|
path: |
|
||||||
|
~/.cache/ms-playwright/
|
||||||
|
key: ${{ runner.os }}-playwright-${{ hashFiles('yarn.lock') }}
|
||||||
|
|
||||||
|
- name: Install Playwright Browsers
|
||||||
|
if: needs.conditions.outputs.should-run == 'true'
|
||||||
|
run: yarn playwright install --with-deps
|
||||||
|
|
||||||
|
- name: Build web
|
||||||
|
if: needs.conditions.outputs.should-run == 'true'
|
||||||
|
run: yarn tronb:vite:dev
|
||||||
|
|
||||||
|
- name: Install good sed
|
||||||
|
if: startsWith(matrix.os, 'macos')
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
brew install gnu-sed
|
||||||
|
echo "/opt/homebrew/opt/gnu-sed/libexec/gnubin" >> $GITHUB_PATH
|
||||||
|
|
||||||
|
# TODO: Add back axiom logs
|
||||||
|
|
||||||
|
- uses: actions/download-artifact@v4
|
||||||
|
if: ${{ needs.conditions.outputs.should-run == 'true' && !cancelled() && (success() || failure()) }}
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
with:
|
with:
|
||||||
name: test-results-${{ matrix.os }}-${{ matrix.shardIndex }}-${{ github.sha }}
|
name: test-results-${{ env.OS_NAME }}-${{ matrix.shardIndex }}-${{ github.sha }}
|
||||||
path: test-results/
|
path: test-results/
|
||||||
|
|
||||||
- name: Run playwright/electron flow (with retries)
|
- name: Run playwright/electron flow (with retries)
|
||||||
id: retry
|
id: retry
|
||||||
if: ${{ !cancelled() && steps.deps-install.outcome == 'success' }}
|
if: ${{ needs.conditions.outputs.should-run == 'true' && !cancelled() && steps.deps-install.outcome == 'success' }}
|
||||||
uses: nick-fields/retry@v3.0.2
|
uses: nick-fields/retry@v3.0.2
|
||||||
with:
|
with:
|
||||||
shell: bash
|
shell: bash
|
||||||
command: .github/ci-cd-scripts/playwright-electron.sh ${{matrix.shardIndex}} ${{matrix.shardTotal}} ${{matrix.os}}
|
command: .github/ci-cd-scripts/playwright-electron.sh ${{matrix.shardIndex}} ${{matrix.shardTotal}} ${{ env.OS_NAME }}
|
||||||
timeout_minutes: 30
|
timeout_minutes: 45
|
||||||
max_attempts: 25
|
max_attempts: 15
|
||||||
env:
|
env:
|
||||||
CI: true
|
CI: true
|
||||||
FAIL_ON_CONSOLE_ERRORS: true
|
FAIL_ON_CONSOLE_ERRORS: true
|
||||||
@ -208,20 +372,21 @@ jobs:
|
|||||||
VITE_KC_DEV_TOKEN: ${{ secrets.KITTYCAD_API_TOKEN_DEV }}
|
VITE_KC_DEV_TOKEN: ${{ secrets.KITTYCAD_API_TOKEN_DEV }}
|
||||||
VITE_KC_SKIP_AUTH: true
|
VITE_KC_SKIP_AUTH: true
|
||||||
token: ${{ secrets.KITTYCAD_API_TOKEN_DEV }}
|
token: ${{ secrets.KITTYCAD_API_TOKEN_DEV }}
|
||||||
|
|
||||||
- uses: actions/upload-artifact@v4
|
- uses: actions/upload-artifact@v4
|
||||||
if: always()
|
if: ${{ needs.conditions.outputs.should-run == 'true' && always() }}
|
||||||
with:
|
with:
|
||||||
name: test-results-${{ matrix.os }}-${{ matrix.shardIndex }}-${{ github.sha }}
|
name: test-results-${{ env.OS_NAME }}-${{ matrix.shardIndex }}-${{ github.sha }}
|
||||||
path: test-results/
|
path: test-results/
|
||||||
include-hidden-files: true
|
include-hidden-files: true
|
||||||
retention-days: 30
|
retention-days: 30
|
||||||
overwrite: true
|
overwrite: true
|
||||||
|
|
||||||
- uses: actions/upload-artifact@v4
|
- uses: actions/upload-artifact@v4
|
||||||
if: always()
|
if: ${{ needs.conditions.outputs.should-run == 'true' && always() }}
|
||||||
with:
|
with:
|
||||||
name: playwright-report-${{ matrix.os }}-${{ matrix.shardIndex }}-${{ github.sha }}
|
name: playwright-report-${{ env.OS_NAME }}-${{ matrix.shardIndex }}-${{ github.sha }}
|
||||||
path: playwright-report/
|
path: playwright-report/
|
||||||
include-hidden-files: true
|
include-hidden-files: true
|
||||||
retention-days: 30
|
retention-days: 30
|
||||||
overwrite: true
|
overwrite: true
|
||||||
|
|
||||||
|
13
.github/workflows/generate-website-docs.yml
vendored
13
.github/workflows/generate-website-docs.yml
vendored
@ -5,6 +5,7 @@ on:
|
|||||||
paths:
|
paths:
|
||||||
- .github/workflows/generate-website-docs.yml
|
- .github/workflows/generate-website-docs.yml
|
||||||
- 'docs/**'
|
- 'docs/**'
|
||||||
|
- 'public/kcl-samples/**'
|
||||||
pull_request:
|
pull_request:
|
||||||
paths:
|
paths:
|
||||||
- .github/workflows/generate-website-docs.yml
|
- .github/workflows/generate-website-docs.yml
|
||||||
@ -39,9 +40,21 @@ jobs:
|
|||||||
# cleanup old
|
# cleanup old
|
||||||
rm -rf documentation/content/pages/docs/kcl/*.md
|
rm -rf documentation/content/pages/docs/kcl/*.md
|
||||||
rm -rf documentation/content/pages/docs/kcl/types
|
rm -rf documentation/content/pages/docs/kcl/types
|
||||||
|
rm -rf documentation/content/pages/docs/kcl/settings
|
||||||
|
rm -rf documentation/content/pages/docs/kcl/consts
|
||||||
# move new
|
# move new
|
||||||
mv -f docs/kcl/*.md documentation/content/pages/docs/kcl/
|
mv -f docs/kcl/*.md documentation/content/pages/docs/kcl/
|
||||||
mv -f docs/kcl/types documentation/content/pages/docs/kcl/
|
mv -f docs/kcl/types documentation/content/pages/docs/kcl/
|
||||||
|
mv -f docs/kcl/settings documentation/content/pages/docs/kcl/
|
||||||
|
mv -f docs/kcl/consts documentation/content/pages/docs/kcl/
|
||||||
|
- name: move kcl-samples
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
mkdir -p documentation/content/pages/docs/kcl-samples
|
||||||
|
# cleanup old
|
||||||
|
rm -rf documentation/content/pages/docs/kcl-samples/*
|
||||||
|
# move new
|
||||||
|
mv -f public/kcl-samples/* documentation/content/pages/docs/kcl-samples/
|
||||||
- name: commit the changes in the docs repo
|
- name: commit the changes in the docs repo
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
|
5
.github/workflows/kcl-python-bindings.yml
vendored
5
.github/workflows/kcl-python-bindings.yml
vendored
@ -159,10 +159,13 @@ jobs:
|
|||||||
if: startsWith(github.ref, 'refs/tags/')
|
if: startsWith(github.ref, 'refs/tags/')
|
||||||
needs: [linux-x86_64, windows, macos, sdist]
|
needs: [linux-x86_64, windows, macos, sdist]
|
||||||
steps:
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
- uses: actions/download-artifact@v4
|
- uses: actions/download-artifact@v4
|
||||||
|
with:
|
||||||
|
path: rust/kcl-python-bindings
|
||||||
- name: Install the latest version of uv
|
- name: Install the latest version of uv
|
||||||
uses: astral-sh/setup-uv@v5
|
uses: astral-sh/setup-uv@v5
|
||||||
- name: Install codespell
|
- name: do uv things
|
||||||
run: |
|
run: |
|
||||||
cd rust/kcl-python-bindings
|
cd rust/kcl-python-bindings
|
||||||
uv venv .venv
|
uv venv .venv
|
||||||
|
6
.gitignore
vendored
6
.gitignore
vendored
@ -51,14 +51,16 @@ e2e/playwright/export-snapshots/*
|
|||||||
!e2e/playwright/export-snapshots/*.png
|
!e2e/playwright/export-snapshots/*.png
|
||||||
!e2e/playwright/snapshot-tests.spec.ts-snapshots/*.png
|
!e2e/playwright/snapshot-tests.spec.ts-snapshots/*.png
|
||||||
|
|
||||||
/kcl-samples
|
/public/kcl-samples.zip
|
||||||
|
/public/kcl-samples/.github
|
||||||
|
/public/kcl-samples/screenshots/main.kcl
|
||||||
|
/public/kcl-samples/step/main.kcl
|
||||||
/test-results/
|
/test-results/
|
||||||
/playwright-report/
|
/playwright-report/
|
||||||
/blob-report/
|
/blob-report/
|
||||||
/playwright/.cache/
|
/playwright/.cache/
|
||||||
/src/lang/std/artifactMapCache
|
/src/lang/std/artifactMapCache
|
||||||
|
|
||||||
|
|
||||||
## generated files
|
## generated files
|
||||||
src/**/*.typegen.ts
|
src/**/*.typegen.ts
|
||||||
|
|
||||||
|
2
Makefile
2
Makefile
@ -4,7 +4,7 @@ KCL_WASM_LIB_FILES := $(wildcard rust/**/*.rs)
|
|||||||
TS_SRC := $(wildcard src/**/*.tsx) $(wildcard src/**/*.ts)
|
TS_SRC := $(wildcard src/**/*.tsx) $(wildcard src/**/*.ts)
|
||||||
XSTATE_TYPEGENS := $(wildcard src/machines/*.typegen.ts)
|
XSTATE_TYPEGENS := $(wildcard src/machines/*.typegen.ts)
|
||||||
|
|
||||||
dev: node_modules public/wasm_lib_bg.wasm $(XSTATE_TYPEGENS)
|
dev: node_modules public/kcl_wasm_lib_bg.wasm $(XSTATE_TYPEGENS)
|
||||||
yarn start
|
yarn start
|
||||||
|
|
||||||
# I'm sorry this is so specific to my setup you may as well ignore this.
|
# I'm sorry this is so specific to my setup you may as well ignore this.
|
||||||
|
10
README.md
10
README.md
@ -105,7 +105,7 @@ Finally, to run the web app only, run:
|
|||||||
yarn start
|
yarn start
|
||||||
```
|
```
|
||||||
|
|
||||||
If you're not a Zoo employee you won't be able to access the dev environment, you should copy everything from `.env.production` to `.env.development` to make it point to production instead, then when you navigate to `localhost:3000` the easiest way to sign in is to paste `localStorage.setItem('TOKEN_PERSIST_KEY', "your-token-from-https://zoo.dev/account/api-tokens")` replacing the with a real token from https://zoo.dev/account/api-tokens of course, then navigate to localhost:3000 again. Note that navigating to `localhost:3000/signin` removes your token so you will need to set the token again.
|
If you're not a Zoo employee you won't be able to access the dev environment, you should copy everything from `.env.production` to `.env.development.local` to make it point to production instead, then when you navigate to `localhost:3000` the easiest way to sign in is to paste `localStorage.setItem('TOKEN_PERSIST_KEY', "your-token-from-https://zoo.dev/account/api-tokens")` replacing the with a real token from https://zoo.dev/account/api-tokens of course, then navigate to `localhost:3000` again. Note that navigating to `localhost:3000/signin` removes your token so you will need to set the token again.
|
||||||
|
|
||||||
### Development environment variables
|
### Development environment variables
|
||||||
|
|
||||||
@ -122,7 +122,7 @@ Third-Party Cookies".
|
|||||||
|
|
||||||
## Desktop
|
## Desktop
|
||||||
|
|
||||||
To spin up the desktop app, `yarn install` and `yarn build:wasm` need to have been done before hand then
|
To spin up the desktop app, `yarn install` and `yarn build:wasm` need to have been done before hand then:
|
||||||
|
|
||||||
```
|
```
|
||||||
yarn tron:start
|
yarn tron:start
|
||||||
@ -130,13 +130,13 @@ yarn tron:start
|
|||||||
|
|
||||||
This will start the application and hot-reload on changes.
|
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 Command-Option-I (macOS) or Ctrl-Shift-I (Linux and Windows).
|
||||||
|
|
||||||
To package the app for your platform with electron-builder, run `yarn tronb:package:dev` (or `yarn tronb:package:prod` to point to the .env.production variables)
|
To package the app for your platform with electron-builder, run `yarn tronb:package:dev` (or `yarn tronb:package:prod` to point to the .env.production variables).
|
||||||
|
|
||||||
## Checking out commits / Bisecting
|
## Checking out commits / Bisecting
|
||||||
|
|
||||||
Which commands from setup are one off vs need to be run every time?
|
Which commands from setup are one off vs. need to be run every time?
|
||||||
|
|
||||||
The following will need to be run when checking out a new commit and guarantees the build is not stale:
|
The following will need to be run when checking out a new commit and guarantees the build is not stale:
|
||||||
|
|
||||||
|
@ -21,11 +21,11 @@ abs(num: number): number
|
|||||||
|
|
||||||
| Name | Type | Description | Required |
|
| Name | Type | Description | Required |
|
||||||
|----------|------|-------------|----------|
|
|----------|------|-------------|----------|
|
||||||
| `num` | `number` | | Yes |
|
| `num` | [`number`](/docs/kcl/types/number) | | Yes |
|
||||||
|
|
||||||
### Returns
|
### Returns
|
||||||
|
|
||||||
`number`
|
[`number`](/docs/kcl/types/number)
|
||||||
|
|
||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
@ -21,11 +21,11 @@ acos(num: number): number
|
|||||||
|
|
||||||
| Name | Type | Description | Required |
|
| Name | Type | Description | Required |
|
||||||
|----------|------|-------------|----------|
|
|----------|------|-------------|----------|
|
||||||
| `num` | `number` | | Yes |
|
| `num` | [`number`](/docs/kcl/types/number) | | Yes |
|
||||||
|
|
||||||
### Returns
|
### Returns
|
||||||
|
|
||||||
`number`
|
[`number`](/docs/kcl/types/number)
|
||||||
|
|
||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
@ -21,13 +21,13 @@ angleToMatchLengthX(
|
|||||||
|
|
||||||
| Name | Type | Description | Required |
|
| Name | Type | Description | Required |
|
||||||
|----------|------|-------------|----------|
|
|----------|------|-------------|----------|
|
||||||
| `tag` | [`TagIdentifier`](/docs/kcl/types#tag-identifier) | | Yes |
|
| [`tag`](/docs/kcl/types/tag) | [`TagIdentifier`](/docs/kcl/types#tag-identifier) | | Yes |
|
||||||
| `to` | `number` | | Yes |
|
| `to` | [`number`](/docs/kcl/types/number) | | Yes |
|
||||||
| `sketch` | [`Sketch`](/docs/kcl/types/Sketch) | A sketch is a collection of paths. | Yes |
|
| `sketch` | [`Sketch`](/docs/kcl/types/Sketch) | | Yes |
|
||||||
|
|
||||||
### Returns
|
### Returns
|
||||||
|
|
||||||
`number`
|
[`number`](/docs/kcl/types/number)
|
||||||
|
|
||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
@ -21,13 +21,13 @@ angleToMatchLengthY(
|
|||||||
|
|
||||||
| Name | Type | Description | Required |
|
| Name | Type | Description | Required |
|
||||||
|----------|------|-------------|----------|
|
|----------|------|-------------|----------|
|
||||||
| `tag` | [`TagIdentifier`](/docs/kcl/types#tag-identifier) | | Yes |
|
| [`tag`](/docs/kcl/types/tag) | [`TagIdentifier`](/docs/kcl/types#tag-identifier) | | Yes |
|
||||||
| `to` | `number` | | Yes |
|
| `to` | [`number`](/docs/kcl/types/number) | | Yes |
|
||||||
| `sketch` | [`Sketch`](/docs/kcl/types/Sketch) | A sketch is a collection of paths. | Yes |
|
| `sketch` | [`Sketch`](/docs/kcl/types/Sketch) | | Yes |
|
||||||
|
|
||||||
### Returns
|
### Returns
|
||||||
|
|
||||||
`number`
|
[`number`](/docs/kcl/types/number)
|
||||||
|
|
||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
@ -40,7 +40,7 @@ sketch001 = startSketchOn('XZ')
|
|||||||
angle = angleToMatchLengthY(seg01, 15, %),
|
angle = angleToMatchLengthY(seg01, 15, %),
|
||||||
length = 5
|
length = 5
|
||||||
}, %)
|
}, %)
|
||||||
|> yLineTo(0, %)
|
|> yLine(endAbsolute = 0)
|
||||||
|> close()
|
|> close()
|
||||||
|
|
||||||
extrusion = extrude(sketch001, length = 5)
|
extrusion = extrude(sketch001, length = 5)
|
||||||
|
@ -22,12 +22,12 @@ angledLine(
|
|||||||
| Name | Type | Description | Required |
|
| Name | Type | Description | Required |
|
||||||
|----------|------|-------------|----------|
|
|----------|------|-------------|----------|
|
||||||
| `data` | [`AngledLineData`](/docs/kcl/types/AngledLineData) | Data to draw an angled line. | Yes |
|
| `data` | [`AngledLineData`](/docs/kcl/types/AngledLineData) | Data to draw an angled line. | Yes |
|
||||||
| `sketch` | [`Sketch`](/docs/kcl/types/Sketch) | A sketch is a collection of paths. | Yes |
|
| `sketch` | [`Sketch`](/docs/kcl/types/Sketch) | | Yes |
|
||||||
| `tag` | [`TagDeclarator`](/docs/kcl/types#tag-declaration) | | No |
|
| [`tag`](/docs/kcl/types/tag) | [`TagDeclarator`](/docs/kcl/types#tag-declaration) | | No |
|
||||||
|
|
||||||
### Returns
|
### Returns
|
||||||
|
|
||||||
[`Sketch`](/docs/kcl/types/Sketch) - A sketch is a collection of paths.
|
[`Sketch`](/docs/kcl/types/Sketch)
|
||||||
|
|
||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
@ -35,10 +35,10 @@ angledLine(
|
|||||||
```js
|
```js
|
||||||
exampleSketch = startSketchOn(XZ)
|
exampleSketch = startSketchOn(XZ)
|
||||||
|> startProfileAt([0, 0], %)
|
|> startProfileAt([0, 0], %)
|
||||||
|> yLineTo(15, %)
|
|> yLine(endAbsolute = 15)
|
||||||
|> angledLine({ angle = 30, length = 15 }, %)
|
|> angledLine({ angle = 30, length = 15 }, %)
|
||||||
|> line(end = [8, -10])
|
|> line(end = [8, -10])
|
||||||
|> yLineTo(0, %)
|
|> yLine(endAbsolute = 0)
|
||||||
|> close()
|
|> close()
|
||||||
|
|
||||||
example = extrude(exampleSketch, length = 10)
|
example = extrude(exampleSketch, length = 10)
|
||||||
|
@ -22,12 +22,12 @@ angledLineOfXLength(
|
|||||||
| Name | Type | Description | Required |
|
| Name | Type | Description | Required |
|
||||||
|----------|------|-------------|----------|
|
|----------|------|-------------|----------|
|
||||||
| `data` | [`AngledLineData`](/docs/kcl/types/AngledLineData) | Data to draw an angled line. | Yes |
|
| `data` | [`AngledLineData`](/docs/kcl/types/AngledLineData) | Data to draw an angled line. | Yes |
|
||||||
| `sketch` | [`Sketch`](/docs/kcl/types/Sketch) | A sketch is a collection of paths. | Yes |
|
| `sketch` | [`Sketch`](/docs/kcl/types/Sketch) | | Yes |
|
||||||
| `tag` | [`TagDeclarator`](/docs/kcl/types#tag-declaration) | | No |
|
| [`tag`](/docs/kcl/types/tag) | [`TagDeclarator`](/docs/kcl/types#tag-declaration) | | No |
|
||||||
|
|
||||||
### Returns
|
### Returns
|
||||||
|
|
||||||
[`Sketch`](/docs/kcl/types/Sketch) - A sketch is a collection of paths.
|
[`Sketch`](/docs/kcl/types/Sketch)
|
||||||
|
|
||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
@ -22,12 +22,12 @@ angledLineOfYLength(
|
|||||||
| Name | Type | Description | Required |
|
| Name | Type | Description | Required |
|
||||||
|----------|------|-------------|----------|
|
|----------|------|-------------|----------|
|
||||||
| `data` | [`AngledLineData`](/docs/kcl/types/AngledLineData) | Data to draw an angled line. | Yes |
|
| `data` | [`AngledLineData`](/docs/kcl/types/AngledLineData) | Data to draw an angled line. | Yes |
|
||||||
| `sketch` | [`Sketch`](/docs/kcl/types/Sketch) | A sketch is a collection of paths. | Yes |
|
| `sketch` | [`Sketch`](/docs/kcl/types/Sketch) | | Yes |
|
||||||
| `tag` | [`TagDeclarator`](/docs/kcl/types#tag-declaration) | | No |
|
| [`tag`](/docs/kcl/types/tag) | [`TagDeclarator`](/docs/kcl/types#tag-declaration) | | No |
|
||||||
|
|
||||||
### Returns
|
### Returns
|
||||||
|
|
||||||
[`Sketch`](/docs/kcl/types/Sketch) - A sketch is a collection of paths.
|
[`Sketch`](/docs/kcl/types/Sketch)
|
||||||
|
|
||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
@ -22,12 +22,12 @@ angledLineThatIntersects(
|
|||||||
| Name | Type | Description | Required |
|
| Name | Type | Description | Required |
|
||||||
|----------|------|-------------|----------|
|
|----------|------|-------------|----------|
|
||||||
| `data` | [`AngledLineThatIntersectsData`](/docs/kcl/types/AngledLineThatIntersectsData) | Data for drawing an angled line that intersects with a given line. | Yes |
|
| `data` | [`AngledLineThatIntersectsData`](/docs/kcl/types/AngledLineThatIntersectsData) | Data for drawing an angled line that intersects with a given line. | Yes |
|
||||||
| `sketch` | [`Sketch`](/docs/kcl/types/Sketch) | A sketch is a collection of paths. | Yes |
|
| `sketch` | [`Sketch`](/docs/kcl/types/Sketch) | | Yes |
|
||||||
| `tag` | [`TagDeclarator`](/docs/kcl/types#tag-declaration) | | No |
|
| [`tag`](/docs/kcl/types/tag) | [`TagDeclarator`](/docs/kcl/types#tag-declaration) | | No |
|
||||||
|
|
||||||
### Returns
|
### Returns
|
||||||
|
|
||||||
[`Sketch`](/docs/kcl/types/Sketch) - A sketch is a collection of paths.
|
[`Sketch`](/docs/kcl/types/Sketch)
|
||||||
|
|
||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
@ -22,12 +22,12 @@ angledLineToX(
|
|||||||
| Name | Type | Description | Required |
|
| Name | Type | Description | Required |
|
||||||
|----------|------|-------------|----------|
|
|----------|------|-------------|----------|
|
||||||
| `data` | [`AngledLineToData`](/docs/kcl/types/AngledLineToData) | Data to draw an angled line to a point. | Yes |
|
| `data` | [`AngledLineToData`](/docs/kcl/types/AngledLineToData) | Data to draw an angled line to a point. | Yes |
|
||||||
| `sketch` | [`Sketch`](/docs/kcl/types/Sketch) | A sketch is a collection of paths. | Yes |
|
| `sketch` | [`Sketch`](/docs/kcl/types/Sketch) | | Yes |
|
||||||
| `tag` | [`TagDeclarator`](/docs/kcl/types#tag-declaration) | | No |
|
| [`tag`](/docs/kcl/types/tag) | [`TagDeclarator`](/docs/kcl/types#tag-declaration) | | No |
|
||||||
|
|
||||||
### Returns
|
### Returns
|
||||||
|
|
||||||
[`Sketch`](/docs/kcl/types/Sketch) - A sketch is a collection of paths.
|
[`Sketch`](/docs/kcl/types/Sketch)
|
||||||
|
|
||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
@ -22,12 +22,12 @@ angledLineToY(
|
|||||||
| Name | Type | Description | Required |
|
| Name | Type | Description | Required |
|
||||||
|----------|------|-------------|----------|
|
|----------|------|-------------|----------|
|
||||||
| `data` | [`AngledLineToData`](/docs/kcl/types/AngledLineToData) | Data to draw an angled line to a point. | Yes |
|
| `data` | [`AngledLineToData`](/docs/kcl/types/AngledLineToData) | Data to draw an angled line to a point. | Yes |
|
||||||
| `sketch` | [`Sketch`](/docs/kcl/types/Sketch) | A sketch is a collection of paths. | Yes |
|
| `sketch` | [`Sketch`](/docs/kcl/types/Sketch) | | Yes |
|
||||||
| `tag` | [`TagDeclarator`](/docs/kcl/types#tag-declaration) | | No |
|
| [`tag`](/docs/kcl/types/tag) | [`TagDeclarator`](/docs/kcl/types#tag-declaration) | | No |
|
||||||
|
|
||||||
### Returns
|
### Returns
|
||||||
|
|
||||||
[`Sketch`](/docs/kcl/types/Sketch) - A sketch is a collection of paths.
|
[`Sketch`](/docs/kcl/types/Sketch)
|
||||||
|
|
||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
File diff suppressed because one or more lines are too long
@ -24,12 +24,12 @@ arc(
|
|||||||
| Name | Type | Description | Required |
|
| Name | Type | Description | Required |
|
||||||
|----------|------|-------------|----------|
|
|----------|------|-------------|----------|
|
||||||
| `data` | [`ArcData`](/docs/kcl/types/ArcData) | Data to draw an arc. | Yes |
|
| `data` | [`ArcData`](/docs/kcl/types/ArcData) | Data to draw an arc. | Yes |
|
||||||
| `sketch` | [`Sketch`](/docs/kcl/types/Sketch) | A sketch is a collection of paths. | Yes |
|
| `sketch` | [`Sketch`](/docs/kcl/types/Sketch) | | Yes |
|
||||||
| `tag` | [`TagDeclarator`](/docs/kcl/types#tag-declaration) | | No |
|
| [`tag`](/docs/kcl/types/tag) | [`TagDeclarator`](/docs/kcl/types#tag-declaration) | | No |
|
||||||
|
|
||||||
### Returns
|
### Returns
|
||||||
|
|
||||||
[`Sketch`](/docs/kcl/types/Sketch) - A sketch is a collection of paths.
|
[`Sketch`](/docs/kcl/types/Sketch)
|
||||||
|
|
||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
@ -22,12 +22,12 @@ arcTo(
|
|||||||
| Name | Type | Description | Required |
|
| Name | Type | Description | Required |
|
||||||
|----------|------|-------------|----------|
|
|----------|------|-------------|----------|
|
||||||
| `data` | [`ArcToData`](/docs/kcl/types/ArcToData) | Data to draw a three point arc (arcTo). | Yes |
|
| `data` | [`ArcToData`](/docs/kcl/types/ArcToData) | Data to draw a three point arc (arcTo). | Yes |
|
||||||
| `sketch` | [`Sketch`](/docs/kcl/types/Sketch) | A sketch is a collection of paths. | Yes |
|
| `sketch` | [`Sketch`](/docs/kcl/types/Sketch) | | Yes |
|
||||||
| `tag` | [`TagDeclarator`](/docs/kcl/types#tag-declaration) | | No |
|
| [`tag`](/docs/kcl/types/tag) | [`TagDeclarator`](/docs/kcl/types#tag-declaration) | | No |
|
||||||
|
|
||||||
### Returns
|
### Returns
|
||||||
|
|
||||||
[`Sketch`](/docs/kcl/types/Sketch) - A sketch is a collection of paths.
|
[`Sketch`](/docs/kcl/types/Sketch)
|
||||||
|
|
||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
@ -21,11 +21,11 @@ asin(num: number): number
|
|||||||
|
|
||||||
| Name | Type | Description | Required |
|
| Name | Type | Description | Required |
|
||||||
|----------|------|-------------|----------|
|
|----------|------|-------------|----------|
|
||||||
| `num` | `number` | | Yes |
|
| `num` | [`number`](/docs/kcl/types/number) | | Yes |
|
||||||
|
|
||||||
### Returns
|
### Returns
|
||||||
|
|
||||||
`number`
|
[`number`](/docs/kcl/types/number)
|
||||||
|
|
||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
@ -37,7 +37,7 @@ sketch001 = startSketchOn('XZ')
|
|||||||
angle = toDegrees(asin(0.5)),
|
angle = toDegrees(asin(0.5)),
|
||||||
length = 20
|
length = 20
|
||||||
}, %)
|
}, %)
|
||||||
|> yLineTo(0, %)
|
|> yLine(endAbsolute = 0)
|
||||||
|> close()
|
|> close()
|
||||||
|
|
||||||
extrude001 = extrude(sketch001, length = 5)
|
extrude001 = extrude(sketch001, length = 5)
|
||||||
|
@ -20,8 +20,8 @@ assert(
|
|||||||
|
|
||||||
| Name | Type | Description | Required |
|
| Name | Type | Description | Required |
|
||||||
|----------|------|-------------|----------|
|
|----------|------|-------------|----------|
|
||||||
| `data` | `bool` | | Yes |
|
| `data` | [`bool`](/docs/kcl/types/bool) | | Yes |
|
||||||
| `message` | `string` | | Yes |
|
| `message` | [`string`](/docs/kcl/types/string) | | Yes |
|
||||||
|
|
||||||
### Returns
|
### Returns
|
||||||
|
|
||||||
|
@ -22,10 +22,10 @@ assertEqual(
|
|||||||
|
|
||||||
| Name | Type | Description | Required |
|
| Name | Type | Description | Required |
|
||||||
|----------|------|-------------|----------|
|
|----------|------|-------------|----------|
|
||||||
| `left` | `number` | | Yes |
|
| `left` | [`number`](/docs/kcl/types/number) | | Yes |
|
||||||
| `right` | `number` | | Yes |
|
| `right` | [`number`](/docs/kcl/types/number) | | Yes |
|
||||||
| `epsilon` | `number` | | Yes |
|
| `epsilon` | [`number`](/docs/kcl/types/number) | | Yes |
|
||||||
| `message` | `string` | | Yes |
|
| `message` | [`string`](/docs/kcl/types/string) | | Yes |
|
||||||
|
|
||||||
### Returns
|
### Returns
|
||||||
|
|
||||||
|
@ -21,9 +21,9 @@ assertGreaterThan(
|
|||||||
|
|
||||||
| Name | Type | Description | Required |
|
| Name | Type | Description | Required |
|
||||||
|----------|------|-------------|----------|
|
|----------|------|-------------|----------|
|
||||||
| `left` | `number` | | Yes |
|
| `left` | [`number`](/docs/kcl/types/number) | | Yes |
|
||||||
| `right` | `number` | | Yes |
|
| `right` | [`number`](/docs/kcl/types/number) | | Yes |
|
||||||
| `message` | `string` | | Yes |
|
| `message` | [`string`](/docs/kcl/types/string) | | Yes |
|
||||||
|
|
||||||
### Returns
|
### Returns
|
||||||
|
|
||||||
|
@ -21,9 +21,9 @@ assertGreaterThanOrEq(
|
|||||||
|
|
||||||
| Name | Type | Description | Required |
|
| Name | Type | Description | Required |
|
||||||
|----------|------|-------------|----------|
|
|----------|------|-------------|----------|
|
||||||
| `left` | `number` | | Yes |
|
| `left` | [`number`](/docs/kcl/types/number) | | Yes |
|
||||||
| `right` | `number` | | Yes |
|
| `right` | [`number`](/docs/kcl/types/number) | | Yes |
|
||||||
| `message` | `string` | | Yes |
|
| `message` | [`string`](/docs/kcl/types/string) | | Yes |
|
||||||
|
|
||||||
### Returns
|
### Returns
|
||||||
|
|
||||||
|
@ -21,9 +21,9 @@ assertLessThan(
|
|||||||
|
|
||||||
| Name | Type | Description | Required |
|
| Name | Type | Description | Required |
|
||||||
|----------|------|-------------|----------|
|
|----------|------|-------------|----------|
|
||||||
| `left` | `number` | | Yes |
|
| `left` | [`number`](/docs/kcl/types/number) | | Yes |
|
||||||
| `right` | `number` | | Yes |
|
| `right` | [`number`](/docs/kcl/types/number) | | Yes |
|
||||||
| `message` | `string` | | Yes |
|
| `message` | [`string`](/docs/kcl/types/string) | | Yes |
|
||||||
|
|
||||||
### Returns
|
### Returns
|
||||||
|
|
||||||
|
@ -21,9 +21,9 @@ assertLessThanOrEq(
|
|||||||
|
|
||||||
| Name | Type | Description | Required |
|
| Name | Type | Description | Required |
|
||||||
|----------|------|-------------|----------|
|
|----------|------|-------------|----------|
|
||||||
| `left` | `number` | | Yes |
|
| `left` | [`number`](/docs/kcl/types/number) | | Yes |
|
||||||
| `right` | `number` | | Yes |
|
| `right` | [`number`](/docs/kcl/types/number) | | Yes |
|
||||||
| `message` | `string` | | Yes |
|
| `message` | [`string`](/docs/kcl/types/string) | | Yes |
|
||||||
|
|
||||||
### Returns
|
### Returns
|
||||||
|
|
||||||
|
@ -21,11 +21,11 @@ atan(num: number): number
|
|||||||
|
|
||||||
| Name | Type | Description | Required |
|
| Name | Type | Description | Required |
|
||||||
|----------|------|-------------|----------|
|
|----------|------|-------------|----------|
|
||||||
| `num` | `number` | | Yes |
|
| `num` | [`number`](/docs/kcl/types/number) | | Yes |
|
||||||
|
|
||||||
### Returns
|
### Returns
|
||||||
|
|
||||||
`number`
|
[`number`](/docs/kcl/types/number)
|
||||||
|
|
||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
@ -37,7 +37,7 @@ sketch001 = startSketchOn('XZ')
|
|||||||
angle = toDegrees(atan(1.25)),
|
angle = toDegrees(atan(1.25)),
|
||||||
length = 20
|
length = 20
|
||||||
}, %)
|
}, %)
|
||||||
|> yLineTo(0, %)
|
|> yLine(endAbsolute = 0)
|
||||||
|> close()
|
|> close()
|
||||||
|
|
||||||
extrude001 = extrude(sketch001, length = 5)
|
extrude001 = extrude(sketch001, length = 5)
|
||||||
|
@ -24,12 +24,12 @@ atan2(
|
|||||||
|
|
||||||
| Name | Type | Description | Required |
|
| Name | Type | Description | Required |
|
||||||
|----------|------|-------------|----------|
|
|----------|------|-------------|----------|
|
||||||
| `y` | `number` | | Yes |
|
| `y` | [`number`](/docs/kcl/types/number) | | Yes |
|
||||||
| `x` | `number` | | Yes |
|
| `x` | [`number`](/docs/kcl/types/number) | | Yes |
|
||||||
|
|
||||||
### Returns
|
### Returns
|
||||||
|
|
||||||
`number`
|
[`number`](/docs/kcl/types/number)
|
||||||
|
|
||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
@ -41,7 +41,7 @@ sketch001 = startSketchOn('XZ')
|
|||||||
angle = toDegrees(atan2(1.25, 2)),
|
angle = toDegrees(atan2(1.25, 2)),
|
||||||
length = 20
|
length = 20
|
||||||
}, %)
|
}, %)
|
||||||
|> yLineTo(0, %)
|
|> yLine(endAbsolute = 0)
|
||||||
|> close()
|
|> close()
|
||||||
|
|
||||||
extrude001 = extrude(sketch001, length = 5)
|
extrude001 = extrude(sketch001, length = 5)
|
||||||
|
@ -22,12 +22,12 @@ bezierCurve(
|
|||||||
| Name | Type | Description | Required |
|
| Name | Type | Description | Required |
|
||||||
|----------|------|-------------|----------|
|
|----------|------|-------------|----------|
|
||||||
| `data` | [`BezierData`](/docs/kcl/types/BezierData) | Data to draw a bezier curve. | Yes |
|
| `data` | [`BezierData`](/docs/kcl/types/BezierData) | Data to draw a bezier curve. | Yes |
|
||||||
| `sketch` | [`Sketch`](/docs/kcl/types/Sketch) | A sketch is a collection of paths. | Yes |
|
| `sketch` | [`Sketch`](/docs/kcl/types/Sketch) | | Yes |
|
||||||
| `tag` | [`TagDeclarator`](/docs/kcl/types#tag-declaration) | | No |
|
| [`tag`](/docs/kcl/types/tag) | [`TagDeclarator`](/docs/kcl/types#tag-declaration) | | No |
|
||||||
|
|
||||||
### Returns
|
### Returns
|
||||||
|
|
||||||
[`Sketch`](/docs/kcl/types/Sketch) - A sketch is a collection of paths.
|
[`Sketch`](/docs/kcl/types/Sketch)
|
||||||
|
|
||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
@ -21,11 +21,11 @@ ceil(num: number): number
|
|||||||
|
|
||||||
| Name | Type | Description | Required |
|
| Name | Type | Description | Required |
|
||||||
|----------|------|-------------|----------|
|
|----------|------|-------------|----------|
|
||||||
| `num` | `number` | | Yes |
|
| `num` | [`number`](/docs/kcl/types/number) | | Yes |
|
||||||
|
|
||||||
### Returns
|
### Returns
|
||||||
|
|
||||||
`number`
|
[`number`](/docs/kcl/types/number)
|
||||||
|
|
||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
@ -35,7 +35,7 @@ sketch001 = startSketchOn('XZ')
|
|||||||
|> startProfileAt([0, 0], %)
|
|> startProfileAt([0, 0], %)
|
||||||
|> line(endAbsolute = [12, 10])
|
|> line(endAbsolute = [12, 10])
|
||||||
|> line(end = [ceil(7.02986), 0])
|
|> line(end = [ceil(7.02986), 0])
|
||||||
|> yLineTo(0, %)
|
|> yLine(endAbsolute = 0)
|
||||||
|> close()
|
|> close()
|
||||||
|
|
||||||
extrude001 = extrude(sketch001, length = 5)
|
extrude001 = extrude(sketch001, length = 5)
|
||||||
|
File diff suppressed because one or more lines are too long
@ -23,13 +23,13 @@ circle(
|
|||||||
| Name | Type | Description | Required |
|
| Name | Type | Description | Required |
|
||||||
|----------|------|-------------|----------|
|
|----------|------|-------------|----------|
|
||||||
| `sketchOrSurface` | [`SketchOrSurface`](/docs/kcl/types/SketchOrSurface) | Plane or surface to sketch on. | Yes |
|
| `sketchOrSurface` | [`SketchOrSurface`](/docs/kcl/types/SketchOrSurface) | Plane or surface to sketch on. | Yes |
|
||||||
| `center` | `[number]` | The center of the circle. | Yes |
|
| `center` | [`[number]`](/docs/kcl/types/number) | The center of the circle. | Yes |
|
||||||
| `radius` | `number` | The radius of the circle. | Yes |
|
| `radius` | [`number`](/docs/kcl/types/number) | The radius of the circle. | Yes |
|
||||||
| `tag` | [`TagDeclarator`](/docs/kcl/types#tag-declaration) | Create a new tag which refers to this circle | No |
|
| [`tag`](/docs/kcl/types/tag) | [`TagDeclarator`](/docs/kcl/types#tag-declaration) | Create a new tag which refers to this circle | No |
|
||||||
|
|
||||||
### Returns
|
### Returns
|
||||||
|
|
||||||
[`Sketch`](/docs/kcl/types/Sketch) - A sketch is a collection of paths.
|
[`Sketch`](/docs/kcl/types/Sketch)
|
||||||
|
|
||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
@ -23,15 +23,15 @@ circleThreePoint(
|
|||||||
|
|
||||||
| Name | Type | Description | Required |
|
| Name | Type | Description | Required |
|
||||||
|----------|------|-------------|----------|
|
|----------|------|-------------|----------|
|
||||||
| `p1` | `[number]` | 1st point to derive the circle. | Yes |
|
| `p1` | [`[number]`](/docs/kcl/types/number) | 1st point to derive the circle. | Yes |
|
||||||
| `p2` | `[number]` | 2nd point to derive the circle. | Yes |
|
| `p2` | [`[number]`](/docs/kcl/types/number) | 2nd point to derive the circle. | Yes |
|
||||||
| `p3` | `[number]` | 3rd point to derive the circle. | Yes |
|
| `p3` | [`[number]`](/docs/kcl/types/number) | 3rd point to derive the circle. | Yes |
|
||||||
| `sketchSurfaceOrGroup` | [`SketchOrSurface`](/docs/kcl/types/SketchOrSurface) | Plane or surface to sketch on. | Yes |
|
| `sketchSurfaceOrGroup` | [`SketchOrSurface`](/docs/kcl/types/SketchOrSurface) | Plane or surface to sketch on. | Yes |
|
||||||
| `tag` | [`TagDeclarator`](/docs/kcl/types#tag-declaration) | Identifier for the circle to reference elsewhere. | No |
|
| [`tag`](/docs/kcl/types/tag) | [`TagDeclarator`](/docs/kcl/types#tag-declaration) | Identifier for the circle to reference elsewhere. | No |
|
||||||
|
|
||||||
### Returns
|
### Returns
|
||||||
|
|
||||||
[`Sketch`](/docs/kcl/types/Sketch) - A sketch is a collection of paths.
|
[`Sketch`](/docs/kcl/types/Sketch)
|
||||||
|
|
||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
@ -21,11 +21,11 @@ close(
|
|||||||
| Name | Type | Description | Required |
|
| Name | Type | Description | Required |
|
||||||
|----------|------|-------------|----------|
|
|----------|------|-------------|----------|
|
||||||
| `sketch` | [`Sketch`](/docs/kcl/types/Sketch) | The sketch you want to close | Yes |
|
| `sketch` | [`Sketch`](/docs/kcl/types/Sketch) | The sketch you want to close | Yes |
|
||||||
| `tag` | [`TagDeclarator`](/docs/kcl/types#tag-declaration) | Create a new tag which refers to this line | No |
|
| [`tag`](/docs/kcl/types/tag) | [`TagDeclarator`](/docs/kcl/types#tag-declaration) | Create a new tag which refers to this line | No |
|
||||||
|
|
||||||
### Returns
|
### Returns
|
||||||
|
|
||||||
[`Sketch`](/docs/kcl/types/Sketch) - A sketch is a collection of paths.
|
[`Sketch`](/docs/kcl/types/Sketch)
|
||||||
|
|
||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
@ -26,7 +26,7 @@ cm(): number
|
|||||||
|
|
||||||
### Returns
|
### Returns
|
||||||
|
|
||||||
`number`
|
[`number`](/docs/kcl/types/number)
|
||||||
|
|
||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
25
docs/kcl/consts.md
Normal file
25
docs/kcl/consts.md
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
---
|
||||||
|
title: "KCL Constants"
|
||||||
|
excerpt: "Documentation for the KCL constants."
|
||||||
|
layout: manual
|
||||||
|
---
|
||||||
|
|
||||||
|
## Table of Contents
|
||||||
|
|
||||||
|
|
||||||
|
### `std`
|
||||||
|
|
||||||
|
- [`HALF_TURN`](/docs/kcl/consts/std-HALF_TURN)
|
||||||
|
- [`QUARTER_TURN`](/docs/kcl/consts/std-QUARTER_TURN)
|
||||||
|
- [`THREE_QUARTER_TURN`](/docs/kcl/consts/std-THREE_QUARTER_TURN)
|
||||||
|
- [`XY`](/docs/kcl/consts/std-XY)
|
||||||
|
- [`XZ`](/docs/kcl/consts/std-XZ)
|
||||||
|
- [`YZ`](/docs/kcl/consts/std-YZ)
|
||||||
|
- [`ZERO`](/docs/kcl/consts/std-ZERO)
|
||||||
|
|
||||||
|
### `std::math`
|
||||||
|
|
||||||
|
- [`E`](/docs/kcl/consts/std-math-E)
|
||||||
|
- [`PI`](/docs/kcl/consts/std-math-PI)
|
||||||
|
- [`TAU`](/docs/kcl/consts/std-math-TAU)
|
||||||
|
|
@ -21,7 +21,7 @@ exampleSketch = startSketchOn("XZ")
|
|||||||
angle = 30,
|
angle = 30,
|
||||||
length = 2 * E ^ 2,
|
length = 2 * E ^ 2,
|
||||||
}, %)
|
}, %)
|
||||||
|> yLineTo(0, %)
|
|> yLine(endAbsolute = 0)
|
||||||
|> close()
|
|> close()
|
||||||
|
|
||||||
example = extrude(exampleSketch, length = 10)
|
example = extrude(exampleSketch, length = 10)
|
@ -21,7 +21,7 @@ exampleSketch = startSketchOn("XZ")
|
|||||||
angle = 50,
|
angle = 50,
|
||||||
length = 10 * TAU,
|
length = 10 * TAU,
|
||||||
}, %)
|
}, %)
|
||||||
|> yLineTo(0, %)
|
|> yLine(endAbsolute = 0)
|
||||||
|> close()
|
|> close()
|
||||||
|
|
||||||
example = extrude(exampleSketch, length = 5)
|
example = extrude(exampleSketch, length = 5)
|
@ -22,7 +22,7 @@ e(): number
|
|||||||
|
|
||||||
### Returns
|
### Returns
|
||||||
|
|
||||||
`number`
|
[`number`](/docs/kcl/types/number)
|
||||||
|
|
||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
@ -31,7 +31,7 @@ e(): number
|
|||||||
exampleSketch = startSketchOn("XZ")
|
exampleSketch = startSketchOn("XZ")
|
||||||
|> startProfileAt([0, 0], %)
|
|> startProfileAt([0, 0], %)
|
||||||
|> angledLine({ angle = 30, length = 2 * e() ^ 2 }, %)
|
|> angledLine({ angle = 30, length = 2 * e() ^ 2 }, %)
|
||||||
|> yLineTo(0, %)
|
|> yLine(endAbsolute = 0)
|
||||||
|> close()
|
|> close()
|
||||||
|
|
||||||
example = extrude(exampleSketch, length = 10)
|
example = extrude(exampleSketch, length = 10)
|
||||||
|
@ -6,13 +6,15 @@ layout: manual
|
|||||||
|
|
||||||
Extend a 2-dimensional sketch through a third dimension in order to create new 3-dimensional volume, or if extruded into an existing volume, cut into an existing solid.
|
Extend a 2-dimensional sketch through a third dimension in order to create new 3-dimensional volume, or if extruded into an existing volume, cut into an existing solid.
|
||||||
|
|
||||||
|
You can provide more than one sketch to extrude, and they will all be extruded in the same direction.
|
||||||
|
|
||||||
```js
|
```js
|
||||||
extrude(
|
extrude(
|
||||||
sketchSet: SketchSet,
|
sketches: [Sketch],
|
||||||
length: number,
|
length: number,
|
||||||
): SolidSet
|
tagStart?: TagDeclarator,
|
||||||
|
tagEnd?: TagDeclarator,
|
||||||
|
): [Solid]
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -20,12 +22,14 @@ extrude(
|
|||||||
|
|
||||||
| Name | Type | Description | Required |
|
| Name | Type | Description | Required |
|
||||||
|----------|------|-------------|----------|
|
|----------|------|-------------|----------|
|
||||||
| `sketchSet` | [`SketchSet`](/docs/kcl/types/SketchSet) | Which sketches should be extruded | Yes |
|
| `sketches` | [`[Sketch]`](/docs/kcl/types/Sketch) | Which sketch or sketches should be extruded | Yes |
|
||||||
| `length` | `number` | How far to extrude the given sketches | Yes |
|
| `length` | [`number`](/docs/kcl/types/number) | How far to extrude the given sketches | Yes |
|
||||||
|
| `tagStart` | [`TagDeclarator`](/docs/kcl/types#tag-declaration) | A named tag for the face at the start of the extrusion, i.e. the original sketch | No |
|
||||||
|
| `tagEnd` | [`TagDeclarator`](/docs/kcl/types#tag-declaration) | A named tag for the face at the end of the extrusion, i.e. the new face created by extruding the original sketch | No |
|
||||||
|
|
||||||
### Returns
|
### Returns
|
||||||
|
|
||||||
[`SolidSet`](/docs/kcl/types/SolidSet) - A solid or a group of solids.
|
[`[Solid]`](/docs/kcl/types/Solid)
|
||||||
|
|
||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
@ -24,14 +24,14 @@ fillet(
|
|||||||
| Name | Type | Description | Required |
|
| Name | Type | Description | Required |
|
||||||
|----------|------|-------------|----------|
|
|----------|------|-------------|----------|
|
||||||
| `solid` | [`Solid`](/docs/kcl/types/Solid) | The solid whose edges should be filletted | Yes |
|
| `solid` | [`Solid`](/docs/kcl/types/Solid) | The solid whose edges should be filletted | Yes |
|
||||||
| `radius` | `number` | The radius of the fillet | Yes |
|
| `radius` | [`number`](/docs/kcl/types/number) | The radius of the fillet | Yes |
|
||||||
| `tags` | [`[EdgeReference]`](/docs/kcl/types/EdgeReference) | The paths you want to fillet | Yes |
|
| `tags` | [`[EdgeReference]`](/docs/kcl/types/EdgeReference) | The paths you want to fillet | Yes |
|
||||||
| `tolerance` | `number` | The tolerance for this fillet | No |
|
| `tolerance` | [`number`](/docs/kcl/types/number) | The tolerance for this fillet | No |
|
||||||
| `tag` | [`TagDeclarator`](/docs/kcl/types#tag-declaration) | Create a new tag which refers to this fillet | No |
|
| [`tag`](/docs/kcl/types/tag) | [`TagDeclarator`](/docs/kcl/types#tag-declaration) | Create a new tag which refers to this fillet | No |
|
||||||
|
|
||||||
### Returns
|
### Returns
|
||||||
|
|
||||||
[`Solid`](/docs/kcl/types/Solid) - A solid is a collection of extrude surfaces.
|
[`Solid`](/docs/kcl/types/Solid)
|
||||||
|
|
||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
@ -21,11 +21,11 @@ floor(num: number): number
|
|||||||
|
|
||||||
| Name | Type | Description | Required |
|
| Name | Type | Description | Required |
|
||||||
|----------|------|-------------|----------|
|
|----------|------|-------------|----------|
|
||||||
| `num` | `number` | | Yes |
|
| `num` | [`number`](/docs/kcl/types/number) | | Yes |
|
||||||
|
|
||||||
### Returns
|
### Returns
|
||||||
|
|
||||||
`number`
|
[`number`](/docs/kcl/types/number)
|
||||||
|
|
||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
@ -35,7 +35,7 @@ sketch001 = startSketchOn('XZ')
|
|||||||
|> startProfileAt([0, 0], %)
|
|> startProfileAt([0, 0], %)
|
||||||
|> line(endAbsolute = [12, 10])
|
|> line(endAbsolute = [12, 10])
|
||||||
|> line(end = [floor(7.02986), 0])
|
|> line(end = [floor(7.02986), 0])
|
||||||
|> yLineTo(0, %)
|
|> yLine(endAbsolute = 0)
|
||||||
|> close()
|
|> close()
|
||||||
|
|
||||||
extrude001 = extrude(sketch001, length = 5)
|
extrude001 = extrude(sketch001, length = 5)
|
||||||
|
@ -26,7 +26,7 @@ ft(): number
|
|||||||
|
|
||||||
### Returns
|
### Returns
|
||||||
|
|
||||||
`number`
|
[`number`](/docs/kcl/types/number)
|
||||||
|
|
||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
54
docs/kcl/getCommonEdge.md
Normal file
54
docs/kcl/getCommonEdge.md
Normal file
File diff suppressed because one or more lines are too long
@ -17,7 +17,7 @@ getNextAdjacentEdge(tag: TagIdentifier): Uuid
|
|||||||
|
|
||||||
| Name | Type | Description | Required |
|
| Name | Type | Description | Required |
|
||||||
|----------|------|-------------|----------|
|
|----------|------|-------------|----------|
|
||||||
| `tag` | [`TagIdentifier`](/docs/kcl/types#tag-identifier) | | Yes |
|
| [`tag`](/docs/kcl/types/tag) | [`TagIdentifier`](/docs/kcl/types#tag-identifier) | | Yes |
|
||||||
|
|
||||||
### Returns
|
### Returns
|
||||||
|
|
||||||
|
@ -17,7 +17,7 @@ getOppositeEdge(tag: TagIdentifier): Uuid
|
|||||||
|
|
||||||
| Name | Type | Description | Required |
|
| Name | Type | Description | Required |
|
||||||
|----------|------|-------------|----------|
|
|----------|------|-------------|----------|
|
||||||
| `tag` | [`TagIdentifier`](/docs/kcl/types#tag-identifier) | | Yes |
|
| [`tag`](/docs/kcl/types/tag) | [`TagIdentifier`](/docs/kcl/types#tag-identifier) | | Yes |
|
||||||
|
|
||||||
### Returns
|
### Returns
|
||||||
|
|
||||||
|
@ -17,7 +17,7 @@ getPreviousAdjacentEdge(tag: TagIdentifier): Uuid
|
|||||||
|
|
||||||
| Name | Type | Description | Required |
|
| Name | Type | Description | Required |
|
||||||
|----------|------|-------------|----------|
|
|----------|------|-------------|----------|
|
||||||
| `tag` | [`TagIdentifier`](/docs/kcl/types#tag-identifier) | | Yes |
|
| [`tag`](/docs/kcl/types/tag) | [`TagIdentifier`](/docs/kcl/types#tag-identifier) | | Yes |
|
||||||
|
|
||||||
### Returns
|
### Returns
|
||||||
|
|
||||||
|
File diff suppressed because one or more lines are too long
@ -21,11 +21,11 @@ helixRevolutions(
|
|||||||
| Name | Type | Description | Required |
|
| Name | Type | Description | Required |
|
||||||
|----------|------|-------------|----------|
|
|----------|------|-------------|----------|
|
||||||
| `data` | [`HelixRevolutionsData`](/docs/kcl/types/HelixRevolutionsData) | Data for helix revolutions. | Yes |
|
| `data` | [`HelixRevolutionsData`](/docs/kcl/types/HelixRevolutionsData) | Data for helix revolutions. | Yes |
|
||||||
| `solid` | [`Solid`](/docs/kcl/types/Solid) | A solid is a collection of extrude surfaces. | Yes |
|
| `solid` | [`Solid`](/docs/kcl/types/Solid) | | Yes |
|
||||||
|
|
||||||
### Returns
|
### Returns
|
||||||
|
|
||||||
[`Solid`](/docs/kcl/types/Solid) - A solid is a collection of extrude surfaces.
|
[`Solid`](/docs/kcl/types/Solid)
|
||||||
|
|
||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
@ -10,7 +10,7 @@ Use a 2-dimensional sketch to cut a hole in another 2-dimensional sketch.
|
|||||||
|
|
||||||
```js
|
```js
|
||||||
hole(
|
hole(
|
||||||
holeSketch: SketchSet,
|
holeSketch: [Sketch],
|
||||||
sketch: Sketch,
|
sketch: Sketch,
|
||||||
): Sketch
|
): Sketch
|
||||||
```
|
```
|
||||||
@ -20,12 +20,12 @@ hole(
|
|||||||
|
|
||||||
| Name | Type | Description | Required |
|
| Name | Type | Description | Required |
|
||||||
|----------|------|-------------|----------|
|
|----------|------|-------------|----------|
|
||||||
| `holeSketch` | [`SketchSet`](/docs/kcl/types/SketchSet) | A sketch or a group of sketches. | Yes |
|
| `holeSketch` | [`[Sketch]`](/docs/kcl/types/Sketch) | | Yes |
|
||||||
| `sketch` | [`Sketch`](/docs/kcl/types/Sketch) | A sketch is a collection of paths. | Yes |
|
| `sketch` | [`Sketch`](/docs/kcl/types/Sketch) | | Yes |
|
||||||
|
|
||||||
### Returns
|
### Returns
|
||||||
|
|
||||||
[`Sketch`](/docs/kcl/types/Sketch) - A sketch is a collection of paths.
|
[`Sketch`](/docs/kcl/types/Sketch)
|
||||||
|
|
||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
@ -20,12 +20,12 @@ hollow(
|
|||||||
|
|
||||||
| Name | Type | Description | Required |
|
| Name | Type | Description | Required |
|
||||||
|----------|------|-------------|----------|
|
|----------|------|-------------|----------|
|
||||||
| `thickness` | `number` | | Yes |
|
| `thickness` | [`number`](/docs/kcl/types/number) | | Yes |
|
||||||
| `solid` | [`Solid`](/docs/kcl/types/Solid) | A solid is a collection of extrude surfaces. | Yes |
|
| `solid` | [`Solid`](/docs/kcl/types/Solid) | | Yes |
|
||||||
|
|
||||||
### Returns
|
### Returns
|
||||||
|
|
||||||
[`Solid`](/docs/kcl/types/Solid) - A solid is a collection of extrude surfaces.
|
[`Solid`](/docs/kcl/types/Solid)
|
||||||
|
|
||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
@ -26,7 +26,7 @@ inch(): number
|
|||||||
|
|
||||||
### Returns
|
### Returns
|
||||||
|
|
||||||
`number`
|
[`number`](/docs/kcl/types/number)
|
||||||
|
|
||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
@ -12,17 +12,26 @@ layout: manual
|
|||||||
* [`Modules`](kcl/modules)
|
* [`Modules`](kcl/modules)
|
||||||
* [`Settings`](kcl/settings)
|
* [`Settings`](kcl/settings)
|
||||||
* [`Known Issues`](kcl/known-issues)
|
* [`Known Issues`](kcl/known-issues)
|
||||||
|
* [`Constants`](kcl/consts)
|
||||||
|
|
||||||
### Standard library
|
### Standard library
|
||||||
|
|
||||||
* **`std`**
|
* **Primitive types**
|
||||||
* [`HALF_TURN`](kcl/const_std-HALF_TURN)
|
* [`bool`](kcl/types/bool)
|
||||||
* [`QUARTER_TURN`](kcl/const_std-QUARTER_TURN)
|
* [`number`](kcl/types/number)
|
||||||
* [`THREE_QUARTER_TURN`](kcl/const_std-THREE_QUARTER_TURN)
|
* [`string`](kcl/types/string)
|
||||||
* [`XY`](kcl/const_std-XY)
|
* [`tag`](kcl/types/tag)
|
||||||
* [`XZ`](kcl/const_std-XZ)
|
* **std**
|
||||||
* [`YZ`](kcl/const_std-YZ)
|
* [`HALF_TURN`](kcl/consts/std-HALF_TURN)
|
||||||
* [`ZERO`](kcl/const_std-ZERO)
|
* [`Plane`](kcl/types/Plane)
|
||||||
|
* [`QUARTER_TURN`](kcl/consts/std-QUARTER_TURN)
|
||||||
|
* [`Sketch`](kcl/types/Sketch)
|
||||||
|
* [`Solid`](kcl/types/Solid)
|
||||||
|
* [`THREE_QUARTER_TURN`](kcl/consts/std-THREE_QUARTER_TURN)
|
||||||
|
* [`XY`](kcl/consts/std-XY)
|
||||||
|
* [`XZ`](kcl/consts/std-XZ)
|
||||||
|
* [`YZ`](kcl/consts/std-YZ)
|
||||||
|
* [`ZERO`](kcl/consts/std-ZERO)
|
||||||
* [`abs`](kcl/abs)
|
* [`abs`](kcl/abs)
|
||||||
* [`acos`](kcl/acos)
|
* [`acos`](kcl/acos)
|
||||||
* [`angleToMatchLengthX`](kcl/angleToMatchLengthX)
|
* [`angleToMatchLengthX`](kcl/angleToMatchLengthX)
|
||||||
@ -56,6 +65,7 @@ layout: manual
|
|||||||
* [`fillet`](kcl/fillet)
|
* [`fillet`](kcl/fillet)
|
||||||
* [`floor`](kcl/floor)
|
* [`floor`](kcl/floor)
|
||||||
* [`ft`](kcl/ft)
|
* [`ft`](kcl/ft)
|
||||||
|
* [`getCommonEdge`](kcl/getCommonEdge)
|
||||||
* [`getNextAdjacentEdge`](kcl/getNextAdjacentEdge)
|
* [`getNextAdjacentEdge`](kcl/getNextAdjacentEdge)
|
||||||
* [`getOppositeEdge`](kcl/getOppositeEdge)
|
* [`getOppositeEdge`](kcl/getOppositeEdge)
|
||||||
* [`getPreviousAdjacentEdge`](kcl/getPreviousAdjacentEdge)
|
* [`getPreviousAdjacentEdge`](kcl/getPreviousAdjacentEdge)
|
||||||
@ -123,14 +133,12 @@ layout: manual
|
|||||||
* [`toRadians`](kcl/toRadians)
|
* [`toRadians`](kcl/toRadians)
|
||||||
* [`translate`](kcl/translate)
|
* [`translate`](kcl/translate)
|
||||||
* [`xLine`](kcl/xLine)
|
* [`xLine`](kcl/xLine)
|
||||||
* [`xLineTo`](kcl/xLineTo)
|
|
||||||
* [`yLine`](kcl/yLine)
|
* [`yLine`](kcl/yLine)
|
||||||
* [`yLineTo`](kcl/yLineTo)
|
|
||||||
* [`yd`](kcl/yd)
|
* [`yd`](kcl/yd)
|
||||||
* **`std::math`**
|
* **std::math**
|
||||||
* [`E`](kcl/const_std-math-E)
|
* [`E`](kcl/consts/std-math-E)
|
||||||
* [`PI`](kcl/const_std-math-PI)
|
* [`PI`](kcl/consts/std-math-PI)
|
||||||
* [`TAU`](kcl/const_std-math-TAU)
|
* [`TAU`](kcl/consts/std-math-TAU)
|
||||||
* [`cos`](kcl/std-math-cos)
|
* [`cos`](kcl/std-math-cos)
|
||||||
* [`sin`](kcl/std-math-sin)
|
* [`sin`](kcl/std-math-sin)
|
||||||
* [`tan`](kcl/std-math-tan)
|
* [`tan`](kcl/std-math-tan)
|
||||||
|
@ -23,11 +23,11 @@ int(num: number): number
|
|||||||
|
|
||||||
| Name | Type | Description | Required |
|
| Name | Type | Description | Required |
|
||||||
|----------|------|-------------|----------|
|
|----------|------|-------------|----------|
|
||||||
| `num` | `number` | | Yes |
|
| `num` | [`number`](/docs/kcl/types/number) | | Yes |
|
||||||
|
|
||||||
### Returns
|
### Returns
|
||||||
|
|
||||||
`number`
|
[`number`](/docs/kcl/types/number)
|
||||||
|
|
||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
50
docs/kcl/intersect.md
Normal file
50
docs/kcl/intersect.md
Normal file
File diff suppressed because one or more lines are too long
@ -13,9 +13,7 @@ once fixed in engine will just start working here with no language changes.
|
|||||||
If you see a red line around your model, it means this is happening.
|
If you see a red line around your model, it means this is happening.
|
||||||
|
|
||||||
- **Import**: Right now you can import a file, even if that file has brep data
|
- **Import**: Right now you can import a file, even if that file has brep data
|
||||||
you cannot edit it, after v1, the engine will account for this. You also cannot
|
you cannot edit it, after v1, the engine will account for this.
|
||||||
currently move or transform the imported objects at all, once we have assemblies
|
|
||||||
this will work.
|
|
||||||
|
|
||||||
- **Fillets**: Fillets cannot intersect, you will get an error. Only simple fillet
|
- **Fillets**: Fillets cannot intersect, you will get an error. Only simple fillet
|
||||||
cases work currently.
|
cases work currently.
|
||||||
|
@ -21,7 +21,7 @@ lastSegX(sketch: Sketch): number
|
|||||||
|
|
||||||
### Returns
|
### Returns
|
||||||
|
|
||||||
`number`
|
[`number`](/docs/kcl/types/number)
|
||||||
|
|
||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
@ -21,7 +21,7 @@ lastSegY(sketch: Sketch): number
|
|||||||
|
|
||||||
### Returns
|
### Returns
|
||||||
|
|
||||||
`number`
|
[`number`](/docs/kcl/types/number)
|
||||||
|
|
||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
@ -24,12 +24,12 @@ legAngX(
|
|||||||
|
|
||||||
| Name | Type | Description | Required |
|
| Name | Type | Description | Required |
|
||||||
|----------|------|-------------|----------|
|
|----------|------|-------------|----------|
|
||||||
| `hypotenuse` | `number` | | Yes |
|
| `hypotenuse` | [`number`](/docs/kcl/types/number) | | Yes |
|
||||||
| `leg` | `number` | | Yes |
|
| `leg` | [`number`](/docs/kcl/types/number) | | Yes |
|
||||||
|
|
||||||
### Returns
|
### Returns
|
||||||
|
|
||||||
`number`
|
[`number`](/docs/kcl/types/number)
|
||||||
|
|
||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
@ -24,12 +24,12 @@ legAngY(
|
|||||||
|
|
||||||
| Name | Type | Description | Required |
|
| Name | Type | Description | Required |
|
||||||
|----------|------|-------------|----------|
|
|----------|------|-------------|----------|
|
||||||
| `hypotenuse` | `number` | | Yes |
|
| `hypotenuse` | [`number`](/docs/kcl/types/number) | | Yes |
|
||||||
| `leg` | `number` | | Yes |
|
| `leg` | [`number`](/docs/kcl/types/number) | | Yes |
|
||||||
|
|
||||||
### Returns
|
### Returns
|
||||||
|
|
||||||
`number`
|
[`number`](/docs/kcl/types/number)
|
||||||
|
|
||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
@ -24,12 +24,12 @@ legLen(
|
|||||||
|
|
||||||
| Name | Type | Description | Required |
|
| Name | Type | Description | Required |
|
||||||
|----------|------|-------------|----------|
|
|----------|------|-------------|----------|
|
||||||
| `hypotenuse` | `number` | | Yes |
|
| `hypotenuse` | [`number`](/docs/kcl/types/number) | | Yes |
|
||||||
| `leg` | `number` | | Yes |
|
| `leg` | [`number`](/docs/kcl/types/number) | | Yes |
|
||||||
|
|
||||||
### Returns
|
### Returns
|
||||||
|
|
||||||
`number`
|
[`number`](/docs/kcl/types/number)
|
||||||
|
|
||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
@ -23,13 +23,13 @@ line(
|
|||||||
| Name | Type | Description | Required |
|
| Name | Type | Description | Required |
|
||||||
|----------|------|-------------|----------|
|
|----------|------|-------------|----------|
|
||||||
| `sketch` | [`Sketch`](/docs/kcl/types/Sketch) | Which sketch should this path be added to? | Yes |
|
| `sketch` | [`Sketch`](/docs/kcl/types/Sketch) | Which sketch should this path be added to? | Yes |
|
||||||
| `endAbsolute` | `[number]` | Which absolute point should this line go to? Incompatible with `end`. | No |
|
| `endAbsolute` | [`[number]`](/docs/kcl/types/number) | Which absolute point should this line go to? Incompatible with `end`. | No |
|
||||||
| `end` | `[number]` | How far away (along the X and Y axes) should this line go? Incompatible with `endAbsolute`. | No |
|
| `end` | [`[number]`](/docs/kcl/types/number) | How far away (along the X and Y axes) should this line go? Incompatible with `endAbsolute`. | No |
|
||||||
| `tag` | [`TagDeclarator`](/docs/kcl/types#tag-declaration) | Create a new tag which refers to this line | No |
|
| [`tag`](/docs/kcl/types/tag) | [`TagDeclarator`](/docs/kcl/types#tag-declaration) | Create a new tag which refers to this line | No |
|
||||||
|
|
||||||
### Returns
|
### Returns
|
||||||
|
|
||||||
[`Sketch`](/docs/kcl/types/Sketch) - A sketch is a collection of paths.
|
[`Sketch`](/docs/kcl/types/Sketch)
|
||||||
|
|
||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
@ -21,11 +21,11 @@ ln(num: number): number
|
|||||||
|
|
||||||
| Name | Type | Description | Required |
|
| Name | Type | Description | Required |
|
||||||
|----------|------|-------------|----------|
|
|----------|------|-------------|----------|
|
||||||
| `num` | `number` | | Yes |
|
| `num` | [`number`](/docs/kcl/types/number) | | Yes |
|
||||||
|
|
||||||
### Returns
|
### Returns
|
||||||
|
|
||||||
`number`
|
[`number`](/docs/kcl/types/number)
|
||||||
|
|
||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
File diff suppressed because one or more lines are too long
@ -24,12 +24,12 @@ log(
|
|||||||
|
|
||||||
| Name | Type | Description | Required |
|
| Name | Type | Description | Required |
|
||||||
|----------|------|-------------|----------|
|
|----------|------|-------------|----------|
|
||||||
| `num` | `number` | | Yes |
|
| `num` | [`number`](/docs/kcl/types/number) | | Yes |
|
||||||
| `base` | `number` | | Yes |
|
| `base` | [`number`](/docs/kcl/types/number) | | Yes |
|
||||||
|
|
||||||
### Returns
|
### Returns
|
||||||
|
|
||||||
`number`
|
[`number`](/docs/kcl/types/number)
|
||||||
|
|
||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
@ -21,11 +21,11 @@ log10(num: number): number
|
|||||||
|
|
||||||
| Name | Type | Description | Required |
|
| Name | Type | Description | Required |
|
||||||
|----------|------|-------------|----------|
|
|----------|------|-------------|----------|
|
||||||
| `num` | `number` | | Yes |
|
| `num` | [`number`](/docs/kcl/types/number) | | Yes |
|
||||||
|
|
||||||
### Returns
|
### Returns
|
||||||
|
|
||||||
`number`
|
[`number`](/docs/kcl/types/number)
|
||||||
|
|
||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
@ -21,11 +21,11 @@ log2(num: number): number
|
|||||||
|
|
||||||
| Name | Type | Description | Required |
|
| Name | Type | Description | Required |
|
||||||
|----------|------|-------------|----------|
|
|----------|------|-------------|----------|
|
||||||
| `num` | `number` | | Yes |
|
| `num` | [`number`](/docs/kcl/types/number) | | Yes |
|
||||||
|
|
||||||
### Returns
|
### Returns
|
||||||
|
|
||||||
`number`
|
[`number`](/docs/kcl/types/number)
|
||||||
|
|
||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
@ -26,7 +26,7 @@ m(): number
|
|||||||
|
|
||||||
### Returns
|
### Returns
|
||||||
|
|
||||||
`number`
|
[`number`](/docs/kcl/types/number)
|
||||||
|
|
||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
File diff suppressed because one or more lines are too long
@ -21,11 +21,11 @@ max(args: [number]): number
|
|||||||
|
|
||||||
| Name | Type | Description | Required |
|
| Name | Type | Description | Required |
|
||||||
|----------|------|-------------|----------|
|
|----------|------|-------------|----------|
|
||||||
| `args` | `[number]` | | Yes |
|
| `args` | [`[number]`](/docs/kcl/types/number) | | Yes |
|
||||||
|
|
||||||
### Returns
|
### Returns
|
||||||
|
|
||||||
`number`
|
[`number`](/docs/kcl/types/number)
|
||||||
|
|
||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
@ -21,11 +21,11 @@ min(args: [number]): number
|
|||||||
|
|
||||||
| Name | Type | Description | Required |
|
| Name | Type | Description | Required |
|
||||||
|----------|------|-------------|----------|
|
|----------|------|-------------|----------|
|
||||||
| `args` | `[number]` | | Yes |
|
| `args` | [`[number]`](/docs/kcl/types/number) | | Yes |
|
||||||
|
|
||||||
### Returns
|
### Returns
|
||||||
|
|
||||||
`number`
|
[`number`](/docs/kcl/types/number)
|
||||||
|
|
||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
File diff suppressed because one or more lines are too long
@ -26,7 +26,7 @@ mm(): number
|
|||||||
|
|
||||||
### Returns
|
### Returns
|
||||||
|
|
||||||
`number`
|
[`number`](/docs/kcl/types/number)
|
||||||
|
|
||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
File diff suppressed because one or more lines are too long
@ -10,7 +10,7 @@ Repeat a 2-dimensional sketch some number of times along a partial or complete c
|
|||||||
|
|
||||||
```js
|
```js
|
||||||
patternCircular2d(
|
patternCircular2d(
|
||||||
sketchSet: SketchSet,
|
sketchSet: [Sketch],
|
||||||
instances: integer,
|
instances: integer,
|
||||||
center: [number],
|
center: [number],
|
||||||
arcDegrees: number,
|
arcDegrees: number,
|
||||||
@ -24,12 +24,12 @@ patternCircular2d(
|
|||||||
|
|
||||||
| Name | Type | Description | Required |
|
| Name | Type | Description | Required |
|
||||||
|----------|------|-------------|----------|
|
|----------|------|-------------|----------|
|
||||||
| `sketchSet` | [`SketchSet`](/docs/kcl/types/SketchSet) | Which sketch(es) to pattern | Yes |
|
| `sketchSet` | [`[Sketch]`](/docs/kcl/types/Sketch) | Which sketch(es) to pattern | Yes |
|
||||||
| `instances` | `integer` | The number of total instances. Must be greater than or equal to 1. This includes the original entity. For example, if instances is 2, there will be two copies -- the original, and one new copy. If instances is 1, this has no effect. | Yes |
|
| `instances` | `integer` | The number of total instances. Must be greater than or equal to 1. This includes the original entity. For example, if instances is 2, there will be two copies -- the original, and one new copy. If instances is 1, this has no effect. | Yes |
|
||||||
| `center` | `[number]` | The center about which to make the pattern. This is a 2D vector. | Yes |
|
| `center` | [`[number]`](/docs/kcl/types/number) | The center about which to make the pattern. This is a 2D vector. | Yes |
|
||||||
| `arcDegrees` | `number` | The arc angle (in degrees) to place the repetitions. Must be greater than 0. | Yes |
|
| `arcDegrees` | [`number`](/docs/kcl/types/number) | The arc angle (in degrees) to place the repetitions. Must be greater than 0. | Yes |
|
||||||
| `rotateDuplicates` | `bool` | Whether or not to rotate the duplicates as they are copied. | Yes |
|
| `rotateDuplicates` | [`bool`](/docs/kcl/types/bool) | Whether or not to rotate the duplicates as they are copied. | Yes |
|
||||||
| `useOriginal` | `bool` | If the target was sketched on an extrusion, setting this will use the original sketch as the target, not the entire joined solid. Defaults to false. | No |
|
| `useOriginal` | [`bool`](/docs/kcl/types/bool) | If the target was sketched on an extrusion, setting this will use the original sketch as the target, not the entire joined solid. Defaults to false. | No |
|
||||||
|
|
||||||
### Returns
|
### Returns
|
||||||
|
|
||||||
|
@ -10,7 +10,7 @@ Repeat a 3-dimensional solid some number of times along a partial or complete ci
|
|||||||
|
|
||||||
```js
|
```js
|
||||||
patternCircular3d(
|
patternCircular3d(
|
||||||
solidSet: SolidSet,
|
solids: [Solid],
|
||||||
instances: integer,
|
instances: integer,
|
||||||
axis: [number],
|
axis: [number],
|
||||||
center: [number],
|
center: [number],
|
||||||
@ -25,13 +25,13 @@ patternCircular3d(
|
|||||||
|
|
||||||
| Name | Type | Description | Required |
|
| Name | Type | Description | Required |
|
||||||
|----------|------|-------------|----------|
|
|----------|------|-------------|----------|
|
||||||
| `solidSet` | [`SolidSet`](/docs/kcl/types/SolidSet) | Which solid(s) to pattern | Yes |
|
| `solids` | [`[Solid]`](/docs/kcl/types/Solid) | Which solid(s) to pattern | Yes |
|
||||||
| `instances` | `integer` | The number of total instances. Must be greater than or equal to 1. This includes the original entity. For example, if instances is 2, there will be two copies -- the original, and one new copy. If instances is 1, this has no effect. | Yes |
|
| `instances` | `integer` | The number of total instances. Must be greater than or equal to 1. This includes the original entity. For example, if instances is 2, there will be two copies -- the original, and one new copy. If instances is 1, this has no effect. | Yes |
|
||||||
| `axis` | `[number]` | The axis around which to make the pattern. This is a 3D vector | Yes |
|
| `axis` | [`[number]`](/docs/kcl/types/number) | The axis around which to make the pattern. This is a 3D vector | Yes |
|
||||||
| `center` | `[number]` | The center about which to make the pattern. This is a 3D vector. | Yes |
|
| `center` | [`[number]`](/docs/kcl/types/number) | The center about which to make the pattern. This is a 3D vector. | Yes |
|
||||||
| `arcDegrees` | `number` | The arc angle (in degrees) to place the repetitions. Must be greater than 0. | Yes |
|
| `arcDegrees` | [`number`](/docs/kcl/types/number) | The arc angle (in degrees) to place the repetitions. Must be greater than 0. | Yes |
|
||||||
| `rotateDuplicates` | `bool` | Whether or not to rotate the duplicates as they are copied. | Yes |
|
| `rotateDuplicates` | [`bool`](/docs/kcl/types/bool) | Whether or not to rotate the duplicates as they are copied. | Yes |
|
||||||
| `useOriginal` | `bool` | If the target was sketched on an extrusion, setting this will use the original sketch as the target, not the entire joined solid. Defaults to false. | No |
|
| `useOriginal` | [`bool`](/docs/kcl/types/bool) | If the target was sketched on an extrusion, setting this will use the original sketch as the target, not the entire joined solid. Defaults to false. | No |
|
||||||
|
|
||||||
### Returns
|
### Returns
|
||||||
|
|
||||||
|
@ -10,7 +10,7 @@ Repeat a 2-dimensional sketch along some dimension, with a dynamic amount of dis
|
|||||||
|
|
||||||
```js
|
```js
|
||||||
patternLinear2d(
|
patternLinear2d(
|
||||||
sketchSet: SketchSet,
|
sketches: [Sketch],
|
||||||
instances: integer,
|
instances: integer,
|
||||||
distance: number,
|
distance: number,
|
||||||
axis: [number],
|
axis: [number],
|
||||||
@ -23,11 +23,11 @@ patternLinear2d(
|
|||||||
|
|
||||||
| Name | Type | Description | Required |
|
| Name | Type | Description | Required |
|
||||||
|----------|------|-------------|----------|
|
|----------|------|-------------|----------|
|
||||||
| `sketchSet` | [`SketchSet`](/docs/kcl/types/SketchSet) | The sketch(es) to duplicate | Yes |
|
| `sketches` | [`[Sketch]`](/docs/kcl/types/Sketch) | The sketch(es) to duplicate | Yes |
|
||||||
| `instances` | `integer` | The number of total instances. Must be greater than or equal to 1. This includes the original entity. For example, if instances is 2, there will be two copies -- the original, and one new copy. If instances is 1, this has no effect. | Yes |
|
| `instances` | `integer` | The number of total instances. Must be greater than or equal to 1. This includes the original entity. For example, if instances is 2, there will be two copies -- the original, and one new copy. If instances is 1, this has no effect. | Yes |
|
||||||
| `distance` | `number` | Distance between each repetition. Also known as 'spacing'. | Yes |
|
| `distance` | [`number`](/docs/kcl/types/number) | Distance between each repetition. Also known as 'spacing'. | Yes |
|
||||||
| `axis` | `[number]` | The axis of the pattern. A 2D vector. | Yes |
|
| `axis` | [`[number]`](/docs/kcl/types/number) | The axis of the pattern. A 2D vector. | Yes |
|
||||||
| `useOriginal` | `bool` | If the target was sketched on an extrusion, setting this will use the original sketch as the target, not the entire joined solid. Defaults to false. | No |
|
| `useOriginal` | [`bool`](/docs/kcl/types/bool) | If the target was sketched on an extrusion, setting this will use the original sketch as the target, not the entire joined solid. Defaults to false. | No |
|
||||||
|
|
||||||
### Returns
|
### Returns
|
||||||
|
|
||||||
|
@ -10,7 +10,7 @@ Repeat a 3-dimensional solid along a linear path, with a dynamic amount of dista
|
|||||||
|
|
||||||
```js
|
```js
|
||||||
patternLinear3d(
|
patternLinear3d(
|
||||||
solidSet: SolidSet,
|
solids: [Solid],
|
||||||
instances: integer,
|
instances: integer,
|
||||||
distance: number,
|
distance: number,
|
||||||
axis: [number],
|
axis: [number],
|
||||||
@ -23,11 +23,11 @@ patternLinear3d(
|
|||||||
|
|
||||||
| Name | Type | Description | Required |
|
| Name | Type | Description | Required |
|
||||||
|----------|------|-------------|----------|
|
|----------|------|-------------|----------|
|
||||||
| `solidSet` | [`SolidSet`](/docs/kcl/types/SolidSet) | The solid(s) to duplicate | Yes |
|
| `solids` | [`[Solid]`](/docs/kcl/types/Solid) | The solid(s) to duplicate | Yes |
|
||||||
| `instances` | `integer` | The number of total instances. Must be greater than or equal to 1. This includes the original entity. For example, if instances is 2, there will be two copies -- the original, and one new copy. If instances is 1, this has no effect. | Yes |
|
| `instances` | `integer` | The number of total instances. Must be greater than or equal to 1. This includes the original entity. For example, if instances is 2, there will be two copies -- the original, and one new copy. If instances is 1, this has no effect. | Yes |
|
||||||
| `distance` | `number` | Distance between each repetition. Also known as 'spacing'. | Yes |
|
| `distance` | [`number`](/docs/kcl/types/number) | Distance between each repetition. Also known as 'spacing'. | Yes |
|
||||||
| `axis` | `[number]` | The axis of the pattern. A 2D vector. | Yes |
|
| `axis` | [`[number]`](/docs/kcl/types/number) | The axis of the pattern. A 2D vector. | Yes |
|
||||||
| `useOriginal` | `bool` | If the target was sketched on an extrusion, setting this will use the original sketch as the target, not the entire joined solid. Defaults to false. | No |
|
| `useOriginal` | [`bool`](/docs/kcl/types/bool) | If the target was sketched on an extrusion, setting this will use the original sketch as the target, not the entire joined solid. Defaults to false. | No |
|
||||||
|
|
||||||
### Returns
|
### Returns
|
||||||
|
|
||||||
|
@ -36,7 +36,7 @@ The transform function returns a transform object. All properties of the object
|
|||||||
|
|
||||||
```js
|
```js
|
||||||
patternTransform(
|
patternTransform(
|
||||||
solidSet: SolidSet,
|
solids: [Solid],
|
||||||
instances: integer,
|
instances: integer,
|
||||||
transform: FunctionSource,
|
transform: FunctionSource,
|
||||||
useOriginal?: bool,
|
useOriginal?: bool,
|
||||||
@ -48,10 +48,10 @@ patternTransform(
|
|||||||
|
|
||||||
| Name | Type | Description | Required |
|
| Name | Type | Description | Required |
|
||||||
|----------|------|-------------|----------|
|
|----------|------|-------------|----------|
|
||||||
| `solidSet` | [`SolidSet`](/docs/kcl/types/SolidSet) | The solid(s) to duplicate | Yes |
|
| `solids` | [`[Solid]`](/docs/kcl/types/Solid) | The solid(s) to duplicate | Yes |
|
||||||
| `instances` | `integer` | The number of total instances. Must be greater than or equal to 1. This includes the original entity. For example, if instances is 2, there will be two copies -- the original, and one new copy. If instances is 1, this has no effect. | Yes |
|
| `instances` | `integer` | The number of total instances. Must be greater than or equal to 1. This includes the original entity. For example, if instances is 2, there will be two copies -- the original, and one new copy. If instances is 1, this has no effect. | Yes |
|
||||||
| `transform` | `FunctionSource` | How each replica should be transformed. The transform function takes a single parameter: an integer representing which number replication the transform is for. E.g. the first replica to be transformed will be passed the argument `1`. This simplifies your math: the transform function can rely on id `0` being the original instance passed into the `patternTransform`. See the examples. | Yes |
|
| `transform` | `FunctionSource` | How each replica should be transformed. The transform function takes a single parameter: an integer representing which number replication the transform is for. E.g. the first replica to be transformed will be passed the argument `1`. This simplifies your math: the transform function can rely on id `0` being the original instance passed into the `patternTransform`. See the examples. | Yes |
|
||||||
| `useOriginal` | `bool` | If the target was sketched on an extrusion, setting this will use the original sketch as the target, not the entire joined solid. Defaults to false. | No |
|
| `useOriginal` | [`bool`](/docs/kcl/types/bool) | If the target was sketched on an extrusion, setting this will use the original sketch as the target, not the entire joined solid. Defaults to false. | No |
|
||||||
|
|
||||||
### Returns
|
### Returns
|
||||||
|
|
||||||
|
File diff suppressed because one or more lines are too long
@ -22,7 +22,7 @@ pi(): number
|
|||||||
|
|
||||||
### Returns
|
### Returns
|
||||||
|
|
||||||
`number`
|
[`number`](/docs/kcl/types/number)
|
||||||
|
|
||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user