Compare commits
59 Commits
v0.11.2
...
achalmers/
Author | SHA1 | Date | |
---|---|---|---|
17e7df100c | |||
d8aad4bd4f | |||
1f1c44e598 | |||
b20e685eea | |||
3690d986c1 | |||
9a7f434ede | |||
6afacd7427 | |||
957001ee88 | |||
8b4cc306af | |||
52d88171ca | |||
9142cf3af7 | |||
361500058c | |||
198479a71a | |||
905784c1e5 | |||
c33aaad800 | |||
d175c75780 | |||
ba348d1222 | |||
1f49ddfc29 | |||
58659652c1 | |||
251971238d | |||
381d0b3bc8 | |||
fa7943d06a | |||
7a384251d4 | |||
8e07ea32a6 | |||
23adf9d905 | |||
9f0ac5f6fd | |||
08dbd2e9c3 | |||
2e2ba5adbd | |||
a21dbf1055 | |||
5ecb176467 | |||
66135636ec | |||
685a16545c | |||
9adb15ee93 | |||
a8c4c97d79 | |||
39e8e1f259 | |||
1672c1fd1f | |||
6ec5881985 | |||
7272cc9fbd | |||
b925ed9b65 | |||
0db5db2181 | |||
898e3db9d1 | |||
d337ac2546 | |||
371d8e08f7 | |||
338c43a29d | |||
52bb5a2657 | |||
1b6a06d266 | |||
c68d4778a5 | |||
a8abea4fb5 | |||
a0678d22a8 | |||
acbfae2e65 | |||
1e1bec6a8a | |||
06462b5a65 | |||
2f292fb1be | |||
8184e7b376 | |||
b1084cbf80 | |||
548b45905e | |||
141fd2f3f1 | |||
604d931962 | |||
b1668410f8 |
@ -11,6 +11,7 @@
|
||||
"semi": [
|
||||
"error",
|
||||
"never"
|
||||
]
|
||||
],
|
||||
"react-hooks/exhaustive-deps": "off"
|
||||
}
|
||||
}
|
||||
|
4
.github/workflows/ci.yml
vendored
4
.github/workflows/ci.yml
vendored
@ -106,7 +106,7 @@ jobs:
|
||||
run: |
|
||||
VERSION=$(date +'%-y.%-m.%-d') yarn bump-jsons
|
||||
echo "$(jq --arg url 'https://dl.kittycad.io/releases/modeling-app/nightly/last_update.json' \
|
||||
'.tauri.updater.endpoints[]=$url' src-tauri/tauri.conf.json --indent 2)" > src-tauri/tauri.conf.json
|
||||
'.tauri.updater.endpoints[]=$url' src-tauri/tauri.release.conf.json --indent 2)" > src-tauri/tauri.release.conf.json
|
||||
|
||||
- uses: actions/upload-artifact@v3
|
||||
if: github.event_name == 'schedule'
|
||||
@ -114,6 +114,7 @@ jobs:
|
||||
path: |
|
||||
package.json
|
||||
src-tauri/tauri.conf.json
|
||||
src-tauri/tauri.release.conf.json
|
||||
|
||||
- id: export_version
|
||||
run: echo "version=`cat package.json | jq -r '.version'`" >> "$GITHUB_OUTPUT"
|
||||
@ -136,6 +137,7 @@ jobs:
|
||||
ls -l artifact
|
||||
cp artifact/package.json package.json
|
||||
cp artifact/src-tauri/tauri.conf.json src-tauri/tauri.conf.json
|
||||
cp artifact/src-tauri/tauri.release.conf.json src-tauri/tauri.release.conf.json
|
||||
|
||||
- name: Install ubuntu system dependencies
|
||||
if: matrix.os == 'ubuntu-latest'
|
||||
|
@ -48,7 +48,7 @@ We recommend downloading the latest application binary from [our Releases page](
|
||||
|
||||
## Running a development build
|
||||
|
||||
First, [install Rust via `rustup`](https://www.rust-lang.org/tools/install). This project uses a lot of Rust compiled to [WASM](https://webassembly.org/) within it. Then, run:
|
||||
First, [install Rust via `rustup`](https://www.rust-lang.org/tools/install). This project uses a lot of Rust compiled to [WASM](https://webassembly.org/) within it. We always use the latest stable version of Rust, so you may need to run `rustup update stable`. Then, run:
|
||||
|
||||
```
|
||||
yarn install
|
||||
|
24
package.json
24
package.json
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "untitled-app",
|
||||
"version": "0.11.2",
|
||||
"version": "0.12.0",
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"@codemirror/autocomplete": "^6.10.2",
|
||||
@ -8,15 +8,15 @@
|
||||
"@fortawesome/free-brands-svg-icons": "^6.4.2",
|
||||
"@fortawesome/free-solid-svg-icons": "^6.4.2",
|
||||
"@fortawesome/react-fontawesome": "^0.2.0",
|
||||
"@headlessui/react": "^1.7.13",
|
||||
"@headlessui/react": "^1.7.17",
|
||||
"@headlessui/tailwindcss": "^0.2.0",
|
||||
"@kittycad/lib": "^0.0.45",
|
||||
"@lezer/javascript": "^1.4.7",
|
||||
"@open-rpc/client-js": "^1.8.1",
|
||||
"@react-hook/resize-observer": "^1.2.6",
|
||||
"@replit/codemirror-interact": "^6.3.0",
|
||||
"@sentry/react": "^7.65.0",
|
||||
"@tauri-apps/api": "^1.5.0",
|
||||
"@sentry/react": "^7.77.0",
|
||||
"@tauri-apps/api": "^1.5.1",
|
||||
"@testing-library/jest-dom": "^5.14.1",
|
||||
"@testing-library/react": "^14.0.0",
|
||||
"@testing-library/user-event": "^14.5.1",
|
||||
@ -30,7 +30,7 @@
|
||||
"crypto-js": "^4.2.0",
|
||||
"debounce-promise": "^3.1.2",
|
||||
"formik": "^2.4.3",
|
||||
"fuse.js": "^6.6.2",
|
||||
"fuse.js": "^7.0.0",
|
||||
"http-server": "^14.1.1",
|
||||
"json-rpc-2.0": "^1.6.0",
|
||||
"re-resizable": "^6.9.11",
|
||||
@ -51,7 +51,7 @@
|
||||
"uuid": "^9.0.1",
|
||||
"vitest": "^0.34.6",
|
||||
"vscode-jsonrpc": "^8.1.0",
|
||||
"vscode-languageserver-protocol": "^3.17.3",
|
||||
"vscode-languageserver-protocol": "^3.17.5",
|
||||
"wasm-pack": "^0.12.1",
|
||||
"web-vitals": "^3.5.0",
|
||||
"ws": "^8.13.0",
|
||||
@ -102,7 +102,7 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/plugin-proposal-private-property-in-object": "^7.21.11",
|
||||
"@babel/preset-env": "^7.22.9",
|
||||
"@babel/preset-env": "^7.23.3",
|
||||
"@tauri-apps/cli": "^1.5.6",
|
||||
"@types/crypto-js": "^4.1.1",
|
||||
"@types/debounce-promise": "^3.1.8",
|
||||
@ -111,18 +111,18 @@
|
||||
"@types/uuid": "^9.0.4",
|
||||
"@types/wicg-file-system-access": "^2020.9.6",
|
||||
"@types/ws": "^8.5.5",
|
||||
"@vitejs/plugin-react": "^4.0.3",
|
||||
"@vitest/coverage-istanbul": "^0.34.1",
|
||||
"@vitejs/plugin-react": "^4.1.1",
|
||||
"@vitest/coverage-istanbul": "^0.34.6",
|
||||
"autoprefixer": "^10.4.13",
|
||||
"eslint": "^8.44.0",
|
||||
"eslint": "^8.53.0",
|
||||
"eslint-config-react-app": "^7.0.1",
|
||||
"eslint-plugin-css-modules": "^2.11.0",
|
||||
"eslint-plugin-css-modules": "^2.12.0",
|
||||
"happy-dom": "^10.8.0",
|
||||
"husky": "^8.0.3",
|
||||
"postcss": "^8.4.31",
|
||||
"prettier": "^2.8.0",
|
||||
"setimmediate": "^1.0.5",
|
||||
"tailwindcss": "^3.2.4",
|
||||
"tailwindcss": "^3.3.5",
|
||||
"vite": "^4.5.0",
|
||||
"vite-plugin-eslint": "^1.8.1",
|
||||
"vite-tsconfig-paths": "^4.2.1",
|
||||
|
40
src-tauri/Cargo.lock
generated
40
src-tauri/Cargo.lock
generated
@ -1664,9 +1664,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "kittycad"
|
||||
version = "0.2.41"
|
||||
version = "0.2.42"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "874914cd40bfd43674406683bb3f0924d41780698a4ade96f2e180a73678bdd1"
|
||||
checksum = "6aa554d86b6dbbd976a659c912ae25ce817b4378eb12a5684907e263410f0a7b"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"async-trait",
|
||||
@ -1732,9 +1732,9 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646"
|
||||
|
||||
[[package]]
|
||||
name = "libc"
|
||||
version = "0.2.148"
|
||||
version = "0.2.150"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "9cdc71e17332e86d2e1d38c1f99edcb6288ee11b815fb1a4b049eaa2114d369b"
|
||||
checksum = "89d92a4743f9a61002fae18374ed11e7973f530cb3a3255fb354818118b2203c"
|
||||
|
||||
[[package]]
|
||||
name = "libm"
|
||||
@ -1940,9 +1940,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "mio"
|
||||
version = "0.8.8"
|
||||
version = "0.8.9"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "927a765cd3fc26206e66b296465fa9d3e5ab003e651c1b3c060e7956d96b19d2"
|
||||
checksum = "3dce281c5e46beae905d4de1870d8b1509a9142b62eedf18b443b011ca8343d0"
|
||||
dependencies = [
|
||||
"libc",
|
||||
"wasi 0.11.0+wasi-snapshot-preview1",
|
||||
@ -3112,9 +3112,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "schemars"
|
||||
version = "0.8.15"
|
||||
version = "0.8.16"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "1f7b0ce13155372a76ee2e1c5ffba1fe61ede73fbea5630d61eee6fac4929c0c"
|
||||
checksum = "45a28f4c49489add4ce10783f7911893516f15afe45d015608d41faca6bc4d29"
|
||||
dependencies = [
|
||||
"bigdecimal",
|
||||
"bytes",
|
||||
@ -3129,9 +3129,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "schemars_derive"
|
||||
version = "0.8.15"
|
||||
version = "0.8.16"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e85e2a16b12bdb763244c69ab79363d71db2b4b918a2def53f80b02e0574b13c"
|
||||
checksum = "c767fd6fa65d9ccf9cf026122c1b555f2ef9a4f0cea69da4d7dbc3e258d30967"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
@ -3215,9 +3215,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "serde"
|
||||
version = "1.0.190"
|
||||
version = "1.0.192"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "91d3c334ca1ee894a2c6f6ad698fe8c435b76d504b13d436f0685d648d6d96f7"
|
||||
checksum = "bca2a08484b285dcb282d0f67b26cadc0df8b19f8c12502c13d966bf9482f001"
|
||||
dependencies = [
|
||||
"serde_derive",
|
||||
]
|
||||
@ -3233,9 +3233,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "serde_derive"
|
||||
version = "1.0.190"
|
||||
version = "1.0.192"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "67c5609f394e5c2bd7fc51efda478004ea80ef42fee983d5c67a65e34f32c0e3"
|
||||
checksum = "d6c7207fbec9faa48073f3e3074cbe553af6ea512d7c21ba46e434e70ea9fbc1"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
@ -3438,9 +3438,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "socket2"
|
||||
version = "0.5.4"
|
||||
version = "0.5.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "4031e820eb552adee9295814c0ced9e5cf38ddf1e8b7d566d6de8e2538ea989e"
|
||||
checksum = "7b5fac59a5cb5dd637972e5fca70daf0523c9067fcdc4842f053dae04a18f8e9"
|
||||
dependencies = [
|
||||
"libc",
|
||||
"windows-sys 0.48.0",
|
||||
@ -3856,7 +3856,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "tauri-plugin-fs-extra"
|
||||
version = "0.0.0"
|
||||
source = "git+https://github.com/tauri-apps/plugins-workspace?branch=v1#11048fd9975bf89e9bc2f192b735ac339f6bb43b"
|
||||
source = "git+https://github.com/tauri-apps/plugins-workspace?branch=v1#20ef22fc3ab76cab770c2c0dac0cc75dfc982c22"
|
||||
dependencies = [
|
||||
"log",
|
||||
"serde",
|
||||
@ -4035,9 +4035,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20"
|
||||
|
||||
[[package]]
|
||||
name = "tokio"
|
||||
version = "1.33.0"
|
||||
version = "1.34.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "4f38200e3ef7995e5ef13baec2f432a6da0aa9ac495b2c0e8f3b7eec2c92d653"
|
||||
checksum = "d0c014766411e834f7af5b8f4cf46257aab4036ca95e9d2c144a10f59ad6f5b9"
|
||||
dependencies = [
|
||||
"backtrace",
|
||||
"bytes",
|
||||
@ -4045,7 +4045,7 @@ dependencies = [
|
||||
"mio",
|
||||
"num_cpus",
|
||||
"pin-project-lite",
|
||||
"socket2 0.5.4",
|
||||
"socket2 0.5.5",
|
||||
"windows-sys 0.48.0",
|
||||
]
|
||||
|
||||
|
@ -16,13 +16,13 @@ tauri-build = { version = "1.5.0", features = [] }
|
||||
|
||||
[dependencies]
|
||||
anyhow = "1"
|
||||
kittycad = "0.2.41"
|
||||
kittycad = "0.2.42"
|
||||
oauth2 = "4.4.2"
|
||||
serde = { version = "1.0", features = ["derive"] }
|
||||
serde_json = "1.0"
|
||||
tauri = { version = "1.5.2", features = [ "os-all", "dialog-all", "fs-all", "http-request", "path-all", "shell-open", "shell-open-api", "updater", "devtools"] }
|
||||
tauri-plugin-fs-extra = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "v1" }
|
||||
tokio = { version = "1.33.0", features = ["time"] }
|
||||
tokio = { version = "1.34.0", features = ["time"] }
|
||||
toml = "0.8.2"
|
||||
|
||||
[features]
|
||||
|
@ -8,7 +8,7 @@
|
||||
},
|
||||
"package": {
|
||||
"productName": "kittycad-modeling",
|
||||
"version": "0.11.2"
|
||||
"version": "0.12.0"
|
||||
},
|
||||
"tauri": {
|
||||
"allowlist": {
|
||||
|
@ -1,7 +1,6 @@
|
||||
|
||||
{
|
||||
"$schema": "../node_modules/@tauri-apps/cli/schema.json",
|
||||
"package": {
|
||||
"productName": "KittyCAD Modeling"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,4 +1,3 @@
|
||||
|
||||
{
|
||||
"$schema": "../node_modules/@tauri-apps/cli/schema.json",
|
||||
"tauri": {
|
||||
@ -19,4 +18,4 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,7 +1,6 @@
|
||||
|
||||
{
|
||||
"$schema": "../node_modules/@tauri-apps/cli/schema.json",
|
||||
"package": {
|
||||
"productName": "KittyCAD Modeling"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -9,7 +9,6 @@ import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
|
||||
import { faChevronRight, faTrashAlt } from '@fortawesome/free-solid-svg-icons'
|
||||
import { useFileContext } from 'hooks/useFileContext'
|
||||
import { useHotkeys } from 'react-hotkeys-hook'
|
||||
import { kclManager } from 'lang/KclSinglton'
|
||||
import styles from './FileTree.module.css'
|
||||
import { sortProject } from 'lib/tauriFS'
|
||||
|
||||
|
@ -32,11 +32,10 @@ export function useEngineConnectionSubscriptions() {
|
||||
const unSubClick = engineCommandManager.subscribeTo({
|
||||
event: 'select_with_point',
|
||||
callback: async (engineEvent) => {
|
||||
if (!context.sketchEnginePathId) return
|
||||
const event = await getEventForSelectWithPoint(engineEvent, {
|
||||
sketchEnginePathId: context.sketchEnginePathId,
|
||||
})
|
||||
send(event)
|
||||
event && send(event)
|
||||
},
|
||||
})
|
||||
return () => {
|
||||
|
@ -82,9 +82,14 @@ export function useSetupEngineManager(
|
||||
}
|
||||
|
||||
function getDimensions(streamWidth?: number, streamHeight?: number) {
|
||||
const maxResolution = 2000
|
||||
const width = streamWidth ? streamWidth : 0
|
||||
const quadWidth = Math.round(width / 4) * 4
|
||||
const height = streamHeight ? streamHeight : 0
|
||||
const quadHeight = Math.round(height / 4) * 4
|
||||
const ratio = Math.min(
|
||||
Math.min(maxResolution / width, maxResolution / height),
|
||||
1.0
|
||||
)
|
||||
const quadWidth = Math.round((width * ratio) / 4) * 4
|
||||
const quadHeight = Math.round((height * ratio) / 4) * 4
|
||||
return { width: quadWidth, height: quadHeight }
|
||||
}
|
||||
|
@ -238,10 +238,10 @@ class KclManager {
|
||||
defaultPlanes: this.defaultPlanes,
|
||||
})
|
||||
this.isExecuting = false
|
||||
this._logs = logs
|
||||
this._kclErrors = errors
|
||||
this._programMemory = programMemory
|
||||
this._ast = { ...ast }
|
||||
this.logs = logs
|
||||
this.kclErrors = errors
|
||||
this.programMemory = programMemory
|
||||
this.ast = { ...ast }
|
||||
if (updateCode) {
|
||||
this.code = recast(ast)
|
||||
}
|
||||
|
@ -169,16 +169,24 @@ describe('testing function declaration', () => {
|
||||
end: 39,
|
||||
params: [
|
||||
{
|
||||
type: 'Identifier',
|
||||
start: 12,
|
||||
end: 13,
|
||||
name: 'a',
|
||||
type: 'Parameter',
|
||||
identifier: {
|
||||
type: 'Identifier',
|
||||
start: 12,
|
||||
end: 13,
|
||||
name: 'a',
|
||||
},
|
||||
optional: false,
|
||||
},
|
||||
{
|
||||
type: 'Identifier',
|
||||
start: 15,
|
||||
end: 16,
|
||||
name: 'b',
|
||||
type: 'Parameter',
|
||||
identifier: {
|
||||
type: 'Identifier',
|
||||
start: 15,
|
||||
end: 16,
|
||||
name: 'b',
|
||||
},
|
||||
optional: false,
|
||||
},
|
||||
],
|
||||
body: {
|
||||
@ -244,16 +252,24 @@ const myVar = funcN(1, 2)`
|
||||
end: 37,
|
||||
params: [
|
||||
{
|
||||
type: 'Identifier',
|
||||
start: 12,
|
||||
end: 13,
|
||||
name: 'a',
|
||||
type: 'Parameter',
|
||||
identifier: {
|
||||
type: 'Identifier',
|
||||
start: 12,
|
||||
end: 13,
|
||||
name: 'a',
|
||||
},
|
||||
optional: false,
|
||||
},
|
||||
{
|
||||
type: 'Identifier',
|
||||
start: 15,
|
||||
end: 16,
|
||||
name: 'b',
|
||||
type: 'Parameter',
|
||||
identifier: {
|
||||
type: 'Identifier',
|
||||
start: 15,
|
||||
end: 16,
|
||||
name: 'b',
|
||||
},
|
||||
optional: false,
|
||||
},
|
||||
],
|
||||
body: {
|
||||
@ -331,9 +347,6 @@ const myVar = funcN(1, 2)`
|
||||
raw: '2',
|
||||
},
|
||||
],
|
||||
function: {
|
||||
type: 'InMemory',
|
||||
},
|
||||
optional: false,
|
||||
},
|
||||
},
|
||||
@ -403,7 +416,6 @@ describe('testing pipe operator special', () => {
|
||||
],
|
||||
},
|
||||
],
|
||||
function: expect.any(Object),
|
||||
optional: false,
|
||||
},
|
||||
{
|
||||
@ -440,7 +452,6 @@ describe('testing pipe operator special', () => {
|
||||
},
|
||||
{ type: 'PipeSubstitution', start: 59, end: 60 },
|
||||
],
|
||||
function: expect.any(Object),
|
||||
optional: false,
|
||||
},
|
||||
{
|
||||
@ -513,7 +524,6 @@ describe('testing pipe operator special', () => {
|
||||
},
|
||||
{ type: 'PipeSubstitution', start: 105, end: 106 },
|
||||
],
|
||||
function: expect.any(Object),
|
||||
optional: false,
|
||||
},
|
||||
{
|
||||
@ -550,7 +560,6 @@ describe('testing pipe operator special', () => {
|
||||
},
|
||||
{ type: 'PipeSubstitution', start: 128, end: 129 },
|
||||
],
|
||||
function: expect.any(Object),
|
||||
optional: false,
|
||||
},
|
||||
{
|
||||
@ -573,9 +582,6 @@ describe('testing pipe operator special', () => {
|
||||
},
|
||||
{ type: 'PipeSubstitution', start: 143, end: 144 },
|
||||
],
|
||||
function: {
|
||||
type: 'InMemory',
|
||||
},
|
||||
optional: false,
|
||||
},
|
||||
],
|
||||
@ -655,9 +661,6 @@ describe('testing pipe operator special', () => {
|
||||
end: 35,
|
||||
},
|
||||
],
|
||||
function: {
|
||||
type: 'InMemory',
|
||||
},
|
||||
optional: false,
|
||||
},
|
||||
],
|
||||
@ -1567,7 +1570,6 @@ describe('test UnaryExpression', () => {
|
||||
{ type: 'Literal', start: 19, end: 20, value: 4, raw: '4' },
|
||||
{ type: 'Literal', start: 22, end: 25, value: 100, raw: '100' },
|
||||
],
|
||||
function: expect.any(Object),
|
||||
optional: false,
|
||||
},
|
||||
})
|
||||
@ -1601,12 +1603,10 @@ describe('testing nested call expressions', () => {
|
||||
{ type: 'Literal', start: 34, end: 35, value: 5, raw: '5' },
|
||||
{ type: 'Literal', start: 37, end: 38, value: 3, raw: '3' },
|
||||
],
|
||||
function: expect.any(Object),
|
||||
optional: false,
|
||||
},
|
||||
},
|
||||
],
|
||||
function: expect.any(Object),
|
||||
optional: false,
|
||||
})
|
||||
})
|
||||
@ -1638,7 +1638,6 @@ describe('should recognise callExpresions in binaryExpressions', () => {
|
||||
},
|
||||
{ type: 'PipeSubstitution', start: 25, end: 26 },
|
||||
],
|
||||
function: expect.any(Object),
|
||||
optional: false,
|
||||
},
|
||||
right: { type: 'Literal', value: 1, raw: '1', start: 30, end: 31 },
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { getNodePathFromSourceRange, getNodeFromPath } from './queryAst'
|
||||
import { Identifier, parse, initPromise } from './wasm'
|
||||
import { Identifier, parse, initPromise, Parameter } from './wasm'
|
||||
|
||||
beforeAll(() => initPromise)
|
||||
|
||||
@ -46,7 +46,7 @@ const b1 = cube([0,0], 10)`
|
||||
|
||||
const ast = parse(code)
|
||||
const nodePath = getNodePathFromSourceRange(ast, sourceRange)
|
||||
const node = getNodeFromPath<Identifier>(ast, nodePath).node
|
||||
const node = getNodeFromPath<Parameter>(ast, nodePath).node
|
||||
|
||||
expect(nodePath).toEqual([
|
||||
['body', ''],
|
||||
@ -57,8 +57,8 @@ const b1 = cube([0,0], 10)`
|
||||
['params', 'FunctionExpression'],
|
||||
[0, 'index'],
|
||||
])
|
||||
expect(node.type).toBe('Identifier')
|
||||
expect(node.name).toBe('pos')
|
||||
expect(node.type).toBe('Parameter')
|
||||
expect(node.identifier.name).toBe('pos')
|
||||
})
|
||||
it('gets path right for deep within function definition body', () => {
|
||||
const code = `fn cube = (pos, scale) => {
|
||||
|
@ -480,21 +480,6 @@ export function createCallExpressionStdLib(
|
||||
end: 0,
|
||||
name,
|
||||
},
|
||||
function: {
|
||||
type: 'StdLib',
|
||||
func: {
|
||||
// We only need the name here to map it back when it serializes
|
||||
// to rust, don't worry about the rest.
|
||||
name,
|
||||
summary: '',
|
||||
description: '',
|
||||
tags: [],
|
||||
returnValue: { type: '', required: false, name: '', schema: {} },
|
||||
args: [],
|
||||
unpublished: false,
|
||||
deprecated: false,
|
||||
},
|
||||
},
|
||||
optional: false,
|
||||
arguments: args,
|
||||
}
|
||||
@ -514,9 +499,6 @@ export function createCallExpression(
|
||||
end: 0,
|
||||
name,
|
||||
},
|
||||
function: {
|
||||
type: 'InMemory',
|
||||
},
|
||||
optional: false,
|
||||
arguments: args,
|
||||
}
|
||||
|
@ -247,10 +247,10 @@ function moreNodePathFromSourceRange(
|
||||
if (_node.type === 'FunctionExpression' && isInRange) {
|
||||
for (let i = 0; i < _node.params.length; i++) {
|
||||
const param = _node.params[i]
|
||||
if (param.start <= start && param.end >= end) {
|
||||
if (param.identifier.start <= start && param.identifier.end >= end) {
|
||||
path.push(['params', 'FunctionExpression'])
|
||||
path.push([i, 'index'])
|
||||
return moreNodePathFromSourceRange(param, sourceRange, path)
|
||||
return moreNodePathFromSourceRange(param.identifier, sourceRange, path)
|
||||
}
|
||||
}
|
||||
if (_node.body.start <= start && _node.body.end >= end) {
|
||||
|
@ -216,6 +216,26 @@ export class EngineConnection {
|
||||
}
|
||||
})
|
||||
|
||||
this.pc.addEventListener('icecandidateerror', (_event) => {
|
||||
const event = _event as RTCPeerConnectionIceErrorEvent
|
||||
console.error(
|
||||
`ICE candidate returned an error: ${event.errorCode}: ${event.errorText} for ${event.url}`
|
||||
)
|
||||
})
|
||||
|
||||
this.pc.addEventListener('connectionstatechange', (event) => {
|
||||
if (this.pc?.iceConnectionState === 'connected') {
|
||||
if (this.shouldTrace()) {
|
||||
iceSpan.resolve?.()
|
||||
}
|
||||
} else if (this.pc?.iceConnectionState === 'failed') {
|
||||
// failed is a terminal state; let's explicitly kill the
|
||||
// connection to the server at this point.
|
||||
console.log('failed to negotiate ice connection; restarting')
|
||||
this.close()
|
||||
}
|
||||
})
|
||||
|
||||
this.websocket.addEventListener('open', (event) => {
|
||||
if (this.shouldTrace()) {
|
||||
websocketSpan.resolve?.()
|
||||
@ -351,19 +371,6 @@ export class EngineConnection {
|
||||
// until the end of this function is setup of our end of the
|
||||
// PeerConnection and waiting for events to fire our callbacks.
|
||||
|
||||
this.pc.addEventListener('connectionstatechange', (event) => {
|
||||
if (this.pc?.iceConnectionState === 'connected') {
|
||||
if (this.shouldTrace()) {
|
||||
iceSpan.resolve?.()
|
||||
}
|
||||
} else if (this.pc?.iceConnectionState === 'failed') {
|
||||
// failed is a terminal state; let's explicitly kill the
|
||||
// connection to the server at this point.
|
||||
console.log('failed to negotiate ice connection; restarting')
|
||||
this.close()
|
||||
}
|
||||
})
|
||||
|
||||
this.pc.addEventListener('icecandidate', (event) => {
|
||||
if (!this.pc || !this.websocket) return
|
||||
if (event.candidate !== null) {
|
||||
@ -633,7 +640,10 @@ export class EngineCommandManager {
|
||||
|
||||
// If we already have an engine connection, just need to resize the stream.
|
||||
if (this.engineConnection) {
|
||||
this.handleResize({ streamWidth: width, streamHeight: height })
|
||||
this.handleResize({
|
||||
streamWidth: width,
|
||||
streamHeight: height,
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
|
@ -946,7 +946,7 @@ export function compareVec2Epsilon(
|
||||
) {
|
||||
const compareEpsilon = 0.015625 // or 2^-6
|
||||
const xDifference = Math.abs(vec1[0] - vec2[0])
|
||||
const yDifference = Math.abs(vec1[0] - vec2[0])
|
||||
const yDifference = Math.abs(vec1[1] - vec2[1])
|
||||
return xDifference < compareEpsilon && yDifference < compareEpsilon
|
||||
}
|
||||
|
||||
|
@ -20,6 +20,7 @@ export type { ObjectExpression } from '../wasm-lib/kcl/bindings/ObjectExpression
|
||||
export type { MemberExpression } from '../wasm-lib/kcl/bindings/MemberExpression'
|
||||
export type { PipeExpression } from '../wasm-lib/kcl/bindings/PipeExpression'
|
||||
export type { VariableDeclaration } from '../wasm-lib/kcl/bindings/VariableDeclaration'
|
||||
export type { Parameter } from '../wasm-lib/kcl/bindings/Parameter'
|
||||
export type { PipeSubstitution } from '../wasm-lib/kcl/bindings/PipeSubstitution'
|
||||
export type { Identifier } from '../wasm-lib/kcl/bindings/Identifier'
|
||||
export type { UnaryExpression } from '../wasm-lib/kcl/bindings/UnaryExpression'
|
||||
|
@ -102,8 +102,8 @@ export async function getEventForSelectWithPoint(
|
||||
Models['OkModelingCmdResponse_type'],
|
||||
{ type: 'select_with_point' }
|
||||
>,
|
||||
{ sketchEnginePathId }: { sketchEnginePathId: string }
|
||||
): Promise<ModelingMachineEvent> {
|
||||
{ sketchEnginePathId }: { sketchEnginePathId?: string }
|
||||
): Promise<ModelingMachineEvent | null> {
|
||||
if (!data?.entity_id) {
|
||||
return {
|
||||
type: 'Set selection',
|
||||
@ -120,6 +120,7 @@ export async function getEventForSelectWithPoint(
|
||||
},
|
||||
}
|
||||
}
|
||||
if (!sketchEnginePathId) return null
|
||||
// selected a vertex
|
||||
const res = await engineCommandManager.sendSceneCommand({
|
||||
type: 'modeling_cmd_req',
|
||||
|
@ -6,10 +6,10 @@
|
||||
serial-integration = { max-threads = 4 }
|
||||
|
||||
[profile.default]
|
||||
slow-timeout = { period = "60s", terminate-after = 1 }
|
||||
slow-timeout = { period = "10s", terminate-after = 1 }
|
||||
|
||||
[profile.ci]
|
||||
slow-timeout = { period = "120s", terminate-after = 10 }
|
||||
slow-timeout = { period = "30s", terminate-after = 5 }
|
||||
|
||||
[[profile.default.overrides]]
|
||||
filter = "test(serial_test_)"
|
||||
@ -20,3 +20,7 @@ threads-required = 4
|
||||
filter = "test(serial_test_)"
|
||||
test-group = "serial-integration"
|
||||
threads-required = 4
|
||||
|
||||
[[profile.default.overrides]]
|
||||
filter = "test(parser::parser_impl::snapshot_tests)"
|
||||
slow-timeout = { period = "1s", terminate-after = 5 }
|
||||
|
188
src/wasm-lib/Cargo.lock
generated
188
src/wasm-lib/Cargo.lock
generated
@ -157,7 +157,7 @@ checksum = "5fd55a5ba1179988837d24ab4c7cc8ed6efdeff578ede0416b4225a5fca35bd0"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 2.0.38",
|
||||
"syn 2.0.39",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@ -168,7 +168,7 @@ checksum = "a66537f1bb974b254c98ed142ff995236e81b9d0fe4db0575f46612cb15eb0f9"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 2.0.38",
|
||||
"syn 2.0.39",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@ -447,9 +447,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "clap"
|
||||
version = "4.4.7"
|
||||
version = "4.4.8"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "ac495e00dcec98c83465d5ad66c5c4fabd652fd6686e7c6269b117e729a6f17b"
|
||||
checksum = "2275f18819641850fa26c89acc84d465c1bf91ce57bc2748b28c420473352f64"
|
||||
dependencies = [
|
||||
"clap_builder",
|
||||
"clap_derive",
|
||||
@ -457,9 +457,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "clap_builder"
|
||||
version = "4.4.7"
|
||||
version = "4.4.8"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "c77ed9a32a62e6ca27175d00d29d05ca32e396ea1eb5fb01d8256b669cec7663"
|
||||
checksum = "07cdf1b148b25c1e1f7a42225e30a0d99a615cd4637eae7365548dd4529b95bc"
|
||||
dependencies = [
|
||||
"anstream",
|
||||
"anstyle",
|
||||
@ -479,7 +479,7 @@ dependencies = [
|
||||
"heck",
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 2.0.38",
|
||||
"syn 2.0.39",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@ -681,6 +681,29 @@ version = "2.4.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "c2e66c9d817f1720209181c316d28635c050fa304f9c79e47a520882661b7308"
|
||||
|
||||
[[package]]
|
||||
name = "databake"
|
||||
version = "0.1.7"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "82175d72e69414ceafbe2b49686794d3a8bed846e0d50267355f83ea8fdd953a"
|
||||
dependencies = [
|
||||
"databake-derive",
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "databake-derive"
|
||||
version = "0.1.7"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "377af281d8f23663862a7c84623bc5dcf7f8c44b13c7496a590bdc157f941a43"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 2.0.39",
|
||||
"synstructure",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "deranged"
|
||||
version = "0.3.9"
|
||||
@ -702,7 +725,7 @@ dependencies = [
|
||||
"quote",
|
||||
"serde",
|
||||
"serde_tokenstream",
|
||||
"syn 2.0.38",
|
||||
"syn 2.0.39",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@ -716,7 +739,7 @@ dependencies = [
|
||||
"quote",
|
||||
"serde",
|
||||
"serde_tokenstream",
|
||||
"syn 2.0.38",
|
||||
"syn 2.0.39",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@ -975,7 +998,7 @@ checksum = "53b153fd91e4b0147f4aced87be237c98248656bb01050b96bf3ee89220a8ddb"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 2.0.38",
|
||||
"syn 2.0.39",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@ -1359,9 +1382,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "itertools"
|
||||
version = "0.11.0"
|
||||
version = "0.12.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b1c173a5686ce8bfa551b3563d0c2170bf24ca44da99c7ca4bfdab5418c3fe57"
|
||||
checksum = "25db6b064527c5d482d0423354fcd07a89a2dfe07b67892e62411946db7f07b0"
|
||||
dependencies = [
|
||||
"either",
|
||||
]
|
||||
@ -1383,9 +1406,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "js-sys"
|
||||
version = "0.3.64"
|
||||
version = "0.3.65"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "c5f195fe497f702db0f318b07fdd68edb16955aed830df8363d837542f8f935a"
|
||||
checksum = "54c0c35952f67de54bb584e9fd912b3023117cbafc0a77d8f3dee1fb5f572fe8"
|
||||
dependencies = [
|
||||
"wasm-bindgen",
|
||||
]
|
||||
@ -1403,7 +1426,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "kcl-lib"
|
||||
version = "0.1.35"
|
||||
version = "0.1.37"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"async-recursion",
|
||||
@ -1412,11 +1435,12 @@ dependencies = [
|
||||
"clap",
|
||||
"criterion",
|
||||
"dashmap",
|
||||
"databake",
|
||||
"derive-docs 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"expectorate",
|
||||
"futures",
|
||||
"insta",
|
||||
"itertools 0.11.0",
|
||||
"itertools 0.12.0",
|
||||
"js-sys",
|
||||
"kittycad",
|
||||
"lazy_static",
|
||||
@ -1438,11 +1462,23 @@ dependencies = [
|
||||
"winnow",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "kcl-macros"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"databake",
|
||||
"kcl-lib",
|
||||
"pretty_assertions",
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 2.0.39",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "kittycad"
|
||||
version = "0.2.41"
|
||||
version = "0.2.43"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "874914cd40bfd43674406683bb3f0924d41780698a4ade96f2e180a73678bdd1"
|
||||
checksum = "41ab6de34cc4ab06519d65a613d4030ade14036ac619d8fee5ce6f35d1766c11"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"async-trait",
|
||||
@ -1747,7 +1783,7 @@ checksum = "0ab1bc2a289d34bd04a330323ac98a1b4bc82c9d9fcb1e66b63caa84da26b575"
|
||||
[[package]]
|
||||
name = "openapitor"
|
||||
version = "0.0.9"
|
||||
source = "git+https://github.com/KittyCAD/kittycad.rs?branch=main#1b2562f4b3ecd26a3683c3fc48a0d33707097a36"
|
||||
source = "git+https://github.com/KittyCAD/kittycad.rs?branch=main#9caff1f4f00c64632ff5a226251e3dc68210b455"
|
||||
dependencies = [
|
||||
"Inflector",
|
||||
"anyhow",
|
||||
@ -1893,7 +1929,7 @@ dependencies = [
|
||||
"regex",
|
||||
"regex-syntax 0.7.5",
|
||||
"structmeta",
|
||||
"syn 2.0.38",
|
||||
"syn 2.0.39",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@ -1917,7 +1953,7 @@ dependencies = [
|
||||
"bincode",
|
||||
"either",
|
||||
"fnv",
|
||||
"itertools 0.11.0",
|
||||
"itertools 0.10.5",
|
||||
"lazy_static",
|
||||
"nom",
|
||||
"quick-xml",
|
||||
@ -1946,7 +1982,7 @@ checksum = "4359fd9c9171ec6e8c62926d6faaf553a8dc3f64e1507e76da7911b4f6a04405"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 2.0.38",
|
||||
"syn 2.0.39",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@ -2484,9 +2520,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "schemars"
|
||||
version = "0.8.15"
|
||||
version = "0.8.16"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "1f7b0ce13155372a76ee2e1c5ffba1fe61ede73fbea5630d61eee6fac4929c0c"
|
||||
checksum = "45a28f4c49489add4ce10783f7911893516f15afe45d015608d41faca6bc4d29"
|
||||
dependencies = [
|
||||
"bigdecimal",
|
||||
"bytes",
|
||||
@ -2501,9 +2537,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "schemars_derive"
|
||||
version = "0.8.15"
|
||||
version = "0.8.16"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e85e2a16b12bdb763244c69ab79363d71db2b4b918a2def53f80b02e0574b13c"
|
||||
checksum = "c767fd6fa65d9ccf9cf026122c1b555f2ef9a4f0cea69da4d7dbc3e258d30967"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
@ -2558,9 +2594,9 @@ checksum = "836fa6a3e1e547f9a2c4040802ec865b5d85f4014efe00555d7090a3dcaa1090"
|
||||
|
||||
[[package]]
|
||||
name = "serde"
|
||||
version = "1.0.190"
|
||||
version = "1.0.192"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "91d3c334ca1ee894a2c6f6ad698fe8c435b76d504b13d436f0685d648d6d96f7"
|
||||
checksum = "bca2a08484b285dcb282d0f67b26cadc0df8b19f8c12502c13d966bf9482f001"
|
||||
dependencies = [
|
||||
"serde_derive",
|
||||
]
|
||||
@ -2576,13 +2612,13 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "serde_derive"
|
||||
version = "1.0.190"
|
||||
version = "1.0.192"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "67c5609f394e5c2bd7fc51efda478004ea80ef42fee983d5c67a65e34f32c0e3"
|
||||
checksum = "d6c7207fbec9faa48073f3e3074cbe553af6ea512d7c21ba46e434e70ea9fbc1"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 2.0.38",
|
||||
"syn 2.0.39",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@ -2616,7 +2652,7 @@ checksum = "8725e1dfadb3a50f7e5ce0b1a540466f6ed3fe7a0fca2ac2b8b831d31316bd00"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 2.0.38",
|
||||
"syn 2.0.39",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@ -2637,7 +2673,7 @@ dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"serde",
|
||||
"syn 2.0.38",
|
||||
"syn 2.0.39",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@ -2848,7 +2884,7 @@ dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"structmeta-derive",
|
||||
"syn 2.0.38",
|
||||
"syn 2.0.39",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@ -2859,7 +2895,7 @@ checksum = "a60bcaff7397072dca0017d1db428e30d5002e00b6847703e2e42005c95fbe00"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 2.0.38",
|
||||
"syn 2.0.39",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@ -2897,15 +2933,27 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "syn"
|
||||
version = "2.0.38"
|
||||
version = "2.0.39"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e96b79aaa137db8f61e26363a0c9b47d8b4ec75da28b7d1d614c2303e232408b"
|
||||
checksum = "23e78b90f2fcf45d3e842032ce32e3f2d1545ba6636271dcbf24fa306d87be7a"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"unicode-ident",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "synstructure"
|
||||
version = "0.13.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "285ba80e733fac80aa4270fbcdf83772a79b80aa35c97075320abfee4a915b06"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 2.0.39",
|
||||
"unicode-xid",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "system-configuration"
|
||||
version = "0.5.1"
|
||||
@ -3008,7 +3056,7 @@ checksum = "266b2e40bc00e5a6c09c3584011e08b06f123c00362c92b975ba9843aaaa14b8"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 2.0.38",
|
||||
"syn 2.0.39",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@ -3090,9 +3138,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20"
|
||||
|
||||
[[package]]
|
||||
name = "tokio"
|
||||
version = "1.33.0"
|
||||
version = "1.34.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "4f38200e3ef7995e5ef13baec2f432a6da0aa9ac495b2c0e8f3b7eec2c92d653"
|
||||
checksum = "d0c014766411e834f7af5b8f4cf46257aab4036ca95e9d2c144a10f59ad6f5b9"
|
||||
dependencies = [
|
||||
"backtrace",
|
||||
"bytes",
|
||||
@ -3109,13 +3157,13 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "tokio-macros"
|
||||
version = "2.1.0"
|
||||
version = "2.2.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e"
|
||||
checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 2.0.38",
|
||||
"syn 2.0.39",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@ -3256,7 +3304,7 @@ checksum = "84fd902d4e0b9a4b27f2f440108dc034e1758628a9b702f8ec61ad66355422fa"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 2.0.38",
|
||||
"syn 2.0.39",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@ -3284,7 +3332,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 2.0.38",
|
||||
"syn 2.0.39",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@ -3370,7 +3418,7 @@ dependencies = [
|
||||
"Inflector",
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 2.0.38",
|
||||
"syn 2.0.39",
|
||||
"termcolor",
|
||||
]
|
||||
|
||||
@ -3455,6 +3503,12 @@ version = "0.1.11"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e51733f11c9c4f72aa0c160008246859e340b00807569a0da0e7a1079b27ba85"
|
||||
|
||||
[[package]]
|
||||
name = "unicode-xid"
|
||||
version = "0.2.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c"
|
||||
|
||||
[[package]]
|
||||
name = "unsafe-libyaml"
|
||||
version = "0.2.9"
|
||||
@ -3493,9 +3547,9 @@ checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a"
|
||||
|
||||
[[package]]
|
||||
name = "uuid"
|
||||
version = "1.5.0"
|
||||
version = "1.6.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "88ad59a7560b41a70d191093a945f0b87bc1deeda46fb237479708a1d6b6cdfc"
|
||||
checksum = "c58fe91d841bc04822c9801002db4ea904b9e4b8e6bbad25127b46eff8dc516b"
|
||||
dependencies = [
|
||||
"atomic",
|
||||
"getrandom",
|
||||
@ -3548,9 +3602,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423"
|
||||
|
||||
[[package]]
|
||||
name = "wasm-bindgen"
|
||||
version = "0.2.87"
|
||||
version = "0.2.88"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "7706a72ab36d8cb1f80ffbf0e071533974a60d0a308d01a5d0375bf60499a342"
|
||||
checksum = "7daec296f25a1bae309c0cd5c29c4b260e510e6d813c286b19eaadf409d40fce"
|
||||
dependencies = [
|
||||
"cfg-if",
|
||||
"wasm-bindgen-macro",
|
||||
@ -3558,24 +3612,24 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "wasm-bindgen-backend"
|
||||
version = "0.2.87"
|
||||
version = "0.2.88"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "5ef2b6d3c510e9625e5fe6f509ab07d66a760f0885d858736483c32ed7809abd"
|
||||
checksum = "e397f4664c0e4e428e8313a469aaa58310d302159845980fd23b0f22a847f217"
|
||||
dependencies = [
|
||||
"bumpalo",
|
||||
"log",
|
||||
"once_cell",
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 2.0.38",
|
||||
"syn 2.0.39",
|
||||
"wasm-bindgen-shared",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "wasm-bindgen-futures"
|
||||
version = "0.4.37"
|
||||
version = "0.4.38"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "c02dbc21516f9f1f04f187958890d7e6026df8d16540b7ad9492bc34a67cea03"
|
||||
checksum = "9afec9963e3d0994cac82455b2b3502b81a7f40f9a0d32181f7528d9f4b43e02"
|
||||
dependencies = [
|
||||
"cfg-if",
|
||||
"futures-core",
|
||||
@ -3586,9 +3640,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "wasm-bindgen-macro"
|
||||
version = "0.2.87"
|
||||
version = "0.2.88"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "dee495e55982a3bd48105a7b947fd2a9b4a8ae3010041b9e0faab3f9cd028f1d"
|
||||
checksum = "5961017b3b08ad5f3fe39f1e79877f8ee7c23c5e5fd5eb80de95abc41f1f16b2"
|
||||
dependencies = [
|
||||
"quote",
|
||||
"wasm-bindgen-macro-support",
|
||||
@ -3596,22 +3650,22 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "wasm-bindgen-macro-support"
|
||||
version = "0.2.87"
|
||||
version = "0.2.88"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b"
|
||||
checksum = "c5353b8dab669f5e10f5bd76df26a9360c748f054f862ff5f3f8aae0c7fb3907"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 2.0.38",
|
||||
"syn 2.0.39",
|
||||
"wasm-bindgen-backend",
|
||||
"wasm-bindgen-shared",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "wasm-bindgen-shared"
|
||||
version = "0.2.87"
|
||||
version = "0.2.88"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "ca6ad05a4870b2bf5fe995117d3728437bd27d7cd5f06f13c17443ef369775a1"
|
||||
checksum = "0d046c5d029ba91a1ed14da14dca44b68bf2f124cfbaf741c54151fdb3e0750b"
|
||||
|
||||
[[package]]
|
||||
name = "wasm-lib"
|
||||
@ -3668,9 +3722,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "web-sys"
|
||||
version = "0.3.64"
|
||||
version = "0.3.65"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "9b85cbef8c220a6abc02aefd892dfc0fc23afb1c6a426316ec33253a3877249b"
|
||||
checksum = "5db499c5f66323272151db0e666cd34f78617522fb0c1604d31a27c50c206a85"
|
||||
dependencies = [
|
||||
"js-sys",
|
||||
"wasm-bindgen",
|
||||
@ -3862,9 +3916,9 @@ checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538"
|
||||
|
||||
[[package]]
|
||||
name = "winnow"
|
||||
version = "0.5.18"
|
||||
version = "0.5.19"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "176b6138793677221d420fd2f0aeeced263f197688b36484660da767bca2fa32"
|
||||
checksum = "829846f3e3db426d4cee4510841b71a8e58aa2a76b1132579487ae430ccd9c7b"
|
||||
dependencies = [
|
||||
"memchr",
|
||||
]
|
||||
@ -3920,7 +3974,7 @@ checksum = "6b6093bc6d5265ff40b479c834cdd25d8e20784781a2a29a8106327393d0a9ff"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 2.0.38",
|
||||
"syn 2.0.39",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
@ -3,6 +3,7 @@ name = "wasm-lib"
|
||||
version = "0.1.0"
|
||||
edition = "2021"
|
||||
repository = "https://github.com/KittyCAD/modeling-app"
|
||||
rust-version = "1.73"
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
[lib]
|
||||
@ -14,9 +15,9 @@ gloo-utils = "0.2.0"
|
||||
kcl-lib = { path = "kcl" }
|
||||
kittycad = { workspace = true }
|
||||
serde_json = "1.0.108"
|
||||
uuid = { version = "1.5.0", features = ["v4", "js", "serde"] }
|
||||
wasm-bindgen = "0.2.87"
|
||||
wasm-bindgen-futures = "0.4.37"
|
||||
uuid = { version = "1.6.0", features = ["v4", "js", "serde"] }
|
||||
wasm-bindgen = "0.2.88"
|
||||
wasm-bindgen-futures = "0.4.38"
|
||||
|
||||
[dev-dependencies]
|
||||
anyhow = "1"
|
||||
@ -24,19 +25,19 @@ image = "0.24.7"
|
||||
kittycad = { workspace = true, default-features = true }
|
||||
pretty_assertions = "1.4.0"
|
||||
reqwest = { version = "0.11.22", default-features = false }
|
||||
tokio = { version = "1.33.0", features = ["rt-multi-thread", "macros", "time"] }
|
||||
tokio = { version = "1.34.0", features = ["rt-multi-thread", "macros", "time"] }
|
||||
twenty-twenty = "0.6.1"
|
||||
uuid = { version = "1.5.0", features = ["v4", "js", "serde"] }
|
||||
uuid = { version = "1.6.0", features = ["v4", "js", "serde"] }
|
||||
|
||||
[target.'cfg(target_arch = "wasm32")'.dependencies]
|
||||
futures = "0.3.29"
|
||||
js-sys = "0.3.64"
|
||||
js-sys = "0.3.65"
|
||||
tower-lsp = { version = "0.20.0", default-features = false, features = ["runtime-agnostic"] }
|
||||
wasm-bindgen-futures = { version = "0.4.37", features = ["futures-core-03-stream"] }
|
||||
wasm-streams = "0.4.0"
|
||||
|
||||
[target.'cfg(target_arch = "wasm32")'.dependencies.web-sys]
|
||||
version = "0.3.57"
|
||||
version = "0.3.65"
|
||||
features = [
|
||||
"console",
|
||||
"HtmlTextAreaElement",
|
||||
@ -52,10 +53,11 @@ debug = true
|
||||
members = [
|
||||
"derive-docs",
|
||||
"kcl",
|
||||
"kcl-macros",
|
||||
]
|
||||
|
||||
[workspace.dependencies]
|
||||
kittycad = { version = "0.2.41", default-features = false, features = ["js"] }
|
||||
kittycad = { version = "0.2.43", default-features = false, features = ["js"] }
|
||||
|
||||
[[test]]
|
||||
name = "executor"
|
||||
|
@ -5,6 +5,7 @@ version = "0.1.4"
|
||||
edition = "2021"
|
||||
license = "MIT"
|
||||
repository = "https://github.com/KittyCAD/modeling-app"
|
||||
rust-version = "1.73"
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
@ -15,9 +16,9 @@ proc-macro = true
|
||||
convert_case = "0.6.0"
|
||||
proc-macro2 = "1"
|
||||
quote = "1"
|
||||
serde = { version = "1.0.190", features = ["derive"] }
|
||||
serde = { version = "1.0.192", features = ["derive"] }
|
||||
serde_tokenstream = "0.2"
|
||||
syn = { version = "2.0.38", features = ["full"] }
|
||||
syn = { version = "2.0.39", features = ["full"] }
|
||||
|
||||
[dev-dependencies]
|
||||
expectorate = "1.1.0"
|
||||
|
22
src/wasm-lib/kcl-macros/Cargo.toml
Normal file
22
src/wasm-lib/kcl-macros/Cargo.toml
Normal file
@ -0,0 +1,22 @@
|
||||
[package]
|
||||
name = "kcl-macros"
|
||||
description = "Macro for compiling KCL to its AST during Rust compile-time"
|
||||
version = "0.1.0"
|
||||
edition = "2021"
|
||||
license = "MIT"
|
||||
repository = "https://github.com/KittyCAD/modeling-app"
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[lib]
|
||||
proc-macro = true
|
||||
|
||||
[dependencies]
|
||||
databake = "0.1.7"
|
||||
kcl-lib = { path = "../kcl" }
|
||||
proc-macro2 = "1"
|
||||
quote = "1"
|
||||
syn = { version = "2.0.39", features = ["full"] }
|
||||
|
||||
[dev-dependencies]
|
||||
pretty_assertions = "1.4.0"
|
23
src/wasm-lib/kcl-macros/src/lib.rs
Normal file
23
src/wasm-lib/kcl-macros/src/lib.rs
Normal file
@ -0,0 +1,23 @@
|
||||
//! This crate contains macros for parsing KCL at Rust compile-time.
|
||||
use databake::*;
|
||||
use proc_macro::TokenStream;
|
||||
use quote::quote;
|
||||
use syn::{parse_macro_input, LitStr};
|
||||
|
||||
/// Parses KCL into its AST at compile-time.
|
||||
/// This macro takes exactly one argument: A string literal containing KCL.
|
||||
/// # Examples
|
||||
/// ```
|
||||
/// extern crate alloc;
|
||||
/// use kcl_compile_macro::parse_kcl;
|
||||
/// let ast: kcl_lib::ast::types::Program = parse_kcl!("const y = 4");
|
||||
/// ```
|
||||
#[proc_macro]
|
||||
pub fn parse(input: TokenStream) -> TokenStream {
|
||||
let input = parse_macro_input!(input as LitStr);
|
||||
let kcl_src = input.value();
|
||||
let tokens = kcl_lib::token::lexer(&kcl_src);
|
||||
let ast = kcl_lib::parser::Parser::new(tokens).ast().unwrap();
|
||||
let ast_struct = ast.bake(&Default::default());
|
||||
quote!(#ast_struct).into()
|
||||
}
|
38
src/wasm-lib/kcl-macros/tests/macro_test.rs
Normal file
38
src/wasm-lib/kcl-macros/tests/macro_test.rs
Normal file
@ -0,0 +1,38 @@
|
||||
extern crate alloc;
|
||||
use kcl_lib::ast::types::{
|
||||
BodyItem, Identifier, Literal, LiteralValue, NonCodeMeta, Program, Value, VariableDeclaration, VariableDeclarator,
|
||||
VariableKind,
|
||||
};
|
||||
use kcl_macros::parse;
|
||||
use pretty_assertions::assert_eq;
|
||||
|
||||
#[test]
|
||||
fn basic() {
|
||||
let actual = parse!("const y = 4");
|
||||
let expected = Program {
|
||||
start: 0,
|
||||
end: 11,
|
||||
body: vec![BodyItem::VariableDeclaration(VariableDeclaration {
|
||||
start: 0,
|
||||
end: 11,
|
||||
declarations: vec![VariableDeclarator {
|
||||
start: 6,
|
||||
end: 11,
|
||||
id: Identifier {
|
||||
start: 6,
|
||||
end: 7,
|
||||
name: "y".to_owned(),
|
||||
},
|
||||
init: Value::Literal(Box::new(Literal {
|
||||
start: 10,
|
||||
end: 11,
|
||||
value: LiteralValue::IInteger(4),
|
||||
raw: "4".to_owned(),
|
||||
})),
|
||||
}],
|
||||
kind: VariableKind::Const,
|
||||
})],
|
||||
non_code_meta: NonCodeMeta::default(),
|
||||
};
|
||||
assert_eq!(expected, actual);
|
||||
}
|
@ -1,10 +1,13 @@
|
||||
[package]
|
||||
name = "kcl-lib"
|
||||
description = "KittyCAD Language"
|
||||
version = "0.1.35"
|
||||
description = "KittyCAD Language implementation and tools"
|
||||
version = "0.1.37"
|
||||
edition = "2021"
|
||||
license = "MIT"
|
||||
repository = "https://github.com/KittyCAD/modeling-app"
|
||||
rust-version = "1.73"
|
||||
authors = ["Jess Frazelle", "Adam Chalmers", "KittyCAD, Inc"]
|
||||
keywords = ["kcl", "KittyCAD", "CAD"]
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
@ -12,33 +15,34 @@ repository = "https://github.com/KittyCAD/modeling-app"
|
||||
anyhow = { version = "1.0.75", features = ["backtrace"] }
|
||||
async-recursion = "1.0.5"
|
||||
async-trait = "0.1.73"
|
||||
clap = { version = "4.4.7", features = ["cargo", "derive", "env", "unicode"], optional = true }
|
||||
clap = { version = "4.4.8", features = ["cargo", "derive", "env", "unicode"], optional = true }
|
||||
dashmap = "5.5.3"
|
||||
databake = { version = "0.1.7", features = ["derive"] }
|
||||
derive-docs = { version = "0.1.4" }
|
||||
#derive-docs = { path = "../derive-docs" }
|
||||
kittycad = { workspace = true }
|
||||
lazy_static = "1.4.0"
|
||||
parse-display = "0.8.2"
|
||||
schemars = { version = "0.8", features = ["impl_json_schema", "url", "uuid1"] }
|
||||
serde = { version = "1.0.190", features = ["derive"] }
|
||||
schemars = { version = "0.8.16", features = ["impl_json_schema", "url", "uuid1"] }
|
||||
serde = { version = "1.0.192", features = ["derive"] }
|
||||
serde_json = "1.0.108"
|
||||
thiserror = "1.0.50"
|
||||
ts-rs = { version = "7", package = "ts-rs-json-value", features = ["serde-json-impl", "schemars-impl", "uuid-impl"] }
|
||||
uuid = { version = "1.5.0", features = ["v4", "js", "serde"] }
|
||||
uuid = { version = "1.6.0", features = ["v4", "js", "serde"] }
|
||||
winnow = "0.5.18"
|
||||
|
||||
[target.'cfg(target_arch = "wasm32")'.dependencies]
|
||||
js-sys = { version = "0.3.64" }
|
||||
js-sys = { version = "0.3.65" }
|
||||
tower-lsp = { version = "0.20.0", default-features = false, features = ["runtime-agnostic"] }
|
||||
wasm-bindgen = "0.2.87"
|
||||
wasm-bindgen-futures = "0.4.37"
|
||||
web-sys = { version = "0.3.64", features = ["console"] }
|
||||
wasm-bindgen = "0.2.88"
|
||||
wasm-bindgen-futures = "0.4.38"
|
||||
web-sys = { version = "0.3.65", features = ["console"] }
|
||||
|
||||
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
|
||||
bson = { version = "2.7.0", features = ["uuid-1", "chrono"] }
|
||||
futures = { version = "0.3.29" }
|
||||
reqwest = { version = "0.11.22", default-features = false }
|
||||
tokio = { version = "1.33.0", features = ["full"] }
|
||||
tokio = { version = "1.34.0", features = ["full"] }
|
||||
tokio-tungstenite = { version = "0.20.0", features = ["rustls-tls-native-roots"] }
|
||||
tower-lsp = { version = "0.20.0", features = ["proposed"] }
|
||||
|
||||
@ -58,9 +62,9 @@ debug = true # Flamegraphs of benchmarks require accurate debug symbols
|
||||
criterion = "0.5.1"
|
||||
expectorate = "1.1.0"
|
||||
insta = { version = "1.34.0", features = ["json"] }
|
||||
itertools = "0.11.0"
|
||||
itertools = "0.12.0"
|
||||
pretty_assertions = "1.4.0"
|
||||
tokio = { version = "1.33.0", features = ["rt-multi-thread", "macros", "time"] }
|
||||
tokio = { version = "1.34.0", features = ["rt-multi-thread", "macros", "time"] }
|
||||
|
||||
[[bench]]
|
||||
name = "compiler_benchmark"
|
||||
|
@ -4,6 +4,7 @@ version = "0.0.0"
|
||||
publish = false
|
||||
edition = "2021"
|
||||
repository = "https://github.com/KittyCAD/modeling-app"
|
||||
rust-version = "1.73"
|
||||
|
||||
[package.metadata]
|
||||
cargo-fuzz = true
|
||||
|
@ -3,23 +3,26 @@
|
||||
use std::{collections::HashMap, fmt::Write};
|
||||
|
||||
use anyhow::Result;
|
||||
use databake::*;
|
||||
use parse_display::{Display, FromStr};
|
||||
use schemars::JsonSchema;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use serde_json::Map;
|
||||
use serde_json::Value as JValue;
|
||||
use serde_json::{Map, Value as JValue};
|
||||
use tower_lsp::lsp_types::{CompletionItem, CompletionItemKind, DocumentSymbol, Range as LspRange, SymbolKind};
|
||||
|
||||
pub use self::literal_value::LiteralValue;
|
||||
use crate::{
|
||||
docs::StdLibFn,
|
||||
errors::{KclError, KclErrorDetails},
|
||||
executor::{ExecutorContext, MemoryItem, Metadata, PipeInfo, ProgramMemory, SourceRange, UserVal},
|
||||
executor::{BodyType, ExecutorContext, MemoryItem, Metadata, PipeInfo, ProgramMemory, SourceRange, UserVal},
|
||||
parser::PIPE_OPERATOR,
|
||||
std::{kcl_stdlib::KclStdLibFn, FunctionKind},
|
||||
};
|
||||
|
||||
mod literal_value;
|
||||
|
||||
#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, ts_rs::TS, JsonSchema)]
|
||||
#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, ts_rs::TS, JsonSchema, Bake)]
|
||||
#[databake(path = kcl_lib::ast::types)]
|
||||
#[ts(export)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct Program {
|
||||
@ -218,11 +221,11 @@ impl Program {
|
||||
if let Some(Value::FunctionExpression(ref mut function_expression)) = &mut value {
|
||||
// Check if the params to the function expression contain the position.
|
||||
for param in &mut function_expression.params {
|
||||
let param_source_range: SourceRange = param.clone().into();
|
||||
let param_source_range: SourceRange = (¶m.identifier).into();
|
||||
if param_source_range.contains(pos) {
|
||||
let old_name = param.name.clone();
|
||||
let old_name = param.identifier.name.clone();
|
||||
// Rename the param.
|
||||
param.rename(&old_name, new_name);
|
||||
param.identifier.rename(&old_name, new_name);
|
||||
// Now rename all the identifiers in the rest of the program.
|
||||
function_expression.body.rename_identifiers(&old_name, new_name);
|
||||
return;
|
||||
@ -348,7 +351,8 @@ macro_rules! impl_value_meta {
|
||||
|
||||
pub(crate) use impl_value_meta;
|
||||
|
||||
#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, ts_rs::TS, JsonSchema)]
|
||||
#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, ts_rs::TS, JsonSchema, Bake)]
|
||||
#[databake(path = kcl_lib::ast::types)]
|
||||
#[ts(export)]
|
||||
#[serde(tag = "type")]
|
||||
pub enum BodyItem {
|
||||
@ -387,7 +391,8 @@ impl From<&BodyItem> for SourceRange {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, ts_rs::TS, JsonSchema)]
|
||||
#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, ts_rs::TS, JsonSchema, Bake)]
|
||||
#[databake(path = kcl_lib::ast::types)]
|
||||
#[ts(export)]
|
||||
#[serde(tag = "type")]
|
||||
pub enum Value {
|
||||
@ -550,7 +555,8 @@ impl From<&Value> for SourceRange {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, ts_rs::TS, JsonSchema)]
|
||||
#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, ts_rs::TS, JsonSchema, Bake)]
|
||||
#[databake(path = kcl_lib::ast::types)]
|
||||
#[ts(export)]
|
||||
#[serde(tag = "type")]
|
||||
pub enum BinaryPart {
|
||||
@ -706,7 +712,8 @@ impl BinaryPart {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, ts_rs::TS, JsonSchema)]
|
||||
#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, ts_rs::TS, JsonSchema, Bake)]
|
||||
#[databake(path = kcl_lib::ast::types)]
|
||||
#[ts(export)]
|
||||
#[serde(tag = "type")]
|
||||
pub struct NonCodeNode {
|
||||
@ -754,7 +761,8 @@ impl NonCodeNode {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, ts_rs::TS, JsonSchema)]
|
||||
#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, ts_rs::TS, JsonSchema, Bake)]
|
||||
#[databake(path = kcl_lib::ast::types)]
|
||||
#[ts(export)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub enum CommentStyle {
|
||||
@ -764,7 +772,8 @@ pub enum CommentStyle {
|
||||
Block,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, ts_rs::TS, JsonSchema)]
|
||||
#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, ts_rs::TS, JsonSchema, Bake)]
|
||||
#[databake(path = kcl_lib::ast::types)]
|
||||
#[ts(export)]
|
||||
#[serde(tag = "type", rename_all = "camelCase")]
|
||||
pub enum NonCodeValue {
|
||||
@ -801,7 +810,8 @@ pub enum NonCodeValue {
|
||||
NewLine,
|
||||
}
|
||||
|
||||
#[derive(Debug, Default, Clone, Serialize, PartialEq, ts_rs::TS, JsonSchema)]
|
||||
#[derive(Debug, Default, Clone, Serialize, PartialEq, ts_rs::TS, JsonSchema, Bake)]
|
||||
#[databake(path = kcl_lib::ast::types)]
|
||||
#[ts(export)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct NonCodeMeta {
|
||||
@ -842,7 +852,8 @@ impl NonCodeMeta {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, ts_rs::TS, JsonSchema)]
|
||||
#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, ts_rs::TS, JsonSchema, Bake)]
|
||||
#[databake(path = kcl_lib::ast::types)]
|
||||
#[ts(export)]
|
||||
#[serde(tag = "type")]
|
||||
pub struct ExpressionStatement {
|
||||
@ -853,7 +864,8 @@ pub struct ExpressionStatement {
|
||||
|
||||
impl_value_meta!(ExpressionStatement);
|
||||
|
||||
#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, ts_rs::TS, JsonSchema)]
|
||||
#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, ts_rs::TS, JsonSchema, Bake)]
|
||||
#[databake(path = kcl_lib::ast::types)]
|
||||
#[ts(export)]
|
||||
#[serde(tag = "type")]
|
||||
pub struct CallExpression {
|
||||
@ -862,7 +874,6 @@ pub struct CallExpression {
|
||||
pub callee: Identifier,
|
||||
pub arguments: Vec<Value>,
|
||||
pub optional: bool,
|
||||
pub function: Function,
|
||||
}
|
||||
|
||||
impl_value_meta!(CallExpression);
|
||||
@ -875,22 +886,12 @@ impl From<CallExpression> for Value {
|
||||
|
||||
impl CallExpression {
|
||||
pub fn new(name: &str, arguments: Vec<Value>) -> Result<Self, KclError> {
|
||||
// Create our stdlib.
|
||||
let stdlib = crate::std::StdLib::new();
|
||||
let func = stdlib.get(name).ok_or_else(|| {
|
||||
KclError::UndefinedValue(KclErrorDetails {
|
||||
message: format!("Function {} is not defined", name),
|
||||
source_ranges: vec![],
|
||||
})
|
||||
})?;
|
||||
|
||||
Ok(Self {
|
||||
start: 0,
|
||||
end: 0,
|
||||
callee: Identifier::new(name),
|
||||
arguments,
|
||||
optional: false,
|
||||
function: Function::StdLib { func },
|
||||
})
|
||||
}
|
||||
|
||||
@ -972,8 +973,8 @@ impl CallExpression {
|
||||
fn_args.push(result);
|
||||
}
|
||||
|
||||
match &self.function {
|
||||
Function::StdLib { func } => {
|
||||
match ctx.stdlib.get_either(&self.callee.name) {
|
||||
FunctionKind::Core(func) => {
|
||||
// Attempt to call the function.
|
||||
let args = crate::std::Args::new(fn_args, self.into(), ctx.clone());
|
||||
let result = func.std_lib_fn()(args).await?;
|
||||
@ -985,14 +986,58 @@ impl CallExpression {
|
||||
Ok(result)
|
||||
}
|
||||
}
|
||||
Function::InMemory => {
|
||||
FunctionKind::Std(func) => {
|
||||
let function_expression = func.function();
|
||||
if fn_args.len() != function_expression.params.len() {
|
||||
return Err(KclError::Semantic(KclErrorDetails {
|
||||
message: format!(
|
||||
"Expected {} arguments, got {}",
|
||||
function_expression.params.len(),
|
||||
fn_args.len(),
|
||||
),
|
||||
source_ranges: vec![(function_expression).into()],
|
||||
}));
|
||||
}
|
||||
|
||||
// Add the arguments to the memory.
|
||||
let mut fn_memory = memory.clone();
|
||||
for (index, param) in function_expression.params.iter().enumerate() {
|
||||
fn_memory.add(
|
||||
¶m.identifier.name,
|
||||
fn_args.get(index).unwrap().clone(),
|
||||
param.identifier.clone().into(),
|
||||
)?;
|
||||
}
|
||||
|
||||
// Call the stdlib function
|
||||
let p = func.function().clone().body;
|
||||
let results = crate::executor::execute(p, &mut fn_memory, BodyType::Block, ctx).await?;
|
||||
let out = results.return_;
|
||||
let result = out.ok_or_else(|| {
|
||||
KclError::UndefinedValue(KclErrorDetails {
|
||||
message: format!("Result of stdlib function {} is undefined", fn_name),
|
||||
source_ranges: vec![self.into()],
|
||||
})
|
||||
})?;
|
||||
let result = result.get_value()?;
|
||||
|
||||
if pipe_info.is_in_pipe {
|
||||
pipe_info.index += 1;
|
||||
pipe_info.previous_results.push(result);
|
||||
|
||||
execute_pipe_body(memory, &pipe_info.body.clone(), pipe_info, self.into(), ctx).await
|
||||
} else {
|
||||
Ok(result)
|
||||
}
|
||||
}
|
||||
FunctionKind::UserDefined => {
|
||||
let func = memory.get(&fn_name, self.into())?;
|
||||
let result = func
|
||||
.call_fn(fn_args, memory.clone(), ctx.clone())
|
||||
.await?
|
||||
.ok_or_else(|| {
|
||||
KclError::UndefinedValue(KclErrorDetails {
|
||||
message: format!("Result of function {} is undefined", fn_name),
|
||||
message: format!("Result of user-defined function {} is undefined", fn_name),
|
||||
source_ranges: vec![self.into()],
|
||||
})
|
||||
})?;
|
||||
@ -1067,10 +1112,15 @@ impl CallExpression {
|
||||
#[ts(export)]
|
||||
#[serde(tag = "type")]
|
||||
pub enum Function {
|
||||
/// A stdlib function.
|
||||
/// A stdlib function written in Rust (aka core lib).
|
||||
StdLib {
|
||||
/// The function.
|
||||
func: Box<dyn crate::docs::StdLibFn>,
|
||||
func: Box<dyn StdLibFn>,
|
||||
},
|
||||
/// A stdlib function written in KCL.
|
||||
StdLibKcl {
|
||||
/// The function.
|
||||
func: Box<dyn KclStdLibFn>,
|
||||
},
|
||||
/// A function that is defined in memory.
|
||||
#[default]
|
||||
@ -1087,7 +1137,8 @@ impl PartialEq for Function {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, ts_rs::TS, JsonSchema)]
|
||||
#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, ts_rs::TS, JsonSchema, Bake)]
|
||||
#[databake(path = kcl_lib::ast::types)]
|
||||
#[ts(export)]
|
||||
#[serde(tag = "type")]
|
||||
pub struct VariableDeclaration {
|
||||
@ -1190,10 +1241,10 @@ impl VariableDeclaration {
|
||||
symbol_kind = SymbolKind::FUNCTION;
|
||||
let mut children = vec![];
|
||||
for param in &function_expression.params {
|
||||
let param_source_range: SourceRange = param.into();
|
||||
let param_source_range: SourceRange = (¶m.identifier).into();
|
||||
#[allow(deprecated)]
|
||||
children.push(DocumentSymbol {
|
||||
name: param.name.clone(),
|
||||
name: param.identifier.name.clone(),
|
||||
detail: None,
|
||||
kind: SymbolKind::VARIABLE,
|
||||
range: param_source_range.to_lsp_range(code),
|
||||
@ -1237,7 +1288,8 @@ impl VariableDeclaration {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, ts_rs::TS, JsonSchema, FromStr, Display)]
|
||||
#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, ts_rs::TS, JsonSchema, FromStr, Display, Bake)]
|
||||
#[databake(path = kcl_lib::ast::types)]
|
||||
#[ts(export)]
|
||||
#[serde(rename_all = "snake_case")]
|
||||
#[display(style = "snake_case")]
|
||||
@ -1281,7 +1333,8 @@ impl VariableKind {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, ts_rs::TS, JsonSchema)]
|
||||
#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, ts_rs::TS, JsonSchema, Bake)]
|
||||
#[databake(path = kcl_lib::ast::types)]
|
||||
#[ts(export)]
|
||||
#[serde(tag = "type")]
|
||||
pub struct VariableDeclarator {
|
||||
@ -1310,7 +1363,8 @@ impl VariableDeclarator {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, ts_rs::TS, JsonSchema)]
|
||||
#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, ts_rs::TS, JsonSchema, Bake)]
|
||||
#[databake(path = kcl_lib::ast::types)]
|
||||
#[ts(export)]
|
||||
#[serde(tag = "type")]
|
||||
pub struct Literal {
|
||||
@ -1380,7 +1434,8 @@ impl From<&Box<Literal>> for MemoryItem {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, ts_rs::TS, JsonSchema)]
|
||||
#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, ts_rs::TS, JsonSchema, Bake, Eq)]
|
||||
#[databake(path = kcl_lib::ast::types)]
|
||||
#[ts(export)]
|
||||
#[serde(tag = "type")]
|
||||
pub struct Identifier {
|
||||
@ -1416,7 +1471,8 @@ impl Identifier {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, ts_rs::TS, JsonSchema)]
|
||||
#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, ts_rs::TS, JsonSchema, Bake)]
|
||||
#[databake(path = kcl_lib::ast::types)]
|
||||
#[ts(export)]
|
||||
#[serde(tag = "type")]
|
||||
pub struct PipeSubstitution {
|
||||
@ -1444,7 +1500,8 @@ impl From<PipeSubstitution> for Value {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, ts_rs::TS, JsonSchema)]
|
||||
#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, ts_rs::TS, JsonSchema, Bake)]
|
||||
#[databake(path = kcl_lib::ast::types)]
|
||||
#[ts(export)]
|
||||
#[serde(tag = "type")]
|
||||
pub struct ArrayExpression {
|
||||
@ -1604,7 +1661,8 @@ impl ArrayExpression {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, ts_rs::TS, JsonSchema)]
|
||||
#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, ts_rs::TS, JsonSchema, Bake)]
|
||||
#[databake(path = kcl_lib::ast::types)]
|
||||
#[ts(export)]
|
||||
#[serde(tag = "type")]
|
||||
pub struct ObjectExpression {
|
||||
@ -1761,7 +1819,8 @@ impl ObjectExpression {
|
||||
|
||||
impl_value_meta!(ObjectExpression);
|
||||
|
||||
#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, ts_rs::TS, JsonSchema)]
|
||||
#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, ts_rs::TS, JsonSchema, Bake)]
|
||||
#[databake(path = kcl_lib::ast::types)]
|
||||
#[ts(export)]
|
||||
#[serde(tag = "type")]
|
||||
pub struct ObjectProperty {
|
||||
@ -1803,7 +1862,8 @@ impl ObjectProperty {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, ts_rs::TS, JsonSchema)]
|
||||
#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, ts_rs::TS, JsonSchema, Bake)]
|
||||
#[databake(path = kcl_lib::ast::types)]
|
||||
#[ts(export)]
|
||||
#[serde(tag = "type")]
|
||||
pub enum MemberObject {
|
||||
@ -1849,7 +1909,8 @@ impl From<&MemberObject> for SourceRange {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, ts_rs::TS, JsonSchema)]
|
||||
#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, ts_rs::TS, JsonSchema, Bake)]
|
||||
#[databake(path = kcl_lib::ast::types)]
|
||||
#[ts(export)]
|
||||
#[serde(tag = "type")]
|
||||
pub enum LiteralIdentifier {
|
||||
@ -1885,7 +1946,8 @@ impl From<&LiteralIdentifier> for SourceRange {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, ts_rs::TS, JsonSchema)]
|
||||
#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, ts_rs::TS, JsonSchema, Bake)]
|
||||
#[databake(path = kcl_lib::ast::types)]
|
||||
#[ts(export)]
|
||||
#[serde(tag = "type")]
|
||||
pub struct MemberExpression {
|
||||
@ -2048,7 +2110,8 @@ pub struct ObjectKeyInfo {
|
||||
pub computed: bool,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, ts_rs::TS, JsonSchema)]
|
||||
#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, ts_rs::TS, JsonSchema, Bake)]
|
||||
#[databake(path = kcl_lib::ast::types)]
|
||||
#[ts(export)]
|
||||
#[serde(tag = "type")]
|
||||
pub struct BinaryExpression {
|
||||
@ -2227,7 +2290,8 @@ pub fn parse_json_value_as_string(j: &serde_json::Value) -> Option<String> {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, ts_rs::TS, JsonSchema, FromStr, Display)]
|
||||
#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, ts_rs::TS, JsonSchema, FromStr, Display, Bake)]
|
||||
#[databake(path = kcl_lib::ast::types)]
|
||||
#[ts(export)]
|
||||
#[serde(rename_all = "snake_case")]
|
||||
#[display(style = "snake_case")]
|
||||
@ -2295,7 +2359,8 @@ impl BinaryOperator {
|
||||
}
|
||||
}
|
||||
}
|
||||
#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, ts_rs::TS, JsonSchema)]
|
||||
#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, ts_rs::TS, JsonSchema, Bake)]
|
||||
#[databake(path = kcl_lib::ast::types)]
|
||||
#[ts(export)]
|
||||
#[serde(tag = "type")]
|
||||
pub struct UnaryExpression {
|
||||
@ -2373,7 +2438,8 @@ impl UnaryExpression {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, ts_rs::TS, JsonSchema, FromStr, Display)]
|
||||
#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, ts_rs::TS, JsonSchema, FromStr, Display, Bake)]
|
||||
#[databake(path = kcl_lib::ast::types)]
|
||||
#[ts(export)]
|
||||
#[serde(rename_all = "snake_case")]
|
||||
#[display(style = "snake_case")]
|
||||
@ -2388,7 +2454,8 @@ pub enum UnaryOperator {
|
||||
Not,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, ts_rs::TS, JsonSchema)]
|
||||
#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, ts_rs::TS, JsonSchema, Bake)]
|
||||
#[databake(path = kcl_lib::ast::types)]
|
||||
#[ts(export)]
|
||||
#[serde(rename_all = "camelCase", tag = "type")]
|
||||
pub struct PipeExpression {
|
||||
@ -2546,13 +2613,26 @@ async fn execute_pipe_body(
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, ts_rs::TS, JsonSchema)]
|
||||
/// Parameter of a KCL function.
|
||||
#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, ts_rs::TS, JsonSchema, Bake)]
|
||||
#[databake(path = kcl_lib::ast::types)]
|
||||
#[ts(export)]
|
||||
#[serde(tag = "type")]
|
||||
pub struct Parameter {
|
||||
/// The parameter's label or name.
|
||||
pub identifier: Identifier,
|
||||
/// Is the parameter optional?
|
||||
pub optional: bool,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, ts_rs::TS, JsonSchema, Bake)]
|
||||
#[databake(path = kcl_lib::ast::types)]
|
||||
#[ts(export)]
|
||||
#[serde(tag = "type")]
|
||||
pub struct FunctionExpression {
|
||||
pub start: usize,
|
||||
pub end: usize,
|
||||
pub params: Vec<Identifier>,
|
||||
pub params: Vec<Parameter>,
|
||||
pub body: Program,
|
||||
}
|
||||
|
||||
@ -2578,7 +2658,7 @@ impl FunctionExpression {
|
||||
"({}) => {{\n{}{}\n}}",
|
||||
self.params
|
||||
.iter()
|
||||
.map(|param| param.name.clone())
|
||||
.map(|param| param.identifier.name.clone())
|
||||
.collect::<Vec<String>>()
|
||||
.join(", "),
|
||||
options.get_indentation(indentation_level + 1),
|
||||
@ -2596,7 +2676,8 @@ impl FunctionExpression {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, ts_rs::TS, JsonSchema)]
|
||||
#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, ts_rs::TS, JsonSchema, Bake)]
|
||||
#[databake(path = kcl_lib::ast::types)]
|
||||
#[ts(export)]
|
||||
#[serde(tag = "type")]
|
||||
pub struct ReturnStatement {
|
||||
|
@ -1,10 +1,12 @@
|
||||
use databake::*;
|
||||
use schemars::JsonSchema;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use serde_json::Value as JValue;
|
||||
|
||||
use super::{Literal, Value};
|
||||
|
||||
#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, ts_rs::TS, JsonSchema)]
|
||||
#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, ts_rs::TS, JsonSchema, Bake)]
|
||||
#[databake(path = kcl_lib::ast::types)]
|
||||
#[ts(export)]
|
||||
#[serde(untagged, rename_all = "snake_case")]
|
||||
pub enum LiteralValue {
|
||||
|
@ -88,11 +88,7 @@ impl EngineConnection {
|
||||
let ws_stream = tokio_tungstenite::WebSocketStream::from_raw_socket(
|
||||
ws,
|
||||
tokio_tungstenite::tungstenite::protocol::Role::Client,
|
||||
Some(tokio_tungstenite::tungstenite::protocol::WebSocketConfig {
|
||||
write_buffer_size: 1024 * 128,
|
||||
max_write_buffer_size: 1024 * 256,
|
||||
..Default::default()
|
||||
}),
|
||||
Some(tokio_tungstenite::tungstenite::protocol::WebSocketConfig { ..Default::default() }),
|
||||
)
|
||||
.await;
|
||||
|
||||
|
@ -1,8 +1,9 @@
|
||||
//! The executor for the AST.
|
||||
|
||||
use std::collections::HashMap;
|
||||
use std::{collections::HashMap, sync::Arc};
|
||||
|
||||
use anyhow::Result;
|
||||
use async_recursion::async_recursion;
|
||||
use kittycad::types::{Color, ModelingCmd, Point3D};
|
||||
use parse_display::{Display, FromStr};
|
||||
use schemars::JsonSchema;
|
||||
@ -10,9 +11,10 @@ use serde::{Deserialize, Serialize};
|
||||
use tower_lsp::lsp_types::{Position as LspPosition, Range as LspRange};
|
||||
|
||||
use crate::{
|
||||
ast::types::{BodyItem, Function, FunctionExpression, Value},
|
||||
ast::types::{BodyItem, FunctionExpression, Value},
|
||||
engine::{EngineConnection, EngineManager},
|
||||
errors::{KclError, KclErrorDetails},
|
||||
std::{FunctionKind, StdLib},
|
||||
};
|
||||
|
||||
#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, ts_rs::TS, JsonSchema)]
|
||||
@ -347,27 +349,27 @@ impl MemoryItem {
|
||||
}
|
||||
}
|
||||
|
||||
/// If this memory item is a function, call it with the given arguments, return its val as Ok.
|
||||
/// If it's not a function, return Err.
|
||||
pub async fn call_fn(
|
||||
&self,
|
||||
args: Vec<MemoryItem>,
|
||||
memory: ProgramMemory,
|
||||
ctx: ExecutorContext,
|
||||
) -> Result<Option<ProgramReturn>, KclError> {
|
||||
if let MemoryItem::Function { func, expression, meta } = &self {
|
||||
if let Some(func) = func {
|
||||
func(args, memory, expression.clone(), meta.clone(), ctx).await
|
||||
} else {
|
||||
Err(KclError::Semantic(KclErrorDetails {
|
||||
message: format!("Not a function: {:?}", expression),
|
||||
source_ranges: vec![],
|
||||
}))
|
||||
}
|
||||
} else {
|
||||
Err(KclError::Semantic(KclErrorDetails {
|
||||
let MemoryItem::Function { func, expression, meta } = &self else {
|
||||
return Err(KclError::Semantic(KclErrorDetails {
|
||||
message: "not a in memory function".to_string(),
|
||||
source_ranges: vec![],
|
||||
}))
|
||||
}
|
||||
}));
|
||||
};
|
||||
let Some(func) = func else {
|
||||
return Err(KclError::Semantic(KclErrorDetails {
|
||||
message: format!("Not a function: {:?}", expression),
|
||||
source_ranges: vec![],
|
||||
}));
|
||||
};
|
||||
func(args, memory, expression.clone(), meta.clone(), ctx).await
|
||||
}
|
||||
}
|
||||
|
||||
@ -776,9 +778,11 @@ impl Default for PipeInfo {
|
||||
pub struct ExecutorContext {
|
||||
pub engine: EngineConnection,
|
||||
pub planes: DefaultPlanes,
|
||||
pub stdlib: Arc<StdLib>,
|
||||
}
|
||||
|
||||
/// Execute a AST's program.
|
||||
#[async_recursion(?Send)]
|
||||
pub async fn execute(
|
||||
program: crate::ast::types::Program,
|
||||
memory: &mut ProgramMemory,
|
||||
@ -791,7 +795,9 @@ pub async fn execute(
|
||||
for statement in &program.body {
|
||||
match statement {
|
||||
BodyItem::ExpressionStatement(expression_statement) => {
|
||||
if let Value::CallExpression(call_expr) = &expression_statement.expression {
|
||||
if let Value::PipeExpression(pipe_expr) = &expression_statement.expression {
|
||||
pipe_expr.get_result(memory, &mut pipe_info, ctx).await?;
|
||||
} else if let Value::CallExpression(call_expr) = &expression_statement.expression {
|
||||
let fn_name = call_expr.callee.name.to_string();
|
||||
let mut args: Vec<MemoryItem> = Vec::new();
|
||||
for arg in &call_expr.arguments {
|
||||
@ -826,24 +832,37 @@ pub async fn execute(
|
||||
}
|
||||
}
|
||||
let _show_fn = Box::new(crate::std::Show);
|
||||
if let Function::StdLib { func: _show_fn } = &call_expr.function {
|
||||
if options != BodyType::Root {
|
||||
return Err(KclError::Semantic(KclErrorDetails {
|
||||
message: "Cannot call show outside of a root".to_string(),
|
||||
source_ranges: vec![call_expr.into()],
|
||||
}));
|
||||
match ctx.stdlib.get_either(&call_expr.callee.name) {
|
||||
FunctionKind::Core(func) => {
|
||||
use crate::docs::StdLibFn;
|
||||
if func.name() == _show_fn.name() {
|
||||
if options != BodyType::Root {
|
||||
return Err(KclError::Semantic(KclErrorDetails {
|
||||
message: "Cannot call show outside of a root".to_string(),
|
||||
source_ranges: vec![call_expr.into()],
|
||||
}));
|
||||
}
|
||||
|
||||
memory.return_ = Some(ProgramReturn::Arguments(call_expr.arguments.clone()));
|
||||
}
|
||||
}
|
||||
FunctionKind::Std(func) => {
|
||||
let mut newmem = memory.clone();
|
||||
let result = execute(func.program().to_owned(), &mut newmem, BodyType::Block, ctx).await?;
|
||||
memory.return_ = result.return_;
|
||||
}
|
||||
FunctionKind::UserDefined => {
|
||||
if let Some(func) = memory.clone().root.get(&fn_name) {
|
||||
let result = func.call_fn(args.clone(), memory.clone(), ctx.clone()).await?;
|
||||
|
||||
memory.return_ = Some(ProgramReturn::Arguments(call_expr.arguments.clone()));
|
||||
} else if let Some(func) = memory.clone().root.get(&fn_name) {
|
||||
let result = func.call_fn(args.clone(), memory.clone(), ctx.clone()).await?;
|
||||
|
||||
memory.return_ = result;
|
||||
} else {
|
||||
return Err(KclError::Semantic(KclErrorDetails {
|
||||
message: format!("No such name {} defined", fn_name),
|
||||
source_ranges: vec![call_expr.into()],
|
||||
}));
|
||||
memory.return_ = result;
|
||||
} else {
|
||||
return Err(KclError::Semantic(KclErrorDetails {
|
||||
message: format!("No such name {} defined", fn_name),
|
||||
source_ranges: vec![call_expr.into()],
|
||||
}));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -889,9 +908,9 @@ pub async fn execute(
|
||||
// Add the arguments to the memory.
|
||||
for (index, param) in function_expression.params.iter().enumerate() {
|
||||
fn_memory.add(
|
||||
¶m.name,
|
||||
¶m.identifier.name,
|
||||
args.get(index).unwrap().clone(),
|
||||
param.into(),
|
||||
(¶m.identifier).into(),
|
||||
)?;
|
||||
}
|
||||
|
||||
@ -1011,7 +1030,11 @@ mod tests {
|
||||
let mut mem: ProgramMemory = Default::default();
|
||||
let engine = EngineConnection::new().await?;
|
||||
let planes = DefaultPlanes::new(&engine).await?;
|
||||
let ctx = ExecutorContext { engine, planes };
|
||||
let ctx = ExecutorContext {
|
||||
engine,
|
||||
planes,
|
||||
stdlib: Arc::new(StdLib::default()),
|
||||
};
|
||||
let memory = execute(program, &mut mem, BodyType::Root, &ctx).await?;
|
||||
|
||||
Ok(memory)
|
||||
|
@ -1,3 +1,7 @@
|
||||
//! Rust support for KCL (aka the KittyCAD Language).
|
||||
//!
|
||||
//! KCL is written in Rust. This crate contains the compiler tooling (e.g. parser, lexer, code generation),
|
||||
//! the standard library implementation, a LSP implementation, generator for the docs, and more.
|
||||
#![recursion_limit = "1024"]
|
||||
|
||||
pub mod ast;
|
||||
|
@ -1,36 +1,30 @@
|
||||
use winnow::{
|
||||
combinator::{alt, delimited, opt, peek, preceded, repeat, separated0, terminated},
|
||||
combinator::{alt, delimited, opt, peek, preceded, repeat, separated, terminated},
|
||||
dispatch,
|
||||
error::{ErrMode, StrContext, StrContextValue},
|
||||
prelude::*,
|
||||
token::{any, one_of},
|
||||
};
|
||||
|
||||
use super::{math::BinaryExpressionToken, PIPE_OPERATOR, PIPE_SUBSTITUTION_OPERATOR};
|
||||
use crate::{
|
||||
ast::types::{
|
||||
ArrayExpression, BinaryExpression, BinaryOperator, BinaryPart, BodyItem, CallExpression, CommentStyle,
|
||||
ExpressionStatement, FunctionExpression, Identifier, Literal, LiteralIdentifier, LiteralValue,
|
||||
MemberExpression, MemberObject, NonCodeMeta, NonCodeNode, NonCodeValue, ObjectExpression, ObjectProperty,
|
||||
PipeExpression, PipeSubstitution, Program, ReturnStatement, UnaryExpression, UnaryOperator, Value,
|
||||
Parameter, PipeExpression, PipeSubstitution, Program, ReturnStatement, UnaryExpression, UnaryOperator, Value,
|
||||
VariableDeclaration, VariableDeclarator, VariableKind,
|
||||
},
|
||||
errors::{KclError, KclErrorDetails},
|
||||
executor::SourceRange,
|
||||
parser::parser_impl::error::ContextError,
|
||||
std::StdLib,
|
||||
token::{Token, TokenType},
|
||||
};
|
||||
|
||||
use super::{math::BinaryExpressionToken, PIPE_OPERATOR, PIPE_SUBSTITUTION_OPERATOR};
|
||||
|
||||
mod error;
|
||||
|
||||
type PResult<O, E = error::ContextError> = winnow::prelude::PResult<O, E>;
|
||||
|
||||
lazy_static::lazy_static! {
|
||||
static ref STDLIB: StdLib = StdLib::new();
|
||||
}
|
||||
|
||||
type TokenSlice<'slice, 'input> = &'slice mut &'input [Token];
|
||||
|
||||
pub fn run_parser(i: TokenSlice) -> Result<Program, KclError> {
|
||||
@ -373,7 +367,7 @@ fn equals(i: TokenSlice) -> PResult<Token> {
|
||||
fn array(i: TokenSlice) -> PResult<ArrayExpression> {
|
||||
let start = open_bracket(i)?.start;
|
||||
ignore_whitespace(i);
|
||||
let elements = alt((integer_range, separated0(value, comma_sep)))
|
||||
let elements = alt((integer_range, separated(0.., value, comma_sep)))
|
||||
.context(expected(
|
||||
"array contents, either a numeric range (like 0..10) or a list of elements (like [1, 2, 3])",
|
||||
))
|
||||
@ -430,7 +424,7 @@ fn object_property(i: TokenSlice) -> PResult<ObjectProperty> {
|
||||
fn object(i: TokenSlice) -> PResult<ObjectExpression> {
|
||||
let start = open_brace(i)?.start;
|
||||
ignore_whitespace(i);
|
||||
let properties = separated0(object_property, comma_sep)
|
||||
let properties = separated(0.., object_property, comma_sep)
|
||||
.context(expected(
|
||||
"a comma-separated list of key-value pairs, e.g. 'height: 4, width: 3'",
|
||||
))
|
||||
@ -1209,35 +1203,71 @@ fn comma_sep(i: TokenSlice) -> PResult<()> {
|
||||
|
||||
/// Arguments are passed into a function.
|
||||
fn arguments(i: TokenSlice) -> PResult<Vec<Value>> {
|
||||
separated0(value, comma_sep)
|
||||
separated(0.., value, comma_sep)
|
||||
.context(expected("function arguments"))
|
||||
.parse_next(i)
|
||||
}
|
||||
|
||||
fn not_close_paren(i: TokenSlice) -> PResult<Token> {
|
||||
fn required_param(i: TokenSlice) -> PResult<Token> {
|
||||
any.verify(|token: &Token| !matches!(token.token_type, TokenType::Brace) || token.value != ")")
|
||||
.parse_next(i)
|
||||
}
|
||||
|
||||
fn optional_param(i: TokenSlice) -> PResult<Token> {
|
||||
let token = required_param.parse_next(i)?;
|
||||
let _question_mark = one_of(TokenType::QuestionMark).parse_next(i)?;
|
||||
Ok(token)
|
||||
}
|
||||
|
||||
/// Parameters are declared in a function signature, and used within a function.
|
||||
fn parameters(i: TokenSlice) -> PResult<Vec<Identifier>> {
|
||||
fn parameters(i: TokenSlice) -> PResult<Vec<Parameter>> {
|
||||
// Get all tokens until the next ), because that ends the parameter list.
|
||||
let candidates: Vec<Token> = separated0(not_close_paren, comma_sep)
|
||||
.context(expected("function parameters"))
|
||||
.parse_next(i)?;
|
||||
let candidates: Vec<_> = separated(
|
||||
0..,
|
||||
alt((optional_param.map(|t| (t, true)), required_param.map(|t| (t, false)))),
|
||||
comma_sep,
|
||||
)
|
||||
.context(expected("function parameters"))
|
||||
.parse_next(i)?;
|
||||
|
||||
// Make sure all those tokens are valid parameters.
|
||||
let params = candidates
|
||||
let params: Vec<Parameter> = candidates
|
||||
.into_iter()
|
||||
.map(|token| Identifier::try_from(token).and_then(Identifier::into_valid_binding_name))
|
||||
.map(|(token, optional)| {
|
||||
let identifier = Identifier::try_from(token).and_then(Identifier::into_valid_binding_name)?;
|
||||
Ok(Parameter { identifier, optional })
|
||||
})
|
||||
.collect::<Result<_, _>>()
|
||||
.map_err(|e| ErrMode::Backtrack(ContextError::from(e)))?;
|
||||
.map_err(|e: KclError| ErrMode::Backtrack(ContextError::from(e)))?;
|
||||
|
||||
// Make sure optional parameters are last.
|
||||
if let Err(e) = optional_after_required(¶ms) {
|
||||
return Err(ErrMode::Cut(ContextError::from(e)));
|
||||
}
|
||||
Ok(params)
|
||||
}
|
||||
|
||||
fn optional_after_required(params: &[Parameter]) -> Result<(), KclError> {
|
||||
let mut found_optional = false;
|
||||
for p in params {
|
||||
if p.optional {
|
||||
found_optional = true;
|
||||
}
|
||||
if !p.optional && found_optional {
|
||||
let e = KclError::Syntax(KclErrorDetails {
|
||||
source_ranges: vec![(&p.identifier).into()],
|
||||
message: "mandatory parameters must be declared before optional parameters".to_owned(),
|
||||
});
|
||||
return Err(e);
|
||||
}
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
||||
impl Identifier {
|
||||
fn into_valid_binding_name(self) -> Result<Identifier, KclError> {
|
||||
// Make sure they are not assigning a variable to a stdlib function.
|
||||
if STDLIB.fns.contains_key(&self.name) {
|
||||
if crate::std::name_in_stdlib(&self.name) {
|
||||
return Err(KclError::Syntax(KclErrorDetails {
|
||||
source_ranges: vec![SourceRange([self.start, self.end])],
|
||||
message: format!("Cannot assign a variable to a reserved keyword: {}", self.name),
|
||||
@ -1261,18 +1291,12 @@ fn fn_call(i: TokenSlice) -> PResult<CallExpression> {
|
||||
let _ = terminated(open_paren, opt(whitespace)).parse_next(i)?;
|
||||
let args = arguments(i)?;
|
||||
let end = preceded(opt(whitespace), close_paren).parse_next(i)?.end;
|
||||
let function = if let Some(stdlib_fn) = STDLIB.get(&fn_name.name) {
|
||||
crate::ast::types::Function::StdLib { func: stdlib_fn }
|
||||
} else {
|
||||
crate::ast::types::Function::InMemory
|
||||
};
|
||||
Ok(CallExpression {
|
||||
start: fn_name.start,
|
||||
end,
|
||||
callee: fn_name,
|
||||
arguments: args,
|
||||
optional: false,
|
||||
function,
|
||||
})
|
||||
}
|
||||
|
||||
@ -1400,7 +1424,7 @@ const mySk1 = startSketchAt([0, 0])"#;
|
||||
let Value::PipeExpression(pipe) = val else {
|
||||
panic!("expected pipe");
|
||||
};
|
||||
let mut noncode = dbg!(pipe.non_code_meta);
|
||||
let mut noncode = pipe.non_code_meta;
|
||||
assert_eq!(noncode.non_code_nodes.len(), 1);
|
||||
let comment = noncode.non_code_nodes.remove(&0).unwrap().pop().unwrap();
|
||||
assert_eq!(
|
||||
@ -1907,7 +1931,7 @@ const mySk1 = startSketchAt([0, 0])"#;
|
||||
let tokens = crate::token::lexer(input);
|
||||
let actual = parameters.parse(&tokens);
|
||||
assert!(actual.is_ok(), "could not parse test {i}");
|
||||
let actual_ids: Vec<_> = actual.unwrap().into_iter().map(|id| id.name).collect();
|
||||
let actual_ids: Vec<_> = actual.unwrap().into_iter().map(|p| p.identifier.name).collect();
|
||||
assert_eq!(actual_ids, expected);
|
||||
}
|
||||
}
|
||||
@ -2334,6 +2358,82 @@ e
|
||||
assert!(result.err().unwrap().to_string().contains("Unexpected token"));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_optional_param_order() {
|
||||
for (i, (params, expect_ok)) in [
|
||||
(
|
||||
vec![Parameter {
|
||||
identifier: Identifier {
|
||||
start: 0,
|
||||
end: 0,
|
||||
name: "a".to_owned(),
|
||||
},
|
||||
optional: true,
|
||||
}],
|
||||
true,
|
||||
),
|
||||
(
|
||||
vec![Parameter {
|
||||
identifier: Identifier {
|
||||
start: 0,
|
||||
end: 0,
|
||||
name: "a".to_owned(),
|
||||
},
|
||||
optional: false,
|
||||
}],
|
||||
true,
|
||||
),
|
||||
(
|
||||
vec![
|
||||
Parameter {
|
||||
identifier: Identifier {
|
||||
start: 0,
|
||||
end: 0,
|
||||
name: "a".to_owned(),
|
||||
},
|
||||
optional: false,
|
||||
},
|
||||
Parameter {
|
||||
identifier: Identifier {
|
||||
start: 0,
|
||||
end: 0,
|
||||
name: "b".to_owned(),
|
||||
},
|
||||
optional: true,
|
||||
},
|
||||
],
|
||||
true,
|
||||
),
|
||||
(
|
||||
vec![
|
||||
Parameter {
|
||||
identifier: Identifier {
|
||||
start: 0,
|
||||
end: 0,
|
||||
name: "a".to_owned(),
|
||||
},
|
||||
optional: true,
|
||||
},
|
||||
Parameter {
|
||||
identifier: Identifier {
|
||||
start: 0,
|
||||
end: 0,
|
||||
name: "b".to_owned(),
|
||||
},
|
||||
optional: false,
|
||||
},
|
||||
],
|
||||
false,
|
||||
),
|
||||
]
|
||||
.into_iter()
|
||||
.enumerate()
|
||||
{
|
||||
let actual = optional_after_required(¶ms);
|
||||
assert_eq!(actual.is_ok(), expect_ok, "failed test {i}");
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_parse_expand_array() {
|
||||
let code = "const myArray = [0..10]";
|
||||
@ -2587,8 +2687,7 @@ thing(false)
|
||||
let tokens = crate::token::lexer(test_program);
|
||||
let parser = crate::parser::Parser::new(tokens);
|
||||
let result = parser.ast();
|
||||
let e = result.unwrap_err();
|
||||
eprintln!("{e:?}")
|
||||
let _e = result.unwrap_err();
|
||||
}
|
||||
|
||||
#[test]
|
||||
@ -2813,4 +2912,6 @@ mod snapshot_tests {
|
||||
snapshot_test!(aq, "log(5, \"hello\", aIdentifier)");
|
||||
snapshot_test!(ar, r#"5 + "a""#);
|
||||
snapshot_test!(at, "line([0, l], %)");
|
||||
snapshot_test!(au, include_str!("../../../tests/executor/inputs/cylinder.kcl"));
|
||||
snapshot_test!(av, "fn f = (angle?) => { return default(angle, 360) }");
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -74,942 +74,7 @@ expression: actual
|
||||
]
|
||||
}
|
||||
],
|
||||
"optional": false,
|
||||
"function": {
|
||||
"type": "StdLib",
|
||||
"func": {
|
||||
"name": "lineTo",
|
||||
"summary": "Draw a line to a point.",
|
||||
"description": "",
|
||||
"tags": [],
|
||||
"args": [
|
||||
{
|
||||
"name": "data",
|
||||
"type": "LineToData",
|
||||
"schema": {
|
||||
"description": "Data to draw a line to a point.",
|
||||
"anyOf": [
|
||||
{
|
||||
"description": "A point with a tag.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"tag",
|
||||
"to"
|
||||
],
|
||||
"properties": {
|
||||
"tag": {
|
||||
"description": "The tag.",
|
||||
"type": "string"
|
||||
},
|
||||
"to": {
|
||||
"description": "The to point.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"description": "A point.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
}
|
||||
]
|
||||
},
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"name": "sketch_group",
|
||||
"type": "SketchGroup",
|
||||
"schema": {
|
||||
"description": "A sketch group is a collection of paths.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"__meta",
|
||||
"id",
|
||||
"position",
|
||||
"rotation",
|
||||
"start",
|
||||
"value"
|
||||
],
|
||||
"properties": {
|
||||
"__meta": {
|
||||
"description": "Metadata.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"description": "Metadata.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"sourceRange"
|
||||
],
|
||||
"properties": {
|
||||
"sourceRange": {
|
||||
"description": "The source range.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "integer",
|
||||
"format": "uint",
|
||||
"minimum": 0.0
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"id": {
|
||||
"description": "The id of the sketch group.",
|
||||
"type": "string",
|
||||
"format": "uuid"
|
||||
},
|
||||
"planeId": {
|
||||
"description": "The plane id of the sketch group.",
|
||||
"type": "string",
|
||||
"format": "uuid",
|
||||
"nullable": true
|
||||
},
|
||||
"position": {
|
||||
"description": "The position of the sketch group.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 3,
|
||||
"minItems": 3
|
||||
},
|
||||
"rotation": {
|
||||
"description": "The rotation of the sketch group.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 4,
|
||||
"minItems": 4
|
||||
},
|
||||
"start": {
|
||||
"description": "The starting path.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"__geoMeta",
|
||||
"from",
|
||||
"name",
|
||||
"to"
|
||||
],
|
||||
"properties": {
|
||||
"__geoMeta": {
|
||||
"description": "Metadata.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"id",
|
||||
"sourceRange"
|
||||
],
|
||||
"properties": {
|
||||
"id": {
|
||||
"description": "The id of the geometry.",
|
||||
"type": "string",
|
||||
"format": "uuid"
|
||||
},
|
||||
"sourceRange": {
|
||||
"description": "The source range.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "integer",
|
||||
"format": "uint",
|
||||
"minimum": 0.0
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
}
|
||||
}
|
||||
},
|
||||
"from": {
|
||||
"description": "The from point.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
},
|
||||
"name": {
|
||||
"description": "The name of the path.",
|
||||
"type": "string"
|
||||
},
|
||||
"to": {
|
||||
"description": "The to point.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
}
|
||||
}
|
||||
},
|
||||
"value": {
|
||||
"description": "The paths in the sketch group.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"description": "A path.",
|
||||
"oneOf": [
|
||||
{
|
||||
"description": "A path that goes to a point.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"__geoMeta",
|
||||
"from",
|
||||
"name",
|
||||
"to",
|
||||
"type"
|
||||
],
|
||||
"properties": {
|
||||
"__geoMeta": {
|
||||
"description": "Metadata.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"id",
|
||||
"sourceRange"
|
||||
],
|
||||
"properties": {
|
||||
"id": {
|
||||
"description": "The id of the geometry.",
|
||||
"type": "string",
|
||||
"format": "uuid"
|
||||
},
|
||||
"sourceRange": {
|
||||
"description": "The source range.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "integer",
|
||||
"format": "uint",
|
||||
"minimum": 0.0
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
}
|
||||
}
|
||||
},
|
||||
"from": {
|
||||
"description": "The from point.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
},
|
||||
"name": {
|
||||
"description": "The name of the path.",
|
||||
"type": "string"
|
||||
},
|
||||
"to": {
|
||||
"description": "The to point.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
},
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"toPoint"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"description": "A path that is horizontal.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"__geoMeta",
|
||||
"from",
|
||||
"name",
|
||||
"to",
|
||||
"type",
|
||||
"x"
|
||||
],
|
||||
"properties": {
|
||||
"__geoMeta": {
|
||||
"description": "Metadata.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"id",
|
||||
"sourceRange"
|
||||
],
|
||||
"properties": {
|
||||
"id": {
|
||||
"description": "The id of the geometry.",
|
||||
"type": "string",
|
||||
"format": "uuid"
|
||||
},
|
||||
"sourceRange": {
|
||||
"description": "The source range.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "integer",
|
||||
"format": "uint",
|
||||
"minimum": 0.0
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
}
|
||||
}
|
||||
},
|
||||
"from": {
|
||||
"description": "The from point.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
},
|
||||
"name": {
|
||||
"description": "The name of the path.",
|
||||
"type": "string"
|
||||
},
|
||||
"to": {
|
||||
"description": "The to point.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
},
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"horizontal"
|
||||
]
|
||||
},
|
||||
"x": {
|
||||
"description": "The x coordinate.",
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"description": "An angled line to.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"__geoMeta",
|
||||
"from",
|
||||
"name",
|
||||
"to",
|
||||
"type"
|
||||
],
|
||||
"properties": {
|
||||
"__geoMeta": {
|
||||
"description": "Metadata.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"id",
|
||||
"sourceRange"
|
||||
],
|
||||
"properties": {
|
||||
"id": {
|
||||
"description": "The id of the geometry.",
|
||||
"type": "string",
|
||||
"format": "uuid"
|
||||
},
|
||||
"sourceRange": {
|
||||
"description": "The source range.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "integer",
|
||||
"format": "uint",
|
||||
"minimum": 0.0
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
}
|
||||
}
|
||||
},
|
||||
"from": {
|
||||
"description": "The from point.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
},
|
||||
"name": {
|
||||
"description": "The name of the path.",
|
||||
"type": "string"
|
||||
},
|
||||
"to": {
|
||||
"description": "The to point.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
},
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"angledLineTo"
|
||||
]
|
||||
},
|
||||
"x": {
|
||||
"description": "The x coordinate.",
|
||||
"type": "number",
|
||||
"format": "double",
|
||||
"nullable": true
|
||||
},
|
||||
"y": {
|
||||
"description": "The y coordinate.",
|
||||
"type": "number",
|
||||
"format": "double",
|
||||
"nullable": true
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"description": "A base path.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"__geoMeta",
|
||||
"from",
|
||||
"name",
|
||||
"to",
|
||||
"type"
|
||||
],
|
||||
"properties": {
|
||||
"__geoMeta": {
|
||||
"description": "Metadata.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"id",
|
||||
"sourceRange"
|
||||
],
|
||||
"properties": {
|
||||
"id": {
|
||||
"description": "The id of the geometry.",
|
||||
"type": "string",
|
||||
"format": "uuid"
|
||||
},
|
||||
"sourceRange": {
|
||||
"description": "The source range.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "integer",
|
||||
"format": "uint",
|
||||
"minimum": 0.0
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
}
|
||||
}
|
||||
},
|
||||
"from": {
|
||||
"description": "The from point.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
},
|
||||
"name": {
|
||||
"description": "The name of the path.",
|
||||
"type": "string"
|
||||
},
|
||||
"to": {
|
||||
"description": "The to point.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
},
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"base"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": true
|
||||
}
|
||||
],
|
||||
"returnValue": {
|
||||
"name": "",
|
||||
"type": "SketchGroup",
|
||||
"schema": {
|
||||
"description": "A sketch group is a collection of paths.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"__meta",
|
||||
"id",
|
||||
"position",
|
||||
"rotation",
|
||||
"start",
|
||||
"value"
|
||||
],
|
||||
"properties": {
|
||||
"__meta": {
|
||||
"description": "Metadata.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"description": "Metadata.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"sourceRange"
|
||||
],
|
||||
"properties": {
|
||||
"sourceRange": {
|
||||
"description": "The source range.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "integer",
|
||||
"format": "uint",
|
||||
"minimum": 0.0
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"id": {
|
||||
"description": "The id of the sketch group.",
|
||||
"type": "string",
|
||||
"format": "uuid"
|
||||
},
|
||||
"planeId": {
|
||||
"description": "The plane id of the sketch group.",
|
||||
"type": "string",
|
||||
"format": "uuid",
|
||||
"nullable": true
|
||||
},
|
||||
"position": {
|
||||
"description": "The position of the sketch group.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 3,
|
||||
"minItems": 3
|
||||
},
|
||||
"rotation": {
|
||||
"description": "The rotation of the sketch group.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 4,
|
||||
"minItems": 4
|
||||
},
|
||||
"start": {
|
||||
"description": "The starting path.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"__geoMeta",
|
||||
"from",
|
||||
"name",
|
||||
"to"
|
||||
],
|
||||
"properties": {
|
||||
"__geoMeta": {
|
||||
"description": "Metadata.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"id",
|
||||
"sourceRange"
|
||||
],
|
||||
"properties": {
|
||||
"id": {
|
||||
"description": "The id of the geometry.",
|
||||
"type": "string",
|
||||
"format": "uuid"
|
||||
},
|
||||
"sourceRange": {
|
||||
"description": "The source range.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "integer",
|
||||
"format": "uint",
|
||||
"minimum": 0.0
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
}
|
||||
}
|
||||
},
|
||||
"from": {
|
||||
"description": "The from point.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
},
|
||||
"name": {
|
||||
"description": "The name of the path.",
|
||||
"type": "string"
|
||||
},
|
||||
"to": {
|
||||
"description": "The to point.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
}
|
||||
}
|
||||
},
|
||||
"value": {
|
||||
"description": "The paths in the sketch group.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"description": "A path.",
|
||||
"oneOf": [
|
||||
{
|
||||
"description": "A path that goes to a point.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"__geoMeta",
|
||||
"from",
|
||||
"name",
|
||||
"to",
|
||||
"type"
|
||||
],
|
||||
"properties": {
|
||||
"__geoMeta": {
|
||||
"description": "Metadata.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"id",
|
||||
"sourceRange"
|
||||
],
|
||||
"properties": {
|
||||
"id": {
|
||||
"description": "The id of the geometry.",
|
||||
"type": "string",
|
||||
"format": "uuid"
|
||||
},
|
||||
"sourceRange": {
|
||||
"description": "The source range.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "integer",
|
||||
"format": "uint",
|
||||
"minimum": 0.0
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
}
|
||||
}
|
||||
},
|
||||
"from": {
|
||||
"description": "The from point.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
},
|
||||
"name": {
|
||||
"description": "The name of the path.",
|
||||
"type": "string"
|
||||
},
|
||||
"to": {
|
||||
"description": "The to point.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
},
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"toPoint"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"description": "A path that is horizontal.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"__geoMeta",
|
||||
"from",
|
||||
"name",
|
||||
"to",
|
||||
"type",
|
||||
"x"
|
||||
],
|
||||
"properties": {
|
||||
"__geoMeta": {
|
||||
"description": "Metadata.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"id",
|
||||
"sourceRange"
|
||||
],
|
||||
"properties": {
|
||||
"id": {
|
||||
"description": "The id of the geometry.",
|
||||
"type": "string",
|
||||
"format": "uuid"
|
||||
},
|
||||
"sourceRange": {
|
||||
"description": "The source range.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "integer",
|
||||
"format": "uint",
|
||||
"minimum": 0.0
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
}
|
||||
}
|
||||
},
|
||||
"from": {
|
||||
"description": "The from point.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
},
|
||||
"name": {
|
||||
"description": "The name of the path.",
|
||||
"type": "string"
|
||||
},
|
||||
"to": {
|
||||
"description": "The to point.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
},
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"horizontal"
|
||||
]
|
||||
},
|
||||
"x": {
|
||||
"description": "The x coordinate.",
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"description": "An angled line to.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"__geoMeta",
|
||||
"from",
|
||||
"name",
|
||||
"to",
|
||||
"type"
|
||||
],
|
||||
"properties": {
|
||||
"__geoMeta": {
|
||||
"description": "Metadata.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"id",
|
||||
"sourceRange"
|
||||
],
|
||||
"properties": {
|
||||
"id": {
|
||||
"description": "The id of the geometry.",
|
||||
"type": "string",
|
||||
"format": "uuid"
|
||||
},
|
||||
"sourceRange": {
|
||||
"description": "The source range.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "integer",
|
||||
"format": "uint",
|
||||
"minimum": 0.0
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
}
|
||||
}
|
||||
},
|
||||
"from": {
|
||||
"description": "The from point.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
},
|
||||
"name": {
|
||||
"description": "The name of the path.",
|
||||
"type": "string"
|
||||
},
|
||||
"to": {
|
||||
"description": "The to point.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
},
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"angledLineTo"
|
||||
]
|
||||
},
|
||||
"x": {
|
||||
"description": "The x coordinate.",
|
||||
"type": "number",
|
||||
"format": "double",
|
||||
"nullable": true
|
||||
},
|
||||
"y": {
|
||||
"description": "The y coordinate.",
|
||||
"type": "number",
|
||||
"format": "double",
|
||||
"nullable": true
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"description": "A base path.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"__geoMeta",
|
||||
"from",
|
||||
"name",
|
||||
"to",
|
||||
"type"
|
||||
],
|
||||
"properties": {
|
||||
"__geoMeta": {
|
||||
"description": "Metadata.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"id",
|
||||
"sourceRange"
|
||||
],
|
||||
"properties": {
|
||||
"id": {
|
||||
"description": "The id of the geometry.",
|
||||
"type": "string",
|
||||
"format": "uuid"
|
||||
},
|
||||
"sourceRange": {
|
||||
"description": "The source range.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "integer",
|
||||
"format": "uint",
|
||||
"minimum": 0.0
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
}
|
||||
}
|
||||
},
|
||||
"from": {
|
||||
"description": "The from point.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
},
|
||||
"name": {
|
||||
"description": "The name of the path.",
|
||||
"type": "string"
|
||||
},
|
||||
"to": {
|
||||
"description": "The to point.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
},
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"base"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": true
|
||||
},
|
||||
"unpublished": false,
|
||||
"deprecated": false
|
||||
}
|
||||
}
|
||||
"optional": false
|
||||
}
|
||||
}
|
||||
],
|
||||
|
@ -74,10 +74,7 @@ expression: actual
|
||||
"name": "firstPrimeNumber"
|
||||
},
|
||||
"arguments": [],
|
||||
"optional": false,
|
||||
"function": {
|
||||
"type": "InMemory"
|
||||
}
|
||||
"optional": false
|
||||
}
|
||||
}
|
||||
],
|
||||
|
@ -29,10 +29,13 @@ expression: actual
|
||||
"end": 49,
|
||||
"params": [
|
||||
{
|
||||
"type": "Identifier",
|
||||
"start": 12,
|
||||
"end": 17,
|
||||
"name": "param"
|
||||
"identifier": {
|
||||
"type": "Identifier",
|
||||
"start": 12,
|
||||
"end": 17,
|
||||
"name": "param"
|
||||
},
|
||||
"optional": false
|
||||
}
|
||||
],
|
||||
"body": {
|
||||
@ -88,10 +91,7 @@ expression: actual
|
||||
"name": "false"
|
||||
}
|
||||
],
|
||||
"optional": false,
|
||||
"function": {
|
||||
"type": "InMemory"
|
||||
}
|
||||
"optional": false
|
||||
}
|
||||
}
|
||||
],
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -42,503 +42,7 @@ expression: actual
|
||||
"name": "p"
|
||||
}
|
||||
],
|
||||
"optional": false,
|
||||
"function": {
|
||||
"type": "StdLib",
|
||||
"func": {
|
||||
"name": "startSketchAt",
|
||||
"summary": "Start a sketch at a given point on the 'XY' plane.",
|
||||
"description": "",
|
||||
"tags": [],
|
||||
"args": [
|
||||
{
|
||||
"name": "data",
|
||||
"type": "LineData",
|
||||
"schema": {
|
||||
"description": "Data to draw a line.",
|
||||
"anyOf": [
|
||||
{
|
||||
"description": "A point with a tag.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"tag",
|
||||
"to"
|
||||
],
|
||||
"properties": {
|
||||
"tag": {
|
||||
"description": "The tag.",
|
||||
"type": "string"
|
||||
},
|
||||
"to": {
|
||||
"description": "The to point.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"description": "A point.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
}
|
||||
]
|
||||
},
|
||||
"required": true
|
||||
}
|
||||
],
|
||||
"returnValue": {
|
||||
"name": "",
|
||||
"type": "SketchGroup",
|
||||
"schema": {
|
||||
"description": "A sketch group is a collection of paths.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"__meta",
|
||||
"id",
|
||||
"position",
|
||||
"rotation",
|
||||
"start",
|
||||
"value"
|
||||
],
|
||||
"properties": {
|
||||
"__meta": {
|
||||
"description": "Metadata.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"description": "Metadata.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"sourceRange"
|
||||
],
|
||||
"properties": {
|
||||
"sourceRange": {
|
||||
"description": "The source range.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "integer",
|
||||
"format": "uint",
|
||||
"minimum": 0.0
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"id": {
|
||||
"description": "The id of the sketch group.",
|
||||
"type": "string",
|
||||
"format": "uuid"
|
||||
},
|
||||
"planeId": {
|
||||
"description": "The plane id of the sketch group.",
|
||||
"type": "string",
|
||||
"format": "uuid",
|
||||
"nullable": true
|
||||
},
|
||||
"position": {
|
||||
"description": "The position of the sketch group.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 3,
|
||||
"minItems": 3
|
||||
},
|
||||
"rotation": {
|
||||
"description": "The rotation of the sketch group.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 4,
|
||||
"minItems": 4
|
||||
},
|
||||
"start": {
|
||||
"description": "The starting path.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"__geoMeta",
|
||||
"from",
|
||||
"name",
|
||||
"to"
|
||||
],
|
||||
"properties": {
|
||||
"__geoMeta": {
|
||||
"description": "Metadata.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"id",
|
||||
"sourceRange"
|
||||
],
|
||||
"properties": {
|
||||
"id": {
|
||||
"description": "The id of the geometry.",
|
||||
"type": "string",
|
||||
"format": "uuid"
|
||||
},
|
||||
"sourceRange": {
|
||||
"description": "The source range.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "integer",
|
||||
"format": "uint",
|
||||
"minimum": 0.0
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
}
|
||||
}
|
||||
},
|
||||
"from": {
|
||||
"description": "The from point.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
},
|
||||
"name": {
|
||||
"description": "The name of the path.",
|
||||
"type": "string"
|
||||
},
|
||||
"to": {
|
||||
"description": "The to point.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
}
|
||||
}
|
||||
},
|
||||
"value": {
|
||||
"description": "The paths in the sketch group.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"description": "A path.",
|
||||
"oneOf": [
|
||||
{
|
||||
"description": "A path that goes to a point.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"__geoMeta",
|
||||
"from",
|
||||
"name",
|
||||
"to",
|
||||
"type"
|
||||
],
|
||||
"properties": {
|
||||
"__geoMeta": {
|
||||
"description": "Metadata.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"id",
|
||||
"sourceRange"
|
||||
],
|
||||
"properties": {
|
||||
"id": {
|
||||
"description": "The id of the geometry.",
|
||||
"type": "string",
|
||||
"format": "uuid"
|
||||
},
|
||||
"sourceRange": {
|
||||
"description": "The source range.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "integer",
|
||||
"format": "uint",
|
||||
"minimum": 0.0
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
}
|
||||
}
|
||||
},
|
||||
"from": {
|
||||
"description": "The from point.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
},
|
||||
"name": {
|
||||
"description": "The name of the path.",
|
||||
"type": "string"
|
||||
},
|
||||
"to": {
|
||||
"description": "The to point.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
},
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"toPoint"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"description": "A path that is horizontal.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"__geoMeta",
|
||||
"from",
|
||||
"name",
|
||||
"to",
|
||||
"type",
|
||||
"x"
|
||||
],
|
||||
"properties": {
|
||||
"__geoMeta": {
|
||||
"description": "Metadata.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"id",
|
||||
"sourceRange"
|
||||
],
|
||||
"properties": {
|
||||
"id": {
|
||||
"description": "The id of the geometry.",
|
||||
"type": "string",
|
||||
"format": "uuid"
|
||||
},
|
||||
"sourceRange": {
|
||||
"description": "The source range.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "integer",
|
||||
"format": "uint",
|
||||
"minimum": 0.0
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
}
|
||||
}
|
||||
},
|
||||
"from": {
|
||||
"description": "The from point.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
},
|
||||
"name": {
|
||||
"description": "The name of the path.",
|
||||
"type": "string"
|
||||
},
|
||||
"to": {
|
||||
"description": "The to point.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
},
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"horizontal"
|
||||
]
|
||||
},
|
||||
"x": {
|
||||
"description": "The x coordinate.",
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"description": "An angled line to.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"__geoMeta",
|
||||
"from",
|
||||
"name",
|
||||
"to",
|
||||
"type"
|
||||
],
|
||||
"properties": {
|
||||
"__geoMeta": {
|
||||
"description": "Metadata.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"id",
|
||||
"sourceRange"
|
||||
],
|
||||
"properties": {
|
||||
"id": {
|
||||
"description": "The id of the geometry.",
|
||||
"type": "string",
|
||||
"format": "uuid"
|
||||
},
|
||||
"sourceRange": {
|
||||
"description": "The source range.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "integer",
|
||||
"format": "uint",
|
||||
"minimum": 0.0
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
}
|
||||
}
|
||||
},
|
||||
"from": {
|
||||
"description": "The from point.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
},
|
||||
"name": {
|
||||
"description": "The name of the path.",
|
||||
"type": "string"
|
||||
},
|
||||
"to": {
|
||||
"description": "The to point.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
},
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"angledLineTo"
|
||||
]
|
||||
},
|
||||
"x": {
|
||||
"description": "The x coordinate.",
|
||||
"type": "number",
|
||||
"format": "double",
|
||||
"nullable": true
|
||||
},
|
||||
"y": {
|
||||
"description": "The y coordinate.",
|
||||
"type": "number",
|
||||
"format": "double",
|
||||
"nullable": true
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"description": "A base path.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"__geoMeta",
|
||||
"from",
|
||||
"name",
|
||||
"to",
|
||||
"type"
|
||||
],
|
||||
"properties": {
|
||||
"__geoMeta": {
|
||||
"description": "Metadata.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"id",
|
||||
"sourceRange"
|
||||
],
|
||||
"properties": {
|
||||
"id": {
|
||||
"description": "The id of the geometry.",
|
||||
"type": "string",
|
||||
"format": "uuid"
|
||||
},
|
||||
"sourceRange": {
|
||||
"description": "The source range.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "integer",
|
||||
"format": "uint",
|
||||
"minimum": 0.0
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
}
|
||||
}
|
||||
},
|
||||
"from": {
|
||||
"description": "The from point.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
},
|
||||
"name": {
|
||||
"description": "The name of the path.",
|
||||
"type": "string"
|
||||
},
|
||||
"to": {
|
||||
"description": "The to point.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
},
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"base"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": true
|
||||
},
|
||||
"unpublished": false,
|
||||
"deprecated": false
|
||||
}
|
||||
}
|
||||
"optional": false
|
||||
}
|
||||
}
|
||||
],
|
||||
|
@ -49,10 +49,7 @@ expression: actual
|
||||
"raw": "1"
|
||||
}
|
||||
],
|
||||
"optional": false,
|
||||
"function": {
|
||||
"type": "InMemory"
|
||||
}
|
||||
"optional": false
|
||||
},
|
||||
{
|
||||
"type": "CallExpression",
|
||||
@ -75,10 +72,7 @@ expression: actual
|
||||
"raw": "2"
|
||||
}
|
||||
],
|
||||
"optional": false,
|
||||
"function": {
|
||||
"type": "InMemory"
|
||||
}
|
||||
"optional": false
|
||||
}
|
||||
],
|
||||
"nonCodeMeta": {
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -67,942 +67,7 @@ expression: actual
|
||||
]
|
||||
}
|
||||
],
|
||||
"optional": false,
|
||||
"function": {
|
||||
"type": "StdLib",
|
||||
"func": {
|
||||
"name": "lineTo",
|
||||
"summary": "Draw a line to a point.",
|
||||
"description": "",
|
||||
"tags": [],
|
||||
"args": [
|
||||
{
|
||||
"name": "data",
|
||||
"type": "LineToData",
|
||||
"schema": {
|
||||
"description": "Data to draw a line to a point.",
|
||||
"anyOf": [
|
||||
{
|
||||
"description": "A point with a tag.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"tag",
|
||||
"to"
|
||||
],
|
||||
"properties": {
|
||||
"tag": {
|
||||
"description": "The tag.",
|
||||
"type": "string"
|
||||
},
|
||||
"to": {
|
||||
"description": "The to point.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"description": "A point.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
}
|
||||
]
|
||||
},
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"name": "sketch_group",
|
||||
"type": "SketchGroup",
|
||||
"schema": {
|
||||
"description": "A sketch group is a collection of paths.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"__meta",
|
||||
"id",
|
||||
"position",
|
||||
"rotation",
|
||||
"start",
|
||||
"value"
|
||||
],
|
||||
"properties": {
|
||||
"__meta": {
|
||||
"description": "Metadata.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"description": "Metadata.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"sourceRange"
|
||||
],
|
||||
"properties": {
|
||||
"sourceRange": {
|
||||
"description": "The source range.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "integer",
|
||||
"format": "uint",
|
||||
"minimum": 0.0
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"id": {
|
||||
"description": "The id of the sketch group.",
|
||||
"type": "string",
|
||||
"format": "uuid"
|
||||
},
|
||||
"planeId": {
|
||||
"description": "The plane id of the sketch group.",
|
||||
"type": "string",
|
||||
"format": "uuid",
|
||||
"nullable": true
|
||||
},
|
||||
"position": {
|
||||
"description": "The position of the sketch group.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 3,
|
||||
"minItems": 3
|
||||
},
|
||||
"rotation": {
|
||||
"description": "The rotation of the sketch group.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 4,
|
||||
"minItems": 4
|
||||
},
|
||||
"start": {
|
||||
"description": "The starting path.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"__geoMeta",
|
||||
"from",
|
||||
"name",
|
||||
"to"
|
||||
],
|
||||
"properties": {
|
||||
"__geoMeta": {
|
||||
"description": "Metadata.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"id",
|
||||
"sourceRange"
|
||||
],
|
||||
"properties": {
|
||||
"id": {
|
||||
"description": "The id of the geometry.",
|
||||
"type": "string",
|
||||
"format": "uuid"
|
||||
},
|
||||
"sourceRange": {
|
||||
"description": "The source range.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "integer",
|
||||
"format": "uint",
|
||||
"minimum": 0.0
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
}
|
||||
}
|
||||
},
|
||||
"from": {
|
||||
"description": "The from point.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
},
|
||||
"name": {
|
||||
"description": "The name of the path.",
|
||||
"type": "string"
|
||||
},
|
||||
"to": {
|
||||
"description": "The to point.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
}
|
||||
}
|
||||
},
|
||||
"value": {
|
||||
"description": "The paths in the sketch group.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"description": "A path.",
|
||||
"oneOf": [
|
||||
{
|
||||
"description": "A path that goes to a point.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"__geoMeta",
|
||||
"from",
|
||||
"name",
|
||||
"to",
|
||||
"type"
|
||||
],
|
||||
"properties": {
|
||||
"__geoMeta": {
|
||||
"description": "Metadata.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"id",
|
||||
"sourceRange"
|
||||
],
|
||||
"properties": {
|
||||
"id": {
|
||||
"description": "The id of the geometry.",
|
||||
"type": "string",
|
||||
"format": "uuid"
|
||||
},
|
||||
"sourceRange": {
|
||||
"description": "The source range.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "integer",
|
||||
"format": "uint",
|
||||
"minimum": 0.0
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
}
|
||||
}
|
||||
},
|
||||
"from": {
|
||||
"description": "The from point.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
},
|
||||
"name": {
|
||||
"description": "The name of the path.",
|
||||
"type": "string"
|
||||
},
|
||||
"to": {
|
||||
"description": "The to point.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
},
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"toPoint"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"description": "A path that is horizontal.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"__geoMeta",
|
||||
"from",
|
||||
"name",
|
||||
"to",
|
||||
"type",
|
||||
"x"
|
||||
],
|
||||
"properties": {
|
||||
"__geoMeta": {
|
||||
"description": "Metadata.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"id",
|
||||
"sourceRange"
|
||||
],
|
||||
"properties": {
|
||||
"id": {
|
||||
"description": "The id of the geometry.",
|
||||
"type": "string",
|
||||
"format": "uuid"
|
||||
},
|
||||
"sourceRange": {
|
||||
"description": "The source range.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "integer",
|
||||
"format": "uint",
|
||||
"minimum": 0.0
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
}
|
||||
}
|
||||
},
|
||||
"from": {
|
||||
"description": "The from point.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
},
|
||||
"name": {
|
||||
"description": "The name of the path.",
|
||||
"type": "string"
|
||||
},
|
||||
"to": {
|
||||
"description": "The to point.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
},
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"horizontal"
|
||||
]
|
||||
},
|
||||
"x": {
|
||||
"description": "The x coordinate.",
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"description": "An angled line to.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"__geoMeta",
|
||||
"from",
|
||||
"name",
|
||||
"to",
|
||||
"type"
|
||||
],
|
||||
"properties": {
|
||||
"__geoMeta": {
|
||||
"description": "Metadata.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"id",
|
||||
"sourceRange"
|
||||
],
|
||||
"properties": {
|
||||
"id": {
|
||||
"description": "The id of the geometry.",
|
||||
"type": "string",
|
||||
"format": "uuid"
|
||||
},
|
||||
"sourceRange": {
|
||||
"description": "The source range.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "integer",
|
||||
"format": "uint",
|
||||
"minimum": 0.0
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
}
|
||||
}
|
||||
},
|
||||
"from": {
|
||||
"description": "The from point.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
},
|
||||
"name": {
|
||||
"description": "The name of the path.",
|
||||
"type": "string"
|
||||
},
|
||||
"to": {
|
||||
"description": "The to point.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
},
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"angledLineTo"
|
||||
]
|
||||
},
|
||||
"x": {
|
||||
"description": "The x coordinate.",
|
||||
"type": "number",
|
||||
"format": "double",
|
||||
"nullable": true
|
||||
},
|
||||
"y": {
|
||||
"description": "The y coordinate.",
|
||||
"type": "number",
|
||||
"format": "double",
|
||||
"nullable": true
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"description": "A base path.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"__geoMeta",
|
||||
"from",
|
||||
"name",
|
||||
"to",
|
||||
"type"
|
||||
],
|
||||
"properties": {
|
||||
"__geoMeta": {
|
||||
"description": "Metadata.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"id",
|
||||
"sourceRange"
|
||||
],
|
||||
"properties": {
|
||||
"id": {
|
||||
"description": "The id of the geometry.",
|
||||
"type": "string",
|
||||
"format": "uuid"
|
||||
},
|
||||
"sourceRange": {
|
||||
"description": "The source range.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "integer",
|
||||
"format": "uint",
|
||||
"minimum": 0.0
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
}
|
||||
}
|
||||
},
|
||||
"from": {
|
||||
"description": "The from point.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
},
|
||||
"name": {
|
||||
"description": "The name of the path.",
|
||||
"type": "string"
|
||||
},
|
||||
"to": {
|
||||
"description": "The to point.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
},
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"base"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": true
|
||||
}
|
||||
],
|
||||
"returnValue": {
|
||||
"name": "",
|
||||
"type": "SketchGroup",
|
||||
"schema": {
|
||||
"description": "A sketch group is a collection of paths.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"__meta",
|
||||
"id",
|
||||
"position",
|
||||
"rotation",
|
||||
"start",
|
||||
"value"
|
||||
],
|
||||
"properties": {
|
||||
"__meta": {
|
||||
"description": "Metadata.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"description": "Metadata.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"sourceRange"
|
||||
],
|
||||
"properties": {
|
||||
"sourceRange": {
|
||||
"description": "The source range.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "integer",
|
||||
"format": "uint",
|
||||
"minimum": 0.0
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"id": {
|
||||
"description": "The id of the sketch group.",
|
||||
"type": "string",
|
||||
"format": "uuid"
|
||||
},
|
||||
"planeId": {
|
||||
"description": "The plane id of the sketch group.",
|
||||
"type": "string",
|
||||
"format": "uuid",
|
||||
"nullable": true
|
||||
},
|
||||
"position": {
|
||||
"description": "The position of the sketch group.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 3,
|
||||
"minItems": 3
|
||||
},
|
||||
"rotation": {
|
||||
"description": "The rotation of the sketch group.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 4,
|
||||
"minItems": 4
|
||||
},
|
||||
"start": {
|
||||
"description": "The starting path.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"__geoMeta",
|
||||
"from",
|
||||
"name",
|
||||
"to"
|
||||
],
|
||||
"properties": {
|
||||
"__geoMeta": {
|
||||
"description": "Metadata.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"id",
|
||||
"sourceRange"
|
||||
],
|
||||
"properties": {
|
||||
"id": {
|
||||
"description": "The id of the geometry.",
|
||||
"type": "string",
|
||||
"format": "uuid"
|
||||
},
|
||||
"sourceRange": {
|
||||
"description": "The source range.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "integer",
|
||||
"format": "uint",
|
||||
"minimum": 0.0
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
}
|
||||
}
|
||||
},
|
||||
"from": {
|
||||
"description": "The from point.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
},
|
||||
"name": {
|
||||
"description": "The name of the path.",
|
||||
"type": "string"
|
||||
},
|
||||
"to": {
|
||||
"description": "The to point.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
}
|
||||
}
|
||||
},
|
||||
"value": {
|
||||
"description": "The paths in the sketch group.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"description": "A path.",
|
||||
"oneOf": [
|
||||
{
|
||||
"description": "A path that goes to a point.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"__geoMeta",
|
||||
"from",
|
||||
"name",
|
||||
"to",
|
||||
"type"
|
||||
],
|
||||
"properties": {
|
||||
"__geoMeta": {
|
||||
"description": "Metadata.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"id",
|
||||
"sourceRange"
|
||||
],
|
||||
"properties": {
|
||||
"id": {
|
||||
"description": "The id of the geometry.",
|
||||
"type": "string",
|
||||
"format": "uuid"
|
||||
},
|
||||
"sourceRange": {
|
||||
"description": "The source range.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "integer",
|
||||
"format": "uint",
|
||||
"minimum": 0.0
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
}
|
||||
}
|
||||
},
|
||||
"from": {
|
||||
"description": "The from point.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
},
|
||||
"name": {
|
||||
"description": "The name of the path.",
|
||||
"type": "string"
|
||||
},
|
||||
"to": {
|
||||
"description": "The to point.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
},
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"toPoint"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"description": "A path that is horizontal.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"__geoMeta",
|
||||
"from",
|
||||
"name",
|
||||
"to",
|
||||
"type",
|
||||
"x"
|
||||
],
|
||||
"properties": {
|
||||
"__geoMeta": {
|
||||
"description": "Metadata.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"id",
|
||||
"sourceRange"
|
||||
],
|
||||
"properties": {
|
||||
"id": {
|
||||
"description": "The id of the geometry.",
|
||||
"type": "string",
|
||||
"format": "uuid"
|
||||
},
|
||||
"sourceRange": {
|
||||
"description": "The source range.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "integer",
|
||||
"format": "uint",
|
||||
"minimum": 0.0
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
}
|
||||
}
|
||||
},
|
||||
"from": {
|
||||
"description": "The from point.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
},
|
||||
"name": {
|
||||
"description": "The name of the path.",
|
||||
"type": "string"
|
||||
},
|
||||
"to": {
|
||||
"description": "The to point.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
},
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"horizontal"
|
||||
]
|
||||
},
|
||||
"x": {
|
||||
"description": "The x coordinate.",
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"description": "An angled line to.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"__geoMeta",
|
||||
"from",
|
||||
"name",
|
||||
"to",
|
||||
"type"
|
||||
],
|
||||
"properties": {
|
||||
"__geoMeta": {
|
||||
"description": "Metadata.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"id",
|
||||
"sourceRange"
|
||||
],
|
||||
"properties": {
|
||||
"id": {
|
||||
"description": "The id of the geometry.",
|
||||
"type": "string",
|
||||
"format": "uuid"
|
||||
},
|
||||
"sourceRange": {
|
||||
"description": "The source range.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "integer",
|
||||
"format": "uint",
|
||||
"minimum": 0.0
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
}
|
||||
}
|
||||
},
|
||||
"from": {
|
||||
"description": "The from point.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
},
|
||||
"name": {
|
||||
"description": "The name of the path.",
|
||||
"type": "string"
|
||||
},
|
||||
"to": {
|
||||
"description": "The to point.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
},
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"angledLineTo"
|
||||
]
|
||||
},
|
||||
"x": {
|
||||
"description": "The x coordinate.",
|
||||
"type": "number",
|
||||
"format": "double",
|
||||
"nullable": true
|
||||
},
|
||||
"y": {
|
||||
"description": "The y coordinate.",
|
||||
"type": "number",
|
||||
"format": "double",
|
||||
"nullable": true
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"description": "A base path.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"__geoMeta",
|
||||
"from",
|
||||
"name",
|
||||
"to",
|
||||
"type"
|
||||
],
|
||||
"properties": {
|
||||
"__geoMeta": {
|
||||
"description": "Metadata.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"id",
|
||||
"sourceRange"
|
||||
],
|
||||
"properties": {
|
||||
"id": {
|
||||
"description": "The id of the geometry.",
|
||||
"type": "string",
|
||||
"format": "uuid"
|
||||
},
|
||||
"sourceRange": {
|
||||
"description": "The source range.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "integer",
|
||||
"format": "uint",
|
||||
"minimum": 0.0
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
}
|
||||
}
|
||||
},
|
||||
"from": {
|
||||
"description": "The from point.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
},
|
||||
"name": {
|
||||
"description": "The name of the path.",
|
||||
"type": "string"
|
||||
},
|
||||
"to": {
|
||||
"description": "The to point.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
},
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"base"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": true
|
||||
},
|
||||
"unpublished": false,
|
||||
"deprecated": false
|
||||
}
|
||||
}
|
||||
"optional": false
|
||||
}
|
||||
}
|
||||
],
|
||||
|
@ -102,942 +102,7 @@ expression: actual
|
||||
]
|
||||
}
|
||||
],
|
||||
"optional": false,
|
||||
"function": {
|
||||
"type": "StdLib",
|
||||
"func": {
|
||||
"name": "lineTo",
|
||||
"summary": "Draw a line to a point.",
|
||||
"description": "",
|
||||
"tags": [],
|
||||
"args": [
|
||||
{
|
||||
"name": "data",
|
||||
"type": "LineToData",
|
||||
"schema": {
|
||||
"description": "Data to draw a line to a point.",
|
||||
"anyOf": [
|
||||
{
|
||||
"description": "A point with a tag.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"tag",
|
||||
"to"
|
||||
],
|
||||
"properties": {
|
||||
"tag": {
|
||||
"description": "The tag.",
|
||||
"type": "string"
|
||||
},
|
||||
"to": {
|
||||
"description": "The to point.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"description": "A point.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
}
|
||||
]
|
||||
},
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"name": "sketch_group",
|
||||
"type": "SketchGroup",
|
||||
"schema": {
|
||||
"description": "A sketch group is a collection of paths.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"__meta",
|
||||
"id",
|
||||
"position",
|
||||
"rotation",
|
||||
"start",
|
||||
"value"
|
||||
],
|
||||
"properties": {
|
||||
"__meta": {
|
||||
"description": "Metadata.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"description": "Metadata.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"sourceRange"
|
||||
],
|
||||
"properties": {
|
||||
"sourceRange": {
|
||||
"description": "The source range.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "integer",
|
||||
"format": "uint",
|
||||
"minimum": 0.0
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"id": {
|
||||
"description": "The id of the sketch group.",
|
||||
"type": "string",
|
||||
"format": "uuid"
|
||||
},
|
||||
"planeId": {
|
||||
"description": "The plane id of the sketch group.",
|
||||
"type": "string",
|
||||
"format": "uuid",
|
||||
"nullable": true
|
||||
},
|
||||
"position": {
|
||||
"description": "The position of the sketch group.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 3,
|
||||
"minItems": 3
|
||||
},
|
||||
"rotation": {
|
||||
"description": "The rotation of the sketch group.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 4,
|
||||
"minItems": 4
|
||||
},
|
||||
"start": {
|
||||
"description": "The starting path.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"__geoMeta",
|
||||
"from",
|
||||
"name",
|
||||
"to"
|
||||
],
|
||||
"properties": {
|
||||
"__geoMeta": {
|
||||
"description": "Metadata.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"id",
|
||||
"sourceRange"
|
||||
],
|
||||
"properties": {
|
||||
"id": {
|
||||
"description": "The id of the geometry.",
|
||||
"type": "string",
|
||||
"format": "uuid"
|
||||
},
|
||||
"sourceRange": {
|
||||
"description": "The source range.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "integer",
|
||||
"format": "uint",
|
||||
"minimum": 0.0
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
}
|
||||
}
|
||||
},
|
||||
"from": {
|
||||
"description": "The from point.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
},
|
||||
"name": {
|
||||
"description": "The name of the path.",
|
||||
"type": "string"
|
||||
},
|
||||
"to": {
|
||||
"description": "The to point.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
}
|
||||
}
|
||||
},
|
||||
"value": {
|
||||
"description": "The paths in the sketch group.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"description": "A path.",
|
||||
"oneOf": [
|
||||
{
|
||||
"description": "A path that goes to a point.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"__geoMeta",
|
||||
"from",
|
||||
"name",
|
||||
"to",
|
||||
"type"
|
||||
],
|
||||
"properties": {
|
||||
"__geoMeta": {
|
||||
"description": "Metadata.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"id",
|
||||
"sourceRange"
|
||||
],
|
||||
"properties": {
|
||||
"id": {
|
||||
"description": "The id of the geometry.",
|
||||
"type": "string",
|
||||
"format": "uuid"
|
||||
},
|
||||
"sourceRange": {
|
||||
"description": "The source range.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "integer",
|
||||
"format": "uint",
|
||||
"minimum": 0.0
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
}
|
||||
}
|
||||
},
|
||||
"from": {
|
||||
"description": "The from point.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
},
|
||||
"name": {
|
||||
"description": "The name of the path.",
|
||||
"type": "string"
|
||||
},
|
||||
"to": {
|
||||
"description": "The to point.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
},
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"toPoint"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"description": "A path that is horizontal.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"__geoMeta",
|
||||
"from",
|
||||
"name",
|
||||
"to",
|
||||
"type",
|
||||
"x"
|
||||
],
|
||||
"properties": {
|
||||
"__geoMeta": {
|
||||
"description": "Metadata.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"id",
|
||||
"sourceRange"
|
||||
],
|
||||
"properties": {
|
||||
"id": {
|
||||
"description": "The id of the geometry.",
|
||||
"type": "string",
|
||||
"format": "uuid"
|
||||
},
|
||||
"sourceRange": {
|
||||
"description": "The source range.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "integer",
|
||||
"format": "uint",
|
||||
"minimum": 0.0
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
}
|
||||
}
|
||||
},
|
||||
"from": {
|
||||
"description": "The from point.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
},
|
||||
"name": {
|
||||
"description": "The name of the path.",
|
||||
"type": "string"
|
||||
},
|
||||
"to": {
|
||||
"description": "The to point.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
},
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"horizontal"
|
||||
]
|
||||
},
|
||||
"x": {
|
||||
"description": "The x coordinate.",
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"description": "An angled line to.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"__geoMeta",
|
||||
"from",
|
||||
"name",
|
||||
"to",
|
||||
"type"
|
||||
],
|
||||
"properties": {
|
||||
"__geoMeta": {
|
||||
"description": "Metadata.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"id",
|
||||
"sourceRange"
|
||||
],
|
||||
"properties": {
|
||||
"id": {
|
||||
"description": "The id of the geometry.",
|
||||
"type": "string",
|
||||
"format": "uuid"
|
||||
},
|
||||
"sourceRange": {
|
||||
"description": "The source range.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "integer",
|
||||
"format": "uint",
|
||||
"minimum": 0.0
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
}
|
||||
}
|
||||
},
|
||||
"from": {
|
||||
"description": "The from point.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
},
|
||||
"name": {
|
||||
"description": "The name of the path.",
|
||||
"type": "string"
|
||||
},
|
||||
"to": {
|
||||
"description": "The to point.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
},
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"angledLineTo"
|
||||
]
|
||||
},
|
||||
"x": {
|
||||
"description": "The x coordinate.",
|
||||
"type": "number",
|
||||
"format": "double",
|
||||
"nullable": true
|
||||
},
|
||||
"y": {
|
||||
"description": "The y coordinate.",
|
||||
"type": "number",
|
||||
"format": "double",
|
||||
"nullable": true
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"description": "A base path.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"__geoMeta",
|
||||
"from",
|
||||
"name",
|
||||
"to",
|
||||
"type"
|
||||
],
|
||||
"properties": {
|
||||
"__geoMeta": {
|
||||
"description": "Metadata.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"id",
|
||||
"sourceRange"
|
||||
],
|
||||
"properties": {
|
||||
"id": {
|
||||
"description": "The id of the geometry.",
|
||||
"type": "string",
|
||||
"format": "uuid"
|
||||
},
|
||||
"sourceRange": {
|
||||
"description": "The source range.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "integer",
|
||||
"format": "uint",
|
||||
"minimum": 0.0
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
}
|
||||
}
|
||||
},
|
||||
"from": {
|
||||
"description": "The from point.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
},
|
||||
"name": {
|
||||
"description": "The name of the path.",
|
||||
"type": "string"
|
||||
},
|
||||
"to": {
|
||||
"description": "The to point.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
},
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"base"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": true
|
||||
}
|
||||
],
|
||||
"returnValue": {
|
||||
"name": "",
|
||||
"type": "SketchGroup",
|
||||
"schema": {
|
||||
"description": "A sketch group is a collection of paths.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"__meta",
|
||||
"id",
|
||||
"position",
|
||||
"rotation",
|
||||
"start",
|
||||
"value"
|
||||
],
|
||||
"properties": {
|
||||
"__meta": {
|
||||
"description": "Metadata.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"description": "Metadata.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"sourceRange"
|
||||
],
|
||||
"properties": {
|
||||
"sourceRange": {
|
||||
"description": "The source range.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "integer",
|
||||
"format": "uint",
|
||||
"minimum": 0.0
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"id": {
|
||||
"description": "The id of the sketch group.",
|
||||
"type": "string",
|
||||
"format": "uuid"
|
||||
},
|
||||
"planeId": {
|
||||
"description": "The plane id of the sketch group.",
|
||||
"type": "string",
|
||||
"format": "uuid",
|
||||
"nullable": true
|
||||
},
|
||||
"position": {
|
||||
"description": "The position of the sketch group.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 3,
|
||||
"minItems": 3
|
||||
},
|
||||
"rotation": {
|
||||
"description": "The rotation of the sketch group.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 4,
|
||||
"minItems": 4
|
||||
},
|
||||
"start": {
|
||||
"description": "The starting path.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"__geoMeta",
|
||||
"from",
|
||||
"name",
|
||||
"to"
|
||||
],
|
||||
"properties": {
|
||||
"__geoMeta": {
|
||||
"description": "Metadata.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"id",
|
||||
"sourceRange"
|
||||
],
|
||||
"properties": {
|
||||
"id": {
|
||||
"description": "The id of the geometry.",
|
||||
"type": "string",
|
||||
"format": "uuid"
|
||||
},
|
||||
"sourceRange": {
|
||||
"description": "The source range.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "integer",
|
||||
"format": "uint",
|
||||
"minimum": 0.0
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
}
|
||||
}
|
||||
},
|
||||
"from": {
|
||||
"description": "The from point.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
},
|
||||
"name": {
|
||||
"description": "The name of the path.",
|
||||
"type": "string"
|
||||
},
|
||||
"to": {
|
||||
"description": "The to point.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
}
|
||||
}
|
||||
},
|
||||
"value": {
|
||||
"description": "The paths in the sketch group.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"description": "A path.",
|
||||
"oneOf": [
|
||||
{
|
||||
"description": "A path that goes to a point.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"__geoMeta",
|
||||
"from",
|
||||
"name",
|
||||
"to",
|
||||
"type"
|
||||
],
|
||||
"properties": {
|
||||
"__geoMeta": {
|
||||
"description": "Metadata.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"id",
|
||||
"sourceRange"
|
||||
],
|
||||
"properties": {
|
||||
"id": {
|
||||
"description": "The id of the geometry.",
|
||||
"type": "string",
|
||||
"format": "uuid"
|
||||
},
|
||||
"sourceRange": {
|
||||
"description": "The source range.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "integer",
|
||||
"format": "uint",
|
||||
"minimum": 0.0
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
}
|
||||
}
|
||||
},
|
||||
"from": {
|
||||
"description": "The from point.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
},
|
||||
"name": {
|
||||
"description": "The name of the path.",
|
||||
"type": "string"
|
||||
},
|
||||
"to": {
|
||||
"description": "The to point.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
},
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"toPoint"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"description": "A path that is horizontal.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"__geoMeta",
|
||||
"from",
|
||||
"name",
|
||||
"to",
|
||||
"type",
|
||||
"x"
|
||||
],
|
||||
"properties": {
|
||||
"__geoMeta": {
|
||||
"description": "Metadata.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"id",
|
||||
"sourceRange"
|
||||
],
|
||||
"properties": {
|
||||
"id": {
|
||||
"description": "The id of the geometry.",
|
||||
"type": "string",
|
||||
"format": "uuid"
|
||||
},
|
||||
"sourceRange": {
|
||||
"description": "The source range.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "integer",
|
||||
"format": "uint",
|
||||
"minimum": 0.0
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
}
|
||||
}
|
||||
},
|
||||
"from": {
|
||||
"description": "The from point.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
},
|
||||
"name": {
|
||||
"description": "The name of the path.",
|
||||
"type": "string"
|
||||
},
|
||||
"to": {
|
||||
"description": "The to point.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
},
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"horizontal"
|
||||
]
|
||||
},
|
||||
"x": {
|
||||
"description": "The x coordinate.",
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"description": "An angled line to.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"__geoMeta",
|
||||
"from",
|
||||
"name",
|
||||
"to",
|
||||
"type"
|
||||
],
|
||||
"properties": {
|
||||
"__geoMeta": {
|
||||
"description": "Metadata.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"id",
|
||||
"sourceRange"
|
||||
],
|
||||
"properties": {
|
||||
"id": {
|
||||
"description": "The id of the geometry.",
|
||||
"type": "string",
|
||||
"format": "uuid"
|
||||
},
|
||||
"sourceRange": {
|
||||
"description": "The source range.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "integer",
|
||||
"format": "uint",
|
||||
"minimum": 0.0
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
}
|
||||
}
|
||||
},
|
||||
"from": {
|
||||
"description": "The from point.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
},
|
||||
"name": {
|
||||
"description": "The name of the path.",
|
||||
"type": "string"
|
||||
},
|
||||
"to": {
|
||||
"description": "The to point.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
},
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"angledLineTo"
|
||||
]
|
||||
},
|
||||
"x": {
|
||||
"description": "The x coordinate.",
|
||||
"type": "number",
|
||||
"format": "double",
|
||||
"nullable": true
|
||||
},
|
||||
"y": {
|
||||
"description": "The y coordinate.",
|
||||
"type": "number",
|
||||
"format": "double",
|
||||
"nullable": true
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"description": "A base path.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"__geoMeta",
|
||||
"from",
|
||||
"name",
|
||||
"to",
|
||||
"type"
|
||||
],
|
||||
"properties": {
|
||||
"__geoMeta": {
|
||||
"description": "Metadata.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"id",
|
||||
"sourceRange"
|
||||
],
|
||||
"properties": {
|
||||
"id": {
|
||||
"description": "The id of the geometry.",
|
||||
"type": "string",
|
||||
"format": "uuid"
|
||||
},
|
||||
"sourceRange": {
|
||||
"description": "The source range.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "integer",
|
||||
"format": "uint",
|
||||
"minimum": 0.0
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
}
|
||||
}
|
||||
},
|
||||
"from": {
|
||||
"description": "The from point.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
},
|
||||
"name": {
|
||||
"description": "The name of the path.",
|
||||
"type": "string"
|
||||
},
|
||||
"to": {
|
||||
"description": "The to point.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
},
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"base"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": true
|
||||
},
|
||||
"unpublished": false,
|
||||
"deprecated": false
|
||||
}
|
||||
}
|
||||
"optional": false
|
||||
}
|
||||
}
|
||||
],
|
||||
|
@ -67,942 +67,7 @@ expression: actual
|
||||
]
|
||||
}
|
||||
],
|
||||
"optional": false,
|
||||
"function": {
|
||||
"type": "StdLib",
|
||||
"func": {
|
||||
"name": "lineTo",
|
||||
"summary": "Draw a line to a point.",
|
||||
"description": "",
|
||||
"tags": [],
|
||||
"args": [
|
||||
{
|
||||
"name": "data",
|
||||
"type": "LineToData",
|
||||
"schema": {
|
||||
"description": "Data to draw a line to a point.",
|
||||
"anyOf": [
|
||||
{
|
||||
"description": "A point with a tag.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"tag",
|
||||
"to"
|
||||
],
|
||||
"properties": {
|
||||
"tag": {
|
||||
"description": "The tag.",
|
||||
"type": "string"
|
||||
},
|
||||
"to": {
|
||||
"description": "The to point.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"description": "A point.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
}
|
||||
]
|
||||
},
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"name": "sketch_group",
|
||||
"type": "SketchGroup",
|
||||
"schema": {
|
||||
"description": "A sketch group is a collection of paths.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"__meta",
|
||||
"id",
|
||||
"position",
|
||||
"rotation",
|
||||
"start",
|
||||
"value"
|
||||
],
|
||||
"properties": {
|
||||
"__meta": {
|
||||
"description": "Metadata.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"description": "Metadata.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"sourceRange"
|
||||
],
|
||||
"properties": {
|
||||
"sourceRange": {
|
||||
"description": "The source range.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "integer",
|
||||
"format": "uint",
|
||||
"minimum": 0.0
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"id": {
|
||||
"description": "The id of the sketch group.",
|
||||
"type": "string",
|
||||
"format": "uuid"
|
||||
},
|
||||
"planeId": {
|
||||
"description": "The plane id of the sketch group.",
|
||||
"type": "string",
|
||||
"format": "uuid",
|
||||
"nullable": true
|
||||
},
|
||||
"position": {
|
||||
"description": "The position of the sketch group.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 3,
|
||||
"minItems": 3
|
||||
},
|
||||
"rotation": {
|
||||
"description": "The rotation of the sketch group.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 4,
|
||||
"minItems": 4
|
||||
},
|
||||
"start": {
|
||||
"description": "The starting path.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"__geoMeta",
|
||||
"from",
|
||||
"name",
|
||||
"to"
|
||||
],
|
||||
"properties": {
|
||||
"__geoMeta": {
|
||||
"description": "Metadata.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"id",
|
||||
"sourceRange"
|
||||
],
|
||||
"properties": {
|
||||
"id": {
|
||||
"description": "The id of the geometry.",
|
||||
"type": "string",
|
||||
"format": "uuid"
|
||||
},
|
||||
"sourceRange": {
|
||||
"description": "The source range.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "integer",
|
||||
"format": "uint",
|
||||
"minimum": 0.0
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
}
|
||||
}
|
||||
},
|
||||
"from": {
|
||||
"description": "The from point.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
},
|
||||
"name": {
|
||||
"description": "The name of the path.",
|
||||
"type": "string"
|
||||
},
|
||||
"to": {
|
||||
"description": "The to point.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
}
|
||||
}
|
||||
},
|
||||
"value": {
|
||||
"description": "The paths in the sketch group.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"description": "A path.",
|
||||
"oneOf": [
|
||||
{
|
||||
"description": "A path that goes to a point.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"__geoMeta",
|
||||
"from",
|
||||
"name",
|
||||
"to",
|
||||
"type"
|
||||
],
|
||||
"properties": {
|
||||
"__geoMeta": {
|
||||
"description": "Metadata.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"id",
|
||||
"sourceRange"
|
||||
],
|
||||
"properties": {
|
||||
"id": {
|
||||
"description": "The id of the geometry.",
|
||||
"type": "string",
|
||||
"format": "uuid"
|
||||
},
|
||||
"sourceRange": {
|
||||
"description": "The source range.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "integer",
|
||||
"format": "uint",
|
||||
"minimum": 0.0
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
}
|
||||
}
|
||||
},
|
||||
"from": {
|
||||
"description": "The from point.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
},
|
||||
"name": {
|
||||
"description": "The name of the path.",
|
||||
"type": "string"
|
||||
},
|
||||
"to": {
|
||||
"description": "The to point.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
},
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"toPoint"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"description": "A path that is horizontal.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"__geoMeta",
|
||||
"from",
|
||||
"name",
|
||||
"to",
|
||||
"type",
|
||||
"x"
|
||||
],
|
||||
"properties": {
|
||||
"__geoMeta": {
|
||||
"description": "Metadata.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"id",
|
||||
"sourceRange"
|
||||
],
|
||||
"properties": {
|
||||
"id": {
|
||||
"description": "The id of the geometry.",
|
||||
"type": "string",
|
||||
"format": "uuid"
|
||||
},
|
||||
"sourceRange": {
|
||||
"description": "The source range.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "integer",
|
||||
"format": "uint",
|
||||
"minimum": 0.0
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
}
|
||||
}
|
||||
},
|
||||
"from": {
|
||||
"description": "The from point.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
},
|
||||
"name": {
|
||||
"description": "The name of the path.",
|
||||
"type": "string"
|
||||
},
|
||||
"to": {
|
||||
"description": "The to point.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
},
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"horizontal"
|
||||
]
|
||||
},
|
||||
"x": {
|
||||
"description": "The x coordinate.",
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"description": "An angled line to.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"__geoMeta",
|
||||
"from",
|
||||
"name",
|
||||
"to",
|
||||
"type"
|
||||
],
|
||||
"properties": {
|
||||
"__geoMeta": {
|
||||
"description": "Metadata.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"id",
|
||||
"sourceRange"
|
||||
],
|
||||
"properties": {
|
||||
"id": {
|
||||
"description": "The id of the geometry.",
|
||||
"type": "string",
|
||||
"format": "uuid"
|
||||
},
|
||||
"sourceRange": {
|
||||
"description": "The source range.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "integer",
|
||||
"format": "uint",
|
||||
"minimum": 0.0
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
}
|
||||
}
|
||||
},
|
||||
"from": {
|
||||
"description": "The from point.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
},
|
||||
"name": {
|
||||
"description": "The name of the path.",
|
||||
"type": "string"
|
||||
},
|
||||
"to": {
|
||||
"description": "The to point.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
},
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"angledLineTo"
|
||||
]
|
||||
},
|
||||
"x": {
|
||||
"description": "The x coordinate.",
|
||||
"type": "number",
|
||||
"format": "double",
|
||||
"nullable": true
|
||||
},
|
||||
"y": {
|
||||
"description": "The y coordinate.",
|
||||
"type": "number",
|
||||
"format": "double",
|
||||
"nullable": true
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"description": "A base path.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"__geoMeta",
|
||||
"from",
|
||||
"name",
|
||||
"to",
|
||||
"type"
|
||||
],
|
||||
"properties": {
|
||||
"__geoMeta": {
|
||||
"description": "Metadata.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"id",
|
||||
"sourceRange"
|
||||
],
|
||||
"properties": {
|
||||
"id": {
|
||||
"description": "The id of the geometry.",
|
||||
"type": "string",
|
||||
"format": "uuid"
|
||||
},
|
||||
"sourceRange": {
|
||||
"description": "The source range.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "integer",
|
||||
"format": "uint",
|
||||
"minimum": 0.0
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
}
|
||||
}
|
||||
},
|
||||
"from": {
|
||||
"description": "The from point.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
},
|
||||
"name": {
|
||||
"description": "The name of the path.",
|
||||
"type": "string"
|
||||
},
|
||||
"to": {
|
||||
"description": "The to point.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
},
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"base"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": true
|
||||
}
|
||||
],
|
||||
"returnValue": {
|
||||
"name": "",
|
||||
"type": "SketchGroup",
|
||||
"schema": {
|
||||
"description": "A sketch group is a collection of paths.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"__meta",
|
||||
"id",
|
||||
"position",
|
||||
"rotation",
|
||||
"start",
|
||||
"value"
|
||||
],
|
||||
"properties": {
|
||||
"__meta": {
|
||||
"description": "Metadata.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"description": "Metadata.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"sourceRange"
|
||||
],
|
||||
"properties": {
|
||||
"sourceRange": {
|
||||
"description": "The source range.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "integer",
|
||||
"format": "uint",
|
||||
"minimum": 0.0
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"id": {
|
||||
"description": "The id of the sketch group.",
|
||||
"type": "string",
|
||||
"format": "uuid"
|
||||
},
|
||||
"planeId": {
|
||||
"description": "The plane id of the sketch group.",
|
||||
"type": "string",
|
||||
"format": "uuid",
|
||||
"nullable": true
|
||||
},
|
||||
"position": {
|
||||
"description": "The position of the sketch group.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 3,
|
||||
"minItems": 3
|
||||
},
|
||||
"rotation": {
|
||||
"description": "The rotation of the sketch group.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 4,
|
||||
"minItems": 4
|
||||
},
|
||||
"start": {
|
||||
"description": "The starting path.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"__geoMeta",
|
||||
"from",
|
||||
"name",
|
||||
"to"
|
||||
],
|
||||
"properties": {
|
||||
"__geoMeta": {
|
||||
"description": "Metadata.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"id",
|
||||
"sourceRange"
|
||||
],
|
||||
"properties": {
|
||||
"id": {
|
||||
"description": "The id of the geometry.",
|
||||
"type": "string",
|
||||
"format": "uuid"
|
||||
},
|
||||
"sourceRange": {
|
||||
"description": "The source range.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "integer",
|
||||
"format": "uint",
|
||||
"minimum": 0.0
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
}
|
||||
}
|
||||
},
|
||||
"from": {
|
||||
"description": "The from point.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
},
|
||||
"name": {
|
||||
"description": "The name of the path.",
|
||||
"type": "string"
|
||||
},
|
||||
"to": {
|
||||
"description": "The to point.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
}
|
||||
}
|
||||
},
|
||||
"value": {
|
||||
"description": "The paths in the sketch group.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"description": "A path.",
|
||||
"oneOf": [
|
||||
{
|
||||
"description": "A path that goes to a point.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"__geoMeta",
|
||||
"from",
|
||||
"name",
|
||||
"to",
|
||||
"type"
|
||||
],
|
||||
"properties": {
|
||||
"__geoMeta": {
|
||||
"description": "Metadata.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"id",
|
||||
"sourceRange"
|
||||
],
|
||||
"properties": {
|
||||
"id": {
|
||||
"description": "The id of the geometry.",
|
||||
"type": "string",
|
||||
"format": "uuid"
|
||||
},
|
||||
"sourceRange": {
|
||||
"description": "The source range.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "integer",
|
||||
"format": "uint",
|
||||
"minimum": 0.0
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
}
|
||||
}
|
||||
},
|
||||
"from": {
|
||||
"description": "The from point.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
},
|
||||
"name": {
|
||||
"description": "The name of the path.",
|
||||
"type": "string"
|
||||
},
|
||||
"to": {
|
||||
"description": "The to point.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
},
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"toPoint"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"description": "A path that is horizontal.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"__geoMeta",
|
||||
"from",
|
||||
"name",
|
||||
"to",
|
||||
"type",
|
||||
"x"
|
||||
],
|
||||
"properties": {
|
||||
"__geoMeta": {
|
||||
"description": "Metadata.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"id",
|
||||
"sourceRange"
|
||||
],
|
||||
"properties": {
|
||||
"id": {
|
||||
"description": "The id of the geometry.",
|
||||
"type": "string",
|
||||
"format": "uuid"
|
||||
},
|
||||
"sourceRange": {
|
||||
"description": "The source range.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "integer",
|
||||
"format": "uint",
|
||||
"minimum": 0.0
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
}
|
||||
}
|
||||
},
|
||||
"from": {
|
||||
"description": "The from point.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
},
|
||||
"name": {
|
||||
"description": "The name of the path.",
|
||||
"type": "string"
|
||||
},
|
||||
"to": {
|
||||
"description": "The to point.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
},
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"horizontal"
|
||||
]
|
||||
},
|
||||
"x": {
|
||||
"description": "The x coordinate.",
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"description": "An angled line to.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"__geoMeta",
|
||||
"from",
|
||||
"name",
|
||||
"to",
|
||||
"type"
|
||||
],
|
||||
"properties": {
|
||||
"__geoMeta": {
|
||||
"description": "Metadata.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"id",
|
||||
"sourceRange"
|
||||
],
|
||||
"properties": {
|
||||
"id": {
|
||||
"description": "The id of the geometry.",
|
||||
"type": "string",
|
||||
"format": "uuid"
|
||||
},
|
||||
"sourceRange": {
|
||||
"description": "The source range.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "integer",
|
||||
"format": "uint",
|
||||
"minimum": 0.0
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
}
|
||||
}
|
||||
},
|
||||
"from": {
|
||||
"description": "The from point.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
},
|
||||
"name": {
|
||||
"description": "The name of the path.",
|
||||
"type": "string"
|
||||
},
|
||||
"to": {
|
||||
"description": "The to point.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
},
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"angledLineTo"
|
||||
]
|
||||
},
|
||||
"x": {
|
||||
"description": "The x coordinate.",
|
||||
"type": "number",
|
||||
"format": "double",
|
||||
"nullable": true
|
||||
},
|
||||
"y": {
|
||||
"description": "The y coordinate.",
|
||||
"type": "number",
|
||||
"format": "double",
|
||||
"nullable": true
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"description": "A base path.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"__geoMeta",
|
||||
"from",
|
||||
"name",
|
||||
"to",
|
||||
"type"
|
||||
],
|
||||
"properties": {
|
||||
"__geoMeta": {
|
||||
"description": "Metadata.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"id",
|
||||
"sourceRange"
|
||||
],
|
||||
"properties": {
|
||||
"id": {
|
||||
"description": "The id of the geometry.",
|
||||
"type": "string",
|
||||
"format": "uuid"
|
||||
},
|
||||
"sourceRange": {
|
||||
"description": "The source range.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "integer",
|
||||
"format": "uint",
|
||||
"minimum": 0.0
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
}
|
||||
}
|
||||
},
|
||||
"from": {
|
||||
"description": "The from point.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
},
|
||||
"name": {
|
||||
"description": "The name of the path.",
|
||||
"type": "string"
|
||||
},
|
||||
"to": {
|
||||
"description": "The to point.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
},
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"base"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": true
|
||||
},
|
||||
"unpublished": false,
|
||||
"deprecated": false
|
||||
}
|
||||
}
|
||||
"optional": false
|
||||
}
|
||||
}
|
||||
],
|
||||
|
@ -102,942 +102,7 @@ expression: actual
|
||||
]
|
||||
}
|
||||
],
|
||||
"optional": false,
|
||||
"function": {
|
||||
"type": "StdLib",
|
||||
"func": {
|
||||
"name": "lineTo",
|
||||
"summary": "Draw a line to a point.",
|
||||
"description": "",
|
||||
"tags": [],
|
||||
"args": [
|
||||
{
|
||||
"name": "data",
|
||||
"type": "LineToData",
|
||||
"schema": {
|
||||
"description": "Data to draw a line to a point.",
|
||||
"anyOf": [
|
||||
{
|
||||
"description": "A point with a tag.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"tag",
|
||||
"to"
|
||||
],
|
||||
"properties": {
|
||||
"tag": {
|
||||
"description": "The tag.",
|
||||
"type": "string"
|
||||
},
|
||||
"to": {
|
||||
"description": "The to point.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"description": "A point.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
}
|
||||
]
|
||||
},
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"name": "sketch_group",
|
||||
"type": "SketchGroup",
|
||||
"schema": {
|
||||
"description": "A sketch group is a collection of paths.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"__meta",
|
||||
"id",
|
||||
"position",
|
||||
"rotation",
|
||||
"start",
|
||||
"value"
|
||||
],
|
||||
"properties": {
|
||||
"__meta": {
|
||||
"description": "Metadata.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"description": "Metadata.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"sourceRange"
|
||||
],
|
||||
"properties": {
|
||||
"sourceRange": {
|
||||
"description": "The source range.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "integer",
|
||||
"format": "uint",
|
||||
"minimum": 0.0
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"id": {
|
||||
"description": "The id of the sketch group.",
|
||||
"type": "string",
|
||||
"format": "uuid"
|
||||
},
|
||||
"planeId": {
|
||||
"description": "The plane id of the sketch group.",
|
||||
"type": "string",
|
||||
"format": "uuid",
|
||||
"nullable": true
|
||||
},
|
||||
"position": {
|
||||
"description": "The position of the sketch group.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 3,
|
||||
"minItems": 3
|
||||
},
|
||||
"rotation": {
|
||||
"description": "The rotation of the sketch group.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 4,
|
||||
"minItems": 4
|
||||
},
|
||||
"start": {
|
||||
"description": "The starting path.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"__geoMeta",
|
||||
"from",
|
||||
"name",
|
||||
"to"
|
||||
],
|
||||
"properties": {
|
||||
"__geoMeta": {
|
||||
"description": "Metadata.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"id",
|
||||
"sourceRange"
|
||||
],
|
||||
"properties": {
|
||||
"id": {
|
||||
"description": "The id of the geometry.",
|
||||
"type": "string",
|
||||
"format": "uuid"
|
||||
},
|
||||
"sourceRange": {
|
||||
"description": "The source range.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "integer",
|
||||
"format": "uint",
|
||||
"minimum": 0.0
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
}
|
||||
}
|
||||
},
|
||||
"from": {
|
||||
"description": "The from point.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
},
|
||||
"name": {
|
||||
"description": "The name of the path.",
|
||||
"type": "string"
|
||||
},
|
||||
"to": {
|
||||
"description": "The to point.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
}
|
||||
}
|
||||
},
|
||||
"value": {
|
||||
"description": "The paths in the sketch group.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"description": "A path.",
|
||||
"oneOf": [
|
||||
{
|
||||
"description": "A path that goes to a point.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"__geoMeta",
|
||||
"from",
|
||||
"name",
|
||||
"to",
|
||||
"type"
|
||||
],
|
||||
"properties": {
|
||||
"__geoMeta": {
|
||||
"description": "Metadata.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"id",
|
||||
"sourceRange"
|
||||
],
|
||||
"properties": {
|
||||
"id": {
|
||||
"description": "The id of the geometry.",
|
||||
"type": "string",
|
||||
"format": "uuid"
|
||||
},
|
||||
"sourceRange": {
|
||||
"description": "The source range.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "integer",
|
||||
"format": "uint",
|
||||
"minimum": 0.0
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
}
|
||||
}
|
||||
},
|
||||
"from": {
|
||||
"description": "The from point.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
},
|
||||
"name": {
|
||||
"description": "The name of the path.",
|
||||
"type": "string"
|
||||
},
|
||||
"to": {
|
||||
"description": "The to point.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
},
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"toPoint"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"description": "A path that is horizontal.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"__geoMeta",
|
||||
"from",
|
||||
"name",
|
||||
"to",
|
||||
"type",
|
||||
"x"
|
||||
],
|
||||
"properties": {
|
||||
"__geoMeta": {
|
||||
"description": "Metadata.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"id",
|
||||
"sourceRange"
|
||||
],
|
||||
"properties": {
|
||||
"id": {
|
||||
"description": "The id of the geometry.",
|
||||
"type": "string",
|
||||
"format": "uuid"
|
||||
},
|
||||
"sourceRange": {
|
||||
"description": "The source range.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "integer",
|
||||
"format": "uint",
|
||||
"minimum": 0.0
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
}
|
||||
}
|
||||
},
|
||||
"from": {
|
||||
"description": "The from point.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
},
|
||||
"name": {
|
||||
"description": "The name of the path.",
|
||||
"type": "string"
|
||||
},
|
||||
"to": {
|
||||
"description": "The to point.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
},
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"horizontal"
|
||||
]
|
||||
},
|
||||
"x": {
|
||||
"description": "The x coordinate.",
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"description": "An angled line to.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"__geoMeta",
|
||||
"from",
|
||||
"name",
|
||||
"to",
|
||||
"type"
|
||||
],
|
||||
"properties": {
|
||||
"__geoMeta": {
|
||||
"description": "Metadata.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"id",
|
||||
"sourceRange"
|
||||
],
|
||||
"properties": {
|
||||
"id": {
|
||||
"description": "The id of the geometry.",
|
||||
"type": "string",
|
||||
"format": "uuid"
|
||||
},
|
||||
"sourceRange": {
|
||||
"description": "The source range.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "integer",
|
||||
"format": "uint",
|
||||
"minimum": 0.0
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
}
|
||||
}
|
||||
},
|
||||
"from": {
|
||||
"description": "The from point.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
},
|
||||
"name": {
|
||||
"description": "The name of the path.",
|
||||
"type": "string"
|
||||
},
|
||||
"to": {
|
||||
"description": "The to point.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
},
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"angledLineTo"
|
||||
]
|
||||
},
|
||||
"x": {
|
||||
"description": "The x coordinate.",
|
||||
"type": "number",
|
||||
"format": "double",
|
||||
"nullable": true
|
||||
},
|
||||
"y": {
|
||||
"description": "The y coordinate.",
|
||||
"type": "number",
|
||||
"format": "double",
|
||||
"nullable": true
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"description": "A base path.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"__geoMeta",
|
||||
"from",
|
||||
"name",
|
||||
"to",
|
||||
"type"
|
||||
],
|
||||
"properties": {
|
||||
"__geoMeta": {
|
||||
"description": "Metadata.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"id",
|
||||
"sourceRange"
|
||||
],
|
||||
"properties": {
|
||||
"id": {
|
||||
"description": "The id of the geometry.",
|
||||
"type": "string",
|
||||
"format": "uuid"
|
||||
},
|
||||
"sourceRange": {
|
||||
"description": "The source range.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "integer",
|
||||
"format": "uint",
|
||||
"minimum": 0.0
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
}
|
||||
}
|
||||
},
|
||||
"from": {
|
||||
"description": "The from point.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
},
|
||||
"name": {
|
||||
"description": "The name of the path.",
|
||||
"type": "string"
|
||||
},
|
||||
"to": {
|
||||
"description": "The to point.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
},
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"base"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": true
|
||||
}
|
||||
],
|
||||
"returnValue": {
|
||||
"name": "",
|
||||
"type": "SketchGroup",
|
||||
"schema": {
|
||||
"description": "A sketch group is a collection of paths.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"__meta",
|
||||
"id",
|
||||
"position",
|
||||
"rotation",
|
||||
"start",
|
||||
"value"
|
||||
],
|
||||
"properties": {
|
||||
"__meta": {
|
||||
"description": "Metadata.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"description": "Metadata.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"sourceRange"
|
||||
],
|
||||
"properties": {
|
||||
"sourceRange": {
|
||||
"description": "The source range.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "integer",
|
||||
"format": "uint",
|
||||
"minimum": 0.0
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"id": {
|
||||
"description": "The id of the sketch group.",
|
||||
"type": "string",
|
||||
"format": "uuid"
|
||||
},
|
||||
"planeId": {
|
||||
"description": "The plane id of the sketch group.",
|
||||
"type": "string",
|
||||
"format": "uuid",
|
||||
"nullable": true
|
||||
},
|
||||
"position": {
|
||||
"description": "The position of the sketch group.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 3,
|
||||
"minItems": 3
|
||||
},
|
||||
"rotation": {
|
||||
"description": "The rotation of the sketch group.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 4,
|
||||
"minItems": 4
|
||||
},
|
||||
"start": {
|
||||
"description": "The starting path.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"__geoMeta",
|
||||
"from",
|
||||
"name",
|
||||
"to"
|
||||
],
|
||||
"properties": {
|
||||
"__geoMeta": {
|
||||
"description": "Metadata.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"id",
|
||||
"sourceRange"
|
||||
],
|
||||
"properties": {
|
||||
"id": {
|
||||
"description": "The id of the geometry.",
|
||||
"type": "string",
|
||||
"format": "uuid"
|
||||
},
|
||||
"sourceRange": {
|
||||
"description": "The source range.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "integer",
|
||||
"format": "uint",
|
||||
"minimum": 0.0
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
}
|
||||
}
|
||||
},
|
||||
"from": {
|
||||
"description": "The from point.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
},
|
||||
"name": {
|
||||
"description": "The name of the path.",
|
||||
"type": "string"
|
||||
},
|
||||
"to": {
|
||||
"description": "The to point.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
}
|
||||
}
|
||||
},
|
||||
"value": {
|
||||
"description": "The paths in the sketch group.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"description": "A path.",
|
||||
"oneOf": [
|
||||
{
|
||||
"description": "A path that goes to a point.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"__geoMeta",
|
||||
"from",
|
||||
"name",
|
||||
"to",
|
||||
"type"
|
||||
],
|
||||
"properties": {
|
||||
"__geoMeta": {
|
||||
"description": "Metadata.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"id",
|
||||
"sourceRange"
|
||||
],
|
||||
"properties": {
|
||||
"id": {
|
||||
"description": "The id of the geometry.",
|
||||
"type": "string",
|
||||
"format": "uuid"
|
||||
},
|
||||
"sourceRange": {
|
||||
"description": "The source range.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "integer",
|
||||
"format": "uint",
|
||||
"minimum": 0.0
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
}
|
||||
}
|
||||
},
|
||||
"from": {
|
||||
"description": "The from point.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
},
|
||||
"name": {
|
||||
"description": "The name of the path.",
|
||||
"type": "string"
|
||||
},
|
||||
"to": {
|
||||
"description": "The to point.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
},
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"toPoint"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"description": "A path that is horizontal.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"__geoMeta",
|
||||
"from",
|
||||
"name",
|
||||
"to",
|
||||
"type",
|
||||
"x"
|
||||
],
|
||||
"properties": {
|
||||
"__geoMeta": {
|
||||
"description": "Metadata.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"id",
|
||||
"sourceRange"
|
||||
],
|
||||
"properties": {
|
||||
"id": {
|
||||
"description": "The id of the geometry.",
|
||||
"type": "string",
|
||||
"format": "uuid"
|
||||
},
|
||||
"sourceRange": {
|
||||
"description": "The source range.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "integer",
|
||||
"format": "uint",
|
||||
"minimum": 0.0
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
}
|
||||
}
|
||||
},
|
||||
"from": {
|
||||
"description": "The from point.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
},
|
||||
"name": {
|
||||
"description": "The name of the path.",
|
||||
"type": "string"
|
||||
},
|
||||
"to": {
|
||||
"description": "The to point.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
},
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"horizontal"
|
||||
]
|
||||
},
|
||||
"x": {
|
||||
"description": "The x coordinate.",
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"description": "An angled line to.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"__geoMeta",
|
||||
"from",
|
||||
"name",
|
||||
"to",
|
||||
"type"
|
||||
],
|
||||
"properties": {
|
||||
"__geoMeta": {
|
||||
"description": "Metadata.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"id",
|
||||
"sourceRange"
|
||||
],
|
||||
"properties": {
|
||||
"id": {
|
||||
"description": "The id of the geometry.",
|
||||
"type": "string",
|
||||
"format": "uuid"
|
||||
},
|
||||
"sourceRange": {
|
||||
"description": "The source range.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "integer",
|
||||
"format": "uint",
|
||||
"minimum": 0.0
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
}
|
||||
}
|
||||
},
|
||||
"from": {
|
||||
"description": "The from point.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
},
|
||||
"name": {
|
||||
"description": "The name of the path.",
|
||||
"type": "string"
|
||||
},
|
||||
"to": {
|
||||
"description": "The to point.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
},
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"angledLineTo"
|
||||
]
|
||||
},
|
||||
"x": {
|
||||
"description": "The x coordinate.",
|
||||
"type": "number",
|
||||
"format": "double",
|
||||
"nullable": true
|
||||
},
|
||||
"y": {
|
||||
"description": "The y coordinate.",
|
||||
"type": "number",
|
||||
"format": "double",
|
||||
"nullable": true
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"description": "A base path.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"__geoMeta",
|
||||
"from",
|
||||
"name",
|
||||
"to",
|
||||
"type"
|
||||
],
|
||||
"properties": {
|
||||
"__geoMeta": {
|
||||
"description": "Metadata.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"id",
|
||||
"sourceRange"
|
||||
],
|
||||
"properties": {
|
||||
"id": {
|
||||
"description": "The id of the geometry.",
|
||||
"type": "string",
|
||||
"format": "uuid"
|
||||
},
|
||||
"sourceRange": {
|
||||
"description": "The source range.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "integer",
|
||||
"format": "uint",
|
||||
"minimum": 0.0
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
}
|
||||
}
|
||||
},
|
||||
"from": {
|
||||
"description": "The from point.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
},
|
||||
"name": {
|
||||
"description": "The name of the path.",
|
||||
"type": "string"
|
||||
},
|
||||
"to": {
|
||||
"description": "The to point.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
},
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"base"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": true
|
||||
},
|
||||
"unpublished": false,
|
||||
"deprecated": false
|
||||
}
|
||||
}
|
||||
"optional": false
|
||||
}
|
||||
}
|
||||
],
|
||||
|
@ -102,942 +102,7 @@ expression: actual
|
||||
]
|
||||
}
|
||||
],
|
||||
"optional": false,
|
||||
"function": {
|
||||
"type": "StdLib",
|
||||
"func": {
|
||||
"name": "lineTo",
|
||||
"summary": "Draw a line to a point.",
|
||||
"description": "",
|
||||
"tags": [],
|
||||
"args": [
|
||||
{
|
||||
"name": "data",
|
||||
"type": "LineToData",
|
||||
"schema": {
|
||||
"description": "Data to draw a line to a point.",
|
||||
"anyOf": [
|
||||
{
|
||||
"description": "A point with a tag.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"tag",
|
||||
"to"
|
||||
],
|
||||
"properties": {
|
||||
"tag": {
|
||||
"description": "The tag.",
|
||||
"type": "string"
|
||||
},
|
||||
"to": {
|
||||
"description": "The to point.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"description": "A point.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
}
|
||||
]
|
||||
},
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"name": "sketch_group",
|
||||
"type": "SketchGroup",
|
||||
"schema": {
|
||||
"description": "A sketch group is a collection of paths.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"__meta",
|
||||
"id",
|
||||
"position",
|
||||
"rotation",
|
||||
"start",
|
||||
"value"
|
||||
],
|
||||
"properties": {
|
||||
"__meta": {
|
||||
"description": "Metadata.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"description": "Metadata.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"sourceRange"
|
||||
],
|
||||
"properties": {
|
||||
"sourceRange": {
|
||||
"description": "The source range.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "integer",
|
||||
"format": "uint",
|
||||
"minimum": 0.0
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"id": {
|
||||
"description": "The id of the sketch group.",
|
||||
"type": "string",
|
||||
"format": "uuid"
|
||||
},
|
||||
"planeId": {
|
||||
"description": "The plane id of the sketch group.",
|
||||
"type": "string",
|
||||
"format": "uuid",
|
||||
"nullable": true
|
||||
},
|
||||
"position": {
|
||||
"description": "The position of the sketch group.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 3,
|
||||
"minItems": 3
|
||||
},
|
||||
"rotation": {
|
||||
"description": "The rotation of the sketch group.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 4,
|
||||
"minItems": 4
|
||||
},
|
||||
"start": {
|
||||
"description": "The starting path.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"__geoMeta",
|
||||
"from",
|
||||
"name",
|
||||
"to"
|
||||
],
|
||||
"properties": {
|
||||
"__geoMeta": {
|
||||
"description": "Metadata.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"id",
|
||||
"sourceRange"
|
||||
],
|
||||
"properties": {
|
||||
"id": {
|
||||
"description": "The id of the geometry.",
|
||||
"type": "string",
|
||||
"format": "uuid"
|
||||
},
|
||||
"sourceRange": {
|
||||
"description": "The source range.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "integer",
|
||||
"format": "uint",
|
||||
"minimum": 0.0
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
}
|
||||
}
|
||||
},
|
||||
"from": {
|
||||
"description": "The from point.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
},
|
||||
"name": {
|
||||
"description": "The name of the path.",
|
||||
"type": "string"
|
||||
},
|
||||
"to": {
|
||||
"description": "The to point.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
}
|
||||
}
|
||||
},
|
||||
"value": {
|
||||
"description": "The paths in the sketch group.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"description": "A path.",
|
||||
"oneOf": [
|
||||
{
|
||||
"description": "A path that goes to a point.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"__geoMeta",
|
||||
"from",
|
||||
"name",
|
||||
"to",
|
||||
"type"
|
||||
],
|
||||
"properties": {
|
||||
"__geoMeta": {
|
||||
"description": "Metadata.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"id",
|
||||
"sourceRange"
|
||||
],
|
||||
"properties": {
|
||||
"id": {
|
||||
"description": "The id of the geometry.",
|
||||
"type": "string",
|
||||
"format": "uuid"
|
||||
},
|
||||
"sourceRange": {
|
||||
"description": "The source range.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "integer",
|
||||
"format": "uint",
|
||||
"minimum": 0.0
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
}
|
||||
}
|
||||
},
|
||||
"from": {
|
||||
"description": "The from point.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
},
|
||||
"name": {
|
||||
"description": "The name of the path.",
|
||||
"type": "string"
|
||||
},
|
||||
"to": {
|
||||
"description": "The to point.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
},
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"toPoint"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"description": "A path that is horizontal.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"__geoMeta",
|
||||
"from",
|
||||
"name",
|
||||
"to",
|
||||
"type",
|
||||
"x"
|
||||
],
|
||||
"properties": {
|
||||
"__geoMeta": {
|
||||
"description": "Metadata.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"id",
|
||||
"sourceRange"
|
||||
],
|
||||
"properties": {
|
||||
"id": {
|
||||
"description": "The id of the geometry.",
|
||||
"type": "string",
|
||||
"format": "uuid"
|
||||
},
|
||||
"sourceRange": {
|
||||
"description": "The source range.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "integer",
|
||||
"format": "uint",
|
||||
"minimum": 0.0
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
}
|
||||
}
|
||||
},
|
||||
"from": {
|
||||
"description": "The from point.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
},
|
||||
"name": {
|
||||
"description": "The name of the path.",
|
||||
"type": "string"
|
||||
},
|
||||
"to": {
|
||||
"description": "The to point.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
},
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"horizontal"
|
||||
]
|
||||
},
|
||||
"x": {
|
||||
"description": "The x coordinate.",
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"description": "An angled line to.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"__geoMeta",
|
||||
"from",
|
||||
"name",
|
||||
"to",
|
||||
"type"
|
||||
],
|
||||
"properties": {
|
||||
"__geoMeta": {
|
||||
"description": "Metadata.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"id",
|
||||
"sourceRange"
|
||||
],
|
||||
"properties": {
|
||||
"id": {
|
||||
"description": "The id of the geometry.",
|
||||
"type": "string",
|
||||
"format": "uuid"
|
||||
},
|
||||
"sourceRange": {
|
||||
"description": "The source range.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "integer",
|
||||
"format": "uint",
|
||||
"minimum": 0.0
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
}
|
||||
}
|
||||
},
|
||||
"from": {
|
||||
"description": "The from point.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
},
|
||||
"name": {
|
||||
"description": "The name of the path.",
|
||||
"type": "string"
|
||||
},
|
||||
"to": {
|
||||
"description": "The to point.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
},
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"angledLineTo"
|
||||
]
|
||||
},
|
||||
"x": {
|
||||
"description": "The x coordinate.",
|
||||
"type": "number",
|
||||
"format": "double",
|
||||
"nullable": true
|
||||
},
|
||||
"y": {
|
||||
"description": "The y coordinate.",
|
||||
"type": "number",
|
||||
"format": "double",
|
||||
"nullable": true
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"description": "A base path.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"__geoMeta",
|
||||
"from",
|
||||
"name",
|
||||
"to",
|
||||
"type"
|
||||
],
|
||||
"properties": {
|
||||
"__geoMeta": {
|
||||
"description": "Metadata.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"id",
|
||||
"sourceRange"
|
||||
],
|
||||
"properties": {
|
||||
"id": {
|
||||
"description": "The id of the geometry.",
|
||||
"type": "string",
|
||||
"format": "uuid"
|
||||
},
|
||||
"sourceRange": {
|
||||
"description": "The source range.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "integer",
|
||||
"format": "uint",
|
||||
"minimum": 0.0
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
}
|
||||
}
|
||||
},
|
||||
"from": {
|
||||
"description": "The from point.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
},
|
||||
"name": {
|
||||
"description": "The name of the path.",
|
||||
"type": "string"
|
||||
},
|
||||
"to": {
|
||||
"description": "The to point.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
},
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"base"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": true
|
||||
}
|
||||
],
|
||||
"returnValue": {
|
||||
"name": "",
|
||||
"type": "SketchGroup",
|
||||
"schema": {
|
||||
"description": "A sketch group is a collection of paths.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"__meta",
|
||||
"id",
|
||||
"position",
|
||||
"rotation",
|
||||
"start",
|
||||
"value"
|
||||
],
|
||||
"properties": {
|
||||
"__meta": {
|
||||
"description": "Metadata.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"description": "Metadata.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"sourceRange"
|
||||
],
|
||||
"properties": {
|
||||
"sourceRange": {
|
||||
"description": "The source range.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "integer",
|
||||
"format": "uint",
|
||||
"minimum": 0.0
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"id": {
|
||||
"description": "The id of the sketch group.",
|
||||
"type": "string",
|
||||
"format": "uuid"
|
||||
},
|
||||
"planeId": {
|
||||
"description": "The plane id of the sketch group.",
|
||||
"type": "string",
|
||||
"format": "uuid",
|
||||
"nullable": true
|
||||
},
|
||||
"position": {
|
||||
"description": "The position of the sketch group.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 3,
|
||||
"minItems": 3
|
||||
},
|
||||
"rotation": {
|
||||
"description": "The rotation of the sketch group.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 4,
|
||||
"minItems": 4
|
||||
},
|
||||
"start": {
|
||||
"description": "The starting path.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"__geoMeta",
|
||||
"from",
|
||||
"name",
|
||||
"to"
|
||||
],
|
||||
"properties": {
|
||||
"__geoMeta": {
|
||||
"description": "Metadata.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"id",
|
||||
"sourceRange"
|
||||
],
|
||||
"properties": {
|
||||
"id": {
|
||||
"description": "The id of the geometry.",
|
||||
"type": "string",
|
||||
"format": "uuid"
|
||||
},
|
||||
"sourceRange": {
|
||||
"description": "The source range.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "integer",
|
||||
"format": "uint",
|
||||
"minimum": 0.0
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
}
|
||||
}
|
||||
},
|
||||
"from": {
|
||||
"description": "The from point.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
},
|
||||
"name": {
|
||||
"description": "The name of the path.",
|
||||
"type": "string"
|
||||
},
|
||||
"to": {
|
||||
"description": "The to point.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
}
|
||||
}
|
||||
},
|
||||
"value": {
|
||||
"description": "The paths in the sketch group.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"description": "A path.",
|
||||
"oneOf": [
|
||||
{
|
||||
"description": "A path that goes to a point.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"__geoMeta",
|
||||
"from",
|
||||
"name",
|
||||
"to",
|
||||
"type"
|
||||
],
|
||||
"properties": {
|
||||
"__geoMeta": {
|
||||
"description": "Metadata.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"id",
|
||||
"sourceRange"
|
||||
],
|
||||
"properties": {
|
||||
"id": {
|
||||
"description": "The id of the geometry.",
|
||||
"type": "string",
|
||||
"format": "uuid"
|
||||
},
|
||||
"sourceRange": {
|
||||
"description": "The source range.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "integer",
|
||||
"format": "uint",
|
||||
"minimum": 0.0
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
}
|
||||
}
|
||||
},
|
||||
"from": {
|
||||
"description": "The from point.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
},
|
||||
"name": {
|
||||
"description": "The name of the path.",
|
||||
"type": "string"
|
||||
},
|
||||
"to": {
|
||||
"description": "The to point.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
},
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"toPoint"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"description": "A path that is horizontal.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"__geoMeta",
|
||||
"from",
|
||||
"name",
|
||||
"to",
|
||||
"type",
|
||||
"x"
|
||||
],
|
||||
"properties": {
|
||||
"__geoMeta": {
|
||||
"description": "Metadata.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"id",
|
||||
"sourceRange"
|
||||
],
|
||||
"properties": {
|
||||
"id": {
|
||||
"description": "The id of the geometry.",
|
||||
"type": "string",
|
||||
"format": "uuid"
|
||||
},
|
||||
"sourceRange": {
|
||||
"description": "The source range.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "integer",
|
||||
"format": "uint",
|
||||
"minimum": 0.0
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
}
|
||||
}
|
||||
},
|
||||
"from": {
|
||||
"description": "The from point.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
},
|
||||
"name": {
|
||||
"description": "The name of the path.",
|
||||
"type": "string"
|
||||
},
|
||||
"to": {
|
||||
"description": "The to point.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
},
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"horizontal"
|
||||
]
|
||||
},
|
||||
"x": {
|
||||
"description": "The x coordinate.",
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"description": "An angled line to.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"__geoMeta",
|
||||
"from",
|
||||
"name",
|
||||
"to",
|
||||
"type"
|
||||
],
|
||||
"properties": {
|
||||
"__geoMeta": {
|
||||
"description": "Metadata.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"id",
|
||||
"sourceRange"
|
||||
],
|
||||
"properties": {
|
||||
"id": {
|
||||
"description": "The id of the geometry.",
|
||||
"type": "string",
|
||||
"format": "uuid"
|
||||
},
|
||||
"sourceRange": {
|
||||
"description": "The source range.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "integer",
|
||||
"format": "uint",
|
||||
"minimum": 0.0
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
}
|
||||
}
|
||||
},
|
||||
"from": {
|
||||
"description": "The from point.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
},
|
||||
"name": {
|
||||
"description": "The name of the path.",
|
||||
"type": "string"
|
||||
},
|
||||
"to": {
|
||||
"description": "The to point.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
},
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"angledLineTo"
|
||||
]
|
||||
},
|
||||
"x": {
|
||||
"description": "The x coordinate.",
|
||||
"type": "number",
|
||||
"format": "double",
|
||||
"nullable": true
|
||||
},
|
||||
"y": {
|
||||
"description": "The y coordinate.",
|
||||
"type": "number",
|
||||
"format": "double",
|
||||
"nullable": true
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"description": "A base path.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"__geoMeta",
|
||||
"from",
|
||||
"name",
|
||||
"to",
|
||||
"type"
|
||||
],
|
||||
"properties": {
|
||||
"__geoMeta": {
|
||||
"description": "Metadata.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"id",
|
||||
"sourceRange"
|
||||
],
|
||||
"properties": {
|
||||
"id": {
|
||||
"description": "The id of the geometry.",
|
||||
"type": "string",
|
||||
"format": "uuid"
|
||||
},
|
||||
"sourceRange": {
|
||||
"description": "The source range.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "integer",
|
||||
"format": "uint",
|
||||
"minimum": 0.0
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
}
|
||||
}
|
||||
},
|
||||
"from": {
|
||||
"description": "The from point.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
},
|
||||
"name": {
|
||||
"description": "The name of the path.",
|
||||
"type": "string"
|
||||
},
|
||||
"to": {
|
||||
"description": "The to point.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
},
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"base"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": true
|
||||
},
|
||||
"unpublished": false,
|
||||
"deprecated": false
|
||||
}
|
||||
}
|
||||
"optional": false
|
||||
}
|
||||
}
|
||||
],
|
||||
|
@ -59,503 +59,7 @@ expression: actual
|
||||
]
|
||||
}
|
||||
],
|
||||
"optional": false,
|
||||
"function": {
|
||||
"type": "StdLib",
|
||||
"func": {
|
||||
"name": "startSketchAt",
|
||||
"summary": "Start a sketch at a given point on the 'XY' plane.",
|
||||
"description": "",
|
||||
"tags": [],
|
||||
"args": [
|
||||
{
|
||||
"name": "data",
|
||||
"type": "LineData",
|
||||
"schema": {
|
||||
"description": "Data to draw a line.",
|
||||
"anyOf": [
|
||||
{
|
||||
"description": "A point with a tag.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"tag",
|
||||
"to"
|
||||
],
|
||||
"properties": {
|
||||
"tag": {
|
||||
"description": "The tag.",
|
||||
"type": "string"
|
||||
},
|
||||
"to": {
|
||||
"description": "The to point.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"description": "A point.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
}
|
||||
]
|
||||
},
|
||||
"required": true
|
||||
}
|
||||
],
|
||||
"returnValue": {
|
||||
"name": "",
|
||||
"type": "SketchGroup",
|
||||
"schema": {
|
||||
"description": "A sketch group is a collection of paths.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"__meta",
|
||||
"id",
|
||||
"position",
|
||||
"rotation",
|
||||
"start",
|
||||
"value"
|
||||
],
|
||||
"properties": {
|
||||
"__meta": {
|
||||
"description": "Metadata.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"description": "Metadata.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"sourceRange"
|
||||
],
|
||||
"properties": {
|
||||
"sourceRange": {
|
||||
"description": "The source range.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "integer",
|
||||
"format": "uint",
|
||||
"minimum": 0.0
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"id": {
|
||||
"description": "The id of the sketch group.",
|
||||
"type": "string",
|
||||
"format": "uuid"
|
||||
},
|
||||
"planeId": {
|
||||
"description": "The plane id of the sketch group.",
|
||||
"type": "string",
|
||||
"format": "uuid",
|
||||
"nullable": true
|
||||
},
|
||||
"position": {
|
||||
"description": "The position of the sketch group.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 3,
|
||||
"minItems": 3
|
||||
},
|
||||
"rotation": {
|
||||
"description": "The rotation of the sketch group.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 4,
|
||||
"minItems": 4
|
||||
},
|
||||
"start": {
|
||||
"description": "The starting path.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"__geoMeta",
|
||||
"from",
|
||||
"name",
|
||||
"to"
|
||||
],
|
||||
"properties": {
|
||||
"__geoMeta": {
|
||||
"description": "Metadata.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"id",
|
||||
"sourceRange"
|
||||
],
|
||||
"properties": {
|
||||
"id": {
|
||||
"description": "The id of the geometry.",
|
||||
"type": "string",
|
||||
"format": "uuid"
|
||||
},
|
||||
"sourceRange": {
|
||||
"description": "The source range.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "integer",
|
||||
"format": "uint",
|
||||
"minimum": 0.0
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
}
|
||||
}
|
||||
},
|
||||
"from": {
|
||||
"description": "The from point.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
},
|
||||
"name": {
|
||||
"description": "The name of the path.",
|
||||
"type": "string"
|
||||
},
|
||||
"to": {
|
||||
"description": "The to point.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
}
|
||||
}
|
||||
},
|
||||
"value": {
|
||||
"description": "The paths in the sketch group.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"description": "A path.",
|
||||
"oneOf": [
|
||||
{
|
||||
"description": "A path that goes to a point.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"__geoMeta",
|
||||
"from",
|
||||
"name",
|
||||
"to",
|
||||
"type"
|
||||
],
|
||||
"properties": {
|
||||
"__geoMeta": {
|
||||
"description": "Metadata.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"id",
|
||||
"sourceRange"
|
||||
],
|
||||
"properties": {
|
||||
"id": {
|
||||
"description": "The id of the geometry.",
|
||||
"type": "string",
|
||||
"format": "uuid"
|
||||
},
|
||||
"sourceRange": {
|
||||
"description": "The source range.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "integer",
|
||||
"format": "uint",
|
||||
"minimum": 0.0
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
}
|
||||
}
|
||||
},
|
||||
"from": {
|
||||
"description": "The from point.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
},
|
||||
"name": {
|
||||
"description": "The name of the path.",
|
||||
"type": "string"
|
||||
},
|
||||
"to": {
|
||||
"description": "The to point.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
},
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"toPoint"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"description": "A path that is horizontal.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"__geoMeta",
|
||||
"from",
|
||||
"name",
|
||||
"to",
|
||||
"type",
|
||||
"x"
|
||||
],
|
||||
"properties": {
|
||||
"__geoMeta": {
|
||||
"description": "Metadata.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"id",
|
||||
"sourceRange"
|
||||
],
|
||||
"properties": {
|
||||
"id": {
|
||||
"description": "The id of the geometry.",
|
||||
"type": "string",
|
||||
"format": "uuid"
|
||||
},
|
||||
"sourceRange": {
|
||||
"description": "The source range.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "integer",
|
||||
"format": "uint",
|
||||
"minimum": 0.0
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
}
|
||||
}
|
||||
},
|
||||
"from": {
|
||||
"description": "The from point.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
},
|
||||
"name": {
|
||||
"description": "The name of the path.",
|
||||
"type": "string"
|
||||
},
|
||||
"to": {
|
||||
"description": "The to point.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
},
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"horizontal"
|
||||
]
|
||||
},
|
||||
"x": {
|
||||
"description": "The x coordinate.",
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"description": "An angled line to.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"__geoMeta",
|
||||
"from",
|
||||
"name",
|
||||
"to",
|
||||
"type"
|
||||
],
|
||||
"properties": {
|
||||
"__geoMeta": {
|
||||
"description": "Metadata.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"id",
|
||||
"sourceRange"
|
||||
],
|
||||
"properties": {
|
||||
"id": {
|
||||
"description": "The id of the geometry.",
|
||||
"type": "string",
|
||||
"format": "uuid"
|
||||
},
|
||||
"sourceRange": {
|
||||
"description": "The source range.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "integer",
|
||||
"format": "uint",
|
||||
"minimum": 0.0
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
}
|
||||
}
|
||||
},
|
||||
"from": {
|
||||
"description": "The from point.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
},
|
||||
"name": {
|
||||
"description": "The name of the path.",
|
||||
"type": "string"
|
||||
},
|
||||
"to": {
|
||||
"description": "The to point.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
},
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"angledLineTo"
|
||||
]
|
||||
},
|
||||
"x": {
|
||||
"description": "The x coordinate.",
|
||||
"type": "number",
|
||||
"format": "double",
|
||||
"nullable": true
|
||||
},
|
||||
"y": {
|
||||
"description": "The y coordinate.",
|
||||
"type": "number",
|
||||
"format": "double",
|
||||
"nullable": true
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"description": "A base path.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"__geoMeta",
|
||||
"from",
|
||||
"name",
|
||||
"to",
|
||||
"type"
|
||||
],
|
||||
"properties": {
|
||||
"__geoMeta": {
|
||||
"description": "Metadata.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"id",
|
||||
"sourceRange"
|
||||
],
|
||||
"properties": {
|
||||
"id": {
|
||||
"description": "The id of the geometry.",
|
||||
"type": "string",
|
||||
"format": "uuid"
|
||||
},
|
||||
"sourceRange": {
|
||||
"description": "The source range.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "integer",
|
||||
"format": "uint",
|
||||
"minimum": 0.0
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
}
|
||||
}
|
||||
},
|
||||
"from": {
|
||||
"description": "The from point.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
},
|
||||
"name": {
|
||||
"description": "The name of the path.",
|
||||
"type": "string"
|
||||
},
|
||||
"to": {
|
||||
"description": "The to point.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
},
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"base"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": true
|
||||
},
|
||||
"unpublished": false,
|
||||
"deprecated": false
|
||||
}
|
||||
}
|
||||
"optional": false
|
||||
}
|
||||
}
|
||||
],
|
||||
|
@ -47,47 +47,7 @@ expression: actual
|
||||
"name": "aIdentifier"
|
||||
}
|
||||
],
|
||||
"optional": false,
|
||||
"function": {
|
||||
"type": "StdLib",
|
||||
"func": {
|
||||
"name": "log",
|
||||
"summary": "Computes the logarithm of the number with respect to an arbitrary base.",
|
||||
"description": "The result might not be correctly rounded owing to implementation details; `log2()` can produce more accurate results for base 2, and `log10()` can produce more accurate results for base 10.",
|
||||
"tags": [],
|
||||
"args": [
|
||||
{
|
||||
"name": "num",
|
||||
"type": "number",
|
||||
"schema": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"name": "base",
|
||||
"type": "number",
|
||||
"schema": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"required": true
|
||||
}
|
||||
],
|
||||
"returnValue": {
|
||||
"name": "",
|
||||
"type": "number",
|
||||
"schema": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"required": true
|
||||
},
|
||||
"unpublished": false,
|
||||
"deprecated": false
|
||||
}
|
||||
}
|
||||
"optional": false
|
||||
}
|
||||
}
|
||||
],
|
||||
|
@ -53,942 +53,7 @@ expression: actual
|
||||
"end": 14
|
||||
}
|
||||
],
|
||||
"optional": false,
|
||||
"function": {
|
||||
"type": "StdLib",
|
||||
"func": {
|
||||
"name": "line",
|
||||
"summary": "Draw a line.",
|
||||
"description": "",
|
||||
"tags": [],
|
||||
"args": [
|
||||
{
|
||||
"name": "data",
|
||||
"type": "LineData",
|
||||
"schema": {
|
||||
"description": "Data to draw a line.",
|
||||
"anyOf": [
|
||||
{
|
||||
"description": "A point with a tag.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"tag",
|
||||
"to"
|
||||
],
|
||||
"properties": {
|
||||
"tag": {
|
||||
"description": "The tag.",
|
||||
"type": "string"
|
||||
},
|
||||
"to": {
|
||||
"description": "The to point.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"description": "A point.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
}
|
||||
]
|
||||
},
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"name": "sketch_group",
|
||||
"type": "SketchGroup",
|
||||
"schema": {
|
||||
"description": "A sketch group is a collection of paths.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"__meta",
|
||||
"id",
|
||||
"position",
|
||||
"rotation",
|
||||
"start",
|
||||
"value"
|
||||
],
|
||||
"properties": {
|
||||
"__meta": {
|
||||
"description": "Metadata.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"description": "Metadata.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"sourceRange"
|
||||
],
|
||||
"properties": {
|
||||
"sourceRange": {
|
||||
"description": "The source range.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "integer",
|
||||
"format": "uint",
|
||||
"minimum": 0.0
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"id": {
|
||||
"description": "The id of the sketch group.",
|
||||
"type": "string",
|
||||
"format": "uuid"
|
||||
},
|
||||
"planeId": {
|
||||
"description": "The plane id of the sketch group.",
|
||||
"type": "string",
|
||||
"format": "uuid",
|
||||
"nullable": true
|
||||
},
|
||||
"position": {
|
||||
"description": "The position of the sketch group.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 3,
|
||||
"minItems": 3
|
||||
},
|
||||
"rotation": {
|
||||
"description": "The rotation of the sketch group.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 4,
|
||||
"minItems": 4
|
||||
},
|
||||
"start": {
|
||||
"description": "The starting path.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"__geoMeta",
|
||||
"from",
|
||||
"name",
|
||||
"to"
|
||||
],
|
||||
"properties": {
|
||||
"__geoMeta": {
|
||||
"description": "Metadata.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"id",
|
||||
"sourceRange"
|
||||
],
|
||||
"properties": {
|
||||
"id": {
|
||||
"description": "The id of the geometry.",
|
||||
"type": "string",
|
||||
"format": "uuid"
|
||||
},
|
||||
"sourceRange": {
|
||||
"description": "The source range.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "integer",
|
||||
"format": "uint",
|
||||
"minimum": 0.0
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
}
|
||||
}
|
||||
},
|
||||
"from": {
|
||||
"description": "The from point.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
},
|
||||
"name": {
|
||||
"description": "The name of the path.",
|
||||
"type": "string"
|
||||
},
|
||||
"to": {
|
||||
"description": "The to point.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
}
|
||||
}
|
||||
},
|
||||
"value": {
|
||||
"description": "The paths in the sketch group.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"description": "A path.",
|
||||
"oneOf": [
|
||||
{
|
||||
"description": "A path that goes to a point.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"__geoMeta",
|
||||
"from",
|
||||
"name",
|
||||
"to",
|
||||
"type"
|
||||
],
|
||||
"properties": {
|
||||
"__geoMeta": {
|
||||
"description": "Metadata.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"id",
|
||||
"sourceRange"
|
||||
],
|
||||
"properties": {
|
||||
"id": {
|
||||
"description": "The id of the geometry.",
|
||||
"type": "string",
|
||||
"format": "uuid"
|
||||
},
|
||||
"sourceRange": {
|
||||
"description": "The source range.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "integer",
|
||||
"format": "uint",
|
||||
"minimum": 0.0
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
}
|
||||
}
|
||||
},
|
||||
"from": {
|
||||
"description": "The from point.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
},
|
||||
"name": {
|
||||
"description": "The name of the path.",
|
||||
"type": "string"
|
||||
},
|
||||
"to": {
|
||||
"description": "The to point.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
},
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"toPoint"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"description": "A path that is horizontal.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"__geoMeta",
|
||||
"from",
|
||||
"name",
|
||||
"to",
|
||||
"type",
|
||||
"x"
|
||||
],
|
||||
"properties": {
|
||||
"__geoMeta": {
|
||||
"description": "Metadata.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"id",
|
||||
"sourceRange"
|
||||
],
|
||||
"properties": {
|
||||
"id": {
|
||||
"description": "The id of the geometry.",
|
||||
"type": "string",
|
||||
"format": "uuid"
|
||||
},
|
||||
"sourceRange": {
|
||||
"description": "The source range.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "integer",
|
||||
"format": "uint",
|
||||
"minimum": 0.0
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
}
|
||||
}
|
||||
},
|
||||
"from": {
|
||||
"description": "The from point.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
},
|
||||
"name": {
|
||||
"description": "The name of the path.",
|
||||
"type": "string"
|
||||
},
|
||||
"to": {
|
||||
"description": "The to point.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
},
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"horizontal"
|
||||
]
|
||||
},
|
||||
"x": {
|
||||
"description": "The x coordinate.",
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"description": "An angled line to.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"__geoMeta",
|
||||
"from",
|
||||
"name",
|
||||
"to",
|
||||
"type"
|
||||
],
|
||||
"properties": {
|
||||
"__geoMeta": {
|
||||
"description": "Metadata.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"id",
|
||||
"sourceRange"
|
||||
],
|
||||
"properties": {
|
||||
"id": {
|
||||
"description": "The id of the geometry.",
|
||||
"type": "string",
|
||||
"format": "uuid"
|
||||
},
|
||||
"sourceRange": {
|
||||
"description": "The source range.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "integer",
|
||||
"format": "uint",
|
||||
"minimum": 0.0
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
}
|
||||
}
|
||||
},
|
||||
"from": {
|
||||
"description": "The from point.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
},
|
||||
"name": {
|
||||
"description": "The name of the path.",
|
||||
"type": "string"
|
||||
},
|
||||
"to": {
|
||||
"description": "The to point.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
},
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"angledLineTo"
|
||||
]
|
||||
},
|
||||
"x": {
|
||||
"description": "The x coordinate.",
|
||||
"type": "number",
|
||||
"format": "double",
|
||||
"nullable": true
|
||||
},
|
||||
"y": {
|
||||
"description": "The y coordinate.",
|
||||
"type": "number",
|
||||
"format": "double",
|
||||
"nullable": true
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"description": "A base path.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"__geoMeta",
|
||||
"from",
|
||||
"name",
|
||||
"to",
|
||||
"type"
|
||||
],
|
||||
"properties": {
|
||||
"__geoMeta": {
|
||||
"description": "Metadata.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"id",
|
||||
"sourceRange"
|
||||
],
|
||||
"properties": {
|
||||
"id": {
|
||||
"description": "The id of the geometry.",
|
||||
"type": "string",
|
||||
"format": "uuid"
|
||||
},
|
||||
"sourceRange": {
|
||||
"description": "The source range.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "integer",
|
||||
"format": "uint",
|
||||
"minimum": 0.0
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
}
|
||||
}
|
||||
},
|
||||
"from": {
|
||||
"description": "The from point.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
},
|
||||
"name": {
|
||||
"description": "The name of the path.",
|
||||
"type": "string"
|
||||
},
|
||||
"to": {
|
||||
"description": "The to point.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
},
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"base"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": true
|
||||
}
|
||||
],
|
||||
"returnValue": {
|
||||
"name": "",
|
||||
"type": "SketchGroup",
|
||||
"schema": {
|
||||
"description": "A sketch group is a collection of paths.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"__meta",
|
||||
"id",
|
||||
"position",
|
||||
"rotation",
|
||||
"start",
|
||||
"value"
|
||||
],
|
||||
"properties": {
|
||||
"__meta": {
|
||||
"description": "Metadata.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"description": "Metadata.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"sourceRange"
|
||||
],
|
||||
"properties": {
|
||||
"sourceRange": {
|
||||
"description": "The source range.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "integer",
|
||||
"format": "uint",
|
||||
"minimum": 0.0
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"id": {
|
||||
"description": "The id of the sketch group.",
|
||||
"type": "string",
|
||||
"format": "uuid"
|
||||
},
|
||||
"planeId": {
|
||||
"description": "The plane id of the sketch group.",
|
||||
"type": "string",
|
||||
"format": "uuid",
|
||||
"nullable": true
|
||||
},
|
||||
"position": {
|
||||
"description": "The position of the sketch group.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 3,
|
||||
"minItems": 3
|
||||
},
|
||||
"rotation": {
|
||||
"description": "The rotation of the sketch group.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 4,
|
||||
"minItems": 4
|
||||
},
|
||||
"start": {
|
||||
"description": "The starting path.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"__geoMeta",
|
||||
"from",
|
||||
"name",
|
||||
"to"
|
||||
],
|
||||
"properties": {
|
||||
"__geoMeta": {
|
||||
"description": "Metadata.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"id",
|
||||
"sourceRange"
|
||||
],
|
||||
"properties": {
|
||||
"id": {
|
||||
"description": "The id of the geometry.",
|
||||
"type": "string",
|
||||
"format": "uuid"
|
||||
},
|
||||
"sourceRange": {
|
||||
"description": "The source range.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "integer",
|
||||
"format": "uint",
|
||||
"minimum": 0.0
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
}
|
||||
}
|
||||
},
|
||||
"from": {
|
||||
"description": "The from point.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
},
|
||||
"name": {
|
||||
"description": "The name of the path.",
|
||||
"type": "string"
|
||||
},
|
||||
"to": {
|
||||
"description": "The to point.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
}
|
||||
}
|
||||
},
|
||||
"value": {
|
||||
"description": "The paths in the sketch group.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"description": "A path.",
|
||||
"oneOf": [
|
||||
{
|
||||
"description": "A path that goes to a point.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"__geoMeta",
|
||||
"from",
|
||||
"name",
|
||||
"to",
|
||||
"type"
|
||||
],
|
||||
"properties": {
|
||||
"__geoMeta": {
|
||||
"description": "Metadata.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"id",
|
||||
"sourceRange"
|
||||
],
|
||||
"properties": {
|
||||
"id": {
|
||||
"description": "The id of the geometry.",
|
||||
"type": "string",
|
||||
"format": "uuid"
|
||||
},
|
||||
"sourceRange": {
|
||||
"description": "The source range.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "integer",
|
||||
"format": "uint",
|
||||
"minimum": 0.0
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
}
|
||||
}
|
||||
},
|
||||
"from": {
|
||||
"description": "The from point.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
},
|
||||
"name": {
|
||||
"description": "The name of the path.",
|
||||
"type": "string"
|
||||
},
|
||||
"to": {
|
||||
"description": "The to point.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
},
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"toPoint"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"description": "A path that is horizontal.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"__geoMeta",
|
||||
"from",
|
||||
"name",
|
||||
"to",
|
||||
"type",
|
||||
"x"
|
||||
],
|
||||
"properties": {
|
||||
"__geoMeta": {
|
||||
"description": "Metadata.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"id",
|
||||
"sourceRange"
|
||||
],
|
||||
"properties": {
|
||||
"id": {
|
||||
"description": "The id of the geometry.",
|
||||
"type": "string",
|
||||
"format": "uuid"
|
||||
},
|
||||
"sourceRange": {
|
||||
"description": "The source range.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "integer",
|
||||
"format": "uint",
|
||||
"minimum": 0.0
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
}
|
||||
}
|
||||
},
|
||||
"from": {
|
||||
"description": "The from point.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
},
|
||||
"name": {
|
||||
"description": "The name of the path.",
|
||||
"type": "string"
|
||||
},
|
||||
"to": {
|
||||
"description": "The to point.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
},
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"horizontal"
|
||||
]
|
||||
},
|
||||
"x": {
|
||||
"description": "The x coordinate.",
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"description": "An angled line to.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"__geoMeta",
|
||||
"from",
|
||||
"name",
|
||||
"to",
|
||||
"type"
|
||||
],
|
||||
"properties": {
|
||||
"__geoMeta": {
|
||||
"description": "Metadata.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"id",
|
||||
"sourceRange"
|
||||
],
|
||||
"properties": {
|
||||
"id": {
|
||||
"description": "The id of the geometry.",
|
||||
"type": "string",
|
||||
"format": "uuid"
|
||||
},
|
||||
"sourceRange": {
|
||||
"description": "The source range.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "integer",
|
||||
"format": "uint",
|
||||
"minimum": 0.0
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
}
|
||||
}
|
||||
},
|
||||
"from": {
|
||||
"description": "The from point.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
},
|
||||
"name": {
|
||||
"description": "The name of the path.",
|
||||
"type": "string"
|
||||
},
|
||||
"to": {
|
||||
"description": "The to point.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
},
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"angledLineTo"
|
||||
]
|
||||
},
|
||||
"x": {
|
||||
"description": "The x coordinate.",
|
||||
"type": "number",
|
||||
"format": "double",
|
||||
"nullable": true
|
||||
},
|
||||
"y": {
|
||||
"description": "The y coordinate.",
|
||||
"type": "number",
|
||||
"format": "double",
|
||||
"nullable": true
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"description": "A base path.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"__geoMeta",
|
||||
"from",
|
||||
"name",
|
||||
"to",
|
||||
"type"
|
||||
],
|
||||
"properties": {
|
||||
"__geoMeta": {
|
||||
"description": "Metadata.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"id",
|
||||
"sourceRange"
|
||||
],
|
||||
"properties": {
|
||||
"id": {
|
||||
"description": "The id of the geometry.",
|
||||
"type": "string",
|
||||
"format": "uuid"
|
||||
},
|
||||
"sourceRange": {
|
||||
"description": "The source range.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "integer",
|
||||
"format": "uint",
|
||||
"minimum": 0.0
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
}
|
||||
}
|
||||
},
|
||||
"from": {
|
||||
"description": "The from point.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
},
|
||||
"name": {
|
||||
"description": "The name of the path.",
|
||||
"type": "string"
|
||||
},
|
||||
"to": {
|
||||
"description": "The to point.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
},
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"base"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": true
|
||||
},
|
||||
"unpublished": false,
|
||||
"deprecated": false
|
||||
}
|
||||
}
|
||||
"optional": false
|
||||
}
|
||||
}
|
||||
],
|
||||
|
@ -0,0 +1,158 @@
|
||||
---
|
||||
source: kcl/src/parser/parser_impl.rs
|
||||
expression: actual
|
||||
---
|
||||
{
|
||||
"start": 0,
|
||||
"end": 90,
|
||||
"body": [
|
||||
{
|
||||
"type": "VariableDeclaration",
|
||||
"type": "VariableDeclaration",
|
||||
"start": 0,
|
||||
"end": 74,
|
||||
"declarations": [
|
||||
{
|
||||
"type": "VariableDeclarator",
|
||||
"start": 6,
|
||||
"end": 74,
|
||||
"id": {
|
||||
"type": "Identifier",
|
||||
"start": 6,
|
||||
"end": 14,
|
||||
"name": "cylinder"
|
||||
},
|
||||
"init": {
|
||||
"type": "PipeExpression",
|
||||
"type": "PipeExpression",
|
||||
"start": 17,
|
||||
"end": 74,
|
||||
"body": [
|
||||
{
|
||||
"type": "CallExpression",
|
||||
"type": "CallExpression",
|
||||
"start": 17,
|
||||
"end": 56,
|
||||
"callee": {
|
||||
"type": "Identifier",
|
||||
"start": 17,
|
||||
"end": 39,
|
||||
"name": "unstable_stdlib_circle"
|
||||
},
|
||||
"arguments": [
|
||||
{
|
||||
"type": "Literal",
|
||||
"type": "Literal",
|
||||
"start": 40,
|
||||
"end": 44,
|
||||
"value": "XY",
|
||||
"raw": "'XY'"
|
||||
},
|
||||
{
|
||||
"type": "ArrayExpression",
|
||||
"type": "ArrayExpression",
|
||||
"start": 46,
|
||||
"end": 51,
|
||||
"elements": [
|
||||
{
|
||||
"type": "Literal",
|
||||
"type": "Literal",
|
||||
"start": 47,
|
||||
"end": 48,
|
||||
"value": 0,
|
||||
"raw": "0"
|
||||
},
|
||||
{
|
||||
"type": "Literal",
|
||||
"type": "Literal",
|
||||
"start": 49,
|
||||
"end": 50,
|
||||
"value": 0,
|
||||
"raw": "0"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "Literal",
|
||||
"type": "Literal",
|
||||
"start": 53,
|
||||
"end": 55,
|
||||
"value": 22,
|
||||
"raw": "22"
|
||||
}
|
||||
],
|
||||
"optional": false
|
||||
},
|
||||
{
|
||||
"type": "CallExpression",
|
||||
"type": "CallExpression",
|
||||
"start": 60,
|
||||
"end": 74,
|
||||
"callee": {
|
||||
"type": "Identifier",
|
||||
"start": 60,
|
||||
"end": 67,
|
||||
"name": "extrude"
|
||||
},
|
||||
"arguments": [
|
||||
{
|
||||
"type": "Literal",
|
||||
"type": "Literal",
|
||||
"start": 68,
|
||||
"end": 70,
|
||||
"value": 14,
|
||||
"raw": "14"
|
||||
},
|
||||
{
|
||||
"type": "PipeSubstitution",
|
||||
"type": "PipeSubstitution",
|
||||
"start": 72,
|
||||
"end": 73
|
||||
}
|
||||
],
|
||||
"optional": false
|
||||
}
|
||||
],
|
||||
"nonCodeMeta": {
|
||||
"nonCodeNodes": {},
|
||||
"start": []
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"kind": "const"
|
||||
},
|
||||
{
|
||||
"type": "ExpressionStatement",
|
||||
"type": "ExpressionStatement",
|
||||
"start": 75,
|
||||
"end": 89,
|
||||
"expression": {
|
||||
"type": "CallExpression",
|
||||
"type": "CallExpression",
|
||||
"start": 75,
|
||||
"end": 89,
|
||||
"callee": {
|
||||
"type": "Identifier",
|
||||
"start": 75,
|
||||
"end": 79,
|
||||
"name": "show"
|
||||
},
|
||||
"arguments": [
|
||||
{
|
||||
"type": "Identifier",
|
||||
"type": "Identifier",
|
||||
"start": 80,
|
||||
"end": 88,
|
||||
"name": "cylinder"
|
||||
}
|
||||
],
|
||||
"optional": false
|
||||
}
|
||||
}
|
||||
],
|
||||
"nonCodeMeta": {
|
||||
"nonCodeNodes": {},
|
||||
"start": []
|
||||
}
|
||||
}
|
@ -0,0 +1,97 @@
|
||||
---
|
||||
source: kcl/src/parser/parser_impl.rs
|
||||
expression: actual
|
||||
---
|
||||
{
|
||||
"start": 0,
|
||||
"end": 49,
|
||||
"body": [
|
||||
{
|
||||
"type": "VariableDeclaration",
|
||||
"type": "VariableDeclaration",
|
||||
"start": 0,
|
||||
"end": 49,
|
||||
"declarations": [
|
||||
{
|
||||
"type": "VariableDeclarator",
|
||||
"start": 3,
|
||||
"end": 49,
|
||||
"id": {
|
||||
"type": "Identifier",
|
||||
"start": 3,
|
||||
"end": 4,
|
||||
"name": "f"
|
||||
},
|
||||
"init": {
|
||||
"type": "FunctionExpression",
|
||||
"type": "FunctionExpression",
|
||||
"start": 7,
|
||||
"end": 49,
|
||||
"params": [
|
||||
{
|
||||
"identifier": {
|
||||
"type": "Identifier",
|
||||
"start": 8,
|
||||
"end": 13,
|
||||
"name": "angle"
|
||||
},
|
||||
"optional": true
|
||||
}
|
||||
],
|
||||
"body": {
|
||||
"start": 19,
|
||||
"end": 49,
|
||||
"body": [
|
||||
{
|
||||
"type": "ReturnStatement",
|
||||
"type": "ReturnStatement",
|
||||
"start": 21,
|
||||
"end": 47,
|
||||
"argument": {
|
||||
"type": "CallExpression",
|
||||
"type": "CallExpression",
|
||||
"start": 28,
|
||||
"end": 47,
|
||||
"callee": {
|
||||
"type": "Identifier",
|
||||
"start": 28,
|
||||
"end": 35,
|
||||
"name": "default"
|
||||
},
|
||||
"arguments": [
|
||||
{
|
||||
"type": "Identifier",
|
||||
"type": "Identifier",
|
||||
"start": 36,
|
||||
"end": 41,
|
||||
"name": "angle"
|
||||
},
|
||||
{
|
||||
"type": "Literal",
|
||||
"type": "Literal",
|
||||
"start": 43,
|
||||
"end": 46,
|
||||
"value": 360,
|
||||
"raw": "360"
|
||||
}
|
||||
],
|
||||
"optional": false
|
||||
}
|
||||
}
|
||||
],
|
||||
"nonCodeMeta": {
|
||||
"nonCodeNodes": {},
|
||||
"start": []
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"kind": "fn"
|
||||
}
|
||||
],
|
||||
"nonCodeMeta": {
|
||||
"nonCodeNodes": {},
|
||||
"start": []
|
||||
}
|
||||
}
|
@ -77,85 +77,11 @@ expression: actual
|
||||
"raw": "4"
|
||||
}
|
||||
],
|
||||
"optional": false,
|
||||
"function": {
|
||||
"type": "StdLib",
|
||||
"func": {
|
||||
"name": "legLen",
|
||||
"summary": "Returns the length of the given leg.",
|
||||
"description": "",
|
||||
"tags": [],
|
||||
"args": [
|
||||
{
|
||||
"name": "hypotenuse",
|
||||
"type": "number",
|
||||
"schema": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"name": "leg",
|
||||
"type": "number",
|
||||
"schema": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"required": true
|
||||
}
|
||||
],
|
||||
"returnValue": {
|
||||
"name": "",
|
||||
"type": "number",
|
||||
"schema": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"required": true
|
||||
},
|
||||
"unpublished": false,
|
||||
"deprecated": false
|
||||
}
|
||||
}
|
||||
"optional": false
|
||||
}
|
||||
}
|
||||
],
|
||||
"optional": false,
|
||||
"function": {
|
||||
"type": "StdLib",
|
||||
"func": {
|
||||
"name": "min",
|
||||
"summary": "Computes the minimum of the given arguments.",
|
||||
"description": "",
|
||||
"tags": [],
|
||||
"args": [
|
||||
{
|
||||
"name": "args",
|
||||
"type": "[number]",
|
||||
"schema": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
}
|
||||
},
|
||||
"required": true
|
||||
}
|
||||
],
|
||||
"returnValue": {
|
||||
"name": "",
|
||||
"type": "number",
|
||||
"schema": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"required": true
|
||||
},
|
||||
"unpublished": false,
|
||||
"deprecated": false
|
||||
}
|
||||
}
|
||||
"optional": false
|
||||
}
|
||||
}
|
||||
],
|
||||
|
@ -69,47 +69,7 @@ expression: actual
|
||||
"raw": "4"
|
||||
}
|
||||
],
|
||||
"optional": false,
|
||||
"function": {
|
||||
"type": "StdLib",
|
||||
"func": {
|
||||
"name": "legLen",
|
||||
"summary": "Returns the length of the given leg.",
|
||||
"description": "",
|
||||
"tags": [],
|
||||
"args": [
|
||||
{
|
||||
"name": "hypotenuse",
|
||||
"type": "number",
|
||||
"schema": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"name": "leg",
|
||||
"type": "number",
|
||||
"schema": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"required": true
|
||||
}
|
||||
],
|
||||
"returnValue": {
|
||||
"name": "",
|
||||
"type": "number",
|
||||
"schema": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"required": true
|
||||
},
|
||||
"unpublished": false,
|
||||
"deprecated": false
|
||||
}
|
||||
}
|
||||
"optional": false
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -121,41 +81,7 @@ expression: actual
|
||||
"raw": "5"
|
||||
}
|
||||
],
|
||||
"optional": false,
|
||||
"function": {
|
||||
"type": "StdLib",
|
||||
"func": {
|
||||
"name": "min",
|
||||
"summary": "Computes the minimum of the given arguments.",
|
||||
"description": "",
|
||||
"tags": [],
|
||||
"args": [
|
||||
{
|
||||
"name": "args",
|
||||
"type": "[number]",
|
||||
"schema": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
}
|
||||
},
|
||||
"required": true
|
||||
}
|
||||
],
|
||||
"returnValue": {
|
||||
"name": "",
|
||||
"type": "number",
|
||||
"schema": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"required": true
|
||||
},
|
||||
"unpublished": false,
|
||||
"deprecated": false
|
||||
}
|
||||
}
|
||||
"optional": false
|
||||
}
|
||||
}
|
||||
],
|
||||
|
@ -78,10 +78,7 @@ expression: actual
|
||||
"end": 35
|
||||
}
|
||||
],
|
||||
"optional": false,
|
||||
"function": {
|
||||
"type": "InMemory"
|
||||
}
|
||||
"optional": false
|
||||
}
|
||||
],
|
||||
"nonCodeMeta": {
|
||||
|
@ -42,503 +42,7 @@ expression: actual
|
||||
"name": "pos"
|
||||
}
|
||||
],
|
||||
"optional": false,
|
||||
"function": {
|
||||
"type": "StdLib",
|
||||
"func": {
|
||||
"name": "startSketchAt",
|
||||
"summary": "Start a sketch at a given point on the 'XY' plane.",
|
||||
"description": "",
|
||||
"tags": [],
|
||||
"args": [
|
||||
{
|
||||
"name": "data",
|
||||
"type": "LineData",
|
||||
"schema": {
|
||||
"description": "Data to draw a line.",
|
||||
"anyOf": [
|
||||
{
|
||||
"description": "A point with a tag.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"tag",
|
||||
"to"
|
||||
],
|
||||
"properties": {
|
||||
"tag": {
|
||||
"description": "The tag.",
|
||||
"type": "string"
|
||||
},
|
||||
"to": {
|
||||
"description": "The to point.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"description": "A point.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
}
|
||||
]
|
||||
},
|
||||
"required": true
|
||||
}
|
||||
],
|
||||
"returnValue": {
|
||||
"name": "",
|
||||
"type": "SketchGroup",
|
||||
"schema": {
|
||||
"description": "A sketch group is a collection of paths.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"__meta",
|
||||
"id",
|
||||
"position",
|
||||
"rotation",
|
||||
"start",
|
||||
"value"
|
||||
],
|
||||
"properties": {
|
||||
"__meta": {
|
||||
"description": "Metadata.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"description": "Metadata.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"sourceRange"
|
||||
],
|
||||
"properties": {
|
||||
"sourceRange": {
|
||||
"description": "The source range.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "integer",
|
||||
"format": "uint",
|
||||
"minimum": 0.0
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"id": {
|
||||
"description": "The id of the sketch group.",
|
||||
"type": "string",
|
||||
"format": "uuid"
|
||||
},
|
||||
"planeId": {
|
||||
"description": "The plane id of the sketch group.",
|
||||
"type": "string",
|
||||
"format": "uuid",
|
||||
"nullable": true
|
||||
},
|
||||
"position": {
|
||||
"description": "The position of the sketch group.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 3,
|
||||
"minItems": 3
|
||||
},
|
||||
"rotation": {
|
||||
"description": "The rotation of the sketch group.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 4,
|
||||
"minItems": 4
|
||||
},
|
||||
"start": {
|
||||
"description": "The starting path.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"__geoMeta",
|
||||
"from",
|
||||
"name",
|
||||
"to"
|
||||
],
|
||||
"properties": {
|
||||
"__geoMeta": {
|
||||
"description": "Metadata.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"id",
|
||||
"sourceRange"
|
||||
],
|
||||
"properties": {
|
||||
"id": {
|
||||
"description": "The id of the geometry.",
|
||||
"type": "string",
|
||||
"format": "uuid"
|
||||
},
|
||||
"sourceRange": {
|
||||
"description": "The source range.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "integer",
|
||||
"format": "uint",
|
||||
"minimum": 0.0
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
}
|
||||
}
|
||||
},
|
||||
"from": {
|
||||
"description": "The from point.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
},
|
||||
"name": {
|
||||
"description": "The name of the path.",
|
||||
"type": "string"
|
||||
},
|
||||
"to": {
|
||||
"description": "The to point.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
}
|
||||
}
|
||||
},
|
||||
"value": {
|
||||
"description": "The paths in the sketch group.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"description": "A path.",
|
||||
"oneOf": [
|
||||
{
|
||||
"description": "A path that goes to a point.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"__geoMeta",
|
||||
"from",
|
||||
"name",
|
||||
"to",
|
||||
"type"
|
||||
],
|
||||
"properties": {
|
||||
"__geoMeta": {
|
||||
"description": "Metadata.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"id",
|
||||
"sourceRange"
|
||||
],
|
||||
"properties": {
|
||||
"id": {
|
||||
"description": "The id of the geometry.",
|
||||
"type": "string",
|
||||
"format": "uuid"
|
||||
},
|
||||
"sourceRange": {
|
||||
"description": "The source range.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "integer",
|
||||
"format": "uint",
|
||||
"minimum": 0.0
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
}
|
||||
}
|
||||
},
|
||||
"from": {
|
||||
"description": "The from point.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
},
|
||||
"name": {
|
||||
"description": "The name of the path.",
|
||||
"type": "string"
|
||||
},
|
||||
"to": {
|
||||
"description": "The to point.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
},
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"toPoint"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"description": "A path that is horizontal.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"__geoMeta",
|
||||
"from",
|
||||
"name",
|
||||
"to",
|
||||
"type",
|
||||
"x"
|
||||
],
|
||||
"properties": {
|
||||
"__geoMeta": {
|
||||
"description": "Metadata.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"id",
|
||||
"sourceRange"
|
||||
],
|
||||
"properties": {
|
||||
"id": {
|
||||
"description": "The id of the geometry.",
|
||||
"type": "string",
|
||||
"format": "uuid"
|
||||
},
|
||||
"sourceRange": {
|
||||
"description": "The source range.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "integer",
|
||||
"format": "uint",
|
||||
"minimum": 0.0
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
}
|
||||
}
|
||||
},
|
||||
"from": {
|
||||
"description": "The from point.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
},
|
||||
"name": {
|
||||
"description": "The name of the path.",
|
||||
"type": "string"
|
||||
},
|
||||
"to": {
|
||||
"description": "The to point.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
},
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"horizontal"
|
||||
]
|
||||
},
|
||||
"x": {
|
||||
"description": "The x coordinate.",
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"description": "An angled line to.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"__geoMeta",
|
||||
"from",
|
||||
"name",
|
||||
"to",
|
||||
"type"
|
||||
],
|
||||
"properties": {
|
||||
"__geoMeta": {
|
||||
"description": "Metadata.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"id",
|
||||
"sourceRange"
|
||||
],
|
||||
"properties": {
|
||||
"id": {
|
||||
"description": "The id of the geometry.",
|
||||
"type": "string",
|
||||
"format": "uuid"
|
||||
},
|
||||
"sourceRange": {
|
||||
"description": "The source range.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "integer",
|
||||
"format": "uint",
|
||||
"minimum": 0.0
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
}
|
||||
}
|
||||
},
|
||||
"from": {
|
||||
"description": "The from point.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
},
|
||||
"name": {
|
||||
"description": "The name of the path.",
|
||||
"type": "string"
|
||||
},
|
||||
"to": {
|
||||
"description": "The to point.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
},
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"angledLineTo"
|
||||
]
|
||||
},
|
||||
"x": {
|
||||
"description": "The x coordinate.",
|
||||
"type": "number",
|
||||
"format": "double",
|
||||
"nullable": true
|
||||
},
|
||||
"y": {
|
||||
"description": "The y coordinate.",
|
||||
"type": "number",
|
||||
"format": "double",
|
||||
"nullable": true
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"description": "A base path.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"__geoMeta",
|
||||
"from",
|
||||
"name",
|
||||
"to",
|
||||
"type"
|
||||
],
|
||||
"properties": {
|
||||
"__geoMeta": {
|
||||
"description": "Metadata.",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"id",
|
||||
"sourceRange"
|
||||
],
|
||||
"properties": {
|
||||
"id": {
|
||||
"description": "The id of the geometry.",
|
||||
"type": "string",
|
||||
"format": "uuid"
|
||||
},
|
||||
"sourceRange": {
|
||||
"description": "The source range.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "integer",
|
||||
"format": "uint",
|
||||
"minimum": 0.0
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
}
|
||||
}
|
||||
},
|
||||
"from": {
|
||||
"description": "The from point.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
},
|
||||
"name": {
|
||||
"description": "The name of the path.",
|
||||
"type": "string"
|
||||
},
|
||||
"to": {
|
||||
"description": "The to point.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
},
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"base"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": true
|
||||
},
|
||||
"unpublished": false,
|
||||
"deprecated": false
|
||||
}
|
||||
}
|
||||
"optional": false
|
||||
}
|
||||
}
|
||||
],
|
||||
|
File diff suppressed because it is too large
Load Diff
82
src/wasm-lib/kcl/src/std/kcl_stdlib.rs
Normal file
82
src/wasm-lib/kcl/src/std/kcl_stdlib.rs
Normal file
@ -0,0 +1,82 @@
|
||||
use schemars::JsonSchema;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
use crate::{
|
||||
ast::types::{BodyItem, FunctionExpression, Program, Value},
|
||||
docs::{StdLibFn, StdLibFnData},
|
||||
token::lexer,
|
||||
};
|
||||
|
||||
pub trait KclStdLibFn: StdLibFn {
|
||||
fn kcl_clone_box(&self) -> Box<dyn KclStdLibFn>;
|
||||
fn function(&self) -> &FunctionExpression;
|
||||
fn program(&self) -> &Program;
|
||||
}
|
||||
|
||||
impl ts_rs::TS for dyn KclStdLibFn {
|
||||
const EXPORT_TO: Option<&'static str> = Some("bindings/StdLibFnData");
|
||||
|
||||
fn name() -> String {
|
||||
"StdLibFnData".to_string()
|
||||
}
|
||||
|
||||
fn dependencies() -> Vec<ts_rs::Dependency>
|
||||
where
|
||||
Self: 'static,
|
||||
{
|
||||
StdLibFnData::dependencies()
|
||||
}
|
||||
|
||||
fn transparent() -> bool {
|
||||
StdLibFnData::transparent()
|
||||
}
|
||||
}
|
||||
|
||||
impl Clone for Box<dyn KclStdLibFn> {
|
||||
fn clone(&self) -> Box<dyn KclStdLibFn> {
|
||||
self.kcl_clone_box()
|
||||
}
|
||||
}
|
||||
|
||||
impl JsonSchema for dyn KclStdLibFn {
|
||||
fn schema_name() -> String {
|
||||
"KclStdLibFn".to_string()
|
||||
}
|
||||
|
||||
fn json_schema(gen: &mut schemars::gen::SchemaGenerator) -> schemars::schema::Schema {
|
||||
gen.subschema_for::<StdLibFnData>()
|
||||
}
|
||||
}
|
||||
|
||||
impl<'de> Deserialize<'de> for Box<dyn KclStdLibFn> {
|
||||
fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
|
||||
let data = StdLibFnData::deserialize(deserializer)?;
|
||||
let stdlib = crate::std::StdLib::new();
|
||||
let stdlib_fn = stdlib
|
||||
.get_kcl(&data.name)
|
||||
.ok_or_else(|| serde::de::Error::custom(format!("StdLibFn {} not found", data.name)))?;
|
||||
Ok(stdlib_fn)
|
||||
}
|
||||
}
|
||||
|
||||
impl Serialize for Box<dyn KclStdLibFn> {
|
||||
fn serialize<S: serde::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
|
||||
self.to_json().unwrap().serialize(serializer)
|
||||
}
|
||||
}
|
||||
|
||||
/// Parse a KCL program. Expect it to have a single body item, which is a function.
|
||||
/// Return the program and its single function.
|
||||
/// Return None if those expectations aren't met.
|
||||
pub fn extract_function(source: &str) -> Option<(Program, Box<FunctionExpression>)> {
|
||||
let tokens = lexer(source);
|
||||
let src = crate::parser::Parser::new(tokens).ast().ok()?;
|
||||
assert_eq!(src.body.len(), 1);
|
||||
let BodyItem::ExpressionStatement(expr) = src.body.last()? else {
|
||||
panic!("expected expression statement");
|
||||
};
|
||||
let Value::FunctionExpression(function) = expr.expression.clone() else {
|
||||
panic!("expected function expr");
|
||||
};
|
||||
Some((src, function))
|
||||
}
|
@ -1,8 +1,10 @@
|
||||
//! Functions implemented for language execution.
|
||||
|
||||
pub mod extrude;
|
||||
pub mod kcl_stdlib;
|
||||
pub mod math;
|
||||
pub mod segment;
|
||||
pub mod shapes;
|
||||
pub mod sketch;
|
||||
pub mod utils;
|
||||
|
||||
@ -11,12 +13,15 @@ use std::collections::HashMap;
|
||||
use anyhow::Result;
|
||||
use derive_docs::stdlib;
|
||||
use kittycad::types::OkWebSocketResponseData;
|
||||
use lazy_static::lazy_static;
|
||||
use parse_display::{Display, FromStr};
|
||||
use schemars::JsonSchema;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
use self::kcl_stdlib::KclStdLibFn;
|
||||
use crate::{
|
||||
ast::types::parse_json_number_as_f64,
|
||||
docs::StdLibFn,
|
||||
engine::EngineManager,
|
||||
errors::{KclError, KclErrorDetails},
|
||||
executor::{ExecutorContext, ExtrudeGroup, MemoryItem, Metadata, Plane, SketchGroup, SourceRange},
|
||||
@ -25,81 +30,122 @@ use crate::{
|
||||
pub type StdFn = fn(Args) -> std::pin::Pin<Box<dyn std::future::Future<Output = Result<MemoryItem, KclError>>>>;
|
||||
pub type FnMap = HashMap<String, StdFn>;
|
||||
|
||||
lazy_static! {
|
||||
static ref CORE_FNS: Vec<Box<dyn StdLibFn>> = vec![
|
||||
Box::new(Show),
|
||||
Box::new(LegLen),
|
||||
Box::new(LegAngX),
|
||||
Box::new(LegAngY),
|
||||
Box::new(crate::std::extrude::Extrude),
|
||||
Box::new(crate::std::extrude::GetExtrudeWallTransform),
|
||||
Box::new(crate::std::segment::SegEndX),
|
||||
Box::new(crate::std::segment::SegEndY),
|
||||
Box::new(crate::std::segment::LastSegX),
|
||||
Box::new(crate::std::segment::LastSegY),
|
||||
Box::new(crate::std::segment::SegLen),
|
||||
Box::new(crate::std::segment::SegAng),
|
||||
Box::new(crate::std::segment::AngleToMatchLengthX),
|
||||
Box::new(crate::std::segment::AngleToMatchLengthY),
|
||||
Box::new(crate::std::sketch::LineTo),
|
||||
Box::new(crate::std::sketch::Line),
|
||||
Box::new(crate::std::sketch::XLineTo),
|
||||
Box::new(crate::std::sketch::XLine),
|
||||
Box::new(crate::std::sketch::YLineTo),
|
||||
Box::new(crate::std::sketch::YLine),
|
||||
Box::new(crate::std::sketch::AngledLineToX),
|
||||
Box::new(crate::std::sketch::AngledLineToY),
|
||||
Box::new(crate::std::sketch::AngledLine),
|
||||
Box::new(crate::std::sketch::AngledLineOfXLength),
|
||||
Box::new(crate::std::sketch::AngledLineOfYLength),
|
||||
Box::new(crate::std::sketch::AngledLineThatIntersects),
|
||||
Box::new(crate::std::sketch::StartSketchAt),
|
||||
Box::new(crate::std::sketch::StartSketchOn),
|
||||
Box::new(crate::std::sketch::StartProfileAt),
|
||||
Box::new(crate::std::sketch::Close),
|
||||
Box::new(crate::std::sketch::Arc),
|
||||
Box::new(crate::std::sketch::TangentialArc),
|
||||
Box::new(crate::std::sketch::TangentialArcTo),
|
||||
Box::new(crate::std::sketch::BezierCurve),
|
||||
Box::new(crate::std::sketch::Hole),
|
||||
Box::new(crate::std::math::Cos),
|
||||
Box::new(crate::std::math::Sin),
|
||||
Box::new(crate::std::math::Tan),
|
||||
Box::new(crate::std::math::Acos),
|
||||
Box::new(crate::std::math::Asin),
|
||||
Box::new(crate::std::math::Atan),
|
||||
Box::new(crate::std::math::Pi),
|
||||
Box::new(crate::std::math::E),
|
||||
Box::new(crate::std::math::Tau),
|
||||
Box::new(crate::std::math::Sqrt),
|
||||
Box::new(crate::std::math::Abs),
|
||||
Box::new(crate::std::math::Floor),
|
||||
Box::new(crate::std::math::Ceil),
|
||||
Box::new(crate::std::math::Min),
|
||||
Box::new(crate::std::math::Max),
|
||||
Box::new(crate::std::math::Pow),
|
||||
Box::new(crate::std::math::Log),
|
||||
Box::new(crate::std::math::Log2),
|
||||
Box::new(crate::std::math::Log10),
|
||||
Box::new(crate::std::math::Ln),
|
||||
];
|
||||
}
|
||||
|
||||
pub fn name_in_stdlib(name: &str) -> bool {
|
||||
CORE_FNS.iter().any(|f| f.name() == name)
|
||||
}
|
||||
|
||||
pub struct StdLib {
|
||||
pub fns: HashMap<String, Box<(dyn crate::docs::StdLibFn)>>,
|
||||
pub fns: HashMap<String, Box<dyn StdLibFn>>,
|
||||
pub kcl_fns: HashMap<String, Box<dyn KclStdLibFn>>,
|
||||
}
|
||||
|
||||
impl std::fmt::Debug for StdLib {
|
||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||
f.debug_struct("StdLib")
|
||||
.field("fns.len()", &self.fns.len())
|
||||
.field("kcl_fns.len()", &self.kcl_fns.len())
|
||||
.finish()
|
||||
}
|
||||
}
|
||||
|
||||
impl StdLib {
|
||||
pub fn new() -> Self {
|
||||
let internal_fns: Vec<Box<(dyn crate::docs::StdLibFn)>> = vec![
|
||||
Box::new(Show),
|
||||
Box::new(LegLen),
|
||||
Box::new(LegAngX),
|
||||
Box::new(LegAngY),
|
||||
Box::new(crate::std::extrude::Extrude),
|
||||
Box::new(crate::std::extrude::GetExtrudeWallTransform),
|
||||
Box::new(crate::std::segment::SegEndX),
|
||||
Box::new(crate::std::segment::SegEndY),
|
||||
Box::new(crate::std::segment::LastSegX),
|
||||
Box::new(crate::std::segment::LastSegY),
|
||||
Box::new(crate::std::segment::SegLen),
|
||||
Box::new(crate::std::segment::SegAng),
|
||||
Box::new(crate::std::segment::AngleToMatchLengthX),
|
||||
Box::new(crate::std::segment::AngleToMatchLengthY),
|
||||
Box::new(crate::std::sketch::LineTo),
|
||||
Box::new(crate::std::sketch::Line),
|
||||
Box::new(crate::std::sketch::XLineTo),
|
||||
Box::new(crate::std::sketch::XLine),
|
||||
Box::new(crate::std::sketch::YLineTo),
|
||||
Box::new(crate::std::sketch::YLine),
|
||||
Box::new(crate::std::sketch::AngledLineToX),
|
||||
Box::new(crate::std::sketch::AngledLineToY),
|
||||
Box::new(crate::std::sketch::AngledLine),
|
||||
Box::new(crate::std::sketch::AngledLineOfXLength),
|
||||
Box::new(crate::std::sketch::AngledLineOfYLength),
|
||||
Box::new(crate::std::sketch::AngledLineThatIntersects),
|
||||
Box::new(crate::std::sketch::StartSketchAt),
|
||||
Box::new(crate::std::sketch::StartSketchOn),
|
||||
Box::new(crate::std::sketch::StartProfileAt),
|
||||
Box::new(crate::std::sketch::Close),
|
||||
Box::new(crate::std::sketch::Arc),
|
||||
Box::new(crate::std::sketch::TangentialArc),
|
||||
Box::new(crate::std::sketch::TangentialArcTo),
|
||||
Box::new(crate::std::sketch::BezierCurve),
|
||||
Box::new(crate::std::sketch::Hole),
|
||||
Box::new(crate::std::math::Cos),
|
||||
Box::new(crate::std::math::Sin),
|
||||
Box::new(crate::std::math::Tan),
|
||||
Box::new(crate::std::math::Acos),
|
||||
Box::new(crate::std::math::Asin),
|
||||
Box::new(crate::std::math::Atan),
|
||||
Box::new(crate::std::math::Pi),
|
||||
Box::new(crate::std::math::E),
|
||||
Box::new(crate::std::math::Tau),
|
||||
Box::new(crate::std::math::Sqrt),
|
||||
Box::new(crate::std::math::Abs),
|
||||
Box::new(crate::std::math::Floor),
|
||||
Box::new(crate::std::math::Ceil),
|
||||
Box::new(crate::std::math::Min),
|
||||
Box::new(crate::std::math::Max),
|
||||
Box::new(crate::std::math::Pow),
|
||||
Box::new(crate::std::math::Log),
|
||||
Box::new(crate::std::math::Log2),
|
||||
Box::new(crate::std::math::Log10),
|
||||
Box::new(crate::std::math::Ln),
|
||||
];
|
||||
let fns = CORE_FNS
|
||||
.clone()
|
||||
.into_iter()
|
||||
.map(|internal_fn| (internal_fn.name(), internal_fn))
|
||||
.collect();
|
||||
|
||||
let mut fns = HashMap::new();
|
||||
for internal_fn in &internal_fns {
|
||||
fns.insert(internal_fn.name().to_string(), internal_fn.clone());
|
||||
}
|
||||
let kcl_internal_fns: [Box<dyn KclStdLibFn>; 1] = [Box::<shapes::Circle>::default()];
|
||||
let kcl_fns = kcl_internal_fns
|
||||
.into_iter()
|
||||
.map(|internal_fn| (internal_fn.name(), internal_fn))
|
||||
.collect();
|
||||
|
||||
Self { fns }
|
||||
Self { fns, kcl_fns }
|
||||
}
|
||||
|
||||
pub fn get(&self, name: &str) -> Option<Box<dyn crate::docs::StdLibFn>> {
|
||||
pub fn get(&self, name: &str) -> Option<Box<dyn StdLibFn>> {
|
||||
self.fns.get(name).cloned()
|
||||
}
|
||||
|
||||
pub fn get_kcl(&self, name: &str) -> Option<Box<dyn KclStdLibFn>> {
|
||||
self.kcl_fns.get(name).cloned()
|
||||
}
|
||||
|
||||
pub fn get_either(&self, name: &str) -> FunctionKind {
|
||||
if let Some(f) = self.get(name) {
|
||||
FunctionKind::Core(f)
|
||||
} else if let Some(f) = self.get_kcl(name) {
|
||||
FunctionKind::Std(f)
|
||||
} else {
|
||||
FunctionKind::UserDefined
|
||||
}
|
||||
}
|
||||
|
||||
pub fn contains_key(&self, key: &str) -> bool {
|
||||
self.fns.contains_key(key) || self.kcl_fns.contains_key(key)
|
||||
}
|
||||
}
|
||||
|
||||
impl Default for StdLib {
|
||||
@ -108,6 +154,12 @@ impl Default for StdLib {
|
||||
}
|
||||
}
|
||||
|
||||
pub enum FunctionKind {
|
||||
Core(Box<dyn StdLibFn>),
|
||||
Std(Box<dyn KclStdLibFn>),
|
||||
UserDefined,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct Args {
|
||||
pub args: Vec<MemoryItem>,
|
||||
|
102
src/wasm-lib/kcl/src/std/shapes.rs
Normal file
102
src/wasm-lib/kcl/src/std/shapes.rs
Normal file
@ -0,0 +1,102 @@
|
||||
use schemars::JsonSchema;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
use super::kcl_stdlib::KclStdLibFn;
|
||||
use crate::{
|
||||
ast::types::{FunctionExpression, Program},
|
||||
docs::StdLibFn,
|
||||
};
|
||||
|
||||
pub const CIRCLE_FN: &str = r#"
|
||||
(plane, center, radius) => {
|
||||
const sg = startSketchOn(plane)
|
||||
|> startProfileAt([center[0] + radius, center[1]], %)
|
||||
|> arc({
|
||||
angle_end: 360,
|
||||
angle_start: 0,
|
||||
radius: radius
|
||||
}, %)
|
||||
|> close(%)
|
||||
return sg
|
||||
}
|
||||
"#;
|
||||
|
||||
#[derive(Clone, Deserialize, Serialize, PartialEq, ts_rs::TS, JsonSchema)]
|
||||
pub struct Circle {
|
||||
function: FunctionExpression,
|
||||
program: Program,
|
||||
}
|
||||
|
||||
impl Default for Circle {
|
||||
fn default() -> Self {
|
||||
// TODO in https://github.com/KittyCAD/modeling-app/issues/1018
|
||||
// Don't unwrap here, parse it at compile-time.
|
||||
let (src, function) = super::kcl_stdlib::extract_function(CIRCLE_FN).unwrap();
|
||||
Self {
|
||||
function: *function,
|
||||
program: src,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl std::fmt::Debug for Circle {
|
||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||
"circle".fmt(f)
|
||||
}
|
||||
}
|
||||
|
||||
/// TODO: Parse the KCL in a macro and generate these
|
||||
impl StdLibFn for Circle {
|
||||
fn name(&self) -> String {
|
||||
"unstable_stdlib_circle".to_owned()
|
||||
}
|
||||
|
||||
fn summary(&self) -> String {
|
||||
"Sketch a circle on the given plane".to_owned()
|
||||
}
|
||||
|
||||
fn description(&self) -> String {
|
||||
String::new()
|
||||
}
|
||||
|
||||
fn tags(&self) -> Vec<String> {
|
||||
Vec::new()
|
||||
}
|
||||
|
||||
fn args(&self) -> Vec<crate::docs::StdLibFnArg> {
|
||||
Vec::new() // TODO
|
||||
}
|
||||
|
||||
fn return_value(&self) -> Option<crate::docs::StdLibFnArg> {
|
||||
None
|
||||
}
|
||||
|
||||
fn unpublished(&self) -> bool {
|
||||
true
|
||||
}
|
||||
|
||||
fn deprecated(&self) -> bool {
|
||||
false
|
||||
}
|
||||
|
||||
fn std_lib_fn(&self) -> crate::std::StdFn {
|
||||
todo!()
|
||||
}
|
||||
|
||||
fn clone_box(&self) -> Box<dyn StdLibFn> {
|
||||
Box::new(self.to_owned())
|
||||
}
|
||||
}
|
||||
|
||||
impl KclStdLibFn for Circle {
|
||||
fn function(&self) -> &FunctionExpression {
|
||||
&self.function
|
||||
}
|
||||
fn program(&self) -> &Program {
|
||||
&self.program
|
||||
}
|
||||
|
||||
fn kcl_clone_box(&self) -> Box<dyn KclStdLibFn> {
|
||||
Box::new(self.clone())
|
||||
}
|
||||
}
|
@ -47,6 +47,8 @@ pub enum TokenType {
|
||||
Function,
|
||||
/// Unknown lexemes.
|
||||
Unknown,
|
||||
/// The ? symbol, used for optional values.
|
||||
QuestionMark,
|
||||
}
|
||||
|
||||
/// Most KCL tokens correspond to LSP semantic tokens (but not all).
|
||||
@ -58,6 +60,7 @@ impl TryFrom<TokenType> for SemanticTokenType {
|
||||
TokenType::Word => Self::VARIABLE,
|
||||
TokenType::Keyword => Self::KEYWORD,
|
||||
TokenType::Operator => Self::OPERATOR,
|
||||
TokenType::QuestionMark => Self::OPERATOR,
|
||||
TokenType::String => Self::STRING,
|
||||
TokenType::LineComment => Self::COMMENT,
|
||||
TokenType::BlockComment => Self::COMMENT,
|
||||
|
@ -21,6 +21,7 @@ pub fn token(i: &mut Located<&str>) -> PResult<Token> {
|
||||
'{' | '(' | '[' => brace_start,
|
||||
'}' | ')' | ']' => brace_end,
|
||||
',' => comma,
|
||||
'?' => question_mark,
|
||||
'0'..='9' => number,
|
||||
':' => colon,
|
||||
'.' => alt((number, double_period, period)),
|
||||
@ -108,6 +109,11 @@ fn comma(i: &mut Located<&str>) -> PResult<Token> {
|
||||
Ok(Token::from_range(range, TokenType::Comma, value.to_string()))
|
||||
}
|
||||
|
||||
fn question_mark(i: &mut Located<&str>) -> PResult<Token> {
|
||||
let (value, range) = '?'.with_span().parse_next(i)?;
|
||||
Ok(Token::from_range(range, TokenType::QuestionMark, value.to_string()))
|
||||
}
|
||||
|
||||
fn colon(i: &mut Located<&str>) -> PResult<Token> {
|
||||
let (value, range) = ':'.with_span().parse_next(i)?;
|
||||
Ok(Token::from_range(range, TokenType::Colon, value.to_string()))
|
||||
|
@ -28,7 +28,11 @@ pub async fn execute_wasm(
|
||||
let engine = kcl_lib::engine::EngineConnection::new(manager)
|
||||
.await
|
||||
.map_err(|e| format!("{:?}", e))?;
|
||||
let ctx = ExecutorContext { engine, planes };
|
||||
let ctx = ExecutorContext {
|
||||
engine,
|
||||
planes,
|
||||
stdlib: std::sync::Arc::new(kcl_lib::std::StdLib::new()),
|
||||
};
|
||||
|
||||
let memory = kcl_lib::executor::execute(program, &mut mem, kcl_lib::executor::BodyType::Root, &ctx)
|
||||
.await
|
||||
|
2
src/wasm-lib/tests/executor/inputs/cylinder.kcl
Normal file
2
src/wasm-lib/tests/executor/inputs/cylinder.kcl
Normal file
@ -0,0 +1,2 @@
|
||||
const cylinder = unstable_stdlib_circle('XY', [0,0], 22) |> extrude(14, %)
|
||||
show(cylinder)
|
@ -1,5 +1,7 @@
|
||||
use std::sync::Arc;
|
||||
|
||||
use anyhow::Result;
|
||||
use kcl_lib::engine::EngineManager;
|
||||
use kcl_lib::{engine::EngineManager, std::StdLib};
|
||||
|
||||
/// Executes a kcl program and takes a snapshot of the result.
|
||||
/// This returns the bytes of the snapshot.
|
||||
@ -38,7 +40,11 @@ async fn execute_and_snapshot(code: &str) -> Result<image::DynamicImage> {
|
||||
let mut mem: kcl_lib::executor::ProgramMemory = Default::default();
|
||||
let engine = kcl_lib::engine::EngineConnection::new(ws).await?;
|
||||
let planes = kcl_lib::executor::DefaultPlanes::new(&engine).await?;
|
||||
let ctx = kcl_lib::executor::ExecutorContext { engine, planes };
|
||||
let ctx = kcl_lib::executor::ExecutorContext {
|
||||
engine,
|
||||
planes,
|
||||
stdlib: Arc::new(StdLib::default()),
|
||||
};
|
||||
let _ = kcl_lib::executor::execute(program, &mut mem, kcl_lib::executor::BodyType::Root, &ctx).await?;
|
||||
|
||||
// Send a snapshot request to the engine.
|
||||
@ -222,6 +228,14 @@ async fn serial_test_execute_pipes_on_pipes() {
|
||||
twenty_twenty::assert_image("tests/executor/outputs/pipes_on_pipes.png", &result, 0.999);
|
||||
}
|
||||
|
||||
#[tokio::test(flavor = "multi_thread")]
|
||||
async fn serial_test_execute_cylinder() {
|
||||
let code = include_str!("inputs/cylinder.kcl");
|
||||
|
||||
let result = execute_and_snapshot(code).await.unwrap();
|
||||
twenty_twenty::assert_image("tests/executor/outputs/cylinder.png", &result, 0.999);
|
||||
}
|
||||
|
||||
#[tokio::test(flavor = "multi_thread")]
|
||||
async fn serial_test_execute_kittycad_svg() {
|
||||
let code = include_str!("inputs/kittycad_svg.kcl");
|
||||
@ -504,3 +518,23 @@ show(part)"#;
|
||||
let result = execute_and_snapshot(code).await.unwrap();
|
||||
twenty_twenty::assert_image("tests/executor/outputs/rounded_with_holes.png", &result, 0.999);
|
||||
}
|
||||
|
||||
#[tokio::test(flavor = "multi_thread")]
|
||||
async fn serial_test_top_level_expression() {
|
||||
let code = r#"fn circle = (pos, radius) => {
|
||||
const sg = startSketchOn('XY')
|
||||
|> startProfileAt([pos[0] + radius, pos[1]], %)
|
||||
|> arc({
|
||||
angle_end: 360,
|
||||
angle_start: 0,
|
||||
radius: radius
|
||||
}, %)
|
||||
|> close(%)
|
||||
return sg
|
||||
}
|
||||
|
||||
circle([0,0], 22) |> extrude(14, %)"#;
|
||||
|
||||
let result = execute_and_snapshot(code).await.unwrap();
|
||||
twenty_twenty::assert_image("tests/executor/outputs/top_level_expression.png", &result, 0.999);
|
||||
}
|
||||
|
BIN
src/wasm-lib/tests/executor/outputs/cylinder.png
Normal file
BIN
src/wasm-lib/tests/executor/outputs/cylinder.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 98 KiB |
BIN
src/wasm-lib/tests/executor/outputs/top_level_expression.png
Normal file
BIN
src/wasm-lib/tests/executor/outputs/top_level_expression.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 98 KiB |
@ -1,8 +1,11 @@
|
||||
use std::sync::Arc;
|
||||
|
||||
use anyhow::Result;
|
||||
use kcl_lib::{
|
||||
ast::{modify::modify_ast_for_sketch, types::Program},
|
||||
engine::EngineManager,
|
||||
executor::{ExecutorContext, MemoryItem, PlaneType, SourceRange},
|
||||
std::StdLib,
|
||||
};
|
||||
use kittycad::types::{ModelingCmd, Point3D};
|
||||
use pretty_assertions::assert_eq;
|
||||
@ -39,7 +42,11 @@ async fn setup(code: &str, name: &str) -> Result<(ExecutorContext, Program, uuid
|
||||
let mut mem: kcl_lib::executor::ProgramMemory = Default::default();
|
||||
let engine = kcl_lib::engine::EngineConnection::new(ws).await?;
|
||||
let planes = kcl_lib::executor::DefaultPlanes::new(&engine).await?;
|
||||
let ctx = ExecutorContext { engine, planes };
|
||||
let ctx = ExecutorContext {
|
||||
engine,
|
||||
planes,
|
||||
stdlib: Arc::new(StdLib::default()),
|
||||
};
|
||||
let memory = kcl_lib::executor::execute(program.clone(), &mut mem, kcl_lib::executor::BodyType::Root, &ctx).await?;
|
||||
|
||||
// We need to get the sketch ID.
|
||||
|
Reference in New Issue
Block a user