diff --git a/docs/kcl/index.md b/docs/kcl/index.md index da2243646..75f3c19d4 100644 --- a/docs/kcl/index.md +++ b/docs/kcl/index.md @@ -74,10 +74,12 @@ layout: manual * [`patternTransform`](kcl/patternTransform) * [`pi`](kcl/pi) * [`polar`](kcl/polar) +* [`polygon`](kcl/polygon) * [`pow`](kcl/pow) * [`profileStart`](kcl/profileStart) * [`profileStartX`](kcl/profileStartX) * [`profileStartY`](kcl/profileStartY) +* [`push`](kcl/push) * [`reduce`](kcl/reduce) * [`rem`](kcl/rem) * [`revolve`](kcl/revolve) diff --git a/docs/kcl/polygon.md b/docs/kcl/polygon.md new file mode 100644 index 000000000..de75c3538 --- /dev/null +++ b/docs/kcl/polygon.md @@ -0,0 +1,60 @@ +--- +title: "polygon" +excerpt: "Create a regular polygon with the specified number of sides that is either inscribed or circumscribed around a circle of the specified radius." +layout: manual +--- + +Create a regular polygon with the specified number of sides that is either inscribed or circumscribed around a circle of the specified radius. + + + +```js +polygon(data: PolygonData, sketch_surface_or_group: SketchOrSurface, tag?: TagDeclarator) -> Sketch +``` + + +### Arguments + +| Name | Type | Description | Required | +|----------|------|-------------|----------| +| `data` | [`PolygonData`](/docs/kcl/types/PolygonData) | Data for drawing a polygon | Yes | +| `sketch_surface_or_group` | [`SketchOrSurface`](/docs/kcl/types/SketchOrSurface) | A sketch surface or a sketch. | Yes | +| `tag` | [`TagDeclarator`](/docs/kcl/types#tag-declaration) | | No | + +### Returns + +[`Sketch`](/docs/kcl/types/Sketch) - A sketch is a collection of paths. + + +### Examples + +```js +// Create a regular hexagon inscribed in a circle of radius 10 +hex = startSketchOn('XY') + |> polygon({ + radius: 10, + numSides: 6, + center: [0, 0], + inscribed: true + }, %) + +example = extrude(5, hex) +``` + + + +```js +// Create a square circumscribed around a circle of radius 5 +square = startSketchOn('XY') + |> polygon({ + radius: 5.0, + numSides: 4, + center: [10, 10], + inscribed: false + }, %) +example = extrude(5, square) +``` + + + + diff --git a/docs/kcl/push.md b/docs/kcl/push.md new file mode 100644 index 000000000..321786b07 --- /dev/null +++ b/docs/kcl/push.md @@ -0,0 +1,38 @@ +--- +title: "push" +excerpt: "Append an element to the end of an array." +layout: manual +--- + +Append an element to the end of an array. + +Returns a new array with the element appended. + +```js +push(array: [KclValue], elem: KclValue) -> KclValue +``` + + +### Arguments + +| Name | Type | Description | Required | +|----------|------|-------------|----------| +| `array` | [`[KclValue]`](/docs/kcl/types/KclValue) | | Yes | +| `elem` | [`KclValue`](/docs/kcl/types/KclValue) | Any KCL value. | Yes | + +### Returns + +[`KclValue`](/docs/kcl/types/KclValue) - Any KCL value. + + +### Examples + +```js +arr = [1, 2, 3] +new_arr = push(arr, 4) +assertEqual(new_arr[3], 4, 0.00001, "4 was added to the end of the array") +``` + + + + diff --git a/docs/kcl/std.json b/docs/kcl/std.json index 6dcf0a703..058d12394 100644 --- a/docs/kcl/std.json +++ b/docs/kcl/std.json @@ -119614,6 +119614,4104 @@ "exampleSketch = startSketchOn('XZ')\n |> startProfileAt([0, 0], %)\n |> line(polar({ angle: 30, length: 5 }), %, $thing)\n |> line([0, 5], %)\n |> line([segEndX(thing), 0], %)\n |> line([-20, 10], %)\n |> close(%)\n\nexample = extrude(5, exampleSketch)" ] }, + { + "name": "polygon", + "summary": "Create a regular polygon with the specified number of sides that is either inscribed or circumscribed around a circle of the specified radius.", + "description": "", + "tags": [], + "args": [ + { + "name": "data", + "type": "PolygonData", + "schema": { + "$schema": "https://spec.openapis.org/oas/3.0/schema/2019-04-02#/definitions/Schema", + "title": "PolygonData", + "description": "Data for drawing a polygon", + "type": "object", + "required": [ + "center", + "numSides", + "radius" + ], + "properties": { + "radius": { + "description": "The radius of the polygon", + "type": "number", + "format": "double" + }, + "numSides": { + "description": "The number of sides in the polygon", + "type": "integer", + "format": "uint64", + "minimum": 0.0 + }, + "center": { + "description": "The center point of the polygon", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "inscribed": { + "description": "Whether the polygon is inscribed (true) or circumscribed (false) about a circle with the specified radius", + "default": true, + "type": "boolean" + } + } + }, + "required": true + }, + { + "name": "sketch_surface_or_group", + "type": "SketchOrSurface", + "schema": { + "$schema": "https://spec.openapis.org/oas/3.0/schema/2019-04-02#/definitions/Schema", + "title": "SketchOrSurface", + "description": "A sketch surface or a sketch.", + "anyOf": [ + { + "$ref": "#/components/schemas/SketchSurface" + }, + { + "$ref": "#/components/schemas/Sketch" + } + ], + "definitions": { + "SketchSurface": { + "description": "A sketch type.", + "oneOf": [ + { + "description": "A plane.", + "type": "object", + "required": [ + "__meta", + "id", + "origin", + "type", + "value", + "xAxis", + "yAxis", + "zAxis" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "plane" + ] + }, + "id": { + "description": "The id of the plane.", + "type": "string", + "format": "uuid" + }, + "value": { + "$ref": "#/components/schemas/PlaneType" + }, + "origin": { + "description": "Origin of the plane.", + "allOf": [ + { + "$ref": "#/components/schemas/Point3d" + } + ] + }, + "xAxis": { + "description": "What should the plane’s X axis be?", + "allOf": [ + { + "$ref": "#/components/schemas/Point3d" + } + ] + }, + "yAxis": { + "description": "What should the plane’s Y axis be?", + "allOf": [ + { + "$ref": "#/components/schemas/Point3d" + } + ] + }, + "zAxis": { + "description": "The z-axis (normal).", + "allOf": [ + { + "$ref": "#/components/schemas/Point3d" + } + ] + }, + "__meta": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Metadata" + } + } + } + }, + { + "description": "A face.", + "type": "object", + "required": [ + "__meta", + "id", + "solid", + "type", + "value", + "xAxis", + "yAxis", + "zAxis" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "face" + ] + }, + "id": { + "description": "The id of the face.", + "type": "string", + "format": "uuid" + }, + "value": { + "description": "The tag of the face.", + "type": "string" + }, + "xAxis": { + "description": "What should the face’s X axis be?", + "allOf": [ + { + "$ref": "#/components/schemas/Point3d" + } + ] + }, + "yAxis": { + "description": "What should the face’s Y axis be?", + "allOf": [ + { + "$ref": "#/components/schemas/Point3d" + } + ] + }, + "zAxis": { + "description": "The z-axis (normal).", + "allOf": [ + { + "$ref": "#/components/schemas/Point3d" + } + ] + }, + "solid": { + "description": "The solid the face is on.", + "allOf": [ + { + "$ref": "#/components/schemas/Solid" + } + ] + }, + "__meta": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Metadata" + } + } + } + } + ] + }, + "PlaneType": { + "description": "Type for a plane.", + "oneOf": [ + { + "type": "string", + "enum": [ + "XY", + "XZ", + "YZ" + ] + }, + { + "description": "A custom plane.", + "type": "string", + "enum": [ + "Custom" + ] + } + ] + }, + "Point3d": { + "type": "object", + "required": [ + "x", + "y", + "z" + ], + "properties": { + "x": { + "type": "number", + "format": "double" + }, + "y": { + "type": "number", + "format": "double" + }, + "z": { + "type": "number", + "format": "double" + } + } + }, + "Metadata": { + "description": "Metadata.", + "type": "object", + "required": [ + "sourceRange" + ], + "properties": { + "sourceRange": { + "description": "The source range.", + "allOf": [ + { + "$ref": "#/components/schemas/SourceRange" + } + ] + } + } + }, + "SourceRange": { + "type": "array", + "items": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "maxItems": 2, + "minItems": 2 + }, + "Solid": { + "description": "An solid is a collection of extrude surfaces.", + "type": "object", + "required": [ + "__meta", + "height", + "id", + "sketch", + "value" + ], + "properties": { + "id": { + "description": "The id of the solid.", + "type": "string", + "format": "uuid" + }, + "value": { + "description": "The extrude surfaces.", + "type": "array", + "items": { + "$ref": "#/components/schemas/ExtrudeSurface" + } + }, + "sketch": { + "description": "The sketch.", + "allOf": [ + { + "$ref": "#/components/schemas/Sketch" + } + ] + }, + "height": { + "description": "The height of the solid.", + "type": "number", + "format": "double" + }, + "startCapId": { + "description": "The id of the extrusion start cap", + "type": "string", + "format": "uuid", + "nullable": true + }, + "endCapId": { + "description": "The id of the extrusion end cap", + "type": "string", + "format": "uuid", + "nullable": true + }, + "edgeCuts": { + "description": "Chamfers or fillets on this solid.", + "type": "array", + "items": { + "$ref": "#/components/schemas/EdgeCut" + } + }, + "__meta": { + "description": "Metadata.", + "type": "array", + "items": { + "$ref": "#/components/schemas/Metadata" + } + } + } + }, + "ExtrudeSurface": { + "description": "An extrude surface.", + "oneOf": [ + { + "description": "An extrude plane.", + "type": "object", + "required": [ + "faceId", + "id", + "sourceRange", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "extrudePlane" + ] + }, + "faceId": { + "description": "The face id for the extrude plane.", + "type": "string", + "format": "uuid" + }, + "tag": { + "description": "The tag.", + "allOf": [ + { + "$ref": "#/components/schemas/TagDeclarator" + } + ], + "nullable": true + }, + "id": { + "description": "The id of the geometry.", + "type": "string", + "format": "uuid" + }, + "sourceRange": { + "description": "The source range.", + "allOf": [ + { + "$ref": "#/components/schemas/SourceRange" + } + ] + } + } + }, + { + "description": "An extruded arc.", + "type": "object", + "required": [ + "faceId", + "id", + "sourceRange", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "extrudeArc" + ] + }, + "faceId": { + "description": "The face id for the extrude plane.", + "type": "string", + "format": "uuid" + }, + "tag": { + "description": "The tag.", + "allOf": [ + { + "$ref": "#/components/schemas/TagDeclarator" + } + ], + "nullable": true + }, + "id": { + "description": "The id of the geometry.", + "type": "string", + "format": "uuid" + }, + "sourceRange": { + "description": "The source range.", + "allOf": [ + { + "$ref": "#/components/schemas/SourceRange" + } + ] + } + } + }, + { + "description": "Geometry metadata.", + "type": "object", + "required": [ + "faceId", + "id", + "sourceRange", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "chamfer" + ] + }, + "faceId": { + "description": "The id for the chamfer surface.", + "type": "string", + "format": "uuid" + }, + "tag": { + "description": "The tag.", + "allOf": [ + { + "$ref": "#/components/schemas/TagDeclarator" + } + ], + "nullable": true + }, + "id": { + "description": "The id of the geometry.", + "type": "string", + "format": "uuid" + }, + "sourceRange": { + "description": "The source range.", + "allOf": [ + { + "$ref": "#/components/schemas/SourceRange" + } + ] + } + } + }, + { + "description": "Geometry metadata.", + "type": "object", + "required": [ + "faceId", + "id", + "sourceRange", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "fillet" + ] + }, + "faceId": { + "description": "The id for the fillet surface.", + "type": "string", + "format": "uuid" + }, + "tag": { + "description": "The tag.", + "allOf": [ + { + "$ref": "#/components/schemas/TagDeclarator" + } + ], + "nullable": true + }, + "id": { + "description": "The id of the geometry.", + "type": "string", + "format": "uuid" + }, + "sourceRange": { + "description": "The source range.", + "allOf": [ + { + "$ref": "#/components/schemas/SourceRange" + } + ] + } + } + } + ] + }, + "TagDeclarator": { + "type": "object", + "required": [ + "end", + "start", + "value" + ], + "properties": { + "start": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "end": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "value": { + "type": "string" + }, + "digest": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + }, + "maxItems": 32, + "minItems": 32, + "nullable": true + } + } + }, + "Sketch": { + "description": "A sketch is a collection of paths.", + "type": "object", + "required": [ + "__meta", + "id", + "on", + "paths", + "start" + ], + "properties": { + "id": { + "description": "The id of the sketch (this will change when the engine's reference to it changes).", + "type": "string", + "format": "uuid" + }, + "paths": { + "description": "The paths in the sketch.", + "type": "array", + "items": { + "$ref": "#/components/schemas/Path" + } + }, + "on": { + "description": "What the sketch is on (can be a plane or a face).", + "allOf": [ + { + "$ref": "#/components/schemas/SketchSurface" + } + ] + }, + "start": { + "description": "The starting path.", + "allOf": [ + { + "$ref": "#/components/schemas/BasePath" + } + ] + }, + "tags": { + "description": "Tag identifiers that have been declared in this sketch.", + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/TagIdentifier" + } + }, + "__meta": { + "description": "Metadata.", + "type": "array", + "items": { + "$ref": "#/components/schemas/Metadata" + } + } + } + }, + "Path": { + "description": "A path.", + "oneOf": [ + { + "description": "A path that goes to a point.", + "type": "object", + "required": [ + "__geoMeta", + "from", + "to", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "ToPoint" + ] + }, + "from": { + "description": "The from point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "to": { + "description": "The to point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "tag": { + "description": "The tag of the path.", + "allOf": [ + { + "$ref": "#/components/schemas/TagDeclarator" + } + ], + "nullable": true + }, + "__geoMeta": { + "description": "Metadata.", + "allOf": [ + { + "$ref": "#/components/schemas/GeoMeta" + } + ] + } + } + }, + { + "description": "A arc that is tangential to the last path segment that goes to a point", + "type": "object", + "required": [ + "__geoMeta", + "ccw", + "center", + "from", + "to", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "TangentialArcTo" + ] + }, + "center": { + "description": "the arc's center", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "ccw": { + "description": "arc's direction", + "type": "boolean" + }, + "from": { + "description": "The from point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "to": { + "description": "The to point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "tag": { + "description": "The tag of the path.", + "allOf": [ + { + "$ref": "#/components/schemas/TagDeclarator" + } + ], + "nullable": true + }, + "__geoMeta": { + "description": "Metadata.", + "allOf": [ + { + "$ref": "#/components/schemas/GeoMeta" + } + ] + } + } + }, + { + "description": "A arc that is tangential to the last path segment", + "type": "object", + "required": [ + "__geoMeta", + "ccw", + "center", + "from", + "to", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "TangentialArc" + ] + }, + "center": { + "description": "the arc's center", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "ccw": { + "description": "arc's direction", + "type": "boolean" + }, + "from": { + "description": "The from point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "to": { + "description": "The to point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "tag": { + "description": "The tag of the path.", + "allOf": [ + { + "$ref": "#/components/schemas/TagDeclarator" + } + ], + "nullable": true + }, + "__geoMeta": { + "description": "Metadata.", + "allOf": [ + { + "$ref": "#/components/schemas/GeoMeta" + } + ] + } + } + }, + { + "description": "a complete arc", + "type": "object", + "required": [ + "__geoMeta", + "ccw", + "center", + "from", + "radius", + "to", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "Circle" + ] + }, + "center": { + "description": "the arc's center", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "radius": { + "description": "the arc's radius", + "type": "number", + "format": "double" + }, + "ccw": { + "description": "arc's direction", + "type": "boolean" + }, + "from": { + "description": "The from point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "to": { + "description": "The to point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "tag": { + "description": "The tag of the path.", + "allOf": [ + { + "$ref": "#/components/schemas/TagDeclarator" + } + ], + "nullable": true + }, + "__geoMeta": { + "description": "Metadata.", + "allOf": [ + { + "$ref": "#/components/schemas/GeoMeta" + } + ] + } + } + }, + { + "description": "A path that is horizontal.", + "type": "object", + "required": [ + "__geoMeta", + "from", + "to", + "type", + "x" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "Horizontal" + ] + }, + "x": { + "description": "The x coordinate.", + "type": "number", + "format": "double" + }, + "from": { + "description": "The from point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "to": { + "description": "The to point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "tag": { + "description": "The tag of the path.", + "allOf": [ + { + "$ref": "#/components/schemas/TagDeclarator" + } + ], + "nullable": true + }, + "__geoMeta": { + "description": "Metadata.", + "allOf": [ + { + "$ref": "#/components/schemas/GeoMeta" + } + ] + } + } + }, + { + "description": "An angled line to.", + "type": "object", + "required": [ + "__geoMeta", + "from", + "to", + "type" + ], + "properties": { + "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 + }, + "from": { + "description": "The from point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "to": { + "description": "The to point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "tag": { + "description": "The tag of the path.", + "allOf": [ + { + "$ref": "#/components/schemas/TagDeclarator" + } + ], + "nullable": true + }, + "__geoMeta": { + "description": "Metadata.", + "allOf": [ + { + "$ref": "#/components/schemas/GeoMeta" + } + ] + } + } + }, + { + "description": "A base path.", + "type": "object", + "required": [ + "__geoMeta", + "from", + "to", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "Base" + ] + }, + "from": { + "description": "The from point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "to": { + "description": "The to point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "tag": { + "description": "The tag of the path.", + "allOf": [ + { + "$ref": "#/components/schemas/TagDeclarator" + } + ], + "nullable": true + }, + "__geoMeta": { + "description": "Metadata.", + "allOf": [ + { + "$ref": "#/components/schemas/GeoMeta" + } + ] + } + } + }, + { + "description": "A circular arc, not necessarily tangential to the current point.", + "type": "object", + "required": [ + "__geoMeta", + "center", + "from", + "radius", + "to", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "Arc" + ] + }, + "center": { + "description": "Center of the circle that this arc is drawn on.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "radius": { + "description": "Radius of the circle that this arc is drawn on.", + "type": "number", + "format": "double" + }, + "from": { + "description": "The from point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "to": { + "description": "The to point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "tag": { + "description": "The tag of the path.", + "allOf": [ + { + "$ref": "#/components/schemas/TagDeclarator" + } + ], + "nullable": true + }, + "__geoMeta": { + "description": "Metadata.", + "allOf": [ + { + "$ref": "#/components/schemas/GeoMeta" + } + ] + } + } + } + ] + }, + "GeoMeta": { + "description": "Geometry metadata.", + "type": "object", + "required": [ + "id", + "sourceRange" + ], + "properties": { + "id": { + "description": "The id of the geometry.", + "type": "string", + "format": "uuid" + }, + "sourceRange": { + "description": "The source range.", + "allOf": [ + { + "$ref": "#/components/schemas/SourceRange" + } + ] + } + } + }, + "BasePath": { + "description": "A base path.", + "type": "object", + "required": [ + "__geoMeta", + "from", + "to" + ], + "properties": { + "from": { + "description": "The from point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "to": { + "description": "The to point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "tag": { + "description": "The tag of the path.", + "allOf": [ + { + "$ref": "#/components/schemas/TagDeclarator" + } + ], + "nullable": true + }, + "__geoMeta": { + "description": "Metadata.", + "allOf": [ + { + "$ref": "#/components/schemas/GeoMeta" + } + ] + } + } + }, + "TagIdentifier": { + "type": "object", + "required": [ + "__meta", + "value" + ], + "properties": { + "value": { + "type": "string" + }, + "info": { + "allOf": [ + { + "$ref": "#/components/schemas/TagEngineInfo" + } + ], + "nullable": true + }, + "__meta": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Metadata" + } + } + } + }, + "TagEngineInfo": { + "description": "Engine information for a tag.", + "type": "object", + "oneOf": [ + { + "description": "The path the tag is on.", + "type": "object", + "required": [ + "path" + ], + "properties": { + "path": { + "$ref": "#/components/schemas/Path" + } + }, + "additionalProperties": false + }, + { + "description": "The surface information for the tag.", + "type": "object", + "required": [ + "surface" + ], + "properties": { + "surface": { + "$ref": "#/components/schemas/ExtrudeSurface" + } + }, + "additionalProperties": false + } + ], + "required": [ + "id", + "sketch" + ], + "properties": { + "id": { + "description": "The id of the tagged object.", + "type": "string", + "format": "uuid" + }, + "sketch": { + "description": "The sketch the tag is on.", + "type": "string", + "format": "uuid" + } + } + }, + "EdgeCut": { + "description": "A fillet or a chamfer.", + "oneOf": [ + { + "description": "A fillet.", + "type": "object", + "required": [ + "edgeId", + "id", + "radius", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "fillet" + ] + }, + "id": { + "description": "The id of the engine command that called this fillet.", + "type": "string", + "format": "uuid" + }, + "radius": { + "type": "number", + "format": "double" + }, + "edgeId": { + "description": "The engine id of the edge to fillet.", + "type": "string", + "format": "uuid" + }, + "tag": { + "allOf": [ + { + "$ref": "#/components/schemas/TagDeclarator" + } + ], + "nullable": true + } + } + }, + { + "description": "A chamfer.", + "type": "object", + "required": [ + "edgeId", + "id", + "length", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "chamfer" + ] + }, + "id": { + "description": "The id of the engine command that called this chamfer.", + "type": "string", + "format": "uuid" + }, + "length": { + "type": "number", + "format": "double" + }, + "edgeId": { + "description": "The engine id of the edge to chamfer.", + "type": "string", + "format": "uuid" + }, + "tag": { + "allOf": [ + { + "$ref": "#/components/schemas/TagDeclarator" + } + ], + "nullable": true + } + } + } + ] + } + } + }, + "required": true + }, + { + "name": "tag", + "type": "TagDeclarator", + "schema": { + "$schema": "https://spec.openapis.org/oas/3.0/schema/2019-04-02#/definitions/Schema", + "title": "Nullable_TagDeclarator", + "allOf": [ + { + "$ref": "#/components/schemas/TagDeclarator" + } + ], + "nullable": true, + "definitions": { + "SketchSurface": { + "description": "A sketch type.", + "oneOf": [ + { + "description": "A plane.", + "type": "object", + "required": [ + "__meta", + "id", + "origin", + "type", + "value", + "xAxis", + "yAxis", + "zAxis" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "plane" + ] + }, + "id": { + "description": "The id of the plane.", + "type": "string", + "format": "uuid" + }, + "value": { + "$ref": "#/components/schemas/PlaneType" + }, + "origin": { + "description": "Origin of the plane.", + "allOf": [ + { + "$ref": "#/components/schemas/Point3d" + } + ] + }, + "xAxis": { + "description": "What should the plane’s X axis be?", + "allOf": [ + { + "$ref": "#/components/schemas/Point3d" + } + ] + }, + "yAxis": { + "description": "What should the plane’s Y axis be?", + "allOf": [ + { + "$ref": "#/components/schemas/Point3d" + } + ] + }, + "zAxis": { + "description": "The z-axis (normal).", + "allOf": [ + { + "$ref": "#/components/schemas/Point3d" + } + ] + }, + "__meta": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Metadata" + } + } + } + }, + { + "description": "A face.", + "type": "object", + "required": [ + "__meta", + "id", + "solid", + "type", + "value", + "xAxis", + "yAxis", + "zAxis" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "face" + ] + }, + "id": { + "description": "The id of the face.", + "type": "string", + "format": "uuid" + }, + "value": { + "description": "The tag of the face.", + "type": "string" + }, + "xAxis": { + "description": "What should the face’s X axis be?", + "allOf": [ + { + "$ref": "#/components/schemas/Point3d" + } + ] + }, + "yAxis": { + "description": "What should the face’s Y axis be?", + "allOf": [ + { + "$ref": "#/components/schemas/Point3d" + } + ] + }, + "zAxis": { + "description": "The z-axis (normal).", + "allOf": [ + { + "$ref": "#/components/schemas/Point3d" + } + ] + }, + "solid": { + "description": "The solid the face is on.", + "allOf": [ + { + "$ref": "#/components/schemas/Solid" + } + ] + }, + "__meta": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Metadata" + } + } + } + } + ] + }, + "PlaneType": { + "description": "Type for a plane.", + "oneOf": [ + { + "type": "string", + "enum": [ + "XY", + "XZ", + "YZ" + ] + }, + { + "description": "A custom plane.", + "type": "string", + "enum": [ + "Custom" + ] + } + ] + }, + "Point3d": { + "type": "object", + "required": [ + "x", + "y", + "z" + ], + "properties": { + "x": { + "type": "number", + "format": "double" + }, + "y": { + "type": "number", + "format": "double" + }, + "z": { + "type": "number", + "format": "double" + } + } + }, + "Metadata": { + "description": "Metadata.", + "type": "object", + "required": [ + "sourceRange" + ], + "properties": { + "sourceRange": { + "description": "The source range.", + "allOf": [ + { + "$ref": "#/components/schemas/SourceRange" + } + ] + } + } + }, + "SourceRange": { + "type": "array", + "items": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "maxItems": 2, + "minItems": 2 + }, + "Solid": { + "description": "An solid is a collection of extrude surfaces.", + "type": "object", + "required": [ + "__meta", + "height", + "id", + "sketch", + "value" + ], + "properties": { + "id": { + "description": "The id of the solid.", + "type": "string", + "format": "uuid" + }, + "value": { + "description": "The extrude surfaces.", + "type": "array", + "items": { + "$ref": "#/components/schemas/ExtrudeSurface" + } + }, + "sketch": { + "description": "The sketch.", + "allOf": [ + { + "$ref": "#/components/schemas/Sketch" + } + ] + }, + "height": { + "description": "The height of the solid.", + "type": "number", + "format": "double" + }, + "startCapId": { + "description": "The id of the extrusion start cap", + "type": "string", + "format": "uuid", + "nullable": true + }, + "endCapId": { + "description": "The id of the extrusion end cap", + "type": "string", + "format": "uuid", + "nullable": true + }, + "edgeCuts": { + "description": "Chamfers or fillets on this solid.", + "type": "array", + "items": { + "$ref": "#/components/schemas/EdgeCut" + } + }, + "__meta": { + "description": "Metadata.", + "type": "array", + "items": { + "$ref": "#/components/schemas/Metadata" + } + } + } + }, + "ExtrudeSurface": { + "description": "An extrude surface.", + "oneOf": [ + { + "description": "An extrude plane.", + "type": "object", + "required": [ + "faceId", + "id", + "sourceRange", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "extrudePlane" + ] + }, + "faceId": { + "description": "The face id for the extrude plane.", + "type": "string", + "format": "uuid" + }, + "tag": { + "description": "The tag.", + "allOf": [ + { + "$ref": "#/components/schemas/TagDeclarator" + } + ], + "nullable": true + }, + "id": { + "description": "The id of the geometry.", + "type": "string", + "format": "uuid" + }, + "sourceRange": { + "description": "The source range.", + "allOf": [ + { + "$ref": "#/components/schemas/SourceRange" + } + ] + } + } + }, + { + "description": "An extruded arc.", + "type": "object", + "required": [ + "faceId", + "id", + "sourceRange", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "extrudeArc" + ] + }, + "faceId": { + "description": "The face id for the extrude plane.", + "type": "string", + "format": "uuid" + }, + "tag": { + "description": "The tag.", + "allOf": [ + { + "$ref": "#/components/schemas/TagDeclarator" + } + ], + "nullable": true + }, + "id": { + "description": "The id of the geometry.", + "type": "string", + "format": "uuid" + }, + "sourceRange": { + "description": "The source range.", + "allOf": [ + { + "$ref": "#/components/schemas/SourceRange" + } + ] + } + } + }, + { + "description": "Geometry metadata.", + "type": "object", + "required": [ + "faceId", + "id", + "sourceRange", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "chamfer" + ] + }, + "faceId": { + "description": "The id for the chamfer surface.", + "type": "string", + "format": "uuid" + }, + "tag": { + "description": "The tag.", + "allOf": [ + { + "$ref": "#/components/schemas/TagDeclarator" + } + ], + "nullable": true + }, + "id": { + "description": "The id of the geometry.", + "type": "string", + "format": "uuid" + }, + "sourceRange": { + "description": "The source range.", + "allOf": [ + { + "$ref": "#/components/schemas/SourceRange" + } + ] + } + } + }, + { + "description": "Geometry metadata.", + "type": "object", + "required": [ + "faceId", + "id", + "sourceRange", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "fillet" + ] + }, + "faceId": { + "description": "The id for the fillet surface.", + "type": "string", + "format": "uuid" + }, + "tag": { + "description": "The tag.", + "allOf": [ + { + "$ref": "#/components/schemas/TagDeclarator" + } + ], + "nullable": true + }, + "id": { + "description": "The id of the geometry.", + "type": "string", + "format": "uuid" + }, + "sourceRange": { + "description": "The source range.", + "allOf": [ + { + "$ref": "#/components/schemas/SourceRange" + } + ] + } + } + } + ] + }, + "TagDeclarator": { + "type": "object", + "required": [ + "end", + "start", + "value" + ], + "properties": { + "start": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "end": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "value": { + "type": "string" + }, + "digest": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + }, + "maxItems": 32, + "minItems": 32, + "nullable": true + } + } + }, + "Sketch": { + "description": "A sketch is a collection of paths.", + "type": "object", + "required": [ + "__meta", + "id", + "on", + "paths", + "start" + ], + "properties": { + "id": { + "description": "The id of the sketch (this will change when the engine's reference to it changes).", + "type": "string", + "format": "uuid" + }, + "paths": { + "description": "The paths in the sketch.", + "type": "array", + "items": { + "$ref": "#/components/schemas/Path" + } + }, + "on": { + "description": "What the sketch is on (can be a plane or a face).", + "allOf": [ + { + "$ref": "#/components/schemas/SketchSurface" + } + ] + }, + "start": { + "description": "The starting path.", + "allOf": [ + { + "$ref": "#/components/schemas/BasePath" + } + ] + }, + "tags": { + "description": "Tag identifiers that have been declared in this sketch.", + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/TagIdentifier" + } + }, + "__meta": { + "description": "Metadata.", + "type": "array", + "items": { + "$ref": "#/components/schemas/Metadata" + } + } + } + }, + "Path": { + "description": "A path.", + "oneOf": [ + { + "description": "A path that goes to a point.", + "type": "object", + "required": [ + "__geoMeta", + "from", + "to", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "ToPoint" + ] + }, + "from": { + "description": "The from point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "to": { + "description": "The to point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "tag": { + "description": "The tag of the path.", + "allOf": [ + { + "$ref": "#/components/schemas/TagDeclarator" + } + ], + "nullable": true + }, + "__geoMeta": { + "description": "Metadata.", + "allOf": [ + { + "$ref": "#/components/schemas/GeoMeta" + } + ] + } + } + }, + { + "description": "A arc that is tangential to the last path segment that goes to a point", + "type": "object", + "required": [ + "__geoMeta", + "ccw", + "center", + "from", + "to", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "TangentialArcTo" + ] + }, + "center": { + "description": "the arc's center", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "ccw": { + "description": "arc's direction", + "type": "boolean" + }, + "from": { + "description": "The from point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "to": { + "description": "The to point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "tag": { + "description": "The tag of the path.", + "allOf": [ + { + "$ref": "#/components/schemas/TagDeclarator" + } + ], + "nullable": true + }, + "__geoMeta": { + "description": "Metadata.", + "allOf": [ + { + "$ref": "#/components/schemas/GeoMeta" + } + ] + } + } + }, + { + "description": "A arc that is tangential to the last path segment", + "type": "object", + "required": [ + "__geoMeta", + "ccw", + "center", + "from", + "to", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "TangentialArc" + ] + }, + "center": { + "description": "the arc's center", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "ccw": { + "description": "arc's direction", + "type": "boolean" + }, + "from": { + "description": "The from point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "to": { + "description": "The to point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "tag": { + "description": "The tag of the path.", + "allOf": [ + { + "$ref": "#/components/schemas/TagDeclarator" + } + ], + "nullable": true + }, + "__geoMeta": { + "description": "Metadata.", + "allOf": [ + { + "$ref": "#/components/schemas/GeoMeta" + } + ] + } + } + }, + { + "description": "a complete arc", + "type": "object", + "required": [ + "__geoMeta", + "ccw", + "center", + "from", + "radius", + "to", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "Circle" + ] + }, + "center": { + "description": "the arc's center", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "radius": { + "description": "the arc's radius", + "type": "number", + "format": "double" + }, + "ccw": { + "description": "arc's direction", + "type": "boolean" + }, + "from": { + "description": "The from point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "to": { + "description": "The to point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "tag": { + "description": "The tag of the path.", + "allOf": [ + { + "$ref": "#/components/schemas/TagDeclarator" + } + ], + "nullable": true + }, + "__geoMeta": { + "description": "Metadata.", + "allOf": [ + { + "$ref": "#/components/schemas/GeoMeta" + } + ] + } + } + }, + { + "description": "A path that is horizontal.", + "type": "object", + "required": [ + "__geoMeta", + "from", + "to", + "type", + "x" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "Horizontal" + ] + }, + "x": { + "description": "The x coordinate.", + "type": "number", + "format": "double" + }, + "from": { + "description": "The from point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "to": { + "description": "The to point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "tag": { + "description": "The tag of the path.", + "allOf": [ + { + "$ref": "#/components/schemas/TagDeclarator" + } + ], + "nullable": true + }, + "__geoMeta": { + "description": "Metadata.", + "allOf": [ + { + "$ref": "#/components/schemas/GeoMeta" + } + ] + } + } + }, + { + "description": "An angled line to.", + "type": "object", + "required": [ + "__geoMeta", + "from", + "to", + "type" + ], + "properties": { + "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 + }, + "from": { + "description": "The from point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "to": { + "description": "The to point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "tag": { + "description": "The tag of the path.", + "allOf": [ + { + "$ref": "#/components/schemas/TagDeclarator" + } + ], + "nullable": true + }, + "__geoMeta": { + "description": "Metadata.", + "allOf": [ + { + "$ref": "#/components/schemas/GeoMeta" + } + ] + } + } + }, + { + "description": "A base path.", + "type": "object", + "required": [ + "__geoMeta", + "from", + "to", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "Base" + ] + }, + "from": { + "description": "The from point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "to": { + "description": "The to point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "tag": { + "description": "The tag of the path.", + "allOf": [ + { + "$ref": "#/components/schemas/TagDeclarator" + } + ], + "nullable": true + }, + "__geoMeta": { + "description": "Metadata.", + "allOf": [ + { + "$ref": "#/components/schemas/GeoMeta" + } + ] + } + } + }, + { + "description": "A circular arc, not necessarily tangential to the current point.", + "type": "object", + "required": [ + "__geoMeta", + "center", + "from", + "radius", + "to", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "Arc" + ] + }, + "center": { + "description": "Center of the circle that this arc is drawn on.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "radius": { + "description": "Radius of the circle that this arc is drawn on.", + "type": "number", + "format": "double" + }, + "from": { + "description": "The from point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "to": { + "description": "The to point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "tag": { + "description": "The tag of the path.", + "allOf": [ + { + "$ref": "#/components/schemas/TagDeclarator" + } + ], + "nullable": true + }, + "__geoMeta": { + "description": "Metadata.", + "allOf": [ + { + "$ref": "#/components/schemas/GeoMeta" + } + ] + } + } + } + ] + }, + "GeoMeta": { + "description": "Geometry metadata.", + "type": "object", + "required": [ + "id", + "sourceRange" + ], + "properties": { + "id": { + "description": "The id of the geometry.", + "type": "string", + "format": "uuid" + }, + "sourceRange": { + "description": "The source range.", + "allOf": [ + { + "$ref": "#/components/schemas/SourceRange" + } + ] + } + } + }, + "BasePath": { + "description": "A base path.", + "type": "object", + "required": [ + "__geoMeta", + "from", + "to" + ], + "properties": { + "from": { + "description": "The from point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "to": { + "description": "The to point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "tag": { + "description": "The tag of the path.", + "allOf": [ + { + "$ref": "#/components/schemas/TagDeclarator" + } + ], + "nullable": true + }, + "__geoMeta": { + "description": "Metadata.", + "allOf": [ + { + "$ref": "#/components/schemas/GeoMeta" + } + ] + } + } + }, + "TagIdentifier": { + "type": "object", + "required": [ + "__meta", + "value" + ], + "properties": { + "value": { + "type": "string" + }, + "info": { + "allOf": [ + { + "$ref": "#/components/schemas/TagEngineInfo" + } + ], + "nullable": true + }, + "__meta": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Metadata" + } + } + } + }, + "TagEngineInfo": { + "description": "Engine information for a tag.", + "type": "object", + "oneOf": [ + { + "description": "The path the tag is on.", + "type": "object", + "required": [ + "path" + ], + "properties": { + "path": { + "$ref": "#/components/schemas/Path" + } + }, + "additionalProperties": false + }, + { + "description": "The surface information for the tag.", + "type": "object", + "required": [ + "surface" + ], + "properties": { + "surface": { + "$ref": "#/components/schemas/ExtrudeSurface" + } + }, + "additionalProperties": false + } + ], + "required": [ + "id", + "sketch" + ], + "properties": { + "id": { + "description": "The id of the tagged object.", + "type": "string", + "format": "uuid" + }, + "sketch": { + "description": "The sketch the tag is on.", + "type": "string", + "format": "uuid" + } + } + }, + "EdgeCut": { + "description": "A fillet or a chamfer.", + "oneOf": [ + { + "description": "A fillet.", + "type": "object", + "required": [ + "edgeId", + "id", + "radius", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "fillet" + ] + }, + "id": { + "description": "The id of the engine command that called this fillet.", + "type": "string", + "format": "uuid" + }, + "radius": { + "type": "number", + "format": "double" + }, + "edgeId": { + "description": "The engine id of the edge to fillet.", + "type": "string", + "format": "uuid" + }, + "tag": { + "allOf": [ + { + "$ref": "#/components/schemas/TagDeclarator" + } + ], + "nullable": true + } + } + }, + { + "description": "A chamfer.", + "type": "object", + "required": [ + "edgeId", + "id", + "length", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "chamfer" + ] + }, + "id": { + "description": "The id of the engine command that called this chamfer.", + "type": "string", + "format": "uuid" + }, + "length": { + "type": "number", + "format": "double" + }, + "edgeId": { + "description": "The engine id of the edge to chamfer.", + "type": "string", + "format": "uuid" + }, + "tag": { + "allOf": [ + { + "$ref": "#/components/schemas/TagDeclarator" + } + ], + "nullable": true + } + } + } + ] + } + } + }, + "required": false + } + ], + "returnValue": { + "name": "", + "type": "Sketch", + "schema": { + "$schema": "https://spec.openapis.org/oas/3.0/schema/2019-04-02#/definitions/Schema", + "title": "Sketch", + "description": "A sketch is a collection of paths.", + "type": "object", + "required": [ + "__meta", + "id", + "on", + "paths", + "start" + ], + "properties": { + "id": { + "description": "The id of the sketch (this will change when the engine's reference to it changes).", + "type": "string", + "format": "uuid" + }, + "paths": { + "description": "The paths in the sketch.", + "type": "array", + "items": { + "$ref": "#/components/schemas/Path" + } + }, + "on": { + "description": "What the sketch is on (can be a plane or a face).", + "allOf": [ + { + "$ref": "#/components/schemas/SketchSurface" + } + ] + }, + "start": { + "description": "The starting path.", + "allOf": [ + { + "$ref": "#/components/schemas/BasePath" + } + ] + }, + "tags": { + "description": "Tag identifiers that have been declared in this sketch.", + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/TagIdentifier" + } + }, + "__meta": { + "description": "Metadata.", + "type": "array", + "items": { + "$ref": "#/components/schemas/Metadata" + } + } + }, + "definitions": { + "Path": { + "description": "A path.", + "oneOf": [ + { + "description": "A path that goes to a point.", + "type": "object", + "required": [ + "__geoMeta", + "from", + "to", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "ToPoint" + ] + }, + "from": { + "description": "The from point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "to": { + "description": "The to point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "tag": { + "description": "The tag of the path.", + "allOf": [ + { + "$ref": "#/components/schemas/TagDeclarator" + } + ], + "nullable": true + }, + "__geoMeta": { + "description": "Metadata.", + "allOf": [ + { + "$ref": "#/components/schemas/GeoMeta" + } + ] + } + } + }, + { + "description": "A arc that is tangential to the last path segment that goes to a point", + "type": "object", + "required": [ + "__geoMeta", + "ccw", + "center", + "from", + "to", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "TangentialArcTo" + ] + }, + "center": { + "description": "the arc's center", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "ccw": { + "description": "arc's direction", + "type": "boolean" + }, + "from": { + "description": "The from point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "to": { + "description": "The to point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "tag": { + "description": "The tag of the path.", + "allOf": [ + { + "$ref": "#/components/schemas/TagDeclarator" + } + ], + "nullable": true + }, + "__geoMeta": { + "description": "Metadata.", + "allOf": [ + { + "$ref": "#/components/schemas/GeoMeta" + } + ] + } + } + }, + { + "description": "A arc that is tangential to the last path segment", + "type": "object", + "required": [ + "__geoMeta", + "ccw", + "center", + "from", + "to", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "TangentialArc" + ] + }, + "center": { + "description": "the arc's center", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "ccw": { + "description": "arc's direction", + "type": "boolean" + }, + "from": { + "description": "The from point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "to": { + "description": "The to point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "tag": { + "description": "The tag of the path.", + "allOf": [ + { + "$ref": "#/components/schemas/TagDeclarator" + } + ], + "nullable": true + }, + "__geoMeta": { + "description": "Metadata.", + "allOf": [ + { + "$ref": "#/components/schemas/GeoMeta" + } + ] + } + } + }, + { + "description": "a complete arc", + "type": "object", + "required": [ + "__geoMeta", + "ccw", + "center", + "from", + "radius", + "to", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "Circle" + ] + }, + "center": { + "description": "the arc's center", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "radius": { + "description": "the arc's radius", + "type": "number", + "format": "double" + }, + "ccw": { + "description": "arc's direction", + "type": "boolean" + }, + "from": { + "description": "The from point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "to": { + "description": "The to point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "tag": { + "description": "The tag of the path.", + "allOf": [ + { + "$ref": "#/components/schemas/TagDeclarator" + } + ], + "nullable": true + }, + "__geoMeta": { + "description": "Metadata.", + "allOf": [ + { + "$ref": "#/components/schemas/GeoMeta" + } + ] + } + } + }, + { + "description": "A path that is horizontal.", + "type": "object", + "required": [ + "__geoMeta", + "from", + "to", + "type", + "x" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "Horizontal" + ] + }, + "x": { + "description": "The x coordinate.", + "type": "number", + "format": "double" + }, + "from": { + "description": "The from point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "to": { + "description": "The to point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "tag": { + "description": "The tag of the path.", + "allOf": [ + { + "$ref": "#/components/schemas/TagDeclarator" + } + ], + "nullable": true + }, + "__geoMeta": { + "description": "Metadata.", + "allOf": [ + { + "$ref": "#/components/schemas/GeoMeta" + } + ] + } + } + }, + { + "description": "An angled line to.", + "type": "object", + "required": [ + "__geoMeta", + "from", + "to", + "type" + ], + "properties": { + "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 + }, + "from": { + "description": "The from point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "to": { + "description": "The to point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "tag": { + "description": "The tag of the path.", + "allOf": [ + { + "$ref": "#/components/schemas/TagDeclarator" + } + ], + "nullable": true + }, + "__geoMeta": { + "description": "Metadata.", + "allOf": [ + { + "$ref": "#/components/schemas/GeoMeta" + } + ] + } + } + }, + { + "description": "A base path.", + "type": "object", + "required": [ + "__geoMeta", + "from", + "to", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "Base" + ] + }, + "from": { + "description": "The from point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "to": { + "description": "The to point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "tag": { + "description": "The tag of the path.", + "allOf": [ + { + "$ref": "#/components/schemas/TagDeclarator" + } + ], + "nullable": true + }, + "__geoMeta": { + "description": "Metadata.", + "allOf": [ + { + "$ref": "#/components/schemas/GeoMeta" + } + ] + } + } + }, + { + "description": "A circular arc, not necessarily tangential to the current point.", + "type": "object", + "required": [ + "__geoMeta", + "center", + "from", + "radius", + "to", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "Arc" + ] + }, + "center": { + "description": "Center of the circle that this arc is drawn on.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "radius": { + "description": "Radius of the circle that this arc is drawn on.", + "type": "number", + "format": "double" + }, + "from": { + "description": "The from point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "to": { + "description": "The to point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "tag": { + "description": "The tag of the path.", + "allOf": [ + { + "$ref": "#/components/schemas/TagDeclarator" + } + ], + "nullable": true + }, + "__geoMeta": { + "description": "Metadata.", + "allOf": [ + { + "$ref": "#/components/schemas/GeoMeta" + } + ] + } + } + } + ] + }, + "TagDeclarator": { + "type": "object", + "required": [ + "end", + "start", + "value" + ], + "properties": { + "start": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "end": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "value": { + "type": "string" + }, + "digest": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + }, + "maxItems": 32, + "minItems": 32, + "nullable": true + } + } + }, + "GeoMeta": { + "description": "Geometry metadata.", + "type": "object", + "required": [ + "id", + "sourceRange" + ], + "properties": { + "id": { + "description": "The id of the geometry.", + "type": "string", + "format": "uuid" + }, + "sourceRange": { + "description": "The source range.", + "allOf": [ + { + "$ref": "#/components/schemas/SourceRange" + } + ] + } + } + }, + "SourceRange": { + "type": "array", + "items": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "maxItems": 2, + "minItems": 2 + }, + "SketchSurface": { + "description": "A sketch type.", + "oneOf": [ + { + "description": "A plane.", + "type": "object", + "required": [ + "__meta", + "id", + "origin", + "type", + "value", + "xAxis", + "yAxis", + "zAxis" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "plane" + ] + }, + "id": { + "description": "The id of the plane.", + "type": "string", + "format": "uuid" + }, + "value": { + "$ref": "#/components/schemas/PlaneType" + }, + "origin": { + "description": "Origin of the plane.", + "allOf": [ + { + "$ref": "#/components/schemas/Point3d" + } + ] + }, + "xAxis": { + "description": "What should the plane’s X axis be?", + "allOf": [ + { + "$ref": "#/components/schemas/Point3d" + } + ] + }, + "yAxis": { + "description": "What should the plane’s Y axis be?", + "allOf": [ + { + "$ref": "#/components/schemas/Point3d" + } + ] + }, + "zAxis": { + "description": "The z-axis (normal).", + "allOf": [ + { + "$ref": "#/components/schemas/Point3d" + } + ] + }, + "__meta": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Metadata" + } + } + } + }, + { + "description": "A face.", + "type": "object", + "required": [ + "__meta", + "id", + "solid", + "type", + "value", + "xAxis", + "yAxis", + "zAxis" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "face" + ] + }, + "id": { + "description": "The id of the face.", + "type": "string", + "format": "uuid" + }, + "value": { + "description": "The tag of the face.", + "type": "string" + }, + "xAxis": { + "description": "What should the face’s X axis be?", + "allOf": [ + { + "$ref": "#/components/schemas/Point3d" + } + ] + }, + "yAxis": { + "description": "What should the face’s Y axis be?", + "allOf": [ + { + "$ref": "#/components/schemas/Point3d" + } + ] + }, + "zAxis": { + "description": "The z-axis (normal).", + "allOf": [ + { + "$ref": "#/components/schemas/Point3d" + } + ] + }, + "solid": { + "description": "The solid the face is on.", + "allOf": [ + { + "$ref": "#/components/schemas/Solid" + } + ] + }, + "__meta": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Metadata" + } + } + } + } + ] + }, + "PlaneType": { + "description": "Type for a plane.", + "oneOf": [ + { + "type": "string", + "enum": [ + "XY", + "XZ", + "YZ" + ] + }, + { + "description": "A custom plane.", + "type": "string", + "enum": [ + "Custom" + ] + } + ] + }, + "Point3d": { + "type": "object", + "required": [ + "x", + "y", + "z" + ], + "properties": { + "x": { + "type": "number", + "format": "double" + }, + "y": { + "type": "number", + "format": "double" + }, + "z": { + "type": "number", + "format": "double" + } + } + }, + "Metadata": { + "description": "Metadata.", + "type": "object", + "required": [ + "sourceRange" + ], + "properties": { + "sourceRange": { + "description": "The source range.", + "allOf": [ + { + "$ref": "#/components/schemas/SourceRange" + } + ] + } + } + }, + "Solid": { + "description": "An solid is a collection of extrude surfaces.", + "type": "object", + "required": [ + "__meta", + "height", + "id", + "sketch", + "value" + ], + "properties": { + "id": { + "description": "The id of the solid.", + "type": "string", + "format": "uuid" + }, + "value": { + "description": "The extrude surfaces.", + "type": "array", + "items": { + "$ref": "#/components/schemas/ExtrudeSurface" + } + }, + "sketch": { + "description": "The sketch.", + "allOf": [ + { + "$ref": "#/components/schemas/Sketch" + } + ] + }, + "height": { + "description": "The height of the solid.", + "type": "number", + "format": "double" + }, + "startCapId": { + "description": "The id of the extrusion start cap", + "type": "string", + "format": "uuid", + "nullable": true + }, + "endCapId": { + "description": "The id of the extrusion end cap", + "type": "string", + "format": "uuid", + "nullable": true + }, + "edgeCuts": { + "description": "Chamfers or fillets on this solid.", + "type": "array", + "items": { + "$ref": "#/components/schemas/EdgeCut" + } + }, + "__meta": { + "description": "Metadata.", + "type": "array", + "items": { + "$ref": "#/components/schemas/Metadata" + } + } + } + }, + "ExtrudeSurface": { + "description": "An extrude surface.", + "oneOf": [ + { + "description": "An extrude plane.", + "type": "object", + "required": [ + "faceId", + "id", + "sourceRange", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "extrudePlane" + ] + }, + "faceId": { + "description": "The face id for the extrude plane.", + "type": "string", + "format": "uuid" + }, + "tag": { + "description": "The tag.", + "allOf": [ + { + "$ref": "#/components/schemas/TagDeclarator" + } + ], + "nullable": true + }, + "id": { + "description": "The id of the geometry.", + "type": "string", + "format": "uuid" + }, + "sourceRange": { + "description": "The source range.", + "allOf": [ + { + "$ref": "#/components/schemas/SourceRange" + } + ] + } + } + }, + { + "description": "An extruded arc.", + "type": "object", + "required": [ + "faceId", + "id", + "sourceRange", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "extrudeArc" + ] + }, + "faceId": { + "description": "The face id for the extrude plane.", + "type": "string", + "format": "uuid" + }, + "tag": { + "description": "The tag.", + "allOf": [ + { + "$ref": "#/components/schemas/TagDeclarator" + } + ], + "nullable": true + }, + "id": { + "description": "The id of the geometry.", + "type": "string", + "format": "uuid" + }, + "sourceRange": { + "description": "The source range.", + "allOf": [ + { + "$ref": "#/components/schemas/SourceRange" + } + ] + } + } + }, + { + "description": "Geometry metadata.", + "type": "object", + "required": [ + "faceId", + "id", + "sourceRange", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "chamfer" + ] + }, + "faceId": { + "description": "The id for the chamfer surface.", + "type": "string", + "format": "uuid" + }, + "tag": { + "description": "The tag.", + "allOf": [ + { + "$ref": "#/components/schemas/TagDeclarator" + } + ], + "nullable": true + }, + "id": { + "description": "The id of the geometry.", + "type": "string", + "format": "uuid" + }, + "sourceRange": { + "description": "The source range.", + "allOf": [ + { + "$ref": "#/components/schemas/SourceRange" + } + ] + } + } + }, + { + "description": "Geometry metadata.", + "type": "object", + "required": [ + "faceId", + "id", + "sourceRange", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "fillet" + ] + }, + "faceId": { + "description": "The id for the fillet surface.", + "type": "string", + "format": "uuid" + }, + "tag": { + "description": "The tag.", + "allOf": [ + { + "$ref": "#/components/schemas/TagDeclarator" + } + ], + "nullable": true + }, + "id": { + "description": "The id of the geometry.", + "type": "string", + "format": "uuid" + }, + "sourceRange": { + "description": "The source range.", + "allOf": [ + { + "$ref": "#/components/schemas/SourceRange" + } + ] + } + } + } + ] + }, + "Sketch": { + "description": "A sketch is a collection of paths.", + "type": "object", + "required": [ + "__meta", + "id", + "on", + "paths", + "start" + ], + "properties": { + "id": { + "description": "The id of the sketch (this will change when the engine's reference to it changes).", + "type": "string", + "format": "uuid" + }, + "paths": { + "description": "The paths in the sketch.", + "type": "array", + "items": { + "$ref": "#/components/schemas/Path" + } + }, + "on": { + "description": "What the sketch is on (can be a plane or a face).", + "allOf": [ + { + "$ref": "#/components/schemas/SketchSurface" + } + ] + }, + "start": { + "description": "The starting path.", + "allOf": [ + { + "$ref": "#/components/schemas/BasePath" + } + ] + }, + "tags": { + "description": "Tag identifiers that have been declared in this sketch.", + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/TagIdentifier" + } + }, + "__meta": { + "description": "Metadata.", + "type": "array", + "items": { + "$ref": "#/components/schemas/Metadata" + } + } + } + }, + "BasePath": { + "description": "A base path.", + "type": "object", + "required": [ + "__geoMeta", + "from", + "to" + ], + "properties": { + "from": { + "description": "The from point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "to": { + "description": "The to point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "tag": { + "description": "The tag of the path.", + "allOf": [ + { + "$ref": "#/components/schemas/TagDeclarator" + } + ], + "nullable": true + }, + "__geoMeta": { + "description": "Metadata.", + "allOf": [ + { + "$ref": "#/components/schemas/GeoMeta" + } + ] + } + } + }, + "TagIdentifier": { + "type": "object", + "required": [ + "__meta", + "value" + ], + "properties": { + "value": { + "type": "string" + }, + "info": { + "allOf": [ + { + "$ref": "#/components/schemas/TagEngineInfo" + } + ], + "nullable": true + }, + "__meta": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Metadata" + } + } + } + }, + "TagEngineInfo": { + "description": "Engine information for a tag.", + "type": "object", + "oneOf": [ + { + "description": "The path the tag is on.", + "type": "object", + "required": [ + "path" + ], + "properties": { + "path": { + "$ref": "#/components/schemas/Path" + } + }, + "additionalProperties": false + }, + { + "description": "The surface information for the tag.", + "type": "object", + "required": [ + "surface" + ], + "properties": { + "surface": { + "$ref": "#/components/schemas/ExtrudeSurface" + } + }, + "additionalProperties": false + } + ], + "required": [ + "id", + "sketch" + ], + "properties": { + "id": { + "description": "The id of the tagged object.", + "type": "string", + "format": "uuid" + }, + "sketch": { + "description": "The sketch the tag is on.", + "type": "string", + "format": "uuid" + } + } + }, + "EdgeCut": { + "description": "A fillet or a chamfer.", + "oneOf": [ + { + "description": "A fillet.", + "type": "object", + "required": [ + "edgeId", + "id", + "radius", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "fillet" + ] + }, + "id": { + "description": "The id of the engine command that called this fillet.", + "type": "string", + "format": "uuid" + }, + "radius": { + "type": "number", + "format": "double" + }, + "edgeId": { + "description": "The engine id of the edge to fillet.", + "type": "string", + "format": "uuid" + }, + "tag": { + "allOf": [ + { + "$ref": "#/components/schemas/TagDeclarator" + } + ], + "nullable": true + } + } + }, + { + "description": "A chamfer.", + "type": "object", + "required": [ + "edgeId", + "id", + "length", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "chamfer" + ] + }, + "id": { + "description": "The id of the engine command that called this chamfer.", + "type": "string", + "format": "uuid" + }, + "length": { + "type": "number", + "format": "double" + }, + "edgeId": { + "description": "The engine id of the edge to chamfer.", + "type": "string", + "format": "uuid" + }, + "tag": { + "allOf": [ + { + "$ref": "#/components/schemas/TagDeclarator" + } + ], + "nullable": true + } + } + } + ] + } + } + }, + "required": true + }, + "unpublished": false, + "deprecated": false, + "examples": [ + "// Create a regular hexagon inscribed in a circle of radius 10\nhex = startSketchOn('XY')\n |> polygon({\n radius: 10,\n numSides: 6,\n center: [0, 0],\n inscribed: true\n }, %)\n\nexample = extrude(5, hex)", + "// Create a square circumscribed around a circle of radius 5\nsquare = startSketchOn('XY')\n |> polygon({\n radius: 5.0,\n numSides: 4,\n center: [10, 10],\n inscribed: false\n }, %)\nexample = extrude(5, square)" + ] + }, { "name": "pow", "summary": "Compute the number to a power.", @@ -123840,6 +127938,12322 @@ "sketch001 = startSketchOn('XY')\n |> startProfileAt([5, 2], %)\n |> angledLine({ angle: -60, length: 14 }, %)\n |> angledLineToY({ angle: 30, to: profileStartY(%) }, %)" ] }, + { + "name": "push", + "summary": "Append an element to the end of an array.", + "description": "Returns a new array with the element appended.", + "tags": [], + "args": [ + { + "name": "array", + "type": "[KclValue]", + "schema": { + "$schema": "https://spec.openapis.org/oas/3.0/schema/2019-04-02#/definitions/Schema", + "title": "Array_of_KclValue", + "type": "array", + "items": { + "$ref": "#/components/schemas/KclValue" + }, + "definitions": { + "KclValue": { + "description": "Any KCL value.", + "oneOf": [ + { + "type": "object", + "required": [ + "__meta", + "type", + "value" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "UserVal" + ] + }, + "value": {}, + "__meta": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Metadata" + } + } + } + }, + { + "type": "object", + "required": [ + "__meta", + "type", + "value" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "TagIdentifier" + ] + }, + "value": { + "type": "string" + }, + "info": { + "allOf": [ + { + "$ref": "#/components/schemas/TagEngineInfo" + } + ], + "nullable": true + }, + "__meta": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Metadata" + } + } + } + }, + { + "type": "object", + "required": [ + "end", + "start", + "type", + "value" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "TagDeclarator" + ] + }, + "start": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "end": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "value": { + "type": "string" + }, + "digest": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + }, + "maxItems": 32, + "minItems": 32, + "nullable": true + } + } + }, + { + "description": "A plane.", + "type": "object", + "required": [ + "__meta", + "id", + "origin", + "type", + "value", + "xAxis", + "yAxis", + "zAxis" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "Plane" + ] + }, + "id": { + "description": "The id of the plane.", + "type": "string", + "format": "uuid" + }, + "value": { + "$ref": "#/components/schemas/PlaneType" + }, + "origin": { + "description": "Origin of the plane.", + "allOf": [ + { + "$ref": "#/components/schemas/Point3d" + } + ] + }, + "xAxis": { + "description": "What should the plane’s X axis be?", + "allOf": [ + { + "$ref": "#/components/schemas/Point3d" + } + ] + }, + "yAxis": { + "description": "What should the plane’s Y axis be?", + "allOf": [ + { + "$ref": "#/components/schemas/Point3d" + } + ] + }, + "zAxis": { + "description": "The z-axis (normal).", + "allOf": [ + { + "$ref": "#/components/schemas/Point3d" + } + ] + }, + "__meta": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Metadata" + } + } + } + }, + { + "description": "A face.", + "type": "object", + "required": [ + "__meta", + "id", + "solid", + "type", + "value", + "xAxis", + "yAxis", + "zAxis" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "Face" + ] + }, + "id": { + "description": "The id of the face.", + "type": "string", + "format": "uuid" + }, + "value": { + "description": "The tag of the face.", + "type": "string" + }, + "xAxis": { + "description": "What should the face’s X axis be?", + "allOf": [ + { + "$ref": "#/components/schemas/Point3d" + } + ] + }, + "yAxis": { + "description": "What should the face’s Y axis be?", + "allOf": [ + { + "$ref": "#/components/schemas/Point3d" + } + ] + }, + "zAxis": { + "description": "The z-axis (normal).", + "allOf": [ + { + "$ref": "#/components/schemas/Point3d" + } + ] + }, + "solid": { + "description": "The solid the face is on.", + "allOf": [ + { + "$ref": "#/components/schemas/Solid" + } + ] + }, + "__meta": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Metadata" + } + } + } + }, + { + "description": "An solid is a collection of extrude surfaces.", + "type": "object", + "required": [ + "__meta", + "height", + "id", + "sketch", + "type", + "value" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "Solid" + ] + }, + "id": { + "description": "The id of the solid.", + "type": "string", + "format": "uuid" + }, + "value": { + "description": "The extrude surfaces.", + "type": "array", + "items": { + "$ref": "#/components/schemas/ExtrudeSurface" + } + }, + "sketch": { + "description": "The sketch.", + "allOf": [ + { + "$ref": "#/components/schemas/Sketch" + } + ] + }, + "height": { + "description": "The height of the solid.", + "type": "number", + "format": "double" + }, + "startCapId": { + "description": "The id of the extrusion start cap", + "type": "string", + "format": "uuid", + "nullable": true + }, + "endCapId": { + "description": "The id of the extrusion end cap", + "type": "string", + "format": "uuid", + "nullable": true + }, + "edgeCuts": { + "description": "Chamfers or fillets on this solid.", + "type": "array", + "items": { + "$ref": "#/components/schemas/EdgeCut" + } + }, + "__meta": { + "description": "Metadata.", + "type": "array", + "items": { + "$ref": "#/components/schemas/Metadata" + } + } + } + }, + { + "type": "object", + "required": [ + "type", + "value" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "Solids" + ] + }, + "value": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Solid" + } + } + } + }, + { + "description": "Data for an imported geometry.", + "type": "object", + "required": [ + "__meta", + "id", + "type", + "value" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "ImportedGeometry" + ] + }, + "id": { + "description": "The ID of the imported geometry.", + "type": "string", + "format": "uuid" + }, + "value": { + "description": "The original file paths.", + "type": "array", + "items": { + "type": "string" + } + }, + "__meta": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Metadata" + } + } + } + }, + { + "type": "object", + "required": [ + "__meta", + "expression", + "memory", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "Function" + ] + }, + "expression": { + "$ref": "#/components/schemas/FunctionExpression" + }, + "memory": { + "$ref": "#/components/schemas/ProgramMemory" + }, + "__meta": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Metadata" + } + } + } + } + ] + }, + "Metadata": { + "description": "Metadata.", + "type": "object", + "required": [ + "sourceRange" + ], + "properties": { + "sourceRange": { + "description": "The source range.", + "allOf": [ + { + "$ref": "#/components/schemas/SourceRange" + } + ] + } + } + }, + "SourceRange": { + "type": "array", + "items": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "maxItems": 2, + "minItems": 2 + }, + "TagEngineInfo": { + "description": "Engine information for a tag.", + "type": "object", + "oneOf": [ + { + "description": "The path the tag is on.", + "type": "object", + "required": [ + "path" + ], + "properties": { + "path": { + "$ref": "#/components/schemas/Path" + } + }, + "additionalProperties": false + }, + { + "description": "The surface information for the tag.", + "type": "object", + "required": [ + "surface" + ], + "properties": { + "surface": { + "$ref": "#/components/schemas/ExtrudeSurface" + } + }, + "additionalProperties": false + } + ], + "required": [ + "id", + "sketch" + ], + "properties": { + "id": { + "description": "The id of the tagged object.", + "type": "string", + "format": "uuid" + }, + "sketch": { + "description": "The sketch the tag is on.", + "type": "string", + "format": "uuid" + } + } + }, + "Path": { + "description": "A path.", + "oneOf": [ + { + "description": "A path that goes to a point.", + "type": "object", + "required": [ + "__geoMeta", + "from", + "to", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "ToPoint" + ] + }, + "from": { + "description": "The from point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "to": { + "description": "The to point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "tag": { + "description": "The tag of the path.", + "allOf": [ + { + "$ref": "#/components/schemas/TagDeclarator" + } + ], + "nullable": true + }, + "__geoMeta": { + "description": "Metadata.", + "allOf": [ + { + "$ref": "#/components/schemas/GeoMeta" + } + ] + } + } + }, + { + "description": "A arc that is tangential to the last path segment that goes to a point", + "type": "object", + "required": [ + "__geoMeta", + "ccw", + "center", + "from", + "to", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "TangentialArcTo" + ] + }, + "center": { + "description": "the arc's center", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "ccw": { + "description": "arc's direction", + "type": "boolean" + }, + "from": { + "description": "The from point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "to": { + "description": "The to point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "tag": { + "description": "The tag of the path.", + "allOf": [ + { + "$ref": "#/components/schemas/TagDeclarator" + } + ], + "nullable": true + }, + "__geoMeta": { + "description": "Metadata.", + "allOf": [ + { + "$ref": "#/components/schemas/GeoMeta" + } + ] + } + } + }, + { + "description": "A arc that is tangential to the last path segment", + "type": "object", + "required": [ + "__geoMeta", + "ccw", + "center", + "from", + "to", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "TangentialArc" + ] + }, + "center": { + "description": "the arc's center", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "ccw": { + "description": "arc's direction", + "type": "boolean" + }, + "from": { + "description": "The from point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "to": { + "description": "The to point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "tag": { + "description": "The tag of the path.", + "allOf": [ + { + "$ref": "#/components/schemas/TagDeclarator" + } + ], + "nullable": true + }, + "__geoMeta": { + "description": "Metadata.", + "allOf": [ + { + "$ref": "#/components/schemas/GeoMeta" + } + ] + } + } + }, + { + "description": "a complete arc", + "type": "object", + "required": [ + "__geoMeta", + "ccw", + "center", + "from", + "radius", + "to", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "Circle" + ] + }, + "center": { + "description": "the arc's center", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "radius": { + "description": "the arc's radius", + "type": "number", + "format": "double" + }, + "ccw": { + "description": "arc's direction", + "type": "boolean" + }, + "from": { + "description": "The from point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "to": { + "description": "The to point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "tag": { + "description": "The tag of the path.", + "allOf": [ + { + "$ref": "#/components/schemas/TagDeclarator" + } + ], + "nullable": true + }, + "__geoMeta": { + "description": "Metadata.", + "allOf": [ + { + "$ref": "#/components/schemas/GeoMeta" + } + ] + } + } + }, + { + "description": "A path that is horizontal.", + "type": "object", + "required": [ + "__geoMeta", + "from", + "to", + "type", + "x" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "Horizontal" + ] + }, + "x": { + "description": "The x coordinate.", + "type": "number", + "format": "double" + }, + "from": { + "description": "The from point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "to": { + "description": "The to point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "tag": { + "description": "The tag of the path.", + "allOf": [ + { + "$ref": "#/components/schemas/TagDeclarator" + } + ], + "nullable": true + }, + "__geoMeta": { + "description": "Metadata.", + "allOf": [ + { + "$ref": "#/components/schemas/GeoMeta" + } + ] + } + } + }, + { + "description": "An angled line to.", + "type": "object", + "required": [ + "__geoMeta", + "from", + "to", + "type" + ], + "properties": { + "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 + }, + "from": { + "description": "The from point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "to": { + "description": "The to point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "tag": { + "description": "The tag of the path.", + "allOf": [ + { + "$ref": "#/components/schemas/TagDeclarator" + } + ], + "nullable": true + }, + "__geoMeta": { + "description": "Metadata.", + "allOf": [ + { + "$ref": "#/components/schemas/GeoMeta" + } + ] + } + } + }, + { + "description": "A base path.", + "type": "object", + "required": [ + "__geoMeta", + "from", + "to", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "Base" + ] + }, + "from": { + "description": "The from point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "to": { + "description": "The to point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "tag": { + "description": "The tag of the path.", + "allOf": [ + { + "$ref": "#/components/schemas/TagDeclarator" + } + ], + "nullable": true + }, + "__geoMeta": { + "description": "Metadata.", + "allOf": [ + { + "$ref": "#/components/schemas/GeoMeta" + } + ] + } + } + }, + { + "description": "A circular arc, not necessarily tangential to the current point.", + "type": "object", + "required": [ + "__geoMeta", + "center", + "from", + "radius", + "to", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "Arc" + ] + }, + "center": { + "description": "Center of the circle that this arc is drawn on.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "radius": { + "description": "Radius of the circle that this arc is drawn on.", + "type": "number", + "format": "double" + }, + "from": { + "description": "The from point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "to": { + "description": "The to point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "tag": { + "description": "The tag of the path.", + "allOf": [ + { + "$ref": "#/components/schemas/TagDeclarator" + } + ], + "nullable": true + }, + "__geoMeta": { + "description": "Metadata.", + "allOf": [ + { + "$ref": "#/components/schemas/GeoMeta" + } + ] + } + } + } + ] + }, + "TagDeclarator": { + "type": "object", + "required": [ + "end", + "start", + "value" + ], + "properties": { + "start": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "end": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "value": { + "type": "string" + }, + "digest": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + }, + "maxItems": 32, + "minItems": 32, + "nullable": true + } + } + }, + "GeoMeta": { + "description": "Geometry metadata.", + "type": "object", + "required": [ + "id", + "sourceRange" + ], + "properties": { + "id": { + "description": "The id of the geometry.", + "type": "string", + "format": "uuid" + }, + "sourceRange": { + "description": "The source range.", + "allOf": [ + { + "$ref": "#/components/schemas/SourceRange" + } + ] + } + } + }, + "ExtrudeSurface": { + "description": "An extrude surface.", + "oneOf": [ + { + "description": "An extrude plane.", + "type": "object", + "required": [ + "faceId", + "id", + "sourceRange", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "extrudePlane" + ] + }, + "faceId": { + "description": "The face id for the extrude plane.", + "type": "string", + "format": "uuid" + }, + "tag": { + "description": "The tag.", + "allOf": [ + { + "$ref": "#/components/schemas/TagDeclarator" + } + ], + "nullable": true + }, + "id": { + "description": "The id of the geometry.", + "type": "string", + "format": "uuid" + }, + "sourceRange": { + "description": "The source range.", + "allOf": [ + { + "$ref": "#/components/schemas/SourceRange" + } + ] + } + } + }, + { + "description": "An extruded arc.", + "type": "object", + "required": [ + "faceId", + "id", + "sourceRange", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "extrudeArc" + ] + }, + "faceId": { + "description": "The face id for the extrude plane.", + "type": "string", + "format": "uuid" + }, + "tag": { + "description": "The tag.", + "allOf": [ + { + "$ref": "#/components/schemas/TagDeclarator" + } + ], + "nullable": true + }, + "id": { + "description": "The id of the geometry.", + "type": "string", + "format": "uuid" + }, + "sourceRange": { + "description": "The source range.", + "allOf": [ + { + "$ref": "#/components/schemas/SourceRange" + } + ] + } + } + }, + { + "description": "Geometry metadata.", + "type": "object", + "required": [ + "faceId", + "id", + "sourceRange", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "chamfer" + ] + }, + "faceId": { + "description": "The id for the chamfer surface.", + "type": "string", + "format": "uuid" + }, + "tag": { + "description": "The tag.", + "allOf": [ + { + "$ref": "#/components/schemas/TagDeclarator" + } + ], + "nullable": true + }, + "id": { + "description": "The id of the geometry.", + "type": "string", + "format": "uuid" + }, + "sourceRange": { + "description": "The source range.", + "allOf": [ + { + "$ref": "#/components/schemas/SourceRange" + } + ] + } + } + }, + { + "description": "Geometry metadata.", + "type": "object", + "required": [ + "faceId", + "id", + "sourceRange", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "fillet" + ] + }, + "faceId": { + "description": "The id for the fillet surface.", + "type": "string", + "format": "uuid" + }, + "tag": { + "description": "The tag.", + "allOf": [ + { + "$ref": "#/components/schemas/TagDeclarator" + } + ], + "nullable": true + }, + "id": { + "description": "The id of the geometry.", + "type": "string", + "format": "uuid" + }, + "sourceRange": { + "description": "The source range.", + "allOf": [ + { + "$ref": "#/components/schemas/SourceRange" + } + ] + } + } + } + ] + }, + "PlaneType": { + "description": "Type for a plane.", + "oneOf": [ + { + "type": "string", + "enum": [ + "XY", + "XZ", + "YZ" + ] + }, + { + "description": "A custom plane.", + "type": "string", + "enum": [ + "Custom" + ] + } + ] + }, + "Point3d": { + "type": "object", + "required": [ + "x", + "y", + "z" + ], + "properties": { + "x": { + "type": "number", + "format": "double" + }, + "y": { + "type": "number", + "format": "double" + }, + "z": { + "type": "number", + "format": "double" + } + } + }, + "Solid": { + "description": "An solid is a collection of extrude surfaces.", + "type": "object", + "required": [ + "__meta", + "height", + "id", + "sketch", + "value" + ], + "properties": { + "id": { + "description": "The id of the solid.", + "type": "string", + "format": "uuid" + }, + "value": { + "description": "The extrude surfaces.", + "type": "array", + "items": { + "$ref": "#/components/schemas/ExtrudeSurface" + } + }, + "sketch": { + "description": "The sketch.", + "allOf": [ + { + "$ref": "#/components/schemas/Sketch" + } + ] + }, + "height": { + "description": "The height of the solid.", + "type": "number", + "format": "double" + }, + "startCapId": { + "description": "The id of the extrusion start cap", + "type": "string", + "format": "uuid", + "nullable": true + }, + "endCapId": { + "description": "The id of the extrusion end cap", + "type": "string", + "format": "uuid", + "nullable": true + }, + "edgeCuts": { + "description": "Chamfers or fillets on this solid.", + "type": "array", + "items": { + "$ref": "#/components/schemas/EdgeCut" + } + }, + "__meta": { + "description": "Metadata.", + "type": "array", + "items": { + "$ref": "#/components/schemas/Metadata" + } + } + } + }, + "Sketch": { + "description": "A sketch is a collection of paths.", + "type": "object", + "required": [ + "__meta", + "id", + "on", + "paths", + "start" + ], + "properties": { + "id": { + "description": "The id of the sketch (this will change when the engine's reference to it changes).", + "type": "string", + "format": "uuid" + }, + "paths": { + "description": "The paths in the sketch.", + "type": "array", + "items": { + "$ref": "#/components/schemas/Path" + } + }, + "on": { + "description": "What the sketch is on (can be a plane or a face).", + "allOf": [ + { + "$ref": "#/components/schemas/SketchSurface" + } + ] + }, + "start": { + "description": "The starting path.", + "allOf": [ + { + "$ref": "#/components/schemas/BasePath" + } + ] + }, + "tags": { + "description": "Tag identifiers that have been declared in this sketch.", + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/TagIdentifier" + } + }, + "__meta": { + "description": "Metadata.", + "type": "array", + "items": { + "$ref": "#/components/schemas/Metadata" + } + } + } + }, + "SketchSurface": { + "description": "A sketch type.", + "oneOf": [ + { + "description": "A plane.", + "type": "object", + "required": [ + "__meta", + "id", + "origin", + "type", + "value", + "xAxis", + "yAxis", + "zAxis" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "plane" + ] + }, + "id": { + "description": "The id of the plane.", + "type": "string", + "format": "uuid" + }, + "value": { + "$ref": "#/components/schemas/PlaneType" + }, + "origin": { + "description": "Origin of the plane.", + "allOf": [ + { + "$ref": "#/components/schemas/Point3d" + } + ] + }, + "xAxis": { + "description": "What should the plane’s X axis be?", + "allOf": [ + { + "$ref": "#/components/schemas/Point3d" + } + ] + }, + "yAxis": { + "description": "What should the plane’s Y axis be?", + "allOf": [ + { + "$ref": "#/components/schemas/Point3d" + } + ] + }, + "zAxis": { + "description": "The z-axis (normal).", + "allOf": [ + { + "$ref": "#/components/schemas/Point3d" + } + ] + }, + "__meta": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Metadata" + } + } + } + }, + { + "description": "A face.", + "type": "object", + "required": [ + "__meta", + "id", + "solid", + "type", + "value", + "xAxis", + "yAxis", + "zAxis" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "face" + ] + }, + "id": { + "description": "The id of the face.", + "type": "string", + "format": "uuid" + }, + "value": { + "description": "The tag of the face.", + "type": "string" + }, + "xAxis": { + "description": "What should the face’s X axis be?", + "allOf": [ + { + "$ref": "#/components/schemas/Point3d" + } + ] + }, + "yAxis": { + "description": "What should the face’s Y axis be?", + "allOf": [ + { + "$ref": "#/components/schemas/Point3d" + } + ] + }, + "zAxis": { + "description": "The z-axis (normal).", + "allOf": [ + { + "$ref": "#/components/schemas/Point3d" + } + ] + }, + "solid": { + "description": "The solid the face is on.", + "allOf": [ + { + "$ref": "#/components/schemas/Solid" + } + ] + }, + "__meta": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Metadata" + } + } + } + } + ] + }, + "BasePath": { + "description": "A base path.", + "type": "object", + "required": [ + "__geoMeta", + "from", + "to" + ], + "properties": { + "from": { + "description": "The from point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "to": { + "description": "The to point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "tag": { + "description": "The tag of the path.", + "allOf": [ + { + "$ref": "#/components/schemas/TagDeclarator" + } + ], + "nullable": true + }, + "__geoMeta": { + "description": "Metadata.", + "allOf": [ + { + "$ref": "#/components/schemas/GeoMeta" + } + ] + } + } + }, + "TagIdentifier": { + "type": "object", + "required": [ + "__meta", + "value" + ], + "properties": { + "value": { + "type": "string" + }, + "info": { + "allOf": [ + { + "$ref": "#/components/schemas/TagEngineInfo" + } + ], + "nullable": true + }, + "__meta": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Metadata" + } + } + } + }, + "EdgeCut": { + "description": "A fillet or a chamfer.", + "oneOf": [ + { + "description": "A fillet.", + "type": "object", + "required": [ + "edgeId", + "id", + "radius", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "fillet" + ] + }, + "id": { + "description": "The id of the engine command that called this fillet.", + "type": "string", + "format": "uuid" + }, + "radius": { + "type": "number", + "format": "double" + }, + "edgeId": { + "description": "The engine id of the edge to fillet.", + "type": "string", + "format": "uuid" + }, + "tag": { + "allOf": [ + { + "$ref": "#/components/schemas/TagDeclarator" + } + ], + "nullable": true + } + } + }, + { + "description": "A chamfer.", + "type": "object", + "required": [ + "edgeId", + "id", + "length", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "chamfer" + ] + }, + "id": { + "description": "The id of the engine command that called this chamfer.", + "type": "string", + "format": "uuid" + }, + "length": { + "type": "number", + "format": "double" + }, + "edgeId": { + "description": "The engine id of the edge to chamfer.", + "type": "string", + "format": "uuid" + }, + "tag": { + "allOf": [ + { + "$ref": "#/components/schemas/TagDeclarator" + } + ], + "nullable": true + } + } + } + ] + }, + "FunctionExpression": { + "type": "object", + "required": [ + "body", + "end", + "params", + "start" + ], + "properties": { + "start": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "end": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "params": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Parameter" + } + }, + "body": { + "$ref": "#/components/schemas/Program" + }, + "digest": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + }, + "maxItems": 32, + "minItems": 32, + "nullable": true + } + } + }, + "Parameter": { + "description": "Parameter of a KCL function.", + "type": "object", + "required": [ + "identifier", + "optional" + ], + "properties": { + "identifier": { + "description": "The parameter's label or name.", + "allOf": [ + { + "$ref": "#/components/schemas/Identifier" + } + ] + }, + "optional": { + "description": "Is the parameter optional?", + "type": "boolean" + }, + "digest": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + }, + "maxItems": 32, + "minItems": 32, + "nullable": true + } + } + }, + "Identifier": { + "type": "object", + "required": [ + "end", + "name", + "start" + ], + "properties": { + "start": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "end": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "name": { + "type": "string" + }, + "digest": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + }, + "maxItems": 32, + "minItems": 32, + "nullable": true + } + } + }, + "Program": { + "description": "A KCL program top level, or function body.", + "type": "object", + "required": [ + "body", + "end", + "start" + ], + "properties": { + "start": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "end": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "body": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BodyItem" + } + }, + "nonCodeMeta": { + "$ref": "#/components/schemas/NonCodeMeta" + }, + "digest": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + }, + "maxItems": 32, + "minItems": 32, + "nullable": true + } + } + }, + "BodyItem": { + "oneOf": [ + { + "type": "object", + "required": [ + "end", + "items", + "path", + "raw_path", + "start", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "ImportStatement" + ] + }, + "start": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "end": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "items": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImportItem" + } + }, + "path": { + "type": "string" + }, + "raw_path": { + "type": "string" + }, + "digest": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + }, + "maxItems": 32, + "minItems": 32, + "nullable": true + } + } + }, + { + "type": "object", + "required": [ + "end", + "expression", + "start", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "ExpressionStatement" + ] + }, + "start": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "end": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "expression": { + "$ref": "#/components/schemas/Expr" + }, + "digest": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + }, + "maxItems": 32, + "minItems": 32, + "nullable": true + } + } + }, + { + "type": "object", + "required": [ + "declarations", + "end", + "kind", + "start", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "VariableDeclaration" + ] + }, + "start": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "end": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "declarations": { + "type": "array", + "items": { + "$ref": "#/components/schemas/VariableDeclarator" + } + }, + "visibility": { + "$ref": "#/components/schemas/ItemVisibility" + }, + "kind": { + "$ref": "#/components/schemas/VariableKind" + }, + "digest": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + }, + "maxItems": 32, + "minItems": 32, + "nullable": true + } + } + }, + { + "type": "object", + "required": [ + "argument", + "end", + "start", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "ReturnStatement" + ] + }, + "start": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "end": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "argument": { + "$ref": "#/components/schemas/Expr" + }, + "digest": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + }, + "maxItems": 32, + "minItems": 32, + "nullable": true + } + } + } + ] + }, + "ImportItem": { + "type": "object", + "required": [ + "end", + "name", + "start" + ], + "properties": { + "name": { + "description": "Name of the item to import.", + "allOf": [ + { + "$ref": "#/components/schemas/Identifier" + } + ] + }, + "alias": { + "description": "Rename the item using an identifier after \"as\".", + "allOf": [ + { + "$ref": "#/components/schemas/Identifier" + } + ], + "nullable": true + }, + "start": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "end": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "digest": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + }, + "maxItems": 32, + "minItems": 32, + "nullable": true + } + } + }, + "Expr": { + "description": "An expression can be evaluated to yield a single KCL value.", + "oneOf": [ + { + "type": "object", + "required": [ + "end", + "raw", + "start", + "type", + "value" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "Literal" + ] + }, + "start": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "end": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "value": { + "$ref": "#/components/schemas/LiteralValue" + }, + "raw": { + "type": "string" + }, + "digest": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + }, + "maxItems": 32, + "minItems": 32, + "nullable": true + } + } + }, + { + "type": "object", + "required": [ + "end", + "name", + "start", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "Identifier" + ] + }, + "start": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "end": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "name": { + "type": "string" + }, + "digest": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + }, + "maxItems": 32, + "minItems": 32, + "nullable": true + } + } + }, + { + "type": "object", + "required": [ + "end", + "start", + "type", + "value" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "TagDeclarator" + ] + }, + "start": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "end": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "value": { + "type": "string" + }, + "digest": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + }, + "maxItems": 32, + "minItems": 32, + "nullable": true + } + } + }, + { + "type": "object", + "required": [ + "end", + "left", + "operator", + "right", + "start", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "BinaryExpression" + ] + }, + "start": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "end": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "operator": { + "$ref": "#/components/schemas/BinaryOperator" + }, + "left": { + "$ref": "#/components/schemas/BinaryPart" + }, + "right": { + "$ref": "#/components/schemas/BinaryPart" + }, + "digest": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + }, + "maxItems": 32, + "minItems": 32, + "nullable": true + } + } + }, + { + "type": "object", + "required": [ + "body", + "end", + "params", + "start", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "FunctionExpression" + ] + }, + "start": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "end": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "params": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Parameter" + } + }, + "body": { + "$ref": "#/components/schemas/Program" + }, + "digest": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + }, + "maxItems": 32, + "minItems": 32, + "nullable": true + } + } + }, + { + "type": "object", + "required": [ + "arguments", + "callee", + "end", + "optional", + "start", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "CallExpression" + ] + }, + "start": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "end": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "callee": { + "$ref": "#/components/schemas/Identifier" + }, + "arguments": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Expr" + } + }, + "optional": { + "type": "boolean" + }, + "digest": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + }, + "maxItems": 32, + "minItems": 32, + "nullable": true + } + } + }, + { + "type": "object", + "required": [ + "body", + "end", + "start", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "PipeExpression" + ] + }, + "start": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "end": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "body": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Expr" + } + }, + "nonCodeMeta": { + "$ref": "#/components/schemas/NonCodeMeta" + }, + "digest": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + }, + "maxItems": 32, + "minItems": 32, + "nullable": true + } + } + }, + { + "type": "object", + "required": [ + "end", + "start", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "PipeSubstitution" + ] + }, + "start": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "end": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "digest": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + }, + "maxItems": 32, + "minItems": 32, + "nullable": true + } + } + }, + { + "type": "object", + "required": [ + "elements", + "end", + "start", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "ArrayExpression" + ] + }, + "start": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "end": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "elements": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Expr" + } + }, + "nonCodeMeta": { + "$ref": "#/components/schemas/NonCodeMeta" + }, + "digest": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + }, + "maxItems": 32, + "minItems": 32, + "nullable": true + } + } + }, + { + "type": "object", + "required": [ + "end", + "endElement", + "endInclusive", + "start", + "startElement", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "ArrayRangeExpression" + ] + }, + "start": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "end": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "startElement": { + "$ref": "#/components/schemas/Expr" + }, + "endElement": { + "$ref": "#/components/schemas/Expr" + }, + "endInclusive": { + "description": "Is the `end_element` included in the range?", + "type": "boolean" + }, + "digest": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + }, + "maxItems": 32, + "minItems": 32, + "nullable": true + } + } + }, + { + "type": "object", + "required": [ + "end", + "properties", + "start", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "ObjectExpression" + ] + }, + "start": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "end": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "properties": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ObjectProperty" + } + }, + "nonCodeMeta": { + "$ref": "#/components/schemas/NonCodeMeta" + }, + "digest": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + }, + "maxItems": 32, + "minItems": 32, + "nullable": true + } + } + }, + { + "type": "object", + "required": [ + "computed", + "end", + "object", + "property", + "start", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "MemberExpression" + ] + }, + "start": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "end": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "object": { + "$ref": "#/components/schemas/MemberObject" + }, + "property": { + "$ref": "#/components/schemas/LiteralIdentifier" + }, + "computed": { + "type": "boolean" + }, + "digest": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + }, + "maxItems": 32, + "minItems": 32, + "nullable": true + } + } + }, + { + "type": "object", + "required": [ + "argument", + "end", + "operator", + "start", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "UnaryExpression" + ] + }, + "start": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "end": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "operator": { + "$ref": "#/components/schemas/UnaryOperator" + }, + "argument": { + "$ref": "#/components/schemas/BinaryPart" + }, + "digest": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + }, + "maxItems": 32, + "minItems": 32, + "nullable": true + } + } + }, + { + "type": "object", + "required": [ + "cond", + "else_ifs", + "end", + "final_else", + "start", + "then_val", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "IfExpression" + ] + }, + "start": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "end": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "cond": { + "$ref": "#/components/schemas/Expr" + }, + "then_val": { + "$ref": "#/components/schemas/Program" + }, + "else_ifs": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ElseIf" + } + }, + "final_else": { + "$ref": "#/components/schemas/Program" + }, + "digest": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + }, + "maxItems": 32, + "minItems": 32, + "nullable": true + } + } + }, + { + "description": "KCL value for an optional parameter which was not given an argument. (remember, parameters are in the function declaration, arguments are in the function call/application).", + "type": "object", + "required": [ + "end", + "start", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "None" + ] + }, + "start": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "end": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + } + } + } + ] + }, + "LiteralValue": { + "anyOf": [ + { + "type": "integer", + "format": "int64" + }, + { + "type": "number", + "format": "double" + }, + { + "type": "string" + }, + { + "type": "boolean" + } + ] + }, + "BinaryOperator": { + "oneOf": [ + { + "description": "Add two numbers.", + "type": "string", + "enum": [ + "+" + ] + }, + { + "description": "Subtract two numbers.", + "type": "string", + "enum": [ + "-" + ] + }, + { + "description": "Multiply two numbers.", + "type": "string", + "enum": [ + "*" + ] + }, + { + "description": "Divide two numbers.", + "type": "string", + "enum": [ + "/" + ] + }, + { + "description": "Modulo two numbers.", + "type": "string", + "enum": [ + "%" + ] + }, + { + "description": "Raise a number to a power.", + "type": "string", + "enum": [ + "^" + ] + }, + { + "description": "Are two numbers equal?", + "type": "string", + "enum": [ + "==" + ] + }, + { + "description": "Are two numbers not equal?", + "type": "string", + "enum": [ + "!=" + ] + }, + { + "description": "Is left greater than right", + "type": "string", + "enum": [ + ">" + ] + }, + { + "description": "Is left greater than or equal to right", + "type": "string", + "enum": [ + ">=" + ] + }, + { + "description": "Is left less than right", + "type": "string", + "enum": [ + "<" + ] + }, + { + "description": "Is left less than or equal to right", + "type": "string", + "enum": [ + "<=" + ] + } + ] + }, + "BinaryPart": { + "oneOf": [ + { + "type": "object", + "required": [ + "end", + "raw", + "start", + "type", + "value" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "Literal" + ] + }, + "start": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "end": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "value": { + "$ref": "#/components/schemas/LiteralValue" + }, + "raw": { + "type": "string" + }, + "digest": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + }, + "maxItems": 32, + "minItems": 32, + "nullable": true + } + } + }, + { + "type": "object", + "required": [ + "end", + "name", + "start", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "Identifier" + ] + }, + "start": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "end": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "name": { + "type": "string" + }, + "digest": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + }, + "maxItems": 32, + "minItems": 32, + "nullable": true + } + } + }, + { + "type": "object", + "required": [ + "end", + "left", + "operator", + "right", + "start", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "BinaryExpression" + ] + }, + "start": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "end": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "operator": { + "$ref": "#/components/schemas/BinaryOperator" + }, + "left": { + "$ref": "#/components/schemas/BinaryPart" + }, + "right": { + "$ref": "#/components/schemas/BinaryPart" + }, + "digest": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + }, + "maxItems": 32, + "minItems": 32, + "nullable": true + } + } + }, + { + "type": "object", + "required": [ + "arguments", + "callee", + "end", + "optional", + "start", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "CallExpression" + ] + }, + "start": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "end": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "callee": { + "$ref": "#/components/schemas/Identifier" + }, + "arguments": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Expr" + } + }, + "optional": { + "type": "boolean" + }, + "digest": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + }, + "maxItems": 32, + "minItems": 32, + "nullable": true + } + } + }, + { + "type": "object", + "required": [ + "argument", + "end", + "operator", + "start", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "UnaryExpression" + ] + }, + "start": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "end": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "operator": { + "$ref": "#/components/schemas/UnaryOperator" + }, + "argument": { + "$ref": "#/components/schemas/BinaryPart" + }, + "digest": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + }, + "maxItems": 32, + "minItems": 32, + "nullable": true + } + } + }, + { + "type": "object", + "required": [ + "computed", + "end", + "object", + "property", + "start", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "MemberExpression" + ] + }, + "start": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "end": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "object": { + "$ref": "#/components/schemas/MemberObject" + }, + "property": { + "$ref": "#/components/schemas/LiteralIdentifier" + }, + "computed": { + "type": "boolean" + }, + "digest": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + }, + "maxItems": 32, + "minItems": 32, + "nullable": true + } + } + }, + { + "type": "object", + "required": [ + "cond", + "else_ifs", + "end", + "final_else", + "start", + "then_val", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "IfExpression" + ] + }, + "start": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "end": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "cond": { + "$ref": "#/components/schemas/Expr" + }, + "then_val": { + "$ref": "#/components/schemas/Program" + }, + "else_ifs": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ElseIf" + } + }, + "final_else": { + "$ref": "#/components/schemas/Program" + }, + "digest": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + }, + "maxItems": 32, + "minItems": 32, + "nullable": true + } + } + } + ] + }, + "UnaryOperator": { + "oneOf": [ + { + "description": "Negate a number.", + "type": "string", + "enum": [ + "-" + ] + }, + { + "description": "Negate a boolean.", + "type": "string", + "enum": [ + "!" + ] + } + ] + }, + "MemberObject": { + "oneOf": [ + { + "type": "object", + "required": [ + "computed", + "end", + "object", + "property", + "start", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "MemberExpression" + ] + }, + "start": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "end": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "object": { + "$ref": "#/components/schemas/MemberObject" + }, + "property": { + "$ref": "#/components/schemas/LiteralIdentifier" + }, + "computed": { + "type": "boolean" + }, + "digest": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + }, + "maxItems": 32, + "minItems": 32, + "nullable": true + } + } + }, + { + "type": "object", + "required": [ + "end", + "name", + "start", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "Identifier" + ] + }, + "start": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "end": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "name": { + "type": "string" + }, + "digest": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + }, + "maxItems": 32, + "minItems": 32, + "nullable": true + } + } + } + ] + }, + "LiteralIdentifier": { + "oneOf": [ + { + "type": "object", + "required": [ + "end", + "name", + "start", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "Identifier" + ] + }, + "start": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "end": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "name": { + "type": "string" + }, + "digest": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + }, + "maxItems": 32, + "minItems": 32, + "nullable": true + } + } + }, + { + "type": "object", + "required": [ + "end", + "raw", + "start", + "type", + "value" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "Literal" + ] + }, + "start": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "end": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "value": { + "$ref": "#/components/schemas/LiteralValue" + }, + "raw": { + "type": "string" + }, + "digest": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + }, + "maxItems": 32, + "minItems": 32, + "nullable": true + } + } + } + ] + }, + "ElseIf": { + "type": "object", + "required": [ + "cond", + "end", + "start", + "then_val" + ], + "properties": { + "start": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "end": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "cond": { + "$ref": "#/components/schemas/Expr" + }, + "then_val": { + "$ref": "#/components/schemas/Program" + }, + "digest": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + }, + "maxItems": 32, + "minItems": 32, + "nullable": true + } + } + }, + "NonCodeMeta": { + "type": "object", + "required": [ + "nonCodeNodes", + "start" + ], + "properties": { + "nonCodeNodes": { + "type": "object", + "additionalProperties": { + "type": "array", + "items": { + "$ref": "#/components/schemas/NonCodeNode" + } + } + }, + "start": { + "type": "array", + "items": { + "$ref": "#/components/schemas/NonCodeNode" + } + }, + "digest": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + }, + "maxItems": 32, + "minItems": 32, + "nullable": true + } + } + }, + "NonCodeNode": { + "type": "object", + "required": [ + "end", + "start", + "value" + ], + "properties": { + "start": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "end": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "value": { + "$ref": "#/components/schemas/NonCodeValue" + }, + "digest": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + }, + "maxItems": 32, + "minItems": 32, + "nullable": true + } + } + }, + "NonCodeValue": { + "oneOf": [ + { + "description": "A shebang. This is a special type of comment that is at the top of the file. It looks like this: ```python,no_run #!/usr/bin/env python ```", + "type": "object", + "required": [ + "type", + "value" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "shebang" + ] + }, + "value": { + "type": "string" + } + } + }, + { + "description": "An inline comment. Here are examples: `1 + 1 // This is an inline comment`. `1 + 1 /* Here's another */`.", + "type": "object", + "required": [ + "style", + "type", + "value" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "inlineComment" + ] + }, + "value": { + "type": "string" + }, + "style": { + "$ref": "#/components/schemas/CommentStyle" + } + } + }, + { + "description": "A block comment. An example of this is the following: ```python,no_run /* This is a block comment */ 1 + 1 ``` Now this is important. The block comment is attached to the next line. This is always the case. Also the block comment doesn't have a new line above it. If it did it would be a `NewLineBlockComment`.", + "type": "object", + "required": [ + "style", + "type", + "value" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "blockComment" + ] + }, + "value": { + "type": "string" + }, + "style": { + "$ref": "#/components/schemas/CommentStyle" + } + } + }, + { + "description": "A block comment that has a new line above it. The user explicitly added a new line above the block comment.", + "type": "object", + "required": [ + "style", + "type", + "value" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "newLineBlockComment" + ] + }, + "value": { + "type": "string" + }, + "style": { + "$ref": "#/components/schemas/CommentStyle" + } + } + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "newLine" + ] + } + } + } + ] + }, + "CommentStyle": { + "oneOf": [ + { + "description": "Like // foo", + "type": "string", + "enum": [ + "line" + ] + }, + { + "description": "Like /* foo */", + "type": "string", + "enum": [ + "block" + ] + } + ] + }, + "ObjectProperty": { + "type": "object", + "required": [ + "end", + "key", + "start", + "value" + ], + "properties": { + "start": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "end": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "key": { + "$ref": "#/components/schemas/Identifier" + }, + "value": { + "$ref": "#/components/schemas/Expr" + }, + "digest": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + }, + "maxItems": 32, + "minItems": 32, + "nullable": true + } + } + }, + "VariableDeclarator": { + "type": "object", + "required": [ + "end", + "id", + "init", + "start" + ], + "properties": { + "start": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "end": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "id": { + "description": "The identifier of the variable.", + "allOf": [ + { + "$ref": "#/components/schemas/Identifier" + } + ] + }, + "init": { + "description": "The value of the variable.", + "allOf": [ + { + "$ref": "#/components/schemas/Expr" + } + ] + }, + "digest": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + }, + "maxItems": 32, + "minItems": 32, + "nullable": true + } + } + }, + "ItemVisibility": { + "type": "string", + "enum": [ + "default", + "export" + ] + }, + "VariableKind": { + "oneOf": [ + { + "description": "Declare a named constant.", + "type": "string", + "enum": [ + "const" + ] + }, + { + "description": "Declare a function.", + "type": "string", + "enum": [ + "fn" + ] + } + ] + }, + "ProgramMemory": { + "type": "object", + "required": [ + "currentEnv", + "environments" + ], + "properties": { + "environments": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Environment" + } + }, + "currentEnv": { + "$ref": "#/components/schemas/EnvironmentRef" + }, + "return": { + "allOf": [ + { + "$ref": "#/components/schemas/KclValue" + } + ], + "nullable": true + } + } + }, + "Environment": { + "type": "object", + "required": [ + "bindings" + ], + "properties": { + "bindings": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/KclValue" + } + }, + "parent": { + "allOf": [ + { + "$ref": "#/components/schemas/EnvironmentRef" + } + ], + "nullable": true + } + } + }, + "EnvironmentRef": { + "description": "An index pointing to an environment.", + "type": "integer", + "format": "uint", + "minimum": 0.0 + } + } + }, + "required": true + }, + { + "name": "elem", + "type": "KclValue", + "schema": { + "$schema": "https://spec.openapis.org/oas/3.0/schema/2019-04-02#/definitions/Schema", + "title": "KclValue", + "description": "Any KCL value.", + "oneOf": [ + { + "type": "object", + "required": [ + "__meta", + "type", + "value" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "UserVal" + ] + }, + "value": {}, + "__meta": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Metadata" + } + } + } + }, + { + "type": "object", + "required": [ + "__meta", + "type", + "value" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "TagIdentifier" + ] + }, + "value": { + "type": "string" + }, + "info": { + "allOf": [ + { + "$ref": "#/components/schemas/TagEngineInfo" + } + ], + "nullable": true + }, + "__meta": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Metadata" + } + } + } + }, + { + "type": "object", + "required": [ + "end", + "start", + "type", + "value" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "TagDeclarator" + ] + }, + "start": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "end": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "value": { + "type": "string" + }, + "digest": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + }, + "maxItems": 32, + "minItems": 32, + "nullable": true + } + } + }, + { + "description": "A plane.", + "type": "object", + "required": [ + "__meta", + "id", + "origin", + "type", + "value", + "xAxis", + "yAxis", + "zAxis" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "Plane" + ] + }, + "id": { + "description": "The id of the plane.", + "type": "string", + "format": "uuid" + }, + "value": { + "$ref": "#/components/schemas/PlaneType" + }, + "origin": { + "description": "Origin of the plane.", + "allOf": [ + { + "$ref": "#/components/schemas/Point3d" + } + ] + }, + "xAxis": { + "description": "What should the plane’s X axis be?", + "allOf": [ + { + "$ref": "#/components/schemas/Point3d" + } + ] + }, + "yAxis": { + "description": "What should the plane’s Y axis be?", + "allOf": [ + { + "$ref": "#/components/schemas/Point3d" + } + ] + }, + "zAxis": { + "description": "The z-axis (normal).", + "allOf": [ + { + "$ref": "#/components/schemas/Point3d" + } + ] + }, + "__meta": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Metadata" + } + } + } + }, + { + "description": "A face.", + "type": "object", + "required": [ + "__meta", + "id", + "solid", + "type", + "value", + "xAxis", + "yAxis", + "zAxis" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "Face" + ] + }, + "id": { + "description": "The id of the face.", + "type": "string", + "format": "uuid" + }, + "value": { + "description": "The tag of the face.", + "type": "string" + }, + "xAxis": { + "description": "What should the face’s X axis be?", + "allOf": [ + { + "$ref": "#/components/schemas/Point3d" + } + ] + }, + "yAxis": { + "description": "What should the face’s Y axis be?", + "allOf": [ + { + "$ref": "#/components/schemas/Point3d" + } + ] + }, + "zAxis": { + "description": "The z-axis (normal).", + "allOf": [ + { + "$ref": "#/components/schemas/Point3d" + } + ] + }, + "solid": { + "description": "The solid the face is on.", + "allOf": [ + { + "$ref": "#/components/schemas/Solid" + } + ] + }, + "__meta": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Metadata" + } + } + } + }, + { + "description": "An solid is a collection of extrude surfaces.", + "type": "object", + "required": [ + "__meta", + "height", + "id", + "sketch", + "type", + "value" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "Solid" + ] + }, + "id": { + "description": "The id of the solid.", + "type": "string", + "format": "uuid" + }, + "value": { + "description": "The extrude surfaces.", + "type": "array", + "items": { + "$ref": "#/components/schemas/ExtrudeSurface" + } + }, + "sketch": { + "description": "The sketch.", + "allOf": [ + { + "$ref": "#/components/schemas/Sketch" + } + ] + }, + "height": { + "description": "The height of the solid.", + "type": "number", + "format": "double" + }, + "startCapId": { + "description": "The id of the extrusion start cap", + "type": "string", + "format": "uuid", + "nullable": true + }, + "endCapId": { + "description": "The id of the extrusion end cap", + "type": "string", + "format": "uuid", + "nullable": true + }, + "edgeCuts": { + "description": "Chamfers or fillets on this solid.", + "type": "array", + "items": { + "$ref": "#/components/schemas/EdgeCut" + } + }, + "__meta": { + "description": "Metadata.", + "type": "array", + "items": { + "$ref": "#/components/schemas/Metadata" + } + } + } + }, + { + "type": "object", + "required": [ + "type", + "value" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "Solids" + ] + }, + "value": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Solid" + } + } + } + }, + { + "description": "Data for an imported geometry.", + "type": "object", + "required": [ + "__meta", + "id", + "type", + "value" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "ImportedGeometry" + ] + }, + "id": { + "description": "The ID of the imported geometry.", + "type": "string", + "format": "uuid" + }, + "value": { + "description": "The original file paths.", + "type": "array", + "items": { + "type": "string" + } + }, + "__meta": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Metadata" + } + } + } + }, + { + "type": "object", + "required": [ + "__meta", + "expression", + "memory", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "Function" + ] + }, + "expression": { + "$ref": "#/components/schemas/FunctionExpression" + }, + "memory": { + "$ref": "#/components/schemas/ProgramMemory" + }, + "__meta": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Metadata" + } + } + } + } + ], + "definitions": { + "KclValue": { + "description": "Any KCL value.", + "oneOf": [ + { + "type": "object", + "required": [ + "__meta", + "type", + "value" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "UserVal" + ] + }, + "value": {}, + "__meta": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Metadata" + } + } + } + }, + { + "type": "object", + "required": [ + "__meta", + "type", + "value" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "TagIdentifier" + ] + }, + "value": { + "type": "string" + }, + "info": { + "allOf": [ + { + "$ref": "#/components/schemas/TagEngineInfo" + } + ], + "nullable": true + }, + "__meta": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Metadata" + } + } + } + }, + { + "type": "object", + "required": [ + "end", + "start", + "type", + "value" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "TagDeclarator" + ] + }, + "start": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "end": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "value": { + "type": "string" + }, + "digest": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + }, + "maxItems": 32, + "minItems": 32, + "nullable": true + } + } + }, + { + "description": "A plane.", + "type": "object", + "required": [ + "__meta", + "id", + "origin", + "type", + "value", + "xAxis", + "yAxis", + "zAxis" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "Plane" + ] + }, + "id": { + "description": "The id of the plane.", + "type": "string", + "format": "uuid" + }, + "value": { + "$ref": "#/components/schemas/PlaneType" + }, + "origin": { + "description": "Origin of the plane.", + "allOf": [ + { + "$ref": "#/components/schemas/Point3d" + } + ] + }, + "xAxis": { + "description": "What should the plane’s X axis be?", + "allOf": [ + { + "$ref": "#/components/schemas/Point3d" + } + ] + }, + "yAxis": { + "description": "What should the plane’s Y axis be?", + "allOf": [ + { + "$ref": "#/components/schemas/Point3d" + } + ] + }, + "zAxis": { + "description": "The z-axis (normal).", + "allOf": [ + { + "$ref": "#/components/schemas/Point3d" + } + ] + }, + "__meta": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Metadata" + } + } + } + }, + { + "description": "A face.", + "type": "object", + "required": [ + "__meta", + "id", + "solid", + "type", + "value", + "xAxis", + "yAxis", + "zAxis" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "Face" + ] + }, + "id": { + "description": "The id of the face.", + "type": "string", + "format": "uuid" + }, + "value": { + "description": "The tag of the face.", + "type": "string" + }, + "xAxis": { + "description": "What should the face’s X axis be?", + "allOf": [ + { + "$ref": "#/components/schemas/Point3d" + } + ] + }, + "yAxis": { + "description": "What should the face’s Y axis be?", + "allOf": [ + { + "$ref": "#/components/schemas/Point3d" + } + ] + }, + "zAxis": { + "description": "The z-axis (normal).", + "allOf": [ + { + "$ref": "#/components/schemas/Point3d" + } + ] + }, + "solid": { + "description": "The solid the face is on.", + "allOf": [ + { + "$ref": "#/components/schemas/Solid" + } + ] + }, + "__meta": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Metadata" + } + } + } + }, + { + "description": "An solid is a collection of extrude surfaces.", + "type": "object", + "required": [ + "__meta", + "height", + "id", + "sketch", + "type", + "value" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "Solid" + ] + }, + "id": { + "description": "The id of the solid.", + "type": "string", + "format": "uuid" + }, + "value": { + "description": "The extrude surfaces.", + "type": "array", + "items": { + "$ref": "#/components/schemas/ExtrudeSurface" + } + }, + "sketch": { + "description": "The sketch.", + "allOf": [ + { + "$ref": "#/components/schemas/Sketch" + } + ] + }, + "height": { + "description": "The height of the solid.", + "type": "number", + "format": "double" + }, + "startCapId": { + "description": "The id of the extrusion start cap", + "type": "string", + "format": "uuid", + "nullable": true + }, + "endCapId": { + "description": "The id of the extrusion end cap", + "type": "string", + "format": "uuid", + "nullable": true + }, + "edgeCuts": { + "description": "Chamfers or fillets on this solid.", + "type": "array", + "items": { + "$ref": "#/components/schemas/EdgeCut" + } + }, + "__meta": { + "description": "Metadata.", + "type": "array", + "items": { + "$ref": "#/components/schemas/Metadata" + } + } + } + }, + { + "type": "object", + "required": [ + "type", + "value" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "Solids" + ] + }, + "value": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Solid" + } + } + } + }, + { + "description": "Data for an imported geometry.", + "type": "object", + "required": [ + "__meta", + "id", + "type", + "value" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "ImportedGeometry" + ] + }, + "id": { + "description": "The ID of the imported geometry.", + "type": "string", + "format": "uuid" + }, + "value": { + "description": "The original file paths.", + "type": "array", + "items": { + "type": "string" + } + }, + "__meta": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Metadata" + } + } + } + }, + { + "type": "object", + "required": [ + "__meta", + "expression", + "memory", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "Function" + ] + }, + "expression": { + "$ref": "#/components/schemas/FunctionExpression" + }, + "memory": { + "$ref": "#/components/schemas/ProgramMemory" + }, + "__meta": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Metadata" + } + } + } + } + ] + }, + "Metadata": { + "description": "Metadata.", + "type": "object", + "required": [ + "sourceRange" + ], + "properties": { + "sourceRange": { + "description": "The source range.", + "allOf": [ + { + "$ref": "#/components/schemas/SourceRange" + } + ] + } + } + }, + "SourceRange": { + "type": "array", + "items": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "maxItems": 2, + "minItems": 2 + }, + "TagEngineInfo": { + "description": "Engine information for a tag.", + "type": "object", + "oneOf": [ + { + "description": "The path the tag is on.", + "type": "object", + "required": [ + "path" + ], + "properties": { + "path": { + "$ref": "#/components/schemas/Path" + } + }, + "additionalProperties": false + }, + { + "description": "The surface information for the tag.", + "type": "object", + "required": [ + "surface" + ], + "properties": { + "surface": { + "$ref": "#/components/schemas/ExtrudeSurface" + } + }, + "additionalProperties": false + } + ], + "required": [ + "id", + "sketch" + ], + "properties": { + "id": { + "description": "The id of the tagged object.", + "type": "string", + "format": "uuid" + }, + "sketch": { + "description": "The sketch the tag is on.", + "type": "string", + "format": "uuid" + } + } + }, + "Path": { + "description": "A path.", + "oneOf": [ + { + "description": "A path that goes to a point.", + "type": "object", + "required": [ + "__geoMeta", + "from", + "to", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "ToPoint" + ] + }, + "from": { + "description": "The from point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "to": { + "description": "The to point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "tag": { + "description": "The tag of the path.", + "allOf": [ + { + "$ref": "#/components/schemas/TagDeclarator" + } + ], + "nullable": true + }, + "__geoMeta": { + "description": "Metadata.", + "allOf": [ + { + "$ref": "#/components/schemas/GeoMeta" + } + ] + } + } + }, + { + "description": "A arc that is tangential to the last path segment that goes to a point", + "type": "object", + "required": [ + "__geoMeta", + "ccw", + "center", + "from", + "to", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "TangentialArcTo" + ] + }, + "center": { + "description": "the arc's center", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "ccw": { + "description": "arc's direction", + "type": "boolean" + }, + "from": { + "description": "The from point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "to": { + "description": "The to point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "tag": { + "description": "The tag of the path.", + "allOf": [ + { + "$ref": "#/components/schemas/TagDeclarator" + } + ], + "nullable": true + }, + "__geoMeta": { + "description": "Metadata.", + "allOf": [ + { + "$ref": "#/components/schemas/GeoMeta" + } + ] + } + } + }, + { + "description": "A arc that is tangential to the last path segment", + "type": "object", + "required": [ + "__geoMeta", + "ccw", + "center", + "from", + "to", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "TangentialArc" + ] + }, + "center": { + "description": "the arc's center", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "ccw": { + "description": "arc's direction", + "type": "boolean" + }, + "from": { + "description": "The from point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "to": { + "description": "The to point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "tag": { + "description": "The tag of the path.", + "allOf": [ + { + "$ref": "#/components/schemas/TagDeclarator" + } + ], + "nullable": true + }, + "__geoMeta": { + "description": "Metadata.", + "allOf": [ + { + "$ref": "#/components/schemas/GeoMeta" + } + ] + } + } + }, + { + "description": "a complete arc", + "type": "object", + "required": [ + "__geoMeta", + "ccw", + "center", + "from", + "radius", + "to", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "Circle" + ] + }, + "center": { + "description": "the arc's center", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "radius": { + "description": "the arc's radius", + "type": "number", + "format": "double" + }, + "ccw": { + "description": "arc's direction", + "type": "boolean" + }, + "from": { + "description": "The from point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "to": { + "description": "The to point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "tag": { + "description": "The tag of the path.", + "allOf": [ + { + "$ref": "#/components/schemas/TagDeclarator" + } + ], + "nullable": true + }, + "__geoMeta": { + "description": "Metadata.", + "allOf": [ + { + "$ref": "#/components/schemas/GeoMeta" + } + ] + } + } + }, + { + "description": "A path that is horizontal.", + "type": "object", + "required": [ + "__geoMeta", + "from", + "to", + "type", + "x" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "Horizontal" + ] + }, + "x": { + "description": "The x coordinate.", + "type": "number", + "format": "double" + }, + "from": { + "description": "The from point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "to": { + "description": "The to point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "tag": { + "description": "The tag of the path.", + "allOf": [ + { + "$ref": "#/components/schemas/TagDeclarator" + } + ], + "nullable": true + }, + "__geoMeta": { + "description": "Metadata.", + "allOf": [ + { + "$ref": "#/components/schemas/GeoMeta" + } + ] + } + } + }, + { + "description": "An angled line to.", + "type": "object", + "required": [ + "__geoMeta", + "from", + "to", + "type" + ], + "properties": { + "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 + }, + "from": { + "description": "The from point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "to": { + "description": "The to point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "tag": { + "description": "The tag of the path.", + "allOf": [ + { + "$ref": "#/components/schemas/TagDeclarator" + } + ], + "nullable": true + }, + "__geoMeta": { + "description": "Metadata.", + "allOf": [ + { + "$ref": "#/components/schemas/GeoMeta" + } + ] + } + } + }, + { + "description": "A base path.", + "type": "object", + "required": [ + "__geoMeta", + "from", + "to", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "Base" + ] + }, + "from": { + "description": "The from point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "to": { + "description": "The to point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "tag": { + "description": "The tag of the path.", + "allOf": [ + { + "$ref": "#/components/schemas/TagDeclarator" + } + ], + "nullable": true + }, + "__geoMeta": { + "description": "Metadata.", + "allOf": [ + { + "$ref": "#/components/schemas/GeoMeta" + } + ] + } + } + }, + { + "description": "A circular arc, not necessarily tangential to the current point.", + "type": "object", + "required": [ + "__geoMeta", + "center", + "from", + "radius", + "to", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "Arc" + ] + }, + "center": { + "description": "Center of the circle that this arc is drawn on.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "radius": { + "description": "Radius of the circle that this arc is drawn on.", + "type": "number", + "format": "double" + }, + "from": { + "description": "The from point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "to": { + "description": "The to point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "tag": { + "description": "The tag of the path.", + "allOf": [ + { + "$ref": "#/components/schemas/TagDeclarator" + } + ], + "nullable": true + }, + "__geoMeta": { + "description": "Metadata.", + "allOf": [ + { + "$ref": "#/components/schemas/GeoMeta" + } + ] + } + } + } + ] + }, + "TagDeclarator": { + "type": "object", + "required": [ + "end", + "start", + "value" + ], + "properties": { + "start": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "end": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "value": { + "type": "string" + }, + "digest": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + }, + "maxItems": 32, + "minItems": 32, + "nullable": true + } + } + }, + "GeoMeta": { + "description": "Geometry metadata.", + "type": "object", + "required": [ + "id", + "sourceRange" + ], + "properties": { + "id": { + "description": "The id of the geometry.", + "type": "string", + "format": "uuid" + }, + "sourceRange": { + "description": "The source range.", + "allOf": [ + { + "$ref": "#/components/schemas/SourceRange" + } + ] + } + } + }, + "ExtrudeSurface": { + "description": "An extrude surface.", + "oneOf": [ + { + "description": "An extrude plane.", + "type": "object", + "required": [ + "faceId", + "id", + "sourceRange", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "extrudePlane" + ] + }, + "faceId": { + "description": "The face id for the extrude plane.", + "type": "string", + "format": "uuid" + }, + "tag": { + "description": "The tag.", + "allOf": [ + { + "$ref": "#/components/schemas/TagDeclarator" + } + ], + "nullable": true + }, + "id": { + "description": "The id of the geometry.", + "type": "string", + "format": "uuid" + }, + "sourceRange": { + "description": "The source range.", + "allOf": [ + { + "$ref": "#/components/schemas/SourceRange" + } + ] + } + } + }, + { + "description": "An extruded arc.", + "type": "object", + "required": [ + "faceId", + "id", + "sourceRange", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "extrudeArc" + ] + }, + "faceId": { + "description": "The face id for the extrude plane.", + "type": "string", + "format": "uuid" + }, + "tag": { + "description": "The tag.", + "allOf": [ + { + "$ref": "#/components/schemas/TagDeclarator" + } + ], + "nullable": true + }, + "id": { + "description": "The id of the geometry.", + "type": "string", + "format": "uuid" + }, + "sourceRange": { + "description": "The source range.", + "allOf": [ + { + "$ref": "#/components/schemas/SourceRange" + } + ] + } + } + }, + { + "description": "Geometry metadata.", + "type": "object", + "required": [ + "faceId", + "id", + "sourceRange", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "chamfer" + ] + }, + "faceId": { + "description": "The id for the chamfer surface.", + "type": "string", + "format": "uuid" + }, + "tag": { + "description": "The tag.", + "allOf": [ + { + "$ref": "#/components/schemas/TagDeclarator" + } + ], + "nullable": true + }, + "id": { + "description": "The id of the geometry.", + "type": "string", + "format": "uuid" + }, + "sourceRange": { + "description": "The source range.", + "allOf": [ + { + "$ref": "#/components/schemas/SourceRange" + } + ] + } + } + }, + { + "description": "Geometry metadata.", + "type": "object", + "required": [ + "faceId", + "id", + "sourceRange", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "fillet" + ] + }, + "faceId": { + "description": "The id for the fillet surface.", + "type": "string", + "format": "uuid" + }, + "tag": { + "description": "The tag.", + "allOf": [ + { + "$ref": "#/components/schemas/TagDeclarator" + } + ], + "nullable": true + }, + "id": { + "description": "The id of the geometry.", + "type": "string", + "format": "uuid" + }, + "sourceRange": { + "description": "The source range.", + "allOf": [ + { + "$ref": "#/components/schemas/SourceRange" + } + ] + } + } + } + ] + }, + "PlaneType": { + "description": "Type for a plane.", + "oneOf": [ + { + "type": "string", + "enum": [ + "XY", + "XZ", + "YZ" + ] + }, + { + "description": "A custom plane.", + "type": "string", + "enum": [ + "Custom" + ] + } + ] + }, + "Point3d": { + "type": "object", + "required": [ + "x", + "y", + "z" + ], + "properties": { + "x": { + "type": "number", + "format": "double" + }, + "y": { + "type": "number", + "format": "double" + }, + "z": { + "type": "number", + "format": "double" + } + } + }, + "Solid": { + "description": "An solid is a collection of extrude surfaces.", + "type": "object", + "required": [ + "__meta", + "height", + "id", + "sketch", + "value" + ], + "properties": { + "id": { + "description": "The id of the solid.", + "type": "string", + "format": "uuid" + }, + "value": { + "description": "The extrude surfaces.", + "type": "array", + "items": { + "$ref": "#/components/schemas/ExtrudeSurface" + } + }, + "sketch": { + "description": "The sketch.", + "allOf": [ + { + "$ref": "#/components/schemas/Sketch" + } + ] + }, + "height": { + "description": "The height of the solid.", + "type": "number", + "format": "double" + }, + "startCapId": { + "description": "The id of the extrusion start cap", + "type": "string", + "format": "uuid", + "nullable": true + }, + "endCapId": { + "description": "The id of the extrusion end cap", + "type": "string", + "format": "uuid", + "nullable": true + }, + "edgeCuts": { + "description": "Chamfers or fillets on this solid.", + "type": "array", + "items": { + "$ref": "#/components/schemas/EdgeCut" + } + }, + "__meta": { + "description": "Metadata.", + "type": "array", + "items": { + "$ref": "#/components/schemas/Metadata" + } + } + } + }, + "Sketch": { + "description": "A sketch is a collection of paths.", + "type": "object", + "required": [ + "__meta", + "id", + "on", + "paths", + "start" + ], + "properties": { + "id": { + "description": "The id of the sketch (this will change when the engine's reference to it changes).", + "type": "string", + "format": "uuid" + }, + "paths": { + "description": "The paths in the sketch.", + "type": "array", + "items": { + "$ref": "#/components/schemas/Path" + } + }, + "on": { + "description": "What the sketch is on (can be a plane or a face).", + "allOf": [ + { + "$ref": "#/components/schemas/SketchSurface" + } + ] + }, + "start": { + "description": "The starting path.", + "allOf": [ + { + "$ref": "#/components/schemas/BasePath" + } + ] + }, + "tags": { + "description": "Tag identifiers that have been declared in this sketch.", + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/TagIdentifier" + } + }, + "__meta": { + "description": "Metadata.", + "type": "array", + "items": { + "$ref": "#/components/schemas/Metadata" + } + } + } + }, + "SketchSurface": { + "description": "A sketch type.", + "oneOf": [ + { + "description": "A plane.", + "type": "object", + "required": [ + "__meta", + "id", + "origin", + "type", + "value", + "xAxis", + "yAxis", + "zAxis" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "plane" + ] + }, + "id": { + "description": "The id of the plane.", + "type": "string", + "format": "uuid" + }, + "value": { + "$ref": "#/components/schemas/PlaneType" + }, + "origin": { + "description": "Origin of the plane.", + "allOf": [ + { + "$ref": "#/components/schemas/Point3d" + } + ] + }, + "xAxis": { + "description": "What should the plane’s X axis be?", + "allOf": [ + { + "$ref": "#/components/schemas/Point3d" + } + ] + }, + "yAxis": { + "description": "What should the plane’s Y axis be?", + "allOf": [ + { + "$ref": "#/components/schemas/Point3d" + } + ] + }, + "zAxis": { + "description": "The z-axis (normal).", + "allOf": [ + { + "$ref": "#/components/schemas/Point3d" + } + ] + }, + "__meta": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Metadata" + } + } + } + }, + { + "description": "A face.", + "type": "object", + "required": [ + "__meta", + "id", + "solid", + "type", + "value", + "xAxis", + "yAxis", + "zAxis" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "face" + ] + }, + "id": { + "description": "The id of the face.", + "type": "string", + "format": "uuid" + }, + "value": { + "description": "The tag of the face.", + "type": "string" + }, + "xAxis": { + "description": "What should the face’s X axis be?", + "allOf": [ + { + "$ref": "#/components/schemas/Point3d" + } + ] + }, + "yAxis": { + "description": "What should the face’s Y axis be?", + "allOf": [ + { + "$ref": "#/components/schemas/Point3d" + } + ] + }, + "zAxis": { + "description": "The z-axis (normal).", + "allOf": [ + { + "$ref": "#/components/schemas/Point3d" + } + ] + }, + "solid": { + "description": "The solid the face is on.", + "allOf": [ + { + "$ref": "#/components/schemas/Solid" + } + ] + }, + "__meta": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Metadata" + } + } + } + } + ] + }, + "BasePath": { + "description": "A base path.", + "type": "object", + "required": [ + "__geoMeta", + "from", + "to" + ], + "properties": { + "from": { + "description": "The from point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "to": { + "description": "The to point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "tag": { + "description": "The tag of the path.", + "allOf": [ + { + "$ref": "#/components/schemas/TagDeclarator" + } + ], + "nullable": true + }, + "__geoMeta": { + "description": "Metadata.", + "allOf": [ + { + "$ref": "#/components/schemas/GeoMeta" + } + ] + } + } + }, + "TagIdentifier": { + "type": "object", + "required": [ + "__meta", + "value" + ], + "properties": { + "value": { + "type": "string" + }, + "info": { + "allOf": [ + { + "$ref": "#/components/schemas/TagEngineInfo" + } + ], + "nullable": true + }, + "__meta": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Metadata" + } + } + } + }, + "EdgeCut": { + "description": "A fillet or a chamfer.", + "oneOf": [ + { + "description": "A fillet.", + "type": "object", + "required": [ + "edgeId", + "id", + "radius", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "fillet" + ] + }, + "id": { + "description": "The id of the engine command that called this fillet.", + "type": "string", + "format": "uuid" + }, + "radius": { + "type": "number", + "format": "double" + }, + "edgeId": { + "description": "The engine id of the edge to fillet.", + "type": "string", + "format": "uuid" + }, + "tag": { + "allOf": [ + { + "$ref": "#/components/schemas/TagDeclarator" + } + ], + "nullable": true + } + } + }, + { + "description": "A chamfer.", + "type": "object", + "required": [ + "edgeId", + "id", + "length", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "chamfer" + ] + }, + "id": { + "description": "The id of the engine command that called this chamfer.", + "type": "string", + "format": "uuid" + }, + "length": { + "type": "number", + "format": "double" + }, + "edgeId": { + "description": "The engine id of the edge to chamfer.", + "type": "string", + "format": "uuid" + }, + "tag": { + "allOf": [ + { + "$ref": "#/components/schemas/TagDeclarator" + } + ], + "nullable": true + } + } + } + ] + }, + "FunctionExpression": { + "type": "object", + "required": [ + "body", + "end", + "params", + "start" + ], + "properties": { + "start": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "end": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "params": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Parameter" + } + }, + "body": { + "$ref": "#/components/schemas/Program" + }, + "digest": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + }, + "maxItems": 32, + "minItems": 32, + "nullable": true + } + } + }, + "Parameter": { + "description": "Parameter of a KCL function.", + "type": "object", + "required": [ + "identifier", + "optional" + ], + "properties": { + "identifier": { + "description": "The parameter's label or name.", + "allOf": [ + { + "$ref": "#/components/schemas/Identifier" + } + ] + }, + "optional": { + "description": "Is the parameter optional?", + "type": "boolean" + }, + "digest": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + }, + "maxItems": 32, + "minItems": 32, + "nullable": true + } + } + }, + "Identifier": { + "type": "object", + "required": [ + "end", + "name", + "start" + ], + "properties": { + "start": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "end": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "name": { + "type": "string" + }, + "digest": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + }, + "maxItems": 32, + "minItems": 32, + "nullable": true + } + } + }, + "Program": { + "description": "A KCL program top level, or function body.", + "type": "object", + "required": [ + "body", + "end", + "start" + ], + "properties": { + "start": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "end": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "body": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BodyItem" + } + }, + "nonCodeMeta": { + "$ref": "#/components/schemas/NonCodeMeta" + }, + "digest": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + }, + "maxItems": 32, + "minItems": 32, + "nullable": true + } + } + }, + "BodyItem": { + "oneOf": [ + { + "type": "object", + "required": [ + "end", + "items", + "path", + "raw_path", + "start", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "ImportStatement" + ] + }, + "start": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "end": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "items": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImportItem" + } + }, + "path": { + "type": "string" + }, + "raw_path": { + "type": "string" + }, + "digest": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + }, + "maxItems": 32, + "minItems": 32, + "nullable": true + } + } + }, + { + "type": "object", + "required": [ + "end", + "expression", + "start", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "ExpressionStatement" + ] + }, + "start": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "end": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "expression": { + "$ref": "#/components/schemas/Expr" + }, + "digest": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + }, + "maxItems": 32, + "minItems": 32, + "nullable": true + } + } + }, + { + "type": "object", + "required": [ + "declarations", + "end", + "kind", + "start", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "VariableDeclaration" + ] + }, + "start": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "end": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "declarations": { + "type": "array", + "items": { + "$ref": "#/components/schemas/VariableDeclarator" + } + }, + "visibility": { + "$ref": "#/components/schemas/ItemVisibility" + }, + "kind": { + "$ref": "#/components/schemas/VariableKind" + }, + "digest": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + }, + "maxItems": 32, + "minItems": 32, + "nullable": true + } + } + }, + { + "type": "object", + "required": [ + "argument", + "end", + "start", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "ReturnStatement" + ] + }, + "start": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "end": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "argument": { + "$ref": "#/components/schemas/Expr" + }, + "digest": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + }, + "maxItems": 32, + "minItems": 32, + "nullable": true + } + } + } + ] + }, + "ImportItem": { + "type": "object", + "required": [ + "end", + "name", + "start" + ], + "properties": { + "name": { + "description": "Name of the item to import.", + "allOf": [ + { + "$ref": "#/components/schemas/Identifier" + } + ] + }, + "alias": { + "description": "Rename the item using an identifier after \"as\".", + "allOf": [ + { + "$ref": "#/components/schemas/Identifier" + } + ], + "nullable": true + }, + "start": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "end": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "digest": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + }, + "maxItems": 32, + "minItems": 32, + "nullable": true + } + } + }, + "Expr": { + "description": "An expression can be evaluated to yield a single KCL value.", + "oneOf": [ + { + "type": "object", + "required": [ + "end", + "raw", + "start", + "type", + "value" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "Literal" + ] + }, + "start": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "end": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "value": { + "$ref": "#/components/schemas/LiteralValue" + }, + "raw": { + "type": "string" + }, + "digest": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + }, + "maxItems": 32, + "minItems": 32, + "nullable": true + } + } + }, + { + "type": "object", + "required": [ + "end", + "name", + "start", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "Identifier" + ] + }, + "start": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "end": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "name": { + "type": "string" + }, + "digest": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + }, + "maxItems": 32, + "minItems": 32, + "nullable": true + } + } + }, + { + "type": "object", + "required": [ + "end", + "start", + "type", + "value" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "TagDeclarator" + ] + }, + "start": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "end": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "value": { + "type": "string" + }, + "digest": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + }, + "maxItems": 32, + "minItems": 32, + "nullable": true + } + } + }, + { + "type": "object", + "required": [ + "end", + "left", + "operator", + "right", + "start", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "BinaryExpression" + ] + }, + "start": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "end": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "operator": { + "$ref": "#/components/schemas/BinaryOperator" + }, + "left": { + "$ref": "#/components/schemas/BinaryPart" + }, + "right": { + "$ref": "#/components/schemas/BinaryPart" + }, + "digest": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + }, + "maxItems": 32, + "minItems": 32, + "nullable": true + } + } + }, + { + "type": "object", + "required": [ + "body", + "end", + "params", + "start", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "FunctionExpression" + ] + }, + "start": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "end": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "params": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Parameter" + } + }, + "body": { + "$ref": "#/components/schemas/Program" + }, + "digest": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + }, + "maxItems": 32, + "minItems": 32, + "nullable": true + } + } + }, + { + "type": "object", + "required": [ + "arguments", + "callee", + "end", + "optional", + "start", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "CallExpression" + ] + }, + "start": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "end": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "callee": { + "$ref": "#/components/schemas/Identifier" + }, + "arguments": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Expr" + } + }, + "optional": { + "type": "boolean" + }, + "digest": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + }, + "maxItems": 32, + "minItems": 32, + "nullable": true + } + } + }, + { + "type": "object", + "required": [ + "body", + "end", + "start", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "PipeExpression" + ] + }, + "start": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "end": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "body": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Expr" + } + }, + "nonCodeMeta": { + "$ref": "#/components/schemas/NonCodeMeta" + }, + "digest": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + }, + "maxItems": 32, + "minItems": 32, + "nullable": true + } + } + }, + { + "type": "object", + "required": [ + "end", + "start", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "PipeSubstitution" + ] + }, + "start": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "end": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "digest": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + }, + "maxItems": 32, + "minItems": 32, + "nullable": true + } + } + }, + { + "type": "object", + "required": [ + "elements", + "end", + "start", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "ArrayExpression" + ] + }, + "start": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "end": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "elements": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Expr" + } + }, + "nonCodeMeta": { + "$ref": "#/components/schemas/NonCodeMeta" + }, + "digest": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + }, + "maxItems": 32, + "minItems": 32, + "nullable": true + } + } + }, + { + "type": "object", + "required": [ + "end", + "endElement", + "endInclusive", + "start", + "startElement", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "ArrayRangeExpression" + ] + }, + "start": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "end": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "startElement": { + "$ref": "#/components/schemas/Expr" + }, + "endElement": { + "$ref": "#/components/schemas/Expr" + }, + "endInclusive": { + "description": "Is the `end_element` included in the range?", + "type": "boolean" + }, + "digest": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + }, + "maxItems": 32, + "minItems": 32, + "nullable": true + } + } + }, + { + "type": "object", + "required": [ + "end", + "properties", + "start", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "ObjectExpression" + ] + }, + "start": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "end": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "properties": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ObjectProperty" + } + }, + "nonCodeMeta": { + "$ref": "#/components/schemas/NonCodeMeta" + }, + "digest": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + }, + "maxItems": 32, + "minItems": 32, + "nullable": true + } + } + }, + { + "type": "object", + "required": [ + "computed", + "end", + "object", + "property", + "start", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "MemberExpression" + ] + }, + "start": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "end": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "object": { + "$ref": "#/components/schemas/MemberObject" + }, + "property": { + "$ref": "#/components/schemas/LiteralIdentifier" + }, + "computed": { + "type": "boolean" + }, + "digest": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + }, + "maxItems": 32, + "minItems": 32, + "nullable": true + } + } + }, + { + "type": "object", + "required": [ + "argument", + "end", + "operator", + "start", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "UnaryExpression" + ] + }, + "start": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "end": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "operator": { + "$ref": "#/components/schemas/UnaryOperator" + }, + "argument": { + "$ref": "#/components/schemas/BinaryPart" + }, + "digest": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + }, + "maxItems": 32, + "minItems": 32, + "nullable": true + } + } + }, + { + "type": "object", + "required": [ + "cond", + "else_ifs", + "end", + "final_else", + "start", + "then_val", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "IfExpression" + ] + }, + "start": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "end": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "cond": { + "$ref": "#/components/schemas/Expr" + }, + "then_val": { + "$ref": "#/components/schemas/Program" + }, + "else_ifs": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ElseIf" + } + }, + "final_else": { + "$ref": "#/components/schemas/Program" + }, + "digest": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + }, + "maxItems": 32, + "minItems": 32, + "nullable": true + } + } + }, + { + "description": "KCL value for an optional parameter which was not given an argument. (remember, parameters are in the function declaration, arguments are in the function call/application).", + "type": "object", + "required": [ + "end", + "start", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "None" + ] + }, + "start": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "end": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + } + } + } + ] + }, + "LiteralValue": { + "anyOf": [ + { + "type": "integer", + "format": "int64" + }, + { + "type": "number", + "format": "double" + }, + { + "type": "string" + }, + { + "type": "boolean" + } + ] + }, + "BinaryOperator": { + "oneOf": [ + { + "description": "Add two numbers.", + "type": "string", + "enum": [ + "+" + ] + }, + { + "description": "Subtract two numbers.", + "type": "string", + "enum": [ + "-" + ] + }, + { + "description": "Multiply two numbers.", + "type": "string", + "enum": [ + "*" + ] + }, + { + "description": "Divide two numbers.", + "type": "string", + "enum": [ + "/" + ] + }, + { + "description": "Modulo two numbers.", + "type": "string", + "enum": [ + "%" + ] + }, + { + "description": "Raise a number to a power.", + "type": "string", + "enum": [ + "^" + ] + }, + { + "description": "Are two numbers equal?", + "type": "string", + "enum": [ + "==" + ] + }, + { + "description": "Are two numbers not equal?", + "type": "string", + "enum": [ + "!=" + ] + }, + { + "description": "Is left greater than right", + "type": "string", + "enum": [ + ">" + ] + }, + { + "description": "Is left greater than or equal to right", + "type": "string", + "enum": [ + ">=" + ] + }, + { + "description": "Is left less than right", + "type": "string", + "enum": [ + "<" + ] + }, + { + "description": "Is left less than or equal to right", + "type": "string", + "enum": [ + "<=" + ] + } + ] + }, + "BinaryPart": { + "oneOf": [ + { + "type": "object", + "required": [ + "end", + "raw", + "start", + "type", + "value" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "Literal" + ] + }, + "start": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "end": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "value": { + "$ref": "#/components/schemas/LiteralValue" + }, + "raw": { + "type": "string" + }, + "digest": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + }, + "maxItems": 32, + "minItems": 32, + "nullable": true + } + } + }, + { + "type": "object", + "required": [ + "end", + "name", + "start", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "Identifier" + ] + }, + "start": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "end": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "name": { + "type": "string" + }, + "digest": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + }, + "maxItems": 32, + "minItems": 32, + "nullable": true + } + } + }, + { + "type": "object", + "required": [ + "end", + "left", + "operator", + "right", + "start", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "BinaryExpression" + ] + }, + "start": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "end": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "operator": { + "$ref": "#/components/schemas/BinaryOperator" + }, + "left": { + "$ref": "#/components/schemas/BinaryPart" + }, + "right": { + "$ref": "#/components/schemas/BinaryPart" + }, + "digest": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + }, + "maxItems": 32, + "minItems": 32, + "nullable": true + } + } + }, + { + "type": "object", + "required": [ + "arguments", + "callee", + "end", + "optional", + "start", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "CallExpression" + ] + }, + "start": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "end": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "callee": { + "$ref": "#/components/schemas/Identifier" + }, + "arguments": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Expr" + } + }, + "optional": { + "type": "boolean" + }, + "digest": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + }, + "maxItems": 32, + "minItems": 32, + "nullable": true + } + } + }, + { + "type": "object", + "required": [ + "argument", + "end", + "operator", + "start", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "UnaryExpression" + ] + }, + "start": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "end": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "operator": { + "$ref": "#/components/schemas/UnaryOperator" + }, + "argument": { + "$ref": "#/components/schemas/BinaryPart" + }, + "digest": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + }, + "maxItems": 32, + "minItems": 32, + "nullable": true + } + } + }, + { + "type": "object", + "required": [ + "computed", + "end", + "object", + "property", + "start", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "MemberExpression" + ] + }, + "start": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "end": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "object": { + "$ref": "#/components/schemas/MemberObject" + }, + "property": { + "$ref": "#/components/schemas/LiteralIdentifier" + }, + "computed": { + "type": "boolean" + }, + "digest": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + }, + "maxItems": 32, + "minItems": 32, + "nullable": true + } + } + }, + { + "type": "object", + "required": [ + "cond", + "else_ifs", + "end", + "final_else", + "start", + "then_val", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "IfExpression" + ] + }, + "start": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "end": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "cond": { + "$ref": "#/components/schemas/Expr" + }, + "then_val": { + "$ref": "#/components/schemas/Program" + }, + "else_ifs": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ElseIf" + } + }, + "final_else": { + "$ref": "#/components/schemas/Program" + }, + "digest": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + }, + "maxItems": 32, + "minItems": 32, + "nullable": true + } + } + } + ] + }, + "UnaryOperator": { + "oneOf": [ + { + "description": "Negate a number.", + "type": "string", + "enum": [ + "-" + ] + }, + { + "description": "Negate a boolean.", + "type": "string", + "enum": [ + "!" + ] + } + ] + }, + "MemberObject": { + "oneOf": [ + { + "type": "object", + "required": [ + "computed", + "end", + "object", + "property", + "start", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "MemberExpression" + ] + }, + "start": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "end": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "object": { + "$ref": "#/components/schemas/MemberObject" + }, + "property": { + "$ref": "#/components/schemas/LiteralIdentifier" + }, + "computed": { + "type": "boolean" + }, + "digest": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + }, + "maxItems": 32, + "minItems": 32, + "nullable": true + } + } + }, + { + "type": "object", + "required": [ + "end", + "name", + "start", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "Identifier" + ] + }, + "start": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "end": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "name": { + "type": "string" + }, + "digest": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + }, + "maxItems": 32, + "minItems": 32, + "nullable": true + } + } + } + ] + }, + "LiteralIdentifier": { + "oneOf": [ + { + "type": "object", + "required": [ + "end", + "name", + "start", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "Identifier" + ] + }, + "start": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "end": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "name": { + "type": "string" + }, + "digest": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + }, + "maxItems": 32, + "minItems": 32, + "nullable": true + } + } + }, + { + "type": "object", + "required": [ + "end", + "raw", + "start", + "type", + "value" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "Literal" + ] + }, + "start": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "end": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "value": { + "$ref": "#/components/schemas/LiteralValue" + }, + "raw": { + "type": "string" + }, + "digest": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + }, + "maxItems": 32, + "minItems": 32, + "nullable": true + } + } + } + ] + }, + "ElseIf": { + "type": "object", + "required": [ + "cond", + "end", + "start", + "then_val" + ], + "properties": { + "start": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "end": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "cond": { + "$ref": "#/components/schemas/Expr" + }, + "then_val": { + "$ref": "#/components/schemas/Program" + }, + "digest": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + }, + "maxItems": 32, + "minItems": 32, + "nullable": true + } + } + }, + "NonCodeMeta": { + "type": "object", + "required": [ + "nonCodeNodes", + "start" + ], + "properties": { + "nonCodeNodes": { + "type": "object", + "additionalProperties": { + "type": "array", + "items": { + "$ref": "#/components/schemas/NonCodeNode" + } + } + }, + "start": { + "type": "array", + "items": { + "$ref": "#/components/schemas/NonCodeNode" + } + }, + "digest": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + }, + "maxItems": 32, + "minItems": 32, + "nullable": true + } + } + }, + "NonCodeNode": { + "type": "object", + "required": [ + "end", + "start", + "value" + ], + "properties": { + "start": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "end": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "value": { + "$ref": "#/components/schemas/NonCodeValue" + }, + "digest": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + }, + "maxItems": 32, + "minItems": 32, + "nullable": true + } + } + }, + "NonCodeValue": { + "oneOf": [ + { + "description": "A shebang. This is a special type of comment that is at the top of the file. It looks like this: ```python,no_run #!/usr/bin/env python ```", + "type": "object", + "required": [ + "type", + "value" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "shebang" + ] + }, + "value": { + "type": "string" + } + } + }, + { + "description": "An inline comment. Here are examples: `1 + 1 // This is an inline comment`. `1 + 1 /* Here's another */`.", + "type": "object", + "required": [ + "style", + "type", + "value" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "inlineComment" + ] + }, + "value": { + "type": "string" + }, + "style": { + "$ref": "#/components/schemas/CommentStyle" + } + } + }, + { + "description": "A block comment. An example of this is the following: ```python,no_run /* This is a block comment */ 1 + 1 ``` Now this is important. The block comment is attached to the next line. This is always the case. Also the block comment doesn't have a new line above it. If it did it would be a `NewLineBlockComment`.", + "type": "object", + "required": [ + "style", + "type", + "value" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "blockComment" + ] + }, + "value": { + "type": "string" + }, + "style": { + "$ref": "#/components/schemas/CommentStyle" + } + } + }, + { + "description": "A block comment that has a new line above it. The user explicitly added a new line above the block comment.", + "type": "object", + "required": [ + "style", + "type", + "value" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "newLineBlockComment" + ] + }, + "value": { + "type": "string" + }, + "style": { + "$ref": "#/components/schemas/CommentStyle" + } + } + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "newLine" + ] + } + } + } + ] + }, + "CommentStyle": { + "oneOf": [ + { + "description": "Like // foo", + "type": "string", + "enum": [ + "line" + ] + }, + { + "description": "Like /* foo */", + "type": "string", + "enum": [ + "block" + ] + } + ] + }, + "ObjectProperty": { + "type": "object", + "required": [ + "end", + "key", + "start", + "value" + ], + "properties": { + "start": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "end": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "key": { + "$ref": "#/components/schemas/Identifier" + }, + "value": { + "$ref": "#/components/schemas/Expr" + }, + "digest": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + }, + "maxItems": 32, + "minItems": 32, + "nullable": true + } + } + }, + "VariableDeclarator": { + "type": "object", + "required": [ + "end", + "id", + "init", + "start" + ], + "properties": { + "start": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "end": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "id": { + "description": "The identifier of the variable.", + "allOf": [ + { + "$ref": "#/components/schemas/Identifier" + } + ] + }, + "init": { + "description": "The value of the variable.", + "allOf": [ + { + "$ref": "#/components/schemas/Expr" + } + ] + }, + "digest": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + }, + "maxItems": 32, + "minItems": 32, + "nullable": true + } + } + }, + "ItemVisibility": { + "type": "string", + "enum": [ + "default", + "export" + ] + }, + "VariableKind": { + "oneOf": [ + { + "description": "Declare a named constant.", + "type": "string", + "enum": [ + "const" + ] + }, + { + "description": "Declare a function.", + "type": "string", + "enum": [ + "fn" + ] + } + ] + }, + "ProgramMemory": { + "type": "object", + "required": [ + "currentEnv", + "environments" + ], + "properties": { + "environments": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Environment" + } + }, + "currentEnv": { + "$ref": "#/components/schemas/EnvironmentRef" + }, + "return": { + "allOf": [ + { + "$ref": "#/components/schemas/KclValue" + } + ], + "nullable": true + } + } + }, + "Environment": { + "type": "object", + "required": [ + "bindings" + ], + "properties": { + "bindings": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/KclValue" + } + }, + "parent": { + "allOf": [ + { + "$ref": "#/components/schemas/EnvironmentRef" + } + ], + "nullable": true + } + } + }, + "EnvironmentRef": { + "description": "An index pointing to an environment.", + "type": "integer", + "format": "uint", + "minimum": 0.0 + } + } + }, + "required": true + } + ], + "returnValue": { + "name": "", + "type": "KclValue", + "schema": { + "$schema": "https://spec.openapis.org/oas/3.0/schema/2019-04-02#/definitions/Schema", + "title": "KclValue", + "description": "Any KCL value.", + "oneOf": [ + { + "type": "object", + "required": [ + "__meta", + "type", + "value" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "UserVal" + ] + }, + "value": {}, + "__meta": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Metadata" + } + } + } + }, + { + "type": "object", + "required": [ + "__meta", + "type", + "value" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "TagIdentifier" + ] + }, + "value": { + "type": "string" + }, + "info": { + "allOf": [ + { + "$ref": "#/components/schemas/TagEngineInfo" + } + ], + "nullable": true + }, + "__meta": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Metadata" + } + } + } + }, + { + "type": "object", + "required": [ + "end", + "start", + "type", + "value" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "TagDeclarator" + ] + }, + "start": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "end": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "value": { + "type": "string" + }, + "digest": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + }, + "maxItems": 32, + "minItems": 32, + "nullable": true + } + } + }, + { + "description": "A plane.", + "type": "object", + "required": [ + "__meta", + "id", + "origin", + "type", + "value", + "xAxis", + "yAxis", + "zAxis" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "Plane" + ] + }, + "id": { + "description": "The id of the plane.", + "type": "string", + "format": "uuid" + }, + "value": { + "$ref": "#/components/schemas/PlaneType" + }, + "origin": { + "description": "Origin of the plane.", + "allOf": [ + { + "$ref": "#/components/schemas/Point3d" + } + ] + }, + "xAxis": { + "description": "What should the plane’s X axis be?", + "allOf": [ + { + "$ref": "#/components/schemas/Point3d" + } + ] + }, + "yAxis": { + "description": "What should the plane’s Y axis be?", + "allOf": [ + { + "$ref": "#/components/schemas/Point3d" + } + ] + }, + "zAxis": { + "description": "The z-axis (normal).", + "allOf": [ + { + "$ref": "#/components/schemas/Point3d" + } + ] + }, + "__meta": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Metadata" + } + } + } + }, + { + "description": "A face.", + "type": "object", + "required": [ + "__meta", + "id", + "solid", + "type", + "value", + "xAxis", + "yAxis", + "zAxis" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "Face" + ] + }, + "id": { + "description": "The id of the face.", + "type": "string", + "format": "uuid" + }, + "value": { + "description": "The tag of the face.", + "type": "string" + }, + "xAxis": { + "description": "What should the face’s X axis be?", + "allOf": [ + { + "$ref": "#/components/schemas/Point3d" + } + ] + }, + "yAxis": { + "description": "What should the face’s Y axis be?", + "allOf": [ + { + "$ref": "#/components/schemas/Point3d" + } + ] + }, + "zAxis": { + "description": "The z-axis (normal).", + "allOf": [ + { + "$ref": "#/components/schemas/Point3d" + } + ] + }, + "solid": { + "description": "The solid the face is on.", + "allOf": [ + { + "$ref": "#/components/schemas/Solid" + } + ] + }, + "__meta": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Metadata" + } + } + } + }, + { + "description": "An solid is a collection of extrude surfaces.", + "type": "object", + "required": [ + "__meta", + "height", + "id", + "sketch", + "type", + "value" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "Solid" + ] + }, + "id": { + "description": "The id of the solid.", + "type": "string", + "format": "uuid" + }, + "value": { + "description": "The extrude surfaces.", + "type": "array", + "items": { + "$ref": "#/components/schemas/ExtrudeSurface" + } + }, + "sketch": { + "description": "The sketch.", + "allOf": [ + { + "$ref": "#/components/schemas/Sketch" + } + ] + }, + "height": { + "description": "The height of the solid.", + "type": "number", + "format": "double" + }, + "startCapId": { + "description": "The id of the extrusion start cap", + "type": "string", + "format": "uuid", + "nullable": true + }, + "endCapId": { + "description": "The id of the extrusion end cap", + "type": "string", + "format": "uuid", + "nullable": true + }, + "edgeCuts": { + "description": "Chamfers or fillets on this solid.", + "type": "array", + "items": { + "$ref": "#/components/schemas/EdgeCut" + } + }, + "__meta": { + "description": "Metadata.", + "type": "array", + "items": { + "$ref": "#/components/schemas/Metadata" + } + } + } + }, + { + "type": "object", + "required": [ + "type", + "value" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "Solids" + ] + }, + "value": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Solid" + } + } + } + }, + { + "description": "Data for an imported geometry.", + "type": "object", + "required": [ + "__meta", + "id", + "type", + "value" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "ImportedGeometry" + ] + }, + "id": { + "description": "The ID of the imported geometry.", + "type": "string", + "format": "uuid" + }, + "value": { + "description": "The original file paths.", + "type": "array", + "items": { + "type": "string" + } + }, + "__meta": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Metadata" + } + } + } + }, + { + "type": "object", + "required": [ + "__meta", + "expression", + "memory", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "Function" + ] + }, + "expression": { + "$ref": "#/components/schemas/FunctionExpression" + }, + "memory": { + "$ref": "#/components/schemas/ProgramMemory" + }, + "__meta": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Metadata" + } + } + } + } + ], + "definitions": { + "Metadata": { + "description": "Metadata.", + "type": "object", + "required": [ + "sourceRange" + ], + "properties": { + "sourceRange": { + "description": "The source range.", + "allOf": [ + { + "$ref": "#/components/schemas/SourceRange" + } + ] + } + } + }, + "SourceRange": { + "type": "array", + "items": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "maxItems": 2, + "minItems": 2 + }, + "TagEngineInfo": { + "description": "Engine information for a tag.", + "type": "object", + "oneOf": [ + { + "description": "The path the tag is on.", + "type": "object", + "required": [ + "path" + ], + "properties": { + "path": { + "$ref": "#/components/schemas/Path" + } + }, + "additionalProperties": false + }, + { + "description": "The surface information for the tag.", + "type": "object", + "required": [ + "surface" + ], + "properties": { + "surface": { + "$ref": "#/components/schemas/ExtrudeSurface" + } + }, + "additionalProperties": false + } + ], + "required": [ + "id", + "sketch" + ], + "properties": { + "id": { + "description": "The id of the tagged object.", + "type": "string", + "format": "uuid" + }, + "sketch": { + "description": "The sketch the tag is on.", + "type": "string", + "format": "uuid" + } + } + }, + "Path": { + "description": "A path.", + "oneOf": [ + { + "description": "A path that goes to a point.", + "type": "object", + "required": [ + "__geoMeta", + "from", + "to", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "ToPoint" + ] + }, + "from": { + "description": "The from point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "to": { + "description": "The to point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "tag": { + "description": "The tag of the path.", + "allOf": [ + { + "$ref": "#/components/schemas/TagDeclarator" + } + ], + "nullable": true + }, + "__geoMeta": { + "description": "Metadata.", + "allOf": [ + { + "$ref": "#/components/schemas/GeoMeta" + } + ] + } + } + }, + { + "description": "A arc that is tangential to the last path segment that goes to a point", + "type": "object", + "required": [ + "__geoMeta", + "ccw", + "center", + "from", + "to", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "TangentialArcTo" + ] + }, + "center": { + "description": "the arc's center", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "ccw": { + "description": "arc's direction", + "type": "boolean" + }, + "from": { + "description": "The from point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "to": { + "description": "The to point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "tag": { + "description": "The tag of the path.", + "allOf": [ + { + "$ref": "#/components/schemas/TagDeclarator" + } + ], + "nullable": true + }, + "__geoMeta": { + "description": "Metadata.", + "allOf": [ + { + "$ref": "#/components/schemas/GeoMeta" + } + ] + } + } + }, + { + "description": "A arc that is tangential to the last path segment", + "type": "object", + "required": [ + "__geoMeta", + "ccw", + "center", + "from", + "to", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "TangentialArc" + ] + }, + "center": { + "description": "the arc's center", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "ccw": { + "description": "arc's direction", + "type": "boolean" + }, + "from": { + "description": "The from point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "to": { + "description": "The to point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "tag": { + "description": "The tag of the path.", + "allOf": [ + { + "$ref": "#/components/schemas/TagDeclarator" + } + ], + "nullable": true + }, + "__geoMeta": { + "description": "Metadata.", + "allOf": [ + { + "$ref": "#/components/schemas/GeoMeta" + } + ] + } + } + }, + { + "description": "a complete arc", + "type": "object", + "required": [ + "__geoMeta", + "ccw", + "center", + "from", + "radius", + "to", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "Circle" + ] + }, + "center": { + "description": "the arc's center", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "radius": { + "description": "the arc's radius", + "type": "number", + "format": "double" + }, + "ccw": { + "description": "arc's direction", + "type": "boolean" + }, + "from": { + "description": "The from point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "to": { + "description": "The to point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "tag": { + "description": "The tag of the path.", + "allOf": [ + { + "$ref": "#/components/schemas/TagDeclarator" + } + ], + "nullable": true + }, + "__geoMeta": { + "description": "Metadata.", + "allOf": [ + { + "$ref": "#/components/schemas/GeoMeta" + } + ] + } + } + }, + { + "description": "A path that is horizontal.", + "type": "object", + "required": [ + "__geoMeta", + "from", + "to", + "type", + "x" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "Horizontal" + ] + }, + "x": { + "description": "The x coordinate.", + "type": "number", + "format": "double" + }, + "from": { + "description": "The from point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "to": { + "description": "The to point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "tag": { + "description": "The tag of the path.", + "allOf": [ + { + "$ref": "#/components/schemas/TagDeclarator" + } + ], + "nullable": true + }, + "__geoMeta": { + "description": "Metadata.", + "allOf": [ + { + "$ref": "#/components/schemas/GeoMeta" + } + ] + } + } + }, + { + "description": "An angled line to.", + "type": "object", + "required": [ + "__geoMeta", + "from", + "to", + "type" + ], + "properties": { + "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 + }, + "from": { + "description": "The from point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "to": { + "description": "The to point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "tag": { + "description": "The tag of the path.", + "allOf": [ + { + "$ref": "#/components/schemas/TagDeclarator" + } + ], + "nullable": true + }, + "__geoMeta": { + "description": "Metadata.", + "allOf": [ + { + "$ref": "#/components/schemas/GeoMeta" + } + ] + } + } + }, + { + "description": "A base path.", + "type": "object", + "required": [ + "__geoMeta", + "from", + "to", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "Base" + ] + }, + "from": { + "description": "The from point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "to": { + "description": "The to point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "tag": { + "description": "The tag of the path.", + "allOf": [ + { + "$ref": "#/components/schemas/TagDeclarator" + } + ], + "nullable": true + }, + "__geoMeta": { + "description": "Metadata.", + "allOf": [ + { + "$ref": "#/components/schemas/GeoMeta" + } + ] + } + } + }, + { + "description": "A circular arc, not necessarily tangential to the current point.", + "type": "object", + "required": [ + "__geoMeta", + "center", + "from", + "radius", + "to", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "Arc" + ] + }, + "center": { + "description": "Center of the circle that this arc is drawn on.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "radius": { + "description": "Radius of the circle that this arc is drawn on.", + "type": "number", + "format": "double" + }, + "from": { + "description": "The from point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "to": { + "description": "The to point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "tag": { + "description": "The tag of the path.", + "allOf": [ + { + "$ref": "#/components/schemas/TagDeclarator" + } + ], + "nullable": true + }, + "__geoMeta": { + "description": "Metadata.", + "allOf": [ + { + "$ref": "#/components/schemas/GeoMeta" + } + ] + } + } + } + ] + }, + "TagDeclarator": { + "type": "object", + "required": [ + "end", + "start", + "value" + ], + "properties": { + "start": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "end": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "value": { + "type": "string" + }, + "digest": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + }, + "maxItems": 32, + "minItems": 32, + "nullable": true + } + } + }, + "GeoMeta": { + "description": "Geometry metadata.", + "type": "object", + "required": [ + "id", + "sourceRange" + ], + "properties": { + "id": { + "description": "The id of the geometry.", + "type": "string", + "format": "uuid" + }, + "sourceRange": { + "description": "The source range.", + "allOf": [ + { + "$ref": "#/components/schemas/SourceRange" + } + ] + } + } + }, + "ExtrudeSurface": { + "description": "An extrude surface.", + "oneOf": [ + { + "description": "An extrude plane.", + "type": "object", + "required": [ + "faceId", + "id", + "sourceRange", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "extrudePlane" + ] + }, + "faceId": { + "description": "The face id for the extrude plane.", + "type": "string", + "format": "uuid" + }, + "tag": { + "description": "The tag.", + "allOf": [ + { + "$ref": "#/components/schemas/TagDeclarator" + } + ], + "nullable": true + }, + "id": { + "description": "The id of the geometry.", + "type": "string", + "format": "uuid" + }, + "sourceRange": { + "description": "The source range.", + "allOf": [ + { + "$ref": "#/components/schemas/SourceRange" + } + ] + } + } + }, + { + "description": "An extruded arc.", + "type": "object", + "required": [ + "faceId", + "id", + "sourceRange", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "extrudeArc" + ] + }, + "faceId": { + "description": "The face id for the extrude plane.", + "type": "string", + "format": "uuid" + }, + "tag": { + "description": "The tag.", + "allOf": [ + { + "$ref": "#/components/schemas/TagDeclarator" + } + ], + "nullable": true + }, + "id": { + "description": "The id of the geometry.", + "type": "string", + "format": "uuid" + }, + "sourceRange": { + "description": "The source range.", + "allOf": [ + { + "$ref": "#/components/schemas/SourceRange" + } + ] + } + } + }, + { + "description": "Geometry metadata.", + "type": "object", + "required": [ + "faceId", + "id", + "sourceRange", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "chamfer" + ] + }, + "faceId": { + "description": "The id for the chamfer surface.", + "type": "string", + "format": "uuid" + }, + "tag": { + "description": "The tag.", + "allOf": [ + { + "$ref": "#/components/schemas/TagDeclarator" + } + ], + "nullable": true + }, + "id": { + "description": "The id of the geometry.", + "type": "string", + "format": "uuid" + }, + "sourceRange": { + "description": "The source range.", + "allOf": [ + { + "$ref": "#/components/schemas/SourceRange" + } + ] + } + } + }, + { + "description": "Geometry metadata.", + "type": "object", + "required": [ + "faceId", + "id", + "sourceRange", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "fillet" + ] + }, + "faceId": { + "description": "The id for the fillet surface.", + "type": "string", + "format": "uuid" + }, + "tag": { + "description": "The tag.", + "allOf": [ + { + "$ref": "#/components/schemas/TagDeclarator" + } + ], + "nullable": true + }, + "id": { + "description": "The id of the geometry.", + "type": "string", + "format": "uuid" + }, + "sourceRange": { + "description": "The source range.", + "allOf": [ + { + "$ref": "#/components/schemas/SourceRange" + } + ] + } + } + } + ] + }, + "PlaneType": { + "description": "Type for a plane.", + "oneOf": [ + { + "type": "string", + "enum": [ + "XY", + "XZ", + "YZ" + ] + }, + { + "description": "A custom plane.", + "type": "string", + "enum": [ + "Custom" + ] + } + ] + }, + "Point3d": { + "type": "object", + "required": [ + "x", + "y", + "z" + ], + "properties": { + "x": { + "type": "number", + "format": "double" + }, + "y": { + "type": "number", + "format": "double" + }, + "z": { + "type": "number", + "format": "double" + } + } + }, + "Solid": { + "description": "An solid is a collection of extrude surfaces.", + "type": "object", + "required": [ + "__meta", + "height", + "id", + "sketch", + "value" + ], + "properties": { + "id": { + "description": "The id of the solid.", + "type": "string", + "format": "uuid" + }, + "value": { + "description": "The extrude surfaces.", + "type": "array", + "items": { + "$ref": "#/components/schemas/ExtrudeSurface" + } + }, + "sketch": { + "description": "The sketch.", + "allOf": [ + { + "$ref": "#/components/schemas/Sketch" + } + ] + }, + "height": { + "description": "The height of the solid.", + "type": "number", + "format": "double" + }, + "startCapId": { + "description": "The id of the extrusion start cap", + "type": "string", + "format": "uuid", + "nullable": true + }, + "endCapId": { + "description": "The id of the extrusion end cap", + "type": "string", + "format": "uuid", + "nullable": true + }, + "edgeCuts": { + "description": "Chamfers or fillets on this solid.", + "type": "array", + "items": { + "$ref": "#/components/schemas/EdgeCut" + } + }, + "__meta": { + "description": "Metadata.", + "type": "array", + "items": { + "$ref": "#/components/schemas/Metadata" + } + } + } + }, + "Sketch": { + "description": "A sketch is a collection of paths.", + "type": "object", + "required": [ + "__meta", + "id", + "on", + "paths", + "start" + ], + "properties": { + "id": { + "description": "The id of the sketch (this will change when the engine's reference to it changes).", + "type": "string", + "format": "uuid" + }, + "paths": { + "description": "The paths in the sketch.", + "type": "array", + "items": { + "$ref": "#/components/schemas/Path" + } + }, + "on": { + "description": "What the sketch is on (can be a plane or a face).", + "allOf": [ + { + "$ref": "#/components/schemas/SketchSurface" + } + ] + }, + "start": { + "description": "The starting path.", + "allOf": [ + { + "$ref": "#/components/schemas/BasePath" + } + ] + }, + "tags": { + "description": "Tag identifiers that have been declared in this sketch.", + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/TagIdentifier" + } + }, + "__meta": { + "description": "Metadata.", + "type": "array", + "items": { + "$ref": "#/components/schemas/Metadata" + } + } + } + }, + "SketchSurface": { + "description": "A sketch type.", + "oneOf": [ + { + "description": "A plane.", + "type": "object", + "required": [ + "__meta", + "id", + "origin", + "type", + "value", + "xAxis", + "yAxis", + "zAxis" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "plane" + ] + }, + "id": { + "description": "The id of the plane.", + "type": "string", + "format": "uuid" + }, + "value": { + "$ref": "#/components/schemas/PlaneType" + }, + "origin": { + "description": "Origin of the plane.", + "allOf": [ + { + "$ref": "#/components/schemas/Point3d" + } + ] + }, + "xAxis": { + "description": "What should the plane’s X axis be?", + "allOf": [ + { + "$ref": "#/components/schemas/Point3d" + } + ] + }, + "yAxis": { + "description": "What should the plane’s Y axis be?", + "allOf": [ + { + "$ref": "#/components/schemas/Point3d" + } + ] + }, + "zAxis": { + "description": "The z-axis (normal).", + "allOf": [ + { + "$ref": "#/components/schemas/Point3d" + } + ] + }, + "__meta": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Metadata" + } + } + } + }, + { + "description": "A face.", + "type": "object", + "required": [ + "__meta", + "id", + "solid", + "type", + "value", + "xAxis", + "yAxis", + "zAxis" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "face" + ] + }, + "id": { + "description": "The id of the face.", + "type": "string", + "format": "uuid" + }, + "value": { + "description": "The tag of the face.", + "type": "string" + }, + "xAxis": { + "description": "What should the face’s X axis be?", + "allOf": [ + { + "$ref": "#/components/schemas/Point3d" + } + ] + }, + "yAxis": { + "description": "What should the face’s Y axis be?", + "allOf": [ + { + "$ref": "#/components/schemas/Point3d" + } + ] + }, + "zAxis": { + "description": "The z-axis (normal).", + "allOf": [ + { + "$ref": "#/components/schemas/Point3d" + } + ] + }, + "solid": { + "description": "The solid the face is on.", + "allOf": [ + { + "$ref": "#/components/schemas/Solid" + } + ] + }, + "__meta": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Metadata" + } + } + } + } + ] + }, + "BasePath": { + "description": "A base path.", + "type": "object", + "required": [ + "__geoMeta", + "from", + "to" + ], + "properties": { + "from": { + "description": "The from point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "to": { + "description": "The to point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "tag": { + "description": "The tag of the path.", + "allOf": [ + { + "$ref": "#/components/schemas/TagDeclarator" + } + ], + "nullable": true + }, + "__geoMeta": { + "description": "Metadata.", + "allOf": [ + { + "$ref": "#/components/schemas/GeoMeta" + } + ] + } + } + }, + "TagIdentifier": { + "type": "object", + "required": [ + "__meta", + "value" + ], + "properties": { + "value": { + "type": "string" + }, + "info": { + "allOf": [ + { + "$ref": "#/components/schemas/TagEngineInfo" + } + ], + "nullable": true + }, + "__meta": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Metadata" + } + } + } + }, + "EdgeCut": { + "description": "A fillet or a chamfer.", + "oneOf": [ + { + "description": "A fillet.", + "type": "object", + "required": [ + "edgeId", + "id", + "radius", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "fillet" + ] + }, + "id": { + "description": "The id of the engine command that called this fillet.", + "type": "string", + "format": "uuid" + }, + "radius": { + "type": "number", + "format": "double" + }, + "edgeId": { + "description": "The engine id of the edge to fillet.", + "type": "string", + "format": "uuid" + }, + "tag": { + "allOf": [ + { + "$ref": "#/components/schemas/TagDeclarator" + } + ], + "nullable": true + } + } + }, + { + "description": "A chamfer.", + "type": "object", + "required": [ + "edgeId", + "id", + "length", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "chamfer" + ] + }, + "id": { + "description": "The id of the engine command that called this chamfer.", + "type": "string", + "format": "uuid" + }, + "length": { + "type": "number", + "format": "double" + }, + "edgeId": { + "description": "The engine id of the edge to chamfer.", + "type": "string", + "format": "uuid" + }, + "tag": { + "allOf": [ + { + "$ref": "#/components/schemas/TagDeclarator" + } + ], + "nullable": true + } + } + } + ] + }, + "FunctionExpression": { + "type": "object", + "required": [ + "body", + "end", + "params", + "start" + ], + "properties": { + "start": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "end": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "params": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Parameter" + } + }, + "body": { + "$ref": "#/components/schemas/Program" + }, + "digest": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + }, + "maxItems": 32, + "minItems": 32, + "nullable": true + } + } + }, + "Parameter": { + "description": "Parameter of a KCL function.", + "type": "object", + "required": [ + "identifier", + "optional" + ], + "properties": { + "identifier": { + "description": "The parameter's label or name.", + "allOf": [ + { + "$ref": "#/components/schemas/Identifier" + } + ] + }, + "optional": { + "description": "Is the parameter optional?", + "type": "boolean" + }, + "digest": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + }, + "maxItems": 32, + "minItems": 32, + "nullable": true + } + } + }, + "Identifier": { + "type": "object", + "required": [ + "end", + "name", + "start" + ], + "properties": { + "start": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "end": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "name": { + "type": "string" + }, + "digest": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + }, + "maxItems": 32, + "minItems": 32, + "nullable": true + } + } + }, + "Program": { + "description": "A KCL program top level, or function body.", + "type": "object", + "required": [ + "body", + "end", + "start" + ], + "properties": { + "start": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "end": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "body": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BodyItem" + } + }, + "nonCodeMeta": { + "$ref": "#/components/schemas/NonCodeMeta" + }, + "digest": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + }, + "maxItems": 32, + "minItems": 32, + "nullable": true + } + } + }, + "BodyItem": { + "oneOf": [ + { + "type": "object", + "required": [ + "end", + "items", + "path", + "raw_path", + "start", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "ImportStatement" + ] + }, + "start": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "end": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "items": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImportItem" + } + }, + "path": { + "type": "string" + }, + "raw_path": { + "type": "string" + }, + "digest": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + }, + "maxItems": 32, + "minItems": 32, + "nullable": true + } + } + }, + { + "type": "object", + "required": [ + "end", + "expression", + "start", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "ExpressionStatement" + ] + }, + "start": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "end": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "expression": { + "$ref": "#/components/schemas/Expr" + }, + "digest": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + }, + "maxItems": 32, + "minItems": 32, + "nullable": true + } + } + }, + { + "type": "object", + "required": [ + "declarations", + "end", + "kind", + "start", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "VariableDeclaration" + ] + }, + "start": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "end": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "declarations": { + "type": "array", + "items": { + "$ref": "#/components/schemas/VariableDeclarator" + } + }, + "visibility": { + "$ref": "#/components/schemas/ItemVisibility" + }, + "kind": { + "$ref": "#/components/schemas/VariableKind" + }, + "digest": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + }, + "maxItems": 32, + "minItems": 32, + "nullable": true + } + } + }, + { + "type": "object", + "required": [ + "argument", + "end", + "start", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "ReturnStatement" + ] + }, + "start": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "end": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "argument": { + "$ref": "#/components/schemas/Expr" + }, + "digest": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + }, + "maxItems": 32, + "minItems": 32, + "nullable": true + } + } + } + ] + }, + "ImportItem": { + "type": "object", + "required": [ + "end", + "name", + "start" + ], + "properties": { + "name": { + "description": "Name of the item to import.", + "allOf": [ + { + "$ref": "#/components/schemas/Identifier" + } + ] + }, + "alias": { + "description": "Rename the item using an identifier after \"as\".", + "allOf": [ + { + "$ref": "#/components/schemas/Identifier" + } + ], + "nullable": true + }, + "start": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "end": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "digest": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + }, + "maxItems": 32, + "minItems": 32, + "nullable": true + } + } + }, + "Expr": { + "description": "An expression can be evaluated to yield a single KCL value.", + "oneOf": [ + { + "type": "object", + "required": [ + "end", + "raw", + "start", + "type", + "value" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "Literal" + ] + }, + "start": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "end": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "value": { + "$ref": "#/components/schemas/LiteralValue" + }, + "raw": { + "type": "string" + }, + "digest": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + }, + "maxItems": 32, + "minItems": 32, + "nullable": true + } + } + }, + { + "type": "object", + "required": [ + "end", + "name", + "start", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "Identifier" + ] + }, + "start": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "end": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "name": { + "type": "string" + }, + "digest": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + }, + "maxItems": 32, + "minItems": 32, + "nullable": true + } + } + }, + { + "type": "object", + "required": [ + "end", + "start", + "type", + "value" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "TagDeclarator" + ] + }, + "start": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "end": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "value": { + "type": "string" + }, + "digest": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + }, + "maxItems": 32, + "minItems": 32, + "nullable": true + } + } + }, + { + "type": "object", + "required": [ + "end", + "left", + "operator", + "right", + "start", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "BinaryExpression" + ] + }, + "start": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "end": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "operator": { + "$ref": "#/components/schemas/BinaryOperator" + }, + "left": { + "$ref": "#/components/schemas/BinaryPart" + }, + "right": { + "$ref": "#/components/schemas/BinaryPart" + }, + "digest": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + }, + "maxItems": 32, + "minItems": 32, + "nullable": true + } + } + }, + { + "type": "object", + "required": [ + "body", + "end", + "params", + "start", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "FunctionExpression" + ] + }, + "start": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "end": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "params": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Parameter" + } + }, + "body": { + "$ref": "#/components/schemas/Program" + }, + "digest": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + }, + "maxItems": 32, + "minItems": 32, + "nullable": true + } + } + }, + { + "type": "object", + "required": [ + "arguments", + "callee", + "end", + "optional", + "start", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "CallExpression" + ] + }, + "start": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "end": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "callee": { + "$ref": "#/components/schemas/Identifier" + }, + "arguments": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Expr" + } + }, + "optional": { + "type": "boolean" + }, + "digest": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + }, + "maxItems": 32, + "minItems": 32, + "nullable": true + } + } + }, + { + "type": "object", + "required": [ + "body", + "end", + "start", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "PipeExpression" + ] + }, + "start": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "end": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "body": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Expr" + } + }, + "nonCodeMeta": { + "$ref": "#/components/schemas/NonCodeMeta" + }, + "digest": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + }, + "maxItems": 32, + "minItems": 32, + "nullable": true + } + } + }, + { + "type": "object", + "required": [ + "end", + "start", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "PipeSubstitution" + ] + }, + "start": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "end": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "digest": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + }, + "maxItems": 32, + "minItems": 32, + "nullable": true + } + } + }, + { + "type": "object", + "required": [ + "elements", + "end", + "start", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "ArrayExpression" + ] + }, + "start": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "end": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "elements": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Expr" + } + }, + "nonCodeMeta": { + "$ref": "#/components/schemas/NonCodeMeta" + }, + "digest": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + }, + "maxItems": 32, + "minItems": 32, + "nullable": true + } + } + }, + { + "type": "object", + "required": [ + "end", + "endElement", + "endInclusive", + "start", + "startElement", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "ArrayRangeExpression" + ] + }, + "start": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "end": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "startElement": { + "$ref": "#/components/schemas/Expr" + }, + "endElement": { + "$ref": "#/components/schemas/Expr" + }, + "endInclusive": { + "description": "Is the `end_element` included in the range?", + "type": "boolean" + }, + "digest": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + }, + "maxItems": 32, + "minItems": 32, + "nullable": true + } + } + }, + { + "type": "object", + "required": [ + "end", + "properties", + "start", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "ObjectExpression" + ] + }, + "start": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "end": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "properties": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ObjectProperty" + } + }, + "nonCodeMeta": { + "$ref": "#/components/schemas/NonCodeMeta" + }, + "digest": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + }, + "maxItems": 32, + "minItems": 32, + "nullable": true + } + } + }, + { + "type": "object", + "required": [ + "computed", + "end", + "object", + "property", + "start", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "MemberExpression" + ] + }, + "start": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "end": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "object": { + "$ref": "#/components/schemas/MemberObject" + }, + "property": { + "$ref": "#/components/schemas/LiteralIdentifier" + }, + "computed": { + "type": "boolean" + }, + "digest": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + }, + "maxItems": 32, + "minItems": 32, + "nullable": true + } + } + }, + { + "type": "object", + "required": [ + "argument", + "end", + "operator", + "start", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "UnaryExpression" + ] + }, + "start": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "end": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "operator": { + "$ref": "#/components/schemas/UnaryOperator" + }, + "argument": { + "$ref": "#/components/schemas/BinaryPart" + }, + "digest": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + }, + "maxItems": 32, + "minItems": 32, + "nullable": true + } + } + }, + { + "type": "object", + "required": [ + "cond", + "else_ifs", + "end", + "final_else", + "start", + "then_val", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "IfExpression" + ] + }, + "start": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "end": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "cond": { + "$ref": "#/components/schemas/Expr" + }, + "then_val": { + "$ref": "#/components/schemas/Program" + }, + "else_ifs": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ElseIf" + } + }, + "final_else": { + "$ref": "#/components/schemas/Program" + }, + "digest": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + }, + "maxItems": 32, + "minItems": 32, + "nullable": true + } + } + }, + { + "description": "KCL value for an optional parameter which was not given an argument. (remember, parameters are in the function declaration, arguments are in the function call/application).", + "type": "object", + "required": [ + "end", + "start", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "None" + ] + }, + "start": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "end": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + } + } + } + ] + }, + "LiteralValue": { + "anyOf": [ + { + "type": "integer", + "format": "int64" + }, + { + "type": "number", + "format": "double" + }, + { + "type": "string" + }, + { + "type": "boolean" + } + ] + }, + "BinaryOperator": { + "oneOf": [ + { + "description": "Add two numbers.", + "type": "string", + "enum": [ + "+" + ] + }, + { + "description": "Subtract two numbers.", + "type": "string", + "enum": [ + "-" + ] + }, + { + "description": "Multiply two numbers.", + "type": "string", + "enum": [ + "*" + ] + }, + { + "description": "Divide two numbers.", + "type": "string", + "enum": [ + "/" + ] + }, + { + "description": "Modulo two numbers.", + "type": "string", + "enum": [ + "%" + ] + }, + { + "description": "Raise a number to a power.", + "type": "string", + "enum": [ + "^" + ] + }, + { + "description": "Are two numbers equal?", + "type": "string", + "enum": [ + "==" + ] + }, + { + "description": "Are two numbers not equal?", + "type": "string", + "enum": [ + "!=" + ] + }, + { + "description": "Is left greater than right", + "type": "string", + "enum": [ + ">" + ] + }, + { + "description": "Is left greater than or equal to right", + "type": "string", + "enum": [ + ">=" + ] + }, + { + "description": "Is left less than right", + "type": "string", + "enum": [ + "<" + ] + }, + { + "description": "Is left less than or equal to right", + "type": "string", + "enum": [ + "<=" + ] + } + ] + }, + "BinaryPart": { + "oneOf": [ + { + "type": "object", + "required": [ + "end", + "raw", + "start", + "type", + "value" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "Literal" + ] + }, + "start": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "end": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "value": { + "$ref": "#/components/schemas/LiteralValue" + }, + "raw": { + "type": "string" + }, + "digest": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + }, + "maxItems": 32, + "minItems": 32, + "nullable": true + } + } + }, + { + "type": "object", + "required": [ + "end", + "name", + "start", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "Identifier" + ] + }, + "start": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "end": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "name": { + "type": "string" + }, + "digest": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + }, + "maxItems": 32, + "minItems": 32, + "nullable": true + } + } + }, + { + "type": "object", + "required": [ + "end", + "left", + "operator", + "right", + "start", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "BinaryExpression" + ] + }, + "start": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "end": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "operator": { + "$ref": "#/components/schemas/BinaryOperator" + }, + "left": { + "$ref": "#/components/schemas/BinaryPart" + }, + "right": { + "$ref": "#/components/schemas/BinaryPart" + }, + "digest": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + }, + "maxItems": 32, + "minItems": 32, + "nullable": true + } + } + }, + { + "type": "object", + "required": [ + "arguments", + "callee", + "end", + "optional", + "start", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "CallExpression" + ] + }, + "start": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "end": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "callee": { + "$ref": "#/components/schemas/Identifier" + }, + "arguments": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Expr" + } + }, + "optional": { + "type": "boolean" + }, + "digest": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + }, + "maxItems": 32, + "minItems": 32, + "nullable": true + } + } + }, + { + "type": "object", + "required": [ + "argument", + "end", + "operator", + "start", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "UnaryExpression" + ] + }, + "start": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "end": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "operator": { + "$ref": "#/components/schemas/UnaryOperator" + }, + "argument": { + "$ref": "#/components/schemas/BinaryPart" + }, + "digest": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + }, + "maxItems": 32, + "minItems": 32, + "nullable": true + } + } + }, + { + "type": "object", + "required": [ + "computed", + "end", + "object", + "property", + "start", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "MemberExpression" + ] + }, + "start": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "end": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "object": { + "$ref": "#/components/schemas/MemberObject" + }, + "property": { + "$ref": "#/components/schemas/LiteralIdentifier" + }, + "computed": { + "type": "boolean" + }, + "digest": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + }, + "maxItems": 32, + "minItems": 32, + "nullable": true + } + } + }, + { + "type": "object", + "required": [ + "cond", + "else_ifs", + "end", + "final_else", + "start", + "then_val", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "IfExpression" + ] + }, + "start": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "end": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "cond": { + "$ref": "#/components/schemas/Expr" + }, + "then_val": { + "$ref": "#/components/schemas/Program" + }, + "else_ifs": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ElseIf" + } + }, + "final_else": { + "$ref": "#/components/schemas/Program" + }, + "digest": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + }, + "maxItems": 32, + "minItems": 32, + "nullable": true + } + } + } + ] + }, + "UnaryOperator": { + "oneOf": [ + { + "description": "Negate a number.", + "type": "string", + "enum": [ + "-" + ] + }, + { + "description": "Negate a boolean.", + "type": "string", + "enum": [ + "!" + ] + } + ] + }, + "MemberObject": { + "oneOf": [ + { + "type": "object", + "required": [ + "computed", + "end", + "object", + "property", + "start", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "MemberExpression" + ] + }, + "start": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "end": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "object": { + "$ref": "#/components/schemas/MemberObject" + }, + "property": { + "$ref": "#/components/schemas/LiteralIdentifier" + }, + "computed": { + "type": "boolean" + }, + "digest": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + }, + "maxItems": 32, + "minItems": 32, + "nullable": true + } + } + }, + { + "type": "object", + "required": [ + "end", + "name", + "start", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "Identifier" + ] + }, + "start": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "end": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "name": { + "type": "string" + }, + "digest": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + }, + "maxItems": 32, + "minItems": 32, + "nullable": true + } + } + } + ] + }, + "LiteralIdentifier": { + "oneOf": [ + { + "type": "object", + "required": [ + "end", + "name", + "start", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "Identifier" + ] + }, + "start": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "end": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "name": { + "type": "string" + }, + "digest": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + }, + "maxItems": 32, + "minItems": 32, + "nullable": true + } + } + }, + { + "type": "object", + "required": [ + "end", + "raw", + "start", + "type", + "value" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "Literal" + ] + }, + "start": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "end": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "value": { + "$ref": "#/components/schemas/LiteralValue" + }, + "raw": { + "type": "string" + }, + "digest": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + }, + "maxItems": 32, + "minItems": 32, + "nullable": true + } + } + } + ] + }, + "ElseIf": { + "type": "object", + "required": [ + "cond", + "end", + "start", + "then_val" + ], + "properties": { + "start": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "end": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "cond": { + "$ref": "#/components/schemas/Expr" + }, + "then_val": { + "$ref": "#/components/schemas/Program" + }, + "digest": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + }, + "maxItems": 32, + "minItems": 32, + "nullable": true + } + } + }, + "NonCodeMeta": { + "type": "object", + "required": [ + "nonCodeNodes", + "start" + ], + "properties": { + "nonCodeNodes": { + "type": "object", + "additionalProperties": { + "type": "array", + "items": { + "$ref": "#/components/schemas/NonCodeNode" + } + } + }, + "start": { + "type": "array", + "items": { + "$ref": "#/components/schemas/NonCodeNode" + } + }, + "digest": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + }, + "maxItems": 32, + "minItems": 32, + "nullable": true + } + } + }, + "NonCodeNode": { + "type": "object", + "required": [ + "end", + "start", + "value" + ], + "properties": { + "start": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "end": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "value": { + "$ref": "#/components/schemas/NonCodeValue" + }, + "digest": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + }, + "maxItems": 32, + "minItems": 32, + "nullable": true + } + } + }, + "NonCodeValue": { + "oneOf": [ + { + "description": "A shebang. This is a special type of comment that is at the top of the file. It looks like this: ```python,no_run #!/usr/bin/env python ```", + "type": "object", + "required": [ + "type", + "value" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "shebang" + ] + }, + "value": { + "type": "string" + } + } + }, + { + "description": "An inline comment. Here are examples: `1 + 1 // This is an inline comment`. `1 + 1 /* Here's another */`.", + "type": "object", + "required": [ + "style", + "type", + "value" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "inlineComment" + ] + }, + "value": { + "type": "string" + }, + "style": { + "$ref": "#/components/schemas/CommentStyle" + } + } + }, + { + "description": "A block comment. An example of this is the following: ```python,no_run /* This is a block comment */ 1 + 1 ``` Now this is important. The block comment is attached to the next line. This is always the case. Also the block comment doesn't have a new line above it. If it did it would be a `NewLineBlockComment`.", + "type": "object", + "required": [ + "style", + "type", + "value" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "blockComment" + ] + }, + "value": { + "type": "string" + }, + "style": { + "$ref": "#/components/schemas/CommentStyle" + } + } + }, + { + "description": "A block comment that has a new line above it. The user explicitly added a new line above the block comment.", + "type": "object", + "required": [ + "style", + "type", + "value" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "newLineBlockComment" + ] + }, + "value": { + "type": "string" + }, + "style": { + "$ref": "#/components/schemas/CommentStyle" + } + } + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "newLine" + ] + } + } + } + ] + }, + "CommentStyle": { + "oneOf": [ + { + "description": "Like // foo", + "type": "string", + "enum": [ + "line" + ] + }, + { + "description": "Like /* foo */", + "type": "string", + "enum": [ + "block" + ] + } + ] + }, + "ObjectProperty": { + "type": "object", + "required": [ + "end", + "key", + "start", + "value" + ], + "properties": { + "start": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "end": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "key": { + "$ref": "#/components/schemas/Identifier" + }, + "value": { + "$ref": "#/components/schemas/Expr" + }, + "digest": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + }, + "maxItems": 32, + "minItems": 32, + "nullable": true + } + } + }, + "VariableDeclarator": { + "type": "object", + "required": [ + "end", + "id", + "init", + "start" + ], + "properties": { + "start": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "end": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "id": { + "description": "The identifier of the variable.", + "allOf": [ + { + "$ref": "#/components/schemas/Identifier" + } + ] + }, + "init": { + "description": "The value of the variable.", + "allOf": [ + { + "$ref": "#/components/schemas/Expr" + } + ] + }, + "digest": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + }, + "maxItems": 32, + "minItems": 32, + "nullable": true + } + } + }, + "ItemVisibility": { + "type": "string", + "enum": [ + "default", + "export" + ] + }, + "VariableKind": { + "oneOf": [ + { + "description": "Declare a named constant.", + "type": "string", + "enum": [ + "const" + ] + }, + { + "description": "Declare a function.", + "type": "string", + "enum": [ + "fn" + ] + } + ] + }, + "ProgramMemory": { + "type": "object", + "required": [ + "currentEnv", + "environments" + ], + "properties": { + "environments": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Environment" + } + }, + "currentEnv": { + "$ref": "#/components/schemas/EnvironmentRef" + }, + "return": { + "allOf": [ + { + "$ref": "#/components/schemas/KclValue" + } + ], + "nullable": true + } + } + }, + "Environment": { + "type": "object", + "required": [ + "bindings" + ], + "properties": { + "bindings": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/KclValue" + } + }, + "parent": { + "allOf": [ + { + "$ref": "#/components/schemas/EnvironmentRef" + } + ], + "nullable": true + } + } + }, + "KclValue": { + "description": "Any KCL value.", + "oneOf": [ + { + "type": "object", + "required": [ + "__meta", + "type", + "value" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "UserVal" + ] + }, + "value": {}, + "__meta": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Metadata" + } + } + } + }, + { + "type": "object", + "required": [ + "__meta", + "type", + "value" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "TagIdentifier" + ] + }, + "value": { + "type": "string" + }, + "info": { + "allOf": [ + { + "$ref": "#/components/schemas/TagEngineInfo" + } + ], + "nullable": true + }, + "__meta": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Metadata" + } + } + } + }, + { + "type": "object", + "required": [ + "end", + "start", + "type", + "value" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "TagDeclarator" + ] + }, + "start": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "end": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "value": { + "type": "string" + }, + "digest": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + }, + "maxItems": 32, + "minItems": 32, + "nullable": true + } + } + }, + { + "description": "A plane.", + "type": "object", + "required": [ + "__meta", + "id", + "origin", + "type", + "value", + "xAxis", + "yAxis", + "zAxis" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "Plane" + ] + }, + "id": { + "description": "The id of the plane.", + "type": "string", + "format": "uuid" + }, + "value": { + "$ref": "#/components/schemas/PlaneType" + }, + "origin": { + "description": "Origin of the plane.", + "allOf": [ + { + "$ref": "#/components/schemas/Point3d" + } + ] + }, + "xAxis": { + "description": "What should the plane’s X axis be?", + "allOf": [ + { + "$ref": "#/components/schemas/Point3d" + } + ] + }, + "yAxis": { + "description": "What should the plane’s Y axis be?", + "allOf": [ + { + "$ref": "#/components/schemas/Point3d" + } + ] + }, + "zAxis": { + "description": "The z-axis (normal).", + "allOf": [ + { + "$ref": "#/components/schemas/Point3d" + } + ] + }, + "__meta": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Metadata" + } + } + } + }, + { + "description": "A face.", + "type": "object", + "required": [ + "__meta", + "id", + "solid", + "type", + "value", + "xAxis", + "yAxis", + "zAxis" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "Face" + ] + }, + "id": { + "description": "The id of the face.", + "type": "string", + "format": "uuid" + }, + "value": { + "description": "The tag of the face.", + "type": "string" + }, + "xAxis": { + "description": "What should the face’s X axis be?", + "allOf": [ + { + "$ref": "#/components/schemas/Point3d" + } + ] + }, + "yAxis": { + "description": "What should the face’s Y axis be?", + "allOf": [ + { + "$ref": "#/components/schemas/Point3d" + } + ] + }, + "zAxis": { + "description": "The z-axis (normal).", + "allOf": [ + { + "$ref": "#/components/schemas/Point3d" + } + ] + }, + "solid": { + "description": "The solid the face is on.", + "allOf": [ + { + "$ref": "#/components/schemas/Solid" + } + ] + }, + "__meta": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Metadata" + } + } + } + }, + { + "description": "An solid is a collection of extrude surfaces.", + "type": "object", + "required": [ + "__meta", + "height", + "id", + "sketch", + "type", + "value" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "Solid" + ] + }, + "id": { + "description": "The id of the solid.", + "type": "string", + "format": "uuid" + }, + "value": { + "description": "The extrude surfaces.", + "type": "array", + "items": { + "$ref": "#/components/schemas/ExtrudeSurface" + } + }, + "sketch": { + "description": "The sketch.", + "allOf": [ + { + "$ref": "#/components/schemas/Sketch" + } + ] + }, + "height": { + "description": "The height of the solid.", + "type": "number", + "format": "double" + }, + "startCapId": { + "description": "The id of the extrusion start cap", + "type": "string", + "format": "uuid", + "nullable": true + }, + "endCapId": { + "description": "The id of the extrusion end cap", + "type": "string", + "format": "uuid", + "nullable": true + }, + "edgeCuts": { + "description": "Chamfers or fillets on this solid.", + "type": "array", + "items": { + "$ref": "#/components/schemas/EdgeCut" + } + }, + "__meta": { + "description": "Metadata.", + "type": "array", + "items": { + "$ref": "#/components/schemas/Metadata" + } + } + } + }, + { + "type": "object", + "required": [ + "type", + "value" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "Solids" + ] + }, + "value": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Solid" + } + } + } + }, + { + "description": "Data for an imported geometry.", + "type": "object", + "required": [ + "__meta", + "id", + "type", + "value" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "ImportedGeometry" + ] + }, + "id": { + "description": "The ID of the imported geometry.", + "type": "string", + "format": "uuid" + }, + "value": { + "description": "The original file paths.", + "type": "array", + "items": { + "type": "string" + } + }, + "__meta": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Metadata" + } + } + } + }, + { + "type": "object", + "required": [ + "__meta", + "expression", + "memory", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "Function" + ] + }, + "expression": { + "$ref": "#/components/schemas/FunctionExpression" + }, + "memory": { + "$ref": "#/components/schemas/ProgramMemory" + }, + "__meta": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Metadata" + } + } + } + } + ] + }, + "EnvironmentRef": { + "description": "An index pointing to an environment.", + "type": "integer", + "format": "uint", + "minimum": 0.0 + } + } + }, + "required": true + }, + "unpublished": false, + "deprecated": false, + "examples": [ + "arr = [1, 2, 3]\nnew_arr = push(arr, 4)\nassertEqual(new_arr[3], 4, 0.00001, \"4 was added to the end of the array\")" + ] + }, { "name": "reduce", "summary": "Take a starting value. Then, for each element of an array, calculate the next value,", diff --git a/docs/kcl/types/PolygonData.md b/docs/kcl/types/PolygonData.md new file mode 100644 index 000000000..1f7a05429 --- /dev/null +++ b/docs/kcl/types/PolygonData.md @@ -0,0 +1,24 @@ +--- +title: "PolygonData" +excerpt: "Data for drawing a polygon" +layout: manual +--- + +Data for drawing a polygon + +**Type:** `object` + + + + + +## Properties + +| Property | Type | Description | Required | +|----------|------|-------------|----------| +| `radius` |`number`| The radius of the polygon | No | +| `numSides` |`integer`| The number of sides in the polygon | No | +| `center` |`[number, number]`| The center point of the polygon | No | +| `inscribed` |`boolean`| Whether the polygon is inscribed (true) or circumscribed (false) about a circle with the specified radius | No | + + diff --git a/e2e/playwright/snapshot-tests.spec.ts-snapshots/Client-side-scene-scale-should-match-engine-scale-Millimeter-scale-1-Google-Chrome-win32.png b/e2e/playwright/snapshot-tests.spec.ts-snapshots/Client-side-scene-scale-should-match-engine-scale-Millimeter-scale-1-Google-Chrome-win32.png index d072cf76e..0c5da89c1 100644 Binary files a/e2e/playwright/snapshot-tests.spec.ts-snapshots/Client-side-scene-scale-should-match-engine-scale-Millimeter-scale-1-Google-Chrome-win32.png and b/e2e/playwright/snapshot-tests.spec.ts-snapshots/Client-side-scene-scale-should-match-engine-scale-Millimeter-scale-1-Google-Chrome-win32.png differ diff --git a/e2e/playwright/snapshot-tests.spec.ts-snapshots/Client-side-scene-scale-should-match-engine-scale-Millimeter-scale-2-Google-Chrome-win32.png b/e2e/playwright/snapshot-tests.spec.ts-snapshots/Client-side-scene-scale-should-match-engine-scale-Millimeter-scale-2-Google-Chrome-win32.png index 0a291d1b7..ab82fb0aa 100644 Binary files a/e2e/playwright/snapshot-tests.spec.ts-snapshots/Client-side-scene-scale-should-match-engine-scale-Millimeter-scale-2-Google-Chrome-win32.png and b/e2e/playwright/snapshot-tests.spec.ts-snapshots/Client-side-scene-scale-should-match-engine-scale-Millimeter-scale-2-Google-Chrome-win32.png differ diff --git a/e2e/playwright/snapshot-tests.spec.ts-snapshots/Sketch-on-face-with-none-z-up-1-Google-Chrome-win32.png b/e2e/playwright/snapshot-tests.spec.ts-snapshots/Sketch-on-face-with-none-z-up-1-Google-Chrome-win32.png index abd80123b..ba30cd7e1 100644 Binary files a/e2e/playwright/snapshot-tests.spec.ts-snapshots/Sketch-on-face-with-none-z-up-1-Google-Chrome-win32.png and b/e2e/playwright/snapshot-tests.spec.ts-snapshots/Sketch-on-face-with-none-z-up-1-Google-Chrome-win32.png differ diff --git a/src/Toolbar.tsx b/src/Toolbar.tsx index 540bc9647..35ec85df6 100644 --- a/src/Toolbar.tsx +++ b/src/Toolbar.tsx @@ -100,6 +100,11 @@ export function Toolbar({ function resolveItemConfig( maybeIconConfig: ToolbarItem ): ToolbarItemResolved { + const isDisabled = + disableAllButtons || + maybeIconConfig.status !== 'available' || + maybeIconConfig.disabled?.(state) === true + return { ...maybeIconConfig, title: @@ -113,10 +118,11 @@ export function Toolbar({ typeof maybeIconConfig.hotkey === 'string' ? maybeIconConfig.hotkey : maybeIconConfig.hotkey?.(state), - disabled: - disableAllButtons || - maybeIconConfig.status !== 'available' || - maybeIconConfig.disabled?.(state) === true, + disabled: isDisabled, + disabledReason: + typeof maybeIconConfig.disabledReason === 'function' + ? maybeIconConfig.disabledReason(state) + : maybeIconConfig.disabledReason, disableHotkey: maybeIconConfig.disableHotkey?.(state), status: maybeIconConfig.status, } @@ -273,6 +279,8 @@ const ToolbarItemTooltip = memo(function ToolbarItemContents({ itemConfig: ToolbarItemResolved configCallbackProps: ToolbarItemCallbackProps }) { + const { state } = useModelingContext() + useHotkeys( itemConfig.hotkey || '', () => { @@ -336,6 +344,17 @@ const ToolbarItemTooltip = memo(function ToolbarItemContents({ )}
{itemConfig.description}
+ {/* Add disabled reason if item is disabled */} + {itemConfig.disabled && itemConfig.disabledReason && ( + <> ++ {typeof itemConfig.disabledReason === 'function' + ? itemConfig.disabledReason(state) + : itemConfig.disabledReason} +
+ > + )} {itemConfig.links.length > 0 && ( <>