{
  "$defs": {
    "Action": {
      "description": "面の働き（屈折は省く）。mirror は反射してから位相・傾きを加える",
      "oneOf": [
        {
          "const": "reflect",
          "description": "反射（鏡）",
          "type": "string"
        },
        {
          "additionalProperties": false,
          "description": "屈折面での反射（ゴーストの経路の解析の写し）。medium は光が入らない側の媒質",
          "properties": {
            "ghost_reflect": {
              "additionalProperties": false,
              "properties": {
                "medium": {
                  "type": "string"
                }
              },
              "required": [
                "medium"
              ],
              "type": "object"
            }
          },
          "required": [
            "ghost_reflect"
          ],
          "type": "object"
        },
        {
          "additionalProperties": false,
          "description": "理想レンズ（焦点距離 f、OPD の求め方 opd_mode）",
          "properties": {
            "paraxial": {
              "additionalProperties": false,
              "properties": {
                "f": {
                  "format": "double",
                  "type": "number"
                },
                "mirror": {
                  "type": "boolean"
                },
                "opd_mode": {
                  "format": "int32",
                  "type": "integer"
                }
              },
              "required": [
                "f"
              ],
              "type": "object"
            }
          },
          "required": [
            "paraxial"
          ],
          "type": "object"
        },
        {
          "additionalProperties": false,
          "description": "Jones 行列 [Ar, Ai, Br, Bi, Cr, Ci, Dr, Di]、または波長ごとに作る偏光子・波長板",
          "properties": {
            "jones": {
              "additionalProperties": false,
              "properties": {
                "matrix": {
                  "items": {
                    "format": "double",
                    "type": "number"
                  },
                  "maxItems": 8,
                  "minItems": 8,
                  "type": "array"
                },
                "mirror": {
                  "type": "boolean"
                },
                "retarder": {
                  "anyOf": [
                    {
                      "$ref": "#/$defs/Retarder"
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              },
              "type": "object"
            }
          },
          "required": [
            "jones"
          ],
          "type": "object"
        },
        {
          "additionalProperties": false,
          "description": "Binary 2: 位相 Φ = order · Σ coef[i] ρ^{2(i+1)}（形は偶数次非球面）",
          "properties": {
            "binary2": {
              "additionalProperties": false,
              "properties": {
                "mirror": {
                  "type": "boolean"
                },
                "phase": {
                  "anyOf": [
                    {
                      "$ref": "#/$defs/Binary2"
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              },
              "type": "object"
            }
          },
          "required": [
            "binary2"
          ],
          "type": "object"
        },
        {
          "additionalProperties": false,
          "description": "Fresnel: 交点は頂点の平面、屈折は偶数次非球面（c・k・a）の傾きで",
          "properties": {
            "fresnel": {
              "additionalProperties": false,
              "properties": {
                "a": {
                  "items": {
                    "format": "double",
                    "type": "number"
                  },
                  "type": "array"
                },
                "c": {
                  "format": "double",
                  "type": "number"
                },
                "k": {
                  "format": "double",
                  "type": "number"
                },
                "mirror": {
                  "type": "boolean"
                }
              },
              "type": "object"
            }
          },
          "required": [
            "fresnel"
          ],
          "type": "object"
        },
        {
          "additionalProperties": false,
          "description": "Cylinder Fresnel: 交点は形（cylinder）、屈折は bend の面の傾きで",
          "properties": {
            "cylinder_fresnel": {
              "additionalProperties": false,
              "properties": {
                "bend": {
                  "anyOf": [
                    {
                      "$ref": "#/$defs/CylFresnel"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "mirror": {
                  "type": "boolean"
                }
              },
              "type": "object"
            }
          },
          "required": [
            "cylinder_fresnel"
          ],
          "type": "object"
        },
        {
          "additionalProperties": false,
          "description": "複屈折材の板の入口（mode 0: 常光の成分だけ、2: 波長板。axis は結晶軸）",
          "properties": {
            "birefringent_in": {
              "additionalProperties": false,
              "properties": {
                "axis": {
                  "items": {
                    "format": "double",
                    "type": "number"
                  },
                  "maxItems": 3,
                  "minItems": 3,
                  "type": "array"
                },
                "mode": {
                  "format": "uint8",
                  "maximum": 255,
                  "minimum": 0,
                  "type": "integer"
                }
              },
              "required": [
                "mode",
                "axis"
              ],
              "type": "object"
            }
          },
          "required": [
            "birefringent_in"
          ],
          "type": "object"
        },
        {
          "const": "birefringent_out",
          "description": "複屈折材の板の出口",
          "type": "string"
        },
        {
          "additionalProperties": false,
          "description": "利用者定義の面（登録のモデルの名前と設定）",
          "properties": {
            "user": {
              "additionalProperties": false,
              "properties": {
                "config": {
                  "additionalProperties": {
                    "$ref": "#/$defs/Value"
                  },
                  "default": {},
                  "type": "object"
                },
                "mirror": {
                  "type": "boolean"
                },
                "model": {
                  "type": "string"
                }
              },
              "required": [
                "model"
              ],
              "type": "object"
            }
          },
          "required": [
            "user"
          ],
          "type": "object"
        }
      ]
    },
    "After": {
      "anyOf": [
        {
          "$ref": "#/$defs/Reverse",
          "description": "\"reverse\": 前の変換を戻す"
        },
        {
          "$ref": "#/$defs/Tilt"
        }
      ],
      "description": "面の後の傾き・偏心"
    },
    "Aperture": {
      "description": "面の開口",
      "oneOf": [
        {
          "additionalProperties": false,
          "description": "円（最小・最大半径、偏心）",
          "properties": {
            "circular": {
              "additionalProperties": false,
              "properties": {
                "dx": {
                  "format": "double",
                  "type": "number"
                },
                "dy": {
                  "format": "double",
                  "type": "number"
                },
                "max": {
                  "format": "double",
                  "type": "number"
                },
                "min": {
                  "format": "double",
                  "type": "number"
                }
              },
              "required": [
                "max"
              ],
              "type": "object"
            }
          },
          "required": [
            "circular"
          ],
          "type": "object"
        },
        {
          "additionalProperties": false,
          "description": "矩形（x・y の半幅、偏心）",
          "properties": {
            "rect": {
              "additionalProperties": false,
              "properties": {
                "dx": {
                  "format": "double",
                  "type": "number"
                },
                "dy": {
                  "format": "double",
                  "type": "number"
                },
                "hx": {
                  "format": "double",
                  "type": "number"
                },
                "hy": {
                  "format": "double",
                  "type": "number"
                }
              },
              "required": [
                "hx",
                "hy"
              ],
              "type": "object"
            }
          },
          "required": [
            "rect"
          ],
          "type": "object"
        },
        {
          "additionalProperties": false,
          "description": "浮動開口（半径は面の半直径。違うときだけ semi）",
          "properties": {
            "floating": {
              "additionalProperties": false,
              "properties": {
                "semi": {
                  "format": "double",
                  "type": [
                    "number",
                    "null"
                  ]
                }
              },
              "type": "object"
            }
          },
          "required": [
            "floating"
          ],
          "type": "object"
        },
        {
          "additionalProperties": false,
          "description": "楕円（x・y の半軸、偏心）",
          "properties": {
            "ellipse": {
              "additionalProperties": false,
              "properties": {
                "dx": {
                  "format": "double",
                  "type": "number"
                },
                "dy": {
                  "format": "double",
                  "type": "number"
                },
                "hx": {
                  "format": "double",
                  "type": "number"
                },
                "hy": {
                  "format": "double",
                  "type": "number"
                }
              },
              "required": [
                "hx",
                "hy"
              ],
              "type": "object"
            }
          },
          "required": [
            "ellipse"
          ],
          "type": "object"
        },
        {
          "additionalProperties": false,
          "description": "円形遮蔽（最小〜最大半径の間を遮る）",
          "properties": {
            "obscuration": {
              "additionalProperties": false,
              "properties": {
                "dx": {
                  "format": "double",
                  "type": "number"
                },
                "dy": {
                  "format": "double",
                  "type": "number"
                },
                "max": {
                  "format": "double",
                  "type": "number"
                },
                "min": {
                  "format": "double",
                  "type": "number"
                }
              },
              "required": [
                "max"
              ],
              "type": "object"
            }
          },
          "required": [
            "obscuration"
          ],
          "type": "object"
        },
        {
          "additionalProperties": false,
          "description": "スパイダー（幅 width の腕 arms 本）",
          "properties": {
            "spider": {
              "additionalProperties": false,
              "properties": {
                "arms": {
                  "format": "uint32",
                  "minimum": 0,
                  "type": "integer"
                },
                "dx": {
                  "format": "double",
                  "type": "number"
                },
                "dy": {
                  "format": "double",
                  "type": "number"
                },
                "width": {
                  "format": "double",
                  "type": "number"
                }
              },
              "required": [
                "width",
                "arms"
              ],
              "type": "object"
            }
          },
          "required": [
            "spider"
          ],
          "type": "object"
        }
      ]
    },
    "Arm": {
      "description": "経路の既定（文字を指定しないとき）",
      "enum": [
        "t",
        "r"
      ],
      "type": "string"
    },
    "Auto": {
      "enum": [
        "auto"
      ],
      "type": "string"
    },
    "AutoWord": {
      "description": "[`Semi::Auto`] の綴り \"auto\"",
      "enum": [
        "auto"
      ],
      "type": "string"
    },
    "Binary2": {
      "description": "Binary 2 の位相 Φ = order · Σ coef[i] ρ^{2(i+1)}（ρ = r / norm、係数の単位は rad）",
      "properties": {
        "coef": {
          "items": {
            "format": "double",
            "type": "number"
          },
          "type": "array"
        },
        "norm": {
          "description": "正規化半径",
          "format": "double",
          "type": "number"
        },
        "order": {
          "description": "回折次数 M",
          "format": "double",
          "type": "number"
        }
      },
      "required": [
        "order",
        "norm",
        "coef"
      ],
      "type": "object"
    },
    "BireSpec": {
      "description": "複屈折材の板の入口・出口の面。`{\"in\": {\"axis\": [x, y, z]}}` か `\"out\"`",
      "oneOf": [
        {
          "enum": [
            "out"
          ],
          "type": "string"
        },
        {
          "additionalProperties": false,
          "properties": {
            "in": {
              "properties": {
                "axis": {
                  "description": "結晶軸の向き（面の局所座標）",
                  "items": {
                    "format": "double",
                    "type": "number"
                  },
                  "maxItems": 3,
                  "minItems": 3,
                  "type": "array"
                },
                "mode": {
                  "default": 2,
                  "description": "2: 波長板（常光の道で、常光・異常光の両方の位相）、0: 常光の成分だけ、1: 異常光の道で異常光の成分だけ、3: 異常光の道で両方の位相（異常光の道は walk-off して進む）。OpticStudio の Mode",
                  "format": "uint8",
                  "maximum": 255,
                  "minimum": 0,
                  "type": "integer"
                }
              },
              "required": [
                "axis"
              ],
              "type": "object"
            }
          },
          "required": [
            "in"
          ],
          "type": "object"
        }
      ]
    },
    "Block": {
      "oneOf": [
        {
          "description": "ブロックの置き方（ON/OFF、偏心・傾き）",
          "properties": {
            "decenter": {
              "default": [
                0.0,
                0.0
              ],
              "description": "偏心 [mm]",
              "items": {
                "format": "double",
                "type": "number"
              },
              "maxItems": 2,
              "minItems": 2,
              "type": "array"
            },
            "id": {
              "default": "",
              "type": "string"
            },
            "off": {
              "$ref": "#/$defs/OffMode",
              "default": "collapse"
            },
            "on": {
              "default": true,
              "type": "boolean"
            },
            "reversed": {
              "default": false,
              "type": "boolean"
            },
            "source": {
              "$ref": "#/$defs/LensSource"
            },
            "stop": {
              "default": false,
              "description": "玉の前面を絞りにする",
              "type": "boolean"
            },
            "surface_edits": {
              "description": "面の値の上書き",
              "items": {
                "$ref": "#/$defs/SurfaceEdit"
              },
              "type": "array"
            },
            "surface_ops": {
              "description": "面の絞り・ソルブ・ピックアップ。serve の `edit` の `set_stop`・`add_solve`・`add_pickup`・`remove_solve`・\n`remove_pickup` と同じ形で、`surface`・`dst` の番号はこのブロックの面（[`SurfaceEdit`] と同じ数え方）。\n`src`・`other` はほかのブロックの面 `{\"block\": id, \"surface\": i}` か系の面の番号・名前。\n往復するブロックは往路の面を指す",
              "items": {
                "$ref": "#/$defs/SurfaceOp"
              },
              "type": "array"
            },
            "tilt": {
              "default": [
                0.0,
                0.0,
                0.0
              ],
              "description": "傾き x・y・z [deg]（前面の頂点のまわり、x → y → z の順）",
              "items": {
                "format": "double",
                "type": "number"
              },
              "maxItems": 3,
              "minItems": 3,
              "type": "array"
            },
            "type": {
              "const": "lens",
              "type": "string"
            }
          },
          "required": [
            "type",
            "source"
          ],
          "type": "object"
        },
        {
          "properties": {
            "id": {
              "default": "",
              "type": "string"
            },
            "medium": {
              "description": "間隔を満たす媒質（液浸の油・水など、硝材の名前か屈折率の数）。省略は空気。最後の間隔なら像空間の媒質",
              "type": [
                "string",
                "null"
              ]
            },
            "t": {
              "format": "double",
              "type": "number"
            },
            "type": {
              "const": "air",
              "type": "string"
            }
          },
          "required": [
            "type",
            "t"
          ],
          "type": "object"
        },
        {
          "description": "絞り（空気中のダミー面）",
          "properties": {
            "id": {
              "default": "",
              "type": "string"
            },
            "semi": {
              "default": 0.0,
              "format": "double",
              "type": "number"
            },
            "surface_edits": {
              "description": "面の値の上書き",
              "items": {
                "$ref": "#/$defs/SurfaceEdit"
              },
              "type": "array"
            },
            "surface_ops": {
              "description": "面の絞り・ソルブ・ピックアップ。serve の `edit` の `set_stop`・`add_solve`・`add_pickup`・`remove_solve`・\n`remove_pickup` と同じ形で、`surface`・`dst` の番号はこのブロックの面（[`SurfaceEdit`] と同じ数え方）。\n`src`・`other` はほかのブロックの面 `{\"block\": id, \"surface\": i}` か系の面の番号・名前。\n往復するブロックは往路の面を指す",
              "items": {
                "$ref": "#/$defs/SurfaceOp"
              },
              "type": "array"
            },
            "type": {
              "const": "stop",
              "type": "string"
            }
          },
          "required": [
            "type"
          ],
          "type": "object"
        },
        {
          "description": "ブロックの面の上書き・絞り・ソルブ・ピックアップ（GUI の面の表で変えたもの）。ブロックと .zmx の取り込みの群が持ち、\n展開の最後に当てる（上書きの後に操作）。状態で外したブロックのものは当てない",
          "properties": {
            "aperture": {
              "anyOf": [
                {
                  "$ref": "#/$defs/SurfAperture"
                },
                {
                  "type": "null"
                }
              ],
              "description": "鏡の開口（省略なら半径 semi の円。四角い鏡は rect）"
            },
            "back": {
              "default": false,
              "description": "往路を戻る: 同じ並び（群）で鏡より前のブロックを、逆の順・逆の向きにたどる",
              "type": "boolean"
            },
            "coat": {
              "default": "",
              "type": "string"
            },
            "conic": {
              "default": 0.0,
              "format": "double",
              "type": "number"
            },
            "id": {
              "default": "",
              "type": "string"
            },
            "on": {
              "default": true,
              "type": "boolean"
            },
            "radius": {
              "default": null,
              "description": "曲率半径（省略・0 なら平面）",
              "format": "double",
              "type": [
                "number",
                "null"
              ]
            },
            "row": {
              "anyOf": [
                {
                  "$ref": "#/$defs/Row"
                },
                {
                  "type": "null"
                }
              ],
              "description": "radius・conic で書けない鏡（Zernike・Grid Sag など）を、システムファイル（版 2）の面の行で書く。\n働きは鏡（reflect、または mirror の付く働き）。書くときは radius・conic・semi・aperture・coat を書かない\n（行に書く）。厚さ・媒質・絞りの印は書かない（間隔は後の空気、絞りはブロックの set_stop で）"
            },
            "semi": {
              "default": 0.0,
              "format": "double",
              "type": "number"
            },
            "surface_edits": {
              "description": "面の値の上書き",
              "items": {
                "$ref": "#/$defs/SurfaceEdit"
              },
              "type": "array"
            },
            "surface_ops": {
              "description": "面の絞り・ソルブ・ピックアップ。serve の `edit` の `set_stop`・`add_solve`・`add_pickup`・`remove_solve`・\n`remove_pickup` と同じ形で、`surface`・`dst` の番号はこのブロックの面（[`SurfaceEdit`] と同じ数え方）。\n`src`・`other` はほかのブロックの面 `{\"block\": id, \"surface\": i}` か系の面の番号・名前。\n往復するブロックは往路の面を指す",
              "items": {
                "$ref": "#/$defs/SurfaceOp"
              },
              "type": "array"
            },
            "tilt": {
              "default": [
                0.0,
                0.0
              ],
              "description": "傾き x・y [deg]。折り曲げでは鏡の前後で同じ角だけ傾ける（光軸が折れる。後ろは回す順を逆にして、2 軸でも後の軸が反射した光軸に乗る）。\n`back`（往路を戻る）では鏡だけを傾け、座標は元の軸に戻す（復路の光線が傾きの 2 倍の角で戻る）",
              "items": {
                "format": "double",
                "type": "number"
              },
              "maxItems": 2,
              "minItems": 2,
              "type": "array"
            },
            "type": {
              "const": "mirror",
              "type": "string"
            }
          },
          "required": [
            "type"
          ],
          "type": "object"
        },
        {
          "description": "空気中の面の並び（玉に分けない）",
          "properties": {
            "decenter": {
              "default": [
                0.0,
                0.0
              ],
              "description": "偏心 [mm]",
              "items": {
                "format": "double",
                "type": "number"
              },
              "maxItems": 2,
              "minItems": 2,
              "type": "array"
            },
            "id": {
              "default": "",
              "type": "string"
            },
            "off": {
              "$ref": "#/$defs/OffMode",
              "default": "collapse"
            },
            "on": {
              "default": true,
              "type": "boolean"
            },
            "surface_edits": {
              "description": "面の値の上書き",
              "items": {
                "$ref": "#/$defs/SurfaceEdit"
              },
              "type": "array"
            },
            "surface_ops": {
              "description": "面の絞り・ソルブ・ピックアップ。serve の `edit` の `set_stop`・`add_solve`・`add_pickup`・`remove_solve`・\n`remove_pickup` と同じ形で、`surface`・`dst` の番号はこのブロックの面（[`SurfaceEdit`] と同じ数え方）。\n`src`・`other` はほかのブロックの面 `{\"block\": id, \"surface\": i}` か系の面の番号・名前。\n往復するブロックは往路の面を指す",
              "items": {
                "$ref": "#/$defs/SurfaceOp"
              },
              "type": "array"
            },
            "surfaces": {
              "items": {
                "$ref": "#/$defs/SurfSpec"
              },
              "type": "array"
            },
            "tilt": {
              "default": [
                0.0,
                0.0,
                0.0
              ],
              "description": "傾き x・y・z [deg]（前面の頂点のまわり、x → y → z の順）",
              "items": {
                "format": "double",
                "type": "number"
              },
              "maxItems": 3,
              "minItems": 3,
              "type": "array"
            },
            "type": {
              "const": "surfaces",
              "type": "string"
            }
          },
          "required": [
            "type",
            "surfaces"
          ],
          "type": "object"
        },
        {
          "description": ".zmx から取り込んだ系（面 from〜to、既定は面 1 から像面の手前まで。空気間隔も含む）。`path` は lensbench の系\n（系ファイル・プロジェクトの .json、構成は 1 だけ）でもよい",
          "properties": {
            "beam_path": {
              "description": "取り込むプロジェクト（.json）の BS の経路（T・R の文字列。省略なら状態・プロジェクトの path）",
              "type": [
                "string",
                "null"
              ]
            },
            "config": {
              "default": 1,
              "description": ".zmx のマルチコンフィグの番号（1 始まり）",
              "format": "uint",
              "minimum": 0,
              "type": "integer"
            },
            "decenter": {
              "default": [
                0.0,
                0.0
              ],
              "description": "偏心 [mm]",
              "items": {
                "format": "double",
                "type": "number"
              },
              "maxItems": 2,
              "minItems": 2,
              "type": "array"
            },
            "from": {
              "default": null,
              "format": "uint",
              "minimum": 0,
              "type": [
                "integer",
                "null"
              ]
            },
            "groups": {
              "default": [],
              "description": "玉モードの群（.zmx の面の範囲）",
              "items": {
                "$ref": "#/$defs/ZmxGroup"
              },
              "type": "array"
            },
            "id": {
              "default": "",
              "type": "string"
            },
            "off": {
              "$ref": "#/$defs/OffMode",
              "default": "collapse"
            },
            "on": {
              "default": true,
              "type": "boolean"
            },
            "path": {
              "type": "string"
            },
            "state": {
              "description": "取り込むプロジェクト（.json）の状態（省略なら状態の変更なし）",
              "type": [
                "string",
                "null"
              ]
            },
            "stop": {
              "default": true,
              "description": ".zmx の絞りを系の絞りにする（false なら取り込んだ面の絞りを外す。系の絞りはほかのブロックで）",
              "type": "boolean"
            },
            "surface_edits": {
              "description": "面の値の上書き",
              "items": {
                "$ref": "#/$defs/SurfaceEdit"
              },
              "type": "array"
            },
            "surface_ops": {
              "description": "面の絞り・ソルブ・ピックアップ。serve の `edit` の `set_stop`・`add_solve`・`add_pickup`・`remove_solve`・\n`remove_pickup` と同じ形で、`surface`・`dst` の番号はこのブロックの面（[`SurfaceEdit`] と同じ数え方）。\n`src`・`other` はほかのブロックの面 `{\"block\": id, \"surface\": i}` か系の面の番号・名前。\n往復するブロックは往路の面を指す",
              "items": {
                "$ref": "#/$defs/SurfaceOp"
              },
              "type": "array"
            },
            "tilt": {
              "default": [
                0.0,
                0.0,
                0.0
              ],
              "description": "傾き x・y・z [deg]（前面の頂点のまわり、x → y → z の順）",
              "items": {
                "format": "double",
                "type": "number"
              },
              "maxItems": 3,
              "minItems": 3,
              "type": "array"
            },
            "to": {
              "default": null,
              "format": "uint",
              "minimum": 0,
              "type": [
                "integer",
                "null"
              ]
            },
            "type": {
              "const": "zmx",
              "type": "string"
            }
          },
          "required": [
            "type",
            "path"
          ],
          "type": "object"
        },
        {
          "description": "ユーザーカタログの項目（群と同じに入れる）",
          "properties": {
            "catalog": {
              "description": "ユーザーカタログのファイル（プロジェクトのフォルダから）",
              "type": "string"
            },
            "decenter": {
              "default": [
                0.0,
                0.0
              ],
              "description": "偏心 [mm]",
              "items": {
                "format": "double",
                "type": "number"
              },
              "maxItems": 2,
              "minItems": 2,
              "type": "array"
            },
            "id": {
              "default": "",
              "type": "string"
            },
            "item": {
              "type": "string"
            },
            "off": {
              "$ref": "#/$defs/OffMode",
              "default": "collapse"
            },
            "on": {
              "default": true,
              "type": "boolean"
            },
            "surface_edits": {
              "description": "面の値の上書き",
              "items": {
                "$ref": "#/$defs/SurfaceEdit"
              },
              "type": "array"
            },
            "surface_ops": {
              "description": "面の絞り・ソルブ・ピックアップ。serve の `edit` の `set_stop`・`add_solve`・`add_pickup`・`remove_solve`・\n`remove_pickup` と同じ形で、`surface`・`dst` の番号はこのブロックの面（[`SurfaceEdit`] と同じ数え方）。\n`src`・`other` はほかのブロックの面 `{\"block\": id, \"surface\": i}` か系の面の番号・名前。\n往復するブロックは往路の面を指す",
              "items": {
                "$ref": "#/$defs/SurfaceOp"
              },
              "type": "array"
            },
            "tilt": {
              "default": [
                0.0,
                0.0,
                0.0
              ],
              "description": "傾き x・y・z [deg]（前面の頂点のまわり、x → y → z の順）",
              "items": {
                "format": "double",
                "type": "number"
              },
              "maxItems": 3,
              "minItems": 3,
              "type": "array"
            },
            "type": {
              "const": "user",
              "type": "string"
            }
          },
          "required": [
            "type",
            "catalog",
            "item"
          ],
          "type": "object"
        },
        {
          "description": "ビームスプリッター（[`SplitterSpec`]）。id が要る",
          "properties": {
            "angle": {
              "default": [
                45.0,
                0.0
              ],
              "description": "分ける面の傾き x・y [deg]（鏡の tilt と同じ約束）。キューブは ±45 の一方だけ",
              "items": {
                "format": "double",
                "type": "number"
              },
              "maxItems": 2,
              "minItems": 2,
              "type": "array"
            },
            "ar": {
              "description": "分ける面以外の面の膜の既定（空なら膜なし）",
              "type": "string"
            },
            "arm": {
              "$ref": "#/$defs/Arm",
              "default": "t",
              "description": "経路の文字がないときに選ぶ口"
            },
            "coat": {
              "description": "分ける面の膜（膜ファイル・LBCM の名前）",
              "type": "string"
            },
            "d": {
              "description": "口 D（B から戻る光の反射）の先のブロック",
              "items": {
                "$ref": "#/$defs/Block"
              },
              "type": "array"
            },
            "decenter": {
              "default": [
                0.0,
                0.0
              ],
              "description": "偏心 [mm]",
              "items": {
                "format": "double",
                "type": "number"
              },
              "maxItems": 2,
              "minItems": 2,
              "type": "array"
            },
            "faces": {
              "additionalProperties": {
                "type": "string"
              },
              "description": "面ごとの膜（キューブは a・b・c・d、平板は front・back。分ける面には付けない）",
              "type": "object"
            },
            "form": {
              "$ref": "#/$defs/SplitForm",
              "default": "cube"
            },
            "glass": {
              "default": "",
              "description": "キューブ・平板の硝材",
              "type": "string"
            },
            "id": {
              "default": "",
              "type": "string"
            },
            "off": {
              "$ref": "#/$defs/OffMode",
              "default": "collapse"
            },
            "on": {
              "default": true,
              "type": "boolean"
            },
            "pbs": {
              "anyOf": [
                {
                  "$ref": "#/$defs/PbsSpec"
                },
                {
                  "type": "null"
                }
              ],
              "description": "理想の偏光ビームスプリッター"
            },
            "r": {
              "description": "口 C（反射）の先のブロック",
              "items": {
                "$ref": "#/$defs/Block"
              },
              "type": "array"
            },
            "ratio": {
              "description": "分岐比（偏光によらない理想膜の強度の透過率）。ratio・coat・pbs のどれもなければ 0.5",
              "format": "double",
              "type": [
                "number",
                "null"
              ]
            },
            "semi": {
              "default": 0.0,
              "description": "平板・理想面の半径 [mm]（0 なら切らない）",
              "format": "double",
              "type": "number"
            },
            "size": {
              "default": 0.0,
              "description": "キューブの一辺 [mm]",
              "format": "double",
              "type": "number"
            },
            "split_face": {
              "$ref": "#/$defs/SplitFace",
              "default": "front",
              "description": "平板で分ける面（front: 表、back: 裏）"
            },
            "t": {
              "description": "口 B（透過）の先のブロック",
              "items": {
                "$ref": "#/$defs/Block"
              },
              "type": "array"
            },
            "thickness": {
              "default": 0.0,
              "description": "平板の中心の厚さ [mm]（表の法線の向き）",
              "format": "double",
              "type": "number"
            },
            "tilt": {
              "default": [
                0.0,
                0.0,
                0.0
              ],
              "description": "傾き x・y・z [deg]（前面の頂点のまわり、x → y → z の順）",
              "items": {
                "format": "double",
                "type": "number"
              },
              "maxItems": 3,
              "minItems": 3,
              "type": "array"
            },
            "type": {
              "const": "splitter",
              "type": "string"
            },
            "wedge": {
              "default": [
                0.0,
                0.0
              ],
              "description": "平板のくさび: 裏面を表面に対して傾ける角 x・y [deg]（裏面の頂点のまわり）",
              "items": {
                "format": "double",
                "type": "number"
              },
              "maxItems": 2,
              "minItems": 2,
              "type": "array"
            }
          },
          "required": [
            "type"
          ],
          "type": "object"
        },
        {
          "description": "ブロックの置き方（ON/OFF、偏心・傾き）",
          "properties": {
            "blocks": {
              "items": {
                "$ref": "#/$defs/Block"
              },
              "type": "array"
            },
            "decenter": {
              "default": [
                0.0,
                0.0
              ],
              "description": "偏心 [mm]",
              "items": {
                "format": "double",
                "type": "number"
              },
              "maxItems": 2,
              "minItems": 2,
              "type": "array"
            },
            "id": {
              "default": "",
              "type": "string"
            },
            "name": {
              "default": "",
              "type": "string"
            },
            "off": {
              "$ref": "#/$defs/OffMode",
              "default": "collapse"
            },
            "on": {
              "default": true,
              "type": "boolean"
            },
            "role": {
              "anyOf": [
                {
                  "$ref": "#/$defs/Role"
                },
                {
                  "type": "null"
                }
              ],
              "default": null
            },
            "shift": {
              "default": 0.0,
              "description": "群の移動 [mm]（光の進む向きが正）。前の間隔に足し、後の間隔から引く",
              "format": "double",
              "type": "number"
            },
            "surface_edits": {
              "description": "面の値の上書き",
              "items": {
                "$ref": "#/$defs/SurfaceEdit"
              },
              "type": "array"
            },
            "surface_ops": {
              "description": "面の絞り・ソルブ・ピックアップ。serve の `edit` の `set_stop`・`add_solve`・`add_pickup`・`remove_solve`・\n`remove_pickup` と同じ形で、`surface`・`dst` の番号はこのブロックの面（[`SurfaceEdit`] と同じ数え方）。\n`src`・`other` はほかのブロックの面 `{\"block\": id, \"surface\": i}` か系の面の番号・名前。\n往復するブロックは往路の面を指す",
              "items": {
                "$ref": "#/$defs/SurfaceOp"
              },
              "type": "array"
            },
            "tilt": {
              "default": [
                0.0,
                0.0,
                0.0
              ],
              "description": "傾き x・y・z [deg]（前面の頂点のまわり、x → y → z の順）",
              "items": {
                "format": "double",
                "type": "number"
              },
              "maxItems": 3,
              "minItems": 3,
              "type": "array"
            },
            "type": {
              "const": "group",
              "type": "string"
            }
          },
          "required": [
            "type",
            "blocks"
          ],
          "type": "object"
        },
        {
          "description": "検出器（登録した種類。最後のブロックだけに置け、面は足さない）。項目は種類ごと",
          "properties": {
            "id": {
              "default": "",
              "type": "string"
            },
            "type": {
              "not": {
                "enum": [
                  "lens",
                  "air",
                  "stop",
                  "mirror",
                  "surfaces",
                  "zmx",
                  "user",
                  "splitter",
                  "group"
                ]
              },
              "type": "string"
            }
          },
          "required": [
            "type"
          ],
          "type": "object"
        }
      ]
    },
    "BlockFace": {
      "additionalProperties": false,
      "description": "プロジェクトのブロックの面",
      "properties": {
        "back": {
          "description": "鏡の `back` で戻る復路の面を指す（surface は往路と同じ番号で、復路では逆の順に通る）",
          "type": "boolean"
        },
        "block": {
          "description": "ブロックの id",
          "type": "string"
        },
        "coordbrk": {
          "description": "座標ブレークの面を指す（surface はブロックの座標ブレークだけを数えた番号）",
          "type": "boolean"
        },
        "pass": {
          "description": "同じ向きに何回目に通る面か（0 始まり。往復を重ねてブロックを 2 回以上通るとき）",
          "format": "uint",
          "minimum": 0,
          "type": "integer"
        },
        "surface": {
          "description": "ブロックの面の番号（0 始まり、座標ブレークを除く。往復するブロックは往路の面）",
          "format": "uint",
          "minimum": 0,
          "type": "integer"
        }
      },
      "required": [
        "block",
        "surface"
      ],
      "type": "object"
    },
    "BlockRef": {
      "anyOf": [
        {
          "$ref": "#/$defs/BlockFace",
          "description": "ブロックの面"
        },
        {
          "$ref": "#/$defs/Ref",
          "description": "展開した系の面"
        }
      ],
      "description": "ブロックの `surface_ops` の面: ブロックの面 `{\"block\": id, \"surface\": i}` か、展開した系の面の番号か名前"
    },
    "BoreSpec": {
      "description": "機構部品の穴（部品の基準面からの z の範囲と内径）",
      "properties": {
        "diameter": {
          "description": "内径・クリア開口 [mm]",
          "format": "double",
          "type": "number"
        },
        "z0": {
          "default": 0.0,
          "format": "double",
          "type": "number"
        },
        "z1": {
          "format": "double",
          "type": "number"
        }
      },
      "required": [
        "z1",
        "diameter"
      ],
      "type": "object"
    },
    "CadLinks": {
      "description": "品の CAD データの公式 URL（メーカーの配布元）。STEP はカタログに入れず、要るときに 1 件だけ取る",
      "properties": {
        "pdf": {
          "description": "図面の PDF",
          "type": "string"
        },
        "step": {
          "description": "STEP（.step・.stp。zip に入ったものも可）",
          "type": "string"
        }
      },
      "type": "object"
    },
    "CoatSpec": {
      "description": "プロジェクト・カタログの `coatings` の 1 つ",
      "oneOf": [
        {
          "description": "表: 行 [入射角 deg, 波長 µm, Rs, Rp, Ts, Tp]",
          "properties": {
            "rows": {
              "items": {
                "items": {
                  "format": "double",
                  "type": "number"
                },
                "maxItems": 6,
                "minItems": 6,
                "type": "array"
              },
              "type": "array"
            },
            "type": {
              "const": "table",
              "type": "string"
            }
          },
          "required": [
            "type",
            "rows"
          ],
          "type": "object"
        },
        {
          "description": "波長 [nm] ごとの透過 `t`（と反射 `r`、省略は 0）。角度・偏光によらない",
          "properties": {
            "r": {
              "items": {
                "format": "double",
                "type": "number"
              },
              "type": "array"
            },
            "t": {
              "items": {
                "format": "double",
                "type": "number"
              },
              "type": "array"
            },
            "type": {
              "const": "curve",
              "type": "string"
            },
            "wavelengths_nm": {
              "items": {
                "format": "double",
                "type": "number"
              },
              "type": "array"
            }
          },
          "required": [
            "type",
            "wavelengths_nm",
            "t"
          ],
          "type": "object"
        },
        {
          "description": "エッジ `edge_nm`（透過 50 %）より長い波長を通す",
          "properties": {
            "absorptive": {
              "default": false,
              "description": "反射を 0 にする（吸収型）。省略は反射 = 1 − 透過（干渉型・ダイクロイック）",
              "type": "boolean"
            },
            "edge_nm": {
              "format": "double",
              "type": "number"
            },
            "neff": {
              "default": 2.0,
              "description": "斜め入射でのエッジのずれの実効屈折率",
              "format": "double",
              "type": "number"
            },
            "od": {
              "default": 4.0,
              "description": "帯域外（阻止域）の光学濃度（T = 10^−od）",
              "format": "double",
              "type": "number"
            },
            "t": {
              "default": 0.95,
              "description": "帯域内の透過率（0〜1）",
              "format": "double",
              "type": "number"
            },
            "type": {
              "const": "longpass",
              "type": "string"
            },
            "width_nm": {
              "description": "エッジの幅 [nm]（透過が 10 % から 90 % まで。省略は 1 % のエッジ波長、帯域フィルタは FWHM の 10 %）",
              "format": "double",
              "type": [
                "number",
                "null"
              ]
            }
          },
          "required": [
            "type",
            "edge_nm"
          ],
          "type": "object"
        },
        {
          "description": "エッジより短い波長を通す",
          "properties": {
            "absorptive": {
              "default": false,
              "description": "反射を 0 にする（吸収型）。省略は反射 = 1 − 透過（干渉型・ダイクロイック）",
              "type": "boolean"
            },
            "edge_nm": {
              "format": "double",
              "type": "number"
            },
            "neff": {
              "default": 2.0,
              "description": "斜め入射でのエッジのずれの実効屈折率",
              "format": "double",
              "type": "number"
            },
            "od": {
              "default": 4.0,
              "description": "帯域外（阻止域）の光学濃度（T = 10^−od）",
              "format": "double",
              "type": "number"
            },
            "t": {
              "default": 0.95,
              "description": "帯域内の透過率（0〜1）",
              "format": "double",
              "type": "number"
            },
            "type": {
              "const": "shortpass",
              "type": "string"
            },
            "width_nm": {
              "description": "エッジの幅 [nm]（透過が 10 % から 90 % まで。省略は 1 % のエッジ波長、帯域フィルタは FWHM の 10 %）",
              "format": "double",
              "type": [
                "number",
                "null"
              ]
            }
          },
          "required": [
            "type",
            "edge_nm"
          ],
          "type": "object"
        },
        {
          "description": "中心 `center_nm`・半値全幅 `fwhm_nm` を通す",
          "properties": {
            "absorptive": {
              "default": false,
              "description": "反射を 0 にする（吸収型）。省略は反射 = 1 − 透過（干渉型・ダイクロイック）",
              "type": "boolean"
            },
            "center_nm": {
              "format": "double",
              "type": "number"
            },
            "fwhm_nm": {
              "format": "double",
              "type": "number"
            },
            "neff": {
              "default": 2.0,
              "description": "斜め入射でのエッジのずれの実効屈折率",
              "format": "double",
              "type": "number"
            },
            "od": {
              "default": 4.0,
              "description": "帯域外（阻止域）の光学濃度（T = 10^−od）",
              "format": "double",
              "type": "number"
            },
            "t": {
              "default": 0.95,
              "description": "帯域内の透過率（0〜1）",
              "format": "double",
              "type": "number"
            },
            "type": {
              "const": "bandpass",
              "type": "string"
            },
            "width_nm": {
              "description": "エッジの幅 [nm]（透過が 10 % から 90 % まで。省略は 1 % のエッジ波長、帯域フィルタは FWHM の 10 %）",
              "format": "double",
              "type": [
                "number",
                "null"
              ]
            }
          },
          "required": [
            "type",
            "center_nm",
            "fwhm_nm"
          ],
          "type": "object"
        },
        {
          "description": "中心・幅の帯域を od で止める（帯域外は t）",
          "properties": {
            "absorptive": {
              "default": false,
              "description": "反射を 0 にする（吸収型）。省略は反射 = 1 − 透過（干渉型・ダイクロイック）",
              "type": "boolean"
            },
            "center_nm": {
              "format": "double",
              "type": "number"
            },
            "fwhm_nm": {
              "format": "double",
              "type": "number"
            },
            "neff": {
              "default": 2.0,
              "description": "斜め入射でのエッジのずれの実効屈折率",
              "format": "double",
              "type": "number"
            },
            "od": {
              "default": 4.0,
              "description": "帯域外（阻止域）の光学濃度（T = 10^−od）",
              "format": "double",
              "type": "number"
            },
            "t": {
              "default": 0.95,
              "description": "帯域内の透過率（0〜1）",
              "format": "double",
              "type": "number"
            },
            "type": {
              "const": "notch",
              "type": "string"
            },
            "width_nm": {
              "description": "エッジの幅 [nm]（透過が 10 % から 90 % まで。省略は 1 % のエッジ波長、帯域フィルタは FWHM の 10 %）",
              "format": "double",
              "type": [
                "number",
                "null"
              ]
            }
          },
          "required": [
            "type",
            "center_nm",
            "fwhm_nm"
          ],
          "type": "object"
        },
        {
          "description": "波長によらない ND（T = 10^−od）",
          "properties": {
            "absorptive": {
              "default": false,
              "type": "boolean"
            },
            "od": {
              "format": "double",
              "type": "number"
            },
            "type": {
              "const": "nd",
              "type": "string"
            }
          },
          "required": [
            "type",
            "od"
          ],
          "type": "object"
        }
      ]
    },
    "CylFresnel": {
      "description": "Cylinder Fresnel の屈折に使う面: z = c y² / (1 + √(1 − (1 + k) c² y²)) + Σ coef[i] y^{2(i+1)}",
      "properties": {
        "c": {
          "format": "double",
          "type": "number"
        },
        "coef": {
          "items": {
            "format": "double",
            "type": "number"
          },
          "type": "array"
        },
        "k": {
          "format": "double",
          "type": "number"
        }
      },
      "required": [
        "c",
        "k",
        "coef"
      ],
      "type": "object"
    },
    "Grad9Mat": {
      "description": "Gradient 9 の材料（GRADIENT_9.DAT の組）",
      "properties": {
        "b": {
          "format": "double",
          "type": "number"
        },
        "c": {
          "format": "double",
          "type": "number"
        },
        "k0": {
          "format": "double",
          "type": "number"
        },
        "k1": {
          "format": "double",
          "type": "number"
        },
        "k2": {
          "format": "double",
          "type": "number"
        }
      },
      "required": [
        "b",
        "c",
        "k0",
        "k1",
        "k2"
      ],
      "type": "object"
    },
    "GradiumProfile": {
      "description": "Gradium の分布（PROFILE.GRD の組）",
      "properties": {
        "coef": {
          "description": "n_0 … n_11",
          "items": {
            "format": "double",
            "type": "number"
          },
          "type": "array"
        },
        "family": {
          "description": "分散の名前（SGRIN.DAT の組）",
          "type": "string"
        },
        "file": {
          "description": "読んだファイルの名前（PROFILE.GRD など。.zmx の COFN に書く）",
          "type": "string"
        },
        "flipped": {
          "description": "分布を z について裏返した（鏡の後に置いた）もの。係数はファイルの組と違うので .zmx には書けない",
          "type": "boolean"
        },
        "name": {
          "type": "string"
        },
        "zmax": {
          "description": "玉の素材の厚さ z_max",
          "format": "double",
          "type": "number"
        }
      },
      "required": [
        "name",
        "family",
        "zmax",
        "coef",
        "file"
      ],
      "type": "object"
    },
    "GridSag": {
      "description": "Grid Sag の格子",
      "properties": {
        "dx": {
          "description": "格子の間隔 [mm]",
          "format": "double",
          "type": "number"
        },
        "dy": {
          "format": "double",
          "type": "number"
        },
        "linear": {
          "description": "双一次で補間する（false は双三次）。双一次では傾きも格子点の傾きの双一次補間",
          "type": "boolean"
        },
        "nodata": {
          "description": "値のない点",
          "items": {
            "type": "boolean"
          },
          "type": "array"
        },
        "nx": {
          "format": "uint",
          "minimum": 0,
          "type": "integer"
        },
        "ny": {
          "format": "uint",
          "minimum": 0,
          "type": "integer"
        },
        "xdec": {
          "description": "格子の中心の偏心 [mm]",
          "format": "double",
          "type": "number"
        },
        "ydec": {
          "format": "double",
          "type": "number"
        },
        "z": {
          "description": "点ごとの (z, ∂z/∂x, ∂z/∂y, ∂²z/∂x∂y)。並びは y の小さい行から、行の中は x の小さい点から\n（iy * nx + ix）。単位は mm",
          "items": {
            "items": {
              "format": "double",
              "type": "number"
            },
            "maxItems": 4,
            "minItems": 4,
            "type": "array"
          },
          "type": "array"
        }
      },
      "required": [
        "nx",
        "ny",
        "dx",
        "dy",
        "xdec",
        "ydec",
        "z",
        "nodata",
        "linear"
      ],
      "type": "object"
    },
    "Grin": {
      "additionalProperties": false,
      "description": "屈折率分布の媒質",
      "properties": {
        "dt": {
          "description": "OpticStudio の刻み Δt",
          "format": "double",
          "type": "number"
        },
        "name": {
          "description": "材料の名前",
          "type": "string"
        },
        "profile": {
          "$ref": "#/$defs/GrinKind"
        }
      },
      "required": [
        "profile"
      ],
      "type": "object"
    },
    "GrinKind": {
      "oneOf": [
        {
          "additionalProperties": false,
          "properties": {
            "Gradium": {
              "properties": {
                "cap": {
                  "description": "端の扱い: 0 両端で止める、1 左（z′ + Δz < 0）だけ止める、2 右だけ止める、3 止めない\n（止めない側は端の屈折率の一様な媒質）",
                  "format": "uint8",
                  "maximum": 255,
                  "minimum": 0,
                  "type": "integer"
                },
                "dec": {
                  "description": "公差の項 d_x d_y t_x t_y（近軸では使わない）",
                  "items": {
                    "format": "double",
                    "type": "number"
                  },
                  "maxItems": 4,
                  "minItems": 4,
                  "type": "array"
                },
                "disp": {
                  "$ref": "#/$defs/Sgrin"
                },
                "dz": {
                  "description": "分布の上の位置のずれ Δz",
                  "format": "double",
                  "type": "number"
                },
                "prof": {
                  "$ref": "#/$defs/GradiumProfile"
                }
              },
              "required": [
                "prof",
                "disp",
                "dz",
                "dec",
                "cap"
              ],
              "type": "object"
            }
          },
          "required": [
            "Gradium"
          ],
          "type": "object"
        },
        {
          "additionalProperties": false,
          "properties": {
            "Grad9": {
              "properties": {
                "mat": {
                  "$ref": "#/$defs/Grad9Mat"
                },
                "tan": {
                  "description": "形の傾きの項 tan α、tan β",
                  "items": {
                    "format": "double",
                    "type": "number"
                  },
                  "maxItems": 2,
                  "minItems": 2,
                  "type": "array"
                }
              },
              "required": [
                "mat",
                "tan"
              ],
              "type": "object"
            }
          },
          "required": [
            "Grad9"
          ],
          "type": "object"
        }
      ]
    },
    "HoldSpec": {
      "description": "保持する素子",
      "properties": {
        "diameter": {
          "description": "保持する素子の径 [mm]（`max_diameter` があれば入る径の下限）",
          "format": "double",
          "type": "number"
        },
        "max_diameter": {
          "description": "入る径の上限 [mm]。上下から挟むホルダー（バー型・ジョー型）のように径を選ばない部品は `diameter`〜これの\n素子を挟む（素子の縁にだけ当たり、穴で切らない）。0 は径の決まった部品",
          "format": "double",
          "type": "number"
        },
        "seat_z": {
          "default": 0.0,
          "description": "素子の前面を当てる座の z [mm]",
          "format": "double",
          "type": "number"
        }
      },
      "required": [
        "diameter"
      ],
      "type": "object"
    },
    "ItemKind": {
      "description": "品の種類（一覧での分類。ブロックの種類とは別: ウィンドウ・偏光子も今は玉・面の並びのブロックで書ける）",
      "oneOf": [
        {
          "enum": [
            "lens",
            "mirror",
            "splitter",
            "polarizer",
            "waveplate",
            "window",
            "filter",
            "prism",
            "other"
          ],
          "type": "string"
        },
        {
          "const": "tube",
          "description": "レンズチューブ（機構）",
          "type": "string"
        },
        {
          "const": "cage_plate",
          "description": "ケージ板",
          "type": "string"
        },
        {
          "const": "mount",
          "description": "マウント（素子の保持）",
          "type": "string"
        },
        {
          "const": "rod",
          "description": "ケージのロッド",
          "type": "string"
        },
        {
          "const": "adapter",
          "description": "アダプタ・スペーサ・止め輪など",
          "type": "string"
        }
      ]
    },
    "LensSource": {
      "anyOf": [
        {
          "description": ".zmx の k 番目の玉（玉だけを数える、1 始まり）。lensbench の系の .json でもよい",
          "properties": {
            "config": {
              "default": 1,
              "description": ".zmx のマルチコンフィグの番号（1 始まり）",
              "format": "uint",
              "minimum": 0,
              "type": "integer"
            },
            "lens": {
              "default": 1,
              "format": "uint",
              "minimum": 0,
              "type": "integer"
            },
            "zmx": {
              "type": "string"
            }
          },
          "required": [
            "zmx"
          ],
          "type": "object"
        },
        {
          "description": "レンズカタログ（メーカーと型番）",
          "properties": {
            "part": {
              "type": "string"
            },
            "vendor": {
              "type": "string"
            }
          },
          "required": [
            "vendor",
            "part"
          ],
          "type": "object"
        },
        {
          "description": "面を直接",
          "properties": {
            "surfaces": {
              "items": {
                "$ref": "#/$defs/SurfSpec"
              },
              "type": "array"
            }
          },
          "required": [
            "surfaces"
          ],
          "type": "object"
        }
      ],
      "description": "玉の出どころ"
    },
    "MechOutline": {
      "description": "機構部品の簡易外形の形",
      "oneOf": [
        {
          "const": "round",
          "description": "丸（円柱）",
          "type": "string"
        },
        {
          "const": "square",
          "description": "角（正方形の柱、辺は部品の局所の x・y 軸に沿う）",
          "type": "string"
        }
      ]
    },
    "MechSpec": {
      "description": "機構部品の寸法。z は部品の基準面（チューブの入口の端など）から光の進む向き",
      "properties": {
        "back_thread": {
          "anyOf": [
            {
              "$ref": "#/$defs/ThreadEnd"
            },
            {
              "type": "null"
            }
          ],
          "description": "z の大きい端のねじ"
        },
        "bores": {
          "default": [],
          "description": "光の通る穴（チューブの内径、ケージ板・マウントのクリア開口）",
          "items": {
            "$ref": "#/$defs/BoreSpec"
          },
          "type": "array"
        },
        "front_thread": {
          "anyOf": [
            {
              "$ref": "#/$defs/ThreadEnd"
            },
            {
              "type": "null"
            }
          ],
          "description": "z 0 の端（光の入る側）のねじ。機構部品をつなぐ（[`MechPlacement::after`]）とき、合うかを確かめる"
        },
        "holds": {
          "anyOf": [
            {
              "$ref": "#/$defs/HoldSpec"
            },
            {
              "type": "null"
            }
          ],
          "description": "保持する素子の径 [mm] と座の z [mm]（マウント・チューブ）"
        },
        "length": {
          "default": 0.0,
          "description": "長さ [mm]（外形の z の範囲 0〜length。0 なら穴の範囲）",
          "format": "double",
          "type": "number"
        },
        "outer_diameter": {
          "default": 0.0,
          "description": "外径 [mm]（ケージ板は外形の一辺）",
          "format": "double",
          "type": "number"
        },
        "outline": {
          "$ref": "#/$defs/MechOutline",
          "description": "外形の形: 丸（既定、`outer_diameter` は外径）か角（`outer_diameter` は正方形の一辺。ケージ板など）。\n配置図・3D・書き出しはこの簡易外形で描く"
        },
        "rod_spacing": {
          "description": "ケージのロッドの間隔 [mm]",
          "format": "double",
          "type": "number"
        },
        "thread": {
          "description": "ねじ（\"SM1\" など）",
          "type": "string"
        }
      },
      "type": "object"
    },
    "Medium": {
      "anyOf": [
        {
          "description": "ガラスの名前（カタログから引く。\"AIR\" は空気）",
          "type": "string"
        },
        {
          "$ref": "#/$defs/MediumData",
          "description": "モデルガラス・GRIN"
        }
      ],
      "description": "面の後の媒質"
    },
    "MediumData": {
      "oneOf": [
        {
          "additionalProperties": false,
          "description": "モデルガラス（nd・vd・ΔPgF）。vd = 0 は分散なし（屈折率 nd）",
          "properties": {
            "model": {
              "additionalProperties": false,
              "properties": {
                "dpgf": {
                  "format": "double",
                  "type": "number"
                },
                "nd": {
                  "format": "double",
                  "type": "number"
                },
                "vd": {
                  "format": "double",
                  "type": "number"
                }
              },
              "required": [
                "nd"
              ],
              "type": "object"
            }
          },
          "required": [
            "model"
          ],
          "type": "object"
        },
        {
          "additionalProperties": false,
          "description": "屈折率分布（Gradium・Gradient 9）",
          "properties": {
            "grin": {
              "$ref": "#/$defs/Grin"
            }
          },
          "required": [
            "grin"
          ],
          "type": "object"
        }
      ]
    },
    "Num": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "additionalProperties": false,
          "properties": {
            "$f": {
              "enum": [
                "inf",
                "-inf",
                "nan"
              ]
            }
          },
          "required": [
            "$f"
          ],
          "type": "object"
        }
      ],
      "description": "数。JSON に書けない数は {\"$f\": \"inf\"}（-inf・nan も）"
    },
    "OffMode": {
      "oneOf": [
        {
          "const": "collapse",
          "description": "長さごと除く",
          "type": "string"
        },
        {
          "const": "air",
          "description": "同じ長さの空気で残す",
          "type": "string"
        }
      ]
    },
    "Overlay": {
      "description": "ほかのカタログの品へ足す仕様・リンク（`overlay` の値）",
      "properties": {
        "description": {
          "description": "品の説明が空のときに使う",
          "type": "string"
        },
        "kind": {
          "anyOf": [
            {
              "$ref": "#/$defs/ItemKind"
            },
            {
              "type": "null"
            }
          ]
        },
        "specs": {
          "additionalProperties": true,
          "type": "object"
        },
        "tags": {
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "url": {
          "type": "string"
        }
      },
      "type": "object"
    },
    "PbsSpec": {
      "description": "理想の偏光ビームスプリッター（強度の透過率。反射は 1 − T）",
      "properties": {
        "tp": {
          "default": 1.0,
          "format": "double",
          "type": "number"
        },
        "ts": {
          "default": 0.0,
          "format": "double",
          "type": "number"
        }
      },
      "type": "object"
    },
    "Plate": {
      "additionalProperties": false,
      "description": "波長板の複屈折材の板",
      "properties": {
        "axis_deg": {
          "format": "double",
          "type": "number"
        },
        "material": {
          "type": "string"
        },
        "thickness": {
          "description": "厚さ [mm]",
          "format": "double",
          "type": "number"
        }
      },
      "required": [
        "material",
        "thickness",
        "axis_deg"
      ],
      "type": "object"
    },
    "PlateSpec": {
      "description": "波長板の複屈折材の板 1 枚",
      "properties": {
        "axis_deg": {
          "default": 0.0,
          "description": "速い軸の向き [deg]（波長板の `axis_deg` から）",
          "format": "double",
          "type": "number"
        },
        "material": {
          "description": "複屈折材（常光はガラス material、異常光は material-E）",
          "type": "string"
        },
        "thickness_mm": {
          "description": "厚さ [mm]",
          "format": "double",
          "type": "number"
        }
      },
      "required": [
        "material",
        "thickness_mm"
      ],
      "type": "object"
    },
    "PolarizerSpec": {
      "description": "直線偏光子（理想）: 透過軸の向きの強度透過率 `transmittance`、直交する向きは `transmittance / extinction_ratio`",
      "properties": {
        "axis_deg": {
          "default": 0.0,
          "description": "透過軸の向き [deg]（x から y へ）",
          "format": "double",
          "type": "number"
        },
        "extinction_ratio": {
          "description": "消光比（1000 は 1000:1。省略は無限 = 直交の向きを通さない）",
          "format": "double",
          "type": "number"
        },
        "transmittance": {
          "default": 1.0,
          "description": "透過軸の向きの強度透過率",
          "format": "double",
          "type": "number"
        }
      },
      "type": "object"
    },
    "Ref": {
      "anyOf": [
        {
          "description": "番号",
          "format": "uint",
          "minimum": 0,
          "type": "integer"
        },
        {
          "description": "名前",
          "type": "string"
        }
      ],
      "description": "番号か名前。面は OpticStudio の面番号か面のコメント、玉・群と機構部品は 0 始まりの番号か名前"
    },
    "Retarder": {
      "additionalProperties": false,
      "description": "偏光子・波長板（Jones の面）",
      "properties": {
        "axis_deg": {
          "format": "double",
          "type": "number"
        },
        "order": {
          "default": 0,
          "format": "uint32",
          "minimum": 0,
          "type": "integer"
        },
        "plates": {
          "description": "複屈折材の板（ガラスは名前で引く）",
          "items": {
            "$ref": "#/$defs/Plate"
          },
          "type": "array"
        },
        "retardance": {
          "description": "設計波長での遅延 [波長]",
          "format": "double",
          "type": "number"
        },
        "tx": {
          "format": "double",
          "type": "number"
        },
        "ty": {
          "format": "double",
          "type": "number"
        },
        "wl0": {
          "description": "設計波長 [µm]",
          "format": "double",
          "type": "number"
        }
      },
      "required": [
        "axis_deg",
        "tx",
        "ty",
        "retardance",
        "wl0"
      ],
      "type": "object"
    },
    "Reverse": {
      "enum": [
        "reverse"
      ],
      "type": "string"
    },
    "Role": {
      "description": "群の役割",
      "enum": [
        "zoom",
        "focus",
        "fixed"
      ],
      "type": "string"
    },
    "Row": {
      "additionalProperties": false,
      "description": "面の列の 1 行（面とその後の間隔）",
      "properties": {
        "action": {
          "anyOf": [
            {
              "$ref": "#/$defs/Action"
            },
            {
              "type": "null"
            }
          ],
          "description": "面の働き（省略は屈折）"
        },
        "after": {
          "anyOf": [
            {
              "$ref": "#/$defs/After"
            },
            {
              "type": "null"
            }
          ],
          "description": "面の後の傾き・偏心（\"reverse\" は前の変換を戻す）"
        },
        "aperture": {
          "anyOf": [
            {
              "$ref": "#/$defs/Aperture"
            },
            {
              "type": "null"
            }
          ],
          "description": "面の開口（省略は開口なし）"
        },
        "before": {
          "anyOf": [
            {
              "$ref": "#/$defs/Tilt"
            },
            {
              "type": "null"
            }
          ],
          "description": "面の前の傾き・偏心"
        },
        "chip": {
          "description": "チップゾーン [mm]（OpticStudio の Chip Zone）: 面の形をクリア半径からこの幅だけ外へ延ばし、その外を平らにする",
          "format": "double",
          "type": "number"
        },
        "coating": {
          "description": "膜の名前",
          "type": "string"
        },
        "comment": {
          "type": "string"
        },
        "coordinate_break": {
          "anyOf": [
            {
              "$ref": "#/$defs/Tilt"
            },
            {
              "type": "null"
            }
          ],
          "description": "座標ブレーク（面でなく座標系だけを変える行）"
        },
        "disp": {
          "description": "媒質の分散の相対変化: n = n0(λ) + dn + disp·(n0(λ) − n0(主波長))",
          "format": "double",
          "type": "number"
        },
        "dn": {
          "description": "媒質の屈折率のずれ（全波長に足す）",
          "format": "double",
          "type": "number"
        },
        "dnd": {
          "description": "ガラスの d 線の屈折率のずれ（OpticStudio の TIND）: モデルガラスの式で nd を変えた差を波長ごとに足す",
          "format": "double",
          "type": "number"
        },
        "dvd": {
          "description": "ガラスのアッベ数のずれ（OpticStudio の TABB）: モデルガラスの式で vd を変えた差を波長ごとに足す",
          "format": "double",
          "type": "number"
        },
        "ignore": {
          "description": "無視する",
          "type": "boolean"
        },
        "image": {
          "description": "像面の印（最後の行）",
          "type": "boolean"
        },
        "mech": {
          "description": "固定した機械半径 [mm]（OpticStudio の Mech Semi-Dia。省略は自動: ガラスでつながる面の縁 + チップゾーンの最大。\n自動より小さければ自動のまま）",
          "format": "double",
          "type": [
            "number",
            "null"
          ]
        },
        "medium": {
          "anyOf": [
            {
              "$ref": "#/$defs/Medium"
            },
            {
              "type": "null"
            }
          ],
          "description": "面の後の媒質（省略は空気。鏡・座標ブレークでは前の媒質）"
        },
        "object": {
          "description": "物体面の印（最初の行。読むときは確かめるだけ）",
          "type": "boolean"
        },
        "semi": {
          "anyOf": [
            {
              "$ref": "#/$defs/Semi2"
            },
            {
              "type": "null"
            }
          ],
          "description": "半直径 [mm]。\"auto\" は光線から求める"
        },
        "shape": {
          "anyOf": [
            {
              "$ref": "#/$defs/Shape"
            },
            {
              "type": "null"
            }
          ],
          "description": "面の形（省略は平面の標準面）"
        },
        "stop": {
          "description": "絞り",
          "type": "boolean"
        },
        "t": {
          "description": "次の面までの厚さ [mm]",
          "format": "double",
          "type": "number"
        },
        "tce": {
          "description": "面の熱膨張係数 [1e-6/°C]（OpticStudio のレンズデータの TCE の列。光線追跡には効かない）",
          "format": "double",
          "type": "number"
        }
      },
      "type": "object"
    },
    "Semi": {
      "anyOf": [
        {
          "format": "double",
          "type": "number"
        },
        {
          "$ref": "#/$defs/AutoWord"
        }
      ],
      "description": "面の半直径: 数 [mm] か \"auto\"（全視野・全波長の主光線と瞳の縁の光線から求める）"
    },
    "Semi2": {
      "anyOf": [
        {
          "format": "double",
          "type": "number"
        },
        {
          "$ref": "#/$defs/Auto",
          "description": "\"auto\": 光線から求める"
        }
      ],
      "description": "半直径"
    },
    "Sgrin": {
      "description": "Gradient 5 の分散（SGRIN.DAT の組）",
      "properties": {
        "k": {
          "description": "K_ij（i = 1..3、j = 1..K_MAX）",
          "items": {
            "items": {
              "format": "double",
              "type": "number"
            },
            "type": "array"
          },
          "maxItems": 3,
          "minItems": 3,
          "type": "array"
        },
        "l": {
          "description": "L_ij（i = 1..3、j = 1..L_MAX）",
          "items": {
            "items": {
              "format": "double",
              "type": "number"
            },
            "type": "array"
          },
          "maxItems": 3,
          "minItems": 3,
          "type": "array"
        },
        "lmax": {
          "format": "double",
          "type": "number"
        },
        "lmin": {
          "description": "波長の範囲 [µm]",
          "format": "double",
          "type": "number"
        },
        "lref": {
          "description": "基準波長 [µm]",
          "format": "double",
          "type": "number"
        },
        "name": {
          "type": "string"
        }
      },
      "required": [
        "name",
        "lmin",
        "lmax",
        "lref",
        "k",
        "l"
      ],
      "type": "object"
    },
    "Shape": {
      "description": "面の形（種類ごとの値だけ）。曲率は c [1/mm]",
      "oneOf": [
        {
          "additionalProperties": false,
          "description": "二次曲面（標準面）",
          "properties": {
            "conic": {
              "additionalProperties": false,
              "properties": {
                "c": {
                  "format": "double",
                  "type": "number"
                },
                "k": {
                  "format": "double",
                  "type": "number"
                }
              },
              "type": "object"
            }
          },
          "required": [
            "conic"
          ],
          "type": "object"
        },
        {
          "additionalProperties": false,
          "description": "偶数次非球面: a は r², r⁴, … の係数",
          "properties": {
            "even_asphere": {
              "additionalProperties": false,
              "properties": {
                "a": {
                  "items": {
                    "format": "double",
                    "type": "number"
                  },
                  "type": "array"
                },
                "c": {
                  "format": "double",
                  "type": "number"
                },
                "k": {
                  "format": "double",
                  "type": "number"
                }
              },
              "type": "object"
            }
          },
          "required": [
            "even_asphere"
          ],
          "type": "object"
        },
        {
          "additionalProperties": false,
          "description": "Odd Asphere: b は r¹, r², … の係数",
          "properties": {
            "odd_asphere": {
              "additionalProperties": false,
              "properties": {
                "b": {
                  "items": {
                    "format": "double",
                    "type": "number"
                  },
                  "type": "array"
                },
                "c": {
                  "format": "double",
                  "type": "number"
                },
                "k": {
                  "format": "double",
                  "type": "number"
                }
              },
              "type": "object"
            }
          },
          "required": [
            "odd_asphere"
          ],
          "type": "object"
        },
        {
          "additionalProperties": false,
          "description": "トロイダル面: YZ 面の曲線（c・k・y², y⁴, … の係数 a）を回転の曲率 cx で回した面（cx = 0 は円柱面）",
          "properties": {
            "toroid": {
              "additionalProperties": false,
              "properties": {
                "a": {
                  "items": {
                    "format": "double",
                    "type": "number"
                  },
                  "type": "array"
                },
                "c": {
                  "format": "double",
                  "type": "number"
                },
                "cx": {
                  "format": "double",
                  "type": "number"
                },
                "k": {
                  "format": "double",
                  "type": "number"
                }
              },
              "type": "object"
            }
          },
          "required": [
            "toroid"
          ],
          "type": "object"
        },
        {
          "additionalProperties": false,
          "description": "Zernike Standard Sag",
          "properties": {
            "zernike_standard": {
              "$ref": "#/$defs/ZernikeShape"
            }
          },
          "required": [
            "zernike_standard"
          ],
          "type": "object"
        },
        {
          "additionalProperties": false,
          "description": "Zernike Fringe Sag",
          "properties": {
            "zernike_fringe": {
              "$ref": "#/$defs/ZernikeShape"
            }
          },
          "required": [
            "zernike_fringe"
          ],
          "type": "object"
        },
        {
          "additionalProperties": false,
          "description": "Grid Sag",
          "properties": {
            "grid_sag": {
              "additionalProperties": false,
              "properties": {
                "a": {
                  "items": {
                    "format": "double",
                    "type": "number"
                  },
                  "type": "array"
                },
                "c": {
                  "format": "double",
                  "type": "number"
                },
                "grid": {
                  "anyOf": [
                    {
                      "$ref": "#/$defs/GridSag"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "grid_file": {
                  "description": "格子の .DAT のファイル名（書き出し用）",
                  "type": "string"
                },
                "k": {
                  "format": "double",
                  "type": "number"
                },
                "terms": {
                  "anyOf": [
                    {
                      "$ref": "#/$defs/ZernSag"
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              },
              "type": "object"
            }
          },
          "required": [
            "grid_sag"
          ],
          "type": "object"
        },
        {
          "additionalProperties": false,
          "description": "Tilted: 平面 z = x tan α + y tan β。c・k は交点を求める初めの値にだけ使う（.zmx から読んだ値が残るとき）",
          "properties": {
            "tilted": {
              "additionalProperties": false,
              "properties": {
                "c": {
                  "format": "double",
                  "type": "number"
                },
                "k": {
                  "format": "double",
                  "type": "number"
                },
                "tan": {
                  "items": {
                    "format": "double",
                    "type": "number"
                  },
                  "maxItems": 2,
                  "minItems": 2,
                  "type": "array"
                }
              },
              "type": "object"
            }
          },
          "required": [
            "tilted"
          ],
          "type": "object"
        },
        {
          "additionalProperties": false,
          "description": "Irregular: 偏心・傾けた標準面に Zs ρ⁴ + Za ρ_y² + Zc ρ² ρ_y（ρ は半直径で正規化）",
          "properties": {
            "irregular": {
              "additionalProperties": false,
              "properties": {
                "angle": {
                  "description": "項を回す角度 [deg]",
                  "format": "double",
                  "type": "number"
                },
                "c": {
                  "format": "double",
                  "type": "number"
                },
                "decenter": {
                  "items": {
                    "format": "double",
                    "type": "number"
                  },
                  "maxItems": 2,
                  "minItems": 2,
                  "type": "array"
                },
                "k": {
                  "format": "double",
                  "type": "number"
                },
                "tilt": {
                  "description": "傾き x・y [deg]",
                  "items": {
                    "format": "double",
                    "type": "number"
                  },
                  "maxItems": 2,
                  "minItems": 2,
                  "type": "array"
                },
                "za": {
                  "format": "double",
                  "type": "number"
                },
                "zc": {
                  "format": "double",
                  "type": "number"
                },
                "zs": {
                  "format": "double",
                  "type": "number"
                }
              },
              "type": "object"
            }
          },
          "required": [
            "irregular"
          ],
          "type": "object"
        },
        {
          "additionalProperties": false,
          "description": "y だけの偶数次非球面（Cylinder Fresnel の基板。働きは cylinder_fresnel）",
          "properties": {
            "cylinder": {
              "additionalProperties": false,
              "properties": {
                "a": {
                  "items": {
                    "format": "double",
                    "type": "number"
                  },
                  "type": "array"
                },
                "c": {
                  "format": "double",
                  "type": "number"
                },
                "k": {
                  "format": "double",
                  "type": "number"
                }
              },
              "type": "object"
            }
          },
          "required": [
            "cylinder"
          ],
          "type": "object"
        },
        {
          "additionalProperties": false,
          "description": "利用者定義の形: 二次曲面（c・k）に、登録したモデル model の矢高を足す",
          "properties": {
            "user": {
              "additionalProperties": false,
              "properties": {
                "c": {
                  "format": "double",
                  "type": "number"
                },
                "config": {
                  "additionalProperties": {
                    "$ref": "#/$defs/Value"
                  },
                  "default": {},
                  "type": "object"
                },
                "flip_z": {
                  "description": "z について裏返した（鏡の後・玉の反転。矢高の符号が逆）",
                  "type": "boolean"
                },
                "k": {
                  "format": "double",
                  "type": "number"
                },
                "mirror_x": {
                  "description": "x について映した（玉の反転。x の向きが逆）",
                  "type": "boolean"
                },
                "model": {
                  "description": "モデルの名前（空は未設定）",
                  "type": "string"
                }
              },
              "required": [
                "model"
              ],
              "type": "object"
            }
          },
          "required": [
            "user"
          ],
          "type": "object"
        }
      ]
    },
    "SolveWhat": {
      "description": "ソルブを外す量",
      "oneOf": [
        {
          "const": "t",
          "description": "厚さ（既定）",
          "type": "string"
        },
        {
          "const": "c",
          "description": "曲率",
          "type": "string"
        }
      ]
    },
    "SplitFace": {
      "description": "平板で分ける面",
      "enum": [
        "front",
        "back"
      ],
      "type": "string"
    },
    "SplitForm": {
      "description": "BS の形",
      "oneOf": [
        {
          "const": "cube",
          "description": "キューブ（2 つの直角プリズムを貼り合わせた形、斜面が 45°）",
          "type": "string"
        },
        {
          "const": "plate",
          "description": "平板（表裏の 2 面、くさびも可）",
          "type": "string"
        },
        {
          "const": "ideal",
          "description": "厚さのない理想の面（空気中）",
          "type": "string"
        }
      ]
    },
    "SurfAperture": {
      "description": "面の開口（偏心 dx・dy は省略で 0）",
      "oneOf": [
        {
          "description": "円（最小・最大半径）",
          "properties": {
            "dx": {
              "default": 0.0,
              "format": "double",
              "type": "number"
            },
            "dy": {
              "default": 0.0,
              "format": "double",
              "type": "number"
            },
            "max": {
              "format": "double",
              "type": "number"
            },
            "min": {
              "default": 0.0,
              "format": "double",
              "type": "number"
            },
            "type": {
              "const": "circular",
              "type": "string"
            }
          },
          "required": [
            "type",
            "max"
          ],
          "type": "object"
        },
        {
          "description": "矩形（x・y の半幅）",
          "properties": {
            "dx": {
              "default": 0.0,
              "format": "double",
              "type": "number"
            },
            "dy": {
              "default": 0.0,
              "format": "double",
              "type": "number"
            },
            "hx": {
              "format": "double",
              "type": "number"
            },
            "hy": {
              "format": "double",
              "type": "number"
            },
            "type": {
              "const": "rect",
              "type": "string"
            }
          },
          "required": [
            "type",
            "hx",
            "hy"
          ],
          "type": "object"
        },
        {
          "description": "楕円（x・y の半軸）",
          "properties": {
            "dx": {
              "default": 0.0,
              "format": "double",
              "type": "number"
            },
            "dy": {
              "default": 0.0,
              "format": "double",
              "type": "number"
            },
            "hx": {
              "format": "double",
              "type": "number"
            },
            "hy": {
              "format": "double",
              "type": "number"
            },
            "type": {
              "const": "ellipse",
              "type": "string"
            }
          },
          "required": [
            "type",
            "hx",
            "hy"
          ],
          "type": "object"
        },
        {
          "description": "円形の遮蔽（最小〜最大半径の間を遮る）",
          "properties": {
            "dx": {
              "default": 0.0,
              "format": "double",
              "type": "number"
            },
            "dy": {
              "default": 0.0,
              "format": "double",
              "type": "number"
            },
            "max": {
              "format": "double",
              "type": "number"
            },
            "min": {
              "default": 0.0,
              "format": "double",
              "type": "number"
            },
            "type": {
              "const": "obscuration",
              "type": "string"
            }
          },
          "required": [
            "type",
            "max"
          ],
          "type": "object"
        },
        {
          "description": "スパイダー（中心から外へ伸びる幅 width の腕 arms 本を遮る。最初の腕は +x、360° を等分）",
          "properties": {
            "arms": {
              "format": "uint32",
              "minimum": 0,
              "type": "integer"
            },
            "dx": {
              "default": 0.0,
              "format": "double",
              "type": "number"
            },
            "dy": {
              "default": 0.0,
              "format": "double",
              "type": "number"
            },
            "type": {
              "const": "spider",
              "type": "string"
            },
            "width": {
              "format": "double",
              "type": "number"
            }
          },
          "required": [
            "type",
            "width",
            "arms"
          ],
          "type": "object"
        },
        {
          "description": "半径（semi）で切る",
          "properties": {
            "type": {
              "const": "floating",
              "type": "string"
            }
          },
          "required": [
            "type"
          ],
          "type": "object"
        }
      ]
    },
    "SurfShape": {
      "description": "面の形（[`SurfSpec::shape`]）",
      "oneOf": [
        {
          "const": "standard",
          "description": "標準面・偶数次非球面",
          "type": "string"
        },
        {
          "const": "odd_asph",
          "description": "Odd Asphere",
          "type": "string"
        },
        {
          "const": "toroidal",
          "description": "トロイダル面（円柱面を含む）",
          "type": "string"
        },
        {
          "const": "fresnel",
          "description": "Fresnel（平面の上の屈折）",
          "type": "string"
        }
      ]
    },
    "SurfSpec": {
      "description": "面 1 つ（光の進む向きで書く）",
      "properties": {
        "aperture": {
          "anyOf": [
            {
              "$ref": "#/$defs/SurfAperture"
            },
            {
              "type": "null"
            }
          ],
          "description": "開口（省略なら開口なし）"
        },
        "asph": {
          "default": [],
          "description": "偶数次非球面の係数 r², r⁴, …",
          "items": {
            "format": "double",
            "type": "number"
          },
          "type": "array"
        },
        "birefringent": {
          "anyOf": [
            {
              "$ref": "#/$defs/BireSpec"
            },
            {
              "type": "null"
            }
          ],
          "description": "複屈折材の板の入口・出口（OpticStudio の Birefringent In / Out）。入口の `glass` が常光の材料（異常光は 名前-E）"
        },
        "coat": {
          "default": "",
          "type": "string"
        },
        "comment": {
          "default": "",
          "type": "string"
        },
        "conic": {
          "default": 0.0,
          "format": "double",
          "type": "number"
        },
        "coordbrk": {
          "description": "座標ブレークの面: [dx, dy, tx, ty, tz]（曲率・ガラスは書かない）",
          "items": {
            "format": "double",
            "type": "number"
          },
          "maxItems": 5,
          "minItems": 5,
          "type": [
            "array",
            "null"
          ]
        },
        "glass": {
          "default": null,
          "description": "面の後のガラス（省略なら空気）。数字なら分散なしのモデルガラスの屈折率",
          "type": [
            "string",
            "null"
          ]
        },
        "ignore": {
          "description": "面を無視する（OpticStudio の Ignore This Surface。座標ブレークにも書ける）",
          "type": "boolean"
        },
        "jones": {
          "description": "Jones 行列の面（平面、OpticStudio の JONESMAT）: [Ar, Ai, Br, Bi, Cr, Ci, Dr, Di]",
          "items": {
            "format": "double",
            "type": "number"
          },
          "maxItems": 8,
          "minItems": 8,
          "type": [
            "array",
            "null"
          ]
        },
        "order": {
          "description": "座標ブレークの順序（0: 偏心してから傾き、1: 傾けてから偏心）",
          "format": "uint8",
          "maximum": 255,
          "minimum": 0,
          "type": "integer"
        },
        "polarizer": {
          "anyOf": [
            {
              "$ref": "#/$defs/PolarizerSpec"
            },
            {
              "type": "null"
            }
          ],
          "description": "直線偏光子の面（平面の Jones 面）"
        },
        "radius": {
          "default": null,
          "description": "曲率半径 [mm]（省略・0 なら平面）",
          "format": "double",
          "type": [
            "number",
            "null"
          ]
        },
        "radius_x": {
          "description": "トロイダル面の x 方向の曲率半径 [mm]（省略・0 なら円柱面）",
          "format": "double",
          "type": [
            "number",
            "null"
          ]
        },
        "row": {
          "anyOf": [
            {
              "$ref": "#/$defs/Row"
            },
            {
              "type": "null"
            }
          ],
          "description": "ほかの欄で書けない面（Zernike・Grid Sag・Irregular・Tilted・Binary 2・理想レンズ・GRIN の媒質・\ndn・disp など）を、システムファイル（版 2）の面の行で書く。書くときはほかの欄を書かない。絞りの印（stop）は\n書けない（ブロックの set_stop で）。玉の最後の面の厚さ・媒質は使わない"
        },
        "semi": {
          "$ref": "#/$defs/Semi",
          "default": 0.0,
          "description": "半直径 [mm]。\"auto\" なら光線から求める（OpticStudio の Automatic）"
        },
        "shape": {
          "$ref": "#/$defs/SurfShape",
          "description": "面の形（省略は標準面。`asph` があれば偶数次非球面）。`odd_asph` は `asph` が β1..β8（r¹..r⁸ の係数、\nOpticStudio の Odd Asphere）。`toroidal` は `radius`・`conic`・`asph` が y 方向の曲線で、x 方向の曲率半径が\n`radius_x`（省略・0 なら円柱面、OpticStudio の Toroidal）。`fresnel` は平面の上で、屈折だけ\n`radius`・`conic`・`asph` の面の傾きで決まる（OpticStudio の Fresnel）"
        },
        "t": {
          "default": 0.0,
          "description": "次の面までの厚さ（玉の最後の面では使わない）",
          "format": "double",
          "type": "number"
        },
        "tilt": {
          "description": "面だけの傾き [tx, ty] deg（頂点のまわり、後の面の座標は元に戻す。くさびのウィンドウなど）",
          "items": {
            "format": "double",
            "type": "number"
          },
          "maxItems": 2,
          "minItems": 2,
          "type": [
            "array",
            "null"
          ]
        },
        "waveplate": {
          "anyOf": [
            {
              "$ref": "#/$defs/WaveplateSpec"
            },
            {
              "type": "null"
            }
          ],
          "description": "波長板の面（平面の Jones 面、波長ごとに遅延を変える）"
        }
      },
      "type": "object"
    },
    "SurfaceEdit": {
      "additionalProperties": false,
      "description": "ブロックの面の値の上書き（[`FaceMods::surface_edits`]）。面はブロックの面のうち座標ブレークを除いて数えた\n番号（0 始まり。偏心・傾きの座標ブレークの有無で番号が変わらないように）。値は系の面の値（順次の面の値。\n鏡の後は厚さ・曲率の符号が逆）で、名前は [`lensbench_core::edit::SURF_FIELDS`]",
      "properties": {
        "coordbrk": {
          "description": "座標ブレークの面を指す（surface はブロックの面の座標ブレークだけを数えた番号。ブロックの偏心・傾きの座標ブレークは\n数えない。往復するブロックでは使えない）",
          "type": "boolean"
        },
        "fields": {
          "additionalProperties": true,
          "type": "object"
        },
        "surface": {
          "format": "uint",
          "minimum": 0,
          "type": "integer"
        }
      },
      "required": [
        "surface",
        "fields"
      ],
      "type": "object"
    },
    "SurfaceOp": {
      "description": "ブロックの `surface_ops` の操作（[`crate::FaceMods`]）: serve の `edit` の `set_stop`・`add_solve`・`add_pickup`・`remove_solve`・\n`remove_pickup` と同じ形で、面（`surface`・`dst`・`src`・`other`）はブロックの面 `{\"block\": id, \"surface\": i}` でも指せる\n（当てる面 `surface`・`dst` の番号はそのブロックの面）。\n`remove_*` はブロックの元（.zmx など）にあるソルブ・ピックアップを外す（無ければ当てずに注意）",
      "oneOf": [
        {
          "additionalProperties": false,
          "description": "面を絞りにする",
          "properties": {
            "op": {
              "const": "set_stop",
              "type": "string"
            },
            "surface": {
              "$ref": "#/$defs/BlockRef"
            }
          },
          "required": [
            "op",
            "surface"
          ],
          "type": "object"
        },
        {
          "additionalProperties": false,
          "description": "ソルブを置く",
          "properties": {
            "kind": {
              "description": "種類（既定 marginal_height、[`lensbench_core::solves::SOLVE_KINDS`]）",
              "type": [
                "string",
                "null"
              ]
            },
            "macro": {
              "anyOf": [
                {
                  "$ref": "#/$defs/Ref"
                },
                {
                  "type": "null"
                }
              ],
              "description": "種類 `macro_curv`・`macro_thick` のマクロの名前か番号（系のマクロ、プロジェクトでは `macros`）。書けば `param` より優先"
            },
            "op": {
              "const": "add_solve",
              "type": "string"
            },
            "other": {
              "anyOf": [
                {
                  "$ref": "#/$defs/BlockRef"
                },
                {
                  "type": "null"
                }
              ],
              "description": "別の面を参照する種類の面"
            },
            "param": {
              "anyOf": [
                {
                  "$ref": "#/$defs/Num"
                },
                {
                  "type": "null"
                }
              ],
              "description": "帯・縁の高さ（既定 0）。種類 `macro_curv`・`macro_thick` ではマクロの番号（`macro` で名前でも指せる）"
            },
            "surface": {
              "$ref": "#/$defs/BlockRef"
            },
            "value": {
              "anyOf": [
                {
                  "$ref": "#/$defs/Num"
                },
                {
                  "type": "null"
                }
              ],
              "description": "目標の値（既定 0）"
            }
          },
          "required": [
            "op",
            "surface"
          ],
          "type": "object"
        },
        {
          "additionalProperties": false,
          "description": "円錐係数・半直径・機械半径・面タイプのパラメータのマクロのソルブを置く",
          "properties": {
            "macro": {
              "$ref": "#/$defs/Ref",
              "description": "マクロの名前か番号（系のマクロ、プロジェクトでは `macros`。番号は 0 始まり）"
            },
            "op": {
              "const": "add_macro_solve",
              "type": "string"
            },
            "surface": {
              "$ref": "#/$defs/BlockRef"
            },
            "what": {
              "description": "解く量: `k`（円錐係数）・`semi`（半直径）・`mech`（機械半径）・`p1` …（面タイプのパラメータ）",
              "type": "string"
            }
          },
          "required": [
            "op",
            "surface",
            "macro",
            "what"
          ],
          "type": "object"
        },
        {
          "additionalProperties": false,
          "description": "ピックアップを置く",
          "properties": {
            "dst": {
              "$ref": "#/$defs/BlockRef",
              "description": "値を写される面"
            },
            "from": {
              "description": "元の量（省くと what）",
              "type": [
                "string",
                "null"
              ]
            },
            "offset": {
              "anyOf": [
                {
                  "$ref": "#/$defs/Num"
                },
                {
                  "type": "null"
                }
              ],
              "description": "足す値（既定 0）"
            },
            "op": {
              "const": "add_pickup",
              "type": "string"
            },
            "scale": {
              "anyOf": [
                {
                  "$ref": "#/$defs/Num"
                },
                {
                  "type": "null"
                }
              ],
              "description": "倍率（既定 1）"
            },
            "src": {
              "$ref": "#/$defs/BlockRef",
              "description": "元の面"
            },
            "what": {
              "description": "量（c r t k p1〜 dn disp semi before0〜4 after0〜4）",
              "type": "string"
            }
          },
          "required": [
            "op",
            "dst",
            "src",
            "what"
          ],
          "type": "object"
        },
        {
          "description": "ソルブを外す",
          "properties": {
            "op": {
              "const": "remove_solve",
              "type": "string"
            },
            "surface": {
              "$ref": "#/$defs/BlockRef"
            },
            "what": {
              "$ref": "#/$defs/SolveWhat",
              "default": "t"
            }
          },
          "required": [
            "op",
            "surface"
          ],
          "type": "object"
        },
        {
          "description": "ピックアップを外す",
          "properties": {
            "dst": {
              "$ref": "#/$defs/BlockRef"
            },
            "op": {
              "const": "remove_pickup",
              "type": "string"
            },
            "what": {
              "type": "string"
            }
          },
          "required": [
            "op",
            "dst",
            "what"
          ],
          "type": "object"
        }
      ]
    },
    "ThreadEnd": {
      "description": "機構部品の端のねじ",
      "properties": {
        "length": {
          "default": 0.0,
          "description": "ねじの長さ [mm]。オスのねじは相手のメスにこの長さだけねじ込む（部品が重なる）",
          "format": "double",
          "type": "number"
        },
        "male": {
          "description": "オス（外側のねじ）なら true、メス（内側のねじ）なら false",
          "type": "boolean"
        },
        "recess": {
          "description": "部品の端からねじの始まりまでの引っ込み [mm]（ケージ板のねじの穴の端が外形の端より奥にあるときなど）。\nつなぐとき、オスはこの分も奥へ入る",
          "format": "double",
          "type": "number"
        },
        "thread": {
          "description": "ねじの名前（\"SM1\" など）。つなぐ相手と同じ名前なら合う",
          "type": "string"
        }
      },
      "required": [
        "thread",
        "male"
      ],
      "type": "object"
    },
    "Tilt": {
      "additionalProperties": false,
      "description": "傾き・偏心（座標ブレーク・面の前後）",
      "properties": {
        "decenter": {
          "description": "偏心 x・y [mm]",
          "items": {
            "format": "double",
            "type": "number"
          },
          "maxItems": 2,
          "minItems": 2,
          "type": "array"
        },
        "order": {
          "description": "順序（0: 偏心 → X → Y → Z、1: Z → Y → X → 偏心）",
          "format": "uint8",
          "maximum": 255,
          "minimum": 0,
          "type": "integer"
        },
        "tilt": {
          "description": "傾き x・y・z [deg]",
          "items": {
            "format": "double",
            "type": "number"
          },
          "maxItems": 3,
          "minItems": 3,
          "type": "array"
        }
      },
      "type": "object"
    },
    "UserItem": {
      "description": "ユーザーカタログの項目（JSON の形）。光学の面（blocks、枠付きなら frame も）・機構部品（mech）・未完（missing）の\nどれか 1 つで、意味のない組み合わせは読むときに誤り（[`UserItem`] に直す）",
      "properties": {
        "blocks": {
          "default": [],
          "description": "光学の面（機構部品は空）",
          "items": {
            "$ref": "#/$defs/Block"
          },
          "type": "array"
        },
        "cad": {
          "$ref": "#/$defs/CadLinks",
          "description": "CAD データ（STEP・図面）の公式 URL"
        },
        "checked": {
          "description": "仕様を確かめた日（YYYY-MM-DD）",
          "type": "string"
        },
        "description": {
          "default": "",
          "type": "string"
        },
        "frame": {
          "anyOf": [
            {
              "$ref": "#/$defs/MechSpec"
            },
            {
              "type": "null"
            }
          ],
          "description": "枠付きの品（マウント済みのフィルタなど）の枠。`blocks` はガラスだけで、枠は z を枠の端から光の進む\n向きに書き、`holds.seat_z` にガラスの前面の位置を書く。プロジェクトに置くと、ガラスの最初の面に\n機構部品として付く（ケラレ・当たりの確認と描画）"
        },
        "frame_reversed": {
          "description": "枠の向き: false なら光は枠の z の小さい端から入り、true なら大きい端から入る（STEP から測った枠は STEP の\n座標の向きなので、図面の矢印などで決める）",
          "type": "boolean"
        },
        "glass_catalogs": {
          "default": [],
          "description": "項目の玉のガラスのカタログ（使うときに足す）",
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "kind": {
          "anyOf": [
            {
              "$ref": "#/$defs/ItemKind"
            },
            {
              "type": "null"
            }
          ],
          "description": "品の種類（一覧の分類。省略時はブロックから: 鏡・BS のブロック 1 つならそれ、ほかは玉）"
        },
        "mech": {
          "anyOf": [
            {
              "$ref": "#/$defs/MechSpec"
            },
            {
              "type": "null"
            }
          ],
          "description": "機構部品の寸法"
        },
        "missing": {
          "description": "未完の品の足りない値（`thickness`・`diameter`）。blocks の無い品で空でなければ、配置できない「未完の品」\nとして並べ、品ページの仕様表か STEP で補ってから使う（[`catalog_fill`]）",
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "notes": {
          "description": "データを作ったときのメモ（読めなかった欄など）",
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "source": {
          "description": "仕様の出典（資料・ページ）",
          "type": "string"
        },
        "specs": {
          "additionalProperties": true,
          "description": "仕様（名前 → 数・[下限, 上限]・文字列。名前の決まったものは `catalog_spec::SPEC_NAMES`）",
          "type": "object"
        },
        "tags": {
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "title": {
          "description": "品の名前（一覧のページの見出しなど）",
          "type": "string"
        },
        "url": {
          "description": "製品ページ",
          "type": "string"
        }
      },
      "type": "object"
    },
    "Value": {
      "anyOf": [
        {
          "format": "double",
          "type": "number"
        },
        {
          "description": "真偽（[`ConfigReader::flag`]。0・1 の数も受ける）",
          "type": "boolean"
        },
        {
          "type": "string"
        },
        {
          "description": "数の並び（角度 4 個など）",
          "items": {
            "format": "double",
            "type": "number"
          },
          "type": "array"
        }
      ],
      "description": "設定の値（系ファイルの JSON では数・真偽・文字列・数の並びをそのまま書く）"
    },
    "WaveplateSpec": {
      "description": "波長板: 速い軸 `axis_deg` に対する遅い軸の遅延。理想（材料なし）は (order + retardance)·wavelength_um/λ 波長。\n`material`（複屈折材、常光はガラス material、異常光は material-E）か `plates`（2 材の組など）があれば\n遅延は板ごとの Δn(λ)·d/λ。`material` で厚さを省くと、設計波長の遅延 order + retardance から決める",
      "properties": {
        "axis_deg": {
          "default": 0.0,
          "description": "速い軸の向き [deg]（x から y へ）",
          "format": "double",
          "type": "number"
        },
        "material": {
          "description": "複屈折材（1 枚の板。速い軸が `axis_deg`）",
          "type": [
            "string",
            "null"
          ]
        },
        "order": {
          "default": 0,
          "description": "多次の波長板の整数の次数（ゼロ次は 0）",
          "format": "uint32",
          "minimum": 0,
          "type": "integer"
        },
        "plates": {
          "description": "複屈折材の板の組（光の通る順。アクロマティック波長板は速い軸を直交させた 2 材など）",
          "items": {
            "$ref": "#/$defs/PlateSpec"
          },
          "type": "array"
        },
        "retardance": {
          "default": 0.0,
          "description": "設計波長での遅延 [波長]（λ/4 板は 0.25、λ/2 板は 0.5）。厚さを書いた板では使わない",
          "format": "double",
          "type": "number"
        },
        "thickness_mm": {
          "description": "`material` の板の厚さ [mm]（省略なら設計波長の遅延から）",
          "format": "double",
          "type": [
            "number",
            "null"
          ]
        },
        "transmittance": {
          "default": 1.0,
          "description": "強度透過率",
          "format": "double",
          "type": "number"
        },
        "wavelength_um": {
          "description": "設計波長 [µm]",
          "format": "double",
          "type": "number"
        }
      },
      "required": [
        "wavelength_um"
      ],
      "type": "object"
    },
    "ZernSag": {
      "description": "Zernike の矢高の項\n\nserde では内部の `groups` を書き出さず、読み直したら `coef` から作り直す。\n項の数が [`ZernSag::max_terms`] を超えるものは読み直しでエラーにする",
      "properties": {
        "coef": {
          "description": "項 1, 2, … の係数 [mm]",
          "items": {
            "format": "double",
            "type": "number"
          },
          "type": "array"
        },
        "dx": {
          "description": "Zernike の項の中心の偏心（Zern Decenter X・Y）[mm]",
          "format": "double",
          "type": "number"
        },
        "dy": {
          "format": "double",
          "type": "number"
        },
        "extrapolate": {
          "description": "正規化半径の外でも Zernike の項を使うか",
          "type": "boolean"
        },
        "fringe": {
          "description": "Fringe の順（規格化なし）か、Standard（Noll の順、規格化）か",
          "type": "boolean"
        },
        "norm": {
          "description": "正規化半径 [mm]",
          "format": "double",
          "type": "number"
        }
      },
      "required": [
        "fringe",
        "norm",
        "coef",
        "extrapolate",
        "dx",
        "dy"
      ],
      "type": "object"
    },
    "ZernikeShape": {
      "additionalProperties": false,
      "description": "Zernike Sag の形",
      "properties": {
        "a": {
          "description": "土台の偶数次非球面の係数",
          "items": {
            "format": "double",
            "type": "number"
          },
          "type": "array"
        },
        "c": {
          "format": "double",
          "type": "number"
        },
        "k": {
          "format": "double",
          "type": "number"
        },
        "terms": {
          "anyOf": [
            {
              "$ref": "#/$defs/ZernSag"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "type": "object"
    },
    "ZmxGroup": {
      "description": ".zmx の取り込みの中の群（玉モード）: 面 from〜to に始まる玉・鏡・面と、その間の空気",
      "properties": {
        "decenter": {
          "default": [
            0.0,
            0.0
          ],
          "description": "偏心 [mm]",
          "items": {
            "format": "double",
            "type": "number"
          },
          "maxItems": 2,
          "minItems": 2,
          "type": "array"
        },
        "from": {
          "format": "uint",
          "minimum": 0,
          "type": "integer"
        },
        "id": {
          "default": "",
          "type": "string"
        },
        "name": {
          "default": "",
          "type": "string"
        },
        "off": {
          "$ref": "#/$defs/OffMode",
          "default": "collapse"
        },
        "on": {
          "default": true,
          "type": "boolean"
        },
        "role": {
          "anyOf": [
            {
              "$ref": "#/$defs/Role"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "shift": {
          "default": 0.0,
          "description": "群の移動 [mm]。前の間隔の値（.zmx の厚さの向き）に足し、後の間隔から引く",
          "format": "double",
          "type": "number"
        },
        "surface_edits": {
          "description": "面の値の上書き",
          "items": {
            "$ref": "#/$defs/SurfaceEdit"
          },
          "type": "array"
        },
        "surface_ops": {
          "description": "面の絞り・ソルブ・ピックアップ。serve の `edit` の `set_stop`・`add_solve`・`add_pickup`・`remove_solve`・\n`remove_pickup` と同じ形で、`surface`・`dst` の番号はこのブロックの面（[`SurfaceEdit`] と同じ数え方）。\n`src`・`other` はほかのブロックの面 `{\"block\": id, \"surface\": i}` か系の面の番号・名前。\n往復するブロックは往路の面を指す",
          "items": {
            "$ref": "#/$defs/SurfaceOp"
          },
          "type": "array"
        },
        "tilt": {
          "default": [
            0.0,
            0.0,
            0.0
          ],
          "description": "傾き x・y・z [deg]（前面の頂点のまわり、x → y → z の順）",
          "items": {
            "format": "double",
            "type": "number"
          },
          "maxItems": 3,
          "minItems": 3,
          "type": "array"
        },
        "to": {
          "format": "uint",
          "minimum": 0,
          "type": "integer"
        }
      },
      "required": [
        "from",
        "to"
      ],
      "type": "object"
    }
  },
  "$id": "https://masa-iwm.github.io/lensbench/schema/v0.11/user-catalog.schema.json",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "description": "ユーザーカタログ（JSON）: 名前 → 保存した玉・ブロックの並び",
  "properties": {
    "$schema": {
      "description": "このファイルのスキーマ（エディタの補完・検査用。読むときは無視する）",
      "type": "string"
    },
    "coatings": {
      "additionalProperties": {
        "$ref": "#/$defs/CoatSpec"
      },
      "description": "カタログの品が使う膜（名前 → フィルタの透過特性・表）。品の面の `coat` に名前を書く",
      "type": "object"
    },
    "items": {
      "additionalProperties": {
        "$ref": "#/$defs/UserItem"
      },
      "default": {},
      "type": "object"
    },
    "overlay": {
      "additionalProperties": {
        "$ref": "#/$defs/Overlay"
      },
      "description": "同じメーカーのほかのカタログの品へ足す仕様・リンク: 型番のパターン（`*`・`?`）→ 中身",
      "type": "object"
    },
    "url_template": {
      "description": "品の url が無いときの製品ページ（`{part}` を型番に置き換える）。同じメーカーのほかのカタログ（ZMF・.zmx）の品にも当てる",
      "type": "string"
    },
    "vendor": {
      "description": "カタログブラウザに出すメーカー（空ならファイルのあるフォルダの名前）",
      "type": "string"
    },
    "version": {
      "default": 1,
      "format": "uint",
      "minimum": 0,
      "type": "integer"
    }
  },
  "title": "lensbench ユーザーカタログ",
  "type": "object"
}
