Compare commits
61 Commits
lf94/fix-r
...
v0.47.0
Author | SHA1 | Date | |
---|---|---|---|
d6ad4b6e66 | |||
546b4ea3b8 | |||
310932dc5a | |||
51459bb413 | |||
e00dae11ba | |||
831c7f764a | |||
ec4ad268f7 | |||
be640ea0bd | |||
f8ceab2233 | |||
aea82e004a | |||
bc3a0e3896 | |||
be69039d40 | |||
2c6d69497c | |||
18db3783af | |||
b536040feb | |||
dd45cd4ef9 | |||
25cc5581be | |||
f7c192b64b | |||
faae169154 | |||
c74b9ba940 | |||
6cce3cda36 | |||
5d25f4a0e5 | |||
79d37d360a | |||
69553fded7 | |||
200a9af61f | |||
2696ddb996 | |||
4e1b0daacb | |||
8aa46099a8 | |||
00ff6371ed | |||
b947dad6e9 | |||
c13bdbb749 | |||
e500fad0e1 | |||
bcac4d3798 | |||
63897bd60e | |||
d429e868ac | |||
faa51ddc18 | |||
c28eb360c0 | |||
69cac17543 | |||
50c7356b6a | |||
37715d9fa8 | |||
e8af61e11f | |||
de85c31e71 | |||
725c56ea6f | |||
1b958ee29f | |||
4b0f67e604 | |||
8ba1a5cd4d | |||
df278c7e6a | |||
6e57a80c13 | |||
efe6565857 | |||
fa0a34585b | |||
dec74f633b | |||
dfcea282ec | |||
191dcf8bb0 | |||
cb1bbe4660 | |||
ff66cb1deb | |||
ab46349d63 | |||
cffad78bf7 | |||
bfb81877d3 | |||
c56398db83 | |||
36e0d35968 | |||
62bf7d8715 |
@ -1,3 +1,3 @@
|
||||
[codespell]
|
||||
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
|
||||
|
@ -1,4 +1,6 @@
|
||||
rust/*
|
||||
rust/**/*.ts
|
||||
!rust/kcl-language-server/client/src/**/*.ts
|
||||
*.typegen.ts
|
||||
packages/codemirror-lsp-client/dist/*
|
||||
e2e/playwright/snapshots/prompt-to-edit/*
|
||||
.vscode-test
|
||||
|
@ -4,6 +4,7 @@
|
||||
"project": "./tsconfig.json"
|
||||
},
|
||||
"plugins": [
|
||||
"react-perf",
|
||||
"css-modules",
|
||||
"jest",
|
||||
"jsx-a11y",
|
||||
|
8
.github/actions/github-release/Dockerfile
vendored
Normal file
8
.github/actions/github-release/Dockerfile
vendored
Normal file
@ -0,0 +1,8 @@
|
||||
FROM node:slim
|
||||
|
||||
COPY . /action
|
||||
WORKDIR /action
|
||||
|
||||
RUN npm install --production
|
||||
|
||||
ENTRYPOINT ["node", "/action/main.js"]
|
21
.github/actions/github-release/README.md
vendored
Normal file
21
.github/actions/github-release/README.md
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
# github-release
|
||||
|
||||
Copy-pasted from
|
||||
https://github.com/bytecodealliance/wasmtime/tree/8acfdbdd8aa550d1b84e0ce1e6222a6605d14e38/.github/actions/github-release
|
||||
|
||||
An action used to publish GitHub releases for `wasmtime`.
|
||||
|
||||
As of the time of this writing there's a few actions floating around which
|
||||
perform github releases but they all tend to have their set of drawbacks.
|
||||
Additionally nothing handles deleting releases which we need for our rolling
|
||||
`dev` release.
|
||||
|
||||
To handle all this, this action rolls its own implementation using the
|
||||
actions/toolkit repository and packages published there. These run in a Docker
|
||||
container and take various inputs to orchestrate the release from the build.
|
||||
|
||||
More comments can be found in `main.js`.
|
||||
|
||||
Testing this is really hard. If you want to try though run `npm install` and
|
||||
then `node main.js`. You'll have to configure a bunch of env vars though to get
|
||||
anything reasonably working.
|
15
.github/actions/github-release/action.yml
vendored
Normal file
15
.github/actions/github-release/action.yml
vendored
Normal file
@ -0,0 +1,15 @@
|
||||
name: "wasmtime github releases"
|
||||
description: "wasmtime github releases"
|
||||
inputs:
|
||||
token:
|
||||
description: ""
|
||||
required: true
|
||||
name:
|
||||
description: ""
|
||||
required: true
|
||||
files:
|
||||
description: ""
|
||||
required: true
|
||||
runs:
|
||||
using: "docker"
|
||||
image: "Dockerfile"
|
143
.github/actions/github-release/main.js
vendored
Normal file
143
.github/actions/github-release/main.js
vendored
Normal file
@ -0,0 +1,143 @@
|
||||
const core = require("@actions/core");
|
||||
const path = require("path");
|
||||
const fs = require("fs");
|
||||
const github = require("@actions/github");
|
||||
const glob = require("glob");
|
||||
|
||||
function sleep(milliseconds) {
|
||||
return new Promise((resolve) => setTimeout(resolve, milliseconds));
|
||||
}
|
||||
|
||||
async function runOnce() {
|
||||
// Load all our inputs and env vars. Note that `getInput` reads from `INPUT_*`
|
||||
const files = core.getInput("files");
|
||||
const name = core.getInput("name");
|
||||
const token = core.getInput("token");
|
||||
const slug = process.env.GITHUB_REPOSITORY;
|
||||
const owner = slug.split("/")[0];
|
||||
const repo = slug.split("/")[1];
|
||||
const sha = process.env.HEAD_SHA;
|
||||
|
||||
core.info(`files: ${files}`);
|
||||
core.info(`name: ${name}`);
|
||||
|
||||
const options = {
|
||||
request: {
|
||||
timeout: 30000,
|
||||
},
|
||||
};
|
||||
const octokit = github.getOctokit(token, options);
|
||||
|
||||
// Delete the previous release since we can't overwrite one. This may happen
|
||||
// due to retrying an upload or it may happen because we're doing the dev
|
||||
// release.
|
||||
const releases = await octokit.paginate("GET /repos/:owner/:repo/releases", { owner, repo });
|
||||
for (const release of releases) {
|
||||
if (release.tag_name !== name) {
|
||||
continue;
|
||||
}
|
||||
const release_id = release.id;
|
||||
core.info(`deleting release ${release_id}`);
|
||||
await octokit.rest.repos.deleteRelease({ owner, repo, release_id });
|
||||
}
|
||||
|
||||
// We also need to update the `dev` tag while we're at it on the `dev` branch.
|
||||
if (name == "nightly") {
|
||||
try {
|
||||
core.info(`updating nightly tag`);
|
||||
await octokit.rest.git.updateRef({
|
||||
owner,
|
||||
repo,
|
||||
ref: "tags/nightly",
|
||||
sha,
|
||||
force: true,
|
||||
});
|
||||
} catch (e) {
|
||||
core.error(e);
|
||||
core.info(`creating nightly tag`);
|
||||
await octokit.rest.git.createTag({
|
||||
owner,
|
||||
repo,
|
||||
tag: "nightly",
|
||||
message: "nightly release",
|
||||
object: sha,
|
||||
type: "commit",
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// Creates an official GitHub release for this `tag`, and if this is `dev`
|
||||
// then we know that from the previous block this should be a fresh release.
|
||||
core.info(`creating a release`);
|
||||
const release = await octokit.rest.repos.createRelease({
|
||||
owner,
|
||||
repo,
|
||||
name,
|
||||
tag_name: name,
|
||||
target_commitish: sha,
|
||||
prerelease: name === "nightly",
|
||||
});
|
||||
const release_id = release.data.id;
|
||||
|
||||
// Upload all the relevant assets for this release as just general blobs.
|
||||
for (const file of glob.sync(files)) {
|
||||
const size = fs.statSync(file).size;
|
||||
const name = path.basename(file);
|
||||
|
||||
await runWithRetry(async function () {
|
||||
// We can't overwrite assets, so remove existing ones from a previous try.
|
||||
let assets = await octokit.rest.repos.listReleaseAssets({
|
||||
owner,
|
||||
repo,
|
||||
release_id,
|
||||
});
|
||||
for (const asset of assets.data) {
|
||||
if (asset.name === name) {
|
||||
core.info(`delete asset ${name}`);
|
||||
const asset_id = asset.id;
|
||||
await octokit.rest.repos.deleteReleaseAsset({ owner, repo, asset_id });
|
||||
}
|
||||
}
|
||||
|
||||
core.info(`upload ${file}`);
|
||||
const headers = { "content-length": size, "content-type": "application/octet-stream" };
|
||||
const data = fs.createReadStream(file);
|
||||
await octokit.rest.repos.uploadReleaseAsset({
|
||||
data,
|
||||
headers,
|
||||
name,
|
||||
url: release.data.upload_url,
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
async function runWithRetry(f) {
|
||||
const retries = 10;
|
||||
const maxDelay = 4000;
|
||||
let delay = 1000;
|
||||
|
||||
for (let i = 0; i < retries; i++) {
|
||||
try {
|
||||
await f();
|
||||
break;
|
||||
} catch (e) {
|
||||
if (i === retries - 1) throw e;
|
||||
|
||||
core.error(e);
|
||||
const currentDelay = Math.round(Math.random() * delay);
|
||||
core.info(`sleeping ${currentDelay} ms`);
|
||||
await sleep(currentDelay);
|
||||
delay = Math.min(delay * 2, maxDelay);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
async function run() {
|
||||
await runWithRetry(runOnce);
|
||||
}
|
||||
|
||||
run().catch((err) => {
|
||||
core.error(err);
|
||||
core.setFailed(err.message);
|
||||
});
|
10
.github/actions/github-release/package.json
vendored
Normal file
10
.github/actions/github-release/package.json
vendored
Normal file
@ -0,0 +1,10 @@
|
||||
{
|
||||
"name": "wasmtime-github-release",
|
||||
"version": "0.0.0",
|
||||
"main": "main.js",
|
||||
"dependencies": {
|
||||
"@actions/core": "^1.6",
|
||||
"@actions/github": "^5.0",
|
||||
"glob": "^7.1.5"
|
||||
}
|
||||
}
|
374
.github/dependabot.yml
vendored
374
.github/dependabot.yml
vendored
@ -1,49 +1,331 @@
|
||||
# To get started with Dependabot version updates, you'll need to specify which
|
||||
# package ecosystems to update and where the package manifests are located.
|
||||
# Please see the documentation for all configuration options:
|
||||
# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
|
||||
# DO NOT EDIT THIS FILE. This dependabot file was generated
|
||||
# by https://github.com/KittyCAD/ciso Changes to this file should be addressed in
|
||||
# the ciso repository.
|
||||
|
||||
version: 2
|
||||
updates:
|
||||
- package-ecosystem: 'npm' # See documentation for possible values
|
||||
directories:
|
||||
- '/'
|
||||
- '/packages/codemirror-lang-kcl/'
|
||||
- '/packages/codemirror-lsp-client/'
|
||||
schedule:
|
||||
interval: weekly
|
||||
day: monday
|
||||
reviewers:
|
||||
- franknoirot
|
||||
- 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
|
||||
groups:
|
||||
serde-dependencies:
|
||||
patterns:
|
||||
- "serde*"
|
||||
wasm-bindgen-deps:
|
||||
patterns:
|
||||
- "wasm-bindgen*"
|
||||
- package-ecosystem: "pip" # See documentation for possible values
|
||||
directory: "/rust/kcl-python-bindings/" # Location of package manifests
|
||||
schedule:
|
||||
interval: weekly
|
||||
day: monday
|
||||
reviewers:
|
||||
- adamchalmers
|
||||
- jessfraz
|
||||
- package-ecosystem: github-actions
|
||||
directory: /
|
||||
schedule:
|
||||
interval: weekly
|
||||
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:
|
||||
- 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: /
|
||||
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: /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: /public/kcl-samples
|
||||
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
|
||||
|
18
.github/workflows/build-and-store-wasm.yml
vendored
18
.github/workflows/build-and-store-wasm.yml
vendored
@ -16,15 +16,21 @@ jobs:
|
||||
cache: 'yarn'
|
||||
- name: Install dependencies
|
||||
run: yarn
|
||||
- name: Setup Rust
|
||||
uses: dtolnay/rust-toolchain@stable
|
||||
- name: Cache wasm
|
||||
uses: Swatinem/rust-cache@v2
|
||||
- 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:
|
||||
workspaces: './rust'
|
||||
- uses: taiki-e/install-action@2dbeb927f58939d3aa13bf06ba0c0a34b76b9bfb
|
||||
cache: false # Configured below.
|
||||
- uses: taiki-e/install-action@955a6ff1416eae278c9f833008a9beb4b7f9afe3
|
||||
with:
|
||||
tool: wasm-pack
|
||||
- name: Rust Cache
|
||||
uses: Swatinem/rust-cache@v2
|
||||
with:
|
||||
workspaces: rust
|
||||
- name: build wasm
|
||||
run: yarn build:wasm
|
||||
|
||||
|
28
.github/workflows/build-apps.yml
vendored
28
.github/workflows/build-apps.yml
vendored
@ -33,18 +33,25 @@ jobs:
|
||||
|
||||
- run: yarn install
|
||||
|
||||
- name: Setup Rust
|
||||
uses: dtolnay/rust-toolchain@stable
|
||||
|
||||
- uses: Swatinem/rust-cache@v2
|
||||
- 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:
|
||||
workspaces: './rust'
|
||||
cache: false # Configured below.
|
||||
|
||||
# TODO: see if we can fetch from main instead if no diff at rust
|
||||
- uses: taiki-e/install-action@2dbeb927f58939d3aa13bf06ba0c0a34b76b9bfb
|
||||
- uses: taiki-e/install-action@955a6ff1416eae278c9f833008a9beb4b7f9afe3
|
||||
with:
|
||||
tool: wasm-pack
|
||||
|
||||
- name: Rust Cache
|
||||
uses: Swatinem/rust-cache@v2
|
||||
with:
|
||||
workspaces: rust
|
||||
|
||||
- name: Run build:wasm
|
||||
run: "yarn build:wasm"
|
||||
|
||||
@ -132,8 +139,9 @@ jobs:
|
||||
|
||||
- name: yarn install
|
||||
# Windows is picky sometimes and fails on fetch. Step takes about ~30s
|
||||
uses: nick-fields/retry@v3.0.1
|
||||
uses: nick-fields/retry@v3.0.2
|
||||
with:
|
||||
shell: bash
|
||||
timeout_minutes: 2
|
||||
max_attempts: 3
|
||||
command: yarn install
|
||||
@ -183,8 +191,9 @@ jobs:
|
||||
WINDOWS_CERTIFICATE_THUMBPRINT: ${{ secrets.WINDOWS_CERTIFICATE_THUMBPRINT }}
|
||||
DEBUG: "electron-notarize*"
|
||||
# TODO: Fix electron-notarize flakes. The logs above should help gather more data on failures
|
||||
uses: nick-fields/retry@v3.0.1
|
||||
uses: nick-fields/retry@v3.0.2
|
||||
with:
|
||||
shell: bash
|
||||
timeout_minutes: 10
|
||||
max_attempts: 3
|
||||
command: yarn tronb:package:prod
|
||||
@ -244,8 +253,9 @@ jobs:
|
||||
WINDOWS_CERTIFICATE_THUMBPRINT: ${{ secrets.WINDOWS_CERTIFICATE_THUMBPRINT }}
|
||||
DEBUG: "electron-notarize*"
|
||||
# TODO: Fix electron-notarize flakes. The logs above should help gather more data on failures
|
||||
uses: nick-fields/retry@v3.0.1
|
||||
uses: nick-fields/retry@v3.0.2
|
||||
with:
|
||||
shell: bash
|
||||
timeout_minutes: 10
|
||||
max_attempts: 3
|
||||
command: yarn tronb:package:prod
|
||||
|
52
.github/workflows/cargo-bench.yml
vendored
Normal file
52
.github/workflows/cargo-bench.yml
vendored
Normal file
@ -0,0 +1,52 @@
|
||||
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: ubuntu-latest-8-cores
|
||||
steps:
|
||||
- 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
|
||||
sudo apt update
|
||||
sudo apt install -y valgrind
|
||||
- uses: boa-dev/criterion-compare-action@v3
|
||||
with:
|
||||
cwd: "rust"
|
||||
defaultFeatures: true
|
||||
# Needed. The name of the branch to compare with. This default uses the branch which is being pulled against
|
||||
branchName: ${{ github.base_ref }}
|
||||
env:
|
||||
KITTYCAD_API_TOKEN: ${{secrets.KITTYCAD_API_TOKEN}}
|
14
.github/workflows/cargo-check.yml
vendored
14
.github/workflows/cargo-check.yml
vendored
@ -19,14 +19,14 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Install latest rust
|
||||
uses: actions-rs/toolchain@v1
|
||||
- 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:
|
||||
toolchain: stable
|
||||
override: true
|
||||
|
||||
- name: Rust Cache
|
||||
uses: Swatinem/rust-cache@v2.6.1
|
||||
cache-workspaces: rust
|
||||
|
||||
- name: Run check
|
||||
run: |
|
||||
|
16
.github/workflows/cargo-clippy.yml
vendored
16
.github/workflows/cargo-clippy.yml
vendored
@ -26,15 +26,15 @@ jobs:
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: taiki-e/install-action@just
|
||||
- name: Install latest rust
|
||||
uses: actions-rs/toolchain@v1
|
||||
- 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:
|
||||
toolchain: stable
|
||||
override: true
|
||||
components: clippy
|
||||
|
||||
- name: Rust Cache
|
||||
uses: Swatinem/rust-cache@v2.6.1
|
||||
cache-workspaces: rust
|
||||
components: clippy
|
||||
|
||||
- name: Run clippy
|
||||
run: |
|
||||
|
16
.github/workflows/cargo-fmt.yml
vendored
16
.github/workflows/cargo-fmt.yml
vendored
@ -28,15 +28,15 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Install latest rust
|
||||
uses: actions-rs/toolchain@v1
|
||||
- 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:
|
||||
toolchain: stable
|
||||
override: true
|
||||
components: rustfmt
|
||||
|
||||
- name: Rust Cache
|
||||
uses: Swatinem/rust-cache@v2.6.1
|
||||
cache-workspaces: rust
|
||||
components: rustfmt
|
||||
|
||||
- name: Run cargo fmt
|
||||
run: |
|
||||
|
100
.github/workflows/cargo-test.yml
vendored
100
.github/workflows/cargo-test.yml
vendored
@ -5,7 +5,9 @@ on:
|
||||
|
||||
pull_request:
|
||||
workflow_dispatch:
|
||||
permissions: read-all
|
||||
permissions:
|
||||
contents: read
|
||||
pull-requests: write
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
|
||||
cancel-in-progress: true
|
||||
@ -15,12 +17,23 @@ jobs:
|
||||
name: cargo test
|
||||
runs-on: ubuntu-latest-8-cores
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Install latest rust
|
||||
uses: actions-rs/toolchain@v1
|
||||
- uses: actions/create-github-app-token@v1
|
||||
id: app-token
|
||||
with:
|
||||
toolchain: stable
|
||||
override: true
|
||||
app-id: ${{ secrets.MODELING_APP_GH_APP_ID }}
|
||||
private-key: ${{ secrets.MODELING_APP_GH_APP_PRIVATE_KEY }}
|
||||
owner: ${{ github.repository_owner }}
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
token: ${{ steps.app-token.outputs.token }}
|
||||
- name: Use correct Rust toolchain
|
||||
shell: bash
|
||||
run: |
|
||||
[ -e rust-toolchain.toml ] || cp rust/rust-toolchain.toml ./
|
||||
- name: Install rust
|
||||
uses: actions-rust-lang/setup-rust-toolchain@v1
|
||||
with:
|
||||
cache: false # Configured below.
|
||||
- name: Install vector
|
||||
run: |
|
||||
curl --proto '=https' --tlsv1.2 -sSfL https://sh.vector.dev > /tmp/vector.sh
|
||||
@ -37,9 +50,81 @@ jobs:
|
||||
${HOME}/.vector/bin/vector --config /tmp/vector.toml &
|
||||
- uses: taiki-e/install-action@cargo-llvm-cov
|
||||
- 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
|
||||
uses: Swatinem/rust-cache@v2.6.1
|
||||
uses: Swatinem/rust-cache@v2
|
||||
with:
|
||||
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
|
||||
cd rust
|
||||
just overwrite-sim-test kcl_samples
|
||||
git add kcl-lib/tests
|
||||
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
|
||||
if: steps.path-changes.outputs.outside-kcl-samples == 'true'
|
||||
shell: bash
|
||||
run: |-
|
||||
cd rust
|
||||
@ -48,6 +133,7 @@ jobs:
|
||||
KITTYCAD_API_TOKEN: ${{secrets.KITTYCAD_API_TOKEN}}
|
||||
RUST_MIN_STACK: 10485760000
|
||||
- name: Upload to codecov.io
|
||||
if: steps.path-changes.outputs.outside-kcl-samples == 'true'
|
||||
uses: codecov/codecov-action@v5
|
||||
with:
|
||||
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
|
134
.github/workflows/e2e-tests.yml
vendored
134
.github/workflows/e2e-tests.yml
vendored
@ -17,6 +17,57 @@ permissions:
|
||||
|
||||
|
||||
jobs:
|
||||
|
||||
conditions:
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
significant: ${{ steps.path-changes.outputs.significant }}
|
||||
should-run: ${{ steps.should-run.outputs.should-run }}
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- 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 }}"
|
||||
|
||||
electron:
|
||||
timeout-minutes: 60
|
||||
name: playwright:electron:${{ matrix.os }} ${{ matrix.shardIndex }} ${{ matrix.shardTotal }}
|
||||
@ -29,6 +80,7 @@ jobs:
|
||||
shardTotal: [4]
|
||||
# TODO: add ref here for main and latest release tag
|
||||
runs-on: ${{ matrix.os }}
|
||||
needs: conditions
|
||||
steps:
|
||||
- uses: actions/create-github-app-token@v1
|
||||
id: app-token
|
||||
@ -47,24 +99,29 @@ jobs:
|
||||
rust:
|
||||
- 'rust/**'
|
||||
- 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'
|
||||
shell: bash
|
||||
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'
|
||||
shell: bash
|
||||
run: yarn playwright install --with-deps
|
||||
- name: Download Wasm Cache
|
||||
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
|
||||
continue-on-error: true
|
||||
with:
|
||||
@ -74,27 +131,44 @@ jobs:
|
||||
branch: main
|
||||
path: rust/kcl-wasm-lib/pkg
|
||||
- name: copy wasm blob
|
||||
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' }}
|
||||
shell: bash
|
||||
run: cp rust/kcl-wasm-lib/pkg/kcl_wasm_lib_bg.wasm public
|
||||
continue-on-error: true
|
||||
- name: Setup Rust
|
||||
uses: dtolnay/rust-toolchain@stable
|
||||
- uses: taiki-e/install-action@2dbeb927f58939d3aa13bf06ba0c0a34b76b9bfb
|
||||
- name: Build WASM condition
|
||||
id: wasm
|
||||
if: needs.conditions.outputs.should-run == 'true'
|
||||
shell: bash
|
||||
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
|
||||
run: |
|
||||
[ -e rust-toolchain.toml ] || cp rust/rust-toolchain.toml ./
|
||||
- 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
|
||||
if: ${{ needs.conditions.outputs.should-run == 'true' && steps.wasm.outputs.should-build-wasm == 'true' }}
|
||||
with:
|
||||
tool: wasm-pack
|
||||
- name: Cache Wasm (because rust diff)
|
||||
if: github.event_name == 'schedule' || steps.filter.outputs.rust == 'true'
|
||||
uses: Swatinem/rust-cache@v2
|
||||
with:
|
||||
workspaces: './rust'
|
||||
- name: OR Cache Wasm (because wasm cache failed)
|
||||
if: steps.download-wasm.outcome == 'failure'
|
||||
- name: Rust Cache
|
||||
if: ${{ needs.conditions.outputs.should-run == 'true' && steps.wasm.outputs.should-build-wasm == 'true' }}
|
||||
uses: Swatinem/rust-cache@v2
|
||||
with:
|
||||
workspaces: './rust'
|
||||
- name: install good sed
|
||||
if: ${{ startsWith(matrix.os, 'macos') }}
|
||||
if: ${{ needs.conditions.outputs.should-run == 'true' && startsWith(matrix.os, 'macos') }}
|
||||
shell: bash
|
||||
run: |
|
||||
brew install gnu-sed
|
||||
@ -116,24 +190,21 @@ jobs:
|
||||
sed -i "s#GH_ACTIONS_AXIOM_TOKEN#${{secrets.GH_ACTIONS_AXIOM_TOKEN}}#g" /tmp/vector.toml
|
||||
cat /tmp/vector.toml
|
||||
${HOME}/.vector/bin/vector --config /tmp/vector.toml &
|
||||
- name: Build Wasm (because rust diff)
|
||||
if: github.event_name == 'schedule' || steps.filter.outputs.rust == 'true'
|
||||
shell: bash
|
||||
run: yarn build:wasm
|
||||
- name: OR Build Wasm (because wasm cache failed)
|
||||
if: steps.download-wasm.outcome == 'failure'
|
||||
- name: Build Wasm
|
||||
if: ${{ needs.conditions.outputs.should-run == 'true' && steps.wasm.outputs.should-build-wasm == 'true' }}
|
||||
shell: bash
|
||||
run: yarn build:wasm
|
||||
- name: build web
|
||||
if: needs.conditions.outputs.should-run == 'true'
|
||||
shell: bash
|
||||
run: yarn tronb:vite:dev
|
||||
- name: Run ubuntu/chrome snapshots
|
||||
if: ${{ matrix.os == 'namespace-profile-ubuntu-8-cores' && matrix.shardIndex == 1 }}
|
||||
if: ${{ needs.conditions.outputs.should-run == 'true' && matrix.os == 'namespace-profile-ubuntu-8-cores' && matrix.shardIndex == 1 }}
|
||||
shell: bash
|
||||
# TODO: break this in its own job, for now it's not slowing down the overall execution as ubuntu is the quickest,
|
||||
# but we could do better. This forces a large 1/1 shard of all 20 snapshot tests that runs in about 3 minutes.
|
||||
run: |
|
||||
PLATFORM=web yarn playwright test --config=playwright.config.ts --retries="3" --update-snapshots --grep=@snapshot --trace=on --shard=1/1
|
||||
yarn test:snapshots
|
||||
env:
|
||||
CI: true
|
||||
NODE_ENV: development
|
||||
@ -142,7 +213,7 @@ jobs:
|
||||
token: ${{ secrets.KITTYCAD_API_TOKEN_DEV }}
|
||||
snapshottoken: ${{ secrets.KITTYCAD_API_TOKEN }}
|
||||
- uses: actions/upload-artifact@v4
|
||||
if: ${{ !cancelled() && (success() || failure()) }}
|
||||
if: ${{ needs.conditions.outputs.should-run == 'true' && !cancelled() && (success() || failure()) }}
|
||||
with:
|
||||
name: playwright-report-snapshots-${{ matrix.os }}-snapshot-${{ matrix.shardIndex }}-${{ github.sha }}
|
||||
path: playwright-report/
|
||||
@ -150,11 +221,11 @@ jobs:
|
||||
retention-days: 30
|
||||
overwrite: true
|
||||
- name: Clean up test-results
|
||||
if: ${{ !cancelled() && (success() || failure()) }}
|
||||
if: ${{ needs.conditions.outputs.should-run == 'true' && !cancelled() && (success() || failure()) }}
|
||||
continue-on-error: true
|
||||
run: rm -r test-results
|
||||
- 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' && matrix.os == 'namespace-profile-ubuntu-8-cores' && matrix.shardIndex == 1 && github.ref != 'refs/heads/main' }}
|
||||
shell: bash
|
||||
id: git-check
|
||||
run: |
|
||||
@ -164,7 +235,7 @@ jobs:
|
||||
else echo "modified=false" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
- 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
|
||||
run: |
|
||||
git add e2e/playwright/snapshot-tests.spec.ts-snapshots e2e/playwright/snapshots
|
||||
@ -179,23 +250,24 @@ jobs:
|
||||
git push origin ${{ github.head_ref }}
|
||||
# only upload artifacts if there's actually changes
|
||||
- uses: actions/upload-artifact@v4
|
||||
if: steps.git-check.outputs.modified == 'true'
|
||||
if: ${{ needs.conditions.outputs.should-run == 'true' && steps.git-check.outputs.modified == 'true' }}
|
||||
with:
|
||||
name: playwright-report-${{ matrix.os }}-${{ matrix.shardIndex }}-${{ github.sha }}
|
||||
path: playwright-report/
|
||||
include-hidden-files: true
|
||||
retention-days: 30
|
||||
- uses: actions/download-artifact@v4
|
||||
if: ${{ !cancelled() && (success() || failure()) }}
|
||||
if: ${{ needs.conditions.outputs.should-run == 'true' && !cancelled() && (success() || failure()) }}
|
||||
continue-on-error: true
|
||||
with:
|
||||
name: test-results-${{ matrix.os }}-${{ matrix.shardIndex }}-${{ github.sha }}
|
||||
path: test-results/
|
||||
- name: Run playwright/electron flow (with retries)
|
||||
id: retry
|
||||
if: ${{ !cancelled() && (success() || failure()) }}
|
||||
uses: nick-fields/retry@v3.0.1
|
||||
if: ${{ needs.conditions.outputs.should-run == 'true' && !cancelled() && steps.deps-install.outcome == 'success' }}
|
||||
uses: nick-fields/retry@v3.0.2
|
||||
with:
|
||||
shell: bash
|
||||
command: .github/ci-cd-scripts/playwright-electron.sh ${{matrix.shardIndex}} ${{matrix.shardTotal}} ${{matrix.os}}
|
||||
timeout_minutes: 30
|
||||
max_attempts: 25
|
||||
@ -207,7 +279,7 @@ jobs:
|
||||
VITE_KC_SKIP_AUTH: true
|
||||
token: ${{ secrets.KITTYCAD_API_TOKEN_DEV }}
|
||||
- uses: actions/upload-artifact@v4
|
||||
if: always()
|
||||
if: ${{ needs.conditions.outputs.should-run == 'true' && always() }}
|
||||
with:
|
||||
name: test-results-${{ matrix.os }}-${{ matrix.shardIndex }}-${{ github.sha }}
|
||||
path: test-results/
|
||||
@ -215,7 +287,7 @@ jobs:
|
||||
retention-days: 30
|
||||
overwrite: true
|
||||
- uses: actions/upload-artifact@v4
|
||||
if: always()
|
||||
if: ${{ needs.conditions.outputs.should-run == 'true' && always() }}
|
||||
with:
|
||||
name: playwright-report-${{ matrix.os }}-${{ matrix.shardIndex }}-${{ github.sha }}
|
||||
path: playwright-report/
|
||||
|
9
.github/workflows/generate-website-docs.yml
vendored
9
.github/workflows/generate-website-docs.yml
vendored
@ -5,6 +5,7 @@ on:
|
||||
paths:
|
||||
- .github/workflows/generate-website-docs.yml
|
||||
- 'docs/**'
|
||||
- 'public/kcl-samples/**'
|
||||
pull_request:
|
||||
paths:
|
||||
- .github/workflows/generate-website-docs.yml
|
||||
@ -42,6 +43,14 @@ jobs:
|
||||
# move new
|
||||
mv -f docs/kcl/*.md documentation/content/pages/docs/kcl/
|
||||
mv -f docs/kcl/types 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
|
||||
shell: bash
|
||||
run: |
|
||||
|
401
.github/workflows/kcl-language-server.yml
vendored
Normal file
401
.github/workflows/kcl-language-server.yml
vendored
Normal file
@ -0,0 +1,401 @@
|
||||
name: kcl-language-server
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
paths:
|
||||
- '**/Cargo.toml'
|
||||
- '**/Cargo.lock'
|
||||
- '**/rust-toolchain.toml'
|
||||
- 'rust/kcl-language-server/**'
|
||||
- '**.rs'
|
||||
- .github/workflows/kcl-language-server.yml
|
||||
tags:
|
||||
- 'kcl-*'
|
||||
pull_request:
|
||||
paths:
|
||||
- '**/Cargo.toml'
|
||||
- '**/Cargo.lock'
|
||||
- '**/rust-toolchain.toml'
|
||||
- 'rust/kcl-language-server/**'
|
||||
- '**.rs'
|
||||
- .github/workflows/kcl-language-server.yml
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
|
||||
cancel-in-progress: true
|
||||
|
||||
env:
|
||||
CARGO_INCREMENTAL: 0
|
||||
CARGO_NET_RETRY: 10
|
||||
RUSTFLAGS: ""
|
||||
RUSTUP_MAX_RETRIES: 10
|
||||
FETCH_DEPTH: 0 # pull in the tags for the version string
|
||||
MACOSX_DEPLOYMENT_TARGET: 10.15
|
||||
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER: aarch64-linux-gnu-gcc
|
||||
CARGO_TARGET_ARM_UNKNOWN_LINUX_GNUEABIHF_LINKER: arm-linux-gnueabihf-gcc
|
||||
|
||||
jobs:
|
||||
test:
|
||||
name: vscode tests
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: [macos-latest, ubuntu-latest, windows-latest]
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
- name: Install Node.js
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version-file: ".nvmrc"
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
yarn install
|
||||
cd rust/kcl-language-server
|
||||
yarn install
|
||||
- name: Run tests
|
||||
run: |
|
||||
cd rust/kcl-language-server
|
||||
yarn build
|
||||
yarn test-compile
|
||||
ls -la dist
|
||||
xvfb-run -a yarn test
|
||||
if: runner.os == 'Linux'
|
||||
- name: Run tests
|
||||
run: |
|
||||
cd rust/kcl-language-server
|
||||
yarn test
|
||||
if: runner.os != 'Linux'
|
||||
build-release:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- os: windows-latest
|
||||
target: x86_64-pc-windows-msvc
|
||||
code-target:
|
||||
win32-x64
|
||||
#- os: windows-latest
|
||||
#target: i686-pc-windows-msvc
|
||||
#code-target:
|
||||
#win32-ia32
|
||||
#- os: windows-latest
|
||||
#target: aarch64-pc-windows-msvc
|
||||
#code-target: win32-arm64
|
||||
- os: ubuntu-latest
|
||||
target: x86_64-unknown-linux-gnu
|
||||
code-target:
|
||||
linux-x64
|
||||
#- os: ubuntu-latest
|
||||
#target: aarch64-unknown-linux-musl
|
||||
#code-target: linux-arm64
|
||||
- os: ubuntu-latest
|
||||
target: aarch64-unknown-linux-gnu
|
||||
code-target: linux-arm64
|
||||
- os: ubuntu-latest
|
||||
target: arm-unknown-linux-gnueabihf
|
||||
code-target: linux-armhf
|
||||
- os: macos-latest
|
||||
target: x86_64-apple-darwin
|
||||
code-target: darwin-x64
|
||||
- os: macos-latest
|
||||
target: aarch64-apple-darwin
|
||||
code-target: darwin-arm64
|
||||
|
||||
name: build-release (${{ matrix.target }})
|
||||
runs-on: ${{ matrix.os }}
|
||||
container: ${{ matrix.container }}
|
||||
|
||||
env:
|
||||
RA_TARGET: ${{ matrix.target }}
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: ${{ env.FETCH_DEPTH }}
|
||||
|
||||
- name: Use correct Rust toolchain
|
||||
shell: bash
|
||||
run: |
|
||||
rm rust/rust-toolchain.toml
|
||||
|
||||
- name: Install rust
|
||||
uses: actions-rust-lang/setup-rust-toolchain@v1
|
||||
with:
|
||||
cache: rust
|
||||
components: rust-src
|
||||
target: ${{ matrix.target }}
|
||||
|
||||
- name: Install Node.js
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version-file: ".nvmrc"
|
||||
|
||||
- name: Update apt repositories
|
||||
if: matrix.target == 'aarch64-unknown-linux-gnu' || matrix.target == 'arm-unknown-linux-gnueabihf' || matrix.os == 'ubuntu-latest'
|
||||
run: sudo apt-get update
|
||||
|
||||
- if: ${{ matrix.os == 'ubuntu-latest' }}
|
||||
name: Install deps
|
||||
shell: bash
|
||||
run: |
|
||||
sudo apt install -y \
|
||||
ca-certificates \
|
||||
clang \
|
||||
cmake \
|
||||
curl \
|
||||
g++ \
|
||||
gcc \
|
||||
gcc-mingw-w64-i686 \
|
||||
gcc-mingw-w64 \
|
||||
jq \
|
||||
libmpc-dev \
|
||||
libmpfr-dev \
|
||||
libgmp-dev \
|
||||
libssl-dev \
|
||||
libxml2-dev \
|
||||
mingw-w64 \
|
||||
wget \
|
||||
zlib1g-dev
|
||||
|
||||
cargo install cross
|
||||
|
||||
- name: Install AArch64 target toolchain
|
||||
if: matrix.target == 'aarch64-unknown-linux-gnu'
|
||||
run: sudo apt-get install gcc-aarch64-linux-gnu
|
||||
|
||||
- name: Install ARM target toolchain
|
||||
if: matrix.target == 'arm-unknown-linux-gnueabihf'
|
||||
run: sudo apt-get install gcc-arm-linux-gnueabihf
|
||||
|
||||
- name: build
|
||||
run: |
|
||||
cd rust
|
||||
cargo kcl-language-server-release build --client-patch-version ${{ github.run_number }}
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
cd rust/kcl-language-server
|
||||
yarn install
|
||||
|
||||
- name: Package Extension (release)
|
||||
if: startsWith(github.event.ref, 'refs/tags/')
|
||||
run: |
|
||||
cd rust/kcl-language-server
|
||||
npx vsce package -o "../build/kcl-language-server-${{ matrix.code-target }}.vsix" --target ${{ matrix.code-target }}
|
||||
|
||||
- name: Package Extension (nightly)
|
||||
if: startsWith(github.event.ref, 'refs/tags/') == false
|
||||
run: |
|
||||
cd rust/kcl-language-server
|
||||
npx vsce package -o "../build/kcl-language-server-${{ matrix.code-target }}.vsix" --target ${{ matrix.code-target }} --pre-release
|
||||
|
||||
- name: remove server
|
||||
if: matrix.target == 'x86_64-unknown-linux-gnu'
|
||||
run: |
|
||||
cd rust/kcl-language-server
|
||||
rm -rf server
|
||||
|
||||
- name: Package Extension (no server, release)
|
||||
if: matrix.target == 'x86_64-unknown-linux-gnu' && startsWith(github.event.ref, 'refs/tags/')
|
||||
run: |
|
||||
cd rust/kcl-language-server
|
||||
npx vsce package -o ../build/kcl-language-server-no-server.vsix
|
||||
|
||||
- name: Package Extension (no server, nightly)
|
||||
if: matrix.target == 'x86_64-unknown-linux-gnu' && startsWith(github.event.ref, 'refs/tags/') == false
|
||||
run: |
|
||||
cd rust/kcl-language-server
|
||||
npx vsce package -o ../build/kcl-language-server-no-server.vsix --pre-release
|
||||
|
||||
- name: Upload artifacts
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: release-${{ matrix.target }}
|
||||
path: ./rust/build
|
||||
|
||||
build-release-x86_64-unknown-linux-musl:
|
||||
name: build-release (x86_64-unknown-linux-musl)
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
RA_TARGET: x86_64-unknown-linux-musl
|
||||
# For some reason `-crt-static` is not working for clang without lld
|
||||
RUSTFLAGS: "-C link-arg=-fuse-ld=lld -C target-feature=-crt-static"
|
||||
container:
|
||||
image: alpine:latest
|
||||
volumes:
|
||||
- /usr/local/cargo/registry:/usr/local/cargo/registry
|
||||
|
||||
steps:
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
apk add --no-cache \
|
||||
bash \
|
||||
curl \
|
||||
git \
|
||||
clang \
|
||||
lld \
|
||||
musl-dev \
|
||||
nodejs \
|
||||
yarn \
|
||||
npm
|
||||
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: ${{ env.FETCH_DEPTH }}
|
||||
|
||||
- name: Use correct Rust toolchain
|
||||
shell: bash
|
||||
run: |
|
||||
rm rust/rust-toolchain.toml
|
||||
|
||||
- name: Install rust
|
||||
uses: actions-rust-lang/setup-rust-toolchain@v1
|
||||
with:
|
||||
cache: rust
|
||||
components: rust-src
|
||||
target: ${{ matrix.target }}
|
||||
|
||||
- name: build
|
||||
run: |
|
||||
cd rust
|
||||
cargo kcl-language-server-release build --client-patch-version ${{ github.run_number }}
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
cd rust/kcl-language-server
|
||||
yarn install
|
||||
|
||||
- name: Package Extension (release)
|
||||
if: startsWith(github.event.ref, 'refs/tags/')
|
||||
run: |
|
||||
cd rust/kcl-language-server
|
||||
npx vsce package -o "../build/kcl-language-server-alpine-x64.vsix" --target alpine-x64
|
||||
|
||||
- name: Package Extension (release)
|
||||
if: startsWith(github.event.ref, 'refs/tags/') == false
|
||||
run: |
|
||||
cd rust/kcl-language-server
|
||||
npx vsce package -o "../build/kcl-language-server-alpine-x64.vsix" --target alpine-x64 --pre-release
|
||||
|
||||
- name: Upload artifacts
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: release-x86_64-unknown-linux-musl
|
||||
path: ./rust/build
|
||||
|
||||
publish:
|
||||
name: publish
|
||||
runs-on: ubuntu-latest
|
||||
needs: ["build-release", "build-release-x86_64-unknown-linux-musl"]
|
||||
if: startsWith(github.event.ref, 'refs/tags')
|
||||
permissions:
|
||||
contents: write
|
||||
steps:
|
||||
- run: echo "TAG=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
|
||||
|
||||
- run: 'echo "TAG: $TAG"'
|
||||
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: ${{ env.FETCH_DEPTH }}
|
||||
|
||||
- name: Install Nodejs
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version-file: ".nvmrc"
|
||||
|
||||
- run: echo "HEAD_SHA=$(git rev-parse HEAD)" >> $GITHUB_ENV
|
||||
- run: 'echo "HEAD_SHA: $HEAD_SHA"'
|
||||
|
||||
- uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: release-aarch64-apple-darwin
|
||||
path: rust/build
|
||||
- uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: release-x86_64-apple-darwin
|
||||
path: rust/build
|
||||
- uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: release-x86_64-unknown-linux-gnu
|
||||
path: rust/build
|
||||
- uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: release-x86_64-unknown-linux-musl
|
||||
path: rust/build
|
||||
- uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: release-aarch64-unknown-linux-gnu
|
||||
path: rust/build
|
||||
- uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: release-arm-unknown-linux-gnueabihf
|
||||
path: rust/build
|
||||
- uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: release-x86_64-pc-windows-msvc
|
||||
path:
|
||||
rust/build
|
||||
#- uses: actions/download-artifact@v4
|
||||
#with:
|
||||
#name: release-i686-pc-windows-msvc
|
||||
#path:
|
||||
#build
|
||||
#- uses: actions/download-artifact@v4
|
||||
#with:
|
||||
#name: release-aarch64-pc-windows-msvc
|
||||
#path: rust/build
|
||||
- run: ls -al ./rust/build
|
||||
|
||||
- name: Publish Release
|
||||
uses: ./.github/actions/github-release
|
||||
with:
|
||||
files: "rust/build/*"
|
||||
name: ${{ env.TAG }}
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: move files to dir for upload
|
||||
shell: bash
|
||||
run: |
|
||||
cd rust
|
||||
mkdir -p releases/language-server/${{ env.TAG }}
|
||||
cp -r build/* releases/language-server/${{ env.TAG }}
|
||||
|
||||
- name: "Authenticate to Google Cloud"
|
||||
uses: "google-github-actions/auth@v2.1.8"
|
||||
with:
|
||||
credentials_json: "${{ secrets.GOOGLE_CLOUD_DL_SA }}"
|
||||
- name: Set up Cloud SDK
|
||||
uses: google-github-actions/setup-gcloud@v2.1.2
|
||||
with:
|
||||
project_id: kittycadapi
|
||||
- name: "upload files to gcp"
|
||||
id: upload-files
|
||||
uses: google-github-actions/upload-cloud-storage@v2.2.2
|
||||
with:
|
||||
path: rust/releases
|
||||
destination: dl.kittycad.io
|
||||
|
||||
- run: rm rust/build/kcl-language-server-no-server.vsix
|
||||
|
||||
- name: Publish Extension (Code Marketplace, release)
|
||||
# token from https://dev.azure.com/kcl-language-server/
|
||||
run: |
|
||||
cd rust/kcl-language-server
|
||||
npx vsce publish --pat ${{ secrets.VSCE_PAT }} --packagePath ../build/kcl-language-server-*.vsix
|
||||
|
||||
- name: Publish Extension (OpenVSX, release)
|
||||
run: |
|
||||
cd rust/kcl-language-server
|
||||
npx ovsx publish --pat ${{ secrets.OPENVSX_TOKEN }} --packagePath ../build/kcl-language-server-*.vsix
|
||||
timeout-minutes: 2
|
3
.github/workflows/kcl-python-bindings.yml
vendored
3
.github/workflows/kcl-python-bindings.yml
vendored
@ -159,10 +159,11 @@ jobs:
|
||||
if: startsWith(github.ref, 'refs/tags/')
|
||||
needs: [linux-x86_64, windows, macos, sdist]
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/download-artifact@v4
|
||||
- name: Install the latest version of uv
|
||||
uses: astral-sh/setup-uv@v5
|
||||
- name: Install codespell
|
||||
- name: do uv things
|
||||
run: |
|
||||
cd rust/kcl-python-bindings
|
||||
uv venv .venv
|
||||
|
12
.github/workflows/static-analysis.yml
vendored
12
.github/workflows/static-analysis.yml
vendored
@ -37,7 +37,7 @@ jobs:
|
||||
node-version-file: '.nvmrc'
|
||||
cache: 'yarn'
|
||||
- run: yarn install
|
||||
- uses: taiki-e/install-action@2dbeb927f58939d3aa13bf06ba0c0a34b76b9bfb
|
||||
- uses: taiki-e/install-action@955a6ff1416eae278c9f833008a9beb4b7f9afe3
|
||||
with:
|
||||
tool: wasm-pack
|
||||
- run: yarn build:wasm
|
||||
@ -52,11 +52,12 @@ jobs:
|
||||
node-version-file: '.nvmrc'
|
||||
cache: 'yarn'
|
||||
- run: yarn install
|
||||
- run: yarn --cwd ./rust/kcl-language-server --modules-folder node_modules install
|
||||
- uses: Swatinem/rust-cache@v2
|
||||
with:
|
||||
workspaces: './rust'
|
||||
|
||||
- uses: taiki-e/install-action@2dbeb927f58939d3aa13bf06ba0c0a34b76b9bfb
|
||||
- uses: taiki-e/install-action@955a6ff1416eae278c9f833008a9beb4b7f9afe3
|
||||
with:
|
||||
tool: wasm-pack
|
||||
- run: yarn build:wasm
|
||||
@ -72,6 +73,7 @@ jobs:
|
||||
node-version-file: '.nvmrc'
|
||||
cache: 'yarn'
|
||||
- run: yarn install
|
||||
- run: yarn --cwd ./rust/kcl-language-server --modules-folder node_modules install
|
||||
- run: yarn lint
|
||||
|
||||
python-codespell:
|
||||
@ -98,7 +100,7 @@ jobs:
|
||||
cache: 'yarn'
|
||||
|
||||
- run: yarn install
|
||||
- uses: taiki-e/install-action@2dbeb927f58939d3aa13bf06ba0c0a34b76b9bfb
|
||||
- uses: taiki-e/install-action@955a6ff1416eae278c9f833008a9beb4b7f9afe3
|
||||
with:
|
||||
tool: wasm-pack
|
||||
- run: yarn build:wasm
|
||||
@ -127,7 +129,7 @@ jobs:
|
||||
cache: 'yarn'
|
||||
|
||||
- run: yarn install
|
||||
- uses: taiki-e/install-action@2dbeb927f58939d3aa13bf06ba0c0a34b76b9bfb
|
||||
- uses: taiki-e/install-action@955a6ff1416eae278c9f833008a9beb4b7f9afe3
|
||||
with:
|
||||
tool: wasm-pack
|
||||
- run: yarn build:wasm
|
||||
@ -141,7 +143,7 @@ jobs:
|
||||
|
||||
- name: run unit tests
|
||||
if: ${{ github.event_name != 'release' && github.event_name != 'schedule' }}
|
||||
run: yarn test:unit
|
||||
run: xvfb-run -a yarn test:unit
|
||||
env:
|
||||
VITE_KC_DEV_TOKEN: ${{ secrets.KITTYCAD_API_TOKEN_DEV }}
|
||||
|
||||
|
15
.gitignore
vendored
15
.gitignore
vendored
@ -1,7 +1,7 @@
|
||||
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
|
||||
|
||||
# dependencies
|
||||
/node_modules
|
||||
node_modules
|
||||
/.pnp
|
||||
.pnp.js
|
||||
|
||||
@ -9,7 +9,7 @@
|
||||
/coverage
|
||||
|
||||
# production
|
||||
/build
|
||||
build
|
||||
|
||||
# misc
|
||||
.DS_Store
|
||||
@ -35,6 +35,10 @@ rust/lcov.info
|
||||
rust/kcl-wasm-lib/pkg
|
||||
*.snap.new
|
||||
rust/kcl-lib/fuzz/Cargo.lock
|
||||
rust/kcl-language-server-release/Cargo.lock
|
||||
|
||||
# kcl language server package
|
||||
rust/kcl-language-server/dist/
|
||||
|
||||
e2e/playwright/playwright-secrets.env
|
||||
e2e/playwright/temp1.png
|
||||
@ -47,7 +51,8 @@ e2e/playwright/export-snapshots/*
|
||||
!e2e/playwright/export-snapshots/*.png
|
||||
!e2e/playwright/snapshot-tests.spec.ts-snapshots/*.png
|
||||
|
||||
/kcl-samples
|
||||
/public/kcl-samples.zip
|
||||
/public/kcl-samples/.github
|
||||
/test-results/
|
||||
/playwright-report/
|
||||
/blob-report/
|
||||
@ -71,5 +76,7 @@ out/
|
||||
# python
|
||||
__pycache__/
|
||||
uv.lock
|
||||
rust/kcl-python-bindings/dist
|
||||
dist
|
||||
venv
|
||||
|
||||
.vscode-test
|
||||
|
@ -7,10 +7,10 @@ coverage
|
||||
*.rs
|
||||
*.hbs
|
||||
target
|
||||
rust/
|
||||
e2e/playwright/export-snapshots
|
||||
e2e/playwright/snapshots/prompt-to-edit
|
||||
|
||||
|
||||
# XState generated files
|
||||
src/machines/**.typegen.ts
|
||||
.vscode-test
|
||||
|
@ -9,7 +9,7 @@ Compute the absolute value of a number.
|
||||
|
||||
|
||||
```js
|
||||
abs(num: number) -> number
|
||||
abs(num: number): number
|
||||
```
|
||||
|
||||
### Tags
|
||||
@ -21,11 +21,11 @@ abs(num: number) -> number
|
||||
|
||||
| Name | Type | Description | Required |
|
||||
|----------|------|-------------|----------|
|
||||
| `num` | `number` | | Yes |
|
||||
| `num` | [`number`](/docs/kcl/types/number) | | Yes |
|
||||
|
||||
### Returns
|
||||
|
||||
`number`
|
||||
[`number`](/docs/kcl/types/number)
|
||||
|
||||
|
||||
### Examples
|
||||
|
@ -9,7 +9,7 @@ Compute the arccosine of a number (in radians).
|
||||
|
||||
|
||||
```js
|
||||
acos(num: number) -> number
|
||||
acos(num: number): number
|
||||
```
|
||||
|
||||
### Tags
|
||||
@ -21,11 +21,11 @@ acos(num: number) -> number
|
||||
|
||||
| Name | Type | Description | Required |
|
||||
|----------|------|-------------|----------|
|
||||
| `num` | `number` | | Yes |
|
||||
| `num` | [`number`](/docs/kcl/types/number) | | Yes |
|
||||
|
||||
### Returns
|
||||
|
||||
`number`
|
||||
[`number`](/docs/kcl/types/number)
|
||||
|
||||
|
||||
### Examples
|
||||
|
@ -13,7 +13,7 @@ angleToMatchLengthX(
|
||||
tag: TagIdentifier,
|
||||
to: number,
|
||||
sketch: Sketch,
|
||||
) -> number
|
||||
): number
|
||||
```
|
||||
|
||||
|
||||
@ -21,13 +21,13 @@ angleToMatchLengthX(
|
||||
|
||||
| Name | Type | Description | Required |
|
||||
|----------|------|-------------|----------|
|
||||
| `tag` | [`TagIdentifier`](/docs/kcl/types#tag-identifier) | | Yes |
|
||||
| `to` | `number` | | Yes |
|
||||
| `sketch` | [`Sketch`](/docs/kcl/types/Sketch) | A sketch is a collection of paths. | Yes |
|
||||
| [`tag`](/docs/kcl/types/tag) | [`TagIdentifier`](/docs/kcl/types#tag-identifier) | | Yes |
|
||||
| `to` | [`number`](/docs/kcl/types/number) | | Yes |
|
||||
| `sketch` | [`Sketch`](/docs/kcl/types/Sketch) | | Yes |
|
||||
|
||||
### Returns
|
||||
|
||||
`number`
|
||||
[`number`](/docs/kcl/types/number)
|
||||
|
||||
|
||||
### Examples
|
||||
|
@ -13,7 +13,7 @@ angleToMatchLengthY(
|
||||
tag: TagIdentifier,
|
||||
to: number,
|
||||
sketch: Sketch,
|
||||
) -> number
|
||||
): number
|
||||
```
|
||||
|
||||
|
||||
@ -21,13 +21,13 @@ angleToMatchLengthY(
|
||||
|
||||
| Name | Type | Description | Required |
|
||||
|----------|------|-------------|----------|
|
||||
| `tag` | [`TagIdentifier`](/docs/kcl/types#tag-identifier) | | Yes |
|
||||
| `to` | `number` | | Yes |
|
||||
| `sketch` | [`Sketch`](/docs/kcl/types/Sketch) | A sketch is a collection of paths. | Yes |
|
||||
| [`tag`](/docs/kcl/types/tag) | [`TagIdentifier`](/docs/kcl/types#tag-identifier) | | Yes |
|
||||
| `to` | [`number`](/docs/kcl/types/number) | | Yes |
|
||||
| `sketch` | [`Sketch`](/docs/kcl/types/Sketch) | | Yes |
|
||||
|
||||
### Returns
|
||||
|
||||
`number`
|
||||
[`number`](/docs/kcl/types/number)
|
||||
|
||||
|
||||
### Examples
|
||||
@ -40,7 +40,7 @@ sketch001 = startSketchOn('XZ')
|
||||
angle = angleToMatchLengthY(seg01, 15, %),
|
||||
length = 5
|
||||
}, %)
|
||||
|> yLineTo(0, %)
|
||||
|> yLine(endAbsolute = 0)
|
||||
|> close()
|
||||
|
||||
extrusion = extrude(sketch001, length = 5)
|
||||
|
@ -1,19 +1,19 @@
|
||||
---
|
||||
title: "angledLine"
|
||||
excerpt: "Draw a line segment relative to the current origin using the polar"
|
||||
excerpt: "Draw a line segment relative to the current origin using the polar measure of some angle and distance."
|
||||
layout: manual
|
||||
---
|
||||
|
||||
Draw a line segment relative to the current origin using the polar
|
||||
Draw a line segment relative to the current origin using the polar measure of some angle and distance.
|
||||
|
||||
|
||||
measure of some angle and distance.
|
||||
|
||||
```js
|
||||
angledLine(
|
||||
data: AngledLineData,
|
||||
sketch: Sketch,
|
||||
tag?: TagDeclarator,
|
||||
) -> Sketch
|
||||
): Sketch
|
||||
```
|
||||
|
||||
|
||||
@ -22,12 +22,12 @@ angledLine(
|
||||
| Name | Type | Description | Required |
|
||||
|----------|------|-------------|----------|
|
||||
| `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 |
|
||||
| `tag` | [`TagDeclarator`](/docs/kcl/types#tag-declaration) | | No |
|
||||
| `sketch` | [`Sketch`](/docs/kcl/types/Sketch) | | Yes |
|
||||
| [`tag`](/docs/kcl/types/tag) | [`TagDeclarator`](/docs/kcl/types#tag-declaration) | | No |
|
||||
|
||||
### Returns
|
||||
|
||||
[`Sketch`](/docs/kcl/types/Sketch) - A sketch is a collection of paths.
|
||||
[`Sketch`](/docs/kcl/types/Sketch)
|
||||
|
||||
|
||||
### Examples
|
||||
@ -35,10 +35,10 @@ angledLine(
|
||||
```js
|
||||
exampleSketch = startSketchOn(XZ)
|
||||
|> startProfileAt([0, 0], %)
|
||||
|> yLineTo(15, %)
|
||||
|> yLine(endAbsolute = 15)
|
||||
|> angledLine({ angle = 30, length = 15 }, %)
|
||||
|> line(end = [8, -10])
|
||||
|> yLineTo(0, %)
|
||||
|> yLine(endAbsolute = 0)
|
||||
|> close()
|
||||
|
||||
example = extrude(exampleSketch, length = 10)
|
||||
|
@ -1,19 +1,19 @@
|
||||
---
|
||||
title: "angledLineOfXLength"
|
||||
excerpt: "Create a line segment from the current 2-dimensional sketch origin"
|
||||
excerpt: "Create a line segment from the current 2-dimensional sketch origin along some angle (in degrees) for some relative length in the 'x' dimension."
|
||||
layout: manual
|
||||
---
|
||||
|
||||
Create a line segment from the current 2-dimensional sketch origin
|
||||
Create a line segment from the current 2-dimensional sketch origin along some angle (in degrees) for some relative length in the 'x' dimension.
|
||||
|
||||
|
||||
along some angle (in degrees) for some relative length in the 'x' dimension.
|
||||
|
||||
```js
|
||||
angledLineOfXLength(
|
||||
data: AngledLineData,
|
||||
sketch: Sketch,
|
||||
tag?: TagDeclarator,
|
||||
) -> Sketch
|
||||
): Sketch
|
||||
```
|
||||
|
||||
|
||||
@ -22,12 +22,12 @@ angledLineOfXLength(
|
||||
| Name | Type | Description | Required |
|
||||
|----------|------|-------------|----------|
|
||||
| `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 |
|
||||
| `tag` | [`TagDeclarator`](/docs/kcl/types#tag-declaration) | | No |
|
||||
| `sketch` | [`Sketch`](/docs/kcl/types/Sketch) | | Yes |
|
||||
| [`tag`](/docs/kcl/types/tag) | [`TagDeclarator`](/docs/kcl/types#tag-declaration) | | No |
|
||||
|
||||
### Returns
|
||||
|
||||
[`Sketch`](/docs/kcl/types/Sketch) - A sketch is a collection of paths.
|
||||
[`Sketch`](/docs/kcl/types/Sketch)
|
||||
|
||||
|
||||
### Examples
|
||||
|
@ -1,19 +1,19 @@
|
||||
---
|
||||
title: "angledLineOfYLength"
|
||||
excerpt: "Create a line segment from the current 2-dimensional sketch origin"
|
||||
excerpt: "Create a line segment from the current 2-dimensional sketch origin along some angle (in degrees) for some relative length in the 'y' dimension."
|
||||
layout: manual
|
||||
---
|
||||
|
||||
Create a line segment from the current 2-dimensional sketch origin
|
||||
Create a line segment from the current 2-dimensional sketch origin along some angle (in degrees) for some relative length in the 'y' dimension.
|
||||
|
||||
|
||||
along some angle (in degrees) for some relative length in the 'y' dimension.
|
||||
|
||||
```js
|
||||
angledLineOfYLength(
|
||||
data: AngledLineData,
|
||||
sketch: Sketch,
|
||||
tag?: TagDeclarator,
|
||||
) -> Sketch
|
||||
): Sketch
|
||||
```
|
||||
|
||||
|
||||
@ -22,12 +22,12 @@ angledLineOfYLength(
|
||||
| Name | Type | Description | Required |
|
||||
|----------|------|-------------|----------|
|
||||
| `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 |
|
||||
| `tag` | [`TagDeclarator`](/docs/kcl/types#tag-declaration) | | No |
|
||||
| `sketch` | [`Sketch`](/docs/kcl/types/Sketch) | | Yes |
|
||||
| [`tag`](/docs/kcl/types/tag) | [`TagDeclarator`](/docs/kcl/types#tag-declaration) | | No |
|
||||
|
||||
### Returns
|
||||
|
||||
[`Sketch`](/docs/kcl/types/Sketch) - A sketch is a collection of paths.
|
||||
[`Sketch`](/docs/kcl/types/Sketch)
|
||||
|
||||
|
||||
### Examples
|
||||
|
@ -1,19 +1,19 @@
|
||||
---
|
||||
title: "angledLineThatIntersects"
|
||||
excerpt: "Draw an angled line from the current origin, constructing a line segment"
|
||||
excerpt: "Draw an angled line from the current origin, constructing a line segment such that the newly created line intersects the desired target line segment."
|
||||
layout: manual
|
||||
---
|
||||
|
||||
Draw an angled line from the current origin, constructing a line segment
|
||||
Draw an angled line from the current origin, constructing a line segment such that the newly created line intersects the desired target line segment.
|
||||
|
||||
|
||||
such that the newly created line intersects the desired target line segment.
|
||||
|
||||
```js
|
||||
angledLineThatIntersects(
|
||||
data: AngledLineThatIntersectsData,
|
||||
sketch: Sketch,
|
||||
tag?: TagDeclarator,
|
||||
) -> Sketch
|
||||
): Sketch
|
||||
```
|
||||
|
||||
|
||||
@ -22,12 +22,12 @@ angledLineThatIntersects(
|
||||
| Name | Type | Description | Required |
|
||||
|----------|------|-------------|----------|
|
||||
| `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 |
|
||||
| `tag` | [`TagDeclarator`](/docs/kcl/types#tag-declaration) | | No |
|
||||
| `sketch` | [`Sketch`](/docs/kcl/types/Sketch) | | Yes |
|
||||
| [`tag`](/docs/kcl/types/tag) | [`TagDeclarator`](/docs/kcl/types#tag-declaration) | | No |
|
||||
|
||||
### Returns
|
||||
|
||||
[`Sketch`](/docs/kcl/types/Sketch) - A sketch is a collection of paths.
|
||||
[`Sketch`](/docs/kcl/types/Sketch)
|
||||
|
||||
|
||||
### Examples
|
||||
|
@ -1,19 +1,19 @@
|
||||
---
|
||||
title: "angledLineToX"
|
||||
excerpt: "Create a line segment from the current 2-dimensional sketch origin"
|
||||
excerpt: "Create a line segment from the current 2-dimensional sketch origin along some angle (in degrees) for some length, ending at the provided value in the 'x' dimension."
|
||||
layout: manual
|
||||
---
|
||||
|
||||
Create a line segment from the current 2-dimensional sketch origin
|
||||
Create a line segment from the current 2-dimensional sketch origin along some angle (in degrees) for some length, ending at the provided value in the 'x' dimension.
|
||||
|
||||
|
||||
along some angle (in degrees) for some length, ending at the provided value in the 'x' dimension.
|
||||
|
||||
```js
|
||||
angledLineToX(
|
||||
data: AngledLineToData,
|
||||
sketch: Sketch,
|
||||
tag?: TagDeclarator,
|
||||
) -> Sketch
|
||||
): Sketch
|
||||
```
|
||||
|
||||
|
||||
@ -22,12 +22,12 @@ angledLineToX(
|
||||
| Name | Type | Description | Required |
|
||||
|----------|------|-------------|----------|
|
||||
| `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 |
|
||||
| `tag` | [`TagDeclarator`](/docs/kcl/types#tag-declaration) | | No |
|
||||
| `sketch` | [`Sketch`](/docs/kcl/types/Sketch) | | Yes |
|
||||
| [`tag`](/docs/kcl/types/tag) | [`TagDeclarator`](/docs/kcl/types#tag-declaration) | | No |
|
||||
|
||||
### Returns
|
||||
|
||||
[`Sketch`](/docs/kcl/types/Sketch) - A sketch is a collection of paths.
|
||||
[`Sketch`](/docs/kcl/types/Sketch)
|
||||
|
||||
|
||||
### Examples
|
||||
|
@ -1,19 +1,19 @@
|
||||
---
|
||||
title: "angledLineToY"
|
||||
excerpt: "Create a line segment from the current 2-dimensional sketch origin"
|
||||
excerpt: "Create a line segment from the current 2-dimensional sketch origin along some angle (in degrees) for some length, ending at the provided value in the 'y' dimension."
|
||||
layout: manual
|
||||
---
|
||||
|
||||
Create a line segment from the current 2-dimensional sketch origin
|
||||
Create a line segment from the current 2-dimensional sketch origin along some angle (in degrees) for some length, ending at the provided value in the 'y' dimension.
|
||||
|
||||
|
||||
along some angle (in degrees) for some length, ending at the provided value in the 'y' dimension.
|
||||
|
||||
```js
|
||||
angledLineToY(
|
||||
data: AngledLineToData,
|
||||
sketch: Sketch,
|
||||
tag?: TagDeclarator,
|
||||
) -> Sketch
|
||||
): Sketch
|
||||
```
|
||||
|
||||
|
||||
@ -22,12 +22,12 @@ angledLineToY(
|
||||
| Name | Type | Description | Required |
|
||||
|----------|------|-------------|----------|
|
||||
| `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 |
|
||||
| `tag` | [`TagDeclarator`](/docs/kcl/types#tag-declaration) | | No |
|
||||
| `sketch` | [`Sketch`](/docs/kcl/types/Sketch) | | Yes |
|
||||
| [`tag`](/docs/kcl/types/tag) | [`TagDeclarator`](/docs/kcl/types#tag-declaration) | | No |
|
||||
|
||||
### Returns
|
||||
|
||||
[`Sketch`](/docs/kcl/types/Sketch) - A sketch is a collection of paths.
|
||||
[`Sketch`](/docs/kcl/types/Sketch)
|
||||
|
||||
|
||||
### Examples
|
||||
|
@ -14,7 +14,7 @@ appearance(
|
||||
color: String,
|
||||
metalness?: number,
|
||||
roughness?: number,
|
||||
) -> SolidSet
|
||||
): SolidSet
|
||||
```
|
||||
|
||||
|
||||
@ -24,8 +24,8 @@ appearance(
|
||||
|----------|------|-------------|----------|
|
||||
| `solidSet` | [`SolidSet`](/docs/kcl/types/SolidSet) | The solid(s) whose appearance is being set | Yes |
|
||||
| `color` | `String` | Color of the new material, a hex string like '#ff0000' | Yes |
|
||||
| `metalness` | `number` | Metalness of the new material, a percentage like 95.7. | No |
|
||||
| `roughness` | `number` | Roughness of the new material, a percentage like 95.7. | No |
|
||||
| `metalness` | [`number`](/docs/kcl/types/number) | Metalness of the new material, a percentage like 95.7. | No |
|
||||
| `roughness` | [`number`](/docs/kcl/types/number) | Roughness of the new material, a percentage like 95.7. | No |
|
||||
|
||||
### Returns
|
||||
|
||||
|
@ -15,7 +15,7 @@ arc(
|
||||
data: ArcData,
|
||||
sketch: Sketch,
|
||||
tag?: TagDeclarator,
|
||||
) -> Sketch
|
||||
): Sketch
|
||||
```
|
||||
|
||||
|
||||
@ -24,12 +24,12 @@ arc(
|
||||
| Name | Type | Description | Required |
|
||||
|----------|------|-------------|----------|
|
||||
| `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 |
|
||||
| `tag` | [`TagDeclarator`](/docs/kcl/types#tag-declaration) | | No |
|
||||
| `sketch` | [`Sketch`](/docs/kcl/types/Sketch) | | Yes |
|
||||
| [`tag`](/docs/kcl/types/tag) | [`TagDeclarator`](/docs/kcl/types#tag-declaration) | | No |
|
||||
|
||||
### Returns
|
||||
|
||||
[`Sketch`](/docs/kcl/types/Sketch) - A sketch is a collection of paths.
|
||||
[`Sketch`](/docs/kcl/types/Sketch)
|
||||
|
||||
|
||||
### Examples
|
||||
|
@ -1,10 +1,10 @@
|
||||
---
|
||||
title: "arcTo"
|
||||
excerpt: "Draw a 3 point arc."
|
||||
excerpt: "Draw a three point arc."
|
||||
layout: manual
|
||||
---
|
||||
|
||||
Draw a 3 point arc.
|
||||
Draw a three point arc.
|
||||
|
||||
The arc is constructed such that the start point is the current position of the sketch and two more points defined as the end and interior point. The interior point is placed between the start point and end point. The radius of the arc will be controlled by how far the interior point is placed from the start and end.
|
||||
|
||||
@ -13,7 +13,7 @@ arcTo(
|
||||
data: ArcToData,
|
||||
sketch: Sketch,
|
||||
tag?: TagDeclarator,
|
||||
) -> Sketch
|
||||
): Sketch
|
||||
```
|
||||
|
||||
|
||||
@ -22,12 +22,12 @@ arcTo(
|
||||
| Name | Type | Description | Required |
|
||||
|----------|------|-------------|----------|
|
||||
| `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 |
|
||||
| `tag` | [`TagDeclarator`](/docs/kcl/types#tag-declaration) | | No |
|
||||
| `sketch` | [`Sketch`](/docs/kcl/types/Sketch) | | Yes |
|
||||
| [`tag`](/docs/kcl/types/tag) | [`TagDeclarator`](/docs/kcl/types#tag-declaration) | | No |
|
||||
|
||||
### Returns
|
||||
|
||||
[`Sketch`](/docs/kcl/types/Sketch) - A sketch is a collection of paths.
|
||||
[`Sketch`](/docs/kcl/types/Sketch)
|
||||
|
||||
|
||||
### Examples
|
||||
|
@ -9,7 +9,7 @@ Compute the arcsine of a number (in radians).
|
||||
|
||||
|
||||
```js
|
||||
asin(num: number) -> number
|
||||
asin(num: number): number
|
||||
```
|
||||
|
||||
### Tags
|
||||
@ -21,11 +21,11 @@ asin(num: number) -> number
|
||||
|
||||
| Name | Type | Description | Required |
|
||||
|----------|------|-------------|----------|
|
||||
| `num` | `number` | | Yes |
|
||||
| `num` | [`number`](/docs/kcl/types/number) | | Yes |
|
||||
|
||||
### Returns
|
||||
|
||||
`number`
|
||||
[`number`](/docs/kcl/types/number)
|
||||
|
||||
|
||||
### Examples
|
||||
@ -37,7 +37,7 @@ sketch001 = startSketchOn('XZ')
|
||||
angle = toDegrees(asin(0.5)),
|
||||
length = 20
|
||||
}, %)
|
||||
|> yLineTo(0, %)
|
||||
|> yLine(endAbsolute = 0)
|
||||
|> close()
|
||||
|
||||
extrude001 = extrude(sketch001, length = 5)
|
||||
|
@ -1,18 +1,18 @@
|
||||
---
|
||||
title: "assert"
|
||||
excerpt: "Check a value at runtime, and raise an error if the argument provided"
|
||||
excerpt: "Check a value at runtime, and raise an error if the argument provided is false."
|
||||
layout: manual
|
||||
---
|
||||
|
||||
Check a value at runtime, and raise an error if the argument provided
|
||||
Check a value at runtime, and raise an error if the argument provided is false.
|
||||
|
||||
|
||||
is false.
|
||||
|
||||
```js
|
||||
assert(
|
||||
data: bool,
|
||||
message: string,
|
||||
) -> ()
|
||||
): ()
|
||||
```
|
||||
|
||||
|
||||
@ -20,8 +20,8 @@ assert(
|
||||
|
||||
| Name | Type | Description | Required |
|
||||
|----------|------|-------------|----------|
|
||||
| `data` | `bool` | | Yes |
|
||||
| `message` | `string` | | Yes |
|
||||
| `data` | [`bool`](/docs/kcl/types/bool) | | Yes |
|
||||
| `message` | [`string`](/docs/kcl/types/string) | | Yes |
|
||||
|
||||
### Returns
|
||||
|
||||
|
@ -1,12 +1,12 @@
|
||||
---
|
||||
title: "assertEqual"
|
||||
excerpt: "Check that a numerical value equals another at runtime,"
|
||||
excerpt: "Check that a numerical value equals another at runtime, otherwise raise an error."
|
||||
layout: manual
|
||||
---
|
||||
|
||||
Check that a numerical value equals another at runtime,
|
||||
Check that a numerical value equals another at runtime, otherwise raise an error.
|
||||
|
||||
|
||||
otherwise raise an error.
|
||||
|
||||
```js
|
||||
assertEqual(
|
||||
@ -14,7 +14,7 @@ assertEqual(
|
||||
right: number,
|
||||
epsilon: number,
|
||||
message: string,
|
||||
) -> ()
|
||||
): ()
|
||||
```
|
||||
|
||||
|
||||
@ -22,10 +22,10 @@ assertEqual(
|
||||
|
||||
| Name | Type | Description | Required |
|
||||
|----------|------|-------------|----------|
|
||||
| `left` | `number` | | Yes |
|
||||
| `right` | `number` | | Yes |
|
||||
| `epsilon` | `number` | | Yes |
|
||||
| `message` | `string` | | Yes |
|
||||
| `left` | [`number`](/docs/kcl/types/number) | | Yes |
|
||||
| `right` | [`number`](/docs/kcl/types/number) | | Yes |
|
||||
| `epsilon` | [`number`](/docs/kcl/types/number) | | Yes |
|
||||
| `message` | [`string`](/docs/kcl/types/string) | | Yes |
|
||||
|
||||
### Returns
|
||||
|
||||
|
@ -1,19 +1,19 @@
|
||||
---
|
||||
title: "assertGreaterThan"
|
||||
excerpt: "Check that a numerical value is greater than another at runtime,"
|
||||
excerpt: "Check that a numerical value is greater than another at runtime, otherwise raise an error."
|
||||
layout: manual
|
||||
---
|
||||
|
||||
Check that a numerical value is greater than another at runtime,
|
||||
Check that a numerical value is greater than another at runtime, otherwise raise an error.
|
||||
|
||||
|
||||
otherwise raise an error.
|
||||
|
||||
```js
|
||||
assertGreaterThan(
|
||||
left: number,
|
||||
right: number,
|
||||
message: string,
|
||||
) -> ()
|
||||
): ()
|
||||
```
|
||||
|
||||
|
||||
@ -21,9 +21,9 @@ assertGreaterThan(
|
||||
|
||||
| Name | Type | Description | Required |
|
||||
|----------|------|-------------|----------|
|
||||
| `left` | `number` | | Yes |
|
||||
| `right` | `number` | | Yes |
|
||||
| `message` | `string` | | Yes |
|
||||
| `left` | [`number`](/docs/kcl/types/number) | | Yes |
|
||||
| `right` | [`number`](/docs/kcl/types/number) | | Yes |
|
||||
| `message` | [`string`](/docs/kcl/types/string) | | Yes |
|
||||
|
||||
### Returns
|
||||
|
||||
|
@ -1,19 +1,19 @@
|
||||
---
|
||||
title: "assertGreaterThanOrEq"
|
||||
excerpt: "Check that a numerical value is greater than or equal to another at runtime,"
|
||||
excerpt: "Check that a numerical value is greater than or equal to another at runtime, otherwise raise an error."
|
||||
layout: manual
|
||||
---
|
||||
|
||||
Check that a numerical value is greater than or equal to another at runtime,
|
||||
Check that a numerical value is greater than or equal to another at runtime, otherwise raise an error.
|
||||
|
||||
|
||||
otherwise raise an error.
|
||||
|
||||
```js
|
||||
assertGreaterThanOrEq(
|
||||
left: number,
|
||||
right: number,
|
||||
message: string,
|
||||
) -> ()
|
||||
): ()
|
||||
```
|
||||
|
||||
|
||||
@ -21,9 +21,9 @@ assertGreaterThanOrEq(
|
||||
|
||||
| Name | Type | Description | Required |
|
||||
|----------|------|-------------|----------|
|
||||
| `left` | `number` | | Yes |
|
||||
| `right` | `number` | | Yes |
|
||||
| `message` | `string` | | Yes |
|
||||
| `left` | [`number`](/docs/kcl/types/number) | | Yes |
|
||||
| `right` | [`number`](/docs/kcl/types/number) | | Yes |
|
||||
| `message` | [`string`](/docs/kcl/types/string) | | Yes |
|
||||
|
||||
### Returns
|
||||
|
||||
|
@ -1,19 +1,19 @@
|
||||
---
|
||||
title: "assertLessThan"
|
||||
excerpt: "Check that a numerical value is less than to another at runtime,"
|
||||
excerpt: "Check that a numerical value is less than to another at runtime, otherwise raise an error."
|
||||
layout: manual
|
||||
---
|
||||
|
||||
Check that a numerical value is less than to another at runtime,
|
||||
Check that a numerical value is less than to another at runtime, otherwise raise an error.
|
||||
|
||||
|
||||
otherwise raise an error.
|
||||
|
||||
```js
|
||||
assertLessThan(
|
||||
left: number,
|
||||
right: number,
|
||||
message: string,
|
||||
) -> ()
|
||||
): ()
|
||||
```
|
||||
|
||||
|
||||
@ -21,9 +21,9 @@ assertLessThan(
|
||||
|
||||
| Name | Type | Description | Required |
|
||||
|----------|------|-------------|----------|
|
||||
| `left` | `number` | | Yes |
|
||||
| `right` | `number` | | Yes |
|
||||
| `message` | `string` | | Yes |
|
||||
| `left` | [`number`](/docs/kcl/types/number) | | Yes |
|
||||
| `right` | [`number`](/docs/kcl/types/number) | | Yes |
|
||||
| `message` | [`string`](/docs/kcl/types/string) | | Yes |
|
||||
|
||||
### Returns
|
||||
|
||||
|
@ -1,19 +1,19 @@
|
||||
---
|
||||
title: "assertLessThanOrEq"
|
||||
excerpt: "Check that a numerical value is less than or equal to another at runtime,"
|
||||
excerpt: "Check that a numerical value is less than or equal to another at runtime, otherwise raise an error."
|
||||
layout: manual
|
||||
---
|
||||
|
||||
Check that a numerical value is less than or equal to another at runtime,
|
||||
Check that a numerical value is less than or equal to another at runtime, otherwise raise an error.
|
||||
|
||||
|
||||
otherwise raise an error.
|
||||
|
||||
```js
|
||||
assertLessThanOrEq(
|
||||
left: number,
|
||||
right: number,
|
||||
message: string,
|
||||
) -> ()
|
||||
): ()
|
||||
```
|
||||
|
||||
|
||||
@ -21,9 +21,9 @@ assertLessThanOrEq(
|
||||
|
||||
| Name | Type | Description | Required |
|
||||
|----------|------|-------------|----------|
|
||||
| `left` | `number` | | Yes |
|
||||
| `right` | `number` | | Yes |
|
||||
| `message` | `string` | | Yes |
|
||||
| `left` | [`number`](/docs/kcl/types/number) | | Yes |
|
||||
| `right` | [`number`](/docs/kcl/types/number) | | Yes |
|
||||
| `message` | [`string`](/docs/kcl/types/string) | | Yes |
|
||||
|
||||
### Returns
|
||||
|
||||
|
@ -9,7 +9,7 @@ Compute the arctangent of a number (in radians).
|
||||
|
||||
|
||||
```js
|
||||
atan(num: number) -> number
|
||||
atan(num: number): number
|
||||
```
|
||||
|
||||
### Tags
|
||||
@ -21,11 +21,11 @@ atan(num: number) -> number
|
||||
|
||||
| Name | Type | Description | Required |
|
||||
|----------|------|-------------|----------|
|
||||
| `num` | `number` | | Yes |
|
||||
| `num` | [`number`](/docs/kcl/types/number) | | Yes |
|
||||
|
||||
### Returns
|
||||
|
||||
`number`
|
||||
[`number`](/docs/kcl/types/number)
|
||||
|
||||
|
||||
### Examples
|
||||
@ -37,7 +37,7 @@ sketch001 = startSketchOn('XZ')
|
||||
angle = toDegrees(atan(1.25)),
|
||||
length = 20
|
||||
}, %)
|
||||
|> yLineTo(0, %)
|
||||
|> yLine(endAbsolute = 0)
|
||||
|> close()
|
||||
|
||||
extrude001 = extrude(sketch001, length = 5)
|
||||
|
@ -12,7 +12,7 @@ Compute the four quadrant arctangent of Y and X (in radians).
|
||||
atan2(
|
||||
y: number,
|
||||
x: number,
|
||||
) -> number
|
||||
): number
|
||||
```
|
||||
|
||||
### Tags
|
||||
@ -24,12 +24,12 @@ atan2(
|
||||
|
||||
| Name | Type | Description | Required |
|
||||
|----------|------|-------------|----------|
|
||||
| `y` | `number` | | Yes |
|
||||
| `x` | `number` | | Yes |
|
||||
| `y` | [`number`](/docs/kcl/types/number) | | Yes |
|
||||
| `x` | [`number`](/docs/kcl/types/number) | | Yes |
|
||||
|
||||
### Returns
|
||||
|
||||
`number`
|
||||
[`number`](/docs/kcl/types/number)
|
||||
|
||||
|
||||
### Examples
|
||||
@ -41,7 +41,7 @@ sketch001 = startSketchOn('XZ')
|
||||
angle = toDegrees(atan2(1.25, 2)),
|
||||
length = 20
|
||||
}, %)
|
||||
|> yLineTo(0, %)
|
||||
|> yLine(endAbsolute = 0)
|
||||
|> close()
|
||||
|
||||
extrude001 = extrude(sketch001, length = 5)
|
||||
|
@ -1,19 +1,19 @@
|
||||
---
|
||||
title: "bezierCurve"
|
||||
excerpt: "Draw a smooth, continuous, curved line segment from the current origin to"
|
||||
excerpt: "Draw a smooth, continuous, curved line segment from the current origin to the desired (x, y), using a number of control points to shape the curve's shape."
|
||||
layout: manual
|
||||
---
|
||||
|
||||
Draw a smooth, continuous, curved line segment from the current origin to
|
||||
Draw a smooth, continuous, curved line segment from the current origin to the desired (x, y), using a number of control points to shape the curve's shape.
|
||||
|
||||
|
||||
the desired (x, y), using a number of control points to shape the curve's shape.
|
||||
|
||||
```js
|
||||
bezierCurve(
|
||||
data: BezierData,
|
||||
sketch: Sketch,
|
||||
tag?: TagDeclarator,
|
||||
) -> Sketch
|
||||
): Sketch
|
||||
```
|
||||
|
||||
|
||||
@ -22,12 +22,12 @@ bezierCurve(
|
||||
| Name | Type | Description | Required |
|
||||
|----------|------|-------------|----------|
|
||||
| `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 |
|
||||
| `tag` | [`TagDeclarator`](/docs/kcl/types#tag-declaration) | | No |
|
||||
| `sketch` | [`Sketch`](/docs/kcl/types/Sketch) | | Yes |
|
||||
| [`tag`](/docs/kcl/types/tag) | [`TagDeclarator`](/docs/kcl/types#tag-declaration) | | No |
|
||||
|
||||
### Returns
|
||||
|
||||
[`Sketch`](/docs/kcl/types/Sketch) - A sketch is a collection of paths.
|
||||
[`Sketch`](/docs/kcl/types/Sketch)
|
||||
|
||||
|
||||
### Examples
|
||||
|
@ -9,7 +9,7 @@ Compute the smallest integer greater than or equal to a number.
|
||||
|
||||
|
||||
```js
|
||||
ceil(num: number) -> number
|
||||
ceil(num: number): number
|
||||
```
|
||||
|
||||
### Tags
|
||||
@ -21,11 +21,11 @@ ceil(num: number) -> number
|
||||
|
||||
| Name | Type | Description | Required |
|
||||
|----------|------|-------------|----------|
|
||||
| `num` | `number` | | Yes |
|
||||
| `num` | [`number`](/docs/kcl/types/number) | | Yes |
|
||||
|
||||
### Returns
|
||||
|
||||
`number`
|
||||
[`number`](/docs/kcl/types/number)
|
||||
|
||||
|
||||
### Examples
|
||||
@ -35,7 +35,7 @@ sketch001 = startSketchOn('XZ')
|
||||
|> startProfileAt([0, 0], %)
|
||||
|> line(endAbsolute = [12, 10])
|
||||
|> line(end = [ceil(7.02986), 0])
|
||||
|> yLineTo(0, %)
|
||||
|> yLine(endAbsolute = 0)
|
||||
|> close()
|
||||
|
||||
extrude001 = extrude(sketch001, length = 5)
|
||||
|
@ -14,7 +14,7 @@ chamfer(
|
||||
length: number,
|
||||
tags: [EdgeReference],
|
||||
tag?: TagDeclarator,
|
||||
) -> Solid
|
||||
): Solid
|
||||
```
|
||||
|
||||
|
||||
@ -23,13 +23,13 @@ chamfer(
|
||||
| Name | Type | Description | Required |
|
||||
|----------|------|-------------|----------|
|
||||
| `solid` | [`Solid`](/docs/kcl/types/Solid) | The solid whose edges should be chamfered | Yes |
|
||||
| `length` | `number` | The length of the chamfer | Yes |
|
||||
| `length` | [`number`](/docs/kcl/types/number) | The length of the chamfer | Yes |
|
||||
| `tags` | [`[EdgeReference]`](/docs/kcl/types/EdgeReference) | The paths you want to chamfer | Yes |
|
||||
| `tag` | [`TagDeclarator`](/docs/kcl/types#tag-declaration) | Create a new tag which refers to this chamfer | No |
|
||||
| [`tag`](/docs/kcl/types/tag) | [`TagDeclarator`](/docs/kcl/types#tag-declaration) | Create a new tag which refers to this chamfer | No |
|
||||
|
||||
### Returns
|
||||
|
||||
[`Solid`](/docs/kcl/types/Solid) - A solid is a collection of extrude surfaces.
|
||||
[`Solid`](/docs/kcl/types/Solid)
|
||||
|
||||
|
||||
### Examples
|
||||
|
@ -1,12 +1,12 @@
|
||||
---
|
||||
title: "circle"
|
||||
excerpt: "Construct a 2-dimensional circle, of the specified radius, centered at"
|
||||
excerpt: "Construct a 2-dimensional circle, of the specified radius, centered at the provided (x, y) origin point."
|
||||
layout: manual
|
||||
---
|
||||
|
||||
Construct a 2-dimensional circle, of the specified radius, centered at
|
||||
Construct a 2-dimensional circle, of the specified radius, centered at the provided (x, y) origin point.
|
||||
|
||||
|
||||
the provided (x, y) origin point.
|
||||
|
||||
```js
|
||||
circle(
|
||||
@ -14,7 +14,7 @@ circle(
|
||||
center: [number],
|
||||
radius: number,
|
||||
tag?: TagDeclarator,
|
||||
) -> Sketch
|
||||
): Sketch
|
||||
```
|
||||
|
||||
|
||||
@ -23,13 +23,13 @@ circle(
|
||||
| Name | Type | Description | Required |
|
||||
|----------|------|-------------|----------|
|
||||
| `sketchOrSurface` | [`SketchOrSurface`](/docs/kcl/types/SketchOrSurface) | Plane or surface to sketch on. | Yes |
|
||||
| `center` | `[number]` | The center of the circle. | Yes |
|
||||
| `radius` | `number` | The radius of the circle. | Yes |
|
||||
| `tag` | [`TagDeclarator`](/docs/kcl/types#tag-declaration) | Create a new tag which refers to this circle | No |
|
||||
| `center` | [`[number]`](/docs/kcl/types/number) | The center of the circle. | Yes |
|
||||
| `radius` | [`number`](/docs/kcl/types/number) | The radius of the circle. | Yes |
|
||||
| [`tag`](/docs/kcl/types/tag) | [`TagDeclarator`](/docs/kcl/types#tag-declaration) | Create a new tag which refers to this circle | No |
|
||||
|
||||
### Returns
|
||||
|
||||
[`Sketch`](/docs/kcl/types/Sketch) - A sketch is a collection of paths.
|
||||
[`Sketch`](/docs/kcl/types/Sketch)
|
||||
|
||||
|
||||
### Examples
|
||||
|
@ -15,7 +15,7 @@ circleThreePoint(
|
||||
p3: [number],
|
||||
sketchSurfaceOrGroup: SketchOrSurface,
|
||||
tag?: TagDeclarator,
|
||||
) -> Sketch
|
||||
): Sketch
|
||||
```
|
||||
|
||||
|
||||
@ -23,15 +23,15 @@ circleThreePoint(
|
||||
|
||||
| Name | Type | Description | Required |
|
||||
|----------|------|-------------|----------|
|
||||
| `p1` | `[number]` | 1st point to derive the circle. | Yes |
|
||||
| `p2` | `[number]` | 2nd point to derive the circle. | Yes |
|
||||
| `p3` | `[number]` | 3rd point to derive the circle. | Yes |
|
||||
| `p1` | [`[number]`](/docs/kcl/types/number) | 1st point to derive the circle. | Yes |
|
||||
| `p2` | [`[number]`](/docs/kcl/types/number) | 2nd 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 |
|
||||
| `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
|
||||
|
||||
[`Sketch`](/docs/kcl/types/Sketch) - A sketch is a collection of paths.
|
||||
[`Sketch`](/docs/kcl/types/Sketch)
|
||||
|
||||
|
||||
### Examples
|
||||
|
@ -1,18 +1,18 @@
|
||||
---
|
||||
title: "close"
|
||||
excerpt: "Construct a line segment from the current origin back to the profile's"
|
||||
excerpt: "Construct a line segment from the current origin back to the profile's origin, ensuring the resulting 2-dimensional sketch is not open-ended."
|
||||
layout: manual
|
||||
---
|
||||
|
||||
Construct a line segment from the current origin back to the profile's
|
||||
Construct a line segment from the current origin back to the profile's origin, ensuring the resulting 2-dimensional sketch is not open-ended.
|
||||
|
||||
|
||||
origin, ensuring the resulting 2-dimensional sketch is not open-ended.
|
||||
|
||||
```js
|
||||
close(
|
||||
sketch: Sketch,
|
||||
tag?: TagDeclarator,
|
||||
) -> Sketch
|
||||
): Sketch
|
||||
```
|
||||
|
||||
|
||||
@ -21,11 +21,11 @@ close(
|
||||
| Name | Type | Description | Required |
|
||||
|----------|------|-------------|----------|
|
||||
| `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
|
||||
|
||||
[`Sketch`](/docs/kcl/types/Sketch) - A sketch is a collection of paths.
|
||||
[`Sketch`](/docs/kcl/types/Sketch)
|
||||
|
||||
|
||||
### Examples
|
||||
|
@ -15,7 +15,7 @@ For example, if the current project uses inches, this function will return `0.39
|
||||
We merely provide these functions for convenience and readability, as `10 * cm()` is more readable that your intent is "I want 10 centimeters" than `10 * 10`, if the project settings are in millimeters.
|
||||
|
||||
```js
|
||||
cm() -> number
|
||||
cm(): number
|
||||
```
|
||||
|
||||
### Tags
|
||||
@ -26,7 +26,7 @@ cm() -> number
|
||||
|
||||
### Returns
|
||||
|
||||
`number`
|
||||
[`number`](/docs/kcl/types/number)
|
||||
|
||||
|
||||
### Examples
|
||||
|
@ -21,7 +21,7 @@ exampleSketch = startSketchOn("XZ")
|
||||
angle = 30,
|
||||
length = 2 * E ^ 2,
|
||||
}, %)
|
||||
|> yLineTo(0, %)
|
||||
|> yLine(endAbsolute = 0)
|
||||
|> close()
|
||||
|
||||
example = extrude(exampleSketch, length = 10)
|
||||
|
@ -21,7 +21,7 @@ exampleSketch = startSketchOn("XZ")
|
||||
angle = 50,
|
||||
length = 10 * TAU,
|
||||
}, %)
|
||||
|> yLineTo(0, %)
|
||||
|> yLine(endAbsolute = 0)
|
||||
|> close()
|
||||
|
||||
example = extrude(exampleSketch, length = 5)
|
||||
|
@ -11,7 +11,7 @@ Return the value of Euler’s number `e`.
|
||||
**DEPRECATED** use the constant E
|
||||
|
||||
```js
|
||||
e() -> number
|
||||
e(): number
|
||||
```
|
||||
|
||||
### Tags
|
||||
@ -22,7 +22,7 @@ e() -> number
|
||||
|
||||
### Returns
|
||||
|
||||
`number`
|
||||
[`number`](/docs/kcl/types/number)
|
||||
|
||||
|
||||
### Examples
|
||||
@ -31,7 +31,7 @@ e() -> number
|
||||
exampleSketch = startSketchOn("XZ")
|
||||
|> startProfileAt([0, 0], %)
|
||||
|> angledLine({ angle = 30, length = 2 * e() ^ 2 }, %)
|
||||
|> yLineTo(0, %)
|
||||
|> yLine(endAbsolute = 0)
|
||||
|> close()
|
||||
|
||||
example = extrude(exampleSketch, length = 10)
|
||||
|
@ -1,18 +1,18 @@
|
||||
---
|
||||
title: "extrude"
|
||||
excerpt: "Extend a 2-dimensional sketch through a third dimension in order to"
|
||||
excerpt: "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."
|
||||
layout: manual
|
||||
---
|
||||
|
||||
Extend a 2-dimensional sketch through a third dimension in order to
|
||||
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.
|
||||
|
||||
|
||||
create new 3-dimensional volume, or if extruded into an existing volume, cut into an existing solid.
|
||||
|
||||
```js
|
||||
extrude(
|
||||
sketchSet: SketchSet,
|
||||
length: number,
|
||||
) -> SolidSet
|
||||
): SolidSet
|
||||
```
|
||||
|
||||
|
||||
@ -21,7 +21,7 @@ extrude(
|
||||
| Name | Type | Description | Required |
|
||||
|----------|------|-------------|----------|
|
||||
| `sketchSet` | [`SketchSet`](/docs/kcl/types/SketchSet) | Which 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 |
|
||||
|
||||
### Returns
|
||||
|
||||
|
@ -15,7 +15,7 @@ fillet(
|
||||
tags: [EdgeReference],
|
||||
tolerance?: number,
|
||||
tag?: TagDeclarator,
|
||||
) -> Solid
|
||||
): Solid
|
||||
```
|
||||
|
||||
|
||||
@ -24,14 +24,14 @@ fillet(
|
||||
| Name | Type | Description | Required |
|
||||
|----------|------|-------------|----------|
|
||||
| `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 |
|
||||
| `tolerance` | `number` | The tolerance for this fillet | No |
|
||||
| `tag` | [`TagDeclarator`](/docs/kcl/types#tag-declaration) | Create a new tag which refers to this fillet | No |
|
||||
| `tolerance` | [`number`](/docs/kcl/types/number) | The tolerance for 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
|
||||
|
||||
[`Solid`](/docs/kcl/types/Solid) - A solid is a collection of extrude surfaces.
|
||||
[`Solid`](/docs/kcl/types/Solid)
|
||||
|
||||
|
||||
### Examples
|
||||
|
@ -9,7 +9,7 @@ Compute the largest integer less than or equal to a number.
|
||||
|
||||
|
||||
```js
|
||||
floor(num: number) -> number
|
||||
floor(num: number): number
|
||||
```
|
||||
|
||||
### Tags
|
||||
@ -21,11 +21,11 @@ floor(num: number) -> number
|
||||
|
||||
| Name | Type | Description | Required |
|
||||
|----------|------|-------------|----------|
|
||||
| `num` | `number` | | Yes |
|
||||
| `num` | [`number`](/docs/kcl/types/number) | | Yes |
|
||||
|
||||
### Returns
|
||||
|
||||
`number`
|
||||
[`number`](/docs/kcl/types/number)
|
||||
|
||||
|
||||
### Examples
|
||||
@ -35,7 +35,7 @@ sketch001 = startSketchOn('XZ')
|
||||
|> startProfileAt([0, 0], %)
|
||||
|> line(endAbsolute = [12, 10])
|
||||
|> line(end = [floor(7.02986), 0])
|
||||
|> yLineTo(0, %)
|
||||
|> yLine(endAbsolute = 0)
|
||||
|> close()
|
||||
|
||||
extrude001 = extrude(sketch001, length = 5)
|
||||
|
@ -15,7 +15,7 @@ For example, if the current project uses inches, this function will return `12`.
|
||||
We merely provide these functions for convenience and readability, as `10 * ft()` is more readable that your intent is "I want 10 feet" than `10 * 304.8`, if the project settings are in millimeters.
|
||||
|
||||
```js
|
||||
ft() -> number
|
||||
ft(): number
|
||||
```
|
||||
|
||||
### Tags
|
||||
@ -26,7 +26,7 @@ ft() -> number
|
||||
|
||||
### Returns
|
||||
|
||||
`number`
|
||||
[`number`](/docs/kcl/types/number)
|
||||
|
||||
|
||||
### Examples
|
||||
|
@ -9,7 +9,7 @@ Get the next adjacent edge to the edge given.
|
||||
|
||||
|
||||
```js
|
||||
getNextAdjacentEdge(tag: TagIdentifier) -> Uuid
|
||||
getNextAdjacentEdge(tag: TagIdentifier): Uuid
|
||||
```
|
||||
|
||||
|
||||
@ -17,7 +17,7 @@ getNextAdjacentEdge(tag: TagIdentifier) -> Uuid
|
||||
|
||||
| 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
|
||||
|
||||
|
@ -9,7 +9,7 @@ Get the opposite edge to the edge given.
|
||||
|
||||
|
||||
```js
|
||||
getOppositeEdge(tag: TagIdentifier) -> Uuid
|
||||
getOppositeEdge(tag: TagIdentifier): Uuid
|
||||
```
|
||||
|
||||
|
||||
@ -17,7 +17,7 @@ getOppositeEdge(tag: TagIdentifier) -> Uuid
|
||||
|
||||
| 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
|
||||
|
||||
|
@ -9,7 +9,7 @@ Get the previous adjacent edge to the edge given.
|
||||
|
||||
|
||||
```js
|
||||
getPreviousAdjacentEdge(tag: TagIdentifier) -> Uuid
|
||||
getPreviousAdjacentEdge(tag: TagIdentifier): Uuid
|
||||
```
|
||||
|
||||
|
||||
@ -17,7 +17,7 @@ getPreviousAdjacentEdge(tag: TagIdentifier) -> Uuid
|
||||
|
||||
| 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
|
||||
|
||||
|
@ -16,7 +16,7 @@ helix(
|
||||
radius: number,
|
||||
axis: Axis3dOrEdgeReference,
|
||||
length?: number,
|
||||
) -> HelixValue
|
||||
): HelixValue
|
||||
```
|
||||
|
||||
|
||||
@ -24,12 +24,12 @@ helix(
|
||||
|
||||
| Name | Type | Description | Required |
|
||||
|----------|------|-------------|----------|
|
||||
| `revolutions` | `number` | Number of revolutions. | Yes |
|
||||
| `angleStart` | `number` | Start angle (in degrees). | Yes |
|
||||
| `ccw` | `bool` | Is the helix rotation counter clockwise? The default is `false`. | No |
|
||||
| `radius` | `number` | Radius of the helix. | Yes |
|
||||
| `revolutions` | [`number`](/docs/kcl/types/number) | Number of revolutions. | Yes |
|
||||
| `angleStart` | [`number`](/docs/kcl/types/number) | Start angle (in degrees). | Yes |
|
||||
| `ccw` | [`bool`](/docs/kcl/types/bool) | Is the helix rotation counter clockwise? The default is `false`. | No |
|
||||
| `radius` | [`number`](/docs/kcl/types/number) | Radius of the helix. | Yes |
|
||||
| `axis` | [`Axis3dOrEdgeReference`](/docs/kcl/types/Axis3dOrEdgeReference) | Axis to use for the helix. | Yes |
|
||||
| `length` | `number` | Length of the helix. This is not necessary if the helix is created around an edge. If not given the length of the edge is used. | No |
|
||||
| `length` | [`number`](/docs/kcl/types/number) | Length of the helix. This is not necessary if the helix is created around an edge. If not given the length of the edge is used. | No |
|
||||
|
||||
### Returns
|
||||
|
||||
|
@ -12,7 +12,7 @@ Create a helix on a cylinder.
|
||||
helixRevolutions(
|
||||
data: HelixRevolutionsData,
|
||||
solid: Solid,
|
||||
) -> Solid
|
||||
): Solid
|
||||
```
|
||||
|
||||
|
||||
@ -21,11 +21,11 @@ helixRevolutions(
|
||||
| Name | Type | Description | Required |
|
||||
|----------|------|-------------|----------|
|
||||
| `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
|
||||
|
||||
[`Solid`](/docs/kcl/types/Solid) - A solid is a collection of extrude surfaces.
|
||||
[`Solid`](/docs/kcl/types/Solid)
|
||||
|
||||
|
||||
### Examples
|
||||
|
@ -12,7 +12,7 @@ Use a 2-dimensional sketch to cut a hole in another 2-dimensional sketch.
|
||||
hole(
|
||||
holeSketch: SketchSet,
|
||||
sketch: Sketch,
|
||||
) -> Sketch
|
||||
): Sketch
|
||||
```
|
||||
|
||||
|
||||
@ -21,11 +21,11 @@ hole(
|
||||
| Name | Type | Description | Required |
|
||||
|----------|------|-------------|----------|
|
||||
| `holeSketch` | [`SketchSet`](/docs/kcl/types/SketchSet) | A sketch or a group of sketches. | Yes |
|
||||
| `sketch` | [`Sketch`](/docs/kcl/types/Sketch) | A sketch is a collection of paths. | Yes |
|
||||
| `sketch` | [`Sketch`](/docs/kcl/types/Sketch) | | Yes |
|
||||
|
||||
### Returns
|
||||
|
||||
[`Sketch`](/docs/kcl/types/Sketch) - A sketch is a collection of paths.
|
||||
[`Sketch`](/docs/kcl/types/Sketch)
|
||||
|
||||
|
||||
### Examples
|
||||
|
@ -12,7 +12,7 @@ Remove volume from a 3-dimensional shape such that a wall of the provided thickn
|
||||
hollow(
|
||||
thickness: number,
|
||||
solid: Solid,
|
||||
) -> Solid
|
||||
): Solid
|
||||
```
|
||||
|
||||
|
||||
@ -20,12 +20,12 @@ hollow(
|
||||
|
||||
| Name | Type | Description | Required |
|
||||
|----------|------|-------------|----------|
|
||||
| `thickness` | `number` | | Yes |
|
||||
| `solid` | [`Solid`](/docs/kcl/types/Solid) | A solid is a collection of extrude surfaces. | Yes |
|
||||
| `thickness` | [`number`](/docs/kcl/types/number) | | Yes |
|
||||
| `solid` | [`Solid`](/docs/kcl/types/Solid) | | Yes |
|
||||
|
||||
### Returns
|
||||
|
||||
[`Solid`](/docs/kcl/types/Solid) - A solid is a collection of extrude surfaces.
|
||||
[`Solid`](/docs/kcl/types/Solid)
|
||||
|
||||
|
||||
### Examples
|
||||
|
@ -18,7 +18,7 @@ Note: The import command currently only works when using the native Modeling App
|
||||
import(
|
||||
filePath: String,
|
||||
options?: ImportFormat,
|
||||
) -> ImportedGeometry
|
||||
): ImportedGeometry
|
||||
```
|
||||
|
||||
|
||||
|
@ -15,7 +15,7 @@ For example, if the current project uses inches, this function will return `1`.
|
||||
We merely provide these functions for convenience and readability, as `10 * inch()` is more readable that your intent is "I want 10 inches" than `10 * 25.4`, if the project settings are in millimeters.
|
||||
|
||||
```js
|
||||
inch() -> number
|
||||
inch(): number
|
||||
```
|
||||
|
||||
### Tags
|
||||
@ -26,7 +26,7 @@ inch() -> number
|
||||
|
||||
### Returns
|
||||
|
||||
`number`
|
||||
[`number`](/docs/kcl/types/number)
|
||||
|
||||
|
||||
### Examples
|
||||
|
@ -15,9 +15,17 @@ layout: manual
|
||||
|
||||
### Standard library
|
||||
|
||||
* **`std`**
|
||||
* **Primitive types**
|
||||
* [`bool`](kcl/bool)
|
||||
* [`number`](kcl/number)
|
||||
* [`string`](kcl/string)
|
||||
* [`tag`](kcl/tag)
|
||||
* **std**
|
||||
* [`HALF_TURN`](kcl/const_std-HALF_TURN)
|
||||
* [`Plane`](kcl/Plane)
|
||||
* [`QUARTER_TURN`](kcl/const_std-QUARTER_TURN)
|
||||
* [`Sketch`](kcl/Sketch)
|
||||
* [`Solid`](kcl/Solid)
|
||||
* [`THREE_QUARTER_TURN`](kcl/const_std-THREE_QUARTER_TURN)
|
||||
* [`XY`](kcl/const_std-XY)
|
||||
* [`XZ`](kcl/const_std-XZ)
|
||||
@ -123,11 +131,9 @@ layout: manual
|
||||
* [`toRadians`](kcl/toRadians)
|
||||
* [`translate`](kcl/translate)
|
||||
* [`xLine`](kcl/xLine)
|
||||
* [`xLineTo`](kcl/xLineTo)
|
||||
* [`yLine`](kcl/yLine)
|
||||
* [`yLineTo`](kcl/yLineTo)
|
||||
* [`yd`](kcl/yd)
|
||||
* **`std::math`**
|
||||
* **std::math**
|
||||
* [`E`](kcl/const_std-math-E)
|
||||
* [`PI`](kcl/const_std-math-PI)
|
||||
* [`TAU`](kcl/const_std-math-TAU)
|
||||
|
@ -11,7 +11,7 @@ Convert a number to an integer.
|
||||
DEPRECATED use floor(), ceil(), or round().
|
||||
|
||||
```js
|
||||
int(num: number) -> number
|
||||
int(num: number): number
|
||||
```
|
||||
|
||||
### Tags
|
||||
@ -23,11 +23,11 @@ int(num: number) -> number
|
||||
|
||||
| Name | Type | Description | Required |
|
||||
|----------|------|-------------|----------|
|
||||
| `num` | `number` | | Yes |
|
||||
| `num` | [`number`](/docs/kcl/types/number) | | Yes |
|
||||
|
||||
### Returns
|
||||
|
||||
`number`
|
||||
[`number`](/docs/kcl/types/number)
|
||||
|
||||
|
||||
### Examples
|
||||
|
@ -1,15 +1,15 @@
|
||||
---
|
||||
title: "lastSegX"
|
||||
excerpt: "Extract the 'x' axis value of the last line segment in the provided 2-d"
|
||||
excerpt: "Extract the 'x' axis value of the last line segment in the provided 2-d sketch."
|
||||
layout: manual
|
||||
---
|
||||
|
||||
Extract the 'x' axis value of the last line segment in the provided 2-d
|
||||
Extract the 'x' axis value of the last line segment in the provided 2-d sketch.
|
||||
|
||||
|
||||
sketch.
|
||||
|
||||
```js
|
||||
lastSegX(sketch: Sketch) -> number
|
||||
lastSegX(sketch: Sketch): number
|
||||
```
|
||||
|
||||
|
||||
@ -21,7 +21,7 @@ lastSegX(sketch: Sketch) -> number
|
||||
|
||||
### Returns
|
||||
|
||||
`number`
|
||||
[`number`](/docs/kcl/types/number)
|
||||
|
||||
|
||||
### Examples
|
||||
|
@ -1,15 +1,15 @@
|
||||
---
|
||||
title: "lastSegY"
|
||||
excerpt: "Extract the 'y' axis value of the last line segment in the provided 2-d"
|
||||
excerpt: "Extract the 'y' axis value of the last line segment in the provided 2-d sketch."
|
||||
layout: manual
|
||||
---
|
||||
|
||||
Extract the 'y' axis value of the last line segment in the provided 2-d
|
||||
Extract the 'y' axis value of the last line segment in the provided 2-d sketch.
|
||||
|
||||
|
||||
sketch.
|
||||
|
||||
```js
|
||||
lastSegY(sketch: Sketch) -> number
|
||||
lastSegY(sketch: Sketch): number
|
||||
```
|
||||
|
||||
|
||||
@ -21,7 +21,7 @@ lastSegY(sketch: Sketch) -> number
|
||||
|
||||
### Returns
|
||||
|
||||
`number`
|
||||
[`number`](/docs/kcl/types/number)
|
||||
|
||||
|
||||
### Examples
|
||||
|
@ -12,7 +12,7 @@ Compute the angle of the given leg for x.
|
||||
legAngX(
|
||||
hypotenuse: number,
|
||||
leg: number,
|
||||
) -> number
|
||||
): number
|
||||
```
|
||||
|
||||
### Tags
|
||||
@ -24,12 +24,12 @@ legAngX(
|
||||
|
||||
| Name | Type | Description | Required |
|
||||
|----------|------|-------------|----------|
|
||||
| `hypotenuse` | `number` | | Yes |
|
||||
| `leg` | `number` | | Yes |
|
||||
| `hypotenuse` | [`number`](/docs/kcl/types/number) | | Yes |
|
||||
| `leg` | [`number`](/docs/kcl/types/number) | | Yes |
|
||||
|
||||
### Returns
|
||||
|
||||
`number`
|
||||
[`number`](/docs/kcl/types/number)
|
||||
|
||||
|
||||
### Examples
|
||||
|
@ -12,7 +12,7 @@ Compute the angle of the given leg for y.
|
||||
legAngY(
|
||||
hypotenuse: number,
|
||||
leg: number,
|
||||
) -> number
|
||||
): number
|
||||
```
|
||||
|
||||
### Tags
|
||||
@ -24,12 +24,12 @@ legAngY(
|
||||
|
||||
| Name | Type | Description | Required |
|
||||
|----------|------|-------------|----------|
|
||||
| `hypotenuse` | `number` | | Yes |
|
||||
| `leg` | `number` | | Yes |
|
||||
| `hypotenuse` | [`number`](/docs/kcl/types/number) | | Yes |
|
||||
| `leg` | [`number`](/docs/kcl/types/number) | | Yes |
|
||||
|
||||
### Returns
|
||||
|
||||
`number`
|
||||
[`number`](/docs/kcl/types/number)
|
||||
|
||||
|
||||
### Examples
|
||||
|
@ -12,7 +12,7 @@ Compute the length of the given leg.
|
||||
legLen(
|
||||
hypotenuse: number,
|
||||
leg: number,
|
||||
) -> number
|
||||
): number
|
||||
```
|
||||
|
||||
### Tags
|
||||
@ -24,12 +24,12 @@ legLen(
|
||||
|
||||
| Name | Type | Description | Required |
|
||||
|----------|------|-------------|----------|
|
||||
| `hypotenuse` | `number` | | Yes |
|
||||
| `leg` | `number` | | Yes |
|
||||
| `hypotenuse` | [`number`](/docs/kcl/types/number) | | Yes |
|
||||
| `leg` | [`number`](/docs/kcl/types/number) | | Yes |
|
||||
|
||||
### Returns
|
||||
|
||||
`number`
|
||||
[`number`](/docs/kcl/types/number)
|
||||
|
||||
|
||||
### Examples
|
||||
|
@ -14,7 +14,7 @@ line(
|
||||
endAbsolute?: [number],
|
||||
end?: [number],
|
||||
tag?: TagDeclarator,
|
||||
) -> Sketch
|
||||
): Sketch
|
||||
```
|
||||
|
||||
|
||||
@ -23,13 +23,13 @@ line(
|
||||
| Name | Type | Description | Required |
|
||||
|----------|------|-------------|----------|
|
||||
| `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 |
|
||||
| `end` | `[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 |
|
||||
| `endAbsolute` | [`[number]`](/docs/kcl/types/number) | Which absolute point should this line go to? Incompatible with `end`. | 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`](/docs/kcl/types/tag) | [`TagDeclarator`](/docs/kcl/types#tag-declaration) | Create a new tag which refers to this line | No |
|
||||
|
||||
### Returns
|
||||
|
||||
[`Sketch`](/docs/kcl/types/Sketch) - A sketch is a collection of paths.
|
||||
[`Sketch`](/docs/kcl/types/Sketch)
|
||||
|
||||
|
||||
### Examples
|
||||
|
@ -9,7 +9,7 @@ Compute the natural logarithm of the number.
|
||||
|
||||
|
||||
```js
|
||||
ln(num: number) -> number
|
||||
ln(num: number): number
|
||||
```
|
||||
|
||||
### Tags
|
||||
@ -21,11 +21,11 @@ ln(num: number) -> number
|
||||
|
||||
| Name | Type | Description | Required |
|
||||
|----------|------|-------------|----------|
|
||||
| `num` | `number` | | Yes |
|
||||
| `num` | [`number`](/docs/kcl/types/number) | | Yes |
|
||||
|
||||
### Returns
|
||||
|
||||
`number`
|
||||
[`number`](/docs/kcl/types/number)
|
||||
|
||||
|
||||
### Examples
|
||||
|
@ -15,7 +15,7 @@ loft(
|
||||
bezApproximateRational: bool,
|
||||
baseCurveIndex?: integer,
|
||||
tolerance?: number,
|
||||
) -> Solid
|
||||
): Solid
|
||||
```
|
||||
|
||||
|
||||
@ -25,13 +25,13 @@ loft(
|
||||
|----------|------|-------------|----------|
|
||||
| `sketches` | [`[Sketch]`](/docs/kcl/types/Sketch) | Which sketches to loft. Must include at least 2 sketches. | Yes |
|
||||
| `vDegree` | `NonZeroU32` | Degree of the interpolation. Must be greater than zero. For example, use 2 for quadratic, or 3 for cubic interpolation in the V direction. This defaults to 2, if not specified. | Yes |
|
||||
| `bezApproximateRational` | `bool` | Attempt to approximate rational curves (such as arcs) using a bezier. This will remove banding around interpolations between arcs and non-arcs. It may produce errors in other scenarios Over time, this field won't be necessary. | Yes |
|
||||
| `bezApproximateRational` | [`bool`](/docs/kcl/types/bool) | Attempt to approximate rational curves (such as arcs) using a bezier. This will remove banding around interpolations between arcs and non-arcs. It may produce errors in other scenarios Over time, this field won't be necessary. | Yes |
|
||||
| `baseCurveIndex` | `integer` | This can be set to override the automatically determined topological base curve, which is usually the first section encountered. | No |
|
||||
| `tolerance` | `number` | Tolerance for the loft operation. | No |
|
||||
| `tolerance` | [`number`](/docs/kcl/types/number) | Tolerance for the loft operation. | No |
|
||||
|
||||
### Returns
|
||||
|
||||
[`Solid`](/docs/kcl/types/Solid) - A solid is a collection of extrude surfaces.
|
||||
[`Solid`](/docs/kcl/types/Solid)
|
||||
|
||||
|
||||
### Examples
|
||||
|
@ -12,7 +12,7 @@ The result might not be correctly rounded owing to implementation details; `log2
|
||||
log(
|
||||
num: number,
|
||||
base: number,
|
||||
) -> number
|
||||
): number
|
||||
```
|
||||
|
||||
### Tags
|
||||
@ -24,12 +24,12 @@ log(
|
||||
|
||||
| Name | Type | Description | Required |
|
||||
|----------|------|-------------|----------|
|
||||
| `num` | `number` | | Yes |
|
||||
| `base` | `number` | | Yes |
|
||||
| `num` | [`number`](/docs/kcl/types/number) | | Yes |
|
||||
| `base` | [`number`](/docs/kcl/types/number) | | Yes |
|
||||
|
||||
### Returns
|
||||
|
||||
`number`
|
||||
[`number`](/docs/kcl/types/number)
|
||||
|
||||
|
||||
### Examples
|
||||
|
@ -9,7 +9,7 @@ Compute the base 10 logarithm of the number.
|
||||
|
||||
|
||||
```js
|
||||
log10(num: number) -> number
|
||||
log10(num: number): number
|
||||
```
|
||||
|
||||
### Tags
|
||||
@ -21,11 +21,11 @@ log10(num: number) -> number
|
||||
|
||||
| Name | Type | Description | Required |
|
||||
|----------|------|-------------|----------|
|
||||
| `num` | `number` | | Yes |
|
||||
| `num` | [`number`](/docs/kcl/types/number) | | Yes |
|
||||
|
||||
### Returns
|
||||
|
||||
`number`
|
||||
[`number`](/docs/kcl/types/number)
|
||||
|
||||
|
||||
### Examples
|
||||
|
@ -9,7 +9,7 @@ Compute the base 2 logarithm of the number.
|
||||
|
||||
|
||||
```js
|
||||
log2(num: number) -> number
|
||||
log2(num: number): number
|
||||
```
|
||||
|
||||
### Tags
|
||||
@ -21,11 +21,11 @@ log2(num: number) -> number
|
||||
|
||||
| Name | Type | Description | Required |
|
||||
|----------|------|-------------|----------|
|
||||
| `num` | `number` | | Yes |
|
||||
| `num` | [`number`](/docs/kcl/types/number) | | Yes |
|
||||
|
||||
### Returns
|
||||
|
||||
`number`
|
||||
[`number`](/docs/kcl/types/number)
|
||||
|
||||
|
||||
### Examples
|
||||
|
@ -15,7 +15,7 @@ For example, if the current project uses inches, this function will return `39.3
|
||||
We merely provide these functions for convenience and readability, as `10 * m()` is more readable that your intent is "I want 10 meters" than `10 * 1000`, if the project settings are in millimeters.
|
||||
|
||||
```js
|
||||
m() -> number
|
||||
m(): number
|
||||
```
|
||||
|
||||
### Tags
|
||||
@ -26,7 +26,7 @@ m() -> number
|
||||
|
||||
### Returns
|
||||
|
||||
`number`
|
||||
[`number`](/docs/kcl/types/number)
|
||||
|
||||
|
||||
### Examples
|
||||
|
@ -12,7 +12,7 @@ Given a list like `[a, b, c]`, and a function like `f`, returns `[f(a), f(b), f(
|
||||
map(
|
||||
array: [KclValue],
|
||||
mapFn: FunctionSource,
|
||||
) -> [KclValue]
|
||||
): [KclValue]
|
||||
```
|
||||
|
||||
|
||||
|
@ -9,7 +9,7 @@ Compute the maximum of the given arguments.
|
||||
|
||||
|
||||
```js
|
||||
max(args: [number]) -> number
|
||||
max(args: [number]): number
|
||||
```
|
||||
|
||||
### Tags
|
||||
@ -21,11 +21,11 @@ max(args: [number]) -> number
|
||||
|
||||
| Name | Type | Description | Required |
|
||||
|----------|------|-------------|----------|
|
||||
| `args` | `[number]` | | Yes |
|
||||
| `args` | [`[number]`](/docs/kcl/types/number) | | Yes |
|
||||
|
||||
### Returns
|
||||
|
||||
`number`
|
||||
[`number`](/docs/kcl/types/number)
|
||||
|
||||
|
||||
### Examples
|
||||
|
@ -9,7 +9,7 @@ Compute the minimum of the given arguments.
|
||||
|
||||
|
||||
```js
|
||||
min(args: [number]) -> number
|
||||
min(args: [number]): number
|
||||
```
|
||||
|
||||
### Tags
|
||||
@ -21,11 +21,11 @@ min(args: [number]) -> number
|
||||
|
||||
| Name | Type | Description | Required |
|
||||
|----------|------|-------------|----------|
|
||||
| `args` | `[number]` | | Yes |
|
||||
| `args` | [`[number]`](/docs/kcl/types/number) | | Yes |
|
||||
|
||||
### Returns
|
||||
|
||||
`number`
|
||||
[`number`](/docs/kcl/types/number)
|
||||
|
||||
|
||||
### Examples
|
||||
|
@ -14,7 +14,7 @@ Mirror occurs around a local sketch axis rather than a global axis.
|
||||
mirror2d(
|
||||
data: Mirror2dData,
|
||||
sketchSet: SketchSet,
|
||||
) -> [Sketch]
|
||||
): [Sketch]
|
||||
```
|
||||
|
||||
|
||||
|
@ -15,7 +15,7 @@ For example, if the current project uses inches, this function will return `(1/2
|
||||
We merely provide these functions for convenience and readability, as `10 * mm()` is more readable that your intent is "I want 10 millimeters" than `10 * (1/25.4)`, if the project settings are in inches.
|
||||
|
||||
```js
|
||||
mm() -> number
|
||||
mm(): number
|
||||
```
|
||||
|
||||
### Tags
|
||||
@ -26,7 +26,7 @@ mm() -> number
|
||||
|
||||
### Returns
|
||||
|
||||
`number`
|
||||
[`number`](/docs/kcl/types/number)
|
||||
|
||||
|
||||
### Examples
|
||||
|
@ -12,7 +12,7 @@ For example, if you offset the 'XZ' plane by 10, the new plane will be parallel
|
||||
offsetPlane(
|
||||
plane: PlaneData,
|
||||
offset: number,
|
||||
) -> Plane
|
||||
): Plane
|
||||
```
|
||||
|
||||
|
||||
@ -21,11 +21,11 @@ offsetPlane(
|
||||
| Name | Type | Description | Required |
|
||||
|----------|------|-------------|----------|
|
||||
| `plane` | [`PlaneData`](/docs/kcl/types/PlaneData) | The plane (e.g. 'XY') which this new plane is created from. | Yes |
|
||||
| `offset` | `number` | Distance from the standard plane this new plane will be created at. | Yes |
|
||||
| `offset` | [`number`](/docs/kcl/types/number) | Distance from the standard plane this new plane will be created at. | Yes |
|
||||
|
||||
### Returns
|
||||
|
||||
[`Plane`](/docs/kcl/types/Plane) - A plane.
|
||||
[`Plane`](/docs/kcl/types/Plane)
|
||||
|
||||
|
||||
### Examples
|
||||
|
@ -1,12 +1,12 @@
|
||||
---
|
||||
title: "patternCircular2d"
|
||||
excerpt: "Repeat a 2-dimensional sketch some number of times along a partial or"
|
||||
excerpt: "Repeat a 2-dimensional sketch some number of times along a partial or complete circle some specified number of times. Each object may additionally be rotated along the circle, ensuring orentation of the solid with respect to the center of the circle is maintained."
|
||||
layout: manual
|
||||
---
|
||||
|
||||
Repeat a 2-dimensional sketch some number of times along a partial or
|
||||
Repeat a 2-dimensional sketch some number of times along a partial or complete circle some specified number of times. Each object may additionally be rotated along the circle, ensuring orentation of the solid with respect to the center of the circle is maintained.
|
||||
|
||||
|
||||
complete circle some specified number of times. Each object may additionally be rotated along the circle, ensuring orentation of the solid with respect to the center of the circle is maintained.
|
||||
|
||||
```js
|
||||
patternCircular2d(
|
||||
@ -16,7 +16,7 @@ patternCircular2d(
|
||||
arcDegrees: number,
|
||||
rotateDuplicates: bool,
|
||||
useOriginal?: bool,
|
||||
) -> [Sketch]
|
||||
): [Sketch]
|
||||
```
|
||||
|
||||
|
||||
@ -26,10 +26,10 @@ patternCircular2d(
|
||||
|----------|------|-------------|----------|
|
||||
| `sketchSet` | [`SketchSet`](/docs/kcl/types/SketchSet) | 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 |
|
||||
| `center` | `[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 |
|
||||
| `rotateDuplicates` | `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 |
|
||||
| `center` | [`[number]`](/docs/kcl/types/number) | The center about which to make the pattern. This is a 2D vector. | Yes |
|
||||
| `arcDegrees` | [`number`](/docs/kcl/types/number) | The arc angle (in degrees) to place the repetitions. Must be greater than 0. | Yes |
|
||||
| `rotateDuplicates` | [`bool`](/docs/kcl/types/bool) | Whether or not to rotate the duplicates as they are copied. | Yes |
|
||||
| `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
|
||||
|
||||
|
@ -1,12 +1,12 @@
|
||||
---
|
||||
title: "patternCircular3d"
|
||||
excerpt: "Repeat a 3-dimensional solid some number of times along a partial or"
|
||||
excerpt: "Repeat a 3-dimensional solid some number of times along a partial or complete circle some specified number of times. Each object may additionally be rotated along the circle, ensuring orentation of the solid with respect to the center of the circle is maintained."
|
||||
layout: manual
|
||||
---
|
||||
|
||||
Repeat a 3-dimensional solid some number of times along a partial or
|
||||
Repeat a 3-dimensional solid some number of times along a partial or complete circle some specified number of times. Each object may additionally be rotated along the circle, ensuring orentation of the solid with respect to the center of the circle is maintained.
|
||||
|
||||
|
||||
complete circle some specified number of times. Each object may additionally be rotated along the circle, ensuring orentation of the solid with respect to the center of the circle is maintained.
|
||||
|
||||
```js
|
||||
patternCircular3d(
|
||||
@ -17,7 +17,7 @@ patternCircular3d(
|
||||
arcDegrees: number,
|
||||
rotateDuplicates: bool,
|
||||
useOriginal?: bool,
|
||||
) -> [Solid]
|
||||
): [Solid]
|
||||
```
|
||||
|
||||
|
||||
@ -27,11 +27,11 @@ patternCircular3d(
|
||||
|----------|------|-------------|----------|
|
||||
| `solidSet` | [`SolidSet`](/docs/kcl/types/SolidSet) | 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 |
|
||||
| `axis` | `[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 |
|
||||
| `arcDegrees` | `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 |
|
||||
| `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 |
|
||||
| `axis` | [`[number]`](/docs/kcl/types/number) | The axis around 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`](/docs/kcl/types/number) | The arc angle (in degrees) to place the repetitions. Must be greater than 0. | Yes |
|
||||
| `rotateDuplicates` | [`bool`](/docs/kcl/types/bool) | Whether or not to rotate the duplicates as they are copied. | Yes |
|
||||
| `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
|
||||
|
||||
|
@ -1,12 +1,12 @@
|
||||
---
|
||||
title: "patternLinear2d"
|
||||
excerpt: "Repeat a 2-dimensional sketch along some dimension, with a dynamic amount"
|
||||
excerpt: "Repeat a 2-dimensional sketch along some dimension, with a dynamic amount of distance between each repetition, some specified number of times."
|
||||
layout: manual
|
||||
---
|
||||
|
||||
Repeat a 2-dimensional sketch along some dimension, with a dynamic amount
|
||||
Repeat a 2-dimensional sketch along some dimension, with a dynamic amount of distance between each repetition, some specified number of times.
|
||||
|
||||
|
||||
of distance between each repetition, some specified number of times.
|
||||
|
||||
```js
|
||||
patternLinear2d(
|
||||
@ -15,7 +15,7 @@ patternLinear2d(
|
||||
distance: number,
|
||||
axis: [number],
|
||||
useOriginal?: bool,
|
||||
) -> [Sketch]
|
||||
): [Sketch]
|
||||
```
|
||||
|
||||
|
||||
@ -25,9 +25,9 @@ patternLinear2d(
|
||||
|----------|------|-------------|----------|
|
||||
| `sketchSet` | [`SketchSet`](/docs/kcl/types/SketchSet) | 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 |
|
||||
| `distance` | `number` | Distance between each repetition. Also known as 'spacing'. | Yes |
|
||||
| `axis` | `[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 |
|
||||
| `distance` | [`number`](/docs/kcl/types/number) | Distance between each repetition. Also known as 'spacing'. | Yes |
|
||||
| `axis` | [`[number]`](/docs/kcl/types/number) | The axis of the pattern. A 2D vector. | Yes |
|
||||
| `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
|
||||
|
||||
|
@ -1,12 +1,10 @@
|
||||
---
|
||||
title: "patternLinear3d"
|
||||
excerpt: "Repeat a 3-dimensional solid along a linear path, with a dynamic amount"
|
||||
excerpt: "Repeat a 3-dimensional solid along a linear path, with a dynamic amount of distance between each repetition, some specified number of times."
|
||||
layout: manual
|
||||
---
|
||||
|
||||
Repeat a 3-dimensional solid along a linear path, with a dynamic amount
|
||||
|
||||
of distance between each repetition, some specified number of times.
|
||||
Repeat a 3-dimensional solid along a linear path, with a dynamic amount of distance between each repetition, some specified number of times.
|
||||
|
||||
///
|
||||
|
||||
@ -17,7 +15,7 @@ patternLinear3d(
|
||||
distance: number,
|
||||
axis: [number],
|
||||
useOriginal?: bool,
|
||||
) -> [Solid]
|
||||
): [Solid]
|
||||
```
|
||||
|
||||
|
||||
@ -27,9 +25,9 @@ patternLinear3d(
|
||||
|----------|------|-------------|----------|
|
||||
| `solidSet` | [`SolidSet`](/docs/kcl/types/SolidSet) | 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 |
|
||||
| `distance` | `number` | Distance between each repetition. Also known as 'spacing'. | Yes |
|
||||
| `axis` | `[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 |
|
||||
| `distance` | [`number`](/docs/kcl/types/number) | Distance between each repetition. Also known as 'spacing'. | Yes |
|
||||
| `axis` | [`[number]`](/docs/kcl/types/number) | The axis of the pattern. A 2D vector. | Yes |
|
||||
| `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
|
||||
|
||||
|
@ -40,7 +40,7 @@ patternTransform(
|
||||
instances: integer,
|
||||
transform: FunctionSource,
|
||||
useOriginal?: bool,
|
||||
) -> [Solid]
|
||||
): [Solid]
|
||||
```
|
||||
|
||||
|
||||
@ -51,7 +51,7 @@ patternTransform(
|
||||
| `solidSet` | [`SolidSet`](/docs/kcl/types/SolidSet) | 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 |
|
||||
| `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
|
||||
|
||||
|
@ -14,7 +14,7 @@ patternTransform2d(
|
||||
instances: integer,
|
||||
transform: FunctionSource,
|
||||
useOriginal?: bool,
|
||||
) -> [Sketch]
|
||||
): [Sketch]
|
||||
```
|
||||
|
||||
|
||||
@ -25,7 +25,7 @@ patternTransform2d(
|
||||
| `sketchSet` | [`SketchSet`](/docs/kcl/types/SketchSet) | 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 |
|
||||
| `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
|
||||
|
||||
|
@ -11,7 +11,7 @@ Return the value of `pi`. Archimedes’ constant (π).
|
||||
**DEPRECATED** use the constant PI
|
||||
|
||||
```js
|
||||
pi() -> number
|
||||
pi(): number
|
||||
```
|
||||
|
||||
### Tags
|
||||
@ -22,7 +22,7 @@ pi() -> number
|
||||
|
||||
### Returns
|
||||
|
||||
`number`
|
||||
[`number`](/docs/kcl/types/number)
|
||||
|
||||
|
||||
### Examples
|
||||
|
@ -1,15 +1,15 @@
|
||||
---
|
||||
title: "polar"
|
||||
excerpt: "Convert polar/sphere (azimuth, elevation, distance) coordinates to"
|
||||
excerpt: "Convert polar/sphere (azimuth, elevation, distance) coordinates to cartesian (x/y/z grid) coordinates."
|
||||
layout: manual
|
||||
---
|
||||
|
||||
Convert polar/sphere (azimuth, elevation, distance) coordinates to
|
||||
Convert polar/sphere (azimuth, elevation, distance) coordinates to cartesian (x/y/z grid) coordinates.
|
||||
|
||||
|
||||
cartesian (x/y/z grid) coordinates.
|
||||
|
||||
```js
|
||||
polar(data: PolarCoordsData) -> [number]
|
||||
polar(data: PolarCoordsData): [number]
|
||||
```
|
||||
|
||||
|
||||
@ -21,7 +21,7 @@ polar(data: PolarCoordsData) -> [number]
|
||||
|
||||
### Returns
|
||||
|
||||
`[number]`
|
||||
[`[number]`](/docs/kcl/types/number)
|
||||
|
||||
|
||||
### Examples
|
||||
|
@ -13,7 +13,7 @@ polygon(
|
||||
data: PolygonData,
|
||||
sketchSurfaceOrGroup: SketchOrSurface,
|
||||
tag?: TagDeclarator,
|
||||
) -> Sketch
|
||||
): Sketch
|
||||
```
|
||||
|
||||
|
||||
@ -23,11 +23,11 @@ polygon(
|
||||
|----------|------|-------------|----------|
|
||||
| `data` | [`PolygonData`](/docs/kcl/types/PolygonData) | Data for drawing a polygon | Yes |
|
||||
| `sketchSurfaceOrGroup` | [`SketchOrSurface`](/docs/kcl/types/SketchOrSurface) | A sketch surface or a sketch. | Yes |
|
||||
| `tag` | [`TagDeclarator`](/docs/kcl/types#tag-declaration) | | No |
|
||||
| [`tag`](/docs/kcl/types/tag) | [`TagDeclarator`](/docs/kcl/types#tag-declaration) | | No |
|
||||
|
||||
### Returns
|
||||
|
||||
[`Sketch`](/docs/kcl/types/Sketch) - A sketch is a collection of paths.
|
||||
[`Sketch`](/docs/kcl/types/Sketch)
|
||||
|
||||
|
||||
### Examples
|
||||
|
@ -9,7 +9,7 @@ Remove the last element from an array.
|
||||
Returns a new array with the last element removed.
|
||||
|
||||
```js
|
||||
pop(array: [KclValue]) -> KclValue
|
||||
pop(array: [KclValue]): KclValue
|
||||
```
|
||||
|
||||
|
||||
|
@ -12,7 +12,7 @@ Compute the number to a power.
|
||||
pow(
|
||||
num: number,
|
||||
pow: number,
|
||||
) -> number
|
||||
): number
|
||||
```
|
||||
|
||||
### Tags
|
||||
@ -24,12 +24,12 @@ pow(
|
||||
|
||||
| Name | Type | Description | Required |
|
||||
|----------|------|-------------|----------|
|
||||
| `num` | `number` | | Yes |
|
||||
| `pow` | `number` | | Yes |
|
||||
| `num` | [`number`](/docs/kcl/types/number) | | Yes |
|
||||
| `pow` | [`number`](/docs/kcl/types/number) | | Yes |
|
||||
|
||||
### Returns
|
||||
|
||||
`number`
|
||||
[`number`](/docs/kcl/types/number)
|
||||
|
||||
|
||||
### Examples
|
||||
@ -38,7 +38,7 @@ pow(
|
||||
exampleSketch = startSketchOn("XZ")
|
||||
|> startProfileAt([0, 0], %)
|
||||
|> angledLine({ angle = 50, length = pow(5, 2) }, %)
|
||||
|> yLineTo(0, %)
|
||||
|> yLine(endAbsolute = 0)
|
||||
|> close()
|
||||
|
||||
example = extrude(exampleSketch, length = 5)
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user