{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "slow_bloom_motion_study.schema.json",
  "title": "slow_bloom_motion_study input",
  "description": "Render Slow Bloom's motion study from the design sheet: a still sheet of the three motions with the direction of each stated in words (output/slow-bloom-motion-directions.png) and an animated clip in which all three motions are legible and in the right direction (output/renders/slow-bloom-motion-directions.mp4). Every number is parsed from docs/slow-bloom.md and every piece quoted from docs/slow-bloom-bom.json, so the render cannot disagree with the design. Both renders audit their own layout and refuse to write if an element would land off the page.",
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "sheet": {
      "type": "boolean",
      "default": true,
      "description": "Render the still sheet, output/slow-bloom-motion-directions.png."
    },
    "video": {
      "type": "boolean",
      "default": true,
      "description": "Render the clip, output/renders/slow-bloom-motion-directions.mp4. Needs ffmpeg on PATH."
    },
    "seconds": {
      "type": "number",
      "minimum": 3,
      "maximum": 60,
      "default": 8.0,
      "description": "Clip length. The three motions are shown in turn: yaw, then lean, then spin."
    },
    "fps": {
      "type": "integer",
      "minimum": 12,
      "maximum": 60,
      "default": 24,
      "description": "Clip frame rate."
    },
    "json_only": {
      "type": "boolean",
      "default": false,
      "description": "Print what the tool read from docs/slow-bloom.md and docs/slow-bloom-bom.json and render nothing."
    }
  },
  "$defs": {
    "output": {
      "type": "object",
      "description": "What the tool writes to stdout on success.",
      "properties": {
        "ok": {"type": "boolean"},
        "sheet": {
          "type": "object",
          "properties": {"path": {"type": "string"}, "px": {"type": "array", "items": {"type": "integer"}}}
        },
        "video": {
          "type": "object",
          "properties": {
            "path": {"type": "string"},
            "seconds": {"type": "number"},
            "fps": {"type": "integer"},
            "size": {"type": "array", "items": {"type": "integer"}}
          }
        },
        "motions": {
          "type": "object",
          "description": "The three motions as the design sheet states them, with the direction of each in words.",
          "properties": {
            "yaw": {
              "type": "object",
              "properties": {
                "about": {"const": "the mast's vertical axis"},
                "way": {"type": "string"},
                "period_s": {"type": "array", "items": {"type": "number"}}
              }
            },
            "lean": {
              "type": "object",
              "properties": {
                "about": {"const": "the arm's own horizontal pivot, across the arm"},
                "way": {"type": "string"},
                "travel_deg": {"type": "array", "items": {"type": "number"}},
                "period_s": {"type": "array", "items": {"type": "number"}}
              }
            },
            "spin": {
              "type": "object",
              "properties": {
                "about": {"const": "each bloom's own vertical axle"},
                "way": {"type": "string"},
                "range_rpm": {"type": "array", "items": {"type": "number"}}
              }
            },
            "counterweight": {
              "const": "moves the OPPOSITE way to the blooms on every lean"
            },
            "negatives": {
              "type": "array",
              "items": {"type": "string"},
              "description": "Nothing is powered; no motion has a reverse; nothing hangs."
            }
          }
        }
      }
    }
  }
}
