diff --git a/docs/kcl.json b/docs/kcl.json new file mode 100644 index 000000000..d373cebbe --- /dev/null +++ b/docs/kcl.json @@ -0,0 +1,17021 @@ +[ + { + "name": "min", + "summary": "Returns the minimum of the given arguments.", + "description": "", + "tags": [], + "args": [ + { + "name": "args", + "type_": "[number]", + "schema": { + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + "required": true + } + ], + "return_value": { + "name": "", + "type_": "number", + "schema": { + "type": "number", + "format": "double" + }, + "required": true + }, + "unpublished": false, + "deprecated": false + }, + { + "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 + } + ], + "return_value": { + "name": "", + "type_": "number", + "schema": { + "type": "number", + "format": "double" + }, + "required": true + }, + "unpublished": false, + "deprecated": false + }, + { + "name": "legAngX", + "summary": "Returns the angle of the given leg for x.", + "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 + } + ], + "return_value": { + "name": "", + "type_": "number", + "schema": { + "type": "number", + "format": "double" + }, + "required": true + }, + "unpublished": false, + "deprecated": false + }, + { + "name": "legAngY", + "summary": "Returns the angle of the given leg for y.", + "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 + } + ], + "return_value": { + "name": "", + "type_": "number", + "schema": { + "type": "number", + "format": "double" + }, + "required": true + }, + "unpublished": false, + "deprecated": false + }, + { + "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" + }, + "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 + } + ], + "return_value": { + "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 + }, + { + "name": "getExtrudeWallTransform", + "summary": "Returns the extrude wall transform.", + "description": "", + "tags": [], + "args": [ + { + "name": "surface_name", + "type_": "string", + "schema": { + "type": "string" + }, + "required": true + }, + { + "name": "extrude_group", + "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 + } + ], + "return_value": { + "name": "", + "type_": "ExtrudeTransform", + "schema": { + "type": "object", + "required": [ + "__meta", + "position", + "rotation" + ], + "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 + } + } + } + }, + "position": { + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 3, + "minItems": 3 + }, + "rotation": { + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 4, + "minItems": 4 + } + } + }, + "required": true + }, + "unpublished": false, + "deprecated": false + }, + { + "name": "segEndX", + "summary": "Returns the segment end of x.", + "description": "", + "tags": [], + "args": [ + { + "name": "segment_name", + "type_": "string", + "schema": { + "type": "string" + }, + "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" + }, + "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 + } + ], + "return_value": { + "name": "", + "type_": "number", + "schema": { + "type": "number", + "format": "double" + }, + "required": true + }, + "unpublished": false, + "deprecated": false + }, + { + "name": "segEndY", + "summary": "Returns the segment end of y.", + "description": "", + "tags": [], + "args": [ + { + "name": "segment_name", + "type_": "string", + "schema": { + "type": "string" + }, + "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" + }, + "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 + } + ], + "return_value": { + "name": "", + "type_": "number", + "schema": { + "type": "number", + "format": "double" + }, + "required": true + }, + "unpublished": false, + "deprecated": false + }, + { + "name": "lastSegX", + "summary": "Returns the last segment of x.", + "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" + }, + "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 + } + ], + "return_value": { + "name": "", + "type_": "number", + "schema": { + "type": "number", + "format": "double" + }, + "required": true + }, + "unpublished": false, + "deprecated": false + }, + { + "name": "lastSegY", + "summary": "Returns the last segment of y.", + "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" + }, + "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 + } + ], + "return_value": { + "name": "", + "type_": "number", + "schema": { + "type": "number", + "format": "double" + }, + "required": true + }, + "unpublished": false, + "deprecated": false + }, + { + "name": "segLen", + "summary": "Returns the length of the segment.", + "description": "", + "tags": [], + "args": [ + { + "name": "segment_name", + "type_": "string", + "schema": { + "type": "string" + }, + "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" + }, + "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 + } + ], + "return_value": { + "name": "", + "type_": "number", + "schema": { + "type": "number", + "format": "double" + }, + "required": true + }, + "unpublished": false, + "deprecated": false + }, + { + "name": "segAng", + "summary": "Returns the angle of the segment.", + "description": "", + "tags": [], + "args": [ + { + "name": "segment_name", + "type_": "string", + "schema": { + "type": "string" + }, + "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" + }, + "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 + } + ], + "return_value": { + "name": "", + "type_": "number", + "schema": { + "type": "number", + "format": "double" + }, + "required": true + }, + "unpublished": false, + "deprecated": false + }, + { + "name": "angleToMatchLengthX", + "summary": "Returns the angle to match the given length for x.", + "description": "", + "tags": [], + "args": [ + { + "name": "segment_name", + "type_": "string", + "schema": { + "type": "string" + }, + "required": true + }, + { + "name": "to", + "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" + }, + "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 + } + ], + "return_value": { + "name": "", + "type_": "number", + "schema": { + "type": "number", + "format": "double" + }, + "required": true + }, + "unpublished": false, + "deprecated": false + }, + { + "name": "angleToMatchLengthY", + "summary": "Returns the angle to match the given length for y.", + "description": "", + "tags": [], + "args": [ + { + "name": "segment_name", + "type_": "string", + "schema": { + "type": "string" + }, + "required": true + }, + { + "name": "to", + "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" + }, + "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 + } + ], + "return_value": { + "name": "", + "type_": "number", + "schema": { + "type": "number", + "format": "double" + }, + "required": true + }, + "unpublished": false, + "deprecated": false + }, + { + "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" + }, + "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 + } + ], + "return_value": { + "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" + }, + "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 + }, + { + "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.", + "anyOf": [ + { + "description": "A point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + { + "description": "A string like `default`.", + "type": "string" + } + ] + } + } + }, + { + "description": "A point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + { + "description": "A string like `default`.", + "type": "string" + } + ] + }, + "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" + }, + "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 + } + ], + "return_value": { + "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" + }, + "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 + }, + { + "name": "xLineTo", + "summary": "Draw a line to a point on the x-axis.", + "description": "", + "tags": [], + "args": [ + { + "name": "data", + "type_": "AxisLineToData", + "schema": { + "description": "Data to draw a line to a point on an axis.", + "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": "number", + "format": "double" + } + } + }, + { + "description": "A point.", + "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" + }, + "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 + } + ], + "return_value": { + "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" + }, + "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 + }, + { + "name": "xLine", + "summary": "Draw a line on the x-axis.", + "description": "", + "tags": [], + "args": [ + { + "name": "data", + "type_": "AxisLineData", + "schema": { + "description": "Data to draw a line on an axis.", + "anyOf": [ + { + "description": "The length with a tag.", + "type": "object", + "required": [ + "length", + "tag" + ], + "properties": { + "length": { + "description": "The length of the line.", + "type": "number", + "format": "double" + }, + "tag": { + "description": "The tag.", + "type": "string" + } + } + }, + { + "description": "The length.", + "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" + }, + "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 + } + ], + "return_value": { + "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" + }, + "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 + }, + { + "name": "yLineTo", + "summary": "Draw a line to a point on the y-axis.", + "description": "", + "tags": [], + "args": [ + { + "name": "data", + "type_": "AxisLineToData", + "schema": { + "description": "Data to draw a line to a point on an axis.", + "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": "number", + "format": "double" + } + } + }, + { + "description": "A point.", + "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" + }, + "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 + } + ], + "return_value": { + "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" + }, + "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 + }, + { + "name": "yLine", + "summary": "Draw a line on the y-axis.", + "description": "", + "tags": [], + "args": [ + { + "name": "data", + "type_": "AxisLineData", + "schema": { + "description": "Data to draw a line on an axis.", + "anyOf": [ + { + "description": "The length with a tag.", + "type": "object", + "required": [ + "length", + "tag" + ], + "properties": { + "length": { + "description": "The length of the line.", + "type": "number", + "format": "double" + }, + "tag": { + "description": "The tag.", + "type": "string" + } + } + }, + { + "description": "The length.", + "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" + }, + "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 + } + ], + "return_value": { + "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" + }, + "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 + }, + { + "name": "angledLineToX", + "summary": "Draw an angled line to a given x coordinate.", + "description": "", + "tags": [], + "args": [ + { + "name": "data", + "type_": "AngledLineToData", + "schema": { + "description": "Data to draw an angled line to a point.", + "anyOf": [ + { + "description": "An angle and point with a tag.", + "type": "object", + "required": [ + "angle", + "tag", + "to" + ], + "properties": { + "angle": { + "description": "The angle of the line.", + "type": "number", + "format": "double" + }, + "tag": { + "description": "The tag.", + "type": "string" + }, + "to": { + "description": "The point to draw to.", + "type": "number", + "format": "double" + } + } + }, + { + "description": "An angle and point to draw to.", + "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" + }, + "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 + } + ], + "return_value": { + "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" + }, + "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 + }, + { + "name": "angledLineToY", + "summary": "Draw an angled line to a given y coordinate.", + "description": "", + "tags": [], + "args": [ + { + "name": "data", + "type_": "AngledLineToData", + "schema": { + "description": "Data to draw an angled line to a point.", + "anyOf": [ + { + "description": "An angle and point with a tag.", + "type": "object", + "required": [ + "angle", + "tag", + "to" + ], + "properties": { + "angle": { + "description": "The angle of the line.", + "type": "number", + "format": "double" + }, + "tag": { + "description": "The tag.", + "type": "string" + }, + "to": { + "description": "The point to draw to.", + "type": "number", + "format": "double" + } + } + }, + { + "description": "An angle and point to draw to.", + "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" + }, + "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 + } + ], + "return_value": { + "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" + }, + "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 + }, + { + "name": "angledLine", + "summary": "Draw an angled line.", + "description": "", + "tags": [], + "args": [ + { + "name": "data", + "type_": "AngledLineData", + "schema": { + "description": "Data to draw an angled line.", + "anyOf": [ + { + "description": "An angle and length with a tag.", + "type": "object", + "required": [ + "angle", + "length", + "tag" + ], + "properties": { + "angle": { + "description": "The angle of the line.", + "type": "number", + "format": "double" + }, + "length": { + "description": "The length of the line.", + "type": "number", + "format": "double" + }, + "tag": { + "description": "The tag.", + "type": "string" + } + } + }, + { + "description": "An angle and length.", + "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" + }, + "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 + } + ], + "return_value": { + "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" + }, + "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 + }, + { + "name": "angledLineOfXLength", + "summary": "Draw an angled line of a given x length.", + "description": "", + "tags": [], + "args": [ + { + "name": "data", + "type_": "AngledLineData", + "schema": { + "description": "Data to draw an angled line.", + "anyOf": [ + { + "description": "An angle and length with a tag.", + "type": "object", + "required": [ + "angle", + "length", + "tag" + ], + "properties": { + "angle": { + "description": "The angle of the line.", + "type": "number", + "format": "double" + }, + "length": { + "description": "The length of the line.", + "type": "number", + "format": "double" + }, + "tag": { + "description": "The tag.", + "type": "string" + } + } + }, + { + "description": "An angle and length.", + "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" + }, + "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 + } + ], + "return_value": { + "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" + }, + "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 + }, + { + "name": "angledLineOfYLength", + "summary": "Draw an angled line of a given y length.", + "description": "", + "tags": [], + "args": [ + { + "name": "data", + "type_": "AngledLineData", + "schema": { + "description": "Data to draw an angled line.", + "anyOf": [ + { + "description": "An angle and length with a tag.", + "type": "object", + "required": [ + "angle", + "length", + "tag" + ], + "properties": { + "angle": { + "description": "The angle of the line.", + "type": "number", + "format": "double" + }, + "length": { + "description": "The length of the line.", + "type": "number", + "format": "double" + }, + "tag": { + "description": "The tag.", + "type": "string" + } + } + }, + { + "description": "An angle and length.", + "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" + }, + "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 + } + ], + "return_value": { + "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" + }, + "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 + }, + { + "name": "angledLineThatIntersects", + "summary": "Draw an angled line that intersects with a given line.", + "description": "", + "tags": [], + "args": [ + { + "name": "data", + "type_": "AngeledLineThatIntersectsData", + "schema": { + "description": "Data for drawing an angled line that intersects with a given line.", + "type": "object", + "required": [ + "angle", + "intersectTag" + ], + "properties": { + "angle": { + "description": "The angle of the line.", + "type": "number", + "format": "double" + }, + "intersectTag": { + "description": "The tag of the line to intersect with.", + "type": "string" + }, + "offset": { + "description": "The offset from the intersecting line.", + "type": "number", + "format": "double", + "nullable": true + }, + "tag": { + "description": "The tag.", + "type": "string", + "nullable": true + } + } + }, + "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" + }, + "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 + } + ], + "return_value": { + "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" + }, + "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 + }, + { + "name": "startSketchAt", + "summary": "Start a sketch 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.", + "anyOf": [ + { + "description": "A point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + { + "description": "A string like `default`.", + "type": "string" + } + ] + } + } + }, + { + "description": "A point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + { + "description": "A string like `default`.", + "type": "string" + } + ] + }, + "required": true + } + ], + "return_value": { + "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" + }, + "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 + }, + { + "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" + }, + "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 + } + ], + "return_value": { + "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" + }, + "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 + } +] \ No newline at end of file diff --git a/docs/kcl.md b/docs/kcl.md new file mode 100644 index 000000000..2d93ebccb --- /dev/null +++ b/docs/kcl.md @@ -0,0 +1,3048 @@ + + +# KCL Standard Library + +## Table of Contents + +* [Functions](#functions) + * [`min`](#min) + * [`legLen`](#legLen) + * [`legAngX`](#legAngX) + * [`legAngY`](#legAngY) + * [`extrude`](#extrude) + * [`getExtrudeWallTransform`](#getExtrudeWallTransform) + * [`segEndX`](#segEndX) + * [`segEndY`](#segEndY) + * [`lastSegX`](#lastSegX) + * [`lastSegY`](#lastSegY) + * [`segLen`](#segLen) + * [`segAng`](#segAng) + * [`angleToMatchLengthX`](#angleToMatchLengthX) + * [`angleToMatchLengthY`](#angleToMatchLengthY) + * [`lineTo`](#lineTo) + * [`line`](#line) + * [`xLineTo`](#xLineTo) + * [`xLine`](#xLine) + * [`yLineTo`](#yLineTo) + * [`yLine`](#yLine) + * [`angledLineToX`](#angledLineToX) + * [`angledLineToY`](#angledLineToY) + * [`angledLine`](#angledLine) + * [`angledLineOfXLength`](#angledLineOfXLength) + * [`angledLineOfYLength`](#angledLineOfYLength) + * [`angledLineThatIntersects`](#angledLineThatIntersects) + * [`startSketchAt`](#startSketchAt) + * [`close`](#close) + + +## Functions + +### min + +Returns the minimum of the given arguments. + + + +``` +min(args: [number]) -> number +``` + +#### Arguments + +* `args`: `[number]` + +#### Returns + +* `number` + + + +### legLen + +Returns the length of the given leg. + + + +``` +legLen(hypotenuse: number, leg: number) -> number +``` + +#### Arguments + +* `hypotenuse`: `number` +* `leg`: `number` + +#### Returns + +* `number` + + + +### legAngX + +Returns the angle of the given leg for x. + + + +``` +legAngX(hypotenuse: number, leg: number) -> number +``` + +#### Arguments + +* `hypotenuse`: `number` +* `leg`: `number` + +#### Returns + +* `number` + + + +### legAngY + +Returns the angle of the given leg for y. + + + +``` +legAngY(hypotenuse: number, leg: number) -> number +``` + +#### Arguments + +* `hypotenuse`: `number` +* `leg`: `number` + +#### Returns + +* `number` + + + +### extrude + +Extrudes by a given amount. + + + +``` +extrude(length: number, sketch_group: SketchGroup) -> ExtrudeGroup +``` + +#### Arguments + +* `length`: `number` +* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. +``` +{ + // The id of the sketch group. + "id": uuid, + // The position of the sketch group. + "position": [number], + // The rotation of the sketch group. + "rotation": [number], + // The starting path. + "start": { + // The from point. + "from": [number], + // The name of the path. + "name": string, + // The to point. + "to": [number], +}, + // The paths in the sketch group. + "value": [{ + // The from point. + "from": [number], + // The name of the path. + "name": string, + // The to point. + "to": [number], + "type": string, +} | +{ + // The from point. + "from": [number], + // The name of the path. + "name": string, + // The to point. + "to": [number], + "type": string, + // The x coordinate. + "x": number, +} | +{ + // The from point. + "from": [number], + // The name of the path. + "name": string, + // The to point. + "to": [number], + "type": string, + // The x coordinate. + "x": number, + // The y coordinate. + "y": number, +} | +{ + // The from point. + "from": [number], + // The name of the path. + "name": string, + // The to point. + "to": [number], + "type": string, +}], +} +``` + +#### Returns + +* `ExtrudeGroup` - An extrude group is a collection of extrude surfaces. +``` +{ + // The height of the extrude group. + "height": number, + // The id of the extrude group. + "id": uuid, + // The position of the extrude group. + "position": [number], + // The rotation of the extrude group. + "rotation": [number], + // The extrude surfaces. + "value": [{ + // The id of the geometry. + "id": uuid, + // The name. + "name": string, + // The position. + "position": [number], + // The rotation. + "rotation": [number], + // The source range. + "sourceRange": [number], + "type": string, +}], +} +``` + + + +### getExtrudeWallTransform + +Returns the extrude wall transform. + + + +``` +getExtrudeWallTransform(surface_name: string, extrude_group: ExtrudeGroup) -> ExtrudeTransform +``` + +#### Arguments + +* `surface_name`: `string` +* `extrude_group`: `ExtrudeGroup` - An extrude group is a collection of extrude surfaces. +``` +{ + // The height of the extrude group. + "height": number, + // The id of the extrude group. + "id": uuid, + // The position of the extrude group. + "position": [number], + // The rotation of the extrude group. + "rotation": [number], + // The extrude surfaces. + "value": [{ + // The id of the geometry. + "id": uuid, + // The name. + "name": string, + // The position. + "position": [number], + // The rotation. + "rotation": [number], + // The source range. + "sourceRange": [number], + "type": string, +}], +} +``` + +#### Returns + +* `ExtrudeTransform` +``` +{ + "position": [number], + "rotation": [number], +} +``` + + + +### segEndX + +Returns the segment end of x. + + + +``` +segEndX(segment_name: string, sketch_group: SketchGroup) -> number +``` + +#### Arguments + +* `segment_name`: `string` +* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. +``` +{ + // The id of the sketch group. + "id": uuid, + // The position of the sketch group. + "position": [number], + // The rotation of the sketch group. + "rotation": [number], + // The starting path. + "start": { + // The from point. + "from": [number], + // The name of the path. + "name": string, + // The to point. + "to": [number], +}, + // The paths in the sketch group. + "value": [{ + // The from point. + "from": [number], + // The name of the path. + "name": string, + // The to point. + "to": [number], + "type": string, +} | +{ + // The from point. + "from": [number], + // The name of the path. + "name": string, + // The to point. + "to": [number], + "type": string, + // The x coordinate. + "x": number, +} | +{ + // The from point. + "from": [number], + // The name of the path. + "name": string, + // The to point. + "to": [number], + "type": string, + // The x coordinate. + "x": number, + // The y coordinate. + "y": number, +} | +{ + // The from point. + "from": [number], + // The name of the path. + "name": string, + // The to point. + "to": [number], + "type": string, +}], +} +``` + +#### Returns + +* `number` + + + +### segEndY + +Returns the segment end of y. + + + +``` +segEndY(segment_name: string, sketch_group: SketchGroup) -> number +``` + +#### Arguments + +* `segment_name`: `string` +* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. +``` +{ + // The id of the sketch group. + "id": uuid, + // The position of the sketch group. + "position": [number], + // The rotation of the sketch group. + "rotation": [number], + // The starting path. + "start": { + // The from point. + "from": [number], + // The name of the path. + "name": string, + // The to point. + "to": [number], +}, + // The paths in the sketch group. + "value": [{ + // The from point. + "from": [number], + // The name of the path. + "name": string, + // The to point. + "to": [number], + "type": string, +} | +{ + // The from point. + "from": [number], + // The name of the path. + "name": string, + // The to point. + "to": [number], + "type": string, + // The x coordinate. + "x": number, +} | +{ + // The from point. + "from": [number], + // The name of the path. + "name": string, + // The to point. + "to": [number], + "type": string, + // The x coordinate. + "x": number, + // The y coordinate. + "y": number, +} | +{ + // The from point. + "from": [number], + // The name of the path. + "name": string, + // The to point. + "to": [number], + "type": string, +}], +} +``` + +#### Returns + +* `number` + + + +### lastSegX + +Returns the last segment of x. + + + +``` +lastSegX(sketch_group: SketchGroup) -> number +``` + +#### Arguments + +* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. +``` +{ + // The id of the sketch group. + "id": uuid, + // The position of the sketch group. + "position": [number], + // The rotation of the sketch group. + "rotation": [number], + // The starting path. + "start": { + // The from point. + "from": [number], + // The name of the path. + "name": string, + // The to point. + "to": [number], +}, + // The paths in the sketch group. + "value": [{ + // The from point. + "from": [number], + // The name of the path. + "name": string, + // The to point. + "to": [number], + "type": string, +} | +{ + // The from point. + "from": [number], + // The name of the path. + "name": string, + // The to point. + "to": [number], + "type": string, + // The x coordinate. + "x": number, +} | +{ + // The from point. + "from": [number], + // The name of the path. + "name": string, + // The to point. + "to": [number], + "type": string, + // The x coordinate. + "x": number, + // The y coordinate. + "y": number, +} | +{ + // The from point. + "from": [number], + // The name of the path. + "name": string, + // The to point. + "to": [number], + "type": string, +}], +} +``` + +#### Returns + +* `number` + + + +### lastSegY + +Returns the last segment of y. + + + +``` +lastSegY(sketch_group: SketchGroup) -> number +``` + +#### Arguments + +* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. +``` +{ + // The id of the sketch group. + "id": uuid, + // The position of the sketch group. + "position": [number], + // The rotation of the sketch group. + "rotation": [number], + // The starting path. + "start": { + // The from point. + "from": [number], + // The name of the path. + "name": string, + // The to point. + "to": [number], +}, + // The paths in the sketch group. + "value": [{ + // The from point. + "from": [number], + // The name of the path. + "name": string, + // The to point. + "to": [number], + "type": string, +} | +{ + // The from point. + "from": [number], + // The name of the path. + "name": string, + // The to point. + "to": [number], + "type": string, + // The x coordinate. + "x": number, +} | +{ + // The from point. + "from": [number], + // The name of the path. + "name": string, + // The to point. + "to": [number], + "type": string, + // The x coordinate. + "x": number, + // The y coordinate. + "y": number, +} | +{ + // The from point. + "from": [number], + // The name of the path. + "name": string, + // The to point. + "to": [number], + "type": string, +}], +} +``` + +#### Returns + +* `number` + + + +### segLen + +Returns the length of the segment. + + + +``` +segLen(segment_name: string, sketch_group: SketchGroup) -> number +``` + +#### Arguments + +* `segment_name`: `string` +* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. +``` +{ + // The id of the sketch group. + "id": uuid, + // The position of the sketch group. + "position": [number], + // The rotation of the sketch group. + "rotation": [number], + // The starting path. + "start": { + // The from point. + "from": [number], + // The name of the path. + "name": string, + // The to point. + "to": [number], +}, + // The paths in the sketch group. + "value": [{ + // The from point. + "from": [number], + // The name of the path. + "name": string, + // The to point. + "to": [number], + "type": string, +} | +{ + // The from point. + "from": [number], + // The name of the path. + "name": string, + // The to point. + "to": [number], + "type": string, + // The x coordinate. + "x": number, +} | +{ + // The from point. + "from": [number], + // The name of the path. + "name": string, + // The to point. + "to": [number], + "type": string, + // The x coordinate. + "x": number, + // The y coordinate. + "y": number, +} | +{ + // The from point. + "from": [number], + // The name of the path. + "name": string, + // The to point. + "to": [number], + "type": string, +}], +} +``` + +#### Returns + +* `number` + + + +### segAng + +Returns the angle of the segment. + + + +``` +segAng(segment_name: string, sketch_group: SketchGroup) -> number +``` + +#### Arguments + +* `segment_name`: `string` +* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. +``` +{ + // The id of the sketch group. + "id": uuid, + // The position of the sketch group. + "position": [number], + // The rotation of the sketch group. + "rotation": [number], + // The starting path. + "start": { + // The from point. + "from": [number], + // The name of the path. + "name": string, + // The to point. + "to": [number], +}, + // The paths in the sketch group. + "value": [{ + // The from point. + "from": [number], + // The name of the path. + "name": string, + // The to point. + "to": [number], + "type": string, +} | +{ + // The from point. + "from": [number], + // The name of the path. + "name": string, + // The to point. + "to": [number], + "type": string, + // The x coordinate. + "x": number, +} | +{ + // The from point. + "from": [number], + // The name of the path. + "name": string, + // The to point. + "to": [number], + "type": string, + // The x coordinate. + "x": number, + // The y coordinate. + "y": number, +} | +{ + // The from point. + "from": [number], + // The name of the path. + "name": string, + // The to point. + "to": [number], + "type": string, +}], +} +``` + +#### Returns + +* `number` + + + +### angleToMatchLengthX + +Returns the angle to match the given length for x. + + + +``` +angleToMatchLengthX(segment_name: string, to: number, sketch_group: SketchGroup) -> number +``` + +#### Arguments + +* `segment_name`: `string` +* `to`: `number` +* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. +``` +{ + // The id of the sketch group. + "id": uuid, + // The position of the sketch group. + "position": [number], + // The rotation of the sketch group. + "rotation": [number], + // The starting path. + "start": { + // The from point. + "from": [number], + // The name of the path. + "name": string, + // The to point. + "to": [number], +}, + // The paths in the sketch group. + "value": [{ + // The from point. + "from": [number], + // The name of the path. + "name": string, + // The to point. + "to": [number], + "type": string, +} | +{ + // The from point. + "from": [number], + // The name of the path. + "name": string, + // The to point. + "to": [number], + "type": string, + // The x coordinate. + "x": number, +} | +{ + // The from point. + "from": [number], + // The name of the path. + "name": string, + // The to point. + "to": [number], + "type": string, + // The x coordinate. + "x": number, + // The y coordinate. + "y": number, +} | +{ + // The from point. + "from": [number], + // The name of the path. + "name": string, + // The to point. + "to": [number], + "type": string, +}], +} +``` + +#### Returns + +* `number` + + + +### angleToMatchLengthY + +Returns the angle to match the given length for y. + + + +``` +angleToMatchLengthY(segment_name: string, to: number, sketch_group: SketchGroup) -> number +``` + +#### Arguments + +* `segment_name`: `string` +* `to`: `number` +* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. +``` +{ + // The id of the sketch group. + "id": uuid, + // The position of the sketch group. + "position": [number], + // The rotation of the sketch group. + "rotation": [number], + // The starting path. + "start": { + // The from point. + "from": [number], + // The name of the path. + "name": string, + // The to point. + "to": [number], +}, + // The paths in the sketch group. + "value": [{ + // The from point. + "from": [number], + // The name of the path. + "name": string, + // The to point. + "to": [number], + "type": string, +} | +{ + // The from point. + "from": [number], + // The name of the path. + "name": string, + // The to point. + "to": [number], + "type": string, + // The x coordinate. + "x": number, +} | +{ + // The from point. + "from": [number], + // The name of the path. + "name": string, + // The to point. + "to": [number], + "type": string, + // The x coordinate. + "x": number, + // The y coordinate. + "y": number, +} | +{ + // The from point. + "from": [number], + // The name of the path. + "name": string, + // The to point. + "to": [number], + "type": string, +}], +} +``` + +#### Returns + +* `number` + + + +### lineTo + +Draw a line to a point. + + + +``` +lineTo(data: LineToData, sketch_group: SketchGroup) -> SketchGroup +``` + +#### Arguments + +* `data`: `LineToData` - Data to draw a line to a point. +``` +{ + // The tag. + "tag": string, + // The to point. + "to": [number], +} | +[number] +``` +* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. +``` +{ + // The id of the sketch group. + "id": uuid, + // The position of the sketch group. + "position": [number], + // The rotation of the sketch group. + "rotation": [number], + // The starting path. + "start": { + // The from point. + "from": [number], + // The name of the path. + "name": string, + // The to point. + "to": [number], +}, + // The paths in the sketch group. + "value": [{ + // The from point. + "from": [number], + // The name of the path. + "name": string, + // The to point. + "to": [number], + "type": string, +} | +{ + // The from point. + "from": [number], + // The name of the path. + "name": string, + // The to point. + "to": [number], + "type": string, + // The x coordinate. + "x": number, +} | +{ + // The from point. + "from": [number], + // The name of the path. + "name": string, + // The to point. + "to": [number], + "type": string, + // The x coordinate. + "x": number, + // The y coordinate. + "y": number, +} | +{ + // The from point. + "from": [number], + // The name of the path. + "name": string, + // The to point. + "to": [number], + "type": string, +}], +} +``` + +#### Returns + +* `SketchGroup` - A sketch group is a collection of paths. +``` +{ + // The id of the sketch group. + "id": uuid, + // The position of the sketch group. + "position": [number], + // The rotation of the sketch group. + "rotation": [number], + // The starting path. + "start": { + // The from point. + "from": [number], + // The name of the path. + "name": string, + // The to point. + "to": [number], +}, + // The paths in the sketch group. + "value": [{ + // The from point. + "from": [number], + // The name of the path. + "name": string, + // The to point. + "to": [number], + "type": string, +} | +{ + // The from point. + "from": [number], + // The name of the path. + "name": string, + // The to point. + "to": [number], + "type": string, + // The x coordinate. + "x": number, +} | +{ + // The from point. + "from": [number], + // The name of the path. + "name": string, + // The to point. + "to": [number], + "type": string, + // The x coordinate. + "x": number, + // The y coordinate. + "y": number, +} | +{ + // The from point. + "from": [number], + // The name of the path. + "name": string, + // The to point. + "to": [number], + "type": string, +}], +} +``` + + + +### line + +Draw a line. + + + +``` +line(data: LineData, sketch_group: SketchGroup) -> SketchGroup +``` + +#### Arguments + +* `data`: `LineData` - Data to draw a line. +``` +{ + // The tag. + "tag": string, + // The to point. + "to": [number] | +string, +} | +[number] | +string +``` +* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. +``` +{ + // The id of the sketch group. + "id": uuid, + // The position of the sketch group. + "position": [number], + // The rotation of the sketch group. + "rotation": [number], + // The starting path. + "start": { + // The from point. + "from": [number], + // The name of the path. + "name": string, + // The to point. + "to": [number], +}, + // The paths in the sketch group. + "value": [{ + // The from point. + "from": [number], + // The name of the path. + "name": string, + // The to point. + "to": [number], + "type": string, +} | +{ + // The from point. + "from": [number], + // The name of the path. + "name": string, + // The to point. + "to": [number], + "type": string, + // The x coordinate. + "x": number, +} | +{ + // The from point. + "from": [number], + // The name of the path. + "name": string, + // The to point. + "to": [number], + "type": string, + // The x coordinate. + "x": number, + // The y coordinate. + "y": number, +} | +{ + // The from point. + "from": [number], + // The name of the path. + "name": string, + // The to point. + "to": [number], + "type": string, +}], +} +``` + +#### Returns + +* `SketchGroup` - A sketch group is a collection of paths. +``` +{ + // The id of the sketch group. + "id": uuid, + // The position of the sketch group. + "position": [number], + // The rotation of the sketch group. + "rotation": [number], + // The starting path. + "start": { + // The from point. + "from": [number], + // The name of the path. + "name": string, + // The to point. + "to": [number], +}, + // The paths in the sketch group. + "value": [{ + // The from point. + "from": [number], + // The name of the path. + "name": string, + // The to point. + "to": [number], + "type": string, +} | +{ + // The from point. + "from": [number], + // The name of the path. + "name": string, + // The to point. + "to": [number], + "type": string, + // The x coordinate. + "x": number, +} | +{ + // The from point. + "from": [number], + // The name of the path. + "name": string, + // The to point. + "to": [number], + "type": string, + // The x coordinate. + "x": number, + // The y coordinate. + "y": number, +} | +{ + // The from point. + "from": [number], + // The name of the path. + "name": string, + // The to point. + "to": [number], + "type": string, +}], +} +``` + + + +### xLineTo + +Draw a line to a point on the x-axis. + + + +``` +xLineTo(data: AxisLineToData, sketch_group: SketchGroup) -> SketchGroup +``` + +#### Arguments + +* `data`: `AxisLineToData` - Data to draw a line to a point on an axis. +``` +{ + // The tag. + "tag": string, + // The to point. + "to": number, +} | +number +``` +* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. +``` +{ + // The id of the sketch group. + "id": uuid, + // The position of the sketch group. + "position": [number], + // The rotation of the sketch group. + "rotation": [number], + // The starting path. + "start": { + // The from point. + "from": [number], + // The name of the path. + "name": string, + // The to point. + "to": [number], +}, + // The paths in the sketch group. + "value": [{ + // The from point. + "from": [number], + // The name of the path. + "name": string, + // The to point. + "to": [number], + "type": string, +} | +{ + // The from point. + "from": [number], + // The name of the path. + "name": string, + // The to point. + "to": [number], + "type": string, + // The x coordinate. + "x": number, +} | +{ + // The from point. + "from": [number], + // The name of the path. + "name": string, + // The to point. + "to": [number], + "type": string, + // The x coordinate. + "x": number, + // The y coordinate. + "y": number, +} | +{ + // The from point. + "from": [number], + // The name of the path. + "name": string, + // The to point. + "to": [number], + "type": string, +}], +} +``` + +#### Returns + +* `SketchGroup` - A sketch group is a collection of paths. +``` +{ + // The id of the sketch group. + "id": uuid, + // The position of the sketch group. + "position": [number], + // The rotation of the sketch group. + "rotation": [number], + // The starting path. + "start": { + // The from point. + "from": [number], + // The name of the path. + "name": string, + // The to point. + "to": [number], +}, + // The paths in the sketch group. + "value": [{ + // The from point. + "from": [number], + // The name of the path. + "name": string, + // The to point. + "to": [number], + "type": string, +} | +{ + // The from point. + "from": [number], + // The name of the path. + "name": string, + // The to point. + "to": [number], + "type": string, + // The x coordinate. + "x": number, +} | +{ + // The from point. + "from": [number], + // The name of the path. + "name": string, + // The to point. + "to": [number], + "type": string, + // The x coordinate. + "x": number, + // The y coordinate. + "y": number, +} | +{ + // The from point. + "from": [number], + // The name of the path. + "name": string, + // The to point. + "to": [number], + "type": string, +}], +} +``` + + + +### xLine + +Draw a line on the x-axis. + + + +``` +xLine(data: AxisLineData, sketch_group: SketchGroup) -> SketchGroup +``` + +#### Arguments + +* `data`: `AxisLineData` - Data to draw a line on an axis. +``` +{ + // The length of the line. + "length": number, + // The tag. + "tag": string, +} | +number +``` +* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. +``` +{ + // The id of the sketch group. + "id": uuid, + // The position of the sketch group. + "position": [number], + // The rotation of the sketch group. + "rotation": [number], + // The starting path. + "start": { + // The from point. + "from": [number], + // The name of the path. + "name": string, + // The to point. + "to": [number], +}, + // The paths in the sketch group. + "value": [{ + // The from point. + "from": [number], + // The name of the path. + "name": string, + // The to point. + "to": [number], + "type": string, +} | +{ + // The from point. + "from": [number], + // The name of the path. + "name": string, + // The to point. + "to": [number], + "type": string, + // The x coordinate. + "x": number, +} | +{ + // The from point. + "from": [number], + // The name of the path. + "name": string, + // The to point. + "to": [number], + "type": string, + // The x coordinate. + "x": number, + // The y coordinate. + "y": number, +} | +{ + // The from point. + "from": [number], + // The name of the path. + "name": string, + // The to point. + "to": [number], + "type": string, +}], +} +``` + +#### Returns + +* `SketchGroup` - A sketch group is a collection of paths. +``` +{ + // The id of the sketch group. + "id": uuid, + // The position of the sketch group. + "position": [number], + // The rotation of the sketch group. + "rotation": [number], + // The starting path. + "start": { + // The from point. + "from": [number], + // The name of the path. + "name": string, + // The to point. + "to": [number], +}, + // The paths in the sketch group. + "value": [{ + // The from point. + "from": [number], + // The name of the path. + "name": string, + // The to point. + "to": [number], + "type": string, +} | +{ + // The from point. + "from": [number], + // The name of the path. + "name": string, + // The to point. + "to": [number], + "type": string, + // The x coordinate. + "x": number, +} | +{ + // The from point. + "from": [number], + // The name of the path. + "name": string, + // The to point. + "to": [number], + "type": string, + // The x coordinate. + "x": number, + // The y coordinate. + "y": number, +} | +{ + // The from point. + "from": [number], + // The name of the path. + "name": string, + // The to point. + "to": [number], + "type": string, +}], +} +``` + + + +### yLineTo + +Draw a line to a point on the y-axis. + + + +``` +yLineTo(data: AxisLineToData, sketch_group: SketchGroup) -> SketchGroup +``` + +#### Arguments + +* `data`: `AxisLineToData` - Data to draw a line to a point on an axis. +``` +{ + // The tag. + "tag": string, + // The to point. + "to": number, +} | +number +``` +* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. +``` +{ + // The id of the sketch group. + "id": uuid, + // The position of the sketch group. + "position": [number], + // The rotation of the sketch group. + "rotation": [number], + // The starting path. + "start": { + // The from point. + "from": [number], + // The name of the path. + "name": string, + // The to point. + "to": [number], +}, + // The paths in the sketch group. + "value": [{ + // The from point. + "from": [number], + // The name of the path. + "name": string, + // The to point. + "to": [number], + "type": string, +} | +{ + // The from point. + "from": [number], + // The name of the path. + "name": string, + // The to point. + "to": [number], + "type": string, + // The x coordinate. + "x": number, +} | +{ + // The from point. + "from": [number], + // The name of the path. + "name": string, + // The to point. + "to": [number], + "type": string, + // The x coordinate. + "x": number, + // The y coordinate. + "y": number, +} | +{ + // The from point. + "from": [number], + // The name of the path. + "name": string, + // The to point. + "to": [number], + "type": string, +}], +} +``` + +#### Returns + +* `SketchGroup` - A sketch group is a collection of paths. +``` +{ + // The id of the sketch group. + "id": uuid, + // The position of the sketch group. + "position": [number], + // The rotation of the sketch group. + "rotation": [number], + // The starting path. + "start": { + // The from point. + "from": [number], + // The name of the path. + "name": string, + // The to point. + "to": [number], +}, + // The paths in the sketch group. + "value": [{ + // The from point. + "from": [number], + // The name of the path. + "name": string, + // The to point. + "to": [number], + "type": string, +} | +{ + // The from point. + "from": [number], + // The name of the path. + "name": string, + // The to point. + "to": [number], + "type": string, + // The x coordinate. + "x": number, +} | +{ + // The from point. + "from": [number], + // The name of the path. + "name": string, + // The to point. + "to": [number], + "type": string, + // The x coordinate. + "x": number, + // The y coordinate. + "y": number, +} | +{ + // The from point. + "from": [number], + // The name of the path. + "name": string, + // The to point. + "to": [number], + "type": string, +}], +} +``` + + + +### yLine + +Draw a line on the y-axis. + + + +``` +yLine(data: AxisLineData, sketch_group: SketchGroup) -> SketchGroup +``` + +#### Arguments + +* `data`: `AxisLineData` - Data to draw a line on an axis. +``` +{ + // The length of the line. + "length": number, + // The tag. + "tag": string, +} | +number +``` +* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. +``` +{ + // The id of the sketch group. + "id": uuid, + // The position of the sketch group. + "position": [number], + // The rotation of the sketch group. + "rotation": [number], + // The starting path. + "start": { + // The from point. + "from": [number], + // The name of the path. + "name": string, + // The to point. + "to": [number], +}, + // The paths in the sketch group. + "value": [{ + // The from point. + "from": [number], + // The name of the path. + "name": string, + // The to point. + "to": [number], + "type": string, +} | +{ + // The from point. + "from": [number], + // The name of the path. + "name": string, + // The to point. + "to": [number], + "type": string, + // The x coordinate. + "x": number, +} | +{ + // The from point. + "from": [number], + // The name of the path. + "name": string, + // The to point. + "to": [number], + "type": string, + // The x coordinate. + "x": number, + // The y coordinate. + "y": number, +} | +{ + // The from point. + "from": [number], + // The name of the path. + "name": string, + // The to point. + "to": [number], + "type": string, +}], +} +``` + +#### Returns + +* `SketchGroup` - A sketch group is a collection of paths. +``` +{ + // The id of the sketch group. + "id": uuid, + // The position of the sketch group. + "position": [number], + // The rotation of the sketch group. + "rotation": [number], + // The starting path. + "start": { + // The from point. + "from": [number], + // The name of the path. + "name": string, + // The to point. + "to": [number], +}, + // The paths in the sketch group. + "value": [{ + // The from point. + "from": [number], + // The name of the path. + "name": string, + // The to point. + "to": [number], + "type": string, +} | +{ + // The from point. + "from": [number], + // The name of the path. + "name": string, + // The to point. + "to": [number], + "type": string, + // The x coordinate. + "x": number, +} | +{ + // The from point. + "from": [number], + // The name of the path. + "name": string, + // The to point. + "to": [number], + "type": string, + // The x coordinate. + "x": number, + // The y coordinate. + "y": number, +} | +{ + // The from point. + "from": [number], + // The name of the path. + "name": string, + // The to point. + "to": [number], + "type": string, +}], +} +``` + + + +### angledLineToX + +Draw an angled line to a given x coordinate. + + + +``` +angledLineToX(data: AngledLineToData, sketch_group: SketchGroup) -> SketchGroup +``` + +#### Arguments + +* `data`: `AngledLineToData` - Data to draw an angled line to a point. +``` +{ + // The angle of the line. + "angle": number, + // The tag. + "tag": string, + // The point to draw to. + "to": number, +} | +[number] +``` +* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. +``` +{ + // The id of the sketch group. + "id": uuid, + // The position of the sketch group. + "position": [number], + // The rotation of the sketch group. + "rotation": [number], + // The starting path. + "start": { + // The from point. + "from": [number], + // The name of the path. + "name": string, + // The to point. + "to": [number], +}, + // The paths in the sketch group. + "value": [{ + // The from point. + "from": [number], + // The name of the path. + "name": string, + // The to point. + "to": [number], + "type": string, +} | +{ + // The from point. + "from": [number], + // The name of the path. + "name": string, + // The to point. + "to": [number], + "type": string, + // The x coordinate. + "x": number, +} | +{ + // The from point. + "from": [number], + // The name of the path. + "name": string, + // The to point. + "to": [number], + "type": string, + // The x coordinate. + "x": number, + // The y coordinate. + "y": number, +} | +{ + // The from point. + "from": [number], + // The name of the path. + "name": string, + // The to point. + "to": [number], + "type": string, +}], +} +``` + +#### Returns + +* `SketchGroup` - A sketch group is a collection of paths. +``` +{ + // The id of the sketch group. + "id": uuid, + // The position of the sketch group. + "position": [number], + // The rotation of the sketch group. + "rotation": [number], + // The starting path. + "start": { + // The from point. + "from": [number], + // The name of the path. + "name": string, + // The to point. + "to": [number], +}, + // The paths in the sketch group. + "value": [{ + // The from point. + "from": [number], + // The name of the path. + "name": string, + // The to point. + "to": [number], + "type": string, +} | +{ + // The from point. + "from": [number], + // The name of the path. + "name": string, + // The to point. + "to": [number], + "type": string, + // The x coordinate. + "x": number, +} | +{ + // The from point. + "from": [number], + // The name of the path. + "name": string, + // The to point. + "to": [number], + "type": string, + // The x coordinate. + "x": number, + // The y coordinate. + "y": number, +} | +{ + // The from point. + "from": [number], + // The name of the path. + "name": string, + // The to point. + "to": [number], + "type": string, +}], +} +``` + + + +### angledLineToY + +Draw an angled line to a given y coordinate. + + + +``` +angledLineToY(data: AngledLineToData, sketch_group: SketchGroup) -> SketchGroup +``` + +#### Arguments + +* `data`: `AngledLineToData` - Data to draw an angled line to a point. +``` +{ + // The angle of the line. + "angle": number, + // The tag. + "tag": string, + // The point to draw to. + "to": number, +} | +[number] +``` +* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. +``` +{ + // The id of the sketch group. + "id": uuid, + // The position of the sketch group. + "position": [number], + // The rotation of the sketch group. + "rotation": [number], + // The starting path. + "start": { + // The from point. + "from": [number], + // The name of the path. + "name": string, + // The to point. + "to": [number], +}, + // The paths in the sketch group. + "value": [{ + // The from point. + "from": [number], + // The name of the path. + "name": string, + // The to point. + "to": [number], + "type": string, +} | +{ + // The from point. + "from": [number], + // The name of the path. + "name": string, + // The to point. + "to": [number], + "type": string, + // The x coordinate. + "x": number, +} | +{ + // The from point. + "from": [number], + // The name of the path. + "name": string, + // The to point. + "to": [number], + "type": string, + // The x coordinate. + "x": number, + // The y coordinate. + "y": number, +} | +{ + // The from point. + "from": [number], + // The name of the path. + "name": string, + // The to point. + "to": [number], + "type": string, +}], +} +``` + +#### Returns + +* `SketchGroup` - A sketch group is a collection of paths. +``` +{ + // The id of the sketch group. + "id": uuid, + // The position of the sketch group. + "position": [number], + // The rotation of the sketch group. + "rotation": [number], + // The starting path. + "start": { + // The from point. + "from": [number], + // The name of the path. + "name": string, + // The to point. + "to": [number], +}, + // The paths in the sketch group. + "value": [{ + // The from point. + "from": [number], + // The name of the path. + "name": string, + // The to point. + "to": [number], + "type": string, +} | +{ + // The from point. + "from": [number], + // The name of the path. + "name": string, + // The to point. + "to": [number], + "type": string, + // The x coordinate. + "x": number, +} | +{ + // The from point. + "from": [number], + // The name of the path. + "name": string, + // The to point. + "to": [number], + "type": string, + // The x coordinate. + "x": number, + // The y coordinate. + "y": number, +} | +{ + // The from point. + "from": [number], + // The name of the path. + "name": string, + // The to point. + "to": [number], + "type": string, +}], +} +``` + + + +### angledLine + +Draw an angled line. + + + +``` +angledLine(data: AngledLineData, sketch_group: SketchGroup) -> SketchGroup +``` + +#### Arguments + +* `data`: `AngledLineData` - Data to draw an angled line. +``` +{ + // The angle of the line. + "angle": number, + // The length of the line. + "length": number, + // The tag. + "tag": string, +} | +[number] +``` +* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. +``` +{ + // The id of the sketch group. + "id": uuid, + // The position of the sketch group. + "position": [number], + // The rotation of the sketch group. + "rotation": [number], + // The starting path. + "start": { + // The from point. + "from": [number], + // The name of the path. + "name": string, + // The to point. + "to": [number], +}, + // The paths in the sketch group. + "value": [{ + // The from point. + "from": [number], + // The name of the path. + "name": string, + // The to point. + "to": [number], + "type": string, +} | +{ + // The from point. + "from": [number], + // The name of the path. + "name": string, + // The to point. + "to": [number], + "type": string, + // The x coordinate. + "x": number, +} | +{ + // The from point. + "from": [number], + // The name of the path. + "name": string, + // The to point. + "to": [number], + "type": string, + // The x coordinate. + "x": number, + // The y coordinate. + "y": number, +} | +{ + // The from point. + "from": [number], + // The name of the path. + "name": string, + // The to point. + "to": [number], + "type": string, +}], +} +``` + +#### Returns + +* `SketchGroup` - A sketch group is a collection of paths. +``` +{ + // The id of the sketch group. + "id": uuid, + // The position of the sketch group. + "position": [number], + // The rotation of the sketch group. + "rotation": [number], + // The starting path. + "start": { + // The from point. + "from": [number], + // The name of the path. + "name": string, + // The to point. + "to": [number], +}, + // The paths in the sketch group. + "value": [{ + // The from point. + "from": [number], + // The name of the path. + "name": string, + // The to point. + "to": [number], + "type": string, +} | +{ + // The from point. + "from": [number], + // The name of the path. + "name": string, + // The to point. + "to": [number], + "type": string, + // The x coordinate. + "x": number, +} | +{ + // The from point. + "from": [number], + // The name of the path. + "name": string, + // The to point. + "to": [number], + "type": string, + // The x coordinate. + "x": number, + // The y coordinate. + "y": number, +} | +{ + // The from point. + "from": [number], + // The name of the path. + "name": string, + // The to point. + "to": [number], + "type": string, +}], +} +``` + + + +### angledLineOfXLength + +Draw an angled line of a given x length. + + + +``` +angledLineOfXLength(data: AngledLineData, sketch_group: SketchGroup) -> SketchGroup +``` + +#### Arguments + +* `data`: `AngledLineData` - Data to draw an angled line. +``` +{ + // The angle of the line. + "angle": number, + // The length of the line. + "length": number, + // The tag. + "tag": string, +} | +[number] +``` +* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. +``` +{ + // The id of the sketch group. + "id": uuid, + // The position of the sketch group. + "position": [number], + // The rotation of the sketch group. + "rotation": [number], + // The starting path. + "start": { + // The from point. + "from": [number], + // The name of the path. + "name": string, + // The to point. + "to": [number], +}, + // The paths in the sketch group. + "value": [{ + // The from point. + "from": [number], + // The name of the path. + "name": string, + // The to point. + "to": [number], + "type": string, +} | +{ + // The from point. + "from": [number], + // The name of the path. + "name": string, + // The to point. + "to": [number], + "type": string, + // The x coordinate. + "x": number, +} | +{ + // The from point. + "from": [number], + // The name of the path. + "name": string, + // The to point. + "to": [number], + "type": string, + // The x coordinate. + "x": number, + // The y coordinate. + "y": number, +} | +{ + // The from point. + "from": [number], + // The name of the path. + "name": string, + // The to point. + "to": [number], + "type": string, +}], +} +``` + +#### Returns + +* `SketchGroup` - A sketch group is a collection of paths. +``` +{ + // The id of the sketch group. + "id": uuid, + // The position of the sketch group. + "position": [number], + // The rotation of the sketch group. + "rotation": [number], + // The starting path. + "start": { + // The from point. + "from": [number], + // The name of the path. + "name": string, + // The to point. + "to": [number], +}, + // The paths in the sketch group. + "value": [{ + // The from point. + "from": [number], + // The name of the path. + "name": string, + // The to point. + "to": [number], + "type": string, +} | +{ + // The from point. + "from": [number], + // The name of the path. + "name": string, + // The to point. + "to": [number], + "type": string, + // The x coordinate. + "x": number, +} | +{ + // The from point. + "from": [number], + // The name of the path. + "name": string, + // The to point. + "to": [number], + "type": string, + // The x coordinate. + "x": number, + // The y coordinate. + "y": number, +} | +{ + // The from point. + "from": [number], + // The name of the path. + "name": string, + // The to point. + "to": [number], + "type": string, +}], +} +``` + + + +### angledLineOfYLength + +Draw an angled line of a given y length. + + + +``` +angledLineOfYLength(data: AngledLineData, sketch_group: SketchGroup) -> SketchGroup +``` + +#### Arguments + +* `data`: `AngledLineData` - Data to draw an angled line. +``` +{ + // The angle of the line. + "angle": number, + // The length of the line. + "length": number, + // The tag. + "tag": string, +} | +[number] +``` +* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. +``` +{ + // The id of the sketch group. + "id": uuid, + // The position of the sketch group. + "position": [number], + // The rotation of the sketch group. + "rotation": [number], + // The starting path. + "start": { + // The from point. + "from": [number], + // The name of the path. + "name": string, + // The to point. + "to": [number], +}, + // The paths in the sketch group. + "value": [{ + // The from point. + "from": [number], + // The name of the path. + "name": string, + // The to point. + "to": [number], + "type": string, +} | +{ + // The from point. + "from": [number], + // The name of the path. + "name": string, + // The to point. + "to": [number], + "type": string, + // The x coordinate. + "x": number, +} | +{ + // The from point. + "from": [number], + // The name of the path. + "name": string, + // The to point. + "to": [number], + "type": string, + // The x coordinate. + "x": number, + // The y coordinate. + "y": number, +} | +{ + // The from point. + "from": [number], + // The name of the path. + "name": string, + // The to point. + "to": [number], + "type": string, +}], +} +``` + +#### Returns + +* `SketchGroup` - A sketch group is a collection of paths. +``` +{ + // The id of the sketch group. + "id": uuid, + // The position of the sketch group. + "position": [number], + // The rotation of the sketch group. + "rotation": [number], + // The starting path. + "start": { + // The from point. + "from": [number], + // The name of the path. + "name": string, + // The to point. + "to": [number], +}, + // The paths in the sketch group. + "value": [{ + // The from point. + "from": [number], + // The name of the path. + "name": string, + // The to point. + "to": [number], + "type": string, +} | +{ + // The from point. + "from": [number], + // The name of the path. + "name": string, + // The to point. + "to": [number], + "type": string, + // The x coordinate. + "x": number, +} | +{ + // The from point. + "from": [number], + // The name of the path. + "name": string, + // The to point. + "to": [number], + "type": string, + // The x coordinate. + "x": number, + // The y coordinate. + "y": number, +} | +{ + // The from point. + "from": [number], + // The name of the path. + "name": string, + // The to point. + "to": [number], + "type": string, +}], +} +``` + + + +### angledLineThatIntersects + +Draw an angled line that intersects with a given line. + + + +``` +angledLineThatIntersects(data: AngeledLineThatIntersectsData, sketch_group: SketchGroup) -> SketchGroup +``` + +#### Arguments + +* `data`: `AngeledLineThatIntersectsData` - Data for drawing an angled line that intersects with a given line. +``` +{ + // The angle of the line. + "angle": number, + // The tag of the line to intersect with. + "intersectTag": string, + // The offset from the intersecting line. + "offset": number, + // The tag. + "tag": string, +} +``` +* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. +``` +{ + // The id of the sketch group. + "id": uuid, + // The position of the sketch group. + "position": [number], + // The rotation of the sketch group. + "rotation": [number], + // The starting path. + "start": { + // The from point. + "from": [number], + // The name of the path. + "name": string, + // The to point. + "to": [number], +}, + // The paths in the sketch group. + "value": [{ + // The from point. + "from": [number], + // The name of the path. + "name": string, + // The to point. + "to": [number], + "type": string, +} | +{ + // The from point. + "from": [number], + // The name of the path. + "name": string, + // The to point. + "to": [number], + "type": string, + // The x coordinate. + "x": number, +} | +{ + // The from point. + "from": [number], + // The name of the path. + "name": string, + // The to point. + "to": [number], + "type": string, + // The x coordinate. + "x": number, + // The y coordinate. + "y": number, +} | +{ + // The from point. + "from": [number], + // The name of the path. + "name": string, + // The to point. + "to": [number], + "type": string, +}], +} +``` + +#### Returns + +* `SketchGroup` - A sketch group is a collection of paths. +``` +{ + // The id of the sketch group. + "id": uuid, + // The position of the sketch group. + "position": [number], + // The rotation of the sketch group. + "rotation": [number], + // The starting path. + "start": { + // The from point. + "from": [number], + // The name of the path. + "name": string, + // The to point. + "to": [number], +}, + // The paths in the sketch group. + "value": [{ + // The from point. + "from": [number], + // The name of the path. + "name": string, + // The to point. + "to": [number], + "type": string, +} | +{ + // The from point. + "from": [number], + // The name of the path. + "name": string, + // The to point. + "to": [number], + "type": string, + // The x coordinate. + "x": number, +} | +{ + // The from point. + "from": [number], + // The name of the path. + "name": string, + // The to point. + "to": [number], + "type": string, + // The x coordinate. + "x": number, + // The y coordinate. + "y": number, +} | +{ + // The from point. + "from": [number], + // The name of the path. + "name": string, + // The to point. + "to": [number], + "type": string, +}], +} +``` + + + +### startSketchAt + +Start a sketch at a given point. + + + +``` +startSketchAt(data: LineData) -> SketchGroup +``` + +#### Arguments + +* `data`: `LineData` - Data to draw a line. +``` +{ + // The tag. + "tag": string, + // The to point. + "to": [number] | +string, +} | +[number] | +string +``` + +#### Returns + +* `SketchGroup` - A sketch group is a collection of paths. +``` +{ + // The id of the sketch group. + "id": uuid, + // The position of the sketch group. + "position": [number], + // The rotation of the sketch group. + "rotation": [number], + // The starting path. + "start": { + // The from point. + "from": [number], + // The name of the path. + "name": string, + // The to point. + "to": [number], +}, + // The paths in the sketch group. + "value": [{ + // The from point. + "from": [number], + // The name of the path. + "name": string, + // The to point. + "to": [number], + "type": string, +} | +{ + // The from point. + "from": [number], + // The name of the path. + "name": string, + // The to point. + "to": [number], + "type": string, + // The x coordinate. + "x": number, +} | +{ + // The from point. + "from": [number], + // The name of the path. + "name": string, + // The to point. + "to": [number], + "type": string, + // The x coordinate. + "x": number, + // The y coordinate. + "y": number, +} | +{ + // The from point. + "from": [number], + // The name of the path. + "name": string, + // The to point. + "to": [number], + "type": string, +}], +} +``` + + + +### close + +Close the current sketch. + + + +``` +close(sketch_group: SketchGroup) -> SketchGroup +``` + +#### Arguments + +* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. +``` +{ + // The id of the sketch group. + "id": uuid, + // The position of the sketch group. + "position": [number], + // The rotation of the sketch group. + "rotation": [number], + // The starting path. + "start": { + // The from point. + "from": [number], + // The name of the path. + "name": string, + // The to point. + "to": [number], +}, + // The paths in the sketch group. + "value": [{ + // The from point. + "from": [number], + // The name of the path. + "name": string, + // The to point. + "to": [number], + "type": string, +} | +{ + // The from point. + "from": [number], + // The name of the path. + "name": string, + // The to point. + "to": [number], + "type": string, + // The x coordinate. + "x": number, +} | +{ + // The from point. + "from": [number], + // The name of the path. + "name": string, + // The to point. + "to": [number], + "type": string, + // The x coordinate. + "x": number, + // The y coordinate. + "y": number, +} | +{ + // The from point. + "from": [number], + // The name of the path. + "name": string, + // The to point. + "to": [number], + "type": string, +}], +} +``` + +#### Returns + +* `SketchGroup` - A sketch group is a collection of paths. +``` +{ + // The id of the sketch group. + "id": uuid, + // The position of the sketch group. + "position": [number], + // The rotation of the sketch group. + "rotation": [number], + // The starting path. + "start": { + // The from point. + "from": [number], + // The name of the path. + "name": string, + // The to point. + "to": [number], +}, + // The paths in the sketch group. + "value": [{ + // The from point. + "from": [number], + // The name of the path. + "name": string, + // The to point. + "to": [number], + "type": string, +} | +{ + // The from point. + "from": [number], + // The name of the path. + "name": string, + // The to point. + "to": [number], + "type": string, + // The x coordinate. + "x": number, +} | +{ + // The from point. + "from": [number], + // The name of the path. + "name": string, + // The to point. + "to": [number], + "type": string, + // The x coordinate. + "x": number, + // The y coordinate. + "y": number, +} | +{ + // The from point. + "from": [number], + // The name of the path. + "name": string, + // The to point. + "to": [number], + "type": string, +}], +} +``` + + + diff --git a/src/wasm-lib/Cargo.lock b/src/wasm-lib/Cargo.lock index af3c0521d..67b3c0626 100644 --- a/src/wasm-lib/Cargo.lock +++ b/src/wasm-lib/Cargo.lock @@ -7,12 +7,16 @@ name = "Inflector" version = "0.11.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fe438c63458706e03479442743baae6c88256498e6431708f6dfc520a26515d3" +dependencies = [ + "lazy_static", + "regex", +] [[package]] name = "addr2line" -version = "0.20.0" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4fa78e18c64fce05e902adecd7a5eed15a5e0a3439f7b0e169f0252214865e3" +checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" dependencies = [ "gimli", ] @@ -38,11 +42,51 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" +[[package]] +name = "android_system_properties" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" +dependencies = [ + "libc", +] + [[package]] name = "anyhow" version = "1.0.75" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a4668cab20f66d8d020e1fbc0ebe47217433c1b6c8f2040faf858554e394ace6" +dependencies = [ + "backtrace", +] + +[[package]] +name = "arc-swap" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bddcadddf5e9015d310179a59bb28c4d4b9920ad0f11e8e14dbadf654890c9a6" + +[[package]] +name = "async-trait" +version = "0.1.73" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc00ceb34980c03614e35a3a4e218276a0a824e911d07651cd0d858a51e8c0f0" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.29", +] + +[[package]] +name = "atty" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" +dependencies = [ + "hermit-abi 0.1.19", + "libc", + "winapi", +] [[package]] name = "autocfg" @@ -52,9 +96,9 @@ checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" [[package]] name = "backtrace" -version = "0.3.68" +version = "0.3.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4319208da049c43661739c5fade2ba182f09d1dc2299b32298d3a31692b17e12" +checksum = "2089b7e3f35b9dd2d0ed921ead4f6d318c27680d4a5bd167b3ee120edb105837" dependencies = [ "addr2line", "cc", @@ -71,6 +115,17 @@ version = "0.21.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "604178f6c5c21f02dc555784810edfb88d34ac2c73b2eae109655649ee73ce3d" +[[package]] +name = "bigdecimal" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a6773ddc0eafc0e509fb60e48dff7f450f8e674a0686ae8605e8d9901bd5eefa" +dependencies = [ + "num-bigint", + "num-integer", + "num-traits", +] + [[package]] name = "bincode" version = "1.3.3" @@ -86,6 +141,12 @@ version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" +[[package]] +name = "bitflags" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4682ae6287fcf752ecaabbfcc7b6f9b72aa33933dc23a554d853aea8eea8635" + [[package]] name = "block-buffer" version = "0.10.4" @@ -97,9 +158,9 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.12.0" +version = "3.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d261e256854913907f67ed06efbc3338dfe6179796deefc1ff763fc1aee5535" +checksum = "a3e2c3daef883ecc1b5d58c15adae93470a91d425f3532ba1695849656af3fc1" [[package]] name = "byteorder" @@ -118,9 +179,12 @@ dependencies = [ [[package]] name = "cc" -version = "1.0.79" +version = "1.0.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50d30906286121d95be3d479533b458f87493b30a4b5f79a607db8f5d11aa91f" +checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" +dependencies = [ + "libc", +] [[package]] name = "cfg-if" @@ -135,10 +199,94 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec837a71355b28f6556dbd569b37b3f363091c0bd4b2e735674521b4c5fd9bc5" dependencies = [ "android-tzdata", + "iana-time-zone", + "js-sys", "num-traits", "serde", + "time 0.1.45", + "wasm-bindgen", + "winapi", ] +[[package]] +name = "clap" +version = "3.2.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ea181bf566f71cb9a5d17a59e1871af638180a18fb0035c92ae62b705207123" +dependencies = [ + "atty", + "bitflags 1.3.2", + "clap_derive", + "clap_lex", + "indexmap 1.9.3", + "once_cell", + "strsim", + "termcolor", + "textwrap", + "unicase", +] + +[[package]] +name = "clap_derive" +version = "3.2.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae6371b8bdc8b7d3959e9cf7b22d4435ef3e79e138688421ec654acf8c81b008" +dependencies = [ + "heck", + "proc-macro-error", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "clap_lex" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2850f2f5a82cbf437dd5af4d49848fbdfc27c157c3d010345776f952765261c5" +dependencies = [ + "os_str_bytes", +] + +[[package]] +name = "colored" +version = "2.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2674ec482fbc38012cf31e6c42ba0177b431a0cb6f15fe40efa5aab1bda516f6" +dependencies = [ + "is-terminal", + "lazy_static", + "windows-sys 0.48.0", +] + +[[package]] +name = "console" +version = "0.15.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c926e00cc70edefdc64d3a5ff31cc65bb97a3460097762bd23afb4d8145fccf8" +dependencies = [ + "encode_unicode", + "lazy_static", + "libc", + "unicode-width", + "windows-sys 0.45.0", +] + +[[package]] +name = "convert_case" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec182b0ca2f35d8fc196cf3404988fd8b8c739a4d270ff118a398feb0cbec1ca" +dependencies = [ + "unicode-segmentation", +] + +[[package]] +name = "core-foundation-sys" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e496a50fda8aacccc86d7529e2c1e0892dbd0f898a6b5645b5561b89c3210efa" + [[package]] name = "cpufeatures" version = "0.2.9" @@ -148,6 +296,25 @@ dependencies = [ "libc", ] +[[package]] +name = "crossbeam-channel" +version = "0.5.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a33c2bf77f2df06183c3aa30d1e96c0695a313d4f9c453cc3762a6db39f99200" +dependencies = [ + "cfg-if", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-utils" +version = "0.8.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a22b2d63d4d1dc0b7f1b6b2747dd0088008a9be28b6ddf0b1e7d335e3037294" +dependencies = [ + "cfg-if", +] + [[package]] name = "crypto-common" version = "0.1.6" @@ -164,6 +331,27 @@ version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c2e66c9d817f1720209181c316d28635c050fa304f9c79e47a520882661b7308" +[[package]] +name = "deranged" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2696e8a945f658fd14dc3b87242e6b80cd0f36ff04ea560fa39082368847946" + +[[package]] +name = "derive-docs" +version = "0.1.0" +dependencies = [ + "convert_case", + "expectorate", + "openapitor", + "pretty_assertions", + "proc-macro2", + "quote", + "serde", + "serde_tokenstream", + "syn 2.0.29", +] + [[package]] name = "diff" version = "0.1.13" @@ -180,6 +368,27 @@ dependencies = [ "crypto-common", ] +[[package]] +name = "dirs-next" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b98cf8ebf19c3d1b223e151f99a4f9f0690dca41414773390fc824184ac833e1" +dependencies = [ + "cfg-if", + "dirs-sys-next", +] + +[[package]] +name = "dirs-sys-next" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ebda144c4fe02d1f7ea1a7d9641b6fc6b580adcfa024ae48797ecdeb6825b4d" +dependencies = [ + "libc", + "redox_users", + "winapi", +] + [[package]] name = "dyn-clone" version = "1.0.13" @@ -192,6 +401,65 @@ version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" +[[package]] +name = "encode_unicode" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f" + +[[package]] +name = "encoding_rs" +version = "0.8.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7268b386296a025e474d5140678f75d6de9493ae55a5d709eeb9dd08149945e1" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "equivalent" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" + +[[package]] +name = "errno" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b30f669a7961ef1631673d2766cc92f52d64f7ef354d4fe0ddfd30ed52f0f4f" +dependencies = [ + "errno-dragonfly", + "libc", + "windows-sys 0.48.0", +] + +[[package]] +name = "errno-dragonfly" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa68f1b12764fab894d2755d2518754e71b4fd80ecfb822714a1206c2aab39bf" +dependencies = [ + "cc", + "libc", +] + +[[package]] +name = "expectorate" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "710ab6a2d57038a835d66f78d5af3fa5d27c1ec4682f823b9203c48826cb0591" +dependencies = [ + "console", + "newline-converter", + "similar", +] + +[[package]] +name = "fastrand" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6999dc1837253364c2ebb0704ba97994bd874e8f195d665c50b7548f6ea92764" + [[package]] name = "fnv" version = "1.0.7" @@ -207,6 +475,19 @@ dependencies = [ "percent-encoding", ] +[[package]] +name = "format_serde_error" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5837b8e6a4001f99fe4746767fb7379e8510c508a843caa136cc12ed9c0bad0" +dependencies = [ + "colored", + "serde", + "serde_json", + "serde_yaml 0.8.26", + "unicode-segmentation", +] + [[package]] name = "futures" version = "0.3.28" @@ -315,15 +596,15 @@ dependencies = [ "cfg-if", "js-sys", "libc", - "wasi", + "wasi 0.11.0+wasi-snapshot-preview1", "wasm-bindgen", ] [[package]] name = "gimli" -version = "0.27.3" +version = "0.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6c80984affa11d98d1b88b66ac8853f143217b399d3c74116778ff8fdb4ed2e" +checksum = "6fb8d784f27acf97159b40fc4db5ecd8aa23b9ad5ef69cdd136d3bc80665f0c0" [[package]] name = "gloo-events" @@ -360,12 +641,67 @@ dependencies = [ "web-sys", ] +[[package]] +name = "h2" +version = "0.3.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91fc23aa11be92976ef4729127f1a74adf36d8436f7816b185d18df956790833" +dependencies = [ + "bytes", + "fnv", + "futures-core", + "futures-sink", + "futures-util", + "http", + "indexmap 1.9.3", + "slab", + "tokio", + "tokio-util", + "tracing", +] + +[[package]] +name = "hashbrown" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" + +[[package]] +name = "hashbrown" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c6201b9ff9fd90a5a3bac2e56a830d0caa509576f0e503818ee82c181b3437a" + +[[package]] +name = "heck" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" + +[[package]] +name = "hermit-abi" +version = "0.1.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" +dependencies = [ + "libc", +] + [[package]] name = "hermit-abi" version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "443144c8cdadd93ebf52ddb4056d257f5b52c04d3c804e657d19eb73fc33668b" +[[package]] +name = "home" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5444c27eef6923071f7ebcc33e3444508466a76f7a2b93da00ed6e19f30c1ddb" +dependencies = [ + "windows-sys 0.48.0", +] + [[package]] name = "http" version = "0.2.9" @@ -377,12 +713,90 @@ dependencies = [ "itoa", ] +[[package]] +name = "http-body" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d5f38f16d184e36f2408a55281cd658ecbd3ca05cce6d6510a176eca393e26d1" +dependencies = [ + "bytes", + "http", + "pin-project-lite", +] + [[package]] name = "httparse" version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" +[[package]] +name = "httpdate" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" + +[[package]] +name = "hyper" +version = "0.14.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffb1cfd654a8219eaef89881fdb3bb3b1cdc5fa75ded05d6933b2b382e395468" +dependencies = [ + "bytes", + "futures-channel", + "futures-core", + "futures-util", + "h2", + "http", + "http-body", + "httparse", + "httpdate", + "itoa", + "pin-project-lite", + "socket2 0.4.9", + "tokio", + "tower-service", + "tracing", + "want", +] + +[[package]] +name = "hyper-rustls" +version = "0.24.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d78e1e73ec14cf7375674f74d7dde185c8206fd9dea6fb6295e8a98098aaa97" +dependencies = [ + "futures-util", + "http", + "hyper", + "rustls", + "tokio", + "tokio-rustls", +] + +[[package]] +name = "iana-time-zone" +version = "0.1.57" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2fad5b825842d2b38bd206f3e81d6957625fd7f0a361e345c30e01a0ae2dd613" +dependencies = [ + "android_system_properties", + "core-foundation-sys", + "iana-time-zone-haiku", + "js-sys", + "wasm-bindgen", + "windows", +] + +[[package]] +name = "iana-time-zone-haiku" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" +dependencies = [ + "cc", +] + [[package]] name = "idna" version = "0.4.0" @@ -393,6 +807,44 @@ dependencies = [ "unicode-normalization", ] +[[package]] +name = "indexmap" +version = "1.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" +dependencies = [ + "autocfg", + "hashbrown 0.12.3", + "serde", +] + +[[package]] +name = "indexmap" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d5477fe2230a79769d8dc68e0eabf5437907c0457a5614a9e8dddb67f65eb65d" +dependencies = [ + "equivalent", + "hashbrown 0.14.0", +] + +[[package]] +name = "ipnet" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28b29a3cd74f0f4598934efe3aeba42bae0eb4680554128851ebbecb02af14e6" + +[[package]] +name = "is-terminal" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb0889898416213fab133e1d33a0e5858a48177452750691bde3666d0fdbaf8b" +dependencies = [ + "hermit-abi 0.3.2", + "rustix", + "windows-sys 0.48.0", +] + [[package]] name = "itertools" version = "0.10.5" @@ -404,9 +856,9 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.5" +version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fad582f4b9e86b6caa621cabeb0963332d92eea04729ab12892c2533951e6440" +checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" [[package]] name = "js-sys" @@ -417,6 +869,17 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "json-patch" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eb3fa5a61630976fc4c353c70297f2e93f1930e3ccee574d59d618ccbd5154ce" +dependencies = [ + "serde", + "serde_json", + "treediff", +] + [[package]] name = "kittycad" version = "0.2.19" @@ -457,6 +920,12 @@ version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" +[[package]] +name = "linux-raw-sys" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57bcfdad1b858c2db7c38303a6d2ad4dfaf5eb53dfeb0910128b2c26d6158503" + [[package]] name = "lock_api" version = "0.4.10" @@ -469,11 +938,11 @@ dependencies = [ [[package]] name = "log" -version = "0.4.17" +version = "0.4.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" +checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" dependencies = [ - "cfg-if", + "serde", ] [[package]] @@ -491,6 +960,22 @@ version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" +[[package]] +name = "mime" +version = "0.3.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" + +[[package]] +name = "mime_guess" +version = "2.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4192263c238a5f0d0c6bfd21f336a313a4ce1c450542449ca191bb657b4642ef" +dependencies = [ + "mime", + "unicase", +] + [[package]] name = "minimal-lexical" version = "0.2.1" @@ -513,8 +998,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "927a765cd3fc26206e66b296465fa9d3e5ab003e651c1b3c060e7956d96b19d2" dependencies = [ "libc", - "wasi", - "windows-sys", + "wasi 0.11.0+wasi-snapshot-preview1", + "windows-sys 0.48.0", +] + +[[package]] +name = "newline-converter" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "47b6b097ecb1cbfed438542d16e84fd7ad9b0c76c8a65b7f9039212a3d14dc7f" +dependencies = [ + "unicode-segmentation", ] [[package]] @@ -527,6 +1021,27 @@ dependencies = [ "minimal-lexical", ] +[[package]] +name = "num-bigint" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "608e7659b5c3d7cba262d894801b9ec9d00de989e8a82bd4bef91d08da45cdc0" +dependencies = [ + "autocfg", + "num-integer", + "num-traits", +] + +[[package]] +name = "num-integer" +version = "0.1.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9" +dependencies = [ + "autocfg", + "num-traits", +] + [[package]] name = "num-traits" version = "0.2.16" @@ -542,15 +1057,30 @@ version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" dependencies = [ - "hermit-abi", + "hermit-abi 0.3.2", "libc", ] [[package]] -name = "object" -version = "0.31.1" +name = "num_threads" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8bda667d9f2b5051b8833f59f3bf748b28ef54f850f4fcb389a252aa383866d1" +checksum = "2819ce041d2ee131036f4fc9d6ae7ae125a3a40e97ba64d04fe799ad9dabbb44" +dependencies = [ + "libc", +] + +[[package]] +name = "numeral" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "049950a25a8f69e9673ed52fc58749548cee71194f6c3a8a04b80863637ce722" + +[[package]] +name = "object" +version = "0.32.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77ac5bbd07aea88c60a577a1ce218075ffd59208b2d7ca97adf9bfc5aeb21ebe" dependencies = [ "memchr", ] @@ -567,6 +1097,66 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "44d11de466f4a3006fe8a5e7ec84e93b79c70cb992ae0aa0eb631ad2df8abfe2" +[[package]] +name = "openapitor" +version = "0.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "120168eae5b6485690af708bd1030547df62cca10a643763d416ab0e6831decb" +dependencies = [ + "Inflector", + "anyhow", + "chrono", + "clap", + "data-encoding", + "format_serde_error", + "futures-util", + "http", + "indexmap 1.9.3", + "json-patch", + "log", + "numeral", + "openapiv3", + "phonenumber", + "proc-macro2", + "quote", + "rand", + "regex", + "reqwest", + "reqwest-middleware", + "rustfmt-wrapper", + "schemars", + "serde", + "serde_json", + "serde_yaml 0.9.25", + "slog", + "slog-async", + "slog-json", + "slog-scope", + "slog-stdlog", + "slog-term", + "thiserror", + "tokio", + "url", + "uuid", +] + +[[package]] +name = "openapiv3" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b1a9f106eb0a780abd17ba9fca8e0843e3461630bcbe2af0ad4d5d3ba4e9aa4" +dependencies = [ + "indexmap 1.9.3", + "serde", + "serde_json", +] + +[[package]] +name = "os_str_bytes" +version = "6.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4d5d9eb14b174ee9aa2ef96dc2b94637a2d4b6e7cb873c7e171f0c20c6cf3eac" + [[package]] name = "parking_lot" version = "0.12.1" @@ -585,9 +1175,9 @@ checksum = "93f00c865fe7cabf650081affecd3871070f26767e7b2070a3ffae14c654b447" dependencies = [ "cfg-if", "libc", - "redox_syscall", + "redox_syscall 0.3.5", "smallvec", - "windows-targets", + "windows-targets 0.48.5", ] [[package]] @@ -622,6 +1212,16 @@ version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94" +[[package]] +name = "pest" +version = "2.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1acb4a4365a13f749a93f1a094a7805e5cfa0955373a9de860d962eaa3a5fe5a" +dependencies = [ + "thiserror", + "ucd-trie", +] + [[package]] name = "phonenumber" version = "0.3.2+8.13.9" @@ -671,10 +1271,34 @@ dependencies = [ ] [[package]] -name = "proc-macro2" -version = "1.0.64" +name = "proc-macro-error" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78803b62cbf1f46fde80d7c0e803111524b9877184cfe7c3033659490ac7a7da" +checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" +dependencies = [ + "proc-macro-error-attr", + "proc-macro2", + "quote", + "syn 1.0.109", + "version_check", +] + +[[package]] +name = "proc-macro-error-attr" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" +dependencies = [ + "proc-macro2", + "quote", + "version_check", +] + +[[package]] +name = "proc-macro2" +version = "1.0.66" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "18fb31db3f9bddb2ea821cde30a9f70117e3f119938b5ee630b7403aa6e2ead9" dependencies = [ "unicode-ident", ] @@ -690,9 +1314,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.29" +version = "1.0.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "573015e8ab27661678357f27dc26460738fd2b6c86e46f386fde94cb5d913105" +checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" dependencies = [ "proc-macro2", ] @@ -727,13 +1351,33 @@ dependencies = [ "getrandom", ] +[[package]] +name = "redox_syscall" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" +dependencies = [ + "bitflags 1.3.2", +] + [[package]] name = "redox_syscall" version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29" dependencies = [ - "bitflags", + "bitflags 1.3.2", +] + +[[package]] +name = "redox_users" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b033d837a7cf162d7993aded9304e30a83213c648b6e389db233191f891e5c2b" +dependencies = [ + "getrandom", + "redox_syscall 0.2.16", + "thiserror", ] [[package]] @@ -768,14 +1412,14 @@ dependencies = [ "lru-cache", "oncemutex", "regex", - "regex-syntax 0.6.28", + "regex-syntax 0.6.29", ] [[package]] name = "regex-syntax" -version = "0.6.28" +version = "0.6.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "456c603be3e8d448b072f410900c09faf164fbce2d480456f50eea6e25f9c848" +checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" [[package]] name = "regex-syntax" @@ -783,6 +1427,77 @@ version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e5ea92a5b6195c6ef2a0295ea818b312502c6fc94dde986c5553242e18fd4ce2" +[[package]] +name = "reqwest" +version = "0.11.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e9ad3fe7488d7e34558a2033d45a0c90b72d97b4f80705666fea71472e2e6a1" +dependencies = [ + "base64", + "bytes", + "encoding_rs", + "futures-core", + "futures-util", + "h2", + "http", + "http-body", + "hyper", + "hyper-rustls", + "ipnet", + "js-sys", + "log", + "mime", + "mime_guess", + "once_cell", + "percent-encoding", + "pin-project-lite", + "rustls", + "rustls-pemfile", + "serde", + "serde_json", + "serde_urlencoded", + "tokio", + "tokio-rustls", + "tower-service", + "url", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", + "webpki-roots", + "winreg", +] + +[[package]] +name = "reqwest-middleware" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69539cea4148dce683bec9dc95be3f0397a9bb2c248a49c8296a9d21659a8cdd" +dependencies = [ + "anyhow", + "async-trait", + "futures", + "http", + "reqwest", + "serde", + "task-local-extensions", + "thiserror", +] + +[[package]] +name = "ring" +version = "0.16.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3053cf52e236a3ed746dfc745aa9cacf1b791d846bdaf412f60a8d7d6e17c8fc" +dependencies = [ + "cc", + "libc", + "once_cell", + "spin", + "untrusted", + "web-sys", + "winapi", +] + [[package]] name = "rustc-demangle" version = "0.1.23" @@ -790,10 +1505,82 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" [[package]] -name = "ryu" -version = "1.0.12" +name = "rustfmt-wrapper" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b4b9743ed687d4b4bcedf9ff5eaa7398495ae14e61cba0a295704edbc7decde" +checksum = "ed729e3bee08ec2befd593c27e90ca9fdd25efdc83c94c3b82eaef16e4f7406e" +dependencies = [ + "serde", + "tempfile", + "thiserror", + "toml", + "toolchain_find", +] + +[[package]] +name = "rustix" +version = "0.38.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19ed4fa021d81c8392ce04db050a3da9a60299050b7ae1cf482d862b54a7218f" +dependencies = [ + "bitflags 2.4.0", + "errno", + "libc", + "linux-raw-sys", + "windows-sys 0.48.0", +] + +[[package]] +name = "rustls" +version = "0.21.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d1feddffcfcc0b33f5c6ce9a29e341e4cd59c3f78e7ee45f4a40c038b1d6cbb" +dependencies = [ + "log", + "ring", + "rustls-webpki", + "sct", +] + +[[package]] +name = "rustls-pemfile" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d3987094b1d07b653b7dfdc3f70ce9a1da9c51ac18c1b06b662e4f9a0e9f4b2" +dependencies = [ + "base64", +] + +[[package]] +name = "rustls-webpki" +version = "0.101.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d93931baf2d282fff8d3a532bbfd7653f734643161b87e3e01e59a04439bf0d" +dependencies = [ + "ring", + "untrusted", +] + +[[package]] +name = "rustversion" +version = "1.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4" + +[[package]] +name = "ryu" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741" + +[[package]] +name = "same-file" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" +dependencies = [ + "winapi-util", +] [[package]] name = "schemars" @@ -801,6 +1588,7 @@ version = "0.8.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "02c613288622e5f0c3fdc5dbd4db1c5fbe752746b1d1a56a0630b78fd00de44f" dependencies = [ + "bigdecimal", "bytes", "chrono", "dyn-clone", @@ -820,7 +1608,7 @@ dependencies = [ "proc-macro2", "quote", "serde_derive_internals", - "syn 1.0.107", + "syn 1.0.109", ] [[package]] @@ -830,19 +1618,47 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] -name = "serde" -version = "1.0.185" +name = "sct" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be9b6f69f1dfd54c3b568ffa45c310d6973a5e5148fd40cf515acaf38cf5bc31" +checksum = "d53dcdb7c9f8158937a7981b48accfd39a43af418591a5d008c7b22b5e1b7ca4" +dependencies = [ + "ring", + "untrusted", +] + +[[package]] +name = "semver" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f301af10236f6df4160f7c3f04eec6dbc70ace82d23326abad5edee88801c6b6" +dependencies = [ + "semver-parser", +] + +[[package]] +name = "semver-parser" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00b0bef5b7f9e0df16536d3961cfb6e84331c065b4066afb39768d0e319411f7" +dependencies = [ + "pest", +] + +[[package]] +name = "serde" +version = "1.0.186" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f5db24220c009de9bd45e69fb2938f4b6d2df856aa9304ce377b3180f83b7c1" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.185" +version = "1.0.186" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc59dfdcbad1437773485e0367fea4b090a2e0a16d9ffc46af47764536a298ec" +checksum = "5ad697f7e0b65af4983a4ce8f56ed5b357e8d3c36651bf6a7e13639c17b8e670" dependencies = [ "proc-macro2", "quote", @@ -857,20 +1673,69 @@ checksum = "85bf8229e7920a9f636479437026331ce11aa132b4dde37d121944a44d6e5f3c" dependencies = [ "proc-macro2", "quote", - "syn 1.0.107", + "syn 1.0.109", ] [[package]] name = "serde_json" -version = "1.0.93" +version = "1.0.105" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cad406b69c91885b5107daf2c29572f6c8cdb3c66826821e286c533490c0bc76" +checksum = "693151e1ac27563d6dbcec9dee9fbd5da8539b20fa14ad3752b2e6d363ace360" dependencies = [ "itoa", "ryu", "serde", ] +[[package]] +name = "serde_tokenstream" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a00ffd23fd882d096f09fcaae2a9de8329a328628e86027e049ee051dc1621f" +dependencies = [ + "proc-macro2", + "quote", + "serde", + "syn 2.0.29", +] + +[[package]] +name = "serde_urlencoded" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" +dependencies = [ + "form_urlencoded", + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "serde_yaml" +version = "0.8.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "578a7433b776b56a35785ed5ce9a7e777ac0598aac5a6dd1b4b18a307c7fc71b" +dependencies = [ + "indexmap 1.9.3", + "ryu", + "serde", + "yaml-rust", +] + +[[package]] +name = "serde_yaml" +version = "0.9.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a49e178e4452f45cb61d0cd8cebc1b0fafd3e41929e996cef79aa3aca91f574" +dependencies = [ + "indexmap 2.0.0", + "itoa", + "ryu", + "serde", + "unsafe-libyaml", +] + [[package]] name = "sha1" version = "0.10.5" @@ -891,6 +1756,12 @@ dependencies = [ "libc", ] +[[package]] +name = "similar" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "420acb44afdae038210c99e69aae24109f32f15500aa708e81d46c9f29d55fcf" + [[package]] name = "slab" version = "0.4.9" @@ -900,12 +1771,87 @@ dependencies = [ "autocfg", ] +[[package]] +name = "slog" +version = "2.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8347046d4ebd943127157b94d63abb990fcf729dc4e9978927fdf4ac3c998d06" + +[[package]] +name = "slog-async" +version = "2.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "766c59b252e62a34651412870ff55d8c4e6d04df19b43eecb2703e417b097ffe" +dependencies = [ + "crossbeam-channel", + "slog", + "take_mut", + "thread_local", +] + +[[package]] +name = "slog-json" +version = "2.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e1e53f61af1e3c8b852eef0a9dee29008f55d6dd63794f3f12cef786cf0f219" +dependencies = [ + "serde", + "serde_json", + "slog", + "time 0.3.27", +] + +[[package]] +name = "slog-scope" +version = "4.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f95a4b4c3274cd2869549da82b57ccc930859bdbf5bcea0424bc5f140b3c786" +dependencies = [ + "arc-swap", + "lazy_static", + "slog", +] + +[[package]] +name = "slog-stdlog" +version = "4.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6706b2ace5bbae7291d3f8d2473e2bfab073ccd7d03670946197aec98471fa3e" +dependencies = [ + "log", + "slog", + "slog-scope", +] + +[[package]] +name = "slog-term" +version = "2.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87d29185c55b7b258b4f120eab00f48557d4d9bc814f41713f449d35b0f8977c" +dependencies = [ + "atty", + "slog", + "term", + "thread_local", + "time 0.3.27", +] + [[package]] name = "smallvec" version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "62bb4feee49fdd9f707ef802e22365a35de4b7b299de4763d44bfea899442ff9" +[[package]] +name = "socket2" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64a4a911eed85daf18834cfaa86a79b7d266ff93ff5ba14005426219480ed662" +dependencies = [ + "libc", + "winapi", +] + [[package]] name = "socket2" version = "0.5.3" @@ -913,9 +1859,21 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2538b18701741680e0322a2302176d3253a35388e2e62f172f64f4f16605f877" dependencies = [ "libc", - "windows-sys", + "windows-sys 0.48.0", ] +[[package]] +name = "spin" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" + +[[package]] +name = "strsim" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" + [[package]] name = "structmeta" version = "0.2.0" @@ -941,9 +1899,9 @@ dependencies = [ [[package]] name = "syn" -version = "1.0.107" +version = "1.0.109" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f4064b5b16e03ae50984a5a8ed5d4f8803e6bc1fd170a3cda91a1be4b18e3f5" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" dependencies = [ "proc-macro2", "quote", @@ -961,6 +1919,45 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "take_mut" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f764005d11ee5f36500a149ace24e00e3da98b0158b3e2d53a7495660d3f4d60" + +[[package]] +name = "task-local-extensions" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba323866e5d033818e3240feeb9f7db2c4296674e4d9e16b97b7bf8f490434e8" +dependencies = [ + "pin-utils", +] + +[[package]] +name = "tempfile" +version = "3.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb94d2f3cc536af71caac6b6fcebf65860b347e7ce0cc9ebe8f70d3e521054ef" +dependencies = [ + "cfg-if", + "fastrand", + "redox_syscall 0.3.5", + "rustix", + "windows-sys 0.48.0", +] + +[[package]] +name = "term" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c59df8ac95d96ff9bede18eb7300b0fda5e5d8d90960e76f8e14ae765eedbf1f" +dependencies = [ + "dirs-next", + "rustversion", + "winapi", +] + [[package]] name = "termcolor" version = "1.2.0" @@ -970,6 +1967,15 @@ dependencies = [ "winapi-util", ] +[[package]] +name = "textwrap" +version = "0.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "222a222a5bfe1bba4a77b45ec488a741b3cb8872e5e499451fd7d0129c9c7c3d" +dependencies = [ + "unicode-width", +] + [[package]] name = "thiserror" version = "1.0.47" @@ -990,6 +1996,57 @@ dependencies = [ "syn 2.0.29", ] +[[package]] +name = "thread_local" +version = "1.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fdd6f064ccff2d6567adcb3873ca630700f00b5ad3f060c25b5dcfd9a4ce152" +dependencies = [ + "cfg-if", + "once_cell", +] + +[[package]] +name = "time" +version = "0.1.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b797afad3f312d1c66a56d11d0316f916356d11bd158fbc6ca6389ff6bf805a" +dependencies = [ + "libc", + "wasi 0.10.0+wasi-snapshot-preview1", + "winapi", +] + +[[package]] +name = "time" +version = "0.3.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0bb39ee79a6d8de55f48f2293a830e040392f1c5f16e336bdd1788cd0aadce07" +dependencies = [ + "deranged", + "itoa", + "libc", + "num_threads", + "serde", + "time-core", + "time-macros", +] + +[[package]] +name = "time-core" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7300fbefb4dadc1af235a9cef3737cea692a9d97e1b9cbcd4ebdae6f8868e6fb" + +[[package]] +name = "time-macros" +version = "0.2.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "733d258752e9303d392b94b75230d07b0b9c489350c69b851fc6c065fde3e8f9" +dependencies = [ + "time-core", +] + [[package]] name = "tinyvec" version = "1.6.0" @@ -1019,9 +2076,9 @@ dependencies = [ "parking_lot", "pin-project-lite", "signal-hook-registry", - "socket2", + "socket2 0.5.3", "tokio-macros", - "windows-sys", + "windows-sys 0.48.0", ] [[package]] @@ -1035,6 +2092,16 @@ dependencies = [ "syn 2.0.29", ] +[[package]] +name = "tokio-rustls" +version = "0.24.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" +dependencies = [ + "rustls", + "tokio", +] + [[package]] name = "tokio-tungstenite" version = "0.20.0" @@ -1047,6 +2114,83 @@ dependencies = [ "tungstenite", ] +[[package]] +name = "tokio-util" +version = "0.7.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "806fe8c2c87eccc8b3267cbae29ed3ab2d0bd37fca70ab622e46aaa9375ddb7d" +dependencies = [ + "bytes", + "futures-core", + "futures-sink", + "pin-project-lite", + "tokio", + "tracing", +] + +[[package]] +name = "toml" +version = "0.5.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4f7f0dd8d50a853a531c426359045b1998f04219d88799810762cd4ad314234" +dependencies = [ + "serde", +] + +[[package]] +name = "toolchain_find" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e85654a10e7a07a47c6f19d93818f3f343e22927f2fa280c84f7c8042743413" +dependencies = [ + "home", + "lazy_static", + "regex", + "semver", + "walkdir", +] + +[[package]] +name = "tower-service" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" + +[[package]] +name = "tracing" +version = "0.1.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" +dependencies = [ + "cfg-if", + "pin-project-lite", + "tracing-core", +] + +[[package]] +name = "tracing-core" +version = "0.1.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0955b8137a1df6f1a2e9a37d8a6656291ff0297c1a97c24e0d8425fe2312f79a" +dependencies = [ + "once_cell", +] + +[[package]] +name = "treediff" +version = "3.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "761e8d5ad7ce14bb82b7e61ccc0ca961005a275a060b9644a2431aa11553c2ff" +dependencies = [ + "serde_json", +] + +[[package]] +name = "try-lock" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3528ecfd12c466c6f163363caf2d02a71161dd5e1cc6ae7b34207ea2d42d81ed" + [[package]] name = "ts-rs" version = "7.0.0" @@ -1095,6 +2239,21 @@ version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" +[[package]] +name = "ucd-trie" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed646292ffc8188ef8ea4d1e0e0150fb15a5c2e12ad9b8fc191ae7a8a7f3c4b9" + +[[package]] +name = "unicase" +version = "2.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7d2d4dafb69621809a81864c9c1b864479e1235c0dd4e199924b9742439ed89" +dependencies = [ + "version_check", +] + [[package]] name = "unicode-bidi" version = "0.3.13" @@ -1103,9 +2262,9 @@ checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" [[package]] name = "unicode-ident" -version = "1.0.6" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84a22b9f218b40614adcb3f4ff08b703773ad44fa9423e4e0d346d5db86e4ebc" +checksum = "301abaae475aa91687eb82514b328ab47a211a533026cb25fc3e519b86adfc3c" [[package]] name = "unicode-normalization" @@ -1116,6 +2275,30 @@ dependencies = [ "tinyvec", ] +[[package]] +name = "unicode-segmentation" +version = "1.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1dd624098567895118886609431a7c3b8f516e41d30e0643f03d94592a147e36" + +[[package]] +name = "unicode-width" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0edd1e5b14653f783770bce4a4dabb4a5108a5370a5f5d8cfe8710c361f6c8b" + +[[package]] +name = "unsafe-libyaml" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f28467d3e1d3c6586d8f25fa243f544f5800fec42d97032474e17222c2b75cfa" + +[[package]] +name = "untrusted" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" + [[package]] name = "url" version = "2.4.0" @@ -1151,6 +2334,31 @@ version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" +[[package]] +name = "walkdir" +version = "2.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "36df944cda56c7d8d8b7496af378e6b16de9284591917d307c9b4d313c44e698" +dependencies = [ + "same-file", + "winapi-util", +] + +[[package]] +name = "want" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" +dependencies = [ + "try-lock", +] + +[[package]] +name = "wasi" +version = "0.10.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a143597ca7c7793eff794def352d41792a93c481eb1042423ff7ff72ba2c31f" + [[package]] name = "wasi" version = "0.11.0+wasi-snapshot-preview1" @@ -1230,6 +2438,8 @@ dependencies = [ "anyhow", "backtrace", "bincode", + "derive-docs", + "expectorate", "futures", "gloo-file", "gloo-utils", @@ -1238,8 +2448,10 @@ dependencies = [ "js-sys", "kittycad", "lazy_static", + "parse-display", "pretty_assertions", "regex", + "schemars", "serde", "serde_json", "thiserror", @@ -1261,6 +2473,12 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "webpki-roots" +version = "0.25.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "14247bb57be4f377dfb94c72830b8ce8fc6beac03cf4bf7b9732eadd414123fc" + [[package]] name = "winapi" version = "0.3.9" @@ -1292,13 +2510,46 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" +[[package]] +name = "windows" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e686886bc078bc1b0b600cac0147aadb815089b6e4da64016cbd754b6342700f" +dependencies = [ + "windows-targets 0.48.5", +] + +[[package]] +name = "windows-sys" +version = "0.45.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" +dependencies = [ + "windows-targets 0.42.2", +] + [[package]] name = "windows-sys" version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" dependencies = [ - "windows-targets", + "windows-targets 0.48.5", +] + +[[package]] +name = "windows-targets" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071" +dependencies = [ + "windows_aarch64_gnullvm 0.42.2", + "windows_aarch64_msvc 0.42.2", + "windows_i686_gnu 0.42.2", + "windows_i686_msvc 0.42.2", + "windows_x86_64_gnu 0.42.2", + "windows_x86_64_gnullvm 0.42.2", + "windows_x86_64_msvc 0.42.2", ] [[package]] @@ -1307,57 +2558,118 @@ version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" dependencies = [ - "windows_aarch64_gnullvm", - "windows_aarch64_msvc", - "windows_i686_gnu", - "windows_i686_msvc", - "windows_x86_64_gnu", - "windows_x86_64_gnullvm", - "windows_x86_64_msvc", + "windows_aarch64_gnullvm 0.48.5", + "windows_aarch64_msvc 0.48.5", + "windows_i686_gnu 0.48.5", + "windows_i686_msvc 0.48.5", + "windows_x86_64_gnu 0.48.5", + "windows_x86_64_gnullvm 0.48.5", + "windows_x86_64_msvc 0.48.5", ] +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" + [[package]] name = "windows_aarch64_gnullvm" version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" +[[package]] +name = "windows_aarch64_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" + [[package]] name = "windows_aarch64_msvc" version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" +[[package]] +name = "windows_i686_gnu" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" + [[package]] name = "windows_i686_gnu" version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" +[[package]] +name = "windows_i686_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" + [[package]] name = "windows_i686_msvc" version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" +[[package]] +name = "windows_x86_64_gnu" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" + [[package]] name = "windows_x86_64_gnu" version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" + [[package]] name = "windows_x86_64_gnullvm" version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" +[[package]] +name = "windows_x86_64_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" + [[package]] name = "windows_x86_64_msvc" version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" +[[package]] +name = "winreg" +version = "0.50.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "524e57b2c537c0f9b1e69f1965311ec12182b4122e45035b1508cd24d2adadb1" +dependencies = [ + "cfg-if", + "windows-sys 0.48.0", +] + +[[package]] +name = "yaml-rust" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56c1936c4cc7a1c9ab21a1ebb602eb942ba868cbd44a99cb7cdc5892335e1c85" +dependencies = [ + "linked-hash-map", +] + [[package]] name = "yansi" version = "0.5.1" diff --git a/src/wasm-lib/Cargo.toml b/src/wasm-lib/Cargo.toml index 4e395c9c9..f2b473ef2 100644 --- a/src/wasm-lib/Cargo.toml +++ b/src/wasm-lib/Cargo.toml @@ -11,6 +11,7 @@ crate-type = ["cdylib"] anyhow = "1.0.75" backtrace = "0.3" bincode = "1.3.3" +derive-docs = { path = "derive-docs" } futures = { version = "0.3.28", optional = true } gloo-file = { version = "0.3.0", optional = true } gloo-utils = "0.2.0" @@ -19,7 +20,9 @@ httparse = { version = "1.8.0", optional = true } js-sys = { version = "0.3.64", optional = true } kittycad = { version = "0.2.15", default-features = false, features = ["js"] } lazy_static = "1.4.0" +parse-display = "0.8.2" regex = "1.7.1" +schemars = { version = "0.8", features = ["url", "uuid1"] } serde = {version = "1.0.152", features = ["derive"] } serde_json = "1.0.93" thiserror = "1.0.47" @@ -35,6 +38,7 @@ panic = "abort" debug = true [dev-dependencies] +expectorate = "1.0.7" pretty_assertions = "1.4.0" tokio = { version = "1.32.0", features = ["rt-multi-thread", "macros", "time"] } @@ -42,3 +46,8 @@ tokio = { version = "1.32.0", features = ["rt-multi-thread", "macros", "time"] } default = ["web"] web = ["dep:gloo-file", "dep:js-sys"] noweb = ["dep:futures", "dep:httparse", "dep:tokio", "dep:tokio-tungstenite"] + +[workspace] +members = [ + "derive-docs" +] diff --git a/src/wasm-lib/derive-docs/Cargo.toml b/src/wasm-lib/derive-docs/Cargo.toml new file mode 100644 index 000000000..3a65299f7 --- /dev/null +++ b/src/wasm-lib/derive-docs/Cargo.toml @@ -0,0 +1,23 @@ +[package] +name = "derive-docs" +description = "A tool for generating documentation from Rust derive macros" +version = "0.1.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[lib] +proc-macro = true + +[dependencies] +convert_case = "0.6.0" +proc-macro2 = "1" +quote = "1" +serde = { version = "1.0.186", features = ["derive"] } +serde_tokenstream = "0.2" +syn = { version = "2.0.29", features = ["full"] } + +[dev-dependencies] +expectorate = "1.0.7" +openapitor = "0.0.5" +pretty_assertions = "1.4.0" diff --git a/src/wasm-lib/derive-docs/src/lib.rs b/src/wasm-lib/derive-docs/src/lib.rs new file mode 100644 index 000000000..8c199f27c --- /dev/null +++ b/src/wasm-lib/derive-docs/src/lib.rs @@ -0,0 +1,548 @@ +// Copyright 2023 Oxide Computer Company + +//! This package defines macro attributes associated with HTTP handlers. These +//! attributes are used both to define an HTTP API and to generate an OpenAPI +//! Spec (OAS) v3 document that describes the API. + +// Clippy's style advice is definitely valuable, but not worth the trouble for +// automated enforcement. +#![allow(clippy::style)] + +use convert_case::Casing; +use quote::{format_ident, quote, quote_spanned, ToTokens}; +use serde::Deserialize; +use serde_tokenstream::{from_tokenstream, Error}; +use syn::{ + parse::{Parse, ParseStream}, + Attribute, Signature, Visibility, +}; + +#[derive(Deserialize, Debug)] +struct StdlibMetadata { + /// The name of the function in the API. + name: String, + /// Tags for the function. + #[serde(default)] + tags: Vec, + /// Whether the function is unpublished. + /// Then docs will not be generated. + #[serde(default)] + unpublished: bool, + /// Whether the function is deprecated. + /// Then specific docs detailing that this is deprecated will be generated. + #[serde(default)] + deprecated: bool, +} + +#[proc_macro_attribute] +pub fn stdlib( + attr: proc_macro::TokenStream, + item: proc_macro::TokenStream, +) -> proc_macro::TokenStream { + do_output(do_stdlib(attr.into(), item.into())) +} + +fn do_stdlib( + attr: proc_macro2::TokenStream, + item: proc_macro2::TokenStream, +) -> Result<(proc_macro2::TokenStream, Vec), Error> { + let metadata = from_tokenstream(&attr)?; + do_stdlib_inner(metadata, attr, item) +} + +fn do_output( + res: Result<(proc_macro2::TokenStream, Vec), Error>, +) -> proc_macro::TokenStream { + match res { + Err(err) => err.to_compile_error().into(), + Ok((stdlib_docs, errors)) => { + let compiler_errors = errors.iter().map(|err| err.to_compile_error()); + + let output = quote! { + #stdlib_docs + #( #compiler_errors )* + }; + + output.into() + } + } +} + +fn do_stdlib_inner( + metadata: StdlibMetadata, + _attr: proc_macro2::TokenStream, + item: proc_macro2::TokenStream, +) -> Result<(proc_macro2::TokenStream, Vec), Error> { + let ast: ItemFnForSignature = syn::parse2(item.clone())?; + + let mut errors = Vec::new(); + + if ast.sig.constness.is_some() { + errors.push(Error::new_spanned( + &ast.sig.constness, + "stdlib functions may not be const functions", + )); + } + + if ast.sig.asyncness.is_some() { + errors.push(Error::new_spanned( + &ast.sig.fn_token, + "stdlib functions must not be async", + )); + } + + if ast.sig.unsafety.is_some() { + errors.push(Error::new_spanned( + &ast.sig.unsafety, + "stdlib functions may not be unsafe", + )); + } + + if ast.sig.abi.is_some() { + errors.push(Error::new_spanned( + &ast.sig.abi, + "stdlib functions may not use an alternate ABI", + )); + } + + if !ast.sig.generics.params.is_empty() { + errors.push(Error::new_spanned( + &ast.sig.generics, + "generics are not permitted for stdlib functions", + )); + } + + if ast.sig.variadic.is_some() { + errors.push(Error::new_spanned(&ast.sig.variadic, "no language C here")); + } + + let name = metadata.name; + let name_ident = format_ident!("{}", name.to_case(convert_case::Case::UpperCamel)); + let name_str = name.to_string(); + + let fn_name = &ast.sig.ident; + let fn_name_str = fn_name.to_string().replace("inner_", ""); + let fn_name_ident = format_ident!("{}", fn_name_str); + let _visibility = &ast.vis; + + let (summary_text, description_text) = extract_doc_from_attrs(&ast.attrs); + let comment_text = { + let mut buf = String::new(); + buf.push_str("Std lib function: "); + buf.push_str(&name_str); + if let Some(s) = &summary_text { + buf.push_str("\n"); + buf.push_str(&s); + } + if let Some(s) = &description_text { + buf.push_str("\n"); + buf.push_str(&s); + } + buf + }; + let description_doc_comment = quote! { + #[doc = #comment_text] + }; + + let summary = if let Some(summary) = summary_text { + quote! { #summary } + } else { + quote! { "" } + }; + let description = if let Some(description) = description_text { + quote! { #description } + } else { + quote! { "" } + }; + + let tags = metadata + .tags + .iter() + .map(|tag| { + quote! { #tag.to_string() } + }) + .collect::>(); + + let deprecated = if metadata.deprecated { + quote! { true } + } else { + quote! { false } + }; + + let unpublished = if metadata.unpublished { + quote! { true } + } else { + quote! { false } + }; + + let docs_crate = get_crate(None); + + // When the user attaches this proc macro to a function with the wrong type + // signature, the resulting errors can be deeply inscrutable. To attempt to + // make failures easier to understand, we inject code that asserts the types + // of the various parameters. We do this by calling dummy functions that + // require a type that satisfies SharedExtractor or ExclusiveExtractor. + let mut arg_types = Vec::new(); + for arg in ast.sig.inputs.iter() { + // Get the name of the argument. + let arg_name = match arg { + syn::FnArg::Receiver(pat) => { + let span = pat.self_token.span.unwrap(); + span.source_text().unwrap().to_string() + } + syn::FnArg::Typed(pat) => match &*pat.pat { + syn::Pat::Ident(ident) => ident.ident.to_string(), + _ => { + errors.push(Error::new_spanned( + &pat.pat, + "stdlib functions may not use destructuring patterns", + )); + continue; + } + }, + }; + + let ty = match arg { + syn::FnArg::Receiver(pat) => pat.ty.as_ref().into_token_stream(), + syn::FnArg::Typed(pat) => pat.ty.as_ref().into_token_stream(), + }; + + let ty_string = ty + .to_string() + .replace('&', "") + .replace("mut", "") + .replace(' ', ""); + let ty_string = ty_string.trim().to_string(); + let ty_ident = if ty_string.starts_with("Vec<") { + let ty_string = ty_string.trim_start_matches("Vec<").trim_end_matches('>'); + let ty_ident = format_ident!("{}", ty_string); + quote! { + Vec<#ty_ident> + } + } else { + let ty_ident = format_ident!("{}", ty_string); + quote! { + #ty_ident + } + }; + + let ty_string = clean_type(&ty_string); + + if ty_string != "Args" { + let schema = if ty_ident.to_string().starts_with("Vec < ") { + quote! { + <#ty_ident>::json_schema(&mut generator) + } + } else { + quote! { + #ty_ident::json_schema(&mut generator) + } + }; + arg_types.push(quote! { + #docs_crate::StdLibFnArg { + name: #arg_name.to_string(), + type_: #ty_string.to_string(), + schema: #schema, + required: true, + } + }); + } + } + + let ret_ty = ast.sig.output.clone(); + let ret_ty_string = ret_ty + .into_token_stream() + .to_string() + .replace("-> ", "") + .replace("Result < ", "") + .replace(", KclError >", ""); + let ret_ty_string = ret_ty_string.trim().to_string(); + let ret_ty_ident = format_ident!("{}", ret_ty_string); + let ret_ty_string = clean_type(&ret_ty_string); + let return_type = quote! { + #docs_crate::StdLibFnArg { + name: "".to_string(), + type_: #ret_ty_string.to_string(), + schema: #ret_ty_ident::json_schema(&mut generator), + required: true, + } + }; + + // For reasons that are not well understood unused constants that use the + // (default) call_site() Span do not trigger the dead_code lint. Because + // defining but not using an endpoint is likely a programming error, we + // want to be sure to have the compiler flag this. We force this by using + // the span from the name of the function to which this macro was applied. + let span = ast.sig.ident.span(); + let const_struct = quote_spanned! {span=> + pub(crate) const #name_ident: #name_ident = #name_ident {}; + }; + + // The final TokenStream returned will have a few components that reference + // `#name_ident`, the name of the function to which this macro was applied... + let stream = quote! { + // ... a struct type called `#name_ident` that has no members + #[allow(non_camel_case_types, missing_docs)] + #description_doc_comment + pub(crate) struct #name_ident {} + // ... a constant of type `#name` whose identifier is also #name_ident + #[allow(non_upper_case_globals, missing_docs)] + #description_doc_comment + #const_struct + + impl #docs_crate::StdLibFn for #name_ident + { + fn name(&self) -> String { + #name_str.to_string() + } + + fn summary(&self) -> String { + #summary.to_string() + } + + fn description(&self) -> String { + #description.to_string() + } + + fn tags(&self) -> Vec { + vec![#(#tags),*] + } + + fn args(&self) -> Vec<#docs_crate::StdLibFnArg> { + let mut settings = schemars::gen::SchemaSettings::openapi3(); + settings.inline_subschemas = true; + let mut generator = schemars::gen::SchemaGenerator::new(settings); + + vec![#(#arg_types),*] + } + + fn return_value(&self) -> #docs_crate::StdLibFnArg { + let mut settings = schemars::gen::SchemaSettings::openapi3(); + settings.inline_subschemas = true; + let mut generator = schemars::gen::SchemaGenerator::new(settings); + + #return_type + } + + fn unpublished(&self) -> bool { + #unpublished + } + + fn deprecated(&self) -> bool { + #deprecated + } + + fn std_lib_fn(&self) -> crate::std::StdFn { + #fn_name_ident + } + } + + #item + }; + + // Prepend the usage message if any errors were detected. + if !errors.is_empty() { + errors.insert(0, Error::new_spanned(&ast.sig, "")); + } + + Ok((stream, errors)) +} + +#[allow(dead_code)] +fn to_compile_errors(errors: Vec) -> proc_macro2::TokenStream { + let compile_errors = errors.iter().map(syn::Error::to_compile_error); + quote!(#(#compile_errors)*) +} + +fn get_crate(var: Option) -> proc_macro2::TokenStream { + if let Some(s) = var { + if let Ok(ts) = syn::parse_str(s.as_str()) { + return ts; + } + } + quote!(crate::docs) +} + +fn extract_doc_from_attrs(attrs: &[syn::Attribute]) -> (Option, Option) { + let doc = syn::Ident::new("doc", proc_macro2::Span::call_site()); + + let mut lines = attrs.iter().flat_map(|attr| { + if let syn::Meta::NameValue(nv) = &attr.meta { + if nv.path.is_ident(&doc) { + if let syn::Expr::Lit(syn::ExprLit { + lit: syn::Lit::Str(s), + .. + }) = &nv.value + { + return normalize_comment_string(s.value()); + } + } + } + Vec::new() + }); + + // Skip initial blank lines; they make for excessively terse summaries. + let summary = loop { + match lines.next() { + Some(s) if s.is_empty() => (), + next => break next, + } + }; + // Skip initial blank description lines. + let first = loop { + match lines.next() { + Some(s) if s.is_empty() => (), + next => break next, + } + }; + + match (summary, first) { + (None, _) => (None, None), + (summary, None) => (summary, None), + (Some(summary), Some(first)) => ( + Some(summary), + Some( + lines + .fold(first, |acc, comment| { + if acc.ends_with('-') || acc.ends_with('\n') || acc.is_empty() { + // Continuation lines and newlines. + format!("{}{}", acc, comment) + } else if comment.is_empty() { + // Handle fully blank comments as newlines we keep. + format!("{}\n", acc) + } else { + // Default to space-separating comment fragments. + format!("{} {}", acc, comment) + } + }) + .trim_end() + .to_string(), + ), + ), + } +} + +fn normalize_comment_string(s: String) -> Vec { + s.split('\n') + .enumerate() + .map(|(idx, s)| { + // Rust-style comments are intrinsically single-line. We don't want + // to trim away formatting such as an initial '*'. + if idx == 0 { + s.trim_start().trim_end() + } else { + let trimmed = s.trim_start().trim_end(); + trimmed + .strip_prefix("* ") + .unwrap_or_else(|| trimmed.strip_prefix('*').unwrap_or(trimmed)) + } + }) + .map(ToString::to_string) + .collect() +} + +/// Represent an item without concern for its body which may (or may not) +/// contain syntax errors. +struct ItemFnForSignature { + pub attrs: Vec, + pub vis: Visibility, + pub sig: Signature, + pub _block: proc_macro2::TokenStream, +} + +impl Parse for ItemFnForSignature { + fn parse(input: ParseStream) -> syn::parse::Result { + let attrs = input.call(Attribute::parse_outer)?; + let vis: Visibility = input.parse()?; + let sig: Signature = input.parse()?; + let block = input.parse()?; + Ok(ItemFnForSignature { + attrs, + vis, + sig, + _block: block, + }) + } +} + +fn clean_type(t: &str) -> String { + let mut t = t.to_string(); + // Turn vecs into arrays. + if t.starts_with("Vec<") { + t = t.replace("Vec<", "[").replace('>', "]"); + } + + if t == "f64" { + return "number".to_string(); + } else if t == "str" { + return "string".to_string(); + } else { + return t.replace("f64", "number").to_string(); + } +} + +#[cfg(test)] +mod tests { + + use quote::quote; + + use super::*; + + #[test] + fn test_stdlib_line_to() { + let (item, errors) = do_stdlib( + quote! { + name = "lineTo", + }, + quote! { + fn inner_line_to( + data: LineToData, + sketch_group: SketchGroup, + args: &Args, + ) -> Result { + Ok(()) + } + }, + ) + .unwrap(); + let _expected = quote! {}; + + assert!(errors.is_empty()); + expectorate::assert_contents( + "tests/lineTo.gen", + &openapitor::types::get_text_fmt(&item).unwrap(), + ); + } + + #[test] + fn test_stdlib_min() { + let (item, errors) = do_stdlib( + quote! { + name = "min", + }, + quote! { + fn inner_min( + /// The args to do shit to. + args: Vec + ) -> f64 { + let mut min = std::f64::MAX; + for arg in args.iter() { + if *arg < min { + min = *arg; + } + } + + min + } + }, + ) + .unwrap(); + let _expected = quote! {}; + + assert!(errors.is_empty()); + expectorate::assert_contents( + "tests/min.gen", + &openapitor::types::get_text_fmt(&item).unwrap(), + ); + } +} diff --git a/src/wasm-lib/derive-docs/tests/lineTo.gen b/src/wasm-lib/derive-docs/tests/lineTo.gen new file mode 100644 index 000000000..b787b34d2 --- /dev/null +++ b/src/wasm-lib/derive-docs/tests/lineTo.gen @@ -0,0 +1,76 @@ +#[allow(non_camel_case_types, missing_docs)] +#[doc = "Std lib function: lineTo"] +pub(crate) struct LineTo {} + +#[allow(non_upper_case_globals, missing_docs)] +#[doc = "Std lib function: lineTo"] +pub(crate) const LineTo: LineTo = LineTo {}; +impl crate::docs::StdLibFn for LineTo { + fn name(&self) -> String { + "lineTo".to_string() + } + + fn summary(&self) -> String { + "".to_string() + } + + fn description(&self) -> String { + "".to_string() + } + + fn tags(&self) -> Vec { + vec![] + } + + fn args(&self) -> Vec { + let mut settings = schemars::gen::SchemaSettings::openapi3(); + settings.inline_subschemas = true; + let mut generator = schemars::gen::SchemaGenerator::new(settings); + vec![ + crate::docs::StdLibFnArg { + name: "data".to_string(), + type_: "LineToData".to_string(), + schema: LineToData::json_schema(&mut generator), + required: true, + }, + crate::docs::StdLibFnArg { + name: "sketch_group".to_string(), + type_: "SketchGroup".to_string(), + schema: SketchGroup::json_schema(&mut generator), + required: true, + }, + ] + } + + fn return_value(&self) -> crate::docs::StdLibFnArg { + let mut settings = schemars::gen::SchemaSettings::openapi3(); + settings.inline_subschemas = true; + let mut generator = schemars::gen::SchemaGenerator::new(settings); + crate::docs::StdLibFnArg { + name: "".to_string(), + type_: "SketchGroup".to_string(), + schema: SketchGroup::json_schema(&mut generator), + required: true, + } + } + + fn unpublished(&self) -> bool { + false + } + + fn deprecated(&self) -> bool { + false + } + + fn std_lib_fn(&self) -> crate::std::StdFn { + line_to + } +} + +fn inner_line_to( + data: LineToData, + sketch_group: SketchGroup, + args: &Args, +) -> Result { + Ok(()) +} diff --git a/src/wasm-lib/derive-docs/tests/min.gen b/src/wasm-lib/derive-docs/tests/min.gen new file mode 100644 index 000000000..dbd5896e9 --- /dev/null +++ b/src/wasm-lib/derive-docs/tests/min.gen @@ -0,0 +1,71 @@ +#[allow(non_camel_case_types, missing_docs)] +#[doc = "Std lib function: min"] +pub(crate) struct Min {} + +#[allow(non_upper_case_globals, missing_docs)] +#[doc = "Std lib function: min"] +pub(crate) const Min: Min = Min {}; +impl crate::docs::StdLibFn for Min { + fn name(&self) -> String { + "min".to_string() + } + + fn summary(&self) -> String { + "".to_string() + } + + fn description(&self) -> String { + "".to_string() + } + + fn tags(&self) -> Vec { + vec![] + } + + fn args(&self) -> Vec { + let mut settings = schemars::gen::SchemaSettings::openapi3(); + settings.inline_subschemas = true; + let mut generator = schemars::gen::SchemaGenerator::new(settings); + vec![crate::docs::StdLibFnArg { + name: "args".to_string(), + type_: "[number]".to_string(), + schema: >::json_schema(&mut generator), + required: true, + }] + } + + fn return_value(&self) -> crate::docs::StdLibFnArg { + let mut settings = schemars::gen::SchemaSettings::openapi3(); + settings.inline_subschemas = true; + let mut generator = schemars::gen::SchemaGenerator::new(settings); + crate::docs::StdLibFnArg { + name: "".to_string(), + type_: "number".to_string(), + schema: f64::json_schema(&mut generator), + required: true, + } + } + + fn unpublished(&self) -> bool { + false + } + + fn deprecated(&self) -> bool { + false + } + + fn std_lib_fn(&self) -> crate::std::StdFn { + min + } +} + +fn inner_min(#[doc = r" The args to do shit to."] args: Vec) -> f64 { + let mut min = std::f64::MAX; + for arg in args.iter() { + if *arg < min { + min = *arg; + } + } + + min +} diff --git a/src/wasm-lib/src/abstract_syntax_tree_types.rs b/src/wasm-lib/src/abstract_syntax_tree_types.rs index d7431f4ea..4589c6a61 100644 --- a/src/wasm-lib/src/abstract_syntax_tree_types.rs +++ b/src/wasm-lib/src/abstract_syntax_tree_types.rs @@ -2,6 +2,7 @@ use std::collections::HashMap; +use schemars::JsonSchema; use serde::{Deserialize, Serialize}; use serde_json::Map; @@ -11,7 +12,7 @@ use crate::{ executor::{MemoryItem, Metadata, PipeInfo, ProgramMemory, SourceRange}, }; -#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, ts_rs::TS)] +#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, ts_rs::TS, JsonSchema)] #[ts(export)] #[serde(rename_all = "camelCase")] pub struct Program { @@ -21,7 +22,7 @@ pub struct Program { pub non_code_meta: NoneCodeMeta, } -#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, ts_rs::TS)] +#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, ts_rs::TS, JsonSchema)] #[ts(export)] #[serde(tag = "type")] pub enum BodyItem { @@ -30,7 +31,7 @@ pub enum BodyItem { ReturnStatement(ReturnStatement), } -#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, ts_rs::TS)] +#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, ts_rs::TS, JsonSchema)] #[ts(export)] #[serde(tag = "type")] pub enum Value { @@ -131,7 +132,7 @@ impl From<&Value> for crate::executor::SourceRange { } } -#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, ts_rs::TS)] +#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, ts_rs::TS, JsonSchema)] #[ts(export)] #[serde(tag = "type")] pub enum BinaryPart { @@ -178,6 +179,7 @@ impl BinaryPart { &self, memory: &mut ProgramMemory, pipe_info: &mut PipeInfo, + stdlib: &crate::std::StdLib, engine: &mut EngineConnection, ) -> Result { pipe_info.is_in_pipe = false; @@ -188,10 +190,10 @@ impl BinaryPart { Ok(value.clone()) } BinaryPart::BinaryExpression(binary_expression) => { - binary_expression.get_result(memory, pipe_info, engine) + binary_expression.get_result(memory, pipe_info, stdlib, engine) } BinaryPart::CallExpression(call_expression) => { - call_expression.execute(memory, pipe_info, engine) + call_expression.execute(memory, pipe_info, stdlib, engine) } BinaryPart::UnaryExpression(unary_expression) => { // Return an error this should not happen. @@ -207,7 +209,7 @@ impl BinaryPart { } } -#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, ts_rs::TS)] +#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, ts_rs::TS, JsonSchema)] #[ts(export)] #[serde(tag = "type")] pub struct NoneCodeNode { @@ -216,7 +218,7 @@ pub struct NoneCodeNode { pub value: String, } -#[derive(Debug, Clone, Serialize, PartialEq, ts_rs::TS)] +#[derive(Debug, Clone, Serialize, PartialEq, ts_rs::TS, JsonSchema)] #[ts(export)] #[serde(rename_all = "camelCase")] pub struct NoneCodeMeta { @@ -250,7 +252,7 @@ impl<'de> Deserialize<'de> for NoneCodeMeta { } } -#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, ts_rs::TS)] +#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, ts_rs::TS, JsonSchema)] #[ts(export)] #[serde(tag = "type")] pub struct ExpressionStatement { @@ -261,7 +263,7 @@ pub struct ExpressionStatement { impl_value_meta!(ExpressionStatement); -#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, ts_rs::TS)] +#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, ts_rs::TS, JsonSchema)] #[ts(export)] #[serde(tag = "type")] pub struct CallExpression { @@ -279,6 +281,7 @@ impl CallExpression { &self, memory: &mut ProgramMemory, pipe_info: &mut PipeInfo, + stdlib: &crate::std::StdLib, engine: &mut EngineConnection, ) -> Result { let fn_name = self.callee.name.clone(); @@ -293,20 +296,20 @@ impl CallExpression { value.clone() } Value::BinaryExpression(binary_expression) => { - binary_expression.get_result(memory, pipe_info, engine)? + binary_expression.get_result(memory, pipe_info, stdlib, engine)? } Value::CallExpression(call_expression) => { pipe_info.is_in_pipe = false; - call_expression.execute(memory, pipe_info, engine)? + call_expression.execute(memory, pipe_info, stdlib, engine)? } Value::UnaryExpression(unary_expression) => { - unary_expression.get_result(memory, pipe_info, engine)? + unary_expression.get_result(memory, pipe_info, stdlib, engine)? } Value::ObjectExpression(object_expression) => { - object_expression.execute(memory, pipe_info, engine)? + object_expression.execute(memory, pipe_info, stdlib, engine)? } Value::ArrayExpression(array_expression) => { - array_expression.execute(memory, pipe_info, engine)? + array_expression.execute(memory, pipe_info, stdlib, engine)? } Value::PipeExpression(pipe_expression) => { return Err(KclError::Semantic(KclErrorDetails { @@ -353,7 +356,7 @@ impl CallExpression { fn_args.push(result); } - if let Some(func) = crate::std::INTERNAL_FNS.get(&fn_name) { + if let Some(func) = stdlib.fns.get(&fn_name) { // Attempt to call the function. let mut args = crate::std::Args::new(fn_args, self.into(), engine); let result = func(&mut args)?; @@ -365,6 +368,7 @@ impl CallExpression { &pipe_info.body.clone(), pipe_info, self.into(), + stdlib, engine, ) } else { @@ -391,6 +395,7 @@ impl CallExpression { &pipe_info.body.clone(), pipe_info, self.into(), + stdlib, engine, ) } else { @@ -400,7 +405,7 @@ impl CallExpression { } } -#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, ts_rs::TS)] +#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, ts_rs::TS, JsonSchema)] #[ts(export)] #[serde(tag = "type")] pub struct VariableDeclaration { @@ -412,7 +417,7 @@ pub struct VariableDeclaration { impl_value_meta!(VariableDeclaration); -#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, ts_rs::TS)] +#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, ts_rs::TS, JsonSchema)] #[ts(export)] #[serde(tag = "type")] pub struct VariableDeclarator { @@ -424,7 +429,7 @@ pub struct VariableDeclarator { impl_value_meta!(VariableDeclarator); -#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, ts_rs::TS)] +#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, ts_rs::TS, JsonSchema)] #[ts(export)] #[serde(tag = "type")] pub struct Literal { @@ -458,7 +463,7 @@ impl From<&Box> for MemoryItem { } } -#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, ts_rs::TS)] +#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, ts_rs::TS, JsonSchema)] #[ts(export)] #[serde(tag = "type")] pub struct Identifier { @@ -469,7 +474,7 @@ pub struct Identifier { impl_value_meta!(Identifier); -#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, ts_rs::TS)] +#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, ts_rs::TS, JsonSchema)] #[ts(export)] #[serde(tag = "type")] pub struct PipeSubstitution { @@ -479,7 +484,7 @@ pub struct PipeSubstitution { impl_value_meta!(PipeSubstitution); -#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, ts_rs::TS)] +#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, ts_rs::TS, JsonSchema)] #[ts(export)] #[serde(tag = "type")] pub struct ArrayExpression { @@ -495,6 +500,7 @@ impl ArrayExpression { &self, memory: &mut ProgramMemory, pipe_info: &mut PipeInfo, + stdlib: &crate::std::StdLib, engine: &mut EngineConnection, ) -> Result { let mut results = Vec::with_capacity(self.elements.len()); @@ -507,23 +513,23 @@ impl ArrayExpression { value.clone() } Value::BinaryExpression(binary_expression) => { - binary_expression.get_result(memory, pipe_info, engine)? + binary_expression.get_result(memory, pipe_info, stdlib, engine)? } Value::CallExpression(call_expression) => { pipe_info.is_in_pipe = false; - call_expression.execute(memory, pipe_info, engine)? + call_expression.execute(memory, pipe_info, stdlib, engine)? } Value::UnaryExpression(unary_expression) => { - unary_expression.get_result(memory, pipe_info, engine)? + unary_expression.get_result(memory, pipe_info, stdlib, engine)? } Value::ObjectExpression(object_expression) => { - object_expression.execute(memory, pipe_info, engine)? + object_expression.execute(memory, pipe_info, stdlib, engine)? } Value::ArrayExpression(array_expression) => { - array_expression.execute(memory, pipe_info, engine)? + array_expression.execute(memory, pipe_info, stdlib, engine)? } Value::PipeExpression(pipe_expression) => { - pipe_expression.get_result(memory, pipe_info, engine)? + pipe_expression.get_result(memory, pipe_info, stdlib, engine)? } Value::PipeSubstitution(pipe_substitution) => { return Err(KclError::Semantic(KclErrorDetails { @@ -567,7 +573,7 @@ impl ArrayExpression { } } -#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, ts_rs::TS)] +#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, ts_rs::TS, JsonSchema)] #[ts(export)] #[serde(tag = "type")] pub struct ObjectExpression { @@ -581,6 +587,7 @@ impl ObjectExpression { &self, memory: &mut ProgramMemory, pipe_info: &mut PipeInfo, + stdlib: &crate::std::StdLib, engine: &mut EngineConnection, ) -> Result { let mut object = Map::new(); @@ -592,23 +599,23 @@ impl ObjectExpression { value.clone() } Value::BinaryExpression(binary_expression) => { - binary_expression.get_result(memory, pipe_info, engine)? + binary_expression.get_result(memory, pipe_info, stdlib, engine)? } Value::CallExpression(call_expression) => { pipe_info.is_in_pipe = false; - call_expression.execute(memory, pipe_info, engine)? + call_expression.execute(memory, pipe_info, stdlib, engine)? } Value::UnaryExpression(unary_expression) => { - unary_expression.get_result(memory, pipe_info, engine)? + unary_expression.get_result(memory, pipe_info, stdlib, engine)? } Value::ObjectExpression(object_expression) => { - object_expression.execute(memory, pipe_info, engine)? + object_expression.execute(memory, pipe_info, stdlib, engine)? } Value::ArrayExpression(array_expression) => { - array_expression.execute(memory, pipe_info, engine)? + array_expression.execute(memory, pipe_info, stdlib, engine)? } Value::PipeExpression(pipe_expression) => { - pipe_expression.get_result(memory, pipe_info, engine)? + pipe_expression.get_result(memory, pipe_info, stdlib, engine)? } Value::PipeSubstitution(pipe_substitution) => { return Err(KclError::Semantic(KclErrorDetails { @@ -653,7 +660,7 @@ impl ObjectExpression { impl_value_meta!(ObjectExpression); -#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, ts_rs::TS)] +#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, ts_rs::TS, JsonSchema)] #[ts(export)] #[serde(tag = "type")] pub struct ObjectProperty { @@ -665,7 +672,7 @@ pub struct ObjectProperty { impl_value_meta!(ObjectProperty); -#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, ts_rs::TS)] +#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, ts_rs::TS, JsonSchema)] #[ts(export)] #[serde(tag = "type")] pub enum MemberObject { @@ -673,7 +680,7 @@ pub enum MemberObject { Identifier(Box), } -#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, ts_rs::TS)] +#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, ts_rs::TS, JsonSchema)] #[ts(export)] #[serde(tag = "type")] pub enum LiteralIdentifier { @@ -681,7 +688,7 @@ pub enum LiteralIdentifier { Literal(Box), } -#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, ts_rs::TS)] +#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, ts_rs::TS, JsonSchema)] #[ts(export)] #[serde(tag = "type")] pub struct MemberExpression { @@ -747,7 +754,7 @@ impl MemberExpression { } } -#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, ts_rs::TS)] +#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, ts_rs::TS, JsonSchema)] #[ts(export)] pub struct ObjectKeyInfo { pub key: LiteralIdentifier, @@ -755,7 +762,7 @@ pub struct ObjectKeyInfo { pub computed: bool, } -#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, ts_rs::TS)] +#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, ts_rs::TS, JsonSchema)] #[ts(export)] #[serde(tag = "type")] pub struct BinaryExpression { @@ -774,17 +781,18 @@ impl BinaryExpression { &self, memory: &mut ProgramMemory, pipe_info: &mut PipeInfo, + stdlib: &crate::std::StdLib, engine: &mut EngineConnection, ) -> Result { pipe_info.is_in_pipe = false; let left_json_value = self .left - .get_result(memory, pipe_info, engine)? + .get_result(memory, pipe_info, stdlib, engine)? .get_json_value()?; let right_json_value = self .right - .get_result(memory, pipe_info, engine)? + .get_result(memory, pipe_info, stdlib, engine)? .get_json_value()?; // First check if we are doing string concatenation. @@ -856,7 +864,7 @@ pub fn parse_json_value_as_string(j: &serde_json::Value) -> Option { } } -#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, ts_rs::TS)] +#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, ts_rs::TS, JsonSchema)] #[ts(export)] #[serde(tag = "type")] pub struct UnaryExpression { @@ -873,6 +881,7 @@ impl UnaryExpression { &self, memory: &mut ProgramMemory, pipe_info: &mut PipeInfo, + stdlib: &crate::std::StdLib, engine: &mut EngineConnection, ) -> Result { pipe_info.is_in_pipe = false; @@ -880,7 +889,7 @@ impl UnaryExpression { let num = parse_json_number_as_f64( &self .argument - .get_result(memory, pipe_info, engine)? + .get_result(memory, pipe_info, stdlib, engine)? .get_json_value()?, self.into(), )?; @@ -893,7 +902,7 @@ impl UnaryExpression { } } -#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, ts_rs::TS)] +#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, ts_rs::TS, JsonSchema)] #[ts(export)] #[serde(rename_all = "camelCase", tag = "type")] pub struct PipeExpression { @@ -910,12 +919,13 @@ impl PipeExpression { &self, memory: &mut ProgramMemory, pipe_info: &mut PipeInfo, + stdlib: &crate::std::StdLib, engine: &mut EngineConnection, ) -> Result { // Reset the previous results. pipe_info.previous_results = vec![]; pipe_info.index = 0; - execute_pipe_body(memory, &self.body, pipe_info, self.into(), engine) + execute_pipe_body(memory, &self.body, pipe_info, self.into(), stdlib, engine) } } @@ -924,6 +934,7 @@ fn execute_pipe_body( body: &[Value], pipe_info: &mut PipeInfo, source_range: SourceRange, + stdlib: &crate::std::StdLib, engine: &mut EngineConnection, ) -> Result { if pipe_info.index == body.len() { @@ -949,15 +960,15 @@ fn execute_pipe_body( match expression { Value::BinaryExpression(binary_expression) => { - let result = binary_expression.get_result(memory, pipe_info, engine)?; + let result = binary_expression.get_result(memory, pipe_info, stdlib, engine)?; pipe_info.previous_results.push(result); pipe_info.index += 1; - execute_pipe_body(memory, body, pipe_info, source_range, engine) + execute_pipe_body(memory, body, pipe_info, source_range, stdlib, engine) } Value::CallExpression(call_expression) => { pipe_info.is_in_pipe = true; pipe_info.body = body.to_vec(); - call_expression.execute(memory, pipe_info, engine) + call_expression.execute(memory, pipe_info, stdlib, engine) } _ => { // Return an error this should not happen. @@ -969,7 +980,7 @@ fn execute_pipe_body( } } -#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, ts_rs::TS)] +#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, ts_rs::TS, JsonSchema)] #[ts(export)] #[serde(tag = "type")] pub struct FunctionExpression { @@ -982,7 +993,7 @@ pub struct FunctionExpression { impl_value_meta!(FunctionExpression); -#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, ts_rs::TS)] +#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, ts_rs::TS, JsonSchema)] #[ts(export)] #[serde(tag = "type")] pub struct ReturnStatement { diff --git a/src/wasm-lib/src/docs.rs b/src/wasm-lib/src/docs.rs new file mode 100644 index 000000000..98fcfcfd0 --- /dev/null +++ b/src/wasm-lib/src/docs.rs @@ -0,0 +1,195 @@ +//! Functions for generating docs for our stdlib functions. + +use anyhow::Result; +use serde::{Deserialize, Serialize}; + +use crate::std::Primitive; + +#[derive(Debug, Clone, Deserialize, Serialize, PartialEq)] +pub struct StdLibFnData { + /// The name of the function. + pub name: String, + /// The summary of the function. + pub summary: String, + /// The description of the function. + pub description: String, + /// The tags of the function. + pub tags: Vec, + /// The args of the function. + pub args: Vec, + /// The return value of the function. + pub return_value: StdLibFnArg, + /// If the function is unpublished. + pub unpublished: bool, + /// If the function is deprecated. + pub deprecated: bool, +} + +/// This struct defines a single argument to a stdlib function. +#[derive(Debug, Clone, Deserialize, Serialize, PartialEq)] +pub struct StdLibFnArg { + /// The name of the argument. + pub name: String, + /// The type of the argument. + pub type_: String, + /// The schema of the argument. + pub schema: schemars::schema::Schema, + /// If the argument is required. + pub required: bool, +} + +impl StdLibFnArg { + #[allow(dead_code)] + pub fn get_type_string(&self) -> Result<(String, bool)> { + get_type_string_from_schema(&self.schema) + } + + #[allow(dead_code)] + pub fn description(&self) -> Option { + get_description_string_from_schema(&self.schema) + } +} + +/// This trait defines functions called upon stdlib functions to generate +/// documentation for them. +pub trait StdLibFn { + /// The name of the function. + fn name(&self) -> String; + + /// The summary of the function. + fn summary(&self) -> String; + + /// The description of the function. + fn description(&self) -> String; + + /// The tags of the function. + fn tags(&self) -> Vec; + + /// The args of the function. + fn args(&self) -> Vec; + + /// The return value of the function. + fn return_value(&self) -> StdLibFnArg; + + /// If the function is unpublished. + fn unpublished(&self) -> bool; + + /// If the function is deprecated. + fn deprecated(&self) -> bool; + + /// The function itself. + fn std_lib_fn(&self) -> crate::std::StdFn; + + /// Return a JSON struct representing the function. + fn to_json(&self) -> Result { + Ok(StdLibFnData { + name: self.name(), + summary: self.summary(), + description: self.description(), + tags: self.tags(), + args: self.args(), + return_value: self.return_value(), + unpublished: self.unpublished(), + deprecated: self.deprecated(), + }) + } +} + +fn get_description_string_from_schema(schema: &schemars::schema::Schema) -> Option { + if let schemars::schema::Schema::Object(o) = schema { + if let Some(metadata) = &o.metadata { + if let Some(description) = &metadata.description { + return Some(description.to_string()); + } + } + } + + None +} + +fn get_type_string_from_schema(schema: &schemars::schema::Schema) -> Result<(String, bool)> { + match schema { + schemars::schema::Schema::Object(o) => { + if let Some(format) = &o.format { + if format == "uuid" { + return Ok((Primitive::Uuid.to_string(), false)); + } else if format == "double" || format == "uint" { + return Ok((Primitive::Number.to_string(), false)); + } else { + anyhow::bail!("unknown format: {}", format); + } + } + + if let Some(obj_val) = &o.object { + let mut fn_docs = String::new(); + fn_docs.push_str("{\n"); + // Let's print out the object's properties. + for (prop_name, prop) in obj_val.properties.iter() { + if prop_name.starts_with('_') { + continue; + } + + if let Some(description) = get_description_string_from_schema(prop) { + fn_docs.push_str(&format!("\t// {}\n", description)); + } + fn_docs.push_str(&format!( + "\t\"{}\": {},\n", + prop_name, + get_type_string_from_schema(prop)?.0, + )); + } + + fn_docs.push('}'); + + return Ok((fn_docs, true)); + } + + if let Some(array_val) = &o.array { + if let Some(schemars::schema::SingleOrVec::Single(items)) = &array_val.items { + // Let's print out the object's properties. + return Ok(( + format!("[{}]", get_type_string_from_schema(items)?.0), + false, + )); + } else if let Some(items) = &array_val.contains { + return Ok(( + format!("[{}]", get_type_string_from_schema(items)?.0), + false, + )); + } + } + + if let Some(subschemas) = &o.subschemas { + let mut fn_docs = String::new(); + if let Some(items) = &subschemas.one_of { + for (i, item) in items.iter().enumerate() { + // Let's print out the object's properties. + fn_docs.push_str(&get_type_string_from_schema(item)?.0.to_string()); + if i < items.len() - 1 { + fn_docs.push_str(" |\n"); + } + } + } else if let Some(items) = &subschemas.any_of { + for (i, item) in items.iter().enumerate() { + // Let's print out the object's properties. + fn_docs.push_str(&get_type_string_from_schema(item)?.0.to_string()); + if i < items.len() - 1 { + fn_docs.push_str(" |\n"); + } + } + } else { + anyhow::bail!("unknown subschemas: {:#?}", subschemas); + } + + return Ok((fn_docs, true)); + } + + if let Some(schemars::schema::SingleOrVec::Single(_string)) = &o.instance_type { + return Ok((Primitive::String.to_string(), false)); + } + + anyhow::bail!("unknown type: {:#?}", o) + } + schemars::schema::Schema::Bool(_) => Ok((Primitive::Bool.to_string(), false)), + } +} diff --git a/src/wasm-lib/src/executor.rs b/src/wasm-lib/src/executor.rs index 0b94f988a..40e2e222b 100644 --- a/src/wasm-lib/src/executor.rs +++ b/src/wasm-lib/src/executor.rs @@ -3,7 +3,9 @@ use std::collections::HashMap; use anyhow::Result; +use schemars::JsonSchema; use serde::{Deserialize, Serialize}; + #[cfg(not(test))] use wasm_bindgen::prelude::*; @@ -13,7 +15,7 @@ use crate::{ errors::{KclError, KclErrorDetails}, }; -#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, ts_rs::TS)] +#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, ts_rs::TS, JsonSchema)] #[ts(export)] #[serde(rename_all = "camelCase")] pub struct ProgramMemory { @@ -66,7 +68,7 @@ impl Default for ProgramMemory { } } -#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, ts_rs::TS)] +#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, ts_rs::TS, JsonSchema)] #[ts(export)] #[serde(rename_all = "camelCase", untagged)] pub enum ProgramReturn { @@ -101,7 +103,7 @@ impl ProgramReturn { } } -#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, ts_rs::TS)] +#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, ts_rs::TS, JsonSchema)] #[ts(export)] #[serde(tag = "type", rename_all = "camelCase")] pub enum MemoryItem { @@ -112,12 +114,7 @@ pub enum MemoryItem { }, SketchGroup(SketchGroup), ExtrudeGroup(ExtrudeGroup), - ExtrudeTransform { - position: Position, - rotation: Rotation, - #[serde(rename = "__meta")] - meta: Vec, - }, + ExtrudeTransform(ExtrudeTransform), Function { #[serde(skip)] func: Option, @@ -127,6 +124,16 @@ pub enum MemoryItem { }, } +#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, ts_rs::TS, JsonSchema)] +#[ts(export)] +#[serde(rename_all = "camelCase")] +pub struct ExtrudeTransform { + pub position: Position, + pub rotation: Rotation, + #[serde(rename = "__meta")] + pub meta: Vec, +} + pub type MemoryFunction = fn( s: &[MemoryItem], memory: &ProgramMemory, @@ -141,9 +148,7 @@ impl From for Vec { MemoryItem::UserVal { meta, .. } => meta.iter().map(|m| m.source_range).collect(), MemoryItem::SketchGroup(s) => s.meta.iter().map(|m| m.source_range).collect(), MemoryItem::ExtrudeGroup(e) => e.meta.iter().map(|m| m.source_range).collect(), - MemoryItem::ExtrudeTransform { meta, .. } => { - meta.iter().map(|m| m.source_range).collect() - } + MemoryItem::ExtrudeTransform(e) => e.meta.iter().map(|m| m.source_range).collect(), MemoryItem::Function { meta, .. } => meta.iter().map(|m| m.source_range).collect(), } } @@ -190,15 +195,22 @@ impl MemoryItem { } } -#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, ts_rs::TS)] +/// A sketch group is a collection of paths. +#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, ts_rs::TS, JsonSchema)] #[ts(export)] #[serde(rename_all = "camelCase")] pub struct SketchGroup { + /// The id of the sketch group. pub id: uuid::Uuid, + /// The paths in the sketch group. pub value: Vec, + /// The starting path. pub start: BasePath, + /// The position of the sketch group. pub position: Position, + /// The rotation of the sketch group. pub rotation: Rotation, + /// Metadata. #[serde(rename = "__meta")] pub meta: Vec, } @@ -238,15 +250,22 @@ impl SketchGroup { } } -#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, ts_rs::TS)] +/// An extrude group is a collection of extrude surfaces. +#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, ts_rs::TS, JsonSchema)] #[ts(export)] #[serde(rename_all = "camelCase")] pub struct ExtrudeGroup { + /// The id of the extrude group. pub id: uuid::Uuid, + /// The extrude surfaces. pub value: Vec, + /// The height of the extrude group. pub height: f64, + /// The position of the extrude group. pub position: Position, + /// The rotation of the extrude group. pub rotation: Rotation, + /// Metadata. #[serde(rename = "__meta")] pub meta: Vec, } @@ -261,7 +280,7 @@ impl ExtrudeGroup { } } -#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, ts_rs::TS)] +#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, ts_rs::TS, JsonSchema)] #[ts(export)] #[serde(rename_all = "camelCase")] pub enum BodyType { @@ -270,19 +289,19 @@ pub enum BodyType { Block, } -#[derive(Debug, Deserialize, Serialize, PartialEq, Copy, Clone, ts_rs::TS)] +#[derive(Debug, Deserialize, Serialize, PartialEq, Copy, Clone, ts_rs::TS, JsonSchema)] #[ts(export)] pub struct Position(pub [f64; 3]); -#[derive(Debug, Deserialize, Serialize, PartialEq, Copy, Clone, ts_rs::TS)] +#[derive(Debug, Deserialize, Serialize, PartialEq, Copy, Clone, ts_rs::TS, JsonSchema)] #[ts(export)] pub struct Rotation(pub [f64; 4]); -#[derive(Debug, Default, Deserialize, Serialize, PartialEq, Copy, Clone, ts_rs::TS)] +#[derive(Debug, Default, Deserialize, Serialize, PartialEq, Copy, Clone, ts_rs::TS, JsonSchema)] #[ts(export)] pub struct SourceRange(pub [usize; 2]); -#[derive(Debug, Deserialize, Serialize, PartialEq, Clone, ts_rs::TS)] +#[derive(Debug, Deserialize, Serialize, PartialEq, Clone, ts_rs::TS, JsonSchema)] #[ts(export)] pub struct Point2d { pub x: f64, @@ -301,7 +320,7 @@ impl From for [f64; 2] { } } -#[derive(Debug, Deserialize, Serialize, PartialEq, Clone, ts_rs::TS)] +#[derive(Debug, Deserialize, Serialize, PartialEq, Clone, ts_rs::TS, JsonSchema)] #[ts(export)] pub struct Point3d { pub x: f64, @@ -309,10 +328,12 @@ pub struct Point3d { pub z: f64, } -#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, ts_rs::TS)] +/// Metadata. +#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, ts_rs::TS, JsonSchema)] #[ts(export)] #[serde(rename_all = "camelCase")] pub struct Metadata { + /// The source range. pub source_range: SourceRange, } @@ -322,45 +343,61 @@ impl From for Metadata { } } -#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, ts_rs::TS)] +/// A base path. +#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, ts_rs::TS, JsonSchema)] #[ts(export)] #[serde(rename_all = "camelCase")] pub struct BasePath { + /// The from point. pub from: [f64; 2], + /// The to point. pub to: [f64; 2], + /// The name of the path. pub name: String, + /// Metadata. #[serde(rename = "__geoMeta")] pub geo_meta: GeoMeta, } -#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, ts_rs::TS)] +/// Geometry metadata. +#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, ts_rs::TS, JsonSchema)] #[ts(export)] #[serde(rename_all = "camelCase")] pub struct GeoMeta { + /// The id of the geometry. pub id: uuid::Uuid, + /// Metadata. #[serde(flatten)] pub metadata: Metadata, } -#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, ts_rs::TS)] +/// A path. +#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, ts_rs::TS, JsonSchema)] #[ts(export)] #[serde(tag = "type", rename_all = "camelCase")] pub enum Path { + /// A path that goes to a point. ToPoint { #[serde(flatten)] base: BasePath, }, + /// A path that is horizontal. Horizontal { #[serde(flatten)] base: BasePath, + /// The x coordinate. x: f64, }, + /// An angled line to. AngledLineTo { #[serde(flatten)] base: BasePath, + /// The x coordinate. x: Option, + /// The y coordinate. y: Option, }, + /// A base path. Base { #[serde(flatten)] base: BasePath, @@ -396,14 +433,20 @@ impl Path { } } -#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, ts_rs::TS)] +/// An extrude surface. +#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, ts_rs::TS, JsonSchema)] #[ts(export)] #[serde(tag = "type", rename_all = "camelCase")] pub enum ExtrudeSurface { + /// An extrude plane. ExtrudePlane { + /// The position. position: Position, + /// The rotation. rotation: Rotation, + /// The name. name: String, + /// Metadata. #[serde(flatten)] geo_meta: GeoMeta, }, @@ -435,7 +478,7 @@ impl ExtrudeSurface { } } -#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, ts_rs::TS)] +#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, ts_rs::TS, JsonSchema)] #[ts(export)] #[serde(rename_all = "camelCase")] pub struct PipeInfo { @@ -470,6 +513,7 @@ fn execute( engine: &mut EngineConnection, ) -> Result { let mut pipe_info = PipeInfo::default(); + let stdlib = crate::std::StdLib::new(); // Iterate over the body of the program. for statement in &program.body { @@ -525,8 +569,12 @@ fn execute( memory.add(&var_name, value.clone(), source_range)?; } Value::BinaryExpression(binary_expression) => { - let result = - binary_expression.get_result(memory, &mut pipe_info, engine)?; + let result = binary_expression.get_result( + memory, + &mut pipe_info, + &stdlib, + engine, + )?; memory.add(&var_name, result, source_range)?; } Value::FunctionExpression(function_expression) => { @@ -563,12 +611,17 @@ fn execute( )?; } Value::CallExpression(call_expression) => { - let result = call_expression.execute(memory, &mut pipe_info, engine)?; + let result = + call_expression.execute(memory, &mut pipe_info, &stdlib, engine)?; memory.add(&var_name, result, source_range)?; } Value::PipeExpression(pipe_expression) => { - let result = - pipe_expression.get_result(memory, &mut pipe_info, engine)?; + let result = pipe_expression.get_result( + memory, + &mut pipe_info, + &stdlib, + engine, + )?; memory.add(&var_name, result, source_range)?; } Value::PipeSubstitution(pipe_substitution) => { @@ -578,13 +631,21 @@ fn execute( })); } Value::ArrayExpression(array_expression) => { - let result = - array_expression.execute(memory, &mut pipe_info, engine)?; + let result = array_expression.execute( + memory, + &mut pipe_info, + &stdlib, + engine, + )?; memory.add(&var_name, result, source_range)?; } Value::ObjectExpression(object_expression) => { - let result = - object_expression.execute(memory, &mut pipe_info, engine)?; + let result = object_expression.execute( + memory, + &mut pipe_info, + &stdlib, + engine, + )?; memory.add(&var_name, result, source_range)?; } Value::MemberExpression(member_expression) => { @@ -592,8 +653,12 @@ fn execute( memory.add(&var_name, result, source_range)?; } Value::UnaryExpression(unary_expression) => { - let result = - unary_expression.get_result(memory, &mut pipe_info, engine)?; + let result = unary_expression.get_result( + memory, + &mut pipe_info, + &stdlib, + engine, + )?; memory.add(&var_name, result, source_range)?; } } @@ -601,7 +666,7 @@ fn execute( } BodyItem::ReturnStatement(return_statement) => match &return_statement.argument { Value::BinaryExpression(bin_expr) => { - let result = bin_expr.get_result(memory, &mut pipe_info, engine)?; + let result = bin_expr.get_result(memory, &mut pipe_info, &stdlib, engine)?; memory.return_ = Some(ProgramReturn::Value(result)); } Value::Identifier(identifier) => { @@ -671,7 +736,6 @@ mod tests { pub async fn parse_execute(code: &str) -> Result { let tokens = crate::tokeniser::lexer(code); let program = crate::parser::abstract_syntax_tree(&tokens)?; - println!("{:#?}", program); let mut mem: ProgramMemory = Default::default(); let mut engine = EngineConnection::new("dev.kittycad.io", "some-token", "").await?; let memory = execute(program, &mut mem, BodyType::Root, &mut engine)?; diff --git a/src/wasm-lib/src/lib.rs b/src/wasm-lib/src/lib.rs index fd421c09e..3dd4455af 100644 --- a/src/wasm-lib/src/lib.rs +++ b/src/wasm-lib/src/lib.rs @@ -1,4 +1,5 @@ mod abstract_syntax_tree_types; +mod docs; mod engine; mod errors; mod executor; diff --git a/src/wasm-lib/src/std/extrude.rs b/src/wasm-lib/src/std/extrude.rs index 27fe6988e..730dc5c80 100644 --- a/src/wasm-lib/src/std/extrude.rs +++ b/src/wasm-lib/src/std/extrude.rs @@ -2,16 +2,32 @@ use crate::{ errors::{KclError, KclErrorDetails}, - executor::{ExtrudeGroup, MemoryItem}, + executor::{ExtrudeGroup, ExtrudeTransform, MemoryItem, SketchGroup}, std::Args, }; use anyhow::Result; +use derive_docs::stdlib; +use schemars::JsonSchema; /// Extrudes by a given amount. pub fn extrude(args: &mut Args) -> Result { let (length, sketch_group) = args.get_number_sketch_group()?; + let result = inner_extrude(length, sketch_group, args)?; + + Ok(MemoryItem::ExtrudeGroup(result)) +} + +/// Extrudes by a given amount. +#[stdlib { + name = "extrude" +}] +fn inner_extrude( + length: f64, + sketch_group: SketchGroup, + args: &mut Args, +) -> Result { let id = uuid::Uuid::new_v4(); let cmd = kittycad::types::ModelingCmd::Extrude { @@ -21,7 +37,7 @@ pub fn extrude(args: &mut Args) -> Result { }; args.send_modeling_cmd(id, cmd)?; - Ok(MemoryItem::ExtrudeGroup(ExtrudeGroup { + Ok(ExtrudeGroup { id, // TODO, this is just an empty array now, should be deleted. This // comment was originally in the JS code. @@ -30,14 +46,27 @@ pub fn extrude(args: &mut Args) -> Result { position: sketch_group.position, rotation: sketch_group.rotation, meta: sketch_group.meta, - })) + }) } /// Returns the extrude wall transform. pub fn get_extrude_wall_transform(args: &mut Args) -> Result { let (surface_name, extrude_group) = args.get_path_name_extrude_group()?; + let result = inner_get_extrude_wall_transform(&surface_name, extrude_group, args)?; + Ok(MemoryItem::ExtrudeTransform(result)) +} + +/// Returns the extrude wall transform. +#[stdlib { + name = "getExtrudeWallTransform" +}] +fn inner_get_extrude_wall_transform( + surface_name: &str, + extrude_group: ExtrudeGroup, + args: &mut Args, +) -> Result { let surface = extrude_group - .get_path_by_name(&surface_name) + .get_path_by_name(surface_name) .ok_or_else(|| { KclError::Type(KclErrorDetails { message: format!( @@ -48,7 +77,7 @@ pub fn get_extrude_wall_transform(args: &mut Args) -> Result; pub type StdFn = fn(&mut Args) -> Result; -lazy_static! { - pub static ref INTERNAL_FNS: FnMap = - { - HashMap::from([ - // Extrude functions. - ("extrude".to_string(), extrude as StdFn), - ("getExtrudeWallTransform".to_string(), get_extrude_wall_transform as StdFn), +pub struct StdLib { + #[allow(dead_code)] + internal_fn_names: Vec>, - ("min".to_string(), min as StdFn), - ("legLen".to_string(), leg_length as StdFn), - ("legAngX".to_string(),leg_angle_x as StdFn), - ("legAngY".to_string(), leg_angle_y as StdFn), - // Sketch segment functions. - ("segEndX".to_string(), segment_end_x as StdFn), - ("segEndY".to_string(), segment_end_y as StdFn), - ("lastSegX".to_string(), last_segment_x as StdFn), - ("lastSegY".to_string(), last_segment_y as StdFn), - ("segLen".to_string(), segment_length as StdFn), - ("segAng".to_string(), segment_angle as StdFn), - ("angleToMatchLengthX".to_string(), angle_to_match_length_x as StdFn), - ("angleToMatchLengthY".to_string(), angle_to_match_length_y as StdFn), + pub fns: FnMap, +} - // Sketch functions. - ("lineTo".to_string(), line_to as StdFn), - ("xLineTo".to_string(), x_line_to as StdFn), - ("yLineTo".to_string(), y_line_to as StdFn), - ("line".to_string(), line as StdFn), - ("xLine".to_string(), x_line as StdFn), - ("yLine".to_string(), y_line as StdFn), - ("angledLine".to_string(), angled_line as StdFn), - ("angledLineOfXLength".to_string(), angled_line_of_x_length as StdFn), - ("angledLineToX".to_string(), angled_line_to_x as StdFn), - ("angledLineOfYLength".to_string(), angled_line_of_y_length as StdFn), - ("angledLineToY".to_string(), angled_line_to_y as StdFn), - ("angledLineThatIntersects".to_string(), angled_line_that_intersects as StdFn), - ("startSketchAt".to_string(), start_sketch_at as StdFn), - ("close".to_string(), close as StdFn), - ]) +impl StdLib { + pub fn new() -> Self { + let internal_fn_names: Vec> = vec![ + Box::new(Min), + 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::Close), + ]; - }; + let mut fns = HashMap::new(); + for internal_fn_name in &internal_fn_names { + fns.insert( + internal_fn_name.name().to_string(), + internal_fn_name.std_lib_fn(), + ); + } + + Self { + internal_fn_names, + fns, + } + } +} + +impl Default for StdLib { + fn default() -> Self { + Self::new() + } } #[derive(Debug)] @@ -471,34 +483,202 @@ impl<'a> Args<'a> { } /// Returns the minimum of the given arguments. +/// TODO fix min pub fn min(args: &mut Args) -> Result { + let nums = args.get_number_array()?; + let result = inner_min(nums); + + args.make_user_val_from_f64(result) +} + +/// Returns the minimum of the given arguments. +#[stdlib { + name = "min", +}] +fn inner_min(args: Vec) -> f64 { let mut min = std::f64::MAX; - for arg in args.get_number_array()? { - if arg < min { - min = arg; + for arg in args.iter() { + if *arg < min { + min = *arg; } } - args.make_user_val_from_f64(min) + min } /// Returns the length of the given leg. pub fn leg_length(args: &mut Args) -> Result { let (hypotenuse, leg) = args.get_hypotenuse_leg()?; - let result = (hypotenuse.powi(2) - f64::min(hypotenuse.abs(), leg.abs()).powi(2)).sqrt(); + let result = inner_leg_length(hypotenuse, leg); args.make_user_val_from_f64(result) } +/// Returns the length of the given leg. +#[stdlib { + name = "legLen", +}] +fn inner_leg_length(hypotenuse: f64, leg: f64) -> f64 { + (hypotenuse.powi(2) - f64::min(hypotenuse.abs(), leg.abs()).powi(2)).sqrt() +} + /// Returns the angle of the given leg for x. pub fn leg_angle_x(args: &mut Args) -> Result { let (hypotenuse, leg) = args.get_hypotenuse_leg()?; - let result = (leg.min(hypotenuse) / hypotenuse).acos() * 180.0 / std::f64::consts::PI; + let result = inner_leg_angle_x(hypotenuse, leg); args.make_user_val_from_f64(result) } +/// Returns the angle of the given leg for x. +#[stdlib { + name = "legAngX", +}] +fn inner_leg_angle_x(hypotenuse: f64, leg: f64) -> f64 { + (leg.min(hypotenuse) / hypotenuse).acos() * 180.0 / std::f64::consts::PI +} + /// Returns the angle of the given leg for y. pub fn leg_angle_y(args: &mut Args) -> Result { let (hypotenuse, leg) = args.get_hypotenuse_leg()?; - let result = (leg.min(hypotenuse) / hypotenuse).asin() * 180.0 / std::f64::consts::PI; + let result = inner_leg_angle_y(hypotenuse, leg); args.make_user_val_from_f64(result) } + +/// Returns the angle of the given leg for y. +#[stdlib { + name = "legAngY", +}] +fn inner_leg_angle_y(hypotenuse: f64, leg: f64) -> f64 { + (leg.min(hypotenuse) / hypotenuse).asin() * 180.0 / std::f64::consts::PI +} + +/// The primitive types that can be used in a KCL file. +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, Display, FromStr)] +#[serde(rename_all = "lowercase")] +#[display(style = "lowercase")] +pub enum Primitive { + /// A boolean value. + Bool, + /// A number value. + Number, + /// A string value. + String, + /// A uuid value. + Uuid, +} + +#[cfg(test)] +mod tests { + use crate::std::StdLib; + + #[test] + fn test_generate_stdlib_markdown_docs() { + let stdlib = StdLib::new(); + let mut buf = String::new(); + + buf.push_str("\n\n"); + + buf.push_str("# KCL Standard Library\n\n"); + + // Generate a table of contents. + buf.push_str("## Table of Contents\n\n"); + + buf.push_str("* [Functions](#functions)\n"); + + for internal_fn in &stdlib.internal_fn_names { + if internal_fn.unpublished() || internal_fn.deprecated() { + continue; + } + + buf.push_str(&format!( + "\t* [`{}`](#{})\n", + internal_fn.name(), + internal_fn.name() + )); + } + + buf.push_str("\n\n"); + + buf.push_str("## Functions\n\n"); + + for internal_fn in &stdlib.internal_fn_names { + if internal_fn.unpublished() { + continue; + } + + let mut fn_docs = String::new(); + + if internal_fn.deprecated() { + fn_docs.push_str(&format!("### {} DEPRECATED\n\n", internal_fn.name())); + } else { + fn_docs.push_str(&format!("### {}\n\n", internal_fn.name())); + } + + fn_docs.push_str(&format!("{}\n\n", internal_fn.summary())); + fn_docs.push_str(&format!("{}\n\n", internal_fn.description())); + + fn_docs.push_str("```\n"); + fn_docs.push_str(&format!("{}(", internal_fn.name())); + for (i, arg) in internal_fn.args().iter().enumerate() { + if i > 0 { + fn_docs.push_str(", "); + } + fn_docs.push_str(&format!("{}: {}", arg.name, arg.type_)); + } + fn_docs.push_str(") -> "); + fn_docs.push_str(&internal_fn.return_value().type_); + fn_docs.push_str("\n```\n\n"); + + fn_docs.push_str("#### Arguments\n\n"); + for arg in internal_fn.args() { + let (format, should_be_indented) = arg.get_type_string().unwrap(); + if let Some(description) = arg.description() { + fn_docs.push_str(&format!( + "* `{}`: `{}` - {}\n", + arg.name, arg.type_, description + )); + } else { + fn_docs.push_str(&format!("* `{}`: `{}`\n", arg.name, arg.type_)); + } + + if should_be_indented { + fn_docs.push_str(&format!("```\n{}\n```\n", format)); + } + } + + fn_docs.push_str("\n#### Returns\n\n"); + let return_type = internal_fn.return_value(); + if let Some(description) = return_type.description() { + fn_docs.push_str(&format!("* `{}` - {}\n", return_type.type_, description)); + } else { + fn_docs.push_str(&format!("* `{}`\n", return_type.type_)); + } + + let (format, should_be_indented) = return_type.get_type_string().unwrap(); + if should_be_indented { + fn_docs.push_str(&format!("```\n{}\n```\n", format)); + } + + fn_docs.push_str("\n\n\n"); + + buf.push_str(&fn_docs); + } + + expectorate::assert_contents("../../docs/kcl.md", &buf); + } + + #[test] + fn test_generate_stdlib_json_schema() { + let stdlib = StdLib::new(); + + let mut json_data = vec![]; + + for internal_fn in &stdlib.internal_fn_names { + json_data.push(internal_fn.to_json().unwrap()); + } + + expectorate::assert_contents( + "../../docs/kcl.json", + &serde_json::to_string_pretty(&json_data).unwrap(), + ); + } +} diff --git a/src/wasm-lib/src/std/segment.rs b/src/wasm-lib/src/std/segment.rs index 8fa66311f..346f98e92 100644 --- a/src/wasm-lib/src/std/segment.rs +++ b/src/wasm-lib/src/std/segment.rs @@ -2,17 +2,33 @@ use crate::{ errors::{KclError, KclErrorDetails}, - executor::MemoryItem, + executor::{MemoryItem, SketchGroup}, std::{utils::get_angle, Args}, }; use anyhow::Result; +use derive_docs::stdlib; +use schemars::JsonSchema; /// Returns the segment end of x. pub fn segment_end_x(args: &mut Args) -> Result { let (segment_name, sketch_group) = args.get_segment_name_sketch_group()?; + let result = inner_segment_end_x(&segment_name, sketch_group, args)?; + + args.make_user_val_from_f64(result) +} + +/// Returns the segment end of x. +#[stdlib { + name = "segEndX", +}] +fn inner_segment_end_x( + segment_name: &str, + sketch_group: SketchGroup, + args: &mut Args, +) -> Result { let line = sketch_group - .get_base_by_name_or_start(&segment_name) + .get_base_by_name_or_start(segment_name) .ok_or_else(|| { KclError::Type(KclErrorDetails { message: format!( @@ -23,14 +39,28 @@ pub fn segment_end_x(args: &mut Args) -> Result { }) })?; - args.make_user_val_from_f64(line.to[0]) + Ok(line.to[0]) } /// Returns the segment end of y. pub fn segment_end_y(args: &mut Args) -> Result { let (segment_name, sketch_group) = args.get_segment_name_sketch_group()?; + let result = inner_segment_end_y(&segment_name, sketch_group, args)?; + + args.make_user_val_from_f64(result) +} + +/// Returns the segment end of y. +#[stdlib { + name = "segEndY", +}] +fn inner_segment_end_y( + segment_name: &str, + sketch_group: SketchGroup, + args: &mut Args, +) -> Result { let line = sketch_group - .get_base_by_name_or_start(&segment_name) + .get_base_by_name_or_start(segment_name) .ok_or_else(|| { KclError::Type(KclErrorDetails { message: format!( @@ -41,12 +71,22 @@ pub fn segment_end_y(args: &mut Args) -> Result { }) })?; - args.make_user_val_from_f64(line.to[1]) + Ok(line.to[1]) } /// Returns the last segment of x. pub fn last_segment_x(args: &mut Args) -> Result { let sketch_group = args.get_sketch_group()?; + let result = inner_last_segment_x(sketch_group, args)?; + + args.make_user_val_from_f64(result) +} + +/// Returns the last segment of x. +#[stdlib { + name = "lastSegX", +}] +fn inner_last_segment_x(sketch_group: SketchGroup, args: &mut Args) -> Result { let last_line = sketch_group .value .last() @@ -61,12 +101,22 @@ pub fn last_segment_x(args: &mut Args) -> Result { })? .get_base(); - args.make_user_val_from_f64(last_line.to[0]) + Ok(last_line.to[0]) } /// Returns the last segment of y. pub fn last_segment_y(args: &mut Args) -> Result { let sketch_group = args.get_sketch_group()?; + let result = inner_last_segment_y(sketch_group, args)?; + + args.make_user_val_from_f64(result) +} + +/// Returns the last segment of y. +#[stdlib { + name = "lastSegY", +}] +fn inner_last_segment_y(sketch_group: SketchGroup, args: &mut Args) -> Result { let last_line = sketch_group .value .last() @@ -81,63 +131,100 @@ pub fn last_segment_y(args: &mut Args) -> Result { })? .get_base(); - args.make_user_val_from_f64(last_line.to[1]) + Ok(last_line.to[1]) } /// Returns the length of the segment. pub fn segment_length(args: &mut Args) -> Result { let (segment_name, sketch_group) = args.get_segment_name_sketch_group()?; - let path = sketch_group - .get_path_by_name(&segment_name) - .ok_or_else(|| { - KclError::Type(KclErrorDetails { - message: format!( - "Expected a segment name that exists in the given SketchGroup, found `{}`", - segment_name - ), - source_ranges: vec![args.source_range], - }) - })?; + let result = inner_segment_length(&segment_name, sketch_group, args)?; + args.make_user_val_from_f64(result) +} + +/// Returns the length of the segment. +#[stdlib { + name = "segLen", +}] +fn inner_segment_length( + segment_name: &str, + sketch_group: SketchGroup, + args: &mut Args, +) -> Result { + let path = sketch_group.get_path_by_name(segment_name).ok_or_else(|| { + KclError::Type(KclErrorDetails { + message: format!( + "Expected a segment name that exists in the given SketchGroup, found `{}`", + segment_name + ), + source_ranges: vec![args.source_range], + }) + })?; let line = path.get_base(); let result = ((line.from[1] - line.to[1]).powi(2) + (line.from[0] - line.to[0]).powi(2)).sqrt(); - args.make_user_val_from_f64(result) + + Ok(result) } /// Returns the angle of the segment. pub fn segment_angle(args: &mut Args) -> Result { let (segment_name, sketch_group) = args.get_segment_name_sketch_group()?; - let path = sketch_group - .get_path_by_name(&segment_name) - .ok_or_else(|| { - KclError::Type(KclErrorDetails { - message: format!( - "Expected a segment name that exists in the given SketchGroup, found `{}`", - segment_name - ), - source_ranges: vec![args.source_range], - }) - })?; + + let result = inner_segment_angle(&segment_name, sketch_group, args)?; + args.make_user_val_from_f64(result) +} + +/// Returns the angle of the segment. +#[stdlib { + name = "segAng", +}] +fn inner_segment_angle( + segment_name: &str, + sketch_group: SketchGroup, + args: &mut Args, +) -> Result { + let path = sketch_group.get_path_by_name(segment_name).ok_or_else(|| { + KclError::Type(KclErrorDetails { + message: format!( + "Expected a segment name that exists in the given SketchGroup, found `{}`", + segment_name + ), + source_ranges: vec![args.source_range], + }) + })?; let line = path.get_base(); let result = get_angle(&line.from, &line.to); - args.make_user_val_from_f64(result) + + Ok(result) } /// Returns the angle to match the given length for x. pub fn angle_to_match_length_x(args: &mut Args) -> Result { let (segment_name, to, sketch_group) = args.get_segment_name_to_number_sketch_group()?; - let path = sketch_group - .get_path_by_name(&segment_name) - .ok_or_else(|| { - KclError::Type(KclErrorDetails { - message: format!( - "Expected a segment name that exists in the given SketchGroup, found `{}`", - segment_name - ), - source_ranges: vec![args.source_range], - }) - })?; + let result = inner_angle_to_match_length_x(&segment_name, to, sketch_group, args)?; + args.make_user_val_from_f64(result) +} + +/// Returns the angle to match the given length for x. +#[stdlib { + name = "angleToMatchLengthX", +}] +fn inner_angle_to_match_length_x( + segment_name: &str, + to: f64, + sketch_group: SketchGroup, + args: &mut Args, +) -> Result { + let path = sketch_group.get_path_by_name(segment_name).ok_or_else(|| { + KclError::Type(KclErrorDetails { + message: format!( + "Expected a segment name that exists in the given SketchGroup, found `{}`", + segment_name + ), + source_ranges: vec![args.source_range], + }) + })?; let line = path.get_base(); let length = ((line.from[1] - line.to[1]).powi(2) + (line.from[0] - line.to[0]).powi(2)).sqrt(); @@ -161,26 +248,38 @@ pub fn angle_to_match_length_x(args: &mut Args) -> Result let angle_r = diff / length.acos(); if diff > length { - args.make_user_val_from_f64(0.0) + Ok(0.0) } else { - args.make_user_val_from_f64(angle_r * 180.0 / std::f64::consts::PI) + Ok(angle_r * 180.0 / std::f64::consts::PI) } } /// Returns the angle to match the given length for y. pub fn angle_to_match_length_y(args: &mut Args) -> Result { let (segment_name, to, sketch_group) = args.get_segment_name_to_number_sketch_group()?; - let path = sketch_group - .get_path_by_name(&segment_name) - .ok_or_else(|| { - KclError::Type(KclErrorDetails { - message: format!( - "Expected a segment name that exists in the given SketchGroup, found `{}`", - segment_name - ), - source_ranges: vec![args.source_range], - }) - })?; + let result = inner_angle_to_match_length_y(&segment_name, to, sketch_group, args)?; + args.make_user_val_from_f64(result) +} + +/// Returns the angle to match the given length for y. +#[stdlib { + name = "angleToMatchLengthY", +}] +fn inner_angle_to_match_length_y( + segment_name: &str, + to: f64, + sketch_group: SketchGroup, + args: &mut Args, +) -> Result { + let path = sketch_group.get_path_by_name(segment_name).ok_or_else(|| { + KclError::Type(KclErrorDetails { + message: format!( + "Expected a segment name that exists in the given SketchGroup, found `{}`", + segment_name + ), + source_ranges: vec![args.source_range], + }) + })?; let line = path.get_base(); let length = ((line.from[1] - line.to[1]).powi(2) + (line.from[0] - line.to[0]).powi(2)).sqrt(); @@ -204,8 +303,8 @@ pub fn angle_to_match_length_y(args: &mut Args) -> Result let angle_r = diff / length.asin(); if diff > length { - args.make_user_val_from_f64(0.0) + Ok(0.0) } else { - args.make_user_val_from_f64(angle_r * 180.0 / std::f64::consts::PI) + Ok(angle_r * 180.0 / std::f64::consts::PI) } } diff --git a/src/wasm-lib/src/std/sketch.rs b/src/wasm-lib/src/std/sketch.rs index 4d86fdc0a..13cee30b8 100644 --- a/src/wasm-lib/src/std/sketch.rs +++ b/src/wasm-lib/src/std/sketch.rs @@ -1,6 +1,8 @@ //! Functions related to sketching. +use derive_docs::stdlib; use kittycad::types::{ModelingCmd, Point3D}; +use schemars::JsonSchema; use serde::{Deserialize, Serialize}; use crate::{ @@ -14,11 +16,19 @@ use crate::{ use anyhow::Result; -#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, ts_rs::TS)] +/// Data to draw a line to a point. +#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, ts_rs::TS, JsonSchema)] #[ts(export)] #[serde(rename_all = "camelCase", untagged)] pub enum LineToData { - PointWithTag { to: [f64; 2], tag: String }, + /// A point with a tag. + PointWithTag { + /// The to point. + to: [f64; 2], + /// The tag. + tag: String, + }, + /// A point. Point([f64; 2]), } @@ -31,6 +41,9 @@ pub fn line_to(args: &mut Args) -> Result { } /// Draw a line to a point. +#[stdlib { + name = "lineTo", +}] fn inner_line_to( data: LineToData, sketch_group: SketchGroup, @@ -65,17 +78,39 @@ fn inner_line_to( Ok(new_sketch_group) } -#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, ts_rs::TS)] +/// Data to draw a line to a point on an axis. +#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, ts_rs::TS, JsonSchema)] #[ts(export)] #[serde(rename_all = "camelCase", untagged)] pub enum AxisLineToData { - PointWithTag { to: f64, tag: String }, + /// A point with a tag. + PointWithTag { + /// The to point. + to: f64, + /// The tag. + tag: String, + }, + /// A point. Point(f64), } /// Draw a line to a point on the x-axis. pub fn x_line_to(args: &mut Args) -> Result { let (data, sketch_group): (AxisLineToData, SketchGroup) = args.get_data_and_sketch_group()?; + + let new_sketch_group = inner_x_line_to(data, sketch_group, args)?; + Ok(MemoryItem::SketchGroup(new_sketch_group)) +} + +/// Draw a line to a point on the x-axis. +#[stdlib { + name = "xLineTo", +}] +fn inner_x_line_to( + data: AxisLineToData, + sketch_group: SketchGroup, + args: &Args, +) -> Result { let from = sketch_group.get_coords_from_paths()?; let line_to_data = match data { @@ -87,12 +122,27 @@ pub fn x_line_to(args: &mut Args) -> Result { }; let new_sketch_group = inner_line_to(line_to_data, sketch_group, args)?; - Ok(MemoryItem::SketchGroup(new_sketch_group)) + + Ok(new_sketch_group) } /// Draw a line to a point on the y-axis. pub fn y_line_to(args: &mut Args) -> Result { let (data, sketch_group): (AxisLineToData, SketchGroup) = args.get_data_and_sketch_group()?; + + let new_sketch_group = inner_y_line_to(data, sketch_group, args)?; + Ok(MemoryItem::SketchGroup(new_sketch_group)) +} + +/// Draw a line to a point on the y-axis. +#[stdlib { + name = "yLineTo", +}] +fn inner_y_line_to( + data: AxisLineToData, + sketch_group: SketchGroup, + args: &Args, +) -> Result { let from = sketch_group.get_coords_from_paths()?; let line_to_data = match data { @@ -104,23 +154,35 @@ pub fn y_line_to(args: &mut Args) -> Result { }; let new_sketch_group = inner_line_to(line_to_data, sketch_group, args)?; - Ok(MemoryItem::SketchGroup(new_sketch_group)) + Ok(new_sketch_group) } -#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, ts_rs::TS)] +/// Data to draw a line. +#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, ts_rs::TS, JsonSchema)] #[ts(export)] #[serde(rename_all = "camelCase", untagged)] pub enum LineData { - PointWithTag { to: PointOrDefault, tag: String }, + /// A point with a tag. + PointWithTag { + /// The to point. + to: PointOrDefault, + /// The tag. + tag: String, + }, + /// A point. Point([f64; 2]), + /// A string like `default`. Default(String), } -#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, ts_rs::TS)] +/// A point or a default value. +#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, ts_rs::TS, JsonSchema)] #[ts(export)] #[serde(rename_all = "camelCase", untagged)] pub enum PointOrDefault { + /// A point. Point([f64; 2]), + /// A string like `default`. Default(String), } @@ -141,6 +203,10 @@ pub fn line(args: &mut Args) -> Result { Ok(MemoryItem::SketchGroup(new_sketch_group)) } +/// Draw a line. +#[stdlib { + name = "line", +}] fn inner_line( data: LineData, sketch_group: SketchGroup, @@ -195,55 +261,95 @@ fn inner_line( Ok(new_sketch_group) } -#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, ts_rs::TS)] +/// Data to draw a line on an axis. +#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, ts_rs::TS, JsonSchema)] #[ts(export)] #[serde(rename_all = "camelCase", untagged)] pub enum AxisLineData { - PointWithTag { length: f64, tag: String }, - Point(f64), + /// The length with a tag. + LengthWithTag { + /// The length of the line. + length: f64, + /// The tag. + tag: String, + }, + /// The length. + Length(f64), } /// Draw a line on the x-axis. pub fn x_line(args: &mut Args) -> Result { let (data, sketch_group): (AxisLineData, SketchGroup) = args.get_data_and_sketch_group()?; + let new_sketch_group = inner_x_line(data, sketch_group, args)?; + Ok(MemoryItem::SketchGroup(new_sketch_group)) +} + +/// Draw a line on the x-axis. +#[stdlib { + name = "xLine", +}] +fn inner_x_line( + data: AxisLineData, + sketch_group: SketchGroup, + args: &mut Args, +) -> Result { let line_data = match data { - AxisLineData::PointWithTag { length, tag } => LineData::PointWithTag { + AxisLineData::LengthWithTag { length, tag } => LineData::PointWithTag { to: PointOrDefault::Point([length, 0.0]), tag, }, - AxisLineData::Point(length) => LineData::Point([length, 0.0]), + AxisLineData::Length(length) => LineData::Point([length, 0.0]), }; let new_sketch_group = inner_line(line_data, sketch_group, args)?; - Ok(MemoryItem::SketchGroup(new_sketch_group)) + Ok(new_sketch_group) } /// Draw a line on the y-axis. pub fn y_line(args: &mut Args) -> Result { let (data, sketch_group): (AxisLineData, SketchGroup) = args.get_data_and_sketch_group()?; - let line_data = match data { - AxisLineData::PointWithTag { length, tag } => LineData::PointWithTag { - to: PointOrDefault::Point([0.0, length]), - tag, - }, - AxisLineData::Point(length) => LineData::Point([0.0, length]), - }; - - let new_sketch_group = inner_line(line_data, sketch_group, args)?; + let new_sketch_group = inner_y_line(data, sketch_group, args)?; Ok(MemoryItem::SketchGroup(new_sketch_group)) } -#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, ts_rs::TS)] +/// Draw a line on the y-axis. +#[stdlib { + name = "yLine", +}] +fn inner_y_line( + data: AxisLineData, + sketch_group: SketchGroup, + args: &mut Args, +) -> Result { + let line_data = match data { + AxisLineData::LengthWithTag { length, tag } => LineData::PointWithTag { + to: PointOrDefault::Point([0.0, length]), + tag, + }, + AxisLineData::Length(length) => LineData::Point([0.0, length]), + }; + + let new_sketch_group = inner_line(line_data, sketch_group, args)?; + Ok(new_sketch_group) +} + +/// Data to draw an angled line. +#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, ts_rs::TS, JsonSchema)] #[ts(export)] #[serde(rename_all = "camelCase", untagged)] pub enum AngledLineData { + /// An angle and length with a tag. AngleWithTag { + /// The angle of the line. angle: f64, + /// The length of the line. length: f64, + /// The tag. tag: String, }, + /// An angle and length. AngleAndLength([f64; 2]), } @@ -251,6 +357,19 @@ pub enum AngledLineData { pub fn angled_line(args: &mut Args) -> Result { let (data, sketch_group): (AngledLineData, SketchGroup) = args.get_data_and_sketch_group()?; + let new_sketch_group = inner_angled_line(data, sketch_group, args)?; + Ok(MemoryItem::SketchGroup(new_sketch_group)) +} + +/// Draw an angled line. +#[stdlib { + name = "angledLine", +}] +fn inner_angled_line( + data: AngledLineData, + sketch_group: SketchGroup, + args: &mut Args, +) -> Result { let from = sketch_group.get_coords_from_paths()?; let (angle, length) = match &data { AngledLineData::AngleWithTag { angle, length, .. } => (*angle, *length), @@ -283,13 +402,26 @@ pub fn angled_line(args: &mut Args) -> Result { let mut new_sketch_group = sketch_group.clone(); new_sketch_group.value.push(current_path); - Ok(MemoryItem::SketchGroup(new_sketch_group)) + Ok(new_sketch_group) } /// Draw an angled line of a given x length. pub fn angled_line_of_x_length(args: &mut Args) -> Result { let (data, sketch_group): (AngledLineData, SketchGroup) = args.get_data_and_sketch_group()?; + let new_sketch_group = inner_angled_line_of_x_length(data, sketch_group, args)?; + Ok(MemoryItem::SketchGroup(new_sketch_group)) +} + +/// Draw an angled line of a given x length. +#[stdlib { + name = "angledLineOfXLength", +}] +fn inner_angled_line_of_x_length( + data: AngledLineData, + sketch_group: SketchGroup, + args: &mut Args, +) -> Result { let (angle, length) = match &data { AngledLineData::AngleWithTag { angle, length, .. } => (*angle, *length), AngledLineData::AngleAndLength(angle_and_length) => { @@ -312,14 +444,24 @@ pub fn angled_line_of_x_length(args: &mut Args) -> Result args, )?; - Ok(MemoryItem::SketchGroup(new_sketch_group)) + Ok(new_sketch_group) } -#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, ts_rs::TS)] +/// Data to draw an angled line to a point. +#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, ts_rs::TS, JsonSchema)] #[ts(export)] #[serde(rename_all = "camelCase", untagged)] pub enum AngledLineToData { - AngleWithTag { angle: f64, to: f64, tag: String }, + /// An angle and point with a tag. + AngleWithTag { + /// The angle of the line. + angle: f64, + /// The point to draw to. + to: f64, + /// The tag. + tag: String, + }, + /// An angle and point to draw to. AngleAndPoint([f64; 2]), } @@ -327,6 +469,19 @@ pub enum AngledLineToData { pub fn angled_line_to_x(args: &mut Args) -> Result { let (data, sketch_group): (AngledLineToData, SketchGroup) = args.get_data_and_sketch_group()?; + let new_sketch_group = inner_angled_line_to_x(data, sketch_group, args)?; + Ok(MemoryItem::SketchGroup(new_sketch_group)) +} + +/// Draw an angled line to a given x coordinate. +#[stdlib { + name = "angledLineToX", +}] +fn inner_angled_line_to_x( + data: AngledLineToData, + sketch_group: SketchGroup, + args: &mut Args, +) -> Result { let from = sketch_group.get_coords_from_paths()?; let (angle, x_to) = match &data { AngledLineToData::AngleWithTag { angle, to, .. } => (*angle, *to), @@ -349,13 +504,27 @@ pub fn angled_line_to_x(args: &mut Args) -> Result { sketch_group, args, )?; - Ok(MemoryItem::SketchGroup(new_sketch_group)) + Ok(new_sketch_group) } /// Draw an angled line of a given y length. pub fn angled_line_of_y_length(args: &mut Args) -> Result { let (data, sketch_group): (AngledLineData, SketchGroup) = args.get_data_and_sketch_group()?; + let new_sketch_group = inner_angled_line_of_y_length(data, sketch_group, args)?; + + Ok(MemoryItem::SketchGroup(new_sketch_group)) +} + +/// Draw an angled line of a given y length. +#[stdlib { + name = "angledLineOfYLength", +}] +fn inner_angled_line_of_y_length( + data: AngledLineData, + sketch_group: SketchGroup, + args: &mut Args, +) -> Result { let (angle, length) = match &data { AngledLineData::AngleWithTag { angle, length, .. } => (*angle, *length), AngledLineData::AngleAndLength(angle_and_length) => { @@ -378,13 +547,26 @@ pub fn angled_line_of_y_length(args: &mut Args) -> Result args, )?; - Ok(MemoryItem::SketchGroup(new_sketch_group)) + Ok(new_sketch_group) } /// Draw an angled line to a given y coordinate. pub fn angled_line_to_y(args: &mut Args) -> Result { let (data, sketch_group): (AngledLineToData, SketchGroup) = args.get_data_and_sketch_group()?; + let new_sketch_group = inner_angled_line_to_y(data, sketch_group, args)?; + Ok(MemoryItem::SketchGroup(new_sketch_group)) +} + +/// Draw an angled line to a given y coordinate. +#[stdlib { + name = "angledLineToY", +}] +fn inner_angled_line_to_y( + data: AngledLineToData, + sketch_group: SketchGroup, + args: &mut Args, +) -> Result { let from = sketch_group.get_coords_from_paths()?; let (angle, y_to) = match &data { AngledLineToData::AngleWithTag { angle, to, .. } => (*angle, *to), @@ -407,10 +589,11 @@ pub fn angled_line_to_y(args: &mut Args) -> Result { sketch_group, args, )?; - Ok(MemoryItem::SketchGroup(new_sketch_group)) + Ok(new_sketch_group) } -#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, ts_rs::TS)] +/// Data for drawing an angled line that intersects with a given line. +#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, ts_rs::TS, JsonSchema)] #[ts(export)] #[serde(rename_all = "camelCase")] // TODO: make sure the docs on the args below are correct. @@ -429,6 +612,19 @@ pub struct AngeledLineThatIntersectsData { pub fn angled_line_that_intersects(args: &mut Args) -> Result { let (data, sketch_group): (AngeledLineThatIntersectsData, SketchGroup) = args.get_data_and_sketch_group()?; + let new_sketch_group = inner_angled_line_that_intersects(data, sketch_group, args)?; + Ok(MemoryItem::SketchGroup(new_sketch_group)) +} + +/// Draw an angled line that intersects with a given line. +#[stdlib { + name = "angledLineThatIntersects", +}] +fn inner_angled_line_that_intersects( + data: AngeledLineThatIntersectsData, + sketch_group: SketchGroup, + args: &mut Args, +) -> Result { let intersect_path = sketch_group .get_path_by_name(&data.intersect_tag) .ok_or_else(|| { @@ -457,13 +653,22 @@ pub fn angled_line_that_intersects(args: &mut Args) -> Result Result { let data: LineData = args.get_data()?; + let sketch_group = inner_start_sketch_at(data, args)?; + Ok(MemoryItem::SketchGroup(sketch_group)) +} + +/// Start a sketch at a given point. +#[stdlib { + name = "startSketchAt", +}] +fn inner_start_sketch_at(data: LineData, args: &mut Args) -> Result { let default = [0.0, 0.0]; let to = match &data { LineData::PointWithTag { to, .. } => to.get_point_with_default(default), @@ -509,12 +714,23 @@ pub fn start_sketch_at(args: &mut Args) -> Result { start: current_path, meta: vec![args.source_range.into()], }; - Ok(MemoryItem::SketchGroup(sketch_group)) + Ok(sketch_group) } /// Close the current sketch. pub fn close(args: &mut Args) -> Result { let sketch_group = args.get_sketch_group()?; + + let new_sketch_group = inner_close(sketch_group, args)?; + + Ok(MemoryItem::SketchGroup(new_sketch_group)) +} + +/// Close the current sketch. +#[stdlib { + name = "close", +}] +fn inner_close(sketch_group: SketchGroup, args: &mut Args) -> Result { let from = sketch_group.get_coords_from_paths()?; let to: Point2d = sketch_group.start.from.into(); @@ -541,7 +757,7 @@ pub fn close(args: &mut Args) -> Result { }, }); - Ok(MemoryItem::SketchGroup(new_sketch_group)) + Ok(new_sketch_group) } #[cfg(test)]