diff --git a/docs/kcl/std.json b/docs/kcl/std.json index 9349825c2..d1faedf6d 100644 --- a/docs/kcl/std.json +++ b/docs/kcl/std.json @@ -38511,16 +38511,1993 @@ "deprecated": false }, { - "name": "patternCircular", - "summary": "A Circular pattern.", + "name": "patternCircular2d", + "summary": "A circular pattern on a 2D sketch.", "description": "", "tags": [], "args": [ { "name": "data", - "type": "CircularPatternData", + "type": "CircularPattern2dData", "schema": { - "description": "Data for a circular pattern.", + "description": "Data for a circular pattern on a 2D sketch.", + "type": "object", + "required": [ + "arcDegrees", + "center", + "repetitions", + "rotateDuplicates" + ], + "properties": { + "arcDegrees": { + "description": "The arc angle (in degrees) to place the repetitions. Must be greater than 0.", + "type": "number", + "format": "double" + }, + "center": { + "description": "The center about which to make th pattern. This is a 2D vector.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "repetitions": { + "description": "The number of repetitions. Must be greater than 0. This excludes the original entity. For example, if `repetitions` is 1, the original entity will be copied once.", + "type": "integer", + "format": "uint32", + "minimum": 0.0 + }, + "rotateDuplicates": { + "description": "Whether or not to rotate the duplicates as they are copied.", + "type": "boolean" + } + } + }, + "required": true + }, + { + "name": "sketch_group", + "type": "SketchGroup", + "schema": { + "description": "A sketch group is a collection of paths.", + "type": "object", + "required": [ + "__meta", + "id", + "on", + "position", + "rotation", + "start", + "value", + "xAxis", + "yAxis", + "zAxis" + ], + "properties": { + "__meta": { + "description": "Metadata.", + "type": "array", + "items": { + "description": "Metadata.", + "type": "object", + "required": [ + "sourceRange" + ], + "properties": { + "sourceRange": { + "description": "The source range.", + "type": "array", + "items": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "maxItems": 2, + "minItems": 2 + } + } + } + }, + "entityId": { + "description": "The plane id or face id of the sketch group.", + "type": "string", + "format": "uuid", + "nullable": true + }, + "id": { + "description": "The id of the sketch group.", + "type": "string", + "format": "uuid" + }, + "on": { + "description": "What the sketch is on (can be a plane or a face).", + "oneOf": [ + { + "description": "A plane.", + "type": "object", + "required": [ + "__meta", + "id", + "origin", + "type", + "value", + "xAxis", + "yAxis", + "zAxis" + ], + "properties": { + "__meta": { + "type": "array", + "items": { + "description": "Metadata.", + "type": "object", + "required": [ + "sourceRange" + ], + "properties": { + "sourceRange": { + "description": "The source range.", + "type": "array", + "items": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "maxItems": 2, + "minItems": 2 + } + } + } + }, + "id": { + "description": "The id of the plane.", + "type": "string", + "format": "uuid" + }, + "origin": { + "description": "Origin of the plane.", + "type": "object", + "required": [ + "x", + "y", + "z" + ], + "properties": { + "x": { + "type": "number", + "format": "double" + }, + "y": { + "type": "number", + "format": "double" + }, + "z": { + "type": "number", + "format": "double" + } + } + }, + "type": { + "type": "string", + "enum": [ + "plane" + ] + }, + "value": { + "description": "Type for a plane.", + "oneOf": [ + { + "type": "string", + "enum": [ + "XY", + "XZ", + "YZ" + ] + }, + { + "description": "A custom plane.", + "type": "string", + "enum": [ + "Custom" + ] + } + ] + }, + "xAxis": { + "description": "What should the plane’s X axis be?", + "type": "object", + "required": [ + "x", + "y", + "z" + ], + "properties": { + "x": { + "type": "number", + "format": "double" + }, + "y": { + "type": "number", + "format": "double" + }, + "z": { + "type": "number", + "format": "double" + } + } + }, + "yAxis": { + "description": "What should the plane’s Y axis be?", + "type": "object", + "required": [ + "x", + "y", + "z" + ], + "properties": { + "x": { + "type": "number", + "format": "double" + }, + "y": { + "type": "number", + "format": "double" + }, + "z": { + "type": "number", + "format": "double" + } + } + }, + "zAxis": { + "description": "The z-axis (normal).", + "type": "object", + "required": [ + "x", + "y", + "z" + ], + "properties": { + "x": { + "type": "number", + "format": "double" + }, + "y": { + "type": "number", + "format": "double" + }, + "z": { + "type": "number", + "format": "double" + } + } + } + } + }, + { + "description": "A face.", + "type": "object", + "required": [ + "__meta", + "id", + "sketchGroupId", + "type", + "value", + "xAxis", + "yAxis", + "zAxis" + ], + "properties": { + "__meta": { + "type": "array", + "items": { + "description": "Metadata.", + "type": "object", + "required": [ + "sourceRange" + ], + "properties": { + "sourceRange": { + "description": "The source range.", + "type": "array", + "items": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "maxItems": 2, + "minItems": 2 + } + } + } + }, + "id": { + "description": "The id of the face.", + "type": "string", + "format": "uuid" + }, + "sketchGroupId": { + "description": "The original sketch group id of the object we are sketching on.", + "type": "string", + "format": "uuid" + }, + "type": { + "type": "string", + "enum": [ + "face" + ] + }, + "value": { + "description": "The tag of the face.", + "type": "string" + }, + "xAxis": { + "description": "What should the face’s X axis be?", + "type": "object", + "required": [ + "x", + "y", + "z" + ], + "properties": { + "x": { + "type": "number", + "format": "double" + }, + "y": { + "type": "number", + "format": "double" + }, + "z": { + "type": "number", + "format": "double" + } + } + }, + "yAxis": { + "description": "What should the face’s Y axis be?", + "type": "object", + "required": [ + "x", + "y", + "z" + ], + "properties": { + "x": { + "type": "number", + "format": "double" + }, + "y": { + "type": "number", + "format": "double" + }, + "z": { + "type": "number", + "format": "double" + } + } + }, + "zAxis": { + "description": "The z-axis (normal).", + "type": "object", + "required": [ + "x", + "y", + "z" + ], + "properties": { + "x": { + "type": "number", + "format": "double" + }, + "y": { + "type": "number", + "format": "double" + }, + "z": { + "type": "number", + "format": "double" + } + } + } + } + } + ] + }, + "position": { + "description": "The position of the sketch group.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 3, + "minItems": 3 + }, + "rotation": { + "description": "The rotation of the sketch group base plane.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 4, + "minItems": 4 + }, + "start": { + "description": "The starting path.", + "type": "object", + "required": [ + "__geoMeta", + "from", + "name", + "to" + ], + "properties": { + "__geoMeta": { + "description": "Metadata.", + "type": "object", + "required": [ + "id", + "sourceRange" + ], + "properties": { + "id": { + "description": "The id of the geometry.", + "type": "string", + "format": "uuid" + }, + "sourceRange": { + "description": "The source range.", + "type": "array", + "items": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "maxItems": 2, + "minItems": 2 + } + } + }, + "from": { + "description": "The from point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "name": { + "description": "The name of the path.", + "type": "string" + }, + "to": { + "description": "The to point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + } + } + }, + "value": { + "description": "The paths in the sketch group.", + "type": "array", + "items": { + "description": "A path.", + "oneOf": [ + { + "description": "A path that goes to a point.", + "type": "object", + "required": [ + "__geoMeta", + "from", + "name", + "to", + "type" + ], + "properties": { + "__geoMeta": { + "description": "Metadata.", + "type": "object", + "required": [ + "id", + "sourceRange" + ], + "properties": { + "id": { + "description": "The id of the geometry.", + "type": "string", + "format": "uuid" + }, + "sourceRange": { + "description": "The source range.", + "type": "array", + "items": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "maxItems": 2, + "minItems": 2 + } + } + }, + "from": { + "description": "The from point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "name": { + "description": "The name of the path.", + "type": "string" + }, + "to": { + "description": "The to point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "type": { + "type": "string", + "enum": [ + "ToPoint" + ] + } + } + }, + { + "description": "A arc that is tangential to the last path segment that goes to a point", + "type": "object", + "required": [ + "__geoMeta", + "ccw", + "center", + "from", + "name", + "to", + "type" + ], + "properties": { + "__geoMeta": { + "description": "Metadata.", + "type": "object", + "required": [ + "id", + "sourceRange" + ], + "properties": { + "id": { + "description": "The id of the geometry.", + "type": "string", + "format": "uuid" + }, + "sourceRange": { + "description": "The source range.", + "type": "array", + "items": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "maxItems": 2, + "minItems": 2 + } + } + }, + "ccw": { + "description": "arc's direction", + "type": "boolean" + }, + "center": { + "description": "the arc's center", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "from": { + "description": "The from point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "name": { + "description": "The name of the path.", + "type": "string" + }, + "to": { + "description": "The to point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "type": { + "type": "string", + "enum": [ + "TangentialArcTo" + ] + } + } + }, + { + "description": "A arc that is tangential to the last path segment", + "type": "object", + "required": [ + "__geoMeta", + "from", + "name", + "to", + "type" + ], + "properties": { + "__geoMeta": { + "description": "Metadata.", + "type": "object", + "required": [ + "id", + "sourceRange" + ], + "properties": { + "id": { + "description": "The id of the geometry.", + "type": "string", + "format": "uuid" + }, + "sourceRange": { + "description": "The source range.", + "type": "array", + "items": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "maxItems": 2, + "minItems": 2 + } + } + }, + "from": { + "description": "The from point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "name": { + "description": "The name of the path.", + "type": "string" + }, + "to": { + "description": "The to point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "type": { + "type": "string", + "enum": [ + "TangentialArc" + ] + } + } + }, + { + "description": "A path that is horizontal.", + "type": "object", + "required": [ + "__geoMeta", + "from", + "name", + "to", + "type", + "x" + ], + "properties": { + "__geoMeta": { + "description": "Metadata.", + "type": "object", + "required": [ + "id", + "sourceRange" + ], + "properties": { + "id": { + "description": "The id of the geometry.", + "type": "string", + "format": "uuid" + }, + "sourceRange": { + "description": "The source range.", + "type": "array", + "items": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "maxItems": 2, + "minItems": 2 + } + } + }, + "from": { + "description": "The from point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "name": { + "description": "The name of the path.", + "type": "string" + }, + "to": { + "description": "The to point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "type": { + "type": "string", + "enum": [ + "Horizontal" + ] + }, + "x": { + "description": "The x coordinate.", + "type": "number", + "format": "double" + } + } + }, + { + "description": "An angled line to.", + "type": "object", + "required": [ + "__geoMeta", + "from", + "name", + "to", + "type" + ], + "properties": { + "__geoMeta": { + "description": "Metadata.", + "type": "object", + "required": [ + "id", + "sourceRange" + ], + "properties": { + "id": { + "description": "The id of the geometry.", + "type": "string", + "format": "uuid" + }, + "sourceRange": { + "description": "The source range.", + "type": "array", + "items": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "maxItems": 2, + "minItems": 2 + } + } + }, + "from": { + "description": "The from point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "name": { + "description": "The name of the path.", + "type": "string" + }, + "to": { + "description": "The to point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "type": { + "type": "string", + "enum": [ + "AngledLineTo" + ] + }, + "x": { + "description": "The x coordinate.", + "type": "number", + "format": "double", + "nullable": true + }, + "y": { + "description": "The y coordinate.", + "type": "number", + "format": "double", + "nullable": true + } + } + }, + { + "description": "A base path.", + "type": "object", + "required": [ + "__geoMeta", + "from", + "name", + "to", + "type" + ], + "properties": { + "__geoMeta": { + "description": "Metadata.", + "type": "object", + "required": [ + "id", + "sourceRange" + ], + "properties": { + "id": { + "description": "The id of the geometry.", + "type": "string", + "format": "uuid" + }, + "sourceRange": { + "description": "The source range.", + "type": "array", + "items": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "maxItems": 2, + "minItems": 2 + } + } + }, + "from": { + "description": "The from point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "name": { + "description": "The name of the path.", + "type": "string" + }, + "to": { + "description": "The to point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "type": { + "type": "string", + "enum": [ + "Base" + ] + } + } + } + ] + } + }, + "xAxis": { + "description": "The x-axis of the sketch group base plane in the 3D space", + "type": "object", + "required": [ + "x", + "y", + "z" + ], + "properties": { + "x": { + "type": "number", + "format": "double" + }, + "y": { + "type": "number", + "format": "double" + }, + "z": { + "type": "number", + "format": "double" + } + } + }, + "yAxis": { + "description": "The y-axis of the sketch group base plane in the 3D space", + "type": "object", + "required": [ + "x", + "y", + "z" + ], + "properties": { + "x": { + "type": "number", + "format": "double" + }, + "y": { + "type": "number", + "format": "double" + }, + "z": { + "type": "number", + "format": "double" + } + } + }, + "zAxis": { + "description": "The z-axis of the sketch group base plane in the 3D space", + "type": "object", + "required": [ + "x", + "y", + "z" + ], + "properties": { + "x": { + "type": "number", + "format": "double" + }, + "y": { + "type": "number", + "format": "double" + }, + "z": { + "type": "number", + "format": "double" + } + } + } + } + }, + "required": true + } + ], + "returnValue": { + "name": "", + "type": "[SketchGroup]", + "schema": { + "type": "array", + "items": { + "description": "A sketch group is a collection of paths.", + "type": "object", + "required": [ + "__meta", + "id", + "on", + "position", + "rotation", + "start", + "value", + "xAxis", + "yAxis", + "zAxis" + ], + "properties": { + "__meta": { + "description": "Metadata.", + "type": "array", + "items": { + "description": "Metadata.", + "type": "object", + "required": [ + "sourceRange" + ], + "properties": { + "sourceRange": { + "description": "The source range.", + "type": "array", + "items": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "maxItems": 2, + "minItems": 2 + } + } + } + }, + "entityId": { + "description": "The plane id or face id of the sketch group.", + "type": "string", + "format": "uuid", + "nullable": true + }, + "id": { + "description": "The id of the sketch group.", + "type": "string", + "format": "uuid" + }, + "on": { + "description": "What the sketch is on (can be a plane or a face).", + "oneOf": [ + { + "description": "A plane.", + "type": "object", + "required": [ + "__meta", + "id", + "origin", + "type", + "value", + "xAxis", + "yAxis", + "zAxis" + ], + "properties": { + "__meta": { + "type": "array", + "items": { + "description": "Metadata.", + "type": "object", + "required": [ + "sourceRange" + ], + "properties": { + "sourceRange": { + "description": "The source range.", + "type": "array", + "items": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "maxItems": 2, + "minItems": 2 + } + } + } + }, + "id": { + "description": "The id of the plane.", + "type": "string", + "format": "uuid" + }, + "origin": { + "description": "Origin of the plane.", + "type": "object", + "required": [ + "x", + "y", + "z" + ], + "properties": { + "x": { + "type": "number", + "format": "double" + }, + "y": { + "type": "number", + "format": "double" + }, + "z": { + "type": "number", + "format": "double" + } + } + }, + "type": { + "type": "string", + "enum": [ + "plane" + ] + }, + "value": { + "description": "Type for a plane.", + "oneOf": [ + { + "type": "string", + "enum": [ + "XY", + "XZ", + "YZ" + ] + }, + { + "description": "A custom plane.", + "type": "string", + "enum": [ + "Custom" + ] + } + ] + }, + "xAxis": { + "description": "What should the plane’s X axis be?", + "type": "object", + "required": [ + "x", + "y", + "z" + ], + "properties": { + "x": { + "type": "number", + "format": "double" + }, + "y": { + "type": "number", + "format": "double" + }, + "z": { + "type": "number", + "format": "double" + } + } + }, + "yAxis": { + "description": "What should the plane’s Y axis be?", + "type": "object", + "required": [ + "x", + "y", + "z" + ], + "properties": { + "x": { + "type": "number", + "format": "double" + }, + "y": { + "type": "number", + "format": "double" + }, + "z": { + "type": "number", + "format": "double" + } + } + }, + "zAxis": { + "description": "The z-axis (normal).", + "type": "object", + "required": [ + "x", + "y", + "z" + ], + "properties": { + "x": { + "type": "number", + "format": "double" + }, + "y": { + "type": "number", + "format": "double" + }, + "z": { + "type": "number", + "format": "double" + } + } + } + } + }, + { + "description": "A face.", + "type": "object", + "required": [ + "__meta", + "id", + "sketchGroupId", + "type", + "value", + "xAxis", + "yAxis", + "zAxis" + ], + "properties": { + "__meta": { + "type": "array", + "items": { + "description": "Metadata.", + "type": "object", + "required": [ + "sourceRange" + ], + "properties": { + "sourceRange": { + "description": "The source range.", + "type": "array", + "items": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "maxItems": 2, + "minItems": 2 + } + } + } + }, + "id": { + "description": "The id of the face.", + "type": "string", + "format": "uuid" + }, + "sketchGroupId": { + "description": "The original sketch group id of the object we are sketching on.", + "type": "string", + "format": "uuid" + }, + "type": { + "type": "string", + "enum": [ + "face" + ] + }, + "value": { + "description": "The tag of the face.", + "type": "string" + }, + "xAxis": { + "description": "What should the face’s X axis be?", + "type": "object", + "required": [ + "x", + "y", + "z" + ], + "properties": { + "x": { + "type": "number", + "format": "double" + }, + "y": { + "type": "number", + "format": "double" + }, + "z": { + "type": "number", + "format": "double" + } + } + }, + "yAxis": { + "description": "What should the face’s Y axis be?", + "type": "object", + "required": [ + "x", + "y", + "z" + ], + "properties": { + "x": { + "type": "number", + "format": "double" + }, + "y": { + "type": "number", + "format": "double" + }, + "z": { + "type": "number", + "format": "double" + } + } + }, + "zAxis": { + "description": "The z-axis (normal).", + "type": "object", + "required": [ + "x", + "y", + "z" + ], + "properties": { + "x": { + "type": "number", + "format": "double" + }, + "y": { + "type": "number", + "format": "double" + }, + "z": { + "type": "number", + "format": "double" + } + } + } + } + } + ] + }, + "position": { + "description": "The position of the sketch group.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 3, + "minItems": 3 + }, + "rotation": { + "description": "The rotation of the sketch group base plane.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 4, + "minItems": 4 + }, + "start": { + "description": "The starting path.", + "type": "object", + "required": [ + "__geoMeta", + "from", + "name", + "to" + ], + "properties": { + "__geoMeta": { + "description": "Metadata.", + "type": "object", + "required": [ + "id", + "sourceRange" + ], + "properties": { + "id": { + "description": "The id of the geometry.", + "type": "string", + "format": "uuid" + }, + "sourceRange": { + "description": "The source range.", + "type": "array", + "items": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "maxItems": 2, + "minItems": 2 + } + } + }, + "from": { + "description": "The from point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "name": { + "description": "The name of the path.", + "type": "string" + }, + "to": { + "description": "The to point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + } + } + }, + "value": { + "description": "The paths in the sketch group.", + "type": "array", + "items": { + "description": "A path.", + "oneOf": [ + { + "description": "A path that goes to a point.", + "type": "object", + "required": [ + "__geoMeta", + "from", + "name", + "to", + "type" + ], + "properties": { + "__geoMeta": { + "description": "Metadata.", + "type": "object", + "required": [ + "id", + "sourceRange" + ], + "properties": { + "id": { + "description": "The id of the geometry.", + "type": "string", + "format": "uuid" + }, + "sourceRange": { + "description": "The source range.", + "type": "array", + "items": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "maxItems": 2, + "minItems": 2 + } + } + }, + "from": { + "description": "The from point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "name": { + "description": "The name of the path.", + "type": "string" + }, + "to": { + "description": "The to point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "type": { + "type": "string", + "enum": [ + "ToPoint" + ] + } + } + }, + { + "description": "A arc that is tangential to the last path segment that goes to a point", + "type": "object", + "required": [ + "__geoMeta", + "ccw", + "center", + "from", + "name", + "to", + "type" + ], + "properties": { + "__geoMeta": { + "description": "Metadata.", + "type": "object", + "required": [ + "id", + "sourceRange" + ], + "properties": { + "id": { + "description": "The id of the geometry.", + "type": "string", + "format": "uuid" + }, + "sourceRange": { + "description": "The source range.", + "type": "array", + "items": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "maxItems": 2, + "minItems": 2 + } + } + }, + "ccw": { + "description": "arc's direction", + "type": "boolean" + }, + "center": { + "description": "the arc's center", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "from": { + "description": "The from point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "name": { + "description": "The name of the path.", + "type": "string" + }, + "to": { + "description": "The to point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "type": { + "type": "string", + "enum": [ + "TangentialArcTo" + ] + } + } + }, + { + "description": "A arc that is tangential to the last path segment", + "type": "object", + "required": [ + "__geoMeta", + "from", + "name", + "to", + "type" + ], + "properties": { + "__geoMeta": { + "description": "Metadata.", + "type": "object", + "required": [ + "id", + "sourceRange" + ], + "properties": { + "id": { + "description": "The id of the geometry.", + "type": "string", + "format": "uuid" + }, + "sourceRange": { + "description": "The source range.", + "type": "array", + "items": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "maxItems": 2, + "minItems": 2 + } + } + }, + "from": { + "description": "The from point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "name": { + "description": "The name of the path.", + "type": "string" + }, + "to": { + "description": "The to point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "type": { + "type": "string", + "enum": [ + "TangentialArc" + ] + } + } + }, + { + "description": "A path that is horizontal.", + "type": "object", + "required": [ + "__geoMeta", + "from", + "name", + "to", + "type", + "x" + ], + "properties": { + "__geoMeta": { + "description": "Metadata.", + "type": "object", + "required": [ + "id", + "sourceRange" + ], + "properties": { + "id": { + "description": "The id of the geometry.", + "type": "string", + "format": "uuid" + }, + "sourceRange": { + "description": "The source range.", + "type": "array", + "items": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "maxItems": 2, + "minItems": 2 + } + } + }, + "from": { + "description": "The from point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "name": { + "description": "The name of the path.", + "type": "string" + }, + "to": { + "description": "The to point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "type": { + "type": "string", + "enum": [ + "Horizontal" + ] + }, + "x": { + "description": "The x coordinate.", + "type": "number", + "format": "double" + } + } + }, + { + "description": "An angled line to.", + "type": "object", + "required": [ + "__geoMeta", + "from", + "name", + "to", + "type" + ], + "properties": { + "__geoMeta": { + "description": "Metadata.", + "type": "object", + "required": [ + "id", + "sourceRange" + ], + "properties": { + "id": { + "description": "The id of the geometry.", + "type": "string", + "format": "uuid" + }, + "sourceRange": { + "description": "The source range.", + "type": "array", + "items": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "maxItems": 2, + "minItems": 2 + } + } + }, + "from": { + "description": "The from point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "name": { + "description": "The name of the path.", + "type": "string" + }, + "to": { + "description": "The to point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "type": { + "type": "string", + "enum": [ + "AngledLineTo" + ] + }, + "x": { + "description": "The x coordinate.", + "type": "number", + "format": "double", + "nullable": true + }, + "y": { + "description": "The y coordinate.", + "type": "number", + "format": "double", + "nullable": true + } + } + }, + { + "description": "A base path.", + "type": "object", + "required": [ + "__geoMeta", + "from", + "name", + "to", + "type" + ], + "properties": { + "__geoMeta": { + "description": "Metadata.", + "type": "object", + "required": [ + "id", + "sourceRange" + ], + "properties": { + "id": { + "description": "The id of the geometry.", + "type": "string", + "format": "uuid" + }, + "sourceRange": { + "description": "The source range.", + "type": "array", + "items": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "maxItems": 2, + "minItems": 2 + } + } + }, + "from": { + "description": "The from point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "name": { + "description": "The name of the path.", + "type": "string" + }, + "to": { + "description": "The to point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "type": { + "type": "string", + "enum": [ + "Base" + ] + } + } + } + ] + } + }, + "xAxis": { + "description": "The x-axis of the sketch group base plane in the 3D space", + "type": "object", + "required": [ + "x", + "y", + "z" + ], + "properties": { + "x": { + "type": "number", + "format": "double" + }, + "y": { + "type": "number", + "format": "double" + }, + "z": { + "type": "number", + "format": "double" + } + } + }, + "yAxis": { + "description": "The y-axis of the sketch group base plane in the 3D space", + "type": "object", + "required": [ + "x", + "y", + "z" + ], + "properties": { + "x": { + "type": "number", + "format": "double" + }, + "y": { + "type": "number", + "format": "double" + }, + "z": { + "type": "number", + "format": "double" + } + } + }, + "zAxis": { + "description": "The z-axis of the sketch group base plane in the 3D space", + "type": "object", + "required": [ + "x", + "y", + "z" + ], + "properties": { + "x": { + "type": "number", + "format": "double" + }, + "y": { + "type": "number", + "format": "double" + }, + "z": { + "type": "number", + "format": "double" + } + } + } + } + } + }, + "required": true + }, + "unpublished": false, + "deprecated": false + }, + { + "name": "patternCircular3d", + "summary": "A circular pattern on a 3D model.", + "description": "", + "tags": [], + "args": [ + { + "name": "data", + "type": "CircularPattern3dData", + "schema": { + "description": "Data for a circular pattern on a 3D model.", "type": "object", "required": [ "arcDegrees", @@ -38536,14 +40513,14 @@ "format": "double" }, "axis": { - "description": "The axis around which to make the pattern. This is a 2D vector.", + "description": "The axis around which to make the pattern. This is a 3D vector.", "type": "array", "items": { "type": "number", "format": "double" }, - "maxItems": 2, - "minItems": 2 + "maxItems": 3, + "minItems": 3 }, "center": { "description": "The center about which to make th pattern. This is a 3D vector.", @@ -38558,7 +40535,7 @@ "repetitions": { "description": "The number of repetitions. Must be greater than 0. This excludes the original entity. For example, if `repetitions` is 1, the original entity will be copied once.", "type": "integer", - "format": "uint", + "format": "uint32", "minimum": 0.0 }, "rotateDuplicates": { @@ -38570,1001 +40547,600 @@ "required": true }, { - "name": "geometry", - "type": "Geometry", + "name": "extrude_group", + "type": "ExtrudeGroup", "schema": { - "description": "A geometry.", - "oneOf": [ - { - "description": "A sketch group is a collection of paths.", - "type": "object", - "required": [ - "__meta", - "id", - "on", - "position", - "rotation", - "start", - "type", - "value", - "xAxis", - "yAxis", - "zAxis" - ], - "properties": { - "__meta": { - "description": "Metadata.", - "type": "array", - "items": { - "description": "Metadata.", - "type": "object", - "required": [ - "sourceRange" - ], - "properties": { - "sourceRange": { - "description": "The source range.", - "type": "array", - "items": { - "type": "integer", - "format": "uint", - "minimum": 0.0 - }, - "maxItems": 2, - "minItems": 2 - } - } - } - }, - "entityId": { - "description": "The plane id or face id of the sketch group.", - "type": "string", - "format": "uuid", - "nullable": true - }, - "id": { - "description": "The id of the sketch group.", - "type": "string", - "format": "uuid" - }, - "on": { - "description": "What the sketch is on (can be a plane or a face).", - "oneOf": [ - { - "description": "A plane.", - "type": "object", - "required": [ - "__meta", - "id", - "origin", - "type", - "value", - "xAxis", - "yAxis", - "zAxis" - ], - "properties": { - "__meta": { - "type": "array", - "items": { - "description": "Metadata.", - "type": "object", - "required": [ - "sourceRange" - ], - "properties": { - "sourceRange": { - "description": "The source range.", - "type": "array", - "items": { - "type": "integer", - "format": "uint", - "minimum": 0.0 - }, - "maxItems": 2, - "minItems": 2 - } - } - } - }, - "id": { - "description": "The id of the plane.", - "type": "string", - "format": "uuid" - }, - "origin": { - "description": "Origin of the plane.", - "type": "object", - "required": [ - "x", - "y", - "z" - ], - "properties": { - "x": { - "type": "number", - "format": "double" - }, - "y": { - "type": "number", - "format": "double" - }, - "z": { - "type": "number", - "format": "double" - } - } - }, - "type": { - "type": "string", - "enum": [ - "plane" - ] - }, - "value": { - "description": "Type for a plane.", - "oneOf": [ - { - "type": "string", - "enum": [ - "XY", - "XZ", - "YZ" - ] - }, - { - "description": "A custom plane.", - "type": "string", - "enum": [ - "Custom" - ] - } - ] - }, - "xAxis": { - "description": "What should the plane’s X axis be?", - "type": "object", - "required": [ - "x", - "y", - "z" - ], - "properties": { - "x": { - "type": "number", - "format": "double" - }, - "y": { - "type": "number", - "format": "double" - }, - "z": { - "type": "number", - "format": "double" - } - } - }, - "yAxis": { - "description": "What should the plane’s Y axis be?", - "type": "object", - "required": [ - "x", - "y", - "z" - ], - "properties": { - "x": { - "type": "number", - "format": "double" - }, - "y": { - "type": "number", - "format": "double" - }, - "z": { - "type": "number", - "format": "double" - } - } - }, - "zAxis": { - "description": "The z-axis (normal).", - "type": "object", - "required": [ - "x", - "y", - "z" - ], - "properties": { - "x": { - "type": "number", - "format": "double" - }, - "y": { - "type": "number", - "format": "double" - }, - "z": { - "type": "number", - "format": "double" - } - } - } - } + "description": "An extrude group is a collection of extrude surfaces.", + "type": "object", + "required": [ + "__meta", + "height", + "id", + "position", + "rotation", + "sketchGroupValues", + "value", + "xAxis", + "yAxis", + "zAxis" + ], + "properties": { + "__meta": { + "description": "Metadata.", + "type": "array", + "items": { + "description": "Metadata.", + "type": "object", + "required": [ + "sourceRange" + ], + "properties": { + "sourceRange": { + "description": "The source range.", + "type": "array", + "items": { + "type": "integer", + "format": "uint", + "minimum": 0.0 }, - { - "description": "A face.", - "type": "object", - "required": [ - "__meta", - "id", - "sketchGroupId", - "type", - "value", - "xAxis", - "yAxis", - "zAxis" - ], - "properties": { - "__meta": { - "type": "array", - "items": { - "description": "Metadata.", - "type": "object", - "required": [ - "sourceRange" - ], - "properties": { - "sourceRange": { - "description": "The source range.", - "type": "array", - "items": { - "type": "integer", - "format": "uint", - "minimum": 0.0 - }, - "maxItems": 2, - "minItems": 2 - } - } - } - }, - "id": { - "description": "The id of the face.", - "type": "string", - "format": "uuid" - }, - "sketchGroupId": { - "description": "The original sketch group id of the object we are sketching on.", - "type": "string", - "format": "uuid" - }, - "type": { - "type": "string", - "enum": [ - "face" - ] - }, - "value": { - "description": "The tag of the face.", - "type": "string" - }, - "xAxis": { - "description": "What should the face’s X axis be?", - "type": "object", - "required": [ - "x", - "y", - "z" - ], - "properties": { - "x": { - "type": "number", - "format": "double" - }, - "y": { - "type": "number", - "format": "double" - }, - "z": { - "type": "number", - "format": "double" - } - } - }, - "yAxis": { - "description": "What should the face’s Y axis be?", - "type": "object", - "required": [ - "x", - "y", - "z" - ], - "properties": { - "x": { - "type": "number", - "format": "double" - }, - "y": { - "type": "number", - "format": "double" - }, - "z": { - "type": "number", - "format": "double" - } - } - }, - "zAxis": { - "description": "The z-axis (normal).", - "type": "object", - "required": [ - "x", - "y", - "z" - ], - "properties": { - "x": { - "type": "number", - "format": "double" - }, - "y": { - "type": "number", - "format": "double" - }, - "z": { - "type": "number", - "format": "double" - } - } - } - } - } - ] - }, - "position": { - "description": "The position of the sketch group.", - "type": "array", - "items": { - "type": "number", - "format": "double" - }, - "maxItems": 3, - "minItems": 3 - }, - "rotation": { - "description": "The rotation of the sketch group base plane.", - "type": "array", - "items": { - "type": "number", - "format": "double" - }, - "maxItems": 4, - "minItems": 4 - }, - "start": { - "description": "The starting path.", - "type": "object", - "required": [ - "__geoMeta", - "from", - "name", - "to" - ], - "properties": { - "__geoMeta": { - "description": "Metadata.", - "type": "object", - "required": [ - "id", - "sourceRange" - ], - "properties": { - "id": { - "description": "The id of the geometry.", - "type": "string", - "format": "uuid" - }, - "sourceRange": { - "description": "The source range.", - "type": "array", - "items": { - "type": "integer", - "format": "uint", - "minimum": 0.0 - }, - "maxItems": 2, - "minItems": 2 - } - } - }, - "from": { - "description": "The from point.", - "type": "array", - "items": { - "type": "number", - "format": "double" - }, - "maxItems": 2, - "minItems": 2 - }, - "name": { - "description": "The name of the path.", - "type": "string" - }, - "to": { - "description": "The to point.", - "type": "array", - "items": { - "type": "number", - "format": "double" - }, - "maxItems": 2, - "minItems": 2 - } - } - }, - "type": { - "type": "string", - "enum": [ - "SketchGroup" - ] - }, - "value": { - "description": "The paths in the sketch group.", - "type": "array", - "items": { - "description": "A path.", - "oneOf": [ - { - "description": "A path that goes to a point.", - "type": "object", - "required": [ - "__geoMeta", - "from", - "name", - "to", - "type" - ], - "properties": { - "__geoMeta": { - "description": "Metadata.", - "type": "object", - "required": [ - "id", - "sourceRange" - ], - "properties": { - "id": { - "description": "The id of the geometry.", - "type": "string", - "format": "uuid" - }, - "sourceRange": { - "description": "The source range.", - "type": "array", - "items": { - "type": "integer", - "format": "uint", - "minimum": 0.0 - }, - "maxItems": 2, - "minItems": 2 - } - } - }, - "from": { - "description": "The from point.", - "type": "array", - "items": { - "type": "number", - "format": "double" - }, - "maxItems": 2, - "minItems": 2 - }, - "name": { - "description": "The name of the path.", - "type": "string" - }, - "to": { - "description": "The to point.", - "type": "array", - "items": { - "type": "number", - "format": "double" - }, - "maxItems": 2, - "minItems": 2 - }, - "type": { - "type": "string", - "enum": [ - "ToPoint" - ] - } - } - }, - { - "description": "A arc that is tangential to the last path segment that goes to a point", - "type": "object", - "required": [ - "__geoMeta", - "ccw", - "center", - "from", - "name", - "to", - "type" - ], - "properties": { - "__geoMeta": { - "description": "Metadata.", - "type": "object", - "required": [ - "id", - "sourceRange" - ], - "properties": { - "id": { - "description": "The id of the geometry.", - "type": "string", - "format": "uuid" - }, - "sourceRange": { - "description": "The source range.", - "type": "array", - "items": { - "type": "integer", - "format": "uint", - "minimum": 0.0 - }, - "maxItems": 2, - "minItems": 2 - } - } - }, - "ccw": { - "description": "arc's direction", - "type": "boolean" - }, - "center": { - "description": "the arc's center", - "type": "array", - "items": { - "type": "number", - "format": "double" - }, - "maxItems": 2, - "minItems": 2 - }, - "from": { - "description": "The from point.", - "type": "array", - "items": { - "type": "number", - "format": "double" - }, - "maxItems": 2, - "minItems": 2 - }, - "name": { - "description": "The name of the path.", - "type": "string" - }, - "to": { - "description": "The to point.", - "type": "array", - "items": { - "type": "number", - "format": "double" - }, - "maxItems": 2, - "minItems": 2 - }, - "type": { - "type": "string", - "enum": [ - "TangentialArcTo" - ] - } - } - }, - { - "description": "A arc that is tangential to the last path segment", - "type": "object", - "required": [ - "__geoMeta", - "from", - "name", - "to", - "type" - ], - "properties": { - "__geoMeta": { - "description": "Metadata.", - "type": "object", - "required": [ - "id", - "sourceRange" - ], - "properties": { - "id": { - "description": "The id of the geometry.", - "type": "string", - "format": "uuid" - }, - "sourceRange": { - "description": "The source range.", - "type": "array", - "items": { - "type": "integer", - "format": "uint", - "minimum": 0.0 - }, - "maxItems": 2, - "minItems": 2 - } - } - }, - "from": { - "description": "The from point.", - "type": "array", - "items": { - "type": "number", - "format": "double" - }, - "maxItems": 2, - "minItems": 2 - }, - "name": { - "description": "The name of the path.", - "type": "string" - }, - "to": { - "description": "The to point.", - "type": "array", - "items": { - "type": "number", - "format": "double" - }, - "maxItems": 2, - "minItems": 2 - }, - "type": { - "type": "string", - "enum": [ - "TangentialArc" - ] - } - } - }, - { - "description": "A path that is horizontal.", - "type": "object", - "required": [ - "__geoMeta", - "from", - "name", - "to", - "type", - "x" - ], - "properties": { - "__geoMeta": { - "description": "Metadata.", - "type": "object", - "required": [ - "id", - "sourceRange" - ], - "properties": { - "id": { - "description": "The id of the geometry.", - "type": "string", - "format": "uuid" - }, - "sourceRange": { - "description": "The source range.", - "type": "array", - "items": { - "type": "integer", - "format": "uint", - "minimum": 0.0 - }, - "maxItems": 2, - "minItems": 2 - } - } - }, - "from": { - "description": "The from point.", - "type": "array", - "items": { - "type": "number", - "format": "double" - }, - "maxItems": 2, - "minItems": 2 - }, - "name": { - "description": "The name of the path.", - "type": "string" - }, - "to": { - "description": "The to point.", - "type": "array", - "items": { - "type": "number", - "format": "double" - }, - "maxItems": 2, - "minItems": 2 - }, - "type": { - "type": "string", - "enum": [ - "Horizontal" - ] - }, - "x": { - "description": "The x coordinate.", - "type": "number", - "format": "double" - } - } - }, - { - "description": "An angled line to.", - "type": "object", - "required": [ - "__geoMeta", - "from", - "name", - "to", - "type" - ], - "properties": { - "__geoMeta": { - "description": "Metadata.", - "type": "object", - "required": [ - "id", - "sourceRange" - ], - "properties": { - "id": { - "description": "The id of the geometry.", - "type": "string", - "format": "uuid" - }, - "sourceRange": { - "description": "The source range.", - "type": "array", - "items": { - "type": "integer", - "format": "uint", - "minimum": 0.0 - }, - "maxItems": 2, - "minItems": 2 - } - } - }, - "from": { - "description": "The from point.", - "type": "array", - "items": { - "type": "number", - "format": "double" - }, - "maxItems": 2, - "minItems": 2 - }, - "name": { - "description": "The name of the path.", - "type": "string" - }, - "to": { - "description": "The to point.", - "type": "array", - "items": { - "type": "number", - "format": "double" - }, - "maxItems": 2, - "minItems": 2 - }, - "type": { - "type": "string", - "enum": [ - "AngledLineTo" - ] - }, - "x": { - "description": "The x coordinate.", - "type": "number", - "format": "double", - "nullable": true - }, - "y": { - "description": "The y coordinate.", - "type": "number", - "format": "double", - "nullable": true - } - } - }, - { - "description": "A base path.", - "type": "object", - "required": [ - "__geoMeta", - "from", - "name", - "to", - "type" - ], - "properties": { - "__geoMeta": { - "description": "Metadata.", - "type": "object", - "required": [ - "id", - "sourceRange" - ], - "properties": { - "id": { - "description": "The id of the geometry.", - "type": "string", - "format": "uuid" - }, - "sourceRange": { - "description": "The source range.", - "type": "array", - "items": { - "type": "integer", - "format": "uint", - "minimum": 0.0 - }, - "maxItems": 2, - "minItems": 2 - } - } - }, - "from": { - "description": "The from point.", - "type": "array", - "items": { - "type": "number", - "format": "double" - }, - "maxItems": 2, - "minItems": 2 - }, - "name": { - "description": "The name of the path.", - "type": "string" - }, - "to": { - "description": "The to point.", - "type": "array", - "items": { - "type": "number", - "format": "double" - }, - "maxItems": 2, - "minItems": 2 - }, - "type": { - "type": "string", - "enum": [ - "Base" - ] - } - } - } - ] - } - }, - "xAxis": { - "description": "The x-axis of the sketch group base plane in the 3D space", - "type": "object", - "required": [ - "x", - "y", - "z" - ], - "properties": { - "x": { - "type": "number", - "format": "double" - }, - "y": { - "type": "number", - "format": "double" - }, - "z": { - "type": "number", - "format": "double" - } - } - }, - "yAxis": { - "description": "The y-axis of the sketch group base plane in the 3D space", - "type": "object", - "required": [ - "x", - "y", - "z" - ], - "properties": { - "x": { - "type": "number", - "format": "double" - }, - "y": { - "type": "number", - "format": "double" - }, - "z": { - "type": "number", - "format": "double" - } - } - }, - "zAxis": { - "description": "The z-axis of the sketch group base plane in the 3D space", - "type": "object", - "required": [ - "x", - "y", - "z" - ], - "properties": { - "x": { - "type": "number", - "format": "double" - }, - "y": { - "type": "number", - "format": "double" - }, - "z": { - "type": "number", - "format": "double" - } + "maxItems": 2, + "minItems": 2 } } } }, - { - "description": "An extrude group is a collection of extrude surfaces.", - "type": "object", - "required": [ - "__meta", - "height", - "id", - "position", - "rotation", - "sketchGroupValues", - "type", - "value", - "xAxis", - "yAxis", - "zAxis" - ], - "properties": { - "__meta": { - "description": "Metadata.", - "type": "array", - "items": { - "description": "Metadata.", + "endCapId": { + "description": "The id of the extrusion end cap", + "type": "string", + "format": "uuid", + "nullable": true + }, + "height": { + "description": "The height of the extrude group.", + "type": "number", + "format": "double" + }, + "id": { + "description": "The id of the extrude group.", + "type": "string", + "format": "uuid" + }, + "position": { + "description": "The position of the extrude group.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 3, + "minItems": 3 + }, + "rotation": { + "description": "The rotation of the extrude group.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 4, + "minItems": 4 + }, + "sketchGroupValues": { + "description": "The sketch group paths.", + "type": "array", + "items": { + "description": "A path.", + "oneOf": [ + { + "description": "A path that goes to a point.", "type": "object", "required": [ - "sourceRange" + "__geoMeta", + "from", + "name", + "to", + "type" ], "properties": { + "__geoMeta": { + "description": "Metadata.", + "type": "object", + "required": [ + "id", + "sourceRange" + ], + "properties": { + "id": { + "description": "The id of the geometry.", + "type": "string", + "format": "uuid" + }, + "sourceRange": { + "description": "The source range.", + "type": "array", + "items": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "maxItems": 2, + "minItems": 2 + } + } + }, + "from": { + "description": "The from point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "name": { + "description": "The name of the path.", + "type": "string" + }, + "to": { + "description": "The to point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "type": { + "type": "string", + "enum": [ + "ToPoint" + ] + } + } + }, + { + "description": "A arc that is tangential to the last path segment that goes to a point", + "type": "object", + "required": [ + "__geoMeta", + "ccw", + "center", + "from", + "name", + "to", + "type" + ], + "properties": { + "__geoMeta": { + "description": "Metadata.", + "type": "object", + "required": [ + "id", + "sourceRange" + ], + "properties": { + "id": { + "description": "The id of the geometry.", + "type": "string", + "format": "uuid" + }, + "sourceRange": { + "description": "The source range.", + "type": "array", + "items": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "maxItems": 2, + "minItems": 2 + } + } + }, + "ccw": { + "description": "arc's direction", + "type": "boolean" + }, + "center": { + "description": "the arc's center", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "from": { + "description": "The from point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "name": { + "description": "The name of the path.", + "type": "string" + }, + "to": { + "description": "The to point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "type": { + "type": "string", + "enum": [ + "TangentialArcTo" + ] + } + } + }, + { + "description": "A arc that is tangential to the last path segment", + "type": "object", + "required": [ + "__geoMeta", + "from", + "name", + "to", + "type" + ], + "properties": { + "__geoMeta": { + "description": "Metadata.", + "type": "object", + "required": [ + "id", + "sourceRange" + ], + "properties": { + "id": { + "description": "The id of the geometry.", + "type": "string", + "format": "uuid" + }, + "sourceRange": { + "description": "The source range.", + "type": "array", + "items": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "maxItems": 2, + "minItems": 2 + } + } + }, + "from": { + "description": "The from point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "name": { + "description": "The name of the path.", + "type": "string" + }, + "to": { + "description": "The to point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "type": { + "type": "string", + "enum": [ + "TangentialArc" + ] + } + } + }, + { + "description": "A path that is horizontal.", + "type": "object", + "required": [ + "__geoMeta", + "from", + "name", + "to", + "type", + "x" + ], + "properties": { + "__geoMeta": { + "description": "Metadata.", + "type": "object", + "required": [ + "id", + "sourceRange" + ], + "properties": { + "id": { + "description": "The id of the geometry.", + "type": "string", + "format": "uuid" + }, + "sourceRange": { + "description": "The source range.", + "type": "array", + "items": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "maxItems": 2, + "minItems": 2 + } + } + }, + "from": { + "description": "The from point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "name": { + "description": "The name of the path.", + "type": "string" + }, + "to": { + "description": "The to point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "type": { + "type": "string", + "enum": [ + "Horizontal" + ] + }, + "x": { + "description": "The x coordinate.", + "type": "number", + "format": "double" + } + } + }, + { + "description": "An angled line to.", + "type": "object", + "required": [ + "__geoMeta", + "from", + "name", + "to", + "type" + ], + "properties": { + "__geoMeta": { + "description": "Metadata.", + "type": "object", + "required": [ + "id", + "sourceRange" + ], + "properties": { + "id": { + "description": "The id of the geometry.", + "type": "string", + "format": "uuid" + }, + "sourceRange": { + "description": "The source range.", + "type": "array", + "items": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "maxItems": 2, + "minItems": 2 + } + } + }, + "from": { + "description": "The from point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "name": { + "description": "The name of the path.", + "type": "string" + }, + "to": { + "description": "The to point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "type": { + "type": "string", + "enum": [ + "AngledLineTo" + ] + }, + "x": { + "description": "The x coordinate.", + "type": "number", + "format": "double", + "nullable": true + }, + "y": { + "description": "The y coordinate.", + "type": "number", + "format": "double", + "nullable": true + } + } + }, + { + "description": "A base path.", + "type": "object", + "required": [ + "__geoMeta", + "from", + "name", + "to", + "type" + ], + "properties": { + "__geoMeta": { + "description": "Metadata.", + "type": "object", + "required": [ + "id", + "sourceRange" + ], + "properties": { + "id": { + "description": "The id of the geometry.", + "type": "string", + "format": "uuid" + }, + "sourceRange": { + "description": "The source range.", + "type": "array", + "items": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "maxItems": 2, + "minItems": 2 + } + } + }, + "from": { + "description": "The from point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "name": { + "description": "The name of the path.", + "type": "string" + }, + "to": { + "description": "The to point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "type": { + "type": "string", + "enum": [ + "Base" + ] + } + } + } + ] + } + }, + "startCapId": { + "description": "The id of the extrusion start cap", + "type": "string", + "format": "uuid", + "nullable": true + }, + "value": { + "description": "The extrude surfaces.", + "type": "array", + "items": { + "description": "An extrude surface.", + "oneOf": [ + { + "description": "An extrude plane.", + "type": "object", + "required": [ + "faceId", + "id", + "name", + "position", + "rotation", + "sourceRange", + "type" + ], + "properties": { + "faceId": { + "description": "The face id for the extrude plane.", + "type": "string", + "format": "uuid" + }, + "id": { + "description": "The id of the geometry.", + "type": "string", + "format": "uuid" + }, + "name": { + "description": "The name.", + "type": "string" + }, + "position": { + "description": "The position.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 3, + "minItems": 3 + }, + "rotation": { + "description": "The rotation.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 4, + "minItems": 4 + }, "sourceRange": { "description": "The source range.", "type": "array", @@ -39575,1742 +41151,755 @@ }, "maxItems": 2, "minItems": 2 + }, + "type": { + "type": "string", + "enum": [ + "extrudePlane" + ] + } + } + }, + { + "description": "An extruded arc.", + "type": "object", + "required": [ + "faceId", + "id", + "name", + "position", + "rotation", + "sourceRange", + "type" + ], + "properties": { + "faceId": { + "description": "The face id for the extrude plane.", + "type": "string", + "format": "uuid" + }, + "id": { + "description": "The id of the geometry.", + "type": "string", + "format": "uuid" + }, + "name": { + "description": "The name.", + "type": "string" + }, + "position": { + "description": "The position.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 3, + "minItems": 3 + }, + "rotation": { + "description": "The rotation.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 4, + "minItems": 4 + }, + "sourceRange": { + "description": "The source range.", + "type": "array", + "items": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "maxItems": 2, + "minItems": 2 + }, + "type": { + "type": "string", + "enum": [ + "extrudeArc" + ] } } } - }, - "endCapId": { - "description": "The id of the extrusion end cap", - "type": "string", - "format": "uuid", - "nullable": true - }, - "height": { - "description": "The height of the extrude group.", + ] + } + }, + "xAxis": { + "description": "The x-axis of the extrude group base plane in the 3D space", + "type": "object", + "required": [ + "x", + "y", + "z" + ], + "properties": { + "x": { "type": "number", "format": "double" }, - "id": { - "description": "The id of the extrude group.", - "type": "string", - "format": "uuid" + "y": { + "type": "number", + "format": "double" }, - "position": { - "description": "The position of the extrude group.", - "type": "array", - "items": { - "type": "number", - "format": "double" - }, - "maxItems": 3, - "minItems": 3 + "z": { + "type": "number", + "format": "double" + } + } + }, + "yAxis": { + "description": "The y-axis of the extrude group base plane in the 3D space", + "type": "object", + "required": [ + "x", + "y", + "z" + ], + "properties": { + "x": { + "type": "number", + "format": "double" }, - "rotation": { - "description": "The rotation of the extrude group.", - "type": "array", - "items": { - "type": "number", - "format": "double" - }, - "maxItems": 4, - "minItems": 4 + "y": { + "type": "number", + "format": "double" }, - "sketchGroupValues": { - "description": "The sketch group paths.", - "type": "array", - "items": { - "description": "A path.", - "oneOf": [ - { - "description": "A path that goes to a point.", - "type": "object", - "required": [ - "__geoMeta", - "from", - "name", - "to", - "type" - ], - "properties": { - "__geoMeta": { - "description": "Metadata.", - "type": "object", - "required": [ - "id", - "sourceRange" - ], - "properties": { - "id": { - "description": "The id of the geometry.", - "type": "string", - "format": "uuid" - }, - "sourceRange": { - "description": "The source range.", - "type": "array", - "items": { - "type": "integer", - "format": "uint", - "minimum": 0.0 - }, - "maxItems": 2, - "minItems": 2 - } - } - }, - "from": { - "description": "The from point.", - "type": "array", - "items": { - "type": "number", - "format": "double" - }, - "maxItems": 2, - "minItems": 2 - }, - "name": { - "description": "The name of the path.", - "type": "string" - }, - "to": { - "description": "The to point.", - "type": "array", - "items": { - "type": "number", - "format": "double" - }, - "maxItems": 2, - "minItems": 2 - }, - "type": { - "type": "string", - "enum": [ - "ToPoint" - ] - } - } - }, - { - "description": "A arc that is tangential to the last path segment that goes to a point", - "type": "object", - "required": [ - "__geoMeta", - "ccw", - "center", - "from", - "name", - "to", - "type" - ], - "properties": { - "__geoMeta": { - "description": "Metadata.", - "type": "object", - "required": [ - "id", - "sourceRange" - ], - "properties": { - "id": { - "description": "The id of the geometry.", - "type": "string", - "format": "uuid" - }, - "sourceRange": { - "description": "The source range.", - "type": "array", - "items": { - "type": "integer", - "format": "uint", - "minimum": 0.0 - }, - "maxItems": 2, - "minItems": 2 - } - } - }, - "ccw": { - "description": "arc's direction", - "type": "boolean" - }, - "center": { - "description": "the arc's center", - "type": "array", - "items": { - "type": "number", - "format": "double" - }, - "maxItems": 2, - "minItems": 2 - }, - "from": { - "description": "The from point.", - "type": "array", - "items": { - "type": "number", - "format": "double" - }, - "maxItems": 2, - "minItems": 2 - }, - "name": { - "description": "The name of the path.", - "type": "string" - }, - "to": { - "description": "The to point.", - "type": "array", - "items": { - "type": "number", - "format": "double" - }, - "maxItems": 2, - "minItems": 2 - }, - "type": { - "type": "string", - "enum": [ - "TangentialArcTo" - ] - } - } - }, - { - "description": "A arc that is tangential to the last path segment", - "type": "object", - "required": [ - "__geoMeta", - "from", - "name", - "to", - "type" - ], - "properties": { - "__geoMeta": { - "description": "Metadata.", - "type": "object", - "required": [ - "id", - "sourceRange" - ], - "properties": { - "id": { - "description": "The id of the geometry.", - "type": "string", - "format": "uuid" - }, - "sourceRange": { - "description": "The source range.", - "type": "array", - "items": { - "type": "integer", - "format": "uint", - "minimum": 0.0 - }, - "maxItems": 2, - "minItems": 2 - } - } - }, - "from": { - "description": "The from point.", - "type": "array", - "items": { - "type": "number", - "format": "double" - }, - "maxItems": 2, - "minItems": 2 - }, - "name": { - "description": "The name of the path.", - "type": "string" - }, - "to": { - "description": "The to point.", - "type": "array", - "items": { - "type": "number", - "format": "double" - }, - "maxItems": 2, - "minItems": 2 - }, - "type": { - "type": "string", - "enum": [ - "TangentialArc" - ] - } - } - }, - { - "description": "A path that is horizontal.", - "type": "object", - "required": [ - "__geoMeta", - "from", - "name", - "to", - "type", - "x" - ], - "properties": { - "__geoMeta": { - "description": "Metadata.", - "type": "object", - "required": [ - "id", - "sourceRange" - ], - "properties": { - "id": { - "description": "The id of the geometry.", - "type": "string", - "format": "uuid" - }, - "sourceRange": { - "description": "The source range.", - "type": "array", - "items": { - "type": "integer", - "format": "uint", - "minimum": 0.0 - }, - "maxItems": 2, - "minItems": 2 - } - } - }, - "from": { - "description": "The from point.", - "type": "array", - "items": { - "type": "number", - "format": "double" - }, - "maxItems": 2, - "minItems": 2 - }, - "name": { - "description": "The name of the path.", - "type": "string" - }, - "to": { - "description": "The to point.", - "type": "array", - "items": { - "type": "number", - "format": "double" - }, - "maxItems": 2, - "minItems": 2 - }, - "type": { - "type": "string", - "enum": [ - "Horizontal" - ] - }, - "x": { - "description": "The x coordinate.", - "type": "number", - "format": "double" - } - } - }, - { - "description": "An angled line to.", - "type": "object", - "required": [ - "__geoMeta", - "from", - "name", - "to", - "type" - ], - "properties": { - "__geoMeta": { - "description": "Metadata.", - "type": "object", - "required": [ - "id", - "sourceRange" - ], - "properties": { - "id": { - "description": "The id of the geometry.", - "type": "string", - "format": "uuid" - }, - "sourceRange": { - "description": "The source range.", - "type": "array", - "items": { - "type": "integer", - "format": "uint", - "minimum": 0.0 - }, - "maxItems": 2, - "minItems": 2 - } - } - }, - "from": { - "description": "The from point.", - "type": "array", - "items": { - "type": "number", - "format": "double" - }, - "maxItems": 2, - "minItems": 2 - }, - "name": { - "description": "The name of the path.", - "type": "string" - }, - "to": { - "description": "The to point.", - "type": "array", - "items": { - "type": "number", - "format": "double" - }, - "maxItems": 2, - "minItems": 2 - }, - "type": { - "type": "string", - "enum": [ - "AngledLineTo" - ] - }, - "x": { - "description": "The x coordinate.", - "type": "number", - "format": "double", - "nullable": true - }, - "y": { - "description": "The y coordinate.", - "type": "number", - "format": "double", - "nullable": true - } - } - }, - { - "description": "A base path.", - "type": "object", - "required": [ - "__geoMeta", - "from", - "name", - "to", - "type" - ], - "properties": { - "__geoMeta": { - "description": "Metadata.", - "type": "object", - "required": [ - "id", - "sourceRange" - ], - "properties": { - "id": { - "description": "The id of the geometry.", - "type": "string", - "format": "uuid" - }, - "sourceRange": { - "description": "The source range.", - "type": "array", - "items": { - "type": "integer", - "format": "uint", - "minimum": 0.0 - }, - "maxItems": 2, - "minItems": 2 - } - } - }, - "from": { - "description": "The from point.", - "type": "array", - "items": { - "type": "number", - "format": "double" - }, - "maxItems": 2, - "minItems": 2 - }, - "name": { - "description": "The name of the path.", - "type": "string" - }, - "to": { - "description": "The to point.", - "type": "array", - "items": { - "type": "number", - "format": "double" - }, - "maxItems": 2, - "minItems": 2 - }, - "type": { - "type": "string", - "enum": [ - "Base" - ] - } - } - } - ] - } + "z": { + "type": "number", + "format": "double" + } + } + }, + "zAxis": { + "description": "The z-axis of the extrude group base plane in the 3D space", + "type": "object", + "required": [ + "x", + "y", + "z" + ], + "properties": { + "x": { + "type": "number", + "format": "double" }, - "startCapId": { - "description": "The id of the extrusion start cap", - "type": "string", - "format": "uuid", - "nullable": true + "y": { + "type": "number", + "format": "double" }, - "type": { - "type": "string", - "enum": [ - "ExtrudeGroup" - ] - }, - "value": { - "description": "The extrude surfaces.", - "type": "array", - "items": { - "description": "An extrude surface.", - "oneOf": [ - { - "description": "An extrude plane.", - "type": "object", - "required": [ - "faceId", - "id", - "name", - "position", - "rotation", - "sourceRange", - "type" - ], - "properties": { - "faceId": { - "description": "The face id for the extrude plane.", - "type": "string", - "format": "uuid" - }, - "id": { - "description": "The id of the geometry.", - "type": "string", - "format": "uuid" - }, - "name": { - "description": "The name.", - "type": "string" - }, - "position": { - "description": "The position.", - "type": "array", - "items": { - "type": "number", - "format": "double" - }, - "maxItems": 3, - "minItems": 3 - }, - "rotation": { - "description": "The rotation.", - "type": "array", - "items": { - "type": "number", - "format": "double" - }, - "maxItems": 4, - "minItems": 4 - }, - "sourceRange": { - "description": "The source range.", - "type": "array", - "items": { - "type": "integer", - "format": "uint", - "minimum": 0.0 - }, - "maxItems": 2, - "minItems": 2 - }, - "type": { - "type": "string", - "enum": [ - "extrudePlane" - ] - } - } - }, - { - "description": "An extruded arc.", - "type": "object", - "required": [ - "faceId", - "id", - "name", - "position", - "rotation", - "sourceRange", - "type" - ], - "properties": { - "faceId": { - "description": "The face id for the extrude plane.", - "type": "string", - "format": "uuid" - }, - "id": { - "description": "The id of the geometry.", - "type": "string", - "format": "uuid" - }, - "name": { - "description": "The name.", - "type": "string" - }, - "position": { - "description": "The position.", - "type": "array", - "items": { - "type": "number", - "format": "double" - }, - "maxItems": 3, - "minItems": 3 - }, - "rotation": { - "description": "The rotation.", - "type": "array", - "items": { - "type": "number", - "format": "double" - }, - "maxItems": 4, - "minItems": 4 - }, - "sourceRange": { - "description": "The source range.", - "type": "array", - "items": { - "type": "integer", - "format": "uint", - "minimum": 0.0 - }, - "maxItems": 2, - "minItems": 2 - }, - "type": { - "type": "string", - "enum": [ - "extrudeArc" - ] - } - } - } - ] - } - }, - "xAxis": { - "description": "The x-axis of the extrude group base plane in the 3D space", - "type": "object", - "required": [ - "x", - "y", - "z" - ], - "properties": { - "x": { - "type": "number", - "format": "double" - }, - "y": { - "type": "number", - "format": "double" - }, - "z": { - "type": "number", - "format": "double" - } - } - }, - "yAxis": { - "description": "The y-axis of the extrude group base plane in the 3D space", - "type": "object", - "required": [ - "x", - "y", - "z" - ], - "properties": { - "x": { - "type": "number", - "format": "double" - }, - "y": { - "type": "number", - "format": "double" - }, - "z": { - "type": "number", - "format": "double" - } - } - }, - "zAxis": { - "description": "The z-axis of the extrude group base plane in the 3D space", - "type": "object", - "required": [ - "x", - "y", - "z" - ], - "properties": { - "x": { - "type": "number", - "format": "double" - }, - "y": { - "type": "number", - "format": "double" - }, - "z": { - "type": "number", - "format": "double" - } - } + "z": { + "type": "number", + "format": "double" } } } - ] + } }, "required": true } ], "returnValue": { "name": "", - "type": "Geometries", + "type": "[ExtrudeGroup]", "schema": { - "description": "A set of geometry.", - "oneOf": [ - { - "type": [ - "object", - "array" - ], - "items": { - "description": "A sketch group is a collection of paths.", - "type": "object", - "required": [ - "__meta", - "id", - "on", - "position", - "rotation", - "start", - "value", - "xAxis", - "yAxis", - "zAxis" - ], - "properties": { - "__meta": { - "description": "Metadata.", - "type": "array", - "items": { - "description": "Metadata.", - "type": "object", - "required": [ - "sourceRange" - ], - "properties": { - "sourceRange": { - "description": "The source range.", - "type": "array", - "items": { - "type": "integer", - "format": "uint", - "minimum": 0.0 - }, - "maxItems": 2, - "minItems": 2 - } - } - } - }, - "entityId": { - "description": "The plane id or face id of the sketch group.", - "type": "string", - "format": "uuid", - "nullable": true - }, - "id": { - "description": "The id of the sketch group.", - "type": "string", - "format": "uuid" - }, - "on": { - "description": "What the sketch is on (can be a plane or a face).", - "oneOf": [ - { - "description": "A plane.", - "type": "object", - "required": [ - "__meta", - "id", - "origin", - "type", - "value", - "xAxis", - "yAxis", - "zAxis" - ], - "properties": { - "__meta": { - "type": "array", - "items": { - "description": "Metadata.", - "type": "object", - "required": [ - "sourceRange" - ], - "properties": { - "sourceRange": { - "description": "The source range.", - "type": "array", - "items": { - "type": "integer", - "format": "uint", - "minimum": 0.0 - }, - "maxItems": 2, - "minItems": 2 - } - } - } - }, - "id": { - "description": "The id of the plane.", - "type": "string", - "format": "uuid" - }, - "origin": { - "description": "Origin of the plane.", - "type": "object", - "required": [ - "x", - "y", - "z" - ], - "properties": { - "x": { - "type": "number", - "format": "double" - }, - "y": { - "type": "number", - "format": "double" - }, - "z": { - "type": "number", - "format": "double" - } - } - }, - "type": { - "type": "string", - "enum": [ - "plane" - ] - }, - "value": { - "description": "Type for a plane.", - "oneOf": [ - { - "type": "string", - "enum": [ - "XY", - "XZ", - "YZ" - ] - }, - { - "description": "A custom plane.", - "type": "string", - "enum": [ - "Custom" - ] - } - ] - }, - "xAxis": { - "description": "What should the plane’s X axis be?", - "type": "object", - "required": [ - "x", - "y", - "z" - ], - "properties": { - "x": { - "type": "number", - "format": "double" - }, - "y": { - "type": "number", - "format": "double" - }, - "z": { - "type": "number", - "format": "double" - } - } - }, - "yAxis": { - "description": "What should the plane’s Y axis be?", - "type": "object", - "required": [ - "x", - "y", - "z" - ], - "properties": { - "x": { - "type": "number", - "format": "double" - }, - "y": { - "type": "number", - "format": "double" - }, - "z": { - "type": "number", - "format": "double" - } - } - }, - "zAxis": { - "description": "The z-axis (normal).", - "type": "object", - "required": [ - "x", - "y", - "z" - ], - "properties": { - "x": { - "type": "number", - "format": "double" - }, - "y": { - "type": "number", - "format": "double" - }, - "z": { - "type": "number", - "format": "double" - } - } - } - } + "type": "array", + "items": { + "description": "An extrude group is a collection of extrude surfaces.", + "type": "object", + "required": [ + "__meta", + "height", + "id", + "position", + "rotation", + "sketchGroupValues", + "value", + "xAxis", + "yAxis", + "zAxis" + ], + "properties": { + "__meta": { + "description": "Metadata.", + "type": "array", + "items": { + "description": "Metadata.", + "type": "object", + "required": [ + "sourceRange" + ], + "properties": { + "sourceRange": { + "description": "The source range.", + "type": "array", + "items": { + "type": "integer", + "format": "uint", + "minimum": 0.0 }, - { - "description": "A face.", - "type": "object", - "required": [ - "__meta", - "id", - "sketchGroupId", - "type", - "value", - "xAxis", - "yAxis", - "zAxis" - ], - "properties": { - "__meta": { - "type": "array", - "items": { - "description": "Metadata.", - "type": "object", - "required": [ - "sourceRange" - ], - "properties": { - "sourceRange": { - "description": "The source range.", - "type": "array", - "items": { - "type": "integer", - "format": "uint", - "minimum": 0.0 - }, - "maxItems": 2, - "minItems": 2 - } - } - } - }, - "id": { - "description": "The id of the face.", - "type": "string", - "format": "uuid" - }, - "sketchGroupId": { - "description": "The original sketch group id of the object we are sketching on.", - "type": "string", - "format": "uuid" - }, - "type": { - "type": "string", - "enum": [ - "face" - ] - }, - "value": { - "description": "The tag of the face.", - "type": "string" - }, - "xAxis": { - "description": "What should the face’s X axis be?", - "type": "object", - "required": [ - "x", - "y", - "z" - ], - "properties": { - "x": { - "type": "number", - "format": "double" - }, - "y": { - "type": "number", - "format": "double" - }, - "z": { - "type": "number", - "format": "double" - } - } - }, - "yAxis": { - "description": "What should the face’s Y axis be?", - "type": "object", - "required": [ - "x", - "y", - "z" - ], - "properties": { - "x": { - "type": "number", - "format": "double" - }, - "y": { - "type": "number", - "format": "double" - }, - "z": { - "type": "number", - "format": "double" - } - } - }, - "zAxis": { - "description": "The z-axis (normal).", - "type": "object", - "required": [ - "x", - "y", - "z" - ], - "properties": { - "x": { - "type": "number", - "format": "double" - }, - "y": { - "type": "number", - "format": "double" - }, - "z": { - "type": "number", - "format": "double" - } - } - } - } - } - ] - }, - "position": { - "description": "The position of the sketch group.", - "type": "array", - "items": { - "type": "number", - "format": "double" - }, - "maxItems": 3, - "minItems": 3 - }, - "rotation": { - "description": "The rotation of the sketch group base plane.", - "type": "array", - "items": { - "type": "number", - "format": "double" - }, - "maxItems": 4, - "minItems": 4 - }, - "start": { - "description": "The starting path.", - "type": "object", - "required": [ - "__geoMeta", - "from", - "name", - "to" - ], - "properties": { - "__geoMeta": { - "description": "Metadata.", - "type": "object", - "required": [ - "id", - "sourceRange" - ], - "properties": { - "id": { - "description": "The id of the geometry.", - "type": "string", - "format": "uuid" - }, - "sourceRange": { - "description": "The source range.", - "type": "array", - "items": { - "type": "integer", - "format": "uint", - "minimum": 0.0 - }, - "maxItems": 2, - "minItems": 2 - } - } - }, - "from": { - "description": "The from point.", - "type": "array", - "items": { - "type": "number", - "format": "double" - }, - "maxItems": 2, - "minItems": 2 - }, - "name": { - "description": "The name of the path.", - "type": "string" - }, - "to": { - "description": "The to point.", - "type": "array", - "items": { - "type": "number", - "format": "double" - }, - "maxItems": 2, - "minItems": 2 - } - } - }, - "value": { - "description": "The paths in the sketch group.", - "type": "array", - "items": { - "description": "A path.", - "oneOf": [ - { - "description": "A path that goes to a point.", - "type": "object", - "required": [ - "__geoMeta", - "from", - "name", - "to", - "type" - ], - "properties": { - "__geoMeta": { - "description": "Metadata.", - "type": "object", - "required": [ - "id", - "sourceRange" - ], - "properties": { - "id": { - "description": "The id of the geometry.", - "type": "string", - "format": "uuid" - }, - "sourceRange": { - "description": "The source range.", - "type": "array", - "items": { - "type": "integer", - "format": "uint", - "minimum": 0.0 - }, - "maxItems": 2, - "minItems": 2 - } - } - }, - "from": { - "description": "The from point.", - "type": "array", - "items": { - "type": "number", - "format": "double" - }, - "maxItems": 2, - "minItems": 2 - }, - "name": { - "description": "The name of the path.", - "type": "string" - }, - "to": { - "description": "The to point.", - "type": "array", - "items": { - "type": "number", - "format": "double" - }, - "maxItems": 2, - "minItems": 2 - }, - "type": { - "type": "string", - "enum": [ - "ToPoint" - ] - } - } - }, - { - "description": "A arc that is tangential to the last path segment that goes to a point", - "type": "object", - "required": [ - "__geoMeta", - "ccw", - "center", - "from", - "name", - "to", - "type" - ], - "properties": { - "__geoMeta": { - "description": "Metadata.", - "type": "object", - "required": [ - "id", - "sourceRange" - ], - "properties": { - "id": { - "description": "The id of the geometry.", - "type": "string", - "format": "uuid" - }, - "sourceRange": { - "description": "The source range.", - "type": "array", - "items": { - "type": "integer", - "format": "uint", - "minimum": 0.0 - }, - "maxItems": 2, - "minItems": 2 - } - } - }, - "ccw": { - "description": "arc's direction", - "type": "boolean" - }, - "center": { - "description": "the arc's center", - "type": "array", - "items": { - "type": "number", - "format": "double" - }, - "maxItems": 2, - "minItems": 2 - }, - "from": { - "description": "The from point.", - "type": "array", - "items": { - "type": "number", - "format": "double" - }, - "maxItems": 2, - "minItems": 2 - }, - "name": { - "description": "The name of the path.", - "type": "string" - }, - "to": { - "description": "The to point.", - "type": "array", - "items": { - "type": "number", - "format": "double" - }, - "maxItems": 2, - "minItems": 2 - }, - "type": { - "type": "string", - "enum": [ - "TangentialArcTo" - ] - } - } - }, - { - "description": "A arc that is tangential to the last path segment", - "type": "object", - "required": [ - "__geoMeta", - "from", - "name", - "to", - "type" - ], - "properties": { - "__geoMeta": { - "description": "Metadata.", - "type": "object", - "required": [ - "id", - "sourceRange" - ], - "properties": { - "id": { - "description": "The id of the geometry.", - "type": "string", - "format": "uuid" - }, - "sourceRange": { - "description": "The source range.", - "type": "array", - "items": { - "type": "integer", - "format": "uint", - "minimum": 0.0 - }, - "maxItems": 2, - "minItems": 2 - } - } - }, - "from": { - "description": "The from point.", - "type": "array", - "items": { - "type": "number", - "format": "double" - }, - "maxItems": 2, - "minItems": 2 - }, - "name": { - "description": "The name of the path.", - "type": "string" - }, - "to": { - "description": "The to point.", - "type": "array", - "items": { - "type": "number", - "format": "double" - }, - "maxItems": 2, - "minItems": 2 - }, - "type": { - "type": "string", - "enum": [ - "TangentialArc" - ] - } - } - }, - { - "description": "A path that is horizontal.", - "type": "object", - "required": [ - "__geoMeta", - "from", - "name", - "to", - "type", - "x" - ], - "properties": { - "__geoMeta": { - "description": "Metadata.", - "type": "object", - "required": [ - "id", - "sourceRange" - ], - "properties": { - "id": { - "description": "The id of the geometry.", - "type": "string", - "format": "uuid" - }, - "sourceRange": { - "description": "The source range.", - "type": "array", - "items": { - "type": "integer", - "format": "uint", - "minimum": 0.0 - }, - "maxItems": 2, - "minItems": 2 - } - } - }, - "from": { - "description": "The from point.", - "type": "array", - "items": { - "type": "number", - "format": "double" - }, - "maxItems": 2, - "minItems": 2 - }, - "name": { - "description": "The name of the path.", - "type": "string" - }, - "to": { - "description": "The to point.", - "type": "array", - "items": { - "type": "number", - "format": "double" - }, - "maxItems": 2, - "minItems": 2 - }, - "type": { - "type": "string", - "enum": [ - "Horizontal" - ] - }, - "x": { - "description": "The x coordinate.", - "type": "number", - "format": "double" - } - } - }, - { - "description": "An angled line to.", - "type": "object", - "required": [ - "__geoMeta", - "from", - "name", - "to", - "type" - ], - "properties": { - "__geoMeta": { - "description": "Metadata.", - "type": "object", - "required": [ - "id", - "sourceRange" - ], - "properties": { - "id": { - "description": "The id of the geometry.", - "type": "string", - "format": "uuid" - }, - "sourceRange": { - "description": "The source range.", - "type": "array", - "items": { - "type": "integer", - "format": "uint", - "minimum": 0.0 - }, - "maxItems": 2, - "minItems": 2 - } - } - }, - "from": { - "description": "The from point.", - "type": "array", - "items": { - "type": "number", - "format": "double" - }, - "maxItems": 2, - "minItems": 2 - }, - "name": { - "description": "The name of the path.", - "type": "string" - }, - "to": { - "description": "The to point.", - "type": "array", - "items": { - "type": "number", - "format": "double" - }, - "maxItems": 2, - "minItems": 2 - }, - "type": { - "type": "string", - "enum": [ - "AngledLineTo" - ] - }, - "x": { - "description": "The x coordinate.", - "type": "number", - "format": "double", - "nullable": true - }, - "y": { - "description": "The y coordinate.", - "type": "number", - "format": "double", - "nullable": true - } - } - }, - { - "description": "A base path.", - "type": "object", - "required": [ - "__geoMeta", - "from", - "name", - "to", - "type" - ], - "properties": { - "__geoMeta": { - "description": "Metadata.", - "type": "object", - "required": [ - "id", - "sourceRange" - ], - "properties": { - "id": { - "description": "The id of the geometry.", - "type": "string", - "format": "uuid" - }, - "sourceRange": { - "description": "The source range.", - "type": "array", - "items": { - "type": "integer", - "format": "uint", - "minimum": 0.0 - }, - "maxItems": 2, - "minItems": 2 - } - } - }, - "from": { - "description": "The from point.", - "type": "array", - "items": { - "type": "number", - "format": "double" - }, - "maxItems": 2, - "minItems": 2 - }, - "name": { - "description": "The name of the path.", - "type": "string" - }, - "to": { - "description": "The to point.", - "type": "array", - "items": { - "type": "number", - "format": "double" - }, - "maxItems": 2, - "minItems": 2 - }, - "type": { - "type": "string", - "enum": [ - "Base" - ] - } - } - } - ] - } - }, - "xAxis": { - "description": "The x-axis of the sketch group base plane in the 3D space", - "type": "object", - "required": [ - "x", - "y", - "z" - ], - "properties": { - "x": { - "type": "number", - "format": "double" - }, - "y": { - "type": "number", - "format": "double" - }, - "z": { - "type": "number", - "format": "double" - } - } - }, - "yAxis": { - "description": "The y-axis of the sketch group base plane in the 3D space", - "type": "object", - "required": [ - "x", - "y", - "z" - ], - "properties": { - "x": { - "type": "number", - "format": "double" - }, - "y": { - "type": "number", - "format": "double" - }, - "z": { - "type": "number", - "format": "double" - } - } - }, - "zAxis": { - "description": "The z-axis of the sketch group base plane in the 3D space", - "type": "object", - "required": [ - "x", - "y", - "z" - ], - "properties": { - "x": { - "type": "number", - "format": "double" - }, - "y": { - "type": "number", - "format": "double" - }, - "z": { - "type": "number", - "format": "double" - } + "maxItems": 2, + "minItems": 2 } } } }, - "required": [ - "type" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "SketchGroups" - ] - } - } - }, - { - "type": [ - "object", - "array" - ], - "items": { - "description": "An extrude group is a collection of extrude surfaces.", - "type": "object", - "required": [ - "__meta", - "height", - "id", - "position", - "rotation", - "sketchGroupValues", - "value", - "xAxis", - "yAxis", - "zAxis" - ], - "properties": { - "__meta": { - "description": "Metadata.", - "type": "array", - "items": { - "description": "Metadata.", + "endCapId": { + "description": "The id of the extrusion end cap", + "type": "string", + "format": "uuid", + "nullable": true + }, + "height": { + "description": "The height of the extrude group.", + "type": "number", + "format": "double" + }, + "id": { + "description": "The id of the extrude group.", + "type": "string", + "format": "uuid" + }, + "position": { + "description": "The position of the extrude group.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 3, + "minItems": 3 + }, + "rotation": { + "description": "The rotation of the extrude group.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 4, + "minItems": 4 + }, + "sketchGroupValues": { + "description": "The sketch group paths.", + "type": "array", + "items": { + "description": "A path.", + "oneOf": [ + { + "description": "A path that goes to a point.", "type": "object", "required": [ - "sourceRange" + "__geoMeta", + "from", + "name", + "to", + "type" ], "properties": { + "__geoMeta": { + "description": "Metadata.", + "type": "object", + "required": [ + "id", + "sourceRange" + ], + "properties": { + "id": { + "description": "The id of the geometry.", + "type": "string", + "format": "uuid" + }, + "sourceRange": { + "description": "The source range.", + "type": "array", + "items": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "maxItems": 2, + "minItems": 2 + } + } + }, + "from": { + "description": "The from point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "name": { + "description": "The name of the path.", + "type": "string" + }, + "to": { + "description": "The to point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "type": { + "type": "string", + "enum": [ + "ToPoint" + ] + } + } + }, + { + "description": "A arc that is tangential to the last path segment that goes to a point", + "type": "object", + "required": [ + "__geoMeta", + "ccw", + "center", + "from", + "name", + "to", + "type" + ], + "properties": { + "__geoMeta": { + "description": "Metadata.", + "type": "object", + "required": [ + "id", + "sourceRange" + ], + "properties": { + "id": { + "description": "The id of the geometry.", + "type": "string", + "format": "uuid" + }, + "sourceRange": { + "description": "The source range.", + "type": "array", + "items": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "maxItems": 2, + "minItems": 2 + } + } + }, + "ccw": { + "description": "arc's direction", + "type": "boolean" + }, + "center": { + "description": "the arc's center", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "from": { + "description": "The from point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "name": { + "description": "The name of the path.", + "type": "string" + }, + "to": { + "description": "The to point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "type": { + "type": "string", + "enum": [ + "TangentialArcTo" + ] + } + } + }, + { + "description": "A arc that is tangential to the last path segment", + "type": "object", + "required": [ + "__geoMeta", + "from", + "name", + "to", + "type" + ], + "properties": { + "__geoMeta": { + "description": "Metadata.", + "type": "object", + "required": [ + "id", + "sourceRange" + ], + "properties": { + "id": { + "description": "The id of the geometry.", + "type": "string", + "format": "uuid" + }, + "sourceRange": { + "description": "The source range.", + "type": "array", + "items": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "maxItems": 2, + "minItems": 2 + } + } + }, + "from": { + "description": "The from point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "name": { + "description": "The name of the path.", + "type": "string" + }, + "to": { + "description": "The to point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "type": { + "type": "string", + "enum": [ + "TangentialArc" + ] + } + } + }, + { + "description": "A path that is horizontal.", + "type": "object", + "required": [ + "__geoMeta", + "from", + "name", + "to", + "type", + "x" + ], + "properties": { + "__geoMeta": { + "description": "Metadata.", + "type": "object", + "required": [ + "id", + "sourceRange" + ], + "properties": { + "id": { + "description": "The id of the geometry.", + "type": "string", + "format": "uuid" + }, + "sourceRange": { + "description": "The source range.", + "type": "array", + "items": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "maxItems": 2, + "minItems": 2 + } + } + }, + "from": { + "description": "The from point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "name": { + "description": "The name of the path.", + "type": "string" + }, + "to": { + "description": "The to point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "type": { + "type": "string", + "enum": [ + "Horizontal" + ] + }, + "x": { + "description": "The x coordinate.", + "type": "number", + "format": "double" + } + } + }, + { + "description": "An angled line to.", + "type": "object", + "required": [ + "__geoMeta", + "from", + "name", + "to", + "type" + ], + "properties": { + "__geoMeta": { + "description": "Metadata.", + "type": "object", + "required": [ + "id", + "sourceRange" + ], + "properties": { + "id": { + "description": "The id of the geometry.", + "type": "string", + "format": "uuid" + }, + "sourceRange": { + "description": "The source range.", + "type": "array", + "items": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "maxItems": 2, + "minItems": 2 + } + } + }, + "from": { + "description": "The from point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "name": { + "description": "The name of the path.", + "type": "string" + }, + "to": { + "description": "The to point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "type": { + "type": "string", + "enum": [ + "AngledLineTo" + ] + }, + "x": { + "description": "The x coordinate.", + "type": "number", + "format": "double", + "nullable": true + }, + "y": { + "description": "The y coordinate.", + "type": "number", + "format": "double", + "nullable": true + } + } + }, + { + "description": "A base path.", + "type": "object", + "required": [ + "__geoMeta", + "from", + "name", + "to", + "type" + ], + "properties": { + "__geoMeta": { + "description": "Metadata.", + "type": "object", + "required": [ + "id", + "sourceRange" + ], + "properties": { + "id": { + "description": "The id of the geometry.", + "type": "string", + "format": "uuid" + }, + "sourceRange": { + "description": "The source range.", + "type": "array", + "items": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "maxItems": 2, + "minItems": 2 + } + } + }, + "from": { + "description": "The from point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "name": { + "description": "The name of the path.", + "type": "string" + }, + "to": { + "description": "The to point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "type": { + "type": "string", + "enum": [ + "Base" + ] + } + } + } + ] + } + }, + "startCapId": { + "description": "The id of the extrusion start cap", + "type": "string", + "format": "uuid", + "nullable": true + }, + "value": { + "description": "The extrude surfaces.", + "type": "array", + "items": { + "description": "An extrude surface.", + "oneOf": [ + { + "description": "An extrude plane.", + "type": "object", + "required": [ + "faceId", + "id", + "name", + "position", + "rotation", + "sourceRange", + "type" + ], + "properties": { + "faceId": { + "description": "The face id for the extrude plane.", + "type": "string", + "format": "uuid" + }, + "id": { + "description": "The id of the geometry.", + "type": "string", + "format": "uuid" + }, + "name": { + "description": "The name.", + "type": "string" + }, + "position": { + "description": "The position.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 3, + "minItems": 3 + }, + "rotation": { + "description": "The rotation.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 4, + "minItems": 4 + }, "sourceRange": { "description": "The source range.", "type": "array", @@ -41321,734 +41910,155 @@ }, "maxItems": 2, "minItems": 2 + }, + "type": { + "type": "string", + "enum": [ + "extrudePlane" + ] + } + } + }, + { + "description": "An extruded arc.", + "type": "object", + "required": [ + "faceId", + "id", + "name", + "position", + "rotation", + "sourceRange", + "type" + ], + "properties": { + "faceId": { + "description": "The face id for the extrude plane.", + "type": "string", + "format": "uuid" + }, + "id": { + "description": "The id of the geometry.", + "type": "string", + "format": "uuid" + }, + "name": { + "description": "The name.", + "type": "string" + }, + "position": { + "description": "The position.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 3, + "minItems": 3 + }, + "rotation": { + "description": "The rotation.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 4, + "minItems": 4 + }, + "sourceRange": { + "description": "The source range.", + "type": "array", + "items": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "maxItems": 2, + "minItems": 2 + }, + "type": { + "type": "string", + "enum": [ + "extrudeArc" + ] } } } - }, - "endCapId": { - "description": "The id of the extrusion end cap", - "type": "string", - "format": "uuid", - "nullable": true - }, - "height": { - "description": "The height of the extrude group.", + ] + } + }, + "xAxis": { + "description": "The x-axis of the extrude group base plane in the 3D space", + "type": "object", + "required": [ + "x", + "y", + "z" + ], + "properties": { + "x": { "type": "number", "format": "double" }, - "id": { - "description": "The id of the extrude group.", - "type": "string", - "format": "uuid" + "y": { + "type": "number", + "format": "double" }, - "position": { - "description": "The position of the extrude group.", - "type": "array", - "items": { - "type": "number", - "format": "double" - }, - "maxItems": 3, - "minItems": 3 - }, - "rotation": { - "description": "The rotation of the extrude group.", - "type": "array", - "items": { - "type": "number", - "format": "double" - }, - "maxItems": 4, - "minItems": 4 - }, - "sketchGroupValues": { - "description": "The sketch group paths.", - "type": "array", - "items": { - "description": "A path.", - "oneOf": [ - { - "description": "A path that goes to a point.", - "type": "object", - "required": [ - "__geoMeta", - "from", - "name", - "to", - "type" - ], - "properties": { - "__geoMeta": { - "description": "Metadata.", - "type": "object", - "required": [ - "id", - "sourceRange" - ], - "properties": { - "id": { - "description": "The id of the geometry.", - "type": "string", - "format": "uuid" - }, - "sourceRange": { - "description": "The source range.", - "type": "array", - "items": { - "type": "integer", - "format": "uint", - "minimum": 0.0 - }, - "maxItems": 2, - "minItems": 2 - } - } - }, - "from": { - "description": "The from point.", - "type": "array", - "items": { - "type": "number", - "format": "double" - }, - "maxItems": 2, - "minItems": 2 - }, - "name": { - "description": "The name of the path.", - "type": "string" - }, - "to": { - "description": "The to point.", - "type": "array", - "items": { - "type": "number", - "format": "double" - }, - "maxItems": 2, - "minItems": 2 - }, - "type": { - "type": "string", - "enum": [ - "ToPoint" - ] - } - } - }, - { - "description": "A arc that is tangential to the last path segment that goes to a point", - "type": "object", - "required": [ - "__geoMeta", - "ccw", - "center", - "from", - "name", - "to", - "type" - ], - "properties": { - "__geoMeta": { - "description": "Metadata.", - "type": "object", - "required": [ - "id", - "sourceRange" - ], - "properties": { - "id": { - "description": "The id of the geometry.", - "type": "string", - "format": "uuid" - }, - "sourceRange": { - "description": "The source range.", - "type": "array", - "items": { - "type": "integer", - "format": "uint", - "minimum": 0.0 - }, - "maxItems": 2, - "minItems": 2 - } - } - }, - "ccw": { - "description": "arc's direction", - "type": "boolean" - }, - "center": { - "description": "the arc's center", - "type": "array", - "items": { - "type": "number", - "format": "double" - }, - "maxItems": 2, - "minItems": 2 - }, - "from": { - "description": "The from point.", - "type": "array", - "items": { - "type": "number", - "format": "double" - }, - "maxItems": 2, - "minItems": 2 - }, - "name": { - "description": "The name of the path.", - "type": "string" - }, - "to": { - "description": "The to point.", - "type": "array", - "items": { - "type": "number", - "format": "double" - }, - "maxItems": 2, - "minItems": 2 - }, - "type": { - "type": "string", - "enum": [ - "TangentialArcTo" - ] - } - } - }, - { - "description": "A arc that is tangential to the last path segment", - "type": "object", - "required": [ - "__geoMeta", - "from", - "name", - "to", - "type" - ], - "properties": { - "__geoMeta": { - "description": "Metadata.", - "type": "object", - "required": [ - "id", - "sourceRange" - ], - "properties": { - "id": { - "description": "The id of the geometry.", - "type": "string", - "format": "uuid" - }, - "sourceRange": { - "description": "The source range.", - "type": "array", - "items": { - "type": "integer", - "format": "uint", - "minimum": 0.0 - }, - "maxItems": 2, - "minItems": 2 - } - } - }, - "from": { - "description": "The from point.", - "type": "array", - "items": { - "type": "number", - "format": "double" - }, - "maxItems": 2, - "minItems": 2 - }, - "name": { - "description": "The name of the path.", - "type": "string" - }, - "to": { - "description": "The to point.", - "type": "array", - "items": { - "type": "number", - "format": "double" - }, - "maxItems": 2, - "minItems": 2 - }, - "type": { - "type": "string", - "enum": [ - "TangentialArc" - ] - } - } - }, - { - "description": "A path that is horizontal.", - "type": "object", - "required": [ - "__geoMeta", - "from", - "name", - "to", - "type", - "x" - ], - "properties": { - "__geoMeta": { - "description": "Metadata.", - "type": "object", - "required": [ - "id", - "sourceRange" - ], - "properties": { - "id": { - "description": "The id of the geometry.", - "type": "string", - "format": "uuid" - }, - "sourceRange": { - "description": "The source range.", - "type": "array", - "items": { - "type": "integer", - "format": "uint", - "minimum": 0.0 - }, - "maxItems": 2, - "minItems": 2 - } - } - }, - "from": { - "description": "The from point.", - "type": "array", - "items": { - "type": "number", - "format": "double" - }, - "maxItems": 2, - "minItems": 2 - }, - "name": { - "description": "The name of the path.", - "type": "string" - }, - "to": { - "description": "The to point.", - "type": "array", - "items": { - "type": "number", - "format": "double" - }, - "maxItems": 2, - "minItems": 2 - }, - "type": { - "type": "string", - "enum": [ - "Horizontal" - ] - }, - "x": { - "description": "The x coordinate.", - "type": "number", - "format": "double" - } - } - }, - { - "description": "An angled line to.", - "type": "object", - "required": [ - "__geoMeta", - "from", - "name", - "to", - "type" - ], - "properties": { - "__geoMeta": { - "description": "Metadata.", - "type": "object", - "required": [ - "id", - "sourceRange" - ], - "properties": { - "id": { - "description": "The id of the geometry.", - "type": "string", - "format": "uuid" - }, - "sourceRange": { - "description": "The source range.", - "type": "array", - "items": { - "type": "integer", - "format": "uint", - "minimum": 0.0 - }, - "maxItems": 2, - "minItems": 2 - } - } - }, - "from": { - "description": "The from point.", - "type": "array", - "items": { - "type": "number", - "format": "double" - }, - "maxItems": 2, - "minItems": 2 - }, - "name": { - "description": "The name of the path.", - "type": "string" - }, - "to": { - "description": "The to point.", - "type": "array", - "items": { - "type": "number", - "format": "double" - }, - "maxItems": 2, - "minItems": 2 - }, - "type": { - "type": "string", - "enum": [ - "AngledLineTo" - ] - }, - "x": { - "description": "The x coordinate.", - "type": "number", - "format": "double", - "nullable": true - }, - "y": { - "description": "The y coordinate.", - "type": "number", - "format": "double", - "nullable": true - } - } - }, - { - "description": "A base path.", - "type": "object", - "required": [ - "__geoMeta", - "from", - "name", - "to", - "type" - ], - "properties": { - "__geoMeta": { - "description": "Metadata.", - "type": "object", - "required": [ - "id", - "sourceRange" - ], - "properties": { - "id": { - "description": "The id of the geometry.", - "type": "string", - "format": "uuid" - }, - "sourceRange": { - "description": "The source range.", - "type": "array", - "items": { - "type": "integer", - "format": "uint", - "minimum": 0.0 - }, - "maxItems": 2, - "minItems": 2 - } - } - }, - "from": { - "description": "The from point.", - "type": "array", - "items": { - "type": "number", - "format": "double" - }, - "maxItems": 2, - "minItems": 2 - }, - "name": { - "description": "The name of the path.", - "type": "string" - }, - "to": { - "description": "The to point.", - "type": "array", - "items": { - "type": "number", - "format": "double" - }, - "maxItems": 2, - "minItems": 2 - }, - "type": { - "type": "string", - "enum": [ - "Base" - ] - } - } - } - ] - } - }, - "startCapId": { - "description": "The id of the extrusion start cap", - "type": "string", - "format": "uuid", - "nullable": true - }, - "value": { - "description": "The extrude surfaces.", - "type": "array", - "items": { - "description": "An extrude surface.", - "oneOf": [ - { - "description": "An extrude plane.", - "type": "object", - "required": [ - "faceId", - "id", - "name", - "position", - "rotation", - "sourceRange", - "type" - ], - "properties": { - "faceId": { - "description": "The face id for the extrude plane.", - "type": "string", - "format": "uuid" - }, - "id": { - "description": "The id of the geometry.", - "type": "string", - "format": "uuid" - }, - "name": { - "description": "The name.", - "type": "string" - }, - "position": { - "description": "The position.", - "type": "array", - "items": { - "type": "number", - "format": "double" - }, - "maxItems": 3, - "minItems": 3 - }, - "rotation": { - "description": "The rotation.", - "type": "array", - "items": { - "type": "number", - "format": "double" - }, - "maxItems": 4, - "minItems": 4 - }, - "sourceRange": { - "description": "The source range.", - "type": "array", - "items": { - "type": "integer", - "format": "uint", - "minimum": 0.0 - }, - "maxItems": 2, - "minItems": 2 - }, - "type": { - "type": "string", - "enum": [ - "extrudePlane" - ] - } - } - }, - { - "description": "An extruded arc.", - "type": "object", - "required": [ - "faceId", - "id", - "name", - "position", - "rotation", - "sourceRange", - "type" - ], - "properties": { - "faceId": { - "description": "The face id for the extrude plane.", - "type": "string", - "format": "uuid" - }, - "id": { - "description": "The id of the geometry.", - "type": "string", - "format": "uuid" - }, - "name": { - "description": "The name.", - "type": "string" - }, - "position": { - "description": "The position.", - "type": "array", - "items": { - "type": "number", - "format": "double" - }, - "maxItems": 3, - "minItems": 3 - }, - "rotation": { - "description": "The rotation.", - "type": "array", - "items": { - "type": "number", - "format": "double" - }, - "maxItems": 4, - "minItems": 4 - }, - "sourceRange": { - "description": "The source range.", - "type": "array", - "items": { - "type": "integer", - "format": "uint", - "minimum": 0.0 - }, - "maxItems": 2, - "minItems": 2 - }, - "type": { - "type": "string", - "enum": [ - "extrudeArc" - ] - } - } - } - ] - } - }, - "xAxis": { - "description": "The x-axis of the extrude group base plane in the 3D space", - "type": "object", - "required": [ - "x", - "y", - "z" - ], - "properties": { - "x": { - "type": "number", - "format": "double" - }, - "y": { - "type": "number", - "format": "double" - }, - "z": { - "type": "number", - "format": "double" - } - } - }, - "yAxis": { - "description": "The y-axis of the extrude group base plane in the 3D space", - "type": "object", - "required": [ - "x", - "y", - "z" - ], - "properties": { - "x": { - "type": "number", - "format": "double" - }, - "y": { - "type": "number", - "format": "double" - }, - "z": { - "type": "number", - "format": "double" - } - } - }, - "zAxis": { - "description": "The z-axis of the extrude group base plane in the 3D space", - "type": "object", - "required": [ - "x", - "y", - "z" - ], - "properties": { - "x": { - "type": "number", - "format": "double" - }, - "y": { - "type": "number", - "format": "double" - }, - "z": { - "type": "number", - "format": "double" - } - } + "z": { + "type": "number", + "format": "double" } } }, - "required": [ - "type" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "ExtrudeGroups" - ] + "yAxis": { + "description": "The y-axis of the extrude group base plane in the 3D space", + "type": "object", + "required": [ + "x", + "y", + "z" + ], + "properties": { + "x": { + "type": "number", + "format": "double" + }, + "y": { + "type": "number", + "format": "double" + }, + "z": { + "type": "number", + "format": "double" + } + } + }, + "zAxis": { + "description": "The z-axis of the extrude group base plane in the 3D space", + "type": "object", + "required": [ + "x", + "y", + "z" + ], + "properties": { + "x": { + "type": "number", + "format": "double" + }, + "y": { + "type": "number", + "format": "double" + }, + "z": { + "type": "number", + "format": "double" + } } } } - ] + } }, "required": true }, @@ -42056,16 +42066,16 @@ "deprecated": false }, { - "name": "patternLinear", - "summary": "A linear pattern.", + "name": "patternLinear2d", + "summary": "A linear pattern on a 2D sketch.", "description": "", "tags": [], "args": [ { "name": "data", - "type": "LinearPatternData", + "type": "LinearPattern2dData", "schema": { - "description": "Data for a linear pattern.", + "description": "Data for a linear pattern on a 2D sketch.", "type": "object", "required": [ "axis", @@ -42091,7 +42101,7 @@ "repetitions": { "description": "The number of repetitions. Must be greater than 0. This excludes the original entity. For example, if `repetitions` is 1, the original entity will be copied once.", "type": "integer", - "format": "uint", + "format": "uint32", "minimum": 0.0 } } @@ -42099,1573 +42109,247 @@ "required": true }, { - "name": "geometry", - "type": "Geometry", + "name": "sketch_group", + "type": "SketchGroup", "schema": { - "description": "A geometry.", - "oneOf": [ - { - "description": "A sketch group is a collection of paths.", - "type": "object", - "required": [ - "__meta", - "id", - "on", - "position", - "rotation", - "start", - "type", - "value", - "xAxis", - "yAxis", - "zAxis" - ], - "properties": { - "__meta": { - "description": "Metadata.", - "type": "array", - "items": { - "description": "Metadata.", - "type": "object", - "required": [ - "sourceRange" - ], - "properties": { - "sourceRange": { - "description": "The source range.", - "type": "array", - "items": { - "type": "integer", - "format": "uint", - "minimum": 0.0 - }, - "maxItems": 2, - "minItems": 2 - } - } - } - }, - "entityId": { - "description": "The plane id or face id of the sketch group.", - "type": "string", - "format": "uuid", - "nullable": true - }, - "id": { - "description": "The id of the sketch group.", - "type": "string", - "format": "uuid" - }, - "on": { - "description": "What the sketch is on (can be a plane or a face).", - "oneOf": [ - { - "description": "A plane.", - "type": "object", - "required": [ - "__meta", - "id", - "origin", - "type", - "value", - "xAxis", - "yAxis", - "zAxis" - ], - "properties": { - "__meta": { - "type": "array", - "items": { - "description": "Metadata.", - "type": "object", - "required": [ - "sourceRange" - ], - "properties": { - "sourceRange": { - "description": "The source range.", - "type": "array", - "items": { - "type": "integer", - "format": "uint", - "minimum": 0.0 - }, - "maxItems": 2, - "minItems": 2 - } - } - } - }, - "id": { - "description": "The id of the plane.", - "type": "string", - "format": "uuid" - }, - "origin": { - "description": "Origin of the plane.", - "type": "object", - "required": [ - "x", - "y", - "z" - ], - "properties": { - "x": { - "type": "number", - "format": "double" - }, - "y": { - "type": "number", - "format": "double" - }, - "z": { - "type": "number", - "format": "double" - } - } - }, - "type": { - "type": "string", - "enum": [ - "plane" - ] - }, - "value": { - "description": "Type for a plane.", - "oneOf": [ - { - "type": "string", - "enum": [ - "XY", - "XZ", - "YZ" - ] - }, - { - "description": "A custom plane.", - "type": "string", - "enum": [ - "Custom" - ] - } - ] - }, - "xAxis": { - "description": "What should the plane’s X axis be?", - "type": "object", - "required": [ - "x", - "y", - "z" - ], - "properties": { - "x": { - "type": "number", - "format": "double" - }, - "y": { - "type": "number", - "format": "double" - }, - "z": { - "type": "number", - "format": "double" - } - } - }, - "yAxis": { - "description": "What should the plane’s Y axis be?", - "type": "object", - "required": [ - "x", - "y", - "z" - ], - "properties": { - "x": { - "type": "number", - "format": "double" - }, - "y": { - "type": "number", - "format": "double" - }, - "z": { - "type": "number", - "format": "double" - } - } - }, - "zAxis": { - "description": "The z-axis (normal).", - "type": "object", - "required": [ - "x", - "y", - "z" - ], - "properties": { - "x": { - "type": "number", - "format": "double" - }, - "y": { - "type": "number", - "format": "double" - }, - "z": { - "type": "number", - "format": "double" - } - } - } - } + "description": "A sketch group is a collection of paths.", + "type": "object", + "required": [ + "__meta", + "id", + "on", + "position", + "rotation", + "start", + "value", + "xAxis", + "yAxis", + "zAxis" + ], + "properties": { + "__meta": { + "description": "Metadata.", + "type": "array", + "items": { + "description": "Metadata.", + "type": "object", + "required": [ + "sourceRange" + ], + "properties": { + "sourceRange": { + "description": "The source range.", + "type": "array", + "items": { + "type": "integer", + "format": "uint", + "minimum": 0.0 }, - { - "description": "A face.", - "type": "object", - "required": [ - "__meta", - "id", - "sketchGroupId", - "type", - "value", - "xAxis", - "yAxis", - "zAxis" - ], - "properties": { - "__meta": { - "type": "array", - "items": { - "description": "Metadata.", - "type": "object", - "required": [ - "sourceRange" - ], - "properties": { - "sourceRange": { - "description": "The source range.", - "type": "array", - "items": { - "type": "integer", - "format": "uint", - "minimum": 0.0 - }, - "maxItems": 2, - "minItems": 2 - } - } - } - }, - "id": { - "description": "The id of the face.", - "type": "string", - "format": "uuid" - }, - "sketchGroupId": { - "description": "The original sketch group id of the object we are sketching on.", - "type": "string", - "format": "uuid" - }, - "type": { - "type": "string", - "enum": [ - "face" - ] - }, - "value": { - "description": "The tag of the face.", - "type": "string" - }, - "xAxis": { - "description": "What should the face’s X axis be?", - "type": "object", - "required": [ - "x", - "y", - "z" - ], - "properties": { - "x": { - "type": "number", - "format": "double" - }, - "y": { - "type": "number", - "format": "double" - }, - "z": { - "type": "number", - "format": "double" - } - } - }, - "yAxis": { - "description": "What should the face’s Y axis be?", - "type": "object", - "required": [ - "x", - "y", - "z" - ], - "properties": { - "x": { - "type": "number", - "format": "double" - }, - "y": { - "type": "number", - "format": "double" - }, - "z": { - "type": "number", - "format": "double" - } - } - }, - "zAxis": { - "description": "The z-axis (normal).", - "type": "object", - "required": [ - "x", - "y", - "z" - ], - "properties": { - "x": { - "type": "number", - "format": "double" - }, - "y": { - "type": "number", - "format": "double" - }, - "z": { - "type": "number", - "format": "double" - } - } - } - } - } - ] - }, - "position": { - "description": "The position of the sketch group.", - "type": "array", - "items": { - "type": "number", - "format": "double" - }, - "maxItems": 3, - "minItems": 3 - }, - "rotation": { - "description": "The rotation of the sketch group base plane.", - "type": "array", - "items": { - "type": "number", - "format": "double" - }, - "maxItems": 4, - "minItems": 4 - }, - "start": { - "description": "The starting path.", - "type": "object", - "required": [ - "__geoMeta", - "from", - "name", - "to" - ], - "properties": { - "__geoMeta": { - "description": "Metadata.", - "type": "object", - "required": [ - "id", - "sourceRange" - ], - "properties": { - "id": { - "description": "The id of the geometry.", - "type": "string", - "format": "uuid" - }, - "sourceRange": { - "description": "The source range.", - "type": "array", - "items": { - "type": "integer", - "format": "uint", - "minimum": 0.0 - }, - "maxItems": 2, - "minItems": 2 - } - } - }, - "from": { - "description": "The from point.", - "type": "array", - "items": { - "type": "number", - "format": "double" - }, - "maxItems": 2, - "minItems": 2 - }, - "name": { - "description": "The name of the path.", - "type": "string" - }, - "to": { - "description": "The to point.", - "type": "array", - "items": { - "type": "number", - "format": "double" - }, - "maxItems": 2, - "minItems": 2 - } - } - }, - "type": { - "type": "string", - "enum": [ - "SketchGroup" - ] - }, - "value": { - "description": "The paths in the sketch group.", - "type": "array", - "items": { - "description": "A path.", - "oneOf": [ - { - "description": "A path that goes to a point.", - "type": "object", - "required": [ - "__geoMeta", - "from", - "name", - "to", - "type" - ], - "properties": { - "__geoMeta": { - "description": "Metadata.", - "type": "object", - "required": [ - "id", - "sourceRange" - ], - "properties": { - "id": { - "description": "The id of the geometry.", - "type": "string", - "format": "uuid" - }, - "sourceRange": { - "description": "The source range.", - "type": "array", - "items": { - "type": "integer", - "format": "uint", - "minimum": 0.0 - }, - "maxItems": 2, - "minItems": 2 - } - } - }, - "from": { - "description": "The from point.", - "type": "array", - "items": { - "type": "number", - "format": "double" - }, - "maxItems": 2, - "minItems": 2 - }, - "name": { - "description": "The name of the path.", - "type": "string" - }, - "to": { - "description": "The to point.", - "type": "array", - "items": { - "type": "number", - "format": "double" - }, - "maxItems": 2, - "minItems": 2 - }, - "type": { - "type": "string", - "enum": [ - "ToPoint" - ] - } - } - }, - { - "description": "A arc that is tangential to the last path segment that goes to a point", - "type": "object", - "required": [ - "__geoMeta", - "ccw", - "center", - "from", - "name", - "to", - "type" - ], - "properties": { - "__geoMeta": { - "description": "Metadata.", - "type": "object", - "required": [ - "id", - "sourceRange" - ], - "properties": { - "id": { - "description": "The id of the geometry.", - "type": "string", - "format": "uuid" - }, - "sourceRange": { - "description": "The source range.", - "type": "array", - "items": { - "type": "integer", - "format": "uint", - "minimum": 0.0 - }, - "maxItems": 2, - "minItems": 2 - } - } - }, - "ccw": { - "description": "arc's direction", - "type": "boolean" - }, - "center": { - "description": "the arc's center", - "type": "array", - "items": { - "type": "number", - "format": "double" - }, - "maxItems": 2, - "minItems": 2 - }, - "from": { - "description": "The from point.", - "type": "array", - "items": { - "type": "number", - "format": "double" - }, - "maxItems": 2, - "minItems": 2 - }, - "name": { - "description": "The name of the path.", - "type": "string" - }, - "to": { - "description": "The to point.", - "type": "array", - "items": { - "type": "number", - "format": "double" - }, - "maxItems": 2, - "minItems": 2 - }, - "type": { - "type": "string", - "enum": [ - "TangentialArcTo" - ] - } - } - }, - { - "description": "A arc that is tangential to the last path segment", - "type": "object", - "required": [ - "__geoMeta", - "from", - "name", - "to", - "type" - ], - "properties": { - "__geoMeta": { - "description": "Metadata.", - "type": "object", - "required": [ - "id", - "sourceRange" - ], - "properties": { - "id": { - "description": "The id of the geometry.", - "type": "string", - "format": "uuid" - }, - "sourceRange": { - "description": "The source range.", - "type": "array", - "items": { - "type": "integer", - "format": "uint", - "minimum": 0.0 - }, - "maxItems": 2, - "minItems": 2 - } - } - }, - "from": { - "description": "The from point.", - "type": "array", - "items": { - "type": "number", - "format": "double" - }, - "maxItems": 2, - "minItems": 2 - }, - "name": { - "description": "The name of the path.", - "type": "string" - }, - "to": { - "description": "The to point.", - "type": "array", - "items": { - "type": "number", - "format": "double" - }, - "maxItems": 2, - "minItems": 2 - }, - "type": { - "type": "string", - "enum": [ - "TangentialArc" - ] - } - } - }, - { - "description": "A path that is horizontal.", - "type": "object", - "required": [ - "__geoMeta", - "from", - "name", - "to", - "type", - "x" - ], - "properties": { - "__geoMeta": { - "description": "Metadata.", - "type": "object", - "required": [ - "id", - "sourceRange" - ], - "properties": { - "id": { - "description": "The id of the geometry.", - "type": "string", - "format": "uuid" - }, - "sourceRange": { - "description": "The source range.", - "type": "array", - "items": { - "type": "integer", - "format": "uint", - "minimum": 0.0 - }, - "maxItems": 2, - "minItems": 2 - } - } - }, - "from": { - "description": "The from point.", - "type": "array", - "items": { - "type": "number", - "format": "double" - }, - "maxItems": 2, - "minItems": 2 - }, - "name": { - "description": "The name of the path.", - "type": "string" - }, - "to": { - "description": "The to point.", - "type": "array", - "items": { - "type": "number", - "format": "double" - }, - "maxItems": 2, - "minItems": 2 - }, - "type": { - "type": "string", - "enum": [ - "Horizontal" - ] - }, - "x": { - "description": "The x coordinate.", - "type": "number", - "format": "double" - } - } - }, - { - "description": "An angled line to.", - "type": "object", - "required": [ - "__geoMeta", - "from", - "name", - "to", - "type" - ], - "properties": { - "__geoMeta": { - "description": "Metadata.", - "type": "object", - "required": [ - "id", - "sourceRange" - ], - "properties": { - "id": { - "description": "The id of the geometry.", - "type": "string", - "format": "uuid" - }, - "sourceRange": { - "description": "The source range.", - "type": "array", - "items": { - "type": "integer", - "format": "uint", - "minimum": 0.0 - }, - "maxItems": 2, - "minItems": 2 - } - } - }, - "from": { - "description": "The from point.", - "type": "array", - "items": { - "type": "number", - "format": "double" - }, - "maxItems": 2, - "minItems": 2 - }, - "name": { - "description": "The name of the path.", - "type": "string" - }, - "to": { - "description": "The to point.", - "type": "array", - "items": { - "type": "number", - "format": "double" - }, - "maxItems": 2, - "minItems": 2 - }, - "type": { - "type": "string", - "enum": [ - "AngledLineTo" - ] - }, - "x": { - "description": "The x coordinate.", - "type": "number", - "format": "double", - "nullable": true - }, - "y": { - "description": "The y coordinate.", - "type": "number", - "format": "double", - "nullable": true - } - } - }, - { - "description": "A base path.", - "type": "object", - "required": [ - "__geoMeta", - "from", - "name", - "to", - "type" - ], - "properties": { - "__geoMeta": { - "description": "Metadata.", - "type": "object", - "required": [ - "id", - "sourceRange" - ], - "properties": { - "id": { - "description": "The id of the geometry.", - "type": "string", - "format": "uuid" - }, - "sourceRange": { - "description": "The source range.", - "type": "array", - "items": { - "type": "integer", - "format": "uint", - "minimum": 0.0 - }, - "maxItems": 2, - "minItems": 2 - } - } - }, - "from": { - "description": "The from point.", - "type": "array", - "items": { - "type": "number", - "format": "double" - }, - "maxItems": 2, - "minItems": 2 - }, - "name": { - "description": "The name of the path.", - "type": "string" - }, - "to": { - "description": "The to point.", - "type": "array", - "items": { - "type": "number", - "format": "double" - }, - "maxItems": 2, - "minItems": 2 - }, - "type": { - "type": "string", - "enum": [ - "Base" - ] - } - } - } - ] - } - }, - "xAxis": { - "description": "The x-axis of the sketch group base plane in the 3D space", - "type": "object", - "required": [ - "x", - "y", - "z" - ], - "properties": { - "x": { - "type": "number", - "format": "double" - }, - "y": { - "type": "number", - "format": "double" - }, - "z": { - "type": "number", - "format": "double" - } - } - }, - "yAxis": { - "description": "The y-axis of the sketch group base plane in the 3D space", - "type": "object", - "required": [ - "x", - "y", - "z" - ], - "properties": { - "x": { - "type": "number", - "format": "double" - }, - "y": { - "type": "number", - "format": "double" - }, - "z": { - "type": "number", - "format": "double" - } - } - }, - "zAxis": { - "description": "The z-axis of the sketch group base plane in the 3D space", - "type": "object", - "required": [ - "x", - "y", - "z" - ], - "properties": { - "x": { - "type": "number", - "format": "double" - }, - "y": { - "type": "number", - "format": "double" - }, - "z": { - "type": "number", - "format": "double" - } + "maxItems": 2, + "minItems": 2 } } } }, - { - "description": "An extrude group is a collection of extrude surfaces.", - "type": "object", - "required": [ - "__meta", - "height", - "id", - "position", - "rotation", - "sketchGroupValues", - "type", - "value", - "xAxis", - "yAxis", - "zAxis" - ], - "properties": { - "__meta": { - "description": "Metadata.", - "type": "array", - "items": { - "description": "Metadata.", - "type": "object", - "required": [ - "sourceRange" - ], - "properties": { - "sourceRange": { - "description": "The source range.", - "type": "array", - "items": { - "type": "integer", - "format": "uint", - "minimum": 0.0 + "entityId": { + "description": "The plane id or face id of the sketch group.", + "type": "string", + "format": "uuid", + "nullable": true + }, + "id": { + "description": "The id of the sketch group.", + "type": "string", + "format": "uuid" + }, + "on": { + "description": "What the sketch is on (can be a plane or a face).", + "oneOf": [ + { + "description": "A plane.", + "type": "object", + "required": [ + "__meta", + "id", + "origin", + "type", + "value", + "xAxis", + "yAxis", + "zAxis" + ], + "properties": { + "__meta": { + "type": "array", + "items": { + "description": "Metadata.", + "type": "object", + "required": [ + "sourceRange" + ], + "properties": { + "sourceRange": { + "description": "The source range.", + "type": "array", + "items": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "maxItems": 2, + "minItems": 2 + } + } + } + }, + "id": { + "description": "The id of the plane.", + "type": "string", + "format": "uuid" + }, + "origin": { + "description": "Origin of the plane.", + "type": "object", + "required": [ + "x", + "y", + "z" + ], + "properties": { + "x": { + "type": "number", + "format": "double" }, - "maxItems": 2, - "minItems": 2 + "y": { + "type": "number", + "format": "double" + }, + "z": { + "type": "number", + "format": "double" + } + } + }, + "type": { + "type": "string", + "enum": [ + "plane" + ] + }, + "value": { + "description": "Type for a plane.", + "oneOf": [ + { + "type": "string", + "enum": [ + "XY", + "XZ", + "YZ" + ] + }, + { + "description": "A custom plane.", + "type": "string", + "enum": [ + "Custom" + ] + } + ] + }, + "xAxis": { + "description": "What should the plane’s X axis be?", + "type": "object", + "required": [ + "x", + "y", + "z" + ], + "properties": { + "x": { + "type": "number", + "format": "double" + }, + "y": { + "type": "number", + "format": "double" + }, + "z": { + "type": "number", + "format": "double" + } + } + }, + "yAxis": { + "description": "What should the plane’s Y axis be?", + "type": "object", + "required": [ + "x", + "y", + "z" + ], + "properties": { + "x": { + "type": "number", + "format": "double" + }, + "y": { + "type": "number", + "format": "double" + }, + "z": { + "type": "number", + "format": "double" + } + } + }, + "zAxis": { + "description": "The z-axis (normal).", + "type": "object", + "required": [ + "x", + "y", + "z" + ], + "properties": { + "x": { + "type": "number", + "format": "double" + }, + "y": { + "type": "number", + "format": "double" + }, + "z": { + "type": "number", + "format": "double" + } } } } }, - "endCapId": { - "description": "The id of the extrusion end cap", - "type": "string", - "format": "uuid", - "nullable": true - }, - "height": { - "description": "The height of the extrude group.", - "type": "number", - "format": "double" - }, - "id": { - "description": "The id of the extrude group.", - "type": "string", - "format": "uuid" - }, - "position": { - "description": "The position of the extrude group.", - "type": "array", - "items": { - "type": "number", - "format": "double" - }, - "maxItems": 3, - "minItems": 3 - }, - "rotation": { - "description": "The rotation of the extrude group.", - "type": "array", - "items": { - "type": "number", - "format": "double" - }, - "maxItems": 4, - "minItems": 4 - }, - "sketchGroupValues": { - "description": "The sketch group paths.", - "type": "array", - "items": { - "description": "A path.", - "oneOf": [ - { - "description": "A path that goes to a point.", + { + "description": "A face.", + "type": "object", + "required": [ + "__meta", + "id", + "sketchGroupId", + "type", + "value", + "xAxis", + "yAxis", + "zAxis" + ], + "properties": { + "__meta": { + "type": "array", + "items": { + "description": "Metadata.", "type": "object", "required": [ - "__geoMeta", - "from", - "name", - "to", - "type" + "sourceRange" ], "properties": { - "__geoMeta": { - "description": "Metadata.", - "type": "object", - "required": [ - "id", - "sourceRange" - ], - "properties": { - "id": { - "description": "The id of the geometry.", - "type": "string", - "format": "uuid" - }, - "sourceRange": { - "description": "The source range.", - "type": "array", - "items": { - "type": "integer", - "format": "uint", - "minimum": 0.0 - }, - "maxItems": 2, - "minItems": 2 - } - } - }, - "from": { - "description": "The from point.", - "type": "array", - "items": { - "type": "number", - "format": "double" - }, - "maxItems": 2, - "minItems": 2 - }, - "name": { - "description": "The name of the path.", - "type": "string" - }, - "to": { - "description": "The to point.", - "type": "array", - "items": { - "type": "number", - "format": "double" - }, - "maxItems": 2, - "minItems": 2 - }, - "type": { - "type": "string", - "enum": [ - "ToPoint" - ] - } - } - }, - { - "description": "A arc that is tangential to the last path segment that goes to a point", - "type": "object", - "required": [ - "__geoMeta", - "ccw", - "center", - "from", - "name", - "to", - "type" - ], - "properties": { - "__geoMeta": { - "description": "Metadata.", - "type": "object", - "required": [ - "id", - "sourceRange" - ], - "properties": { - "id": { - "description": "The id of the geometry.", - "type": "string", - "format": "uuid" - }, - "sourceRange": { - "description": "The source range.", - "type": "array", - "items": { - "type": "integer", - "format": "uint", - "minimum": 0.0 - }, - "maxItems": 2, - "minItems": 2 - } - } - }, - "ccw": { - "description": "arc's direction", - "type": "boolean" - }, - "center": { - "description": "the arc's center", - "type": "array", - "items": { - "type": "number", - "format": "double" - }, - "maxItems": 2, - "minItems": 2 - }, - "from": { - "description": "The from point.", - "type": "array", - "items": { - "type": "number", - "format": "double" - }, - "maxItems": 2, - "minItems": 2 - }, - "name": { - "description": "The name of the path.", - "type": "string" - }, - "to": { - "description": "The to point.", - "type": "array", - "items": { - "type": "number", - "format": "double" - }, - "maxItems": 2, - "minItems": 2 - }, - "type": { - "type": "string", - "enum": [ - "TangentialArcTo" - ] - } - } - }, - { - "description": "A arc that is tangential to the last path segment", - "type": "object", - "required": [ - "__geoMeta", - "from", - "name", - "to", - "type" - ], - "properties": { - "__geoMeta": { - "description": "Metadata.", - "type": "object", - "required": [ - "id", - "sourceRange" - ], - "properties": { - "id": { - "description": "The id of the geometry.", - "type": "string", - "format": "uuid" - }, - "sourceRange": { - "description": "The source range.", - "type": "array", - "items": { - "type": "integer", - "format": "uint", - "minimum": 0.0 - }, - "maxItems": 2, - "minItems": 2 - } - } - }, - "from": { - "description": "The from point.", - "type": "array", - "items": { - "type": "number", - "format": "double" - }, - "maxItems": 2, - "minItems": 2 - }, - "name": { - "description": "The name of the path.", - "type": "string" - }, - "to": { - "description": "The to point.", - "type": "array", - "items": { - "type": "number", - "format": "double" - }, - "maxItems": 2, - "minItems": 2 - }, - "type": { - "type": "string", - "enum": [ - "TangentialArc" - ] - } - } - }, - { - "description": "A path that is horizontal.", - "type": "object", - "required": [ - "__geoMeta", - "from", - "name", - "to", - "type", - "x" - ], - "properties": { - "__geoMeta": { - "description": "Metadata.", - "type": "object", - "required": [ - "id", - "sourceRange" - ], - "properties": { - "id": { - "description": "The id of the geometry.", - "type": "string", - "format": "uuid" - }, - "sourceRange": { - "description": "The source range.", - "type": "array", - "items": { - "type": "integer", - "format": "uint", - "minimum": 0.0 - }, - "maxItems": 2, - "minItems": 2 - } - } - }, - "from": { - "description": "The from point.", - "type": "array", - "items": { - "type": "number", - "format": "double" - }, - "maxItems": 2, - "minItems": 2 - }, - "name": { - "description": "The name of the path.", - "type": "string" - }, - "to": { - "description": "The to point.", - "type": "array", - "items": { - "type": "number", - "format": "double" - }, - "maxItems": 2, - "minItems": 2 - }, - "type": { - "type": "string", - "enum": [ - "Horizontal" - ] - }, - "x": { - "description": "The x coordinate.", - "type": "number", - "format": "double" - } - } - }, - { - "description": "An angled line to.", - "type": "object", - "required": [ - "__geoMeta", - "from", - "name", - "to", - "type" - ], - "properties": { - "__geoMeta": { - "description": "Metadata.", - "type": "object", - "required": [ - "id", - "sourceRange" - ], - "properties": { - "id": { - "description": "The id of the geometry.", - "type": "string", - "format": "uuid" - }, - "sourceRange": { - "description": "The source range.", - "type": "array", - "items": { - "type": "integer", - "format": "uint", - "minimum": 0.0 - }, - "maxItems": 2, - "minItems": 2 - } - } - }, - "from": { - "description": "The from point.", - "type": "array", - "items": { - "type": "number", - "format": "double" - }, - "maxItems": 2, - "minItems": 2 - }, - "name": { - "description": "The name of the path.", - "type": "string" - }, - "to": { - "description": "The to point.", - "type": "array", - "items": { - "type": "number", - "format": "double" - }, - "maxItems": 2, - "minItems": 2 - }, - "type": { - "type": "string", - "enum": [ - "AngledLineTo" - ] - }, - "x": { - "description": "The x coordinate.", - "type": "number", - "format": "double", - "nullable": true - }, - "y": { - "description": "The y coordinate.", - "type": "number", - "format": "double", - "nullable": true - } - } - }, - { - "description": "A base path.", - "type": "object", - "required": [ - "__geoMeta", - "from", - "name", - "to", - "type" - ], - "properties": { - "__geoMeta": { - "description": "Metadata.", - "type": "object", - "required": [ - "id", - "sourceRange" - ], - "properties": { - "id": { - "description": "The id of the geometry.", - "type": "string", - "format": "uuid" - }, - "sourceRange": { - "description": "The source range.", - "type": "array", - "items": { - "type": "integer", - "format": "uint", - "minimum": 0.0 - }, - "maxItems": 2, - "minItems": 2 - } - } - }, - "from": { - "description": "The from point.", - "type": "array", - "items": { - "type": "number", - "format": "double" - }, - "maxItems": 2, - "minItems": 2 - }, - "name": { - "description": "The name of the path.", - "type": "string" - }, - "to": { - "description": "The to point.", - "type": "array", - "items": { - "type": "number", - "format": "double" - }, - "maxItems": 2, - "minItems": 2 - }, - "type": { - "type": "string", - "enum": [ - "Base" - ] - } - } - } - ] - } - }, - "startCapId": { - "description": "The id of the extrusion start cap", - "type": "string", - "format": "uuid", - "nullable": true - }, - "type": { - "type": "string", - "enum": [ - "ExtrudeGroup" - ] - }, - "value": { - "description": "The extrude surfaces.", - "type": "array", - "items": { - "description": "An extrude surface.", - "oneOf": [ - { - "description": "An extrude plane.", - "type": "object", - "required": [ - "faceId", - "id", - "name", - "position", - "rotation", - "sourceRange", - "type" - ], - "properties": { - "faceId": { - "description": "The face id for the extrude plane.", - "type": "string", - "format": "uuid" - }, - "id": { - "description": "The id of the geometry.", - "type": "string", - "format": "uuid" - }, - "name": { - "description": "The name.", - "type": "string" - }, - "position": { - "description": "The position.", - "type": "array", - "items": { - "type": "number", - "format": "double" - }, - "maxItems": 3, - "minItems": 3 - }, - "rotation": { - "description": "The rotation.", - "type": "array", - "items": { - "type": "number", - "format": "double" - }, - "maxItems": 4, - "minItems": 4 - }, "sourceRange": { "description": "The source range.", "type": "array", @@ -43676,1908 +42360,3239 @@ }, "maxItems": 2, "minItems": 2 - }, - "type": { - "type": "string", - "enum": [ - "extrudePlane" - ] - } - } - }, - { - "description": "An extruded arc.", - "type": "object", - "required": [ - "faceId", - "id", - "name", - "position", - "rotation", - "sourceRange", - "type" - ], - "properties": { - "faceId": { - "description": "The face id for the extrude plane.", - "type": "string", - "format": "uuid" - }, - "id": { - "description": "The id of the geometry.", - "type": "string", - "format": "uuid" - }, - "name": { - "description": "The name.", - "type": "string" - }, - "position": { - "description": "The position.", - "type": "array", - "items": { - "type": "number", - "format": "double" - }, - "maxItems": 3, - "minItems": 3 - }, - "rotation": { - "description": "The rotation.", - "type": "array", - "items": { - "type": "number", - "format": "double" - }, - "maxItems": 4, - "minItems": 4 - }, - "sourceRange": { - "description": "The source range.", - "type": "array", - "items": { - "type": "integer", - "format": "uint", - "minimum": 0.0 - }, - "maxItems": 2, - "minItems": 2 - }, - "type": { - "type": "string", - "enum": [ - "extrudeArc" - ] } } } - ] - } - }, - "xAxis": { - "description": "The x-axis of the extrude group base plane in the 3D space", - "type": "object", - "required": [ - "x", - "y", - "z" - ], - "properties": { - "x": { - "type": "number", - "format": "double" }, - "y": { - "type": "number", - "format": "double" + "id": { + "description": "The id of the face.", + "type": "string", + "format": "uuid" }, - "z": { - "type": "number", - "format": "double" - } - } - }, - "yAxis": { - "description": "The y-axis of the extrude group base plane in the 3D space", - "type": "object", - "required": [ - "x", - "y", - "z" - ], - "properties": { - "x": { - "type": "number", - "format": "double" + "sketchGroupId": { + "description": "The original sketch group id of the object we are sketching on.", + "type": "string", + "format": "uuid" }, - "y": { - "type": "number", - "format": "double" + "type": { + "type": "string", + "enum": [ + "face" + ] }, - "z": { - "type": "number", - "format": "double" - } - } - }, - "zAxis": { - "description": "The z-axis of the extrude group base plane in the 3D space", - "type": "object", - "required": [ - "x", - "y", - "z" - ], - "properties": { - "x": { - "type": "number", - "format": "double" + "value": { + "description": "The tag of the face.", + "type": "string" }, - "y": { - "type": "number", - "format": "double" + "xAxis": { + "description": "What should the face’s X axis be?", + "type": "object", + "required": [ + "x", + "y", + "z" + ], + "properties": { + "x": { + "type": "number", + "format": "double" + }, + "y": { + "type": "number", + "format": "double" + }, + "z": { + "type": "number", + "format": "double" + } + } }, - "z": { - "type": "number", - "format": "double" + "yAxis": { + "description": "What should the face’s Y axis be?", + "type": "object", + "required": [ + "x", + "y", + "z" + ], + "properties": { + "x": { + "type": "number", + "format": "double" + }, + "y": { + "type": "number", + "format": "double" + }, + "z": { + "type": "number", + "format": "double" + } + } + }, + "zAxis": { + "description": "The z-axis (normal).", + "type": "object", + "required": [ + "x", + "y", + "z" + ], + "properties": { + "x": { + "type": "number", + "format": "double" + }, + "y": { + "type": "number", + "format": "double" + }, + "z": { + "type": "number", + "format": "double" + } + } } } } + ] + }, + "position": { + "description": "The position of the sketch group.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 3, + "minItems": 3 + }, + "rotation": { + "description": "The rotation of the sketch group base plane.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 4, + "minItems": 4 + }, + "start": { + "description": "The starting path.", + "type": "object", + "required": [ + "__geoMeta", + "from", + "name", + "to" + ], + "properties": { + "__geoMeta": { + "description": "Metadata.", + "type": "object", + "required": [ + "id", + "sourceRange" + ], + "properties": { + "id": { + "description": "The id of the geometry.", + "type": "string", + "format": "uuid" + }, + "sourceRange": { + "description": "The source range.", + "type": "array", + "items": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "maxItems": 2, + "minItems": 2 + } + } + }, + "from": { + "description": "The from point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "name": { + "description": "The name of the path.", + "type": "string" + }, + "to": { + "description": "The to point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + } + } + }, + "value": { + "description": "The paths in the sketch group.", + "type": "array", + "items": { + "description": "A path.", + "oneOf": [ + { + "description": "A path that goes to a point.", + "type": "object", + "required": [ + "__geoMeta", + "from", + "name", + "to", + "type" + ], + "properties": { + "__geoMeta": { + "description": "Metadata.", + "type": "object", + "required": [ + "id", + "sourceRange" + ], + "properties": { + "id": { + "description": "The id of the geometry.", + "type": "string", + "format": "uuid" + }, + "sourceRange": { + "description": "The source range.", + "type": "array", + "items": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "maxItems": 2, + "minItems": 2 + } + } + }, + "from": { + "description": "The from point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "name": { + "description": "The name of the path.", + "type": "string" + }, + "to": { + "description": "The to point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "type": { + "type": "string", + "enum": [ + "ToPoint" + ] + } + } + }, + { + "description": "A arc that is tangential to the last path segment that goes to a point", + "type": "object", + "required": [ + "__geoMeta", + "ccw", + "center", + "from", + "name", + "to", + "type" + ], + "properties": { + "__geoMeta": { + "description": "Metadata.", + "type": "object", + "required": [ + "id", + "sourceRange" + ], + "properties": { + "id": { + "description": "The id of the geometry.", + "type": "string", + "format": "uuid" + }, + "sourceRange": { + "description": "The source range.", + "type": "array", + "items": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "maxItems": 2, + "minItems": 2 + } + } + }, + "ccw": { + "description": "arc's direction", + "type": "boolean" + }, + "center": { + "description": "the arc's center", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "from": { + "description": "The from point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "name": { + "description": "The name of the path.", + "type": "string" + }, + "to": { + "description": "The to point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "type": { + "type": "string", + "enum": [ + "TangentialArcTo" + ] + } + } + }, + { + "description": "A arc that is tangential to the last path segment", + "type": "object", + "required": [ + "__geoMeta", + "from", + "name", + "to", + "type" + ], + "properties": { + "__geoMeta": { + "description": "Metadata.", + "type": "object", + "required": [ + "id", + "sourceRange" + ], + "properties": { + "id": { + "description": "The id of the geometry.", + "type": "string", + "format": "uuid" + }, + "sourceRange": { + "description": "The source range.", + "type": "array", + "items": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "maxItems": 2, + "minItems": 2 + } + } + }, + "from": { + "description": "The from point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "name": { + "description": "The name of the path.", + "type": "string" + }, + "to": { + "description": "The to point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "type": { + "type": "string", + "enum": [ + "TangentialArc" + ] + } + } + }, + { + "description": "A path that is horizontal.", + "type": "object", + "required": [ + "__geoMeta", + "from", + "name", + "to", + "type", + "x" + ], + "properties": { + "__geoMeta": { + "description": "Metadata.", + "type": "object", + "required": [ + "id", + "sourceRange" + ], + "properties": { + "id": { + "description": "The id of the geometry.", + "type": "string", + "format": "uuid" + }, + "sourceRange": { + "description": "The source range.", + "type": "array", + "items": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "maxItems": 2, + "minItems": 2 + } + } + }, + "from": { + "description": "The from point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "name": { + "description": "The name of the path.", + "type": "string" + }, + "to": { + "description": "The to point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "type": { + "type": "string", + "enum": [ + "Horizontal" + ] + }, + "x": { + "description": "The x coordinate.", + "type": "number", + "format": "double" + } + } + }, + { + "description": "An angled line to.", + "type": "object", + "required": [ + "__geoMeta", + "from", + "name", + "to", + "type" + ], + "properties": { + "__geoMeta": { + "description": "Metadata.", + "type": "object", + "required": [ + "id", + "sourceRange" + ], + "properties": { + "id": { + "description": "The id of the geometry.", + "type": "string", + "format": "uuid" + }, + "sourceRange": { + "description": "The source range.", + "type": "array", + "items": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "maxItems": 2, + "minItems": 2 + } + } + }, + "from": { + "description": "The from point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "name": { + "description": "The name of the path.", + "type": "string" + }, + "to": { + "description": "The to point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "type": { + "type": "string", + "enum": [ + "AngledLineTo" + ] + }, + "x": { + "description": "The x coordinate.", + "type": "number", + "format": "double", + "nullable": true + }, + "y": { + "description": "The y coordinate.", + "type": "number", + "format": "double", + "nullable": true + } + } + }, + { + "description": "A base path.", + "type": "object", + "required": [ + "__geoMeta", + "from", + "name", + "to", + "type" + ], + "properties": { + "__geoMeta": { + "description": "Metadata.", + "type": "object", + "required": [ + "id", + "sourceRange" + ], + "properties": { + "id": { + "description": "The id of the geometry.", + "type": "string", + "format": "uuid" + }, + "sourceRange": { + "description": "The source range.", + "type": "array", + "items": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "maxItems": 2, + "minItems": 2 + } + } + }, + "from": { + "description": "The from point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "name": { + "description": "The name of the path.", + "type": "string" + }, + "to": { + "description": "The to point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "type": { + "type": "string", + "enum": [ + "Base" + ] + } + } + } + ] + } + }, + "xAxis": { + "description": "The x-axis of the sketch group base plane in the 3D space", + "type": "object", + "required": [ + "x", + "y", + "z" + ], + "properties": { + "x": { + "type": "number", + "format": "double" + }, + "y": { + "type": "number", + "format": "double" + }, + "z": { + "type": "number", + "format": "double" + } + } + }, + "yAxis": { + "description": "The y-axis of the sketch group base plane in the 3D space", + "type": "object", + "required": [ + "x", + "y", + "z" + ], + "properties": { + "x": { + "type": "number", + "format": "double" + }, + "y": { + "type": "number", + "format": "double" + }, + "z": { + "type": "number", + "format": "double" + } + } + }, + "zAxis": { + "description": "The z-axis of the sketch group base plane in the 3D space", + "type": "object", + "required": [ + "x", + "y", + "z" + ], + "properties": { + "x": { + "type": "number", + "format": "double" + }, + "y": { + "type": "number", + "format": "double" + }, + "z": { + "type": "number", + "format": "double" + } } } - ] + } }, "required": true } ], "returnValue": { "name": "", - "type": "Geometries", + "type": "[SketchGroup]", "schema": { - "description": "A set of geometry.", - "oneOf": [ - { - "type": [ - "object", - "array" - ], - "items": { - "description": "A sketch group is a collection of paths.", - "type": "object", - "required": [ - "__meta", - "id", - "on", - "position", - "rotation", - "start", - "value", - "xAxis", - "yAxis", - "zAxis" - ], - "properties": { - "__meta": { - "description": "Metadata.", - "type": "array", - "items": { - "description": "Metadata.", - "type": "object", - "required": [ - "sourceRange" - ], - "properties": { - "sourceRange": { - "description": "The source range.", - "type": "array", - "items": { - "type": "integer", - "format": "uint", - "minimum": 0.0 - }, - "maxItems": 2, - "minItems": 2 - } - } - } - }, - "entityId": { - "description": "The plane id or face id of the sketch group.", - "type": "string", - "format": "uuid", - "nullable": true - }, - "id": { - "description": "The id of the sketch group.", - "type": "string", - "format": "uuid" - }, - "on": { - "description": "What the sketch is on (can be a plane or a face).", - "oneOf": [ - { - "description": "A plane.", - "type": "object", - "required": [ - "__meta", - "id", - "origin", - "type", - "value", - "xAxis", - "yAxis", - "zAxis" - ], - "properties": { - "__meta": { - "type": "array", - "items": { - "description": "Metadata.", - "type": "object", - "required": [ - "sourceRange" - ], - "properties": { - "sourceRange": { - "description": "The source range.", - "type": "array", - "items": { - "type": "integer", - "format": "uint", - "minimum": 0.0 - }, - "maxItems": 2, - "minItems": 2 - } - } - } - }, - "id": { - "description": "The id of the plane.", - "type": "string", - "format": "uuid" - }, - "origin": { - "description": "Origin of the plane.", - "type": "object", - "required": [ - "x", - "y", - "z" - ], - "properties": { - "x": { - "type": "number", - "format": "double" - }, - "y": { - "type": "number", - "format": "double" - }, - "z": { - "type": "number", - "format": "double" - } - } - }, - "type": { - "type": "string", - "enum": [ - "plane" - ] - }, - "value": { - "description": "Type for a plane.", - "oneOf": [ - { - "type": "string", - "enum": [ - "XY", - "XZ", - "YZ" - ] - }, - { - "description": "A custom plane.", - "type": "string", - "enum": [ - "Custom" - ] - } - ] - }, - "xAxis": { - "description": "What should the plane’s X axis be?", - "type": "object", - "required": [ - "x", - "y", - "z" - ], - "properties": { - "x": { - "type": "number", - "format": "double" - }, - "y": { - "type": "number", - "format": "double" - }, - "z": { - "type": "number", - "format": "double" - } - } - }, - "yAxis": { - "description": "What should the plane’s Y axis be?", - "type": "object", - "required": [ - "x", - "y", - "z" - ], - "properties": { - "x": { - "type": "number", - "format": "double" - }, - "y": { - "type": "number", - "format": "double" - }, - "z": { - "type": "number", - "format": "double" - } - } - }, - "zAxis": { - "description": "The z-axis (normal).", - "type": "object", - "required": [ - "x", - "y", - "z" - ], - "properties": { - "x": { - "type": "number", - "format": "double" - }, - "y": { - "type": "number", - "format": "double" - }, - "z": { - "type": "number", - "format": "double" - } - } - } - } + "type": "array", + "items": { + "description": "A sketch group is a collection of paths.", + "type": "object", + "required": [ + "__meta", + "id", + "on", + "position", + "rotation", + "start", + "value", + "xAxis", + "yAxis", + "zAxis" + ], + "properties": { + "__meta": { + "description": "Metadata.", + "type": "array", + "items": { + "description": "Metadata.", + "type": "object", + "required": [ + "sourceRange" + ], + "properties": { + "sourceRange": { + "description": "The source range.", + "type": "array", + "items": { + "type": "integer", + "format": "uint", + "minimum": 0.0 }, - { - "description": "A face.", - "type": "object", - "required": [ - "__meta", - "id", - "sketchGroupId", - "type", - "value", - "xAxis", - "yAxis", - "zAxis" - ], - "properties": { - "__meta": { - "type": "array", - "items": { - "description": "Metadata.", - "type": "object", - "required": [ - "sourceRange" - ], - "properties": { - "sourceRange": { - "description": "The source range.", - "type": "array", - "items": { - "type": "integer", - "format": "uint", - "minimum": 0.0 - }, - "maxItems": 2, - "minItems": 2 - } - } - } - }, - "id": { - "description": "The id of the face.", - "type": "string", - "format": "uuid" - }, - "sketchGroupId": { - "description": "The original sketch group id of the object we are sketching on.", - "type": "string", - "format": "uuid" - }, - "type": { - "type": "string", - "enum": [ - "face" - ] - }, - "value": { - "description": "The tag of the face.", - "type": "string" - }, - "xAxis": { - "description": "What should the face’s X axis be?", - "type": "object", - "required": [ - "x", - "y", - "z" - ], - "properties": { - "x": { - "type": "number", - "format": "double" - }, - "y": { - "type": "number", - "format": "double" - }, - "z": { - "type": "number", - "format": "double" - } - } - }, - "yAxis": { - "description": "What should the face’s Y axis be?", - "type": "object", - "required": [ - "x", - "y", - "z" - ], - "properties": { - "x": { - "type": "number", - "format": "double" - }, - "y": { - "type": "number", - "format": "double" - }, - "z": { - "type": "number", - "format": "double" - } - } - }, - "zAxis": { - "description": "The z-axis (normal).", - "type": "object", - "required": [ - "x", - "y", - "z" - ], - "properties": { - "x": { - "type": "number", - "format": "double" - }, - "y": { - "type": "number", - "format": "double" - }, - "z": { - "type": "number", - "format": "double" - } - } - } - } - } - ] - }, - "position": { - "description": "The position of the sketch group.", - "type": "array", - "items": { - "type": "number", - "format": "double" - }, - "maxItems": 3, - "minItems": 3 - }, - "rotation": { - "description": "The rotation of the sketch group base plane.", - "type": "array", - "items": { - "type": "number", - "format": "double" - }, - "maxItems": 4, - "minItems": 4 - }, - "start": { - "description": "The starting path.", - "type": "object", - "required": [ - "__geoMeta", - "from", - "name", - "to" - ], - "properties": { - "__geoMeta": { - "description": "Metadata.", - "type": "object", - "required": [ - "id", - "sourceRange" - ], - "properties": { - "id": { - "description": "The id of the geometry.", - "type": "string", - "format": "uuid" - }, - "sourceRange": { - "description": "The source range.", - "type": "array", - "items": { - "type": "integer", - "format": "uint", - "minimum": 0.0 - }, - "maxItems": 2, - "minItems": 2 - } - } - }, - "from": { - "description": "The from point.", - "type": "array", - "items": { - "type": "number", - "format": "double" - }, - "maxItems": 2, - "minItems": 2 - }, - "name": { - "description": "The name of the path.", - "type": "string" - }, - "to": { - "description": "The to point.", - "type": "array", - "items": { - "type": "number", - "format": "double" - }, - "maxItems": 2, - "minItems": 2 - } - } - }, - "value": { - "description": "The paths in the sketch group.", - "type": "array", - "items": { - "description": "A path.", - "oneOf": [ - { - "description": "A path that goes to a point.", - "type": "object", - "required": [ - "__geoMeta", - "from", - "name", - "to", - "type" - ], - "properties": { - "__geoMeta": { - "description": "Metadata.", - "type": "object", - "required": [ - "id", - "sourceRange" - ], - "properties": { - "id": { - "description": "The id of the geometry.", - "type": "string", - "format": "uuid" - }, - "sourceRange": { - "description": "The source range.", - "type": "array", - "items": { - "type": "integer", - "format": "uint", - "minimum": 0.0 - }, - "maxItems": 2, - "minItems": 2 - } - } - }, - "from": { - "description": "The from point.", - "type": "array", - "items": { - "type": "number", - "format": "double" - }, - "maxItems": 2, - "minItems": 2 - }, - "name": { - "description": "The name of the path.", - "type": "string" - }, - "to": { - "description": "The to point.", - "type": "array", - "items": { - "type": "number", - "format": "double" - }, - "maxItems": 2, - "minItems": 2 - }, - "type": { - "type": "string", - "enum": [ - "ToPoint" - ] - } - } - }, - { - "description": "A arc that is tangential to the last path segment that goes to a point", - "type": "object", - "required": [ - "__geoMeta", - "ccw", - "center", - "from", - "name", - "to", - "type" - ], - "properties": { - "__geoMeta": { - "description": "Metadata.", - "type": "object", - "required": [ - "id", - "sourceRange" - ], - "properties": { - "id": { - "description": "The id of the geometry.", - "type": "string", - "format": "uuid" - }, - "sourceRange": { - "description": "The source range.", - "type": "array", - "items": { - "type": "integer", - "format": "uint", - "minimum": 0.0 - }, - "maxItems": 2, - "minItems": 2 - } - } - }, - "ccw": { - "description": "arc's direction", - "type": "boolean" - }, - "center": { - "description": "the arc's center", - "type": "array", - "items": { - "type": "number", - "format": "double" - }, - "maxItems": 2, - "minItems": 2 - }, - "from": { - "description": "The from point.", - "type": "array", - "items": { - "type": "number", - "format": "double" - }, - "maxItems": 2, - "minItems": 2 - }, - "name": { - "description": "The name of the path.", - "type": "string" - }, - "to": { - "description": "The to point.", - "type": "array", - "items": { - "type": "number", - "format": "double" - }, - "maxItems": 2, - "minItems": 2 - }, - "type": { - "type": "string", - "enum": [ - "TangentialArcTo" - ] - } - } - }, - { - "description": "A arc that is tangential to the last path segment", - "type": "object", - "required": [ - "__geoMeta", - "from", - "name", - "to", - "type" - ], - "properties": { - "__geoMeta": { - "description": "Metadata.", - "type": "object", - "required": [ - "id", - "sourceRange" - ], - "properties": { - "id": { - "description": "The id of the geometry.", - "type": "string", - "format": "uuid" - }, - "sourceRange": { - "description": "The source range.", - "type": "array", - "items": { - "type": "integer", - "format": "uint", - "minimum": 0.0 - }, - "maxItems": 2, - "minItems": 2 - } - } - }, - "from": { - "description": "The from point.", - "type": "array", - "items": { - "type": "number", - "format": "double" - }, - "maxItems": 2, - "minItems": 2 - }, - "name": { - "description": "The name of the path.", - "type": "string" - }, - "to": { - "description": "The to point.", - "type": "array", - "items": { - "type": "number", - "format": "double" - }, - "maxItems": 2, - "minItems": 2 - }, - "type": { - "type": "string", - "enum": [ - "TangentialArc" - ] - } - } - }, - { - "description": "A path that is horizontal.", - "type": "object", - "required": [ - "__geoMeta", - "from", - "name", - "to", - "type", - "x" - ], - "properties": { - "__geoMeta": { - "description": "Metadata.", - "type": "object", - "required": [ - "id", - "sourceRange" - ], - "properties": { - "id": { - "description": "The id of the geometry.", - "type": "string", - "format": "uuid" - }, - "sourceRange": { - "description": "The source range.", - "type": "array", - "items": { - "type": "integer", - "format": "uint", - "minimum": 0.0 - }, - "maxItems": 2, - "minItems": 2 - } - } - }, - "from": { - "description": "The from point.", - "type": "array", - "items": { - "type": "number", - "format": "double" - }, - "maxItems": 2, - "minItems": 2 - }, - "name": { - "description": "The name of the path.", - "type": "string" - }, - "to": { - "description": "The to point.", - "type": "array", - "items": { - "type": "number", - "format": "double" - }, - "maxItems": 2, - "minItems": 2 - }, - "type": { - "type": "string", - "enum": [ - "Horizontal" - ] - }, - "x": { - "description": "The x coordinate.", - "type": "number", - "format": "double" - } - } - }, - { - "description": "An angled line to.", - "type": "object", - "required": [ - "__geoMeta", - "from", - "name", - "to", - "type" - ], - "properties": { - "__geoMeta": { - "description": "Metadata.", - "type": "object", - "required": [ - "id", - "sourceRange" - ], - "properties": { - "id": { - "description": "The id of the geometry.", - "type": "string", - "format": "uuid" - }, - "sourceRange": { - "description": "The source range.", - "type": "array", - "items": { - "type": "integer", - "format": "uint", - "minimum": 0.0 - }, - "maxItems": 2, - "minItems": 2 - } - } - }, - "from": { - "description": "The from point.", - "type": "array", - "items": { - "type": "number", - "format": "double" - }, - "maxItems": 2, - "minItems": 2 - }, - "name": { - "description": "The name of the path.", - "type": "string" - }, - "to": { - "description": "The to point.", - "type": "array", - "items": { - "type": "number", - "format": "double" - }, - "maxItems": 2, - "minItems": 2 - }, - "type": { - "type": "string", - "enum": [ - "AngledLineTo" - ] - }, - "x": { - "description": "The x coordinate.", - "type": "number", - "format": "double", - "nullable": true - }, - "y": { - "description": "The y coordinate.", - "type": "number", - "format": "double", - "nullable": true - } - } - }, - { - "description": "A base path.", - "type": "object", - "required": [ - "__geoMeta", - "from", - "name", - "to", - "type" - ], - "properties": { - "__geoMeta": { - "description": "Metadata.", - "type": "object", - "required": [ - "id", - "sourceRange" - ], - "properties": { - "id": { - "description": "The id of the geometry.", - "type": "string", - "format": "uuid" - }, - "sourceRange": { - "description": "The source range.", - "type": "array", - "items": { - "type": "integer", - "format": "uint", - "minimum": 0.0 - }, - "maxItems": 2, - "minItems": 2 - } - } - }, - "from": { - "description": "The from point.", - "type": "array", - "items": { - "type": "number", - "format": "double" - }, - "maxItems": 2, - "minItems": 2 - }, - "name": { - "description": "The name of the path.", - "type": "string" - }, - "to": { - "description": "The to point.", - "type": "array", - "items": { - "type": "number", - "format": "double" - }, - "maxItems": 2, - "minItems": 2 - }, - "type": { - "type": "string", - "enum": [ - "Base" - ] - } - } - } - ] - } - }, - "xAxis": { - "description": "The x-axis of the sketch group base plane in the 3D space", - "type": "object", - "required": [ - "x", - "y", - "z" - ], - "properties": { - "x": { - "type": "number", - "format": "double" - }, - "y": { - "type": "number", - "format": "double" - }, - "z": { - "type": "number", - "format": "double" - } - } - }, - "yAxis": { - "description": "The y-axis of the sketch group base plane in the 3D space", - "type": "object", - "required": [ - "x", - "y", - "z" - ], - "properties": { - "x": { - "type": "number", - "format": "double" - }, - "y": { - "type": "number", - "format": "double" - }, - "z": { - "type": "number", - "format": "double" - } - } - }, - "zAxis": { - "description": "The z-axis of the sketch group base plane in the 3D space", - "type": "object", - "required": [ - "x", - "y", - "z" - ], - "properties": { - "x": { - "type": "number", - "format": "double" - }, - "y": { - "type": "number", - "format": "double" - }, - "z": { - "type": "number", - "format": "double" - } + "maxItems": 2, + "minItems": 2 } } } }, - "required": [ - "type" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "SketchGroups" - ] - } - } - }, - { - "type": [ - "object", - "array" - ], - "items": { - "description": "An extrude group is a collection of extrude surfaces.", - "type": "object", - "required": [ - "__meta", - "height", - "id", - "position", - "rotation", - "sketchGroupValues", - "value", - "xAxis", - "yAxis", - "zAxis" - ], - "properties": { - "__meta": { - "description": "Metadata.", - "type": "array", - "items": { - "description": "Metadata.", - "type": "object", - "required": [ - "sourceRange" - ], - "properties": { - "sourceRange": { - "description": "The source range.", - "type": "array", - "items": { - "type": "integer", - "format": "uint", - "minimum": 0.0 + "entityId": { + "description": "The plane id or face id of the sketch group.", + "type": "string", + "format": "uuid", + "nullable": true + }, + "id": { + "description": "The id of the sketch group.", + "type": "string", + "format": "uuid" + }, + "on": { + "description": "What the sketch is on (can be a plane or a face).", + "oneOf": [ + { + "description": "A plane.", + "type": "object", + "required": [ + "__meta", + "id", + "origin", + "type", + "value", + "xAxis", + "yAxis", + "zAxis" + ], + "properties": { + "__meta": { + "type": "array", + "items": { + "description": "Metadata.", + "type": "object", + "required": [ + "sourceRange" + ], + "properties": { + "sourceRange": { + "description": "The source range.", + "type": "array", + "items": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "maxItems": 2, + "minItems": 2 + } + } + } + }, + "id": { + "description": "The id of the plane.", + "type": "string", + "format": "uuid" + }, + "origin": { + "description": "Origin of the plane.", + "type": "object", + "required": [ + "x", + "y", + "z" + ], + "properties": { + "x": { + "type": "number", + "format": "double" }, - "maxItems": 2, - "minItems": 2 + "y": { + "type": "number", + "format": "double" + }, + "z": { + "type": "number", + "format": "double" + } + } + }, + "type": { + "type": "string", + "enum": [ + "plane" + ] + }, + "value": { + "description": "Type for a plane.", + "oneOf": [ + { + "type": "string", + "enum": [ + "XY", + "XZ", + "YZ" + ] + }, + { + "description": "A custom plane.", + "type": "string", + "enum": [ + "Custom" + ] + } + ] + }, + "xAxis": { + "description": "What should the plane’s X axis be?", + "type": "object", + "required": [ + "x", + "y", + "z" + ], + "properties": { + "x": { + "type": "number", + "format": "double" + }, + "y": { + "type": "number", + "format": "double" + }, + "z": { + "type": "number", + "format": "double" + } + } + }, + "yAxis": { + "description": "What should the plane’s Y axis be?", + "type": "object", + "required": [ + "x", + "y", + "z" + ], + "properties": { + "x": { + "type": "number", + "format": "double" + }, + "y": { + "type": "number", + "format": "double" + }, + "z": { + "type": "number", + "format": "double" + } + } + }, + "zAxis": { + "description": "The z-axis (normal).", + "type": "object", + "required": [ + "x", + "y", + "z" + ], + "properties": { + "x": { + "type": "number", + "format": "double" + }, + "y": { + "type": "number", + "format": "double" + }, + "z": { + "type": "number", + "format": "double" + } } } } }, - "endCapId": { - "description": "The id of the extrusion end cap", - "type": "string", - "format": "uuid", - "nullable": true + { + "description": "A face.", + "type": "object", + "required": [ + "__meta", + "id", + "sketchGroupId", + "type", + "value", + "xAxis", + "yAxis", + "zAxis" + ], + "properties": { + "__meta": { + "type": "array", + "items": { + "description": "Metadata.", + "type": "object", + "required": [ + "sourceRange" + ], + "properties": { + "sourceRange": { + "description": "The source range.", + "type": "array", + "items": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "maxItems": 2, + "minItems": 2 + } + } + } + }, + "id": { + "description": "The id of the face.", + "type": "string", + "format": "uuid" + }, + "sketchGroupId": { + "description": "The original sketch group id of the object we are sketching on.", + "type": "string", + "format": "uuid" + }, + "type": { + "type": "string", + "enum": [ + "face" + ] + }, + "value": { + "description": "The tag of the face.", + "type": "string" + }, + "xAxis": { + "description": "What should the face’s X axis be?", + "type": "object", + "required": [ + "x", + "y", + "z" + ], + "properties": { + "x": { + "type": "number", + "format": "double" + }, + "y": { + "type": "number", + "format": "double" + }, + "z": { + "type": "number", + "format": "double" + } + } + }, + "yAxis": { + "description": "What should the face’s Y axis be?", + "type": "object", + "required": [ + "x", + "y", + "z" + ], + "properties": { + "x": { + "type": "number", + "format": "double" + }, + "y": { + "type": "number", + "format": "double" + }, + "z": { + "type": "number", + "format": "double" + } + } + }, + "zAxis": { + "description": "The z-axis (normal).", + "type": "object", + "required": [ + "x", + "y", + "z" + ], + "properties": { + "x": { + "type": "number", + "format": "double" + }, + "y": { + "type": "number", + "format": "double" + }, + "z": { + "type": "number", + "format": "double" + } + } + } + } + } + ] + }, + "position": { + "description": "The position of the sketch group.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 3, + "minItems": 3 + }, + "rotation": { + "description": "The rotation of the sketch group base plane.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 4, + "minItems": 4 + }, + "start": { + "description": "The starting path.", + "type": "object", + "required": [ + "__geoMeta", + "from", + "name", + "to" + ], + "properties": { + "__geoMeta": { + "description": "Metadata.", + "type": "object", + "required": [ + "id", + "sourceRange" + ], + "properties": { + "id": { + "description": "The id of the geometry.", + "type": "string", + "format": "uuid" + }, + "sourceRange": { + "description": "The source range.", + "type": "array", + "items": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "maxItems": 2, + "minItems": 2 + } + } }, - "height": { - "description": "The height of the extrude group.", + "from": { + "description": "The from point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "name": { + "description": "The name of the path.", + "type": "string" + }, + "to": { + "description": "The to point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + } + } + }, + "value": { + "description": "The paths in the sketch group.", + "type": "array", + "items": { + "description": "A path.", + "oneOf": [ + { + "description": "A path that goes to a point.", + "type": "object", + "required": [ + "__geoMeta", + "from", + "name", + "to", + "type" + ], + "properties": { + "__geoMeta": { + "description": "Metadata.", + "type": "object", + "required": [ + "id", + "sourceRange" + ], + "properties": { + "id": { + "description": "The id of the geometry.", + "type": "string", + "format": "uuid" + }, + "sourceRange": { + "description": "The source range.", + "type": "array", + "items": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "maxItems": 2, + "minItems": 2 + } + } + }, + "from": { + "description": "The from point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "name": { + "description": "The name of the path.", + "type": "string" + }, + "to": { + "description": "The to point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "type": { + "type": "string", + "enum": [ + "ToPoint" + ] + } + } + }, + { + "description": "A arc that is tangential to the last path segment that goes to a point", + "type": "object", + "required": [ + "__geoMeta", + "ccw", + "center", + "from", + "name", + "to", + "type" + ], + "properties": { + "__geoMeta": { + "description": "Metadata.", + "type": "object", + "required": [ + "id", + "sourceRange" + ], + "properties": { + "id": { + "description": "The id of the geometry.", + "type": "string", + "format": "uuid" + }, + "sourceRange": { + "description": "The source range.", + "type": "array", + "items": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "maxItems": 2, + "minItems": 2 + } + } + }, + "ccw": { + "description": "arc's direction", + "type": "boolean" + }, + "center": { + "description": "the arc's center", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "from": { + "description": "The from point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "name": { + "description": "The name of the path.", + "type": "string" + }, + "to": { + "description": "The to point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "type": { + "type": "string", + "enum": [ + "TangentialArcTo" + ] + } + } + }, + { + "description": "A arc that is tangential to the last path segment", + "type": "object", + "required": [ + "__geoMeta", + "from", + "name", + "to", + "type" + ], + "properties": { + "__geoMeta": { + "description": "Metadata.", + "type": "object", + "required": [ + "id", + "sourceRange" + ], + "properties": { + "id": { + "description": "The id of the geometry.", + "type": "string", + "format": "uuid" + }, + "sourceRange": { + "description": "The source range.", + "type": "array", + "items": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "maxItems": 2, + "minItems": 2 + } + } + }, + "from": { + "description": "The from point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "name": { + "description": "The name of the path.", + "type": "string" + }, + "to": { + "description": "The to point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "type": { + "type": "string", + "enum": [ + "TangentialArc" + ] + } + } + }, + { + "description": "A path that is horizontal.", + "type": "object", + "required": [ + "__geoMeta", + "from", + "name", + "to", + "type", + "x" + ], + "properties": { + "__geoMeta": { + "description": "Metadata.", + "type": "object", + "required": [ + "id", + "sourceRange" + ], + "properties": { + "id": { + "description": "The id of the geometry.", + "type": "string", + "format": "uuid" + }, + "sourceRange": { + "description": "The source range.", + "type": "array", + "items": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "maxItems": 2, + "minItems": 2 + } + } + }, + "from": { + "description": "The from point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "name": { + "description": "The name of the path.", + "type": "string" + }, + "to": { + "description": "The to point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "type": { + "type": "string", + "enum": [ + "Horizontal" + ] + }, + "x": { + "description": "The x coordinate.", + "type": "number", + "format": "double" + } + } + }, + { + "description": "An angled line to.", + "type": "object", + "required": [ + "__geoMeta", + "from", + "name", + "to", + "type" + ], + "properties": { + "__geoMeta": { + "description": "Metadata.", + "type": "object", + "required": [ + "id", + "sourceRange" + ], + "properties": { + "id": { + "description": "The id of the geometry.", + "type": "string", + "format": "uuid" + }, + "sourceRange": { + "description": "The source range.", + "type": "array", + "items": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "maxItems": 2, + "minItems": 2 + } + } + }, + "from": { + "description": "The from point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "name": { + "description": "The name of the path.", + "type": "string" + }, + "to": { + "description": "The to point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "type": { + "type": "string", + "enum": [ + "AngledLineTo" + ] + }, + "x": { + "description": "The x coordinate.", + "type": "number", + "format": "double", + "nullable": true + }, + "y": { + "description": "The y coordinate.", + "type": "number", + "format": "double", + "nullable": true + } + } + }, + { + "description": "A base path.", + "type": "object", + "required": [ + "__geoMeta", + "from", + "name", + "to", + "type" + ], + "properties": { + "__geoMeta": { + "description": "Metadata.", + "type": "object", + "required": [ + "id", + "sourceRange" + ], + "properties": { + "id": { + "description": "The id of the geometry.", + "type": "string", + "format": "uuid" + }, + "sourceRange": { + "description": "The source range.", + "type": "array", + "items": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "maxItems": 2, + "minItems": 2 + } + } + }, + "from": { + "description": "The from point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "name": { + "description": "The name of the path.", + "type": "string" + }, + "to": { + "description": "The to point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "type": { + "type": "string", + "enum": [ + "Base" + ] + } + } + } + ] + } + }, + "xAxis": { + "description": "The x-axis of the sketch group base plane in the 3D space", + "type": "object", + "required": [ + "x", + "y", + "z" + ], + "properties": { + "x": { "type": "number", "format": "double" }, - "id": { - "description": "The id of the extrude group.", - "type": "string", - "format": "uuid" + "y": { + "type": "number", + "format": "double" }, - "position": { - "description": "The position of the extrude group.", - "type": "array", - "items": { - "type": "number", - "format": "double" - }, - "maxItems": 3, - "minItems": 3 + "z": { + "type": "number", + "format": "double" + } + } + }, + "yAxis": { + "description": "The y-axis of the sketch group base plane in the 3D space", + "type": "object", + "required": [ + "x", + "y", + "z" + ], + "properties": { + "x": { + "type": "number", + "format": "double" }, - "rotation": { - "description": "The rotation of the extrude group.", - "type": "array", - "items": { - "type": "number", - "format": "double" - }, - "maxItems": 4, - "minItems": 4 + "y": { + "type": "number", + "format": "double" }, - "sketchGroupValues": { - "description": "The sketch group paths.", - "type": "array", - "items": { - "description": "A path.", - "oneOf": [ - { - "description": "A path that goes to a point.", - "type": "object", - "required": [ - "__geoMeta", - "from", - "name", - "to", - "type" - ], - "properties": { - "__geoMeta": { - "description": "Metadata.", - "type": "object", - "required": [ - "id", - "sourceRange" - ], - "properties": { - "id": { - "description": "The id of the geometry.", - "type": "string", - "format": "uuid" - }, - "sourceRange": { - "description": "The source range.", - "type": "array", - "items": { - "type": "integer", - "format": "uint", - "minimum": 0.0 - }, - "maxItems": 2, - "minItems": 2 - } - } - }, - "from": { - "description": "The from point.", - "type": "array", - "items": { - "type": "number", - "format": "double" - }, - "maxItems": 2, - "minItems": 2 - }, - "name": { - "description": "The name of the path.", - "type": "string" - }, - "to": { - "description": "The to point.", - "type": "array", - "items": { - "type": "number", - "format": "double" - }, - "maxItems": 2, - "minItems": 2 - }, - "type": { - "type": "string", - "enum": [ - "ToPoint" - ] - } - } - }, - { - "description": "A arc that is tangential to the last path segment that goes to a point", - "type": "object", - "required": [ - "__geoMeta", - "ccw", - "center", - "from", - "name", - "to", - "type" - ], - "properties": { - "__geoMeta": { - "description": "Metadata.", - "type": "object", - "required": [ - "id", - "sourceRange" - ], - "properties": { - "id": { - "description": "The id of the geometry.", - "type": "string", - "format": "uuid" - }, - "sourceRange": { - "description": "The source range.", - "type": "array", - "items": { - "type": "integer", - "format": "uint", - "minimum": 0.0 - }, - "maxItems": 2, - "minItems": 2 - } - } - }, - "ccw": { - "description": "arc's direction", - "type": "boolean" - }, - "center": { - "description": "the arc's center", - "type": "array", - "items": { - "type": "number", - "format": "double" - }, - "maxItems": 2, - "minItems": 2 - }, - "from": { - "description": "The from point.", - "type": "array", - "items": { - "type": "number", - "format": "double" - }, - "maxItems": 2, - "minItems": 2 - }, - "name": { - "description": "The name of the path.", - "type": "string" - }, - "to": { - "description": "The to point.", - "type": "array", - "items": { - "type": "number", - "format": "double" - }, - "maxItems": 2, - "minItems": 2 - }, - "type": { - "type": "string", - "enum": [ - "TangentialArcTo" - ] - } - } - }, - { - "description": "A arc that is tangential to the last path segment", - "type": "object", - "required": [ - "__geoMeta", - "from", - "name", - "to", - "type" - ], - "properties": { - "__geoMeta": { - "description": "Metadata.", - "type": "object", - "required": [ - "id", - "sourceRange" - ], - "properties": { - "id": { - "description": "The id of the geometry.", - "type": "string", - "format": "uuid" - }, - "sourceRange": { - "description": "The source range.", - "type": "array", - "items": { - "type": "integer", - "format": "uint", - "minimum": 0.0 - }, - "maxItems": 2, - "minItems": 2 - } - } - }, - "from": { - "description": "The from point.", - "type": "array", - "items": { - "type": "number", - "format": "double" - }, - "maxItems": 2, - "minItems": 2 - }, - "name": { - "description": "The name of the path.", - "type": "string" - }, - "to": { - "description": "The to point.", - "type": "array", - "items": { - "type": "number", - "format": "double" - }, - "maxItems": 2, - "minItems": 2 - }, - "type": { - "type": "string", - "enum": [ - "TangentialArc" - ] - } - } - }, - { - "description": "A path that is horizontal.", - "type": "object", - "required": [ - "__geoMeta", - "from", - "name", - "to", - "type", - "x" - ], - "properties": { - "__geoMeta": { - "description": "Metadata.", - "type": "object", - "required": [ - "id", - "sourceRange" - ], - "properties": { - "id": { - "description": "The id of the geometry.", - "type": "string", - "format": "uuid" - }, - "sourceRange": { - "description": "The source range.", - "type": "array", - "items": { - "type": "integer", - "format": "uint", - "minimum": 0.0 - }, - "maxItems": 2, - "minItems": 2 - } - } - }, - "from": { - "description": "The from point.", - "type": "array", - "items": { - "type": "number", - "format": "double" - }, - "maxItems": 2, - "minItems": 2 - }, - "name": { - "description": "The name of the path.", - "type": "string" - }, - "to": { - "description": "The to point.", - "type": "array", - "items": { - "type": "number", - "format": "double" - }, - "maxItems": 2, - "minItems": 2 - }, - "type": { - "type": "string", - "enum": [ - "Horizontal" - ] - }, - "x": { - "description": "The x coordinate.", - "type": "number", - "format": "double" - } - } - }, - { - "description": "An angled line to.", - "type": "object", - "required": [ - "__geoMeta", - "from", - "name", - "to", - "type" - ], - "properties": { - "__geoMeta": { - "description": "Metadata.", - "type": "object", - "required": [ - "id", - "sourceRange" - ], - "properties": { - "id": { - "description": "The id of the geometry.", - "type": "string", - "format": "uuid" - }, - "sourceRange": { - "description": "The source range.", - "type": "array", - "items": { - "type": "integer", - "format": "uint", - "minimum": 0.0 - }, - "maxItems": 2, - "minItems": 2 - } - } - }, - "from": { - "description": "The from point.", - "type": "array", - "items": { - "type": "number", - "format": "double" - }, - "maxItems": 2, - "minItems": 2 - }, - "name": { - "description": "The name of the path.", - "type": "string" - }, - "to": { - "description": "The to point.", - "type": "array", - "items": { - "type": "number", - "format": "double" - }, - "maxItems": 2, - "minItems": 2 - }, - "type": { - "type": "string", - "enum": [ - "AngledLineTo" - ] - }, - "x": { - "description": "The x coordinate.", - "type": "number", - "format": "double", - "nullable": true - }, - "y": { - "description": "The y coordinate.", - "type": "number", - "format": "double", - "nullable": true - } - } - }, - { - "description": "A base path.", - "type": "object", - "required": [ - "__geoMeta", - "from", - "name", - "to", - "type" - ], - "properties": { - "__geoMeta": { - "description": "Metadata.", - "type": "object", - "required": [ - "id", - "sourceRange" - ], - "properties": { - "id": { - "description": "The id of the geometry.", - "type": "string", - "format": "uuid" - }, - "sourceRange": { - "description": "The source range.", - "type": "array", - "items": { - "type": "integer", - "format": "uint", - "minimum": 0.0 - }, - "maxItems": 2, - "minItems": 2 - } - } - }, - "from": { - "description": "The from point.", - "type": "array", - "items": { - "type": "number", - "format": "double" - }, - "maxItems": 2, - "minItems": 2 - }, - "name": { - "description": "The name of the path.", - "type": "string" - }, - "to": { - "description": "The to point.", - "type": "array", - "items": { - "type": "number", - "format": "double" - }, - "maxItems": 2, - "minItems": 2 - }, - "type": { - "type": "string", - "enum": [ - "Base" - ] - } - } - } - ] - } + "z": { + "type": "number", + "format": "double" + } + } + }, + "zAxis": { + "description": "The z-axis of the sketch group base plane in the 3D space", + "type": "object", + "required": [ + "x", + "y", + "z" + ], + "properties": { + "x": { + "type": "number", + "format": "double" }, - "startCapId": { - "description": "The id of the extrusion start cap", - "type": "string", - "format": "uuid", - "nullable": true + "y": { + "type": "number", + "format": "double" }, - "value": { - "description": "The extrude surfaces.", - "type": "array", - "items": { - "description": "An extrude surface.", - "oneOf": [ - { - "description": "An extrude plane.", - "type": "object", - "required": [ - "faceId", - "id", - "name", - "position", - "rotation", - "sourceRange", - "type" - ], - "properties": { - "faceId": { - "description": "The face id for the extrude plane.", - "type": "string", - "format": "uuid" - }, - "id": { - "description": "The id of the geometry.", - "type": "string", - "format": "uuid" - }, - "name": { - "description": "The name.", - "type": "string" - }, - "position": { - "description": "The position.", - "type": "array", - "items": { - "type": "number", - "format": "double" - }, - "maxItems": 3, - "minItems": 3 - }, - "rotation": { - "description": "The rotation.", - "type": "array", - "items": { - "type": "number", - "format": "double" - }, - "maxItems": 4, - "minItems": 4 - }, - "sourceRange": { - "description": "The source range.", - "type": "array", - "items": { - "type": "integer", - "format": "uint", - "minimum": 0.0 - }, - "maxItems": 2, - "minItems": 2 - }, - "type": { - "type": "string", - "enum": [ - "extrudePlane" - ] - } - } - }, - { - "description": "An extruded arc.", - "type": "object", - "required": [ - "faceId", - "id", - "name", - "position", - "rotation", - "sourceRange", - "type" - ], - "properties": { - "faceId": { - "description": "The face id for the extrude plane.", - "type": "string", - "format": "uuid" - }, - "id": { - "description": "The id of the geometry.", - "type": "string", - "format": "uuid" - }, - "name": { - "description": "The name.", - "type": "string" - }, - "position": { - "description": "The position.", - "type": "array", - "items": { - "type": "number", - "format": "double" - }, - "maxItems": 3, - "minItems": 3 - }, - "rotation": { - "description": "The rotation.", - "type": "array", - "items": { - "type": "number", - "format": "double" - }, - "maxItems": 4, - "minItems": 4 - }, - "sourceRange": { - "description": "The source range.", - "type": "array", - "items": { - "type": "integer", - "format": "uint", - "minimum": 0.0 - }, - "maxItems": 2, - "minItems": 2 - }, - "type": { - "type": "string", - "enum": [ - "extrudeArc" - ] - } - } - } - ] - } - }, - "xAxis": { - "description": "The x-axis of the extrude group base plane in the 3D space", - "type": "object", - "required": [ - "x", - "y", - "z" - ], - "properties": { - "x": { - "type": "number", - "format": "double" + "z": { + "type": "number", + "format": "double" + } + } + } + } + } + }, + "required": true + }, + "unpublished": false, + "deprecated": false + }, + { + "name": "patternLinear3d", + "summary": "A linear pattern on a 3D model.", + "description": "", + "tags": [], + "args": [ + { + "name": "data", + "type": "LinearPattern3dData", + "schema": { + "description": "Data for a linear pattern on a 3D model.", + "type": "object", + "required": [ + "axis", + "distance", + "repetitions" + ], + "properties": { + "axis": { + "description": "The axis of the pattern.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 3, + "minItems": 3 + }, + "distance": { + "description": "The distance between each repetition. This can also be referred to as spacing.", + "type": "number", + "format": "double" + }, + "repetitions": { + "description": "The number of repetitions. Must be greater than 0. This excludes the original entity. For example, if `repetitions` is 1, the original entity will be copied once.", + "type": "integer", + "format": "uint32", + "minimum": 0.0 + } + } + }, + "required": true + }, + { + "name": "extrude_group", + "type": "ExtrudeGroup", + "schema": { + "description": "An extrude group is a collection of extrude surfaces.", + "type": "object", + "required": [ + "__meta", + "height", + "id", + "position", + "rotation", + "sketchGroupValues", + "value", + "xAxis", + "yAxis", + "zAxis" + ], + "properties": { + "__meta": { + "description": "Metadata.", + "type": "array", + "items": { + "description": "Metadata.", + "type": "object", + "required": [ + "sourceRange" + ], + "properties": { + "sourceRange": { + "description": "The source range.", + "type": "array", + "items": { + "type": "integer", + "format": "uint", + "minimum": 0.0 }, - "y": { - "type": "number", - "format": "double" - }, - "z": { - "type": "number", - "format": "double" - } - } - }, - "yAxis": { - "description": "The y-axis of the extrude group base plane in the 3D space", - "type": "object", - "required": [ - "x", - "y", - "z" - ], - "properties": { - "x": { - "type": "number", - "format": "double" - }, - "y": { - "type": "number", - "format": "double" - }, - "z": { - "type": "number", - "format": "double" - } - } - }, - "zAxis": { - "description": "The z-axis of the extrude group base plane in the 3D space", - "type": "object", - "required": [ - "x", - "y", - "z" - ], - "properties": { - "x": { - "type": "number", - "format": "double" - }, - "y": { - "type": "number", - "format": "double" - }, - "z": { - "type": "number", - "format": "double" - } + "maxItems": 2, + "minItems": 2 } } } }, - "required": [ - "type" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "ExtrudeGroups" + "endCapId": { + "description": "The id of the extrusion end cap", + "type": "string", + "format": "uuid", + "nullable": true + }, + "height": { + "description": "The height of the extrude group.", + "type": "number", + "format": "double" + }, + "id": { + "description": "The id of the extrude group.", + "type": "string", + "format": "uuid" + }, + "position": { + "description": "The position of the extrude group.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 3, + "minItems": 3 + }, + "rotation": { + "description": "The rotation of the extrude group.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 4, + "minItems": 4 + }, + "sketchGroupValues": { + "description": "The sketch group paths.", + "type": "array", + "items": { + "description": "A path.", + "oneOf": [ + { + "description": "A path that goes to a point.", + "type": "object", + "required": [ + "__geoMeta", + "from", + "name", + "to", + "type" + ], + "properties": { + "__geoMeta": { + "description": "Metadata.", + "type": "object", + "required": [ + "id", + "sourceRange" + ], + "properties": { + "id": { + "description": "The id of the geometry.", + "type": "string", + "format": "uuid" + }, + "sourceRange": { + "description": "The source range.", + "type": "array", + "items": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "maxItems": 2, + "minItems": 2 + } + } + }, + "from": { + "description": "The from point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "name": { + "description": "The name of the path.", + "type": "string" + }, + "to": { + "description": "The to point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "type": { + "type": "string", + "enum": [ + "ToPoint" + ] + } + } + }, + { + "description": "A arc that is tangential to the last path segment that goes to a point", + "type": "object", + "required": [ + "__geoMeta", + "ccw", + "center", + "from", + "name", + "to", + "type" + ], + "properties": { + "__geoMeta": { + "description": "Metadata.", + "type": "object", + "required": [ + "id", + "sourceRange" + ], + "properties": { + "id": { + "description": "The id of the geometry.", + "type": "string", + "format": "uuid" + }, + "sourceRange": { + "description": "The source range.", + "type": "array", + "items": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "maxItems": 2, + "minItems": 2 + } + } + }, + "ccw": { + "description": "arc's direction", + "type": "boolean" + }, + "center": { + "description": "the arc's center", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "from": { + "description": "The from point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "name": { + "description": "The name of the path.", + "type": "string" + }, + "to": { + "description": "The to point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "type": { + "type": "string", + "enum": [ + "TangentialArcTo" + ] + } + } + }, + { + "description": "A arc that is tangential to the last path segment", + "type": "object", + "required": [ + "__geoMeta", + "from", + "name", + "to", + "type" + ], + "properties": { + "__geoMeta": { + "description": "Metadata.", + "type": "object", + "required": [ + "id", + "sourceRange" + ], + "properties": { + "id": { + "description": "The id of the geometry.", + "type": "string", + "format": "uuid" + }, + "sourceRange": { + "description": "The source range.", + "type": "array", + "items": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "maxItems": 2, + "minItems": 2 + } + } + }, + "from": { + "description": "The from point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "name": { + "description": "The name of the path.", + "type": "string" + }, + "to": { + "description": "The to point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "type": { + "type": "string", + "enum": [ + "TangentialArc" + ] + } + } + }, + { + "description": "A path that is horizontal.", + "type": "object", + "required": [ + "__geoMeta", + "from", + "name", + "to", + "type", + "x" + ], + "properties": { + "__geoMeta": { + "description": "Metadata.", + "type": "object", + "required": [ + "id", + "sourceRange" + ], + "properties": { + "id": { + "description": "The id of the geometry.", + "type": "string", + "format": "uuid" + }, + "sourceRange": { + "description": "The source range.", + "type": "array", + "items": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "maxItems": 2, + "minItems": 2 + } + } + }, + "from": { + "description": "The from point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "name": { + "description": "The name of the path.", + "type": "string" + }, + "to": { + "description": "The to point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "type": { + "type": "string", + "enum": [ + "Horizontal" + ] + }, + "x": { + "description": "The x coordinate.", + "type": "number", + "format": "double" + } + } + }, + { + "description": "An angled line to.", + "type": "object", + "required": [ + "__geoMeta", + "from", + "name", + "to", + "type" + ], + "properties": { + "__geoMeta": { + "description": "Metadata.", + "type": "object", + "required": [ + "id", + "sourceRange" + ], + "properties": { + "id": { + "description": "The id of the geometry.", + "type": "string", + "format": "uuid" + }, + "sourceRange": { + "description": "The source range.", + "type": "array", + "items": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "maxItems": 2, + "minItems": 2 + } + } + }, + "from": { + "description": "The from point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "name": { + "description": "The name of the path.", + "type": "string" + }, + "to": { + "description": "The to point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "type": { + "type": "string", + "enum": [ + "AngledLineTo" + ] + }, + "x": { + "description": "The x coordinate.", + "type": "number", + "format": "double", + "nullable": true + }, + "y": { + "description": "The y coordinate.", + "type": "number", + "format": "double", + "nullable": true + } + } + }, + { + "description": "A base path.", + "type": "object", + "required": [ + "__geoMeta", + "from", + "name", + "to", + "type" + ], + "properties": { + "__geoMeta": { + "description": "Metadata.", + "type": "object", + "required": [ + "id", + "sourceRange" + ], + "properties": { + "id": { + "description": "The id of the geometry.", + "type": "string", + "format": "uuid" + }, + "sourceRange": { + "description": "The source range.", + "type": "array", + "items": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "maxItems": 2, + "minItems": 2 + } + } + }, + "from": { + "description": "The from point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "name": { + "description": "The name of the path.", + "type": "string" + }, + "to": { + "description": "The to point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "type": { + "type": "string", + "enum": [ + "Base" + ] + } + } + } ] } + }, + "startCapId": { + "description": "The id of the extrusion start cap", + "type": "string", + "format": "uuid", + "nullable": true + }, + "value": { + "description": "The extrude surfaces.", + "type": "array", + "items": { + "description": "An extrude surface.", + "oneOf": [ + { + "description": "An extrude plane.", + "type": "object", + "required": [ + "faceId", + "id", + "name", + "position", + "rotation", + "sourceRange", + "type" + ], + "properties": { + "faceId": { + "description": "The face id for the extrude plane.", + "type": "string", + "format": "uuid" + }, + "id": { + "description": "The id of the geometry.", + "type": "string", + "format": "uuid" + }, + "name": { + "description": "The name.", + "type": "string" + }, + "position": { + "description": "The position.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 3, + "minItems": 3 + }, + "rotation": { + "description": "The rotation.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 4, + "minItems": 4 + }, + "sourceRange": { + "description": "The source range.", + "type": "array", + "items": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "maxItems": 2, + "minItems": 2 + }, + "type": { + "type": "string", + "enum": [ + "extrudePlane" + ] + } + } + }, + { + "description": "An extruded arc.", + "type": "object", + "required": [ + "faceId", + "id", + "name", + "position", + "rotation", + "sourceRange", + "type" + ], + "properties": { + "faceId": { + "description": "The face id for the extrude plane.", + "type": "string", + "format": "uuid" + }, + "id": { + "description": "The id of the geometry.", + "type": "string", + "format": "uuid" + }, + "name": { + "description": "The name.", + "type": "string" + }, + "position": { + "description": "The position.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 3, + "minItems": 3 + }, + "rotation": { + "description": "The rotation.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 4, + "minItems": 4 + }, + "sourceRange": { + "description": "The source range.", + "type": "array", + "items": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "maxItems": 2, + "minItems": 2 + }, + "type": { + "type": "string", + "enum": [ + "extrudeArc" + ] + } + } + } + ] + } + }, + "xAxis": { + "description": "The x-axis of the extrude group base plane in the 3D space", + "type": "object", + "required": [ + "x", + "y", + "z" + ], + "properties": { + "x": { + "type": "number", + "format": "double" + }, + "y": { + "type": "number", + "format": "double" + }, + "z": { + "type": "number", + "format": "double" + } + } + }, + "yAxis": { + "description": "The y-axis of the extrude group base plane in the 3D space", + "type": "object", + "required": [ + "x", + "y", + "z" + ], + "properties": { + "x": { + "type": "number", + "format": "double" + }, + "y": { + "type": "number", + "format": "double" + }, + "z": { + "type": "number", + "format": "double" + } + } + }, + "zAxis": { + "description": "The z-axis of the extrude group base plane in the 3D space", + "type": "object", + "required": [ + "x", + "y", + "z" + ], + "properties": { + "x": { + "type": "number", + "format": "double" + }, + "y": { + "type": "number", + "format": "double" + }, + "z": { + "type": "number", + "format": "double" + } + } } } - ] + }, + "required": true + } + ], + "returnValue": { + "name": "", + "type": "[ExtrudeGroup]", + "schema": { + "type": "array", + "items": { + "description": "An extrude group is a collection of extrude surfaces.", + "type": "object", + "required": [ + "__meta", + "height", + "id", + "position", + "rotation", + "sketchGroupValues", + "value", + "xAxis", + "yAxis", + "zAxis" + ], + "properties": { + "__meta": { + "description": "Metadata.", + "type": "array", + "items": { + "description": "Metadata.", + "type": "object", + "required": [ + "sourceRange" + ], + "properties": { + "sourceRange": { + "description": "The source range.", + "type": "array", + "items": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "maxItems": 2, + "minItems": 2 + } + } + } + }, + "endCapId": { + "description": "The id of the extrusion end cap", + "type": "string", + "format": "uuid", + "nullable": true + }, + "height": { + "description": "The height of the extrude group.", + "type": "number", + "format": "double" + }, + "id": { + "description": "The id of the extrude group.", + "type": "string", + "format": "uuid" + }, + "position": { + "description": "The position of the extrude group.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 3, + "minItems": 3 + }, + "rotation": { + "description": "The rotation of the extrude group.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 4, + "minItems": 4 + }, + "sketchGroupValues": { + "description": "The sketch group paths.", + "type": "array", + "items": { + "description": "A path.", + "oneOf": [ + { + "description": "A path that goes to a point.", + "type": "object", + "required": [ + "__geoMeta", + "from", + "name", + "to", + "type" + ], + "properties": { + "__geoMeta": { + "description": "Metadata.", + "type": "object", + "required": [ + "id", + "sourceRange" + ], + "properties": { + "id": { + "description": "The id of the geometry.", + "type": "string", + "format": "uuid" + }, + "sourceRange": { + "description": "The source range.", + "type": "array", + "items": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "maxItems": 2, + "minItems": 2 + } + } + }, + "from": { + "description": "The from point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "name": { + "description": "The name of the path.", + "type": "string" + }, + "to": { + "description": "The to point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "type": { + "type": "string", + "enum": [ + "ToPoint" + ] + } + } + }, + { + "description": "A arc that is tangential to the last path segment that goes to a point", + "type": "object", + "required": [ + "__geoMeta", + "ccw", + "center", + "from", + "name", + "to", + "type" + ], + "properties": { + "__geoMeta": { + "description": "Metadata.", + "type": "object", + "required": [ + "id", + "sourceRange" + ], + "properties": { + "id": { + "description": "The id of the geometry.", + "type": "string", + "format": "uuid" + }, + "sourceRange": { + "description": "The source range.", + "type": "array", + "items": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "maxItems": 2, + "minItems": 2 + } + } + }, + "ccw": { + "description": "arc's direction", + "type": "boolean" + }, + "center": { + "description": "the arc's center", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "from": { + "description": "The from point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "name": { + "description": "The name of the path.", + "type": "string" + }, + "to": { + "description": "The to point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "type": { + "type": "string", + "enum": [ + "TangentialArcTo" + ] + } + } + }, + { + "description": "A arc that is tangential to the last path segment", + "type": "object", + "required": [ + "__geoMeta", + "from", + "name", + "to", + "type" + ], + "properties": { + "__geoMeta": { + "description": "Metadata.", + "type": "object", + "required": [ + "id", + "sourceRange" + ], + "properties": { + "id": { + "description": "The id of the geometry.", + "type": "string", + "format": "uuid" + }, + "sourceRange": { + "description": "The source range.", + "type": "array", + "items": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "maxItems": 2, + "minItems": 2 + } + } + }, + "from": { + "description": "The from point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "name": { + "description": "The name of the path.", + "type": "string" + }, + "to": { + "description": "The to point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "type": { + "type": "string", + "enum": [ + "TangentialArc" + ] + } + } + }, + { + "description": "A path that is horizontal.", + "type": "object", + "required": [ + "__geoMeta", + "from", + "name", + "to", + "type", + "x" + ], + "properties": { + "__geoMeta": { + "description": "Metadata.", + "type": "object", + "required": [ + "id", + "sourceRange" + ], + "properties": { + "id": { + "description": "The id of the geometry.", + "type": "string", + "format": "uuid" + }, + "sourceRange": { + "description": "The source range.", + "type": "array", + "items": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "maxItems": 2, + "minItems": 2 + } + } + }, + "from": { + "description": "The from point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "name": { + "description": "The name of the path.", + "type": "string" + }, + "to": { + "description": "The to point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "type": { + "type": "string", + "enum": [ + "Horizontal" + ] + }, + "x": { + "description": "The x coordinate.", + "type": "number", + "format": "double" + } + } + }, + { + "description": "An angled line to.", + "type": "object", + "required": [ + "__geoMeta", + "from", + "name", + "to", + "type" + ], + "properties": { + "__geoMeta": { + "description": "Metadata.", + "type": "object", + "required": [ + "id", + "sourceRange" + ], + "properties": { + "id": { + "description": "The id of the geometry.", + "type": "string", + "format": "uuid" + }, + "sourceRange": { + "description": "The source range.", + "type": "array", + "items": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "maxItems": 2, + "minItems": 2 + } + } + }, + "from": { + "description": "The from point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "name": { + "description": "The name of the path.", + "type": "string" + }, + "to": { + "description": "The to point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "type": { + "type": "string", + "enum": [ + "AngledLineTo" + ] + }, + "x": { + "description": "The x coordinate.", + "type": "number", + "format": "double", + "nullable": true + }, + "y": { + "description": "The y coordinate.", + "type": "number", + "format": "double", + "nullable": true + } + } + }, + { + "description": "A base path.", + "type": "object", + "required": [ + "__geoMeta", + "from", + "name", + "to", + "type" + ], + "properties": { + "__geoMeta": { + "description": "Metadata.", + "type": "object", + "required": [ + "id", + "sourceRange" + ], + "properties": { + "id": { + "description": "The id of the geometry.", + "type": "string", + "format": "uuid" + }, + "sourceRange": { + "description": "The source range.", + "type": "array", + "items": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "maxItems": 2, + "minItems": 2 + } + } + }, + "from": { + "description": "The from point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "name": { + "description": "The name of the path.", + "type": "string" + }, + "to": { + "description": "The to point.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 + }, + "type": { + "type": "string", + "enum": [ + "Base" + ] + } + } + } + ] + } + }, + "startCapId": { + "description": "The id of the extrusion start cap", + "type": "string", + "format": "uuid", + "nullable": true + }, + "value": { + "description": "The extrude surfaces.", + "type": "array", + "items": { + "description": "An extrude surface.", + "oneOf": [ + { + "description": "An extrude plane.", + "type": "object", + "required": [ + "faceId", + "id", + "name", + "position", + "rotation", + "sourceRange", + "type" + ], + "properties": { + "faceId": { + "description": "The face id for the extrude plane.", + "type": "string", + "format": "uuid" + }, + "id": { + "description": "The id of the geometry.", + "type": "string", + "format": "uuid" + }, + "name": { + "description": "The name.", + "type": "string" + }, + "position": { + "description": "The position.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 3, + "minItems": 3 + }, + "rotation": { + "description": "The rotation.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 4, + "minItems": 4 + }, + "sourceRange": { + "description": "The source range.", + "type": "array", + "items": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "maxItems": 2, + "minItems": 2 + }, + "type": { + "type": "string", + "enum": [ + "extrudePlane" + ] + } + } + }, + { + "description": "An extruded arc.", + "type": "object", + "required": [ + "faceId", + "id", + "name", + "position", + "rotation", + "sourceRange", + "type" + ], + "properties": { + "faceId": { + "description": "The face id for the extrude plane.", + "type": "string", + "format": "uuid" + }, + "id": { + "description": "The id of the geometry.", + "type": "string", + "format": "uuid" + }, + "name": { + "description": "The name.", + "type": "string" + }, + "position": { + "description": "The position.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 3, + "minItems": 3 + }, + "rotation": { + "description": "The rotation.", + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 4, + "minItems": 4 + }, + "sourceRange": { + "description": "The source range.", + "type": "array", + "items": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "maxItems": 2, + "minItems": 2 + }, + "type": { + "type": "string", + "enum": [ + "extrudeArc" + ] + } + } + } + ] + } + }, + "xAxis": { + "description": "The x-axis of the extrude group base plane in the 3D space", + "type": "object", + "required": [ + "x", + "y", + "z" + ], + "properties": { + "x": { + "type": "number", + "format": "double" + }, + "y": { + "type": "number", + "format": "double" + }, + "z": { + "type": "number", + "format": "double" + } + } + }, + "yAxis": { + "description": "The y-axis of the extrude group base plane in the 3D space", + "type": "object", + "required": [ + "x", + "y", + "z" + ], + "properties": { + "x": { + "type": "number", + "format": "double" + }, + "y": { + "type": "number", + "format": "double" + }, + "z": { + "type": "number", + "format": "double" + } + } + }, + "zAxis": { + "description": "The z-axis of the extrude group base plane in the 3D space", + "type": "object", + "required": [ + "x", + "y", + "z" + ], + "properties": { + "x": { + "type": "number", + "format": "double" + }, + "y": { + "type": "number", + "format": "double" + }, + "z": { + "type": "number", + "format": "double" + } + } + } + } + } }, "required": true }, diff --git a/docs/kcl/std.md b/docs/kcl/std.md index 2e40789f0..548a04a83 100644 --- a/docs/kcl/std.md +++ b/docs/kcl/std.md @@ -46,8 +46,10 @@ * [`log2`](#log2) * [`max`](#max) * [`min`](#min) - * [`patternCircular`](#patternCircular) - * [`patternLinear`](#patternLinear) + * [`patternCircular2d`](#patternCircular2d) + * [`patternCircular3d`](#patternCircular3d) + * [`patternLinear2d`](#patternLinear2d) + * [`patternLinear3d`](#patternLinear3d) * [`pi`](#pi) * [`pow`](#pow) * [`segAng`](#segAng) @@ -7170,34 +7172,32 @@ min(args: [number]) -> number -### patternCircular +### patternCircular2d -A Circular pattern. +A circular pattern on a 2D sketch. ``` -patternCircular(data: CircularPatternData, geometry: Geometry) -> Geometries +patternCircular2d(data: CircularPattern2dData, sketch_group: SketchGroup) -> [SketchGroup] ``` #### Arguments -* `data`: `CircularPatternData` - Data for a circular pattern. (REQUIRED) +* `data`: `CircularPattern2dData` - Data for a circular pattern on a 2D sketch. (REQUIRED) ``` { // The arc angle (in degrees) to place the repetitions. Must be greater than 0. arcDegrees: number, - // The axis around which to make the pattern. This is a 2D vector. - axis: [number, number], - // The center about which to make th pattern. This is a 3D vector. - center: [number, number, number], + // The center about which to make th pattern. This is a 2D vector. + center: [number, number], // The number of repetitions. Must be greater than 0. This excludes the original entity. For example, if `repetitions` is 1, the original entity will be copied once. repetitions: number, // Whether or not to rotate the duplicates as they are copied. rotateDuplicates: string, } ``` -* `geometry`: `Geometry` - A geometry. (REQUIRED) +* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED) ``` { // The plane id or face id of the sketch group. @@ -7276,7 +7276,6 @@ patternCircular(data: CircularPatternData, geometry: Geometry) -> Geometries // The to point. to: [number, number], }, - type: "SketchGroup", // The paths in the sketch group. value: [{ // The from point. @@ -7360,7 +7359,44 @@ patternCircular(data: CircularPatternData, geometry: Geometry) -> Geometries y: number, z: number, }, -} | +} +``` + +#### Returns + +* `[SketchGroup]` + + + +### patternCircular3d + +A circular pattern on a 3D model. + + + +``` +patternCircular3d(data: CircularPattern3dData, extrude_group: ExtrudeGroup) -> [ExtrudeGroup] +``` + +#### Arguments + +* `data`: `CircularPattern3dData` - Data for a circular pattern on a 3D model. (REQUIRED) +``` +{ + // The arc angle (in degrees) to place the repetitions. Must be greater than 0. + arcDegrees: number, + // The axis around which to make the pattern. This is a 3D vector. + axis: [number, number, number], + // The center about which to make th pattern. This is a 3D vector. + center: [number, number, number], + // The number of repetitions. Must be greater than 0. This excludes the original entity. For example, if `repetitions` is 1, the original entity will be copied once. + repetitions: number, + // Whether or not to rotate the duplicates as they are copied. + rotateDuplicates: string, +} +``` +* `extrude_group`: `ExtrudeGroup` - An extrude group is a collection of extrude surfaces. (REQUIRED) +``` { // The id of the extrusion end cap endCapId: uuid, @@ -7439,7 +7475,6 @@ patternCircular(data: CircularPatternData, geometry: Geometry) -> Geometries }], // The id of the extrusion start cap startCapId: uuid, - type: "ExtrudeGroup", // The extrude surfaces. value: [{ // The face id for the extrude plane. @@ -7494,31 +7529,23 @@ patternCircular(data: CircularPatternData, geometry: Geometry) -> Geometries #### Returns -* `Geometries` - A set of geometry. -``` -{ - type: "SketchGroups", -} | -{ - type: "ExtrudeGroups", -} -``` +* `[ExtrudeGroup]` -### patternLinear +### patternLinear2d -A linear pattern. +A linear pattern on a 2D sketch. ``` -patternLinear(data: LinearPatternData, geometry: Geometry) -> Geometries +patternLinear2d(data: LinearPattern2dData, sketch_group: SketchGroup) -> [SketchGroup] ``` #### Arguments -* `data`: `LinearPatternData` - Data for a linear pattern. (REQUIRED) +* `data`: `LinearPattern2dData` - Data for a linear pattern on a 2D sketch. (REQUIRED) ``` { // The axis of the pattern. This is a 2D vector. @@ -7529,7 +7556,7 @@ patternLinear(data: LinearPatternData, geometry: Geometry) -> Geometries repetitions: number, } ``` -* `geometry`: `Geometry` - A geometry. (REQUIRED) +* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED) ``` { // The plane id or face id of the sketch group. @@ -7608,7 +7635,6 @@ patternLinear(data: LinearPatternData, geometry: Geometry) -> Geometries // The to point. to: [number, number], }, - type: "SketchGroup", // The paths in the sketch group. value: [{ // The from point. @@ -7692,7 +7718,40 @@ patternLinear(data: LinearPatternData, geometry: Geometry) -> Geometries y: number, z: number, }, -} | +} +``` + +#### Returns + +* `[SketchGroup]` + + + +### patternLinear3d + +A linear pattern on a 3D model. + + + +``` +patternLinear3d(data: LinearPattern3dData, extrude_group: ExtrudeGroup) -> [ExtrudeGroup] +``` + +#### Arguments + +* `data`: `LinearPattern3dData` - Data for a linear pattern on a 3D model. (REQUIRED) +``` +{ + // The axis of the pattern. + axis: [number, number, number], + // The distance between each repetition. This can also be referred to as spacing. + distance: number, + // The number of repetitions. Must be greater than 0. This excludes the original entity. For example, if `repetitions` is 1, the original entity will be copied once. + repetitions: number, +} +``` +* `extrude_group`: `ExtrudeGroup` - An extrude group is a collection of extrude surfaces. (REQUIRED) +``` { // The id of the extrusion end cap endCapId: uuid, @@ -7771,7 +7830,6 @@ patternLinear(data: LinearPatternData, geometry: Geometry) -> Geometries }], // The id of the extrusion start cap startCapId: uuid, - type: "ExtrudeGroup", // The extrude surfaces. value: [{ // The face id for the extrude plane. @@ -7826,15 +7884,7 @@ patternLinear(data: LinearPatternData, geometry: Geometry) -> Geometries #### Returns -* `Geometries` - A set of geometry. -``` -{ - type: "SketchGroups", -} | -{ - type: "ExtrudeGroups", -} -``` +* `[ExtrudeGroup]` diff --git a/src/wasm-lib/Cargo.lock b/src/wasm-lib/Cargo.lock index b0d580602..c0ffc8a55 100644 --- a/src/wasm-lib/Cargo.lock +++ b/src/wasm-lib/Cargo.lock @@ -947,7 +947,7 @@ dependencies = [ [[package]] name = "derive-docs" -version = "0.1.9" +version = "0.1.10" dependencies = [ "convert_case", "expectorate", @@ -962,22 +962,6 @@ dependencies = [ "syn 2.0.52", ] -[[package]] -name = "derive-docs" -version = "0.1.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b81bc4c6288273218d0bb4f2ee7cda229264f2e8381e53aae250c840946171f9" -dependencies = [ - "convert_case", - "once_cell", - "proc-macro2", - "quote", - "regex", - "serde", - "serde_tokenstream", - "syn 2.0.52", -] - [[package]] name = "diesel_derives" version = "2.1.2" @@ -1918,7 +1902,7 @@ dependencies = [ "criterion", "dashmap", "databake", - "derive-docs 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", + "derive-docs", "expectorate", "futures", "gltf-json", diff --git a/src/wasm-lib/derive-docs/Cargo.toml b/src/wasm-lib/derive-docs/Cargo.toml index 6700e914a..af12ada2a 100644 --- a/src/wasm-lib/derive-docs/Cargo.toml +++ b/src/wasm-lib/derive-docs/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "derive-docs" description = "A tool for generating documentation from Rust derive macros" -version = "0.1.9" +version = "0.1.10" edition = "2021" license = "MIT" repository = "https://github.com/KittyCAD/modeling-app" diff --git a/src/wasm-lib/derive-docs/src/lib.rs b/src/wasm-lib/derive-docs/src/lib.rs index f247a7a54..554b44830 100644 --- a/src/wasm-lib/derive-docs/src/lib.rs +++ b/src/wasm-lib/derive-docs/src/lib.rs @@ -223,31 +223,59 @@ fn do_stdlib_inner( } } - let ret_ty = ast.sig.output.clone(); - let ret_ty_string = ret_ty - .into_token_stream() - .to_string() - .replace("-> ", "") - .replace("Result < ", "") - .replace(", KclError >", ""); - let return_type = if !ret_ty_string.is_empty() { - let ret_ty_string = if ret_ty_string.starts_with("Box <") { - ret_ty_string - .trim_start_matches("Box <") - .trim_end_matches(' ') - .trim_end_matches('>') - .trim() - .to_string() - } else { - ret_ty_string.trim().to_string() - }; - let ret_ty_ident = format_ident!("{}", ret_ty_string); + let return_type_inner = match &ast.sig.output { + syn::ReturnType::Default => quote! { () }, + syn::ReturnType::Type(_, ty) => { + // Get the inside of the result. + match &**ty { + syn::Type::Path(syn::TypePath { path, .. }) => { + let path = &path.segments; + if path.len() == 1 { + let seg = &path[0]; + if seg.ident == "Result" { + if let syn::PathArguments::AngleBracketed(syn::AngleBracketedGenericArguments { + args, + .. + }) = &seg.arguments + { + if args.len() == 2 || args.len() == 1 { + let mut args = args.iter(); + let ok = args.next().unwrap(); + if let syn::GenericArgument::Type(ty) = ok { + let ty = unbox(unbox_vec(ty.clone())); + quote! { #ty } + } else { + quote! { () } + } + } else { + quote! { () } + } + } else { + quote! { () } + } + } else { + let ty = unbox(unbox_vec(*ty.clone())); + quote! { #ty } + } + } else { + quote! { () } + } + } + _ => { + quote! { () } + } + } + } + }; + + let ret_ty_string = return_type_inner.to_string().replace(' ', ""); + let return_type = if !ret_ty_string.is_empty() || ret_ty_string != "()" { let ret_ty_string = rust_type_to_openapi_type(&ret_ty_string); quote! { Some(#docs_crate::StdLibFnArg { name: "".to_string(), type_: #ret_ty_string.to_string(), - schema: #ret_ty_ident::json_schema(&mut generator), + schema: <#return_type_inner>::json_schema(&mut generator), required: true, }) } @@ -547,6 +575,93 @@ fn parse_array_type(type_name: &str) -> Option<(&str, usize)> { Some((inner_type.as_str(), length)) } +// Unbox a syn::Type that is boxed to the inner object. +fn unbox(t: syn::Type) -> syn::Type { + match t { + syn::Type::Path(syn::TypePath { ref path, .. }) => { + let path = &path.segments; + if path.len() == 1 { + let seg = &path[0]; + if seg.ident == "Box" { + if let syn::PathArguments::AngleBracketed(syn::AngleBracketedGenericArguments { args, .. }) = + &seg.arguments + { + if args.len() == 1 { + let mut args = args.iter(); + let ok = args.next().unwrap(); + if let syn::GenericArgument::Type(ty) = ok { + return ty.clone(); + } + } + } + } + } + } + _ => { + return t; + } + } + t +} + +// For a Vec> return Vec. +// For a Vec return Vec. +// For a Box return T. +fn unbox_vec(t: syn::Type) -> syn::Type { + match t { + syn::Type::Path(syn::TypePath { ref path, .. }) => { + let path = &path.segments; + if path.len() == 1 { + let seg = &path[0]; + if seg.ident == "Vec" { + if let syn::PathArguments::AngleBracketed(syn::AngleBracketedGenericArguments { args, .. }) = + &seg.arguments + { + if args.len() == 1 { + let mut args = args.iter(); + let ok = args.next().unwrap(); + if let syn::GenericArgument::Type(ty) = ok { + let unboxed = unbox(ty.clone()); + // Wrap it back in a vec. + let wrapped = syn::Type::Path(syn::TypePath { + qself: None, + path: syn::Path { + leading_colon: None, + segments: { + let mut segments = syn::punctuated::Punctuated::new(); + segments.push_value(syn::PathSegment { + ident: syn::Ident::new("Vec", proc_macro2::Span::call_site()), + arguments: syn::PathArguments::AngleBracketed( + syn::AngleBracketedGenericArguments { + colon2_token: None, + lt_token: syn::token::Lt::default(), + args: { + let mut args = syn::punctuated::Punctuated::new(); + args.push_value(syn::GenericArgument::Type(unboxed)); + args + }, + gt_token: syn::token::Gt::default(), + }, + ), + }); + segments + }, + }, + }); + return wrapped; + } + } + } + } + } + } + _ => { + return t; + } + } + t +} + #[cfg(test)] mod tests { @@ -672,7 +787,7 @@ mod tests { fn inner_show( /// The args to do shit to. args: Option - ) -> Box { + ) -> Result> { args } }, @@ -693,7 +808,7 @@ mod tests { fn inner_show( /// The args to do shit to. args: [f64; 2] - ) -> Box { + ) -> Result> { args } }, @@ -714,7 +829,7 @@ mod tests { fn inner_import( /// The args to do shit to. args: Option - ) -> Box { + ) -> Result> { args } }, @@ -727,4 +842,52 @@ mod tests { &openapitor::types::get_text_fmt(&item).unwrap(), ); } + + #[test] + fn test_stdlib_return_vec_sketch_group() { + let (item, errors) = do_stdlib( + quote! { + name = "import", + }, + quote! { + fn inner_import( + /// The args to do shit to. + args: Option + ) -> Result> { + args + } + }, + ) + .unwrap(); + + assert!(errors.is_empty()); + expectorate::assert_contents( + "tests/return_vec_sketch_group.gen", + &openapitor::types::get_text_fmt(&item).unwrap(), + ); + } + + #[test] + fn test_stdlib_return_vec_box_sketch_group() { + let (item, errors) = do_stdlib( + quote! { + name = "import", + }, + quote! { + fn inner_import( + /// The args to do shit to. + args: Option + ) -> Result>> { + args + } + }, + ) + .unwrap(); + + assert!(errors.is_empty()); + expectorate::assert_contents( + "tests/return_vec_box_sketch_group.gen", + &openapitor::types::get_text_fmt(&item).unwrap(), + ); + } } diff --git a/src/wasm-lib/derive-docs/tests/array.gen b/src/wasm-lib/derive-docs/tests/array.gen index 362ebdd38..a06729cf6 100644 --- a/src/wasm-lib/derive-docs/tests/array.gen +++ b/src/wasm-lib/derive-docs/tests/array.gen @@ -55,7 +55,7 @@ impl crate::docs::StdLibFn for Show { Some(crate::docs::StdLibFnArg { name: "".to_string(), type_: "number".to_string(), - schema: f64::json_schema(&mut generator), + schema: ::json_schema(&mut generator), required: true, }) } @@ -77,6 +77,6 @@ impl crate::docs::StdLibFn for Show { } } -fn inner_show(#[doc = r" The args to do shit to."] args: [f64; 2]) -> Box { +fn inner_show(#[doc = r" The args to do shit to."] args: [f64; 2]) -> Result> { args } diff --git a/src/wasm-lib/derive-docs/tests/box.gen b/src/wasm-lib/derive-docs/tests/box.gen index a21f0ca0f..84f1f9262 100644 --- a/src/wasm-lib/derive-docs/tests/box.gen +++ b/src/wasm-lib/derive-docs/tests/box.gen @@ -55,7 +55,7 @@ impl crate::docs::StdLibFn for Show { Some(crate::docs::StdLibFnArg { name: "".to_string(), type_: "number".to_string(), - schema: f64::json_schema(&mut generator), + schema: ::json_schema(&mut generator), required: true, }) } diff --git a/src/wasm-lib/derive-docs/tests/lineTo.gen b/src/wasm-lib/derive-docs/tests/lineTo.gen index 6d2e34f4a..ffc78c18c 100644 --- a/src/wasm-lib/derive-docs/tests/lineTo.gen +++ b/src/wasm-lib/derive-docs/tests/lineTo.gen @@ -63,7 +63,7 @@ impl crate::docs::StdLibFn for LineTo { Some(crate::docs::StdLibFnArg { name: "".to_string(), type_: "SketchGroup".to_string(), - schema: SketchGroup::json_schema(&mut generator), + schema: ::json_schema(&mut generator), required: true, }) } diff --git a/src/wasm-lib/derive-docs/tests/min.gen b/src/wasm-lib/derive-docs/tests/min.gen index d9b393efd..3bfac9c7b 100644 --- a/src/wasm-lib/derive-docs/tests/min.gen +++ b/src/wasm-lib/derive-docs/tests/min.gen @@ -55,7 +55,7 @@ impl crate::docs::StdLibFn for Min { Some(crate::docs::StdLibFnArg { name: "".to_string(), type_: "number".to_string(), - schema: f64::json_schema(&mut generator), + schema: ::json_schema(&mut generator), required: true, }) } diff --git a/src/wasm-lib/derive-docs/tests/option.gen b/src/wasm-lib/derive-docs/tests/option.gen index f743e517d..dce8d619d 100644 --- a/src/wasm-lib/derive-docs/tests/option.gen +++ b/src/wasm-lib/derive-docs/tests/option.gen @@ -55,7 +55,7 @@ impl crate::docs::StdLibFn for Show { Some(crate::docs::StdLibFnArg { name: "".to_string(), type_: "number".to_string(), - schema: f64::json_schema(&mut generator), + schema: ::json_schema(&mut generator), required: true, }) } @@ -77,6 +77,6 @@ impl crate::docs::StdLibFn for Show { } } -fn inner_show(#[doc = r" The args to do shit to."] args: Option) -> Box { +fn inner_show(#[doc = r" The args to do shit to."] args: Option) -> Result> { args } diff --git a/src/wasm-lib/derive-docs/tests/option_input_format.gen b/src/wasm-lib/derive-docs/tests/option_input_format.gen index 3ccc218a4..a15f62310 100644 --- a/src/wasm-lib/derive-docs/tests/option_input_format.gen +++ b/src/wasm-lib/derive-docs/tests/option_input_format.gen @@ -55,7 +55,7 @@ impl crate::docs::StdLibFn for Import { Some(crate::docs::StdLibFnArg { name: "".to_string(), type_: "number".to_string(), - schema: f64::json_schema(&mut generator), + schema: ::json_schema(&mut generator), required: true, }) } @@ -79,6 +79,6 @@ impl crate::docs::StdLibFn for Import { fn inner_import( #[doc = r" The args to do shit to."] args: Option, -) -> Box { +) -> Result> { args } diff --git a/src/wasm-lib/derive-docs/tests/return_vec_box_sketch_group.gen b/src/wasm-lib/derive-docs/tests/return_vec_box_sketch_group.gen new file mode 100644 index 000000000..f2e72e878 --- /dev/null +++ b/src/wasm-lib/derive-docs/tests/return_vec_box_sketch_group.gen @@ -0,0 +1,84 @@ +#[allow(non_camel_case_types, missing_docs)] +#[doc = "Std lib function: import"] +#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, schemars :: JsonSchema, ts_rs :: TS)] +#[ts(export)] +pub(crate) struct Import {} + +#[allow(non_upper_case_globals, missing_docs)] +#[doc = "Std lib function: import"] +pub(crate) const Import: Import = Import {}; +fn boxed_import( + args: crate::std::Args, +) -> std::pin::Pin< + Box< + dyn std::future::Future< + Output = anyhow::Result, + >, + >, +> { + Box::pin(import(args)) +} + +impl crate::docs::StdLibFn for Import { + fn name(&self) -> String { + "import".to_string() + } + + fn summary(&self) -> String { + "".to_string() + } + + fn description(&self) -> String { + "".to_string() + } + + fn tags(&self) -> Vec { + vec![] + } + + fn args(&self) -> Vec { + let mut settings = schemars::gen::SchemaSettings::openapi3(); + settings.inline_subschemas = true; + let mut generator = schemars::gen::SchemaGenerator::new(settings); + vec![crate::docs::StdLibFnArg { + name: "args".to_string(), + type_: "kittycad::types::InputFormat".to_string(), + schema: >::json_schema(&mut generator), + required: false, + }] + } + + fn return_value(&self) -> Option { + let mut settings = schemars::gen::SchemaSettings::openapi3(); + settings.inline_subschemas = true; + let mut generator = schemars::gen::SchemaGenerator::new(settings); + Some(crate::docs::StdLibFnArg { + name: "".to_string(), + type_: "[SketchGroup]".to_string(), + schema: >::json_schema(&mut generator), + required: true, + }) + } + + fn unpublished(&self) -> bool { + false + } + + fn deprecated(&self) -> bool { + false + } + + fn std_lib_fn(&self) -> crate::std::StdFn { + boxed_import + } + + fn clone_box(&self) -> Box { + Box::new(self.clone()) + } +} + +fn inner_import( + #[doc = r" The args to do shit to."] args: Option, +) -> Result>> { + args +} diff --git a/src/wasm-lib/derive-docs/tests/return_vec_sketch_group.gen b/src/wasm-lib/derive-docs/tests/return_vec_sketch_group.gen new file mode 100644 index 000000000..0c937f24f --- /dev/null +++ b/src/wasm-lib/derive-docs/tests/return_vec_sketch_group.gen @@ -0,0 +1,84 @@ +#[allow(non_camel_case_types, missing_docs)] +#[doc = "Std lib function: import"] +#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, schemars :: JsonSchema, ts_rs :: TS)] +#[ts(export)] +pub(crate) struct Import {} + +#[allow(non_upper_case_globals, missing_docs)] +#[doc = "Std lib function: import"] +pub(crate) const Import: Import = Import {}; +fn boxed_import( + args: crate::std::Args, +) -> std::pin::Pin< + Box< + dyn std::future::Future< + Output = anyhow::Result, + >, + >, +> { + Box::pin(import(args)) +} + +impl crate::docs::StdLibFn for Import { + fn name(&self) -> String { + "import".to_string() + } + + fn summary(&self) -> String { + "".to_string() + } + + fn description(&self) -> String { + "".to_string() + } + + fn tags(&self) -> Vec { + vec![] + } + + fn args(&self) -> Vec { + let mut settings = schemars::gen::SchemaSettings::openapi3(); + settings.inline_subschemas = true; + let mut generator = schemars::gen::SchemaGenerator::new(settings); + vec![crate::docs::StdLibFnArg { + name: "args".to_string(), + type_: "kittycad::types::InputFormat".to_string(), + schema: >::json_schema(&mut generator), + required: false, + }] + } + + fn return_value(&self) -> Option { + let mut settings = schemars::gen::SchemaSettings::openapi3(); + settings.inline_subschemas = true; + let mut generator = schemars::gen::SchemaGenerator::new(settings); + Some(crate::docs::StdLibFnArg { + name: "".to_string(), + type_: "[SketchGroup]".to_string(), + schema: >::json_schema(&mut generator), + required: true, + }) + } + + fn unpublished(&self) -> bool { + false + } + + fn deprecated(&self) -> bool { + false + } + + fn std_lib_fn(&self) -> crate::std::StdFn { + boxed_import + } + + fn clone_box(&self) -> Box { + Box::new(self.clone()) + } +} + +fn inner_import( + #[doc = r" The args to do shit to."] args: Option, +) -> Result> { + args +} diff --git a/src/wasm-lib/derive-docs/tests/show.gen b/src/wasm-lib/derive-docs/tests/show.gen index 0d2538429..71c54d7b9 100644 --- a/src/wasm-lib/derive-docs/tests/show.gen +++ b/src/wasm-lib/derive-docs/tests/show.gen @@ -52,7 +52,12 @@ impl crate::docs::StdLibFn for Show { let mut settings = schemars::gen::SchemaSettings::openapi3(); settings.inline_subschemas = true; let mut generator = schemars::gen::SchemaGenerator::new(settings); - None + Some(crate::docs::StdLibFnArg { + name: "".to_string(), + type_: "()".to_string(), + schema: <()>::json_schema(&mut generator), + required: true, + }) } fn unpublished(&self) -> bool { diff --git a/src/wasm-lib/kcl/Cargo.toml b/src/wasm-lib/kcl/Cargo.toml index f570b1f14..cc122a27f 100644 --- a/src/wasm-lib/kcl/Cargo.toml +++ b/src/wasm-lib/kcl/Cargo.toml @@ -17,8 +17,8 @@ async-trait = "0.1.77" clap = { version = "4.5.2", features = ["cargo", "derive", "env", "unicode"], optional = true } dashmap = "5.5.3" databake = { version = "0.1.7", features = ["derive"] } -derive-docs = { version = "0.1.9" } -#derive-docs = { path = "../derive-docs" } +#derive-docs = { version = "0.1.10" } +derive-docs = { path = "../derive-docs" } futures = { version = "0.3.30" } gltf-json = "1.4.0" kittycad = { workspace = true } diff --git a/src/wasm-lib/kcl/src/docs.rs b/src/wasm-lib/kcl/src/docs.rs index 045cb9e92..99b046cec 100644 --- a/src/wasm-lib/kcl/src/docs.rs +++ b/src/wasm-lib/kcl/src/docs.rs @@ -310,7 +310,7 @@ pub fn get_type_string_from_schema(schema: &schemars::schema::Schema) -> Result< if let Some(format) = &o.format { if format == "uuid" { return Ok((Primitive::Uuid.to_string(), false)); - } else if format == "double" || format == "uint" || format == "int64" { + } else if format == "double" || format == "uint" || format == "int64" || format == "uint32" { return Ok((Primitive::Number.to_string(), false)); } else { anyhow::bail!("unknown format: {}", format); @@ -428,7 +428,7 @@ pub fn get_autocomplete_string_from_schema(schema: &schemars::schema::Schema) -> if let Some(format) = &o.format { if format == "uuid" { return Ok(Primitive::Uuid.to_string()); - } else if format == "double" || format == "uint" || format == "int64" { + } else if format == "double" || format == "uint" || format == "int64" || format == "uint32" { return Ok(Primitive::Number.to_string()); } else { anyhow::bail!("unknown format: {}", format); diff --git a/src/wasm-lib/kcl/src/std/mod.rs b/src/wasm-lib/kcl/src/std/mod.rs index e9febe35c..4757701f5 100644 --- a/src/wasm-lib/kcl/src/std/mod.rs +++ b/src/wasm-lib/kcl/src/std/mod.rs @@ -27,8 +27,7 @@ use crate::{ engine::EngineManager, errors::{KclError, KclErrorDetails}, executor::{ - ExecutorContext, ExtrudeGroup, Geometry, MemoryItem, Metadata, SketchGroup, SketchGroupSet, SketchSurface, - SourceRange, + ExecutorContext, ExtrudeGroup, MemoryItem, Metadata, SketchGroup, SketchGroupSet, SketchSurface, SourceRange, }, std::{kcl_stdlib::KclStdLibFn, sketch::SketchOnFaceTag}, }; @@ -72,8 +71,10 @@ lazy_static! { Box::new(crate::std::sketch::TangentialArcTo), Box::new(crate::std::sketch::BezierCurve), Box::new(crate::std::sketch::Hole), - Box::new(crate::std::patterns::PatternLinear), - Box::new(crate::std::patterns::PatternCircular), + Box::new(crate::std::patterns::PatternLinear2D), + Box::new(crate::std::patterns::PatternLinear3D), + Box::new(crate::std::patterns::PatternCircular2D), + Box::new(crate::std::patterns::PatternCircular3D), Box::new(crate::std::fillet::Fillet), Box::new(crate::std::fillet::GetOppositeEdge), Box::new(crate::std::fillet::GetNextAdjacentEdge), @@ -522,49 +523,6 @@ impl Args { Ok((data, sketch_group)) } - fn get_data_and_geometry(&self) -> Result<(T, Geometry), KclError> { - let first_value = self - .args - .first() - .ok_or_else(|| { - KclError::Type(KclErrorDetails { - message: format!("Expected a struct as the first argument, found `{:?}`", self.args), - source_ranges: vec![self.source_range], - }) - })? - .get_json_value()?; - - let data: T = serde_json::from_value(first_value).map_err(|e| { - KclError::Type(KclErrorDetails { - message: format!("Failed to deserialize struct from JSON: {}", e), - source_ranges: vec![self.source_range], - }) - })?; - - let second_value = self.args.get(1).ok_or_else(|| { - KclError::Type(KclErrorDetails { - message: format!("Expected a SketchGroup as the second argument, found `{:?}`", self.args), - source_ranges: vec![self.source_range], - }) - })?; - - let geometry = if let MemoryItem::SketchGroup(sg) = second_value { - Geometry::SketchGroup(sg.clone()) - } else if let MemoryItem::ExtrudeGroup(eg) = second_value { - Geometry::ExtrudeGroup(eg.clone()) - } else { - return Err(KclError::Type(KclErrorDetails { - message: format!( - "Expected a SketchGroup or ExtrudeGroup as the second argument, found `{:?}`", - self.args - ), - source_ranges: vec![self.source_range], - })); - }; - - Ok((data, geometry)) - } - fn get_data_and_sketch_surface(&self) -> Result<(T, SketchSurface), KclError> { let first_value = self .args diff --git a/src/wasm-lib/kcl/src/std/patterns.rs b/src/wasm-lib/kcl/src/std/patterns.rs index 180bf6458..2bf5b3031 100644 --- a/src/wasm-lib/kcl/src/std/patterns.rs +++ b/src/wasm-lib/kcl/src/std/patterns.rs @@ -8,47 +8,71 @@ use serde::{Deserialize, Serialize}; use crate::{ errors::{KclError, KclErrorDetails}, - executor::{Geometries, Geometry, MemoryItem}, + executor::{ExtrudeGroup, Geometries, Geometry, MemoryItem, SketchGroup}, std::Args, }; -/// Data for a linear pattern. +/// Data for a linear pattern on a 2D sketch. #[derive(Debug, Clone, Deserialize, Serialize, PartialEq, ts_rs::TS, JsonSchema)] #[ts(export)] #[serde(rename_all = "camelCase")] -pub struct LinearPatternData { +pub struct LinearPattern2dData { /// The number of repetitions. Must be greater than 0. /// This excludes the original entity. For example, if `repetitions` is 1, /// the original entity will be copied once. - pub repetitions: usize, + pub repetitions: u32, /// The distance between each repetition. This can also be referred to as spacing. pub distance: f64, /// The axis of the pattern. This is a 2D vector. pub axis: [f64; 2], } -/// Data for a circular pattern. +/// Data for a linear pattern on a 3D model. #[derive(Debug, Clone, Deserialize, Serialize, PartialEq, ts_rs::TS, JsonSchema)] #[ts(export)] #[serde(rename_all = "camelCase")] -pub struct CircularPatternData { +pub struct LinearPattern3dData { /// The number of repetitions. Must be greater than 0. /// This excludes the original entity. For example, if `repetitions` is 1, /// the original entity will be copied once. - pub repetitions: usize, - /// The axis around which to make the pattern. This is a 2D vector. - pub axis: [f64; 2], - /// The center about which to make th pattern. This is a 3D vector. - pub center: [f64; 3], - /// The arc angle (in degrees) to place the repetitions. Must be greater than 0. - pub arc_degrees: f64, - /// Whether or not to rotate the duplicates as they are copied. - pub rotate_duplicates: bool, + pub repetitions: u32, + /// The distance between each repetition. This can also be referred to as spacing. + pub distance: f64, + /// The axis of the pattern. + pub axis: [f64; 3], } -/// A linear pattern. -pub async fn pattern_linear(args: Args) -> Result { - let (data, geometry): (LinearPatternData, Geometry) = args.get_data_and_geometry()?; +pub enum LinearPattern { + ThreeD(LinearPattern3dData), + TwoD(LinearPattern2dData), +} + +impl LinearPattern { + pub fn axis(&self) -> [f64; 3] { + match self { + LinearPattern::TwoD(lp) => [lp.axis[0], lp.axis[1], 0.0], + LinearPattern::ThreeD(lp) => lp.axis, + } + } + + pub fn repetitions(&self) -> u32 { + match self { + LinearPattern::TwoD(lp) => lp.repetitions, + LinearPattern::ThreeD(lp) => lp.repetitions, + } + } + + pub fn distance(&self) -> f64 { + match self { + LinearPattern::TwoD(lp) => lp.distance, + LinearPattern::ThreeD(lp) => lp.distance, + } + } +} + +/// A linear pattern on a 2D sketch. +pub async fn pattern_linear_2d(args: Args) -> Result { + let (data, sketch_group): (LinearPattern2dData, Box) = args.get_data_and_sketch_group()?; if data.axis == [0.0, 0.0] { return Err(KclError::Semantic(KclErrorDetails { @@ -59,38 +83,80 @@ pub async fn pattern_linear(args: Args) -> Result { })); } - let new_geometries = inner_pattern_linear(data, geometry, args).await?; - match new_geometries { - Geometries::SketchGroups(sketch_groups) => Ok(MemoryItem::SketchGroups { value: sketch_groups }), - Geometries::ExtrudeGroups(extrude_groups) => Ok(MemoryItem::ExtrudeGroups { value: extrude_groups }), - } + let sketch_groups = inner_pattern_linear_2d(data, sketch_group, args).await?; + Ok(MemoryItem::SketchGroups { value: sketch_groups }) } -/// A circular pattern. -pub async fn pattern_circular(args: Args) -> Result { - let (data, geometry): (CircularPatternData, Geometry) = args.get_data_and_geometry()?; +/// A linear pattern on a 2D sketch. +#[stdlib { + name = "patternLinear2d", +}] +async fn inner_pattern_linear_2d( + data: LinearPattern2dData, + sketch_group: Box, + args: Args, +) -> Result>, KclError> { + let geometries = pattern_linear( + LinearPattern::TwoD(data), + Geometry::SketchGroup(sketch_group), + args.clone(), + ) + .await?; - if data.axis == [0.0, 0.0] { + let Geometries::SketchGroups(sketch_groups) = geometries else { + return Err(KclError::Semantic(KclErrorDetails { + message: "Expected a vec of sketch groups".to_string(), + source_ranges: vec![args.source_range], + })); + }; + + Ok(sketch_groups) +} + +/// A linear pattern on a 3D model. +pub async fn pattern_linear_3d(args: Args) -> Result { + let (data, extrude_group): (LinearPattern3dData, Box) = args.get_data_and_extrude_group()?; + + if data.axis == [0.0, 0.0, 0.0] { return Err(KclError::Semantic(KclErrorDetails { message: - "The axis of the circular pattern cannot be the zero vector. Otherwise they will just duplicate in place." + "The axis of the linear pattern cannot be the zero vector. Otherwise they will just duplicate in place." .to_string(), source_ranges: vec![args.source_range], })); } - let new_geometries = inner_pattern_circular(data, geometry, args).await?; - match new_geometries { - Geometries::SketchGroups(sketch_groups) => Ok(MemoryItem::SketchGroups { value: sketch_groups }), - Geometries::ExtrudeGroups(extrude_groups) => Ok(MemoryItem::ExtrudeGroups { value: extrude_groups }), - } + let extrude_groups = inner_pattern_linear_3d(data, extrude_group, args).await?; + Ok(MemoryItem::ExtrudeGroups { value: extrude_groups }) } -/// A linear pattern. +/// A linear pattern on a 3D model. #[stdlib { - name = "patternLinear", + name = "patternLinear3d", }] -async fn inner_pattern_linear(data: LinearPatternData, geometry: Geometry, args: Args) -> Result { +async fn inner_pattern_linear_3d( + data: LinearPattern3dData, + extrude_group: Box, + args: Args, +) -> Result>, KclError> { + let geometries = pattern_linear( + LinearPattern::ThreeD(data), + Geometry::ExtrudeGroup(extrude_group), + args.clone(), + ) + .await?; + + let Geometries::ExtrudeGroups(extrude_groups) = geometries else { + return Err(KclError::Semantic(KclErrorDetails { + message: "Expected a vec of extrude groups".to_string(), + source_ranges: vec![args.source_range], + })); + }; + + Ok(extrude_groups) +} + +async fn pattern_linear(data: LinearPattern, geometry: Geometry, args: Args) -> Result { let id = uuid::Uuid::new_v4(); let resp = args @@ -98,13 +164,13 @@ async fn inner_pattern_linear(data: LinearPatternData, geometry: Geometry, args: id, ModelingCmd::EntityLinearPattern { axis: kittycad::types::Point3D { - x: data.axis[0], - y: data.axis[1], - z: 0.0, + x: data.axis()[0], + y: data.axis()[1], + z: data.axis()[2], }, entity_id: geometry.id(), - num_repetitions: data.repetitions as u32, - spacing: data.distance, + num_repetitions: data.repetitions(), + spacing: data.distance(), }, ) .await?; @@ -143,15 +209,153 @@ async fn inner_pattern_linear(data: LinearPatternData, geometry: Geometry, args: Ok(geometries) } -/// A Circular pattern. +/// Data for a circular pattern on a 2D sketch. +#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, ts_rs::TS, JsonSchema)] +#[ts(export)] +#[serde(rename_all = "camelCase")] +pub struct CircularPattern2dData { + /// The number of repetitions. Must be greater than 0. + /// This excludes the original entity. For example, if `repetitions` is 1, + /// the original entity will be copied once. + pub repetitions: u32, + /// The center about which to make th pattern. This is a 2D vector. + pub center: [f64; 2], + /// The arc angle (in degrees) to place the repetitions. Must be greater than 0. + pub arc_degrees: f64, + /// Whether or not to rotate the duplicates as they are copied. + pub rotate_duplicates: bool, +} + +/// Data for a circular pattern on a 3D model. +#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, ts_rs::TS, JsonSchema)] +#[ts(export)] +#[serde(rename_all = "camelCase")] +pub struct CircularPattern3dData { + /// The number of repetitions. Must be greater than 0. + /// This excludes the original entity. For example, if `repetitions` is 1, + /// the original entity will be copied once. + pub repetitions: u32, + /// The axis around which to make the pattern. This is a 3D vector. + pub axis: [f64; 3], + /// The center about which to make th pattern. This is a 3D vector. + pub center: [f64; 3], + /// The arc angle (in degrees) to place the repetitions. Must be greater than 0. + pub arc_degrees: f64, + /// Whether or not to rotate the duplicates as they are copied. + pub rotate_duplicates: bool, +} + +pub enum CircularPattern { + ThreeD(CircularPattern3dData), + TwoD(CircularPattern2dData), +} + +impl CircularPattern { + pub fn axis(&self) -> [f64; 3] { + match self { + CircularPattern::TwoD(_lp) => [0.0, 0.0, 0.0], + CircularPattern::ThreeD(lp) => lp.axis, + } + } + + pub fn center(&self) -> [f64; 3] { + match self { + CircularPattern::TwoD(lp) => [lp.center[0], lp.center[1], 0.0], + CircularPattern::ThreeD(lp) => lp.center, + } + } + + pub fn repetitions(&self) -> u32 { + match self { + CircularPattern::TwoD(lp) => lp.repetitions, + CircularPattern::ThreeD(lp) => lp.repetitions, + } + } + + pub fn arc_degrees(&self) -> f64 { + match self { + CircularPattern::TwoD(lp) => lp.arc_degrees, + CircularPattern::ThreeD(lp) => lp.arc_degrees, + } + } + + pub fn rotate_duplicates(&self) -> bool { + match self { + CircularPattern::TwoD(lp) => lp.rotate_duplicates, + CircularPattern::ThreeD(lp) => lp.rotate_duplicates, + } + } +} + +/// A circular pattern on a 2D sketch. +pub async fn pattern_circular_2d(args: Args) -> Result { + let (data, sketch_group): (CircularPattern2dData, Box) = args.get_data_and_sketch_group()?; + + let sketch_groups = inner_pattern_circular_2d(data, sketch_group, args).await?; + Ok(MemoryItem::SketchGroups { value: sketch_groups }) +} + +/// A circular pattern on a 2D sketch. #[stdlib { - name = "patternCircular", + name = "patternCircular2d", }] -async fn inner_pattern_circular( - data: CircularPatternData, - geometry: Geometry, +async fn inner_pattern_circular_2d( + data: CircularPattern2dData, + sketch_group: Box, args: Args, -) -> Result { +) -> Result>, KclError> { + let geometries = pattern_circular( + CircularPattern::TwoD(data), + Geometry::SketchGroup(sketch_group), + args.clone(), + ) + .await?; + + let Geometries::SketchGroups(sketch_groups) = geometries else { + return Err(KclError::Semantic(KclErrorDetails { + message: "Expected a vec of sketch groups".to_string(), + source_ranges: vec![args.source_range], + })); + }; + + Ok(sketch_groups) +} + +/// A circular pattern on a 3D model. +pub async fn pattern_circular_3d(args: Args) -> Result { + let (data, extrude_group): (CircularPattern3dData, Box) = args.get_data_and_extrude_group()?; + + let extrude_groups = inner_pattern_circular_3d(data, extrude_group, args).await?; + Ok(MemoryItem::ExtrudeGroups { value: extrude_groups }) +} + +/// A circular pattern on a 3D model. +#[stdlib { + name = "patternCircular3d", +}] +async fn inner_pattern_circular_3d( + data: CircularPattern3dData, + extrude_group: Box, + args: Args, +) -> Result>, KclError> { + let geometries = pattern_circular( + CircularPattern::ThreeD(data), + Geometry::ExtrudeGroup(extrude_group), + args.clone(), + ) + .await?; + + let Geometries::ExtrudeGroups(extrude_groups) = geometries else { + return Err(KclError::Semantic(KclErrorDetails { + message: "Expected a vec of extrude groups".to_string(), + source_ranges: vec![args.source_range], + })); + }; + + Ok(extrude_groups) +} + +async fn pattern_circular(data: CircularPattern, geometry: Geometry, args: Args) -> Result { let id = uuid::Uuid::new_v4(); let resp = args @@ -159,15 +363,15 @@ async fn inner_pattern_circular( id, ModelingCmd::EntityCircularPattern { axis: kittycad::types::Point3D { - x: data.axis[0], - y: data.axis[1], - z: 0.0, + x: data.axis()[0], + y: data.axis()[1], + z: data.axis()[2], }, entity_id: geometry.id(), - center: data.center.into(), - num_repetitions: data.repetitions as u32, - arc_degrees: data.arc_degrees, - rotate_duplicates: data.rotate_duplicates, + center: data.center().into(), + num_repetitions: data.repetitions(), + arc_degrees: data.arc_degrees(), + rotate_duplicates: data.rotate_duplicates(), }, ) .await?; diff --git a/src/wasm-lib/tests/executor/main.rs b/src/wasm-lib/tests/executor/main.rs index 5333db544..0cbd7b2f7 100644 --- a/src/wasm-lib/tests/executor/main.rs +++ b/src/wasm-lib/tests/executor/main.rs @@ -815,7 +815,7 @@ async fn serial_test_top_level_expression() { async fn serial_test_patterns_linear_basic() { let code = r#"const part = startSketchOn('XY') |> circle([0,0], 2, %) - |> patternLinear({axis: [0,1], repetitions: 12, distance: 2}, %) + |> patternLinear2d({axis: [0,1], repetitions: 12, distance: 2}, %) "#; let result = execute_and_snapshot(code, kittycad::types::UnitLength::Mm) @@ -833,7 +833,7 @@ async fn serial_test_patterns_linear_basic_3d() { |> line([0, -1], %) |> close(%) |> extrude(1, %) - |> patternLinear({axis: [1, 0], repetitions: 3, distance: 6}, %) + |> patternLinear3d({axis: [1, 0, 1], repetitions: 3, distance: 6}, %) "#; let result = execute_and_snapshot(code, kittycad::types::UnitLength::Mm) @@ -846,7 +846,7 @@ async fn serial_test_patterns_linear_basic_3d() { async fn serial_test_patterns_linear_basic_negative_distance() { let code = r#"const part = startSketchOn('XY') |> circle([0,0], 2, %) - |> patternLinear({axis: [0,1], repetitions: 12, distance: -2}, %) + |> patternLinear2d({axis: [0,1], repetitions: 12, distance: -2}, %) "#; let result = execute_and_snapshot(code, kittycad::types::UnitLength::Mm) @@ -863,7 +863,7 @@ async fn serial_test_patterns_linear_basic_negative_distance() { async fn serial_test_patterns_linear_basic_negative_axis() { let code = r#"const part = startSketchOn('XY') |> circle([0,0], 2, %) - |> patternLinear({axis: [0,-1], repetitions: 12, distance: 2}, %) + |> patternLinear2d({axis: [0,-1], repetitions: 12, distance: 2}, %) "#; let result = execute_and_snapshot(code, kittycad::types::UnitLength::Mm) @@ -880,7 +880,7 @@ async fn serial_test_patterns_linear_basic_negative_axis() { async fn serial_test_patterns_linear_basic_holes() { let code = r#"const circles = startSketchOn('XY') |> circle([5, 5], 1, %) - |> patternLinear({axis: [1,1], repetitions: 12, distance: 3}, %) + |> patternLinear2d({axis: [1,1], repetitions: 12, distance: 3}, %) const rectangle = startSketchOn('XY') |> startProfileAt([0, 0], %) @@ -902,7 +902,7 @@ const rectangle = startSketchOn('XY') async fn serial_test_patterns_circular_basic_2d() { let code = r#"const part = startSketchOn('XY') |> circle([0,0], 2, %) - |> patternCircular({axis: [0,1], center: [20, 20, 20], repetitions: 12, arcDegrees: 210, rotateDuplicates: true}, %) + |> patternCircular2d({center: [20, 20], repetitions: 12, arcDegrees: 210, rotateDuplicates: true}, %) "#; let result = execute_and_snapshot(code, kittycad::types::UnitLength::Mm) @@ -920,7 +920,7 @@ async fn serial_test_patterns_circular_basic_3d() { |> line([0, -1], %) |> close(%) |> extrude(1, %) - |> patternCircular({axis: [0,1], center: [-20, -20, -20], repetitions: 40, arcDegrees: 360, rotateDuplicates: false}, %) + |> patternCircular3d({axis: [0,0, 1], center: [-20, -20, -20], repetitions: 40, arcDegrees: 360, rotateDuplicates: false}, %) "#; let result = execute_and_snapshot(code, kittycad::types::UnitLength::Mm) @@ -938,7 +938,7 @@ async fn serial_test_patterns_circular_3d_tilted_axis() { |> line([0, -1], %) |> close(%) |> extrude(1, %) - |> patternCircular({axis: [1,1], center: [10, 0, 10], repetitions: 10, arcDegrees: 360, rotateDuplicates: true}, %) + |> patternCircular3d({axis: [1,1,0], center: [10, 0, 10], repetitions: 10, arcDegrees: 360, rotateDuplicates: true}, %) "#; let result = execute_and_snapshot(code, kittycad::types::UnitLength::Mm) diff --git a/src/wasm-lib/tests/executor/outputs/patterns_circular_basic_3d.png b/src/wasm-lib/tests/executor/outputs/patterns_circular_basic_3d.png index b4a8548c9..62720fccc 100644 Binary files a/src/wasm-lib/tests/executor/outputs/patterns_circular_basic_3d.png and b/src/wasm-lib/tests/executor/outputs/patterns_circular_basic_3d.png differ diff --git a/src/wasm-lib/tests/executor/outputs/patterns_linear_basic_3d.png b/src/wasm-lib/tests/executor/outputs/patterns_linear_basic_3d.png index ec40e200d..a52b09d87 100644 Binary files a/src/wasm-lib/tests/executor/outputs/patterns_linear_basic_3d.png and b/src/wasm-lib/tests/executor/outputs/patterns_linear_basic_3d.png differ