diff --git a/src/lang/abstractSyntaxTree.test.ts b/src/lang/abstractSyntaxTree.test.ts index 01b125be5..d48633c42 100644 --- a/src/lang/abstractSyntaxTree.test.ts +++ b/src/lang/abstractSyntaxTree.test.ts @@ -331,9 +331,6 @@ const myVar = funcN(1, 2)` raw: '2', }, ], - function: { - type: 'InMemory', - }, optional: false, }, }, @@ -403,7 +400,6 @@ describe('testing pipe operator special', () => { ], }, ], - function: expect.any(Object), optional: false, }, { @@ -440,7 +436,6 @@ describe('testing pipe operator special', () => { }, { type: 'PipeSubstitution', start: 59, end: 60 }, ], - function: expect.any(Object), optional: false, }, { @@ -513,7 +508,6 @@ describe('testing pipe operator special', () => { }, { type: 'PipeSubstitution', start: 105, end: 106 }, ], - function: expect.any(Object), optional: false, }, { @@ -550,7 +544,6 @@ describe('testing pipe operator special', () => { }, { type: 'PipeSubstitution', start: 128, end: 129 }, ], - function: expect.any(Object), optional: false, }, { @@ -573,9 +566,6 @@ describe('testing pipe operator special', () => { }, { type: 'PipeSubstitution', start: 143, end: 144 }, ], - function: { - type: 'InMemory', - }, optional: false, }, ], @@ -655,9 +645,6 @@ describe('testing pipe operator special', () => { end: 35, }, ], - function: { - type: 'InMemory', - }, optional: false, }, ], @@ -1567,7 +1554,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 +1587,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 +1622,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 }, diff --git a/src/lang/modifyAst.ts b/src/lang/modifyAst.ts index 8da1a5524..fa4e72b70 100644 --- a/src/lang/modifyAst.ts +++ b/src/lang/modifyAst.ts @@ -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, } diff --git a/src/wasm-lib/kcl/src/ast/types.rs b/src/wasm-lib/kcl/src/ast/types.rs index 9d2598118..ab4aebb10 100644 --- a/src/wasm-lib/kcl/src/ast/types.rs +++ b/src/wasm-lib/kcl/src/ast/types.rs @@ -6,8 +6,7 @@ use anyhow::Result; 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; @@ -862,7 +861,6 @@ pub struct CallExpression { pub callee: Identifier, pub arguments: Vec, pub optional: bool, - pub function: Function, } impl_value_meta!(CallExpression); @@ -875,22 +873,12 @@ impl From for Value { impl CallExpression { pub fn new(name: &str, arguments: Vec) -> Result { - // 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 +960,8 @@ impl CallExpression { fn_args.push(result); } - match &self.function { - Function::StdLib { func } => { + match ctx.stdlib.get(&self.callee.name) { + Some(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,7 +973,8 @@ impl CallExpression { Ok(result) } } - Function::InMemory => { + // Must be user-defined then + None => { let func = memory.get(&fn_name, self.into())?; let result = func .call_fn(fn_args, memory.clone(), ctx.clone()) diff --git a/src/wasm-lib/kcl/src/executor.rs b/src/wasm-lib/kcl/src/executor.rs index f94849a95..7e4648f03 100644 --- a/src/wasm-lib/kcl/src/executor.rs +++ b/src/wasm-lib/kcl/src/executor.rs @@ -1,6 +1,6 @@ //! The executor for the AST. -use std::collections::HashMap; +use std::{collections::HashMap, sync::Arc}; use anyhow::Result; use kittycad::types::{Color, ModelingCmd, Point3D}; @@ -10,9 +10,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::StdLib, }; #[derive(Debug, Clone, Deserialize, Serialize, PartialEq, ts_rs::TS, JsonSchema)] @@ -776,6 +777,7 @@ impl Default for PipeInfo { pub struct ExecutorContext { pub engine: EngineConnection, pub planes: DefaultPlanes, + pub stdlib: Arc, } /// Execute a AST's program. @@ -826,15 +828,18 @@ 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()], - })); - } + if let Some(func) = ctx.stdlib.get(&call_expr.callee.name) { + 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())); + 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?; @@ -1011,7 +1016,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) diff --git a/src/wasm-lib/kcl/src/parser/parser_impl.rs b/src/wasm-lib/kcl/src/parser/parser_impl.rs index 8701ec3d4..f8f1449cf 100644 --- a/src/wasm-lib/kcl/src/parser/parser_impl.rs +++ b/src/wasm-lib/kcl/src/parser/parser_impl.rs @@ -6,6 +6,7 @@ use winnow::{ token::{any, one_of}, }; +use super::{math::BinaryExpressionToken, PIPE_OPERATOR, PIPE_SUBSTITUTION_OPERATOR}; use crate::{ ast::types::{ ArrayExpression, BinaryExpression, BinaryOperator, BinaryPart, BodyItem, CallExpression, CommentStyle, @@ -17,20 +18,13 @@ use crate::{ 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 = winnow::prelude::PResult; -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 { @@ -1237,7 +1231,7 @@ fn parameters(i: TokenSlice) -> PResult> { impl Identifier { fn into_valid_binding_name(self) -> Result { // 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 +1255,12 @@ fn fn_call(i: TokenSlice) -> PResult { 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, }) } diff --git a/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__a.snap b/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__a.snap index 7152fda31..1ff7b2222 100644 --- a/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__a.snap +++ b/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__a.snap @@ -65,503 +65,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 }, { "type": "CallExpression", @@ -606,942 +110,7 @@ expression: actual "end": 62 } ], - "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 }, { "type": "CallExpression", @@ -1593,961 +162,7 @@ expression: actual "end": 95 } ], - "optional": false, - "function": { - "type": "StdLib", - "func": { - "name": "tangentialArc", - "summary": "Draw an arc.", - "description": "", - "tags": [], - "args": [ - { - "name": "data", - "type": "TangentialArcData", - "schema": { - "description": "Data to draw a tangential arc.", - "anyOf": [ - { - "type": "object", - "required": [ - "offset", - "radius" - ], - "properties": { - "offset": { - "description": "Offset of the arc, in degrees.", - "type": "number", - "format": "double" - }, - "radius": { - "description": "Radius of the arc. Not to be confused with Raiders of the Lost Ark.", - "type": "number", - "format": "double" - } - } - }, - { - "description": "A point with a tag.", - "type": "object", - "required": [ - "tag", - "to" - ], - "properties": { - "tag": { - "description": "The tag.", - "type": "string" - }, - "to": { - "description": "Where the arc should end. Must lie in the same plane as the current path pen position. Must not be colinear with current path pen position.", - "type": "array", - "items": { - "type": "number", - "format": "double" - }, - "maxItems": 2, - "minItems": 2 - } - } - }, - { - "description": "A point where the arc should end. Must lie in the same plane as the current path pen position. Must not be colinear with current path pen position.", - "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 }, { "type": "CallExpression", @@ -2599,942 +214,7 @@ expression: actual "end": 120 } ], - "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 }, { "type": "CallExpression", @@ -3563,610 +243,7 @@ expression: actual "end": 142 } ], - "optional": false, - "function": { - "type": "StdLib", - "func": { - "name": "extrude", - "summary": "Extrudes by a given amount.", - "description": "", - "tags": [], - "args": [ - { - "name": "length", - "type": "number", - "schema": { - "type": "number", - "format": "double" - }, - "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": "ExtrudeGroup", - "schema": { - "description": "An extrude group is a collection of extrude surfaces.", - "type": "object", - "required": [ - "__meta", - "height", - "id", - "position", - "rotation", - "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 - } - } - } - }, - "height": { - "description": "The height of the extrude group.", - "type": "number", - "format": "double" - }, - "id": { - "description": "The id of the extrude group.", - "type": "string", - "format": "uuid" - }, - "position": { - "description": "The position of the extrude group.", - "type": "array", - "items": { - "type": "number", - "format": "double" - }, - "maxItems": 3, - "minItems": 3 - }, - "rotation": { - "description": "The rotation of the extrude group.", - "type": "array", - "items": { - "type": "number", - "format": "double" - }, - "maxItems": 4, - "minItems": 4 - }, - "value": { - "description": "The extrude surfaces.", - "type": "array", - "items": { - "description": "An extrude surface.", - "oneOf": [ - { - "description": "An extrude plane.", - "type": "object", - "required": [ - "id", - "name", - "position", - "rotation", - "sourceRange", - "type" - ], - "properties": { - "id": { - "description": "The id of the geometry.", - "type": "string", - "format": "uuid" - }, - "name": { - "description": "The name.", - "type": "string" - }, - "position": { - "description": "The position.", - "type": "array", - "items": { - "type": "number", - "format": "double" - }, - "maxItems": 3, - "minItems": 3 - }, - "rotation": { - "description": "The rotation.", - "type": "array", - "items": { - "type": "number", - "format": "double" - }, - "maxItems": 4, - "minItems": 4 - }, - "sourceRange": { - "description": "The source range.", - "type": "array", - "items": { - "type": "integer", - "format": "uint", - "minimum": 0.0 - }, - "maxItems": 2, - "minItems": 2 - }, - "type": { - "type": "string", - "enum": [ - "extrudePlane" - ] - } - } - } - ] - } - } - } - }, - "required": true - }, - "unpublished": false, - "deprecated": false - } - } + "optional": false } ], "nonCodeMeta": { diff --git a/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__ab.snap b/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__ab.snap index b10b7b3d6..1cf06b5b9 100644 --- a/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__ab.snap +++ b/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__ab.snap @@ -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 } } ], diff --git a/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__ad.snap b/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__ad.snap index 07086262f..54e14a52f 100644 --- a/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__ad.snap +++ b/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__ad.snap @@ -74,10 +74,7 @@ expression: actual "name": "firstPrimeNumber" }, "arguments": [], - "optional": false, - "function": { - "type": "InMemory" - } + "optional": false } } ], diff --git a/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__ae.snap b/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__ae.snap index 2c0790261..b387833af 100644 --- a/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__ae.snap +++ b/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__ae.snap @@ -88,10 +88,7 @@ expression: actual "name": "false" } ], - "optional": false, - "function": { - "type": "InMemory" - } + "optional": false } } ], diff --git a/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__af.snap b/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__af.snap index 1ab869ffe..2e06b6fb5 100644 --- a/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__af.snap +++ b/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__af.snap @@ -65,503 +65,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 }, { "type": "CallExpression", @@ -644,942 +148,7 @@ expression: actual "end": 88 } ], - "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 }, { "type": "CallExpression", @@ -1624,942 +193,7 @@ expression: actual "end": 117 } ], - "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 }, { "type": "CallExpression", @@ -2642,942 +276,7 @@ expression: actual "end": 171 } ], - "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 }, { "type": "CallExpression", @@ -3598,898 +297,7 @@ expression: actual "end": 191 } ], - "optional": false, - "function": { - "type": "StdLib", - "func": { - "name": "close", - "summary": "Close the current sketch.", - "description": "", - "tags": [], - "args": [ - { - "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 } ], "nonCodeMeta": { diff --git a/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__ag.snap b/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__ag.snap index a97e439b5..8b30501a4 100644 --- a/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__ag.snap +++ b/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__ag.snap @@ -65,503 +65,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 }, { "type": "CallExpression", @@ -606,942 +110,7 @@ expression: actual "end": 57 } ], - "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 }, { "type": "CallExpression", @@ -1562,898 +131,7 @@ expression: actual "end": 69 } ], - "optional": false, - "function": { - "type": "StdLib", - "func": { - "name": "close", - "summary": "Close the current sketch.", - "description": "", - "tags": [], - "args": [ - { - "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 } ], "nonCodeMeta": { diff --git a/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__ah.snap b/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__ah.snap index d361991c5..84f308420 100644 --- a/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__ah.snap +++ b/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__ah.snap @@ -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 } } ], diff --git a/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__ai.snap b/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__ai.snap index b4d13aca7..45355c19d 100644 --- a/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__ai.snap +++ b/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__ai.snap @@ -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": { diff --git a/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__aj.snap b/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__aj.snap index 841022882..5eee293e0 100644 --- a/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__aj.snap +++ b/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__aj.snap @@ -48,503 +48,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 }, { "type": "CallExpression", @@ -588,942 +92,7 @@ expression: actual "end": 48 } ], - "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 } ], "nonCodeMeta": { diff --git a/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__ak.snap b/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__ak.snap index 7b6fde3e3..6b888ff14 100644 --- a/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__ak.snap +++ b/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__ak.snap @@ -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 } } ], diff --git a/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__al.snap b/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__al.snap index 872d8e5a0..43eac31be 100644 --- a/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__al.snap +++ b/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__al.snap @@ -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 } } ], diff --git a/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__am.snap b/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__am.snap index 8f319ab66..23704804a 100644 --- a/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__am.snap +++ b/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__am.snap @@ -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 } } ], diff --git a/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__an.snap b/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__an.snap index 71c928b38..ec0141671 100644 --- a/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__an.snap +++ b/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__an.snap @@ -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 } } ], diff --git a/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__ao.snap b/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__ao.snap index e52b91efa..7962553e3 100644 --- a/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__ao.snap +++ b/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__ao.snap @@ -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 } } ], diff --git a/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__ap.snap b/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__ap.snap index fbdea1a70..3cab88e58 100644 --- a/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__ap.snap +++ b/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__ap.snap @@ -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 } } ], diff --git a/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__aq.snap b/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__aq.snap index eb54e22f4..6af912de5 100644 --- a/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__aq.snap +++ b/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__aq.snap @@ -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 } } ], diff --git a/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__at.snap b/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__at.snap index 80d173335..8778828c5 100644 --- a/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__at.snap +++ b/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__at.snap @@ -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 } } ], diff --git a/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__au.snap b/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__au.snap index 9bc5fa79c..ede1bc96f 100644 --- a/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__au.snap +++ b/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__au.snap @@ -93,345 +93,7 @@ expression: actual "name": "plane" } ], - "optional": false, - "function": { - "type": "StdLib", - "func": { - "name": "startSketchOn", - "summary": "Start a sketch at a given point.", - "description": "", - "tags": [], - "args": [ - { - "name": "data", - "type": "PlaneData", - "schema": { - "description": "Data for a plane.", - "oneOf": [ - { - "description": "The XY plane.", - "type": "string", - "enum": [ - "XY" - ] - }, - { - "description": "The opposite side of the XY plane.", - "type": "string", - "enum": [ - "-XY" - ] - }, - { - "description": "The XZ plane.", - "type": "string", - "enum": [ - "XZ" - ] - }, - { - "description": "The opposite side of the XZ plane.", - "type": "string", - "enum": [ - "-XZ" - ] - }, - { - "description": "The YZ plane.", - "type": "string", - "enum": [ - "YZ" - ] - }, - { - "description": "The opposite side of the YZ plane.", - "type": "string", - "enum": [ - "-YZ" - ] - }, - { - "description": "A defined plane.", - "type": "object", - "required": [ - "plane" - ], - "properties": { - "plane": { - "type": "object", - "required": [ - "origin", - "x_axis", - "y_axis", - "z_axis" - ], - "properties": { - "origin": { - "description": "Origin of the plane.", - "type": "object", - "required": [ - "x", - "y", - "z" - ], - "properties": { - "x": { - "type": "number", - "format": "double" - }, - "y": { - "type": "number", - "format": "double" - }, - "z": { - "type": "number", - "format": "double" - } - } - }, - "x_axis": { - "description": "What should the plane’s X axis be?", - "type": "object", - "required": [ - "x", - "y", - "z" - ], - "properties": { - "x": { - "type": "number", - "format": "double" - }, - "y": { - "type": "number", - "format": "double" - }, - "z": { - "type": "number", - "format": "double" - } - } - }, - "y_axis": { - "description": "What should the plane’s Y axis be?", - "type": "object", - "required": [ - "x", - "y", - "z" - ], - "properties": { - "x": { - "type": "number", - "format": "double" - }, - "y": { - "type": "number", - "format": "double" - }, - "z": { - "type": "number", - "format": "double" - } - } - }, - "z_axis": { - "description": "The z-axis (normal).", - "type": "object", - "required": [ - "x", - "y", - "z" - ], - "properties": { - "x": { - "type": "number", - "format": "double" - }, - "y": { - "type": "number", - "format": "double" - }, - "z": { - "type": "number", - "format": "double" - } - } - } - } - } - }, - "additionalProperties": false - } - ] - }, - "required": true - } - ], - "returnValue": { - "name": "", - "type": "Plane", - "schema": { - "description": "A plane.", - "type": "object", - "required": [ - "__meta", - "id", - "origin", - "value", - "xAxis", - "yAxis", - "zAxis" - ], - "properties": { - "__meta": { - "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 plane.", - "type": "string", - "format": "uuid" - }, - "origin": { - "description": "Origin of the plane.", - "type": "object", - "required": [ - "x", - "y", - "z" - ], - "properties": { - "x": { - "type": "number", - "format": "double" - }, - "y": { - "type": "number", - "format": "double" - }, - "z": { - "type": "number", - "format": "double" - } - } - }, - "value": { - "description": "Type for a plane.", - "oneOf": [ - { - "type": "string", - "enum": [ - "XY", - "XZ", - "YZ" - ] - }, - { - "description": "A custom plane.", - "type": "string", - "enum": [ - "Custom" - ] - } - ] - }, - "xAxis": { - "description": "What should the plane’s X axis be?", - "type": "object", - "required": [ - "x", - "y", - "z" - ], - "properties": { - "x": { - "type": "number", - "format": "double" - }, - "y": { - "type": "number", - "format": "double" - }, - "z": { - "type": "number", - "format": "double" - } - } - }, - "yAxis": { - "description": "What should the plane’s Y axis be?", - "type": "object", - "required": [ - "x", - "y", - "z" - ], - "properties": { - "x": { - "type": "number", - "format": "double" - }, - "y": { - "type": "number", - "format": "double" - }, - "z": { - "type": "number", - "format": "double" - } - } - }, - "zAxis": { - "description": "The z-axis (normal).", - "type": "object", - "required": [ - "x", - "y", - "z" - ], - "properties": { - "x": { - "type": "number", - "format": "double" - }, - "y": { - "type": "number", - "format": "double" - }, - "z": { - "type": "number", - "format": "double" - } - } - } - } - }, - "required": true - }, - "unpublished": false, - "deprecated": false - } - } + "optional": false }, { "type": "CallExpression", @@ -518,663 +180,7 @@ expression: actual "end": 131 } ], - "optional": false, - "function": { - "type": "StdLib", - "func": { - "name": "startProfileAt", - "summary": "Start a profile at a given point.", - "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": "plane", - "type": "Plane", - "schema": { - "description": "A plane.", - "type": "object", - "required": [ - "__meta", - "id", - "origin", - "value", - "xAxis", - "yAxis", - "zAxis" - ], - "properties": { - "__meta": { - "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 plane.", - "type": "string", - "format": "uuid" - }, - "origin": { - "description": "Origin of the plane.", - "type": "object", - "required": [ - "x", - "y", - "z" - ], - "properties": { - "x": { - "type": "number", - "format": "double" - }, - "y": { - "type": "number", - "format": "double" - }, - "z": { - "type": "number", - "format": "double" - } - } - }, - "value": { - "description": "Type for a plane.", - "oneOf": [ - { - "type": "string", - "enum": [ - "XY", - "XZ", - "YZ" - ] - }, - { - "description": "A custom plane.", - "type": "string", - "enum": [ - "Custom" - ] - } - ] - }, - "xAxis": { - "description": "What should the plane’s X axis be?", - "type": "object", - "required": [ - "x", - "y", - "z" - ], - "properties": { - "x": { - "type": "number", - "format": "double" - }, - "y": { - "type": "number", - "format": "double" - }, - "z": { - "type": "number", - "format": "double" - } - } - }, - "yAxis": { - "description": "What should the plane’s Y axis be?", - "type": "object", - "required": [ - "x", - "y", - "z" - ], - "properties": { - "x": { - "type": "number", - "format": "double" - }, - "y": { - "type": "number", - "format": "double" - }, - "z": { - "type": "number", - "format": "double" - } - } - }, - "zAxis": { - "description": "The z-axis (normal).", - "type": "object", - "required": [ - "x", - "y", - "z" - ], - "properties": { - "x": { - "type": "number", - "format": "double" - }, - "y": { - "type": "number", - "format": "double" - }, - "z": { - "type": "number", - "format": "double" - } - } - } - } - }, - "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 }, { "type": "CallExpression", @@ -1259,1042 +265,7 @@ expression: actual "end": 223 } ], - "optional": false, - "function": { - "type": "StdLib", - "func": { - "name": "arc", - "summary": "Draw an arc.", - "description": "", - "tags": [], - "args": [ - { - "name": "data", - "type": "ArcData", - "schema": { - "description": "Data to draw an arc.", - "anyOf": [ - { - "description": "Angles and radius with a tag.", - "type": "object", - "required": [ - "angle_end", - "angle_start", - "radius", - "tag" - ], - "properties": { - "angle_end": { - "description": "The end angle.", - "type": "number", - "format": "double" - }, - "angle_start": { - "description": "The start angle.", - "type": "number", - "format": "double" - }, - "radius": { - "description": "The radius.", - "type": "number", - "format": "double" - }, - "tag": { - "description": "The tag.", - "type": "string" - } - } - }, - { - "description": "Angles and radius.", - "type": "object", - "required": [ - "angle_end", - "angle_start", - "radius" - ], - "properties": { - "angle_end": { - "description": "The end angle.", - "type": "number", - "format": "double" - }, - "angle_start": { - "description": "The start angle.", - "type": "number", - "format": "double" - }, - "radius": { - "description": "The radius.", - "type": "number", - "format": "double" - } - } - }, - { - "description": "Center, to and radius with a tag.", - "type": "object", - "required": [ - "center", - "radius", - "tag", - "to" - ], - "properties": { - "center": { - "description": "The center.", - "type": "array", - "items": { - "type": "number", - "format": "double" - }, - "maxItems": 2, - "minItems": 2 - }, - "radius": { - "description": "The radius.", - "type": "number", - "format": "double" - }, - "tag": { - "description": "The tag.", - "type": "string" - }, - "to": { - "description": "The to point.", - "type": "array", - "items": { - "type": "number", - "format": "double" - }, - "maxItems": 2, - "minItems": 2 - } - } - }, - { - "description": "Center, to and radius.", - "type": "object", - "required": [ - "center", - "radius", - "to" - ], - "properties": { - "center": { - "description": "The center.", - "type": "array", - "items": { - "type": "number", - "format": "double" - }, - "maxItems": 2, - "minItems": 2 - }, - "radius": { - "description": "The radius.", - "type": "number", - "format": "double" - }, - "to": { - "description": "The to 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 }, { "type": "CallExpression", @@ -2315,898 +286,7 @@ expression: actual "end": 239 } ], - "optional": false, - "function": { - "type": "StdLib", - "func": { - "name": "close", - "summary": "Close the current sketch.", - "description": "", - "tags": [], - "args": [ - { - "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 } ], "nonCodeMeta": { @@ -3317,10 +397,7 @@ expression: actual "raw": "22" } ], - "optional": false, - "function": { - "type": "InMemory" - } + "optional": false }, { "type": "CallExpression", @@ -3349,610 +426,7 @@ expression: actual "end": 313 } ], - "optional": false, - "function": { - "type": "StdLib", - "func": { - "name": "extrude", - "summary": "Extrudes by a given amount.", - "description": "", - "tags": [], - "args": [ - { - "name": "length", - "type": "number", - "schema": { - "type": "number", - "format": "double" - }, - "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": "ExtrudeGroup", - "schema": { - "description": "An extrude group is a collection of extrude surfaces.", - "type": "object", - "required": [ - "__meta", - "height", - "id", - "position", - "rotation", - "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 - } - } - } - }, - "height": { - "description": "The height of the extrude group.", - "type": "number", - "format": "double" - }, - "id": { - "description": "The id of the extrude group.", - "type": "string", - "format": "uuid" - }, - "position": { - "description": "The position of the extrude group.", - "type": "array", - "items": { - "type": "number", - "format": "double" - }, - "maxItems": 3, - "minItems": 3 - }, - "rotation": { - "description": "The rotation of the extrude group.", - "type": "array", - "items": { - "type": "number", - "format": "double" - }, - "maxItems": 4, - "minItems": 4 - }, - "value": { - "description": "The extrude surfaces.", - "type": "array", - "items": { - "description": "An extrude surface.", - "oneOf": [ - { - "description": "An extrude plane.", - "type": "object", - "required": [ - "id", - "name", - "position", - "rotation", - "sourceRange", - "type" - ], - "properties": { - "id": { - "description": "The id of the geometry.", - "type": "string", - "format": "uuid" - }, - "name": { - "description": "The name.", - "type": "string" - }, - "position": { - "description": "The position.", - "type": "array", - "items": { - "type": "number", - "format": "double" - }, - "maxItems": 3, - "minItems": 3 - }, - "rotation": { - "description": "The rotation.", - "type": "array", - "items": { - "type": "number", - "format": "double" - }, - "maxItems": 4, - "minItems": 4 - }, - "sourceRange": { - "description": "The source range.", - "type": "array", - "items": { - "type": "integer", - "format": "uint", - "minimum": 0.0 - }, - "maxItems": 2, - "minItems": 2 - }, - "type": { - "type": "string", - "enum": [ - "extrudePlane" - ] - } - } - } - ] - } - } - } - }, - "required": true - }, - "unpublished": false, - "deprecated": false - } - } + "optional": false } ], "nonCodeMeta": { @@ -3989,460 +463,7 @@ expression: actual "name": "cylinder" } ], - "optional": false, - "function": { - "type": "StdLib", - "func": { - "name": "show", - "summary": "Render a model.", - "description": "", - "tags": [], - "args": [ - { - "name": "sketch", - "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": null, - "unpublished": false, - "deprecated": false - } - } + "optional": false } } ], diff --git a/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__b.snap b/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__b.snap index e957a48b3..359efc02c 100644 --- a/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__b.snap +++ b/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__b.snap @@ -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 } } ], diff --git a/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__c.snap b/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__c.snap index 41f1fcb8c..4f572850f 100644 --- a/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__c.snap +++ b/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__c.snap @@ -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 } } ], diff --git a/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__d.snap b/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__d.snap index 11757e62f..ceab3be32 100644 --- a/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__d.snap +++ b/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__d.snap @@ -78,10 +78,7 @@ expression: actual "end": 35 } ], - "optional": false, - "function": { - "type": "InMemory" - } + "optional": false } ], "nonCodeMeta": { diff --git a/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__y.snap b/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__y.snap index 886327375..2f1d45bd5 100644 --- a/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__y.snap +++ b/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__y.snap @@ -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 } } ], diff --git a/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__z.snap b/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__z.snap index b26f3aac7..f77c1f3da 100644 --- a/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__z.snap +++ b/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__z.snap @@ -48,503 +48,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 }, { "type": "CallExpression", @@ -595,942 +99,7 @@ expression: actual "end": 52 } ], - "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 } ], "nonCodeMeta": { diff --git a/src/wasm-lib/kcl/src/std/mod.rs b/src/wasm-lib/kcl/src/std/mod.rs index 51b3d3f9d..9cbefb289 100644 --- a/src/wasm-lib/kcl/src/std/mod.rs +++ b/src/wasm-lib/kcl/src/std/mod.rs @@ -11,12 +11,14 @@ 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 crate::{ ast::types::parse_json_number_as_f64, + docs::StdLibFn, engine::EngineManager, errors::{KclError, KclErrorDetails}, executor::{ExecutorContext, ExtrudeGroup, MemoryItem, Metadata, Plane, SketchGroup, SourceRange}, @@ -25,70 +27,84 @@ use crate::{ pub type StdFn = fn(Args) -> std::pin::Pin>>>; pub type FnMap = HashMap; +lazy_static! { + static ref CORE_FNS: Vec> = 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>, + pub fns: HashMap>, +} + +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()).finish() + } } impl StdLib { pub fn new() -> Self { - let internal_fns: [Box; 55] = [ - 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 = internal_fns + let fns = CORE_FNS + .clone() .into_iter() .map(|internal_fn| (internal_fn.name(), internal_fn)) .collect(); @@ -96,7 +112,7 @@ impl StdLib { Self { fns } } - pub fn get(&self, name: &str) -> Option> { + pub fn get(&self, name: &str) -> Option> { self.fns.get(name).cloned() } } diff --git a/src/wasm-lib/src/lib.rs b/src/wasm-lib/src/lib.rs index e573f6dc2..8c85b089a 100644 --- a/src/wasm-lib/src/lib.rs +++ b/src/wasm-lib/src/lib.rs @@ -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 diff --git a/src/wasm-lib/tests/executor/main.rs b/src/wasm-lib/tests/executor/main.rs index b8b037ad1..3eae98805 100644 --- a/src/wasm-lib/tests/executor/main.rs +++ b/src/wasm-lib/tests/executor/main.rs @@ -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 { 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. diff --git a/src/wasm-lib/tests/modify/main.rs b/src/wasm-lib/tests/modify/main.rs index b9b8a6f16..b90811f39 100644 --- a/src/wasm-lib/tests/modify/main.rs +++ b/src/wasm-lib/tests/modify/main.rs @@ -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.