{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://openeik.org/schemas/0.6/commands/detail.draw.schema.json",
  "$comment": "OpenEik 0.5: folded by tools/fold-schemas-0.5.mjs from the proposal drawingCommands, which 0.5 makes a rule (open questions, 137). Written by hand, not generated.",
  "title": "detail.draw",
  "description": "Draws one line item of a view by a sketch operation, or continues the view's line item of its id with a tangent arc or a fillet (Part V, 2.2; Part XIV, 17.1.2). A new item takes color and lineStyle, else #26313b and solid. Its provenance is the command's member, which the processor writes into the item it draws (Part XIV, 17.1.1, rule 6). The view is at its revision plus one.",
  "type": "object",
  "properties": {
    "kind": {
      "const": "detail.draw"
    },
    "viewId": {
      "type": "string",
      "minLength": 1,
      "x-eik-ref": "view"
    },
    "expectedRevision": {
      "type": "integer",
      "minimum": 0,
      "description": "The view's revision as read."
    },
    "id": {
      "type": "string",
      "minLength": 1
    },
    "operation": {
      "description": "A sketch operation (Part XIV, 17.1.2): its tool, its picks in the view's own coordinates, and the tools' settings, each with its default where it is left out.",
      "type": "object",
      "properties": {
        "tool": {
          "type": "string",
          "enum": [
            "line",
            "rectangle",
            "polygon",
            "circumscribed",
            "circle",
            "circle3",
            "arc3",
            "centerArc",
            "tangentArc",
            "fillet",
            "ellipse",
            "partialEllipse",
            "spline"
          ]
        },
        "picks": {
          "type": "array",
          "items": {
            "type": "array",
            "minItems": 2,
            "maxItems": 2,
            "prefixItems": [
              {
                "type": "number"
              },
              {
                "type": "number"
              }
            ]
          },
          "maxItems": 5
        },
        "sides": {
          "type": "integer",
          "minimum": 3,
          "maximum": 64,
          "description": "A polygon's sides; 6 where it is left out."
        },
        "radius": {
          "type": "number",
          "exclusiveMinimum": 0,
          "description": "A fillet's radius, mm; 300 where it is left out."
        },
        "offset": {
          "type": "number",
          "description": "No tool of detail.draw reads it; 0 where it is left out."
        },
        "tolerance": {
          "type": "number",
          "minimum": 0.1,
          "maximum": 20,
          "description": "How far a curve's chords may lie from it, mm; 2 where it is left out."
        },
        "vertex": {
          "type": "integer",
          "minimum": 0,
          "description": "The corner a fillet rounds, by its index from 0; where it is left out, the corner nearest the pick."
        }
      },
      "required": [
        "tool",
        "picks"
      ],
      "additionalProperties": false
    },
    "color": {
      "type": "string",
      "pattern": "^#[0-9a-fA-F]{6}$"
    },
    "lineStyle": {
      "type": "string",
      "enum": [
        "solid",
        "dash",
        "center"
      ]
    },
    "provenance": {
      "$ref": "../drawings/provenance.schema.json"
    }
  },
  "required": [
    "kind",
    "viewId",
    "expectedRevision",
    "id",
    "operation"
  ],
  "additionalProperties": false
}
