{
  "$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": "面の後の傾き・偏心"
    },
    "AimPupil": {
      "description": "光線エイミングの瞳のずれ・圧縮（[`super::Prescription::aim_pupil`]）。追跡には使わない",
      "properties": {
        "auto_shift": {
          "description": "ずれを自動で求める（Automatic pupil shifting）。None は書いていない（.zmx に書くときは 1）",
          "type": [
            "boolean",
            "null"
          ]
        },
        "compress": {
          "default": [
            0.0,
            0.0
          ],
          "description": "瞳の圧縮 x・y",
          "items": {
            "format": "double",
            "type": "number"
          },
          "maxItems": 2,
          "minItems": 2,
          "type": "array"
        },
        "scale_by_field": {
          "default": false,
          "description": "ずれを視野で倍率する（Scale Pupil Shift Factors By Field）",
          "type": "boolean"
        },
        "shift": {
          "default": [
            0.0,
            0.0,
            0.0
          ],
          "description": "瞳のずれ x・y・z（レンズ単位）",
          "items": {
            "format": "double",
            "type": "number"
          },
          "maxItems": 3,
          "minItems": 3,
          "type": "array"
        }
      },
      "type": "object"
    },
    "Aiming": {
      "description": "光線エイミング。JSON の名前は \"off\"・\"paraxial\"・\"real\"",
      "enum": [
        "off",
        "paraxial",
        "real"
      ],
      "type": "string"
    },
    "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"
        }
      ]
    },
    "ApertureKind": {
      "description": "系の開口の種類。JSON の名前は \"epd\"・\"fnum\"・\"na\"・\"float\"・\"pwfn\"・\"cone\"",
      "oneOf": [
        {
          "const": "epd",
          "description": "入射瞳径",
          "type": "string"
        },
        {
          "const": "fnum",
          "description": "像側 F 値",
          "type": "string"
        },
        {
          "const": "na",
          "description": "物体側 NA",
          "type": "string"
        },
        {
          "const": "float",
          "description": "絞り径（絞りの半直径）",
          "type": "string"
        },
        {
          "const": "pwfn",
          "description": "近軸作動 F 値",
          "type": "string"
        },
        {
          "const": "cone",
          "description": "物体側コーン角",
          "type": "string"
        }
      ]
    },
    "ApertureSpec": {
      "properties": {
        "type": {
          "$ref": "#/$defs/ApertureKind"
        },
        "value": {
          "default": 0.0,
          "format": "double",
          "type": "number"
        }
      },
      "required": [
        "type"
      ],
      "type": "object"
    },
    "Apodization": {
      "description": "瞳のアポダイゼーション（系の設定。.zmx の系の行 GFAC 係数 種類、OpticStudio の System Explorer の Aperture の\nApodization Type・Apodization Factor）。解析の瞳関数の振幅に常に入る（FFT PSF・Huygens PSF・回折 MTF）。\n\n式は OpticStudio のヘルプ（System Explorer > Aperture）の定義に合わせる:\n- Gaussian: 「瞳の上で振幅がガウス形に変わる。アポダイゼーション係数は振幅が瞳の半径の座標で減る速さ」。\n  振幅 A(ρ) = exp(−G ρ²)（ρ は正規化瞳の半径、G が係数。瞳の中心で 1）。G = 1 で縁の振幅が 1/e（強度 1/e²）、\n  強度が 1/e² になる半径は ρ₀ = 1/√G（ヘルプの例「係数 3 なら入射瞳の直径が 1/e² の幅の √3 倍」と同じ）。\n- Cosine Cubed: 「点光源が平面を照らすときの強度の落ち方」。強度 I(θ) = cos³θ（θ は z 軸と、入射瞳と交わる\n  光線の角）を瞳の中心で 1 に正規化（I/I_中心）。振幅は √I。θ は物点から近軸の入射瞳の面の点\n  (ρ_x r, ρ_y r)（r は入射瞳の半径）への向きで求める。無限遠物体ではどの光線も同じ向きなので一様になる。\n\nOpticStudio 26.1 と照合済み（Cooke 40 の Strehl が OS の FFT PSF 瞳 512 と 0.3% 以内。試験は解析的に確かめたもの）",
      "oneOf": [
        {
          "const": "uniform",
          "description": "一様（.zmx の GFAC _ 0）",
          "type": "string"
        },
        {
          "additionalProperties": false,
          "description": "ガウス A(ρ) = exp(−G ρ²)（GFAC G 1）",
          "properties": {
            "gaussian": {
              "format": "double",
              "type": "number"
            }
          },
          "required": [
            "gaussian"
          ],
          "type": "object"
        },
        {
          "const": "cosine_cubed",
          "description": "cos³θ の強度（GFAC _ 2）",
          "type": "string"
        }
      ]
    },
    "Arm": {
      "description": "経路の既定（文字を指定しないとき）",
      "enum": [
        "t",
        "r"
      ],
      "type": "string"
    },
    "Auto": {
      "enum": [
        "auto"
      ],
      "type": "string"
    },
    "AutoWord": {
      "description": "[`Semi::Auto`] の綴り \"auto\"",
      "enum": [
        "auto"
      ],
      "type": "string"
    },
    "Beam": {
      "additionalProperties": false,
      "description": "光束（[`Project::beams`]）: ビームスプリッターの経路 1 本に名前を付けたもの。経路を選ぶだけで、分岐比・膜・偏光は\n追跡で決まる。名前は状態の名前と同じ所（`--state`、干渉の光束など）で引ける",
      "properties": {
        "name": {
          "description": "光束の名前（状態の名前と重ならない）",
          "type": "string"
        },
        "off": {
          "description": "解析の既定の組から外す",
          "type": "boolean"
        },
        "path": {
          "description": "ビームスプリッターの経路（BS を通る順の T・R）。省略で状態・プロジェクトの path",
          "type": [
            "string",
            "null"
          ]
        },
        "role": {
          "anyOf": [
            {
              "$ref": "#/$defs/BeamRole"
            },
            {
              "type": "null"
            }
          ],
          "description": "役割（`sample`・`reference`・`stray`）"
        },
        "state": {
          "description": "この光束に当てる状態の名前（経路ごとに系の設定を変える）。省略で状態を当てない",
          "type": [
            "string",
            "null"
          ]
        },
        "turn": {
          "anyOf": [
            {
              "$ref": "#/$defs/BlockFace"
            },
            {
              "type": "null"
            }
          ],
          "description": "玉の面での部分反射で来た道を戻る（ゴーストの経路、干渉計の裏面反射など）。面の反射は境界（膜込み）の反射で、\n戻りは鏡の `back` と同じく前のブロックをたどり、BS では経路の文字で口を選ぶ。戻った先で系は終わる（像面）。\n玉（`lens` ブロック）の面だけ、1 か所"
        }
      },
      "required": [
        "name"
      ],
      "type": "object"
    },
    "BeamRole": {
      "description": "光束の役割（[`Beam::role`]）。表示の色と既定の組み合わせだけに使い、計算は変えない",
      "oneOf": [
        {
          "const": "sample",
          "description": "試料の光束（被検の系を通る）",
          "type": "string"
        },
        {
          "const": "reference",
          "description": "参照の光束",
          "type": "string"
        },
        {
          "const": "stray",
          "description": "迷光の経路",
          "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"
    },
    "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"
    },
    "Environment": {
      "description": "系の環境（[`Project::environment`]）。.zmx の ENVD（温度・気圧・屈折率の補正）と同じ",
      "properties": {
        "adjust_index": {
          "default": false,
          "description": "ガラスの屈折率を温度・気圧で補正する（OpticStudio の Adjust Index Data To Environment）",
          "type": "boolean"
        },
        "pressure_atm": {
          "default": 1.0,
          "description": "気圧 [atm]",
          "format": "double",
          "type": "number"
        },
        "temperature_c": {
          "default": 20.0,
          "description": "温度 [°C]",
          "format": "double",
          "type": "number"
        }
      },
      "type": "object"
    },
    "FieldKind": {
      "description": "視野の種類（[`FieldType`] の条件を除いたもの。プロジェクトの `fields.type`・系ファイル版 2 の `field.type` の名前）。\nJSON の名前は \"angle\"・\"object_height\"・\"paraxial_image_height\"・\"real_image_height\"・\"solve\"",
      "oneOf": [
        {
          "enum": [
            "angle",
            "object_height",
            "paraxial_image_height",
            "real_image_height"
          ],
          "type": "string"
        },
        {
          "const": "solve",
          "description": "条件で定める視野（[`FieldType::Solve`]）",
          "type": "string"
        }
      ]
    },
    "FieldNorm": {
      "description": "視野の正規化（瞳・視野の座標の 1 を何にとるか。.zmx の FTYP の 6 番目）。JSON の名前は \"radial\"・\"rect\"",
      "oneOf": [
        {
          "const": "radial",
          "description": "半径（最も遠い視野が 1）",
          "type": "string"
        },
        {
          "const": "rect",
          "description": "矩形（x・y の最大がそれぞれ 1）",
          "type": "string"
        }
      ]
    },
    "FieldSolveSpec": {
      "description": "条件で定める視野の条件。面は番号か名前（面のコメント）",
      "oneOf": [
        {
          "description": "面 surface での主光線の位置 = 視野の値",
          "properties": {
            "cond": {
              "const": "position",
              "type": "string"
            },
            "surface": {
              "type": "string"
            }
          },
          "required": [
            "cond",
            "surface"
          ],
          "type": "object"
        },
        {
          "description": "面 s1・s2 での主光線の方向余弦 (l, m) の和 = 視野の値（法線入射で戻るなら 0）",
          "properties": {
            "cond": {
              "const": "dir_sum",
              "type": "string"
            },
            "s1": {
              "type": "string"
            },
            "s2": {
              "type": "string"
            }
          },
          "required": [
            "cond",
            "s1",
            "s2"
          ],
          "type": "object"
        },
        {
          "description": "差（s1 − s2）= 視野の値",
          "properties": {
            "cond": {
              "const": "dir_diff",
              "type": "string"
            },
            "s1": {
              "type": "string"
            },
            "s2": {
              "type": "string"
            }
          },
          "required": [
            "cond",
            "s1",
            "s2"
          ],
          "type": "object"
        }
      ]
    },
    "FieldsSpec": {
      "properties": {
        "norm": {
          "$ref": "#/$defs/FieldNorm",
          "description": "視野の正規化（瞳・視野の座標の 1 を何にとるか。.zmx の FTYP の 6 番目）"
        },
        "points": {
          "description": "視野の (x, y)",
          "items": {
            "items": {
              "format": "double",
              "type": "number"
            },
            "maxItems": 2,
            "minItems": 2,
            "type": "array"
          },
          "type": "array"
        },
        "solve": {
          "anyOf": [
            {
              "$ref": "#/$defs/FieldSolveSpec"
            },
            {
              "type": "null"
            }
          ],
          "description": "type = solve のときの条件"
        },
        "type": {
          "$ref": "#/$defs/FieldKind",
          "default": "angle"
        },
        "vignetting": {
          "description": "視野ごとのケラレ係数 [VDX, VDY, VCX, VCY, VAN]（.zmx の VDXN〜VANN、VAN は度）。省略した視野は 0",
          "items": {
            "items": {
              "format": "double",
              "type": "number"
            },
            "maxItems": 5,
            "minItems": 5,
            "type": "array"
          },
          "type": "array"
        },
        "weights": {
          "default": [],
          "items": {
            "format": "double",
            "type": "number"
          },
          "type": "array"
        }
      },
      "required": [
        "points"
      ],
      "type": "object"
    },
    "GlassTemplate": {
      "description": "ガラス置換のテンプレート（OpticStudio の Glass Substitution Template、.zmx の GSTD）。最適化のガラスの置き換えの候補の\n絞り込みに使う（lensbench-design の `glass_sub`）。並びは GSTD と同じで、OpticStudio 2026 R1.01 で 1 欄ずつ確かめた",
      "properties": {
        "check": {
          "default": [
            true,
            true,
            true,
            true,
            true,
            true
          ],
          "description": "上限を確かめる性質（相対価格・CR・FR・SR・AR・PR、13〜18 番目）。上限が 0 以下なら確かめない",
          "items": {
            "type": "boolean"
          },
          "maxItems": 6,
          "minItems": 6,
          "type": "array"
        },
        "enabled": {
          "default": false,
          "description": "テンプレートを使う（GSTD の 1 番目）",
          "type": "boolean"
        },
        "exclude_incomplete": {
          "default": false,
          "description": "値の無い硝材を除く（Exclude Glasses With Incomplete Data、8 番目）",
          "type": "boolean"
        },
        "max": {
          "default": [
            100.0,
            100.0,
            100.0,
            100.0,
            100.0,
            100.0
          ],
          "description": "上限: 相対価格・耐候性 CR・耐汚染性 FR・耐酸性 SR・耐アルカリ性 AR・耐リン酸塩性 PR（2〜7 番目）",
          "items": {
            "format": "double",
            "type": "number"
          },
          "maxItems": 6,
          "minItems": 6,
          "type": "array"
        },
        "status": {
          "default": [
            true,
            true,
            false,
            false
          ],
          "description": "使ってよい状態: 標準・推奨・廃止・特殊（9〜12 番目。溶解は選べず、テンプレートを使うといつも除く）",
          "items": {
            "type": "boolean"
          },
          "maxItems": 4,
          "minItems": 4,
          "type": "array"
        }
      },
      "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"
    },
    "InputPolarization": {
      "description": "系の入射偏光（OpticStudio の System Explorer の Polarization、.zmx の POLS）: 膜・偏光を入れる解析（MTF・PSF・相対照度の\n`polarization`）の入射の偏光。既定は偏光なし（光線に垂直な面の正規直交の 2 つの偏光の平均）",
      "properties": {
        "jx": {
          "default": 0.0,
          "description": "電場の x・y の振幅（正規化しない。強度をそろえて使う）",
          "format": "double",
          "type": "number"
        },
        "jy": {
          "default": 1.0,
          "format": "double",
          "type": "number"
        },
        "phase_x": {
          "default": 0.0,
          "description": "x・y の位相 [deg]",
          "format": "double",
          "type": "number"
        },
        "phase_y": {
          "default": 0.0,
          "format": "double",
          "type": "number"
        },
        "unpolarized": {
          "default": true,
          "description": "偏光なし（true なら jx・jy・位相は使わない）",
          "type": "boolean"
        }
      },
      "type": "object"
    },
    "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": "玉の出どころ"
    },
    "Macro": {
      "description": "系に付けたマクロ（名前と文）。系ファイル（JSON）には文をそのまま入れ、戻すときにファイルは読まない",
      "properties": {
        "name": {
          "description": ".zmx に書かれた名前（拡張子なし）",
          "type": "string"
        },
        "source": {
          "description": "マクロの文（.ZPL の中身）",
          "type": "string"
        }
      },
      "required": [
        "name",
        "source"
      ],
      "type": "object"
    },
    "MechAt": {
      "additionalProperties": false,
      "description": "機構を置く基準の面（[`MechPlacement::at`]）",
      "properties": {
        "block": {
          "type": [
            "string",
            "null"
          ]
        },
        "surface": {
          "default": 0,
          "format": "uint",
          "minimum": 0,
          "type": "integer"
        }
      },
      "type": "object"
    },
    "MechOutline": {
      "description": "機構部品の簡易外形の形",
      "oneOf": [
        {
          "const": "round",
          "description": "丸（円柱）",
          "type": "string"
        },
        {
          "const": "square",
          "description": "角（正方形の柱、辺は部品の局所の x・y 軸に沿う）",
          "type": "string"
        }
      ]
    },
    "MechPlacement": {
      "additionalProperties": false,
      "description": "系に置く機構部品（[`Project::mechanics`]）。部品はユーザーカタログの品（`catalog`・`item`）か、\nその場で書いた寸法（`mech`）",
      "properties": {
        "after": {
          "description": "前に書いた機構部品（名前）の z の大きい端につなぐ（`at`・`seat` の代わり。同じ名前が複数あれば最後のもの）。\n前の部品と同じ面・傾きに置き、`offset` は前の部品の座標でのずれ、`tilt` は使えない。両方の部品の向き合う端に\nねじ（`front_thread`・`back_thread`）があれば、同じねじでオスとメスか確かめ、オスのねじの長さ（とメスの引っ込み）だけ重ねる",
          "type": [
            "string",
            "null"
          ]
        },
        "at": {
          "$ref": "#/$defs/MechAt",
          "description": "置く基準: ブロック id の面（座標ブレークを除いた 0 始まりの番号、省略で 0）か、系の面の番号（`surface` だけ）。\n`seat` なら省略できる（使わない）"
        },
        "catalog": {
          "description": "ユーザーカタログのファイル（プロジェクトのフォルダから）",
          "type": [
            "string",
            "null"
          ]
        },
        "holds": {
          "description": "保持する素子のブロック id。はみ出し・保持径を確かめる",
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "item": {
          "type": [
            "string",
            "null"
          ]
        },
        "mech": {
          "anyOf": [
            {
              "$ref": "#/$defs/MechSpec"
            },
            {
              "type": "null"
            }
          ]
        },
        "name": {
          "description": "名前（省略で品の名前か mech1, mech2, …）",
          "type": "string"
        },
        "offset": {
          "default": [
            0.0,
            0.0,
            0.0
          ],
          "description": "基準の面の局所座標でのずれ [dx, dy, dz] [mm]",
          "items": {
            "format": "double",
            "type": "number"
          },
          "maxItems": 3,
          "minItems": 3,
          "type": "array"
        },
        "reversed": {
          "description": "部品を裏返して置く（寸法の z の大きい端から光が入る。穴・座・両端のねじも入れ替わる）",
          "type": "boolean"
        },
        "seat": {
          "description": "部品の座（寸法の `holds.seat_z`）を、保持する最初の素子の前面に合わせて置く（`at` の代わり。`offset` は\nそこからのずれ）",
          "type": "boolean"
        },
        "tilt": {
          "default": [
            0.0,
            0.0
          ],
          "description": "傾き [tx, ty] [deg]（ずらした後、x → y の順）",
          "items": {
            "format": "double",
            "type": "number"
          },
          "maxItems": 2,
          "minItems": 2,
          "type": "array"
        }
      },
      "type": "object"
    },
    "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"
        }
      ]
    },
    "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"
        }
      ]
    },
    "State": {
      "description": "状態（多重構成に当たる）: 値の変更の組",
      "properties": {
        "name": {
          "type": "string"
        },
        "project": {
          "additionalProperties": true,
          "default": {},
          "description": "系の値（物体距離・開口・視野など、プロジェクトの JSON の項目名と値）",
          "type": "object"
        },
        "set": {
          "additionalProperties": {
            "additionalProperties": true,
            "type": "object"
          },
          "default": {},
          "description": "ブロックの id → 変える値（ブロックの JSON の項目名と値）。群・.zmx の中の群も id で指す",
          "type": "object"
        }
      },
      "required": [
        "name"
      ],
      "type": "object"
    },
    "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"
    },
    "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 では数・真偽・文字列・数の並びをそのまま書く）"
    },
    "VigInterp": {
      "description": "定義した視野以外の点のケラレ係数の求め方（[`System::vig_factors`]）",
      "oneOf": [
        {
          "const": "opticstudio",
          "description": "OpticStudio 2026 R1.01 と同じ（y だけの視野は r² で補間、ほかは L1 で最も近い視野の値。視野の間で段差になる）。\nOpticStudio と照合するとき",
          "type": "string"
        },
        {
          "const": "continuous",
          "description": "連続（既定、2026-11-13 masa 決定）: y だけの視野は r² で補間（外は最も外の視野の値。OpticStudio と同じ区間は\n同じ値）、ほかは視野の点の Delaunay 三角形分割で線形、外側は凸包の縁の最も近い点の値",
          "type": "string"
        }
      ]
    },
    "Wave": {
      "properties": {
        "um": {
          "format": "double",
          "type": "number"
        },
        "weight": {
          "default": 1.0,
          "format": "double",
          "type": "number"
        }
      },
      "required": [
        "um"
      ],
      "type": "object"
    },
    "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/project.schema.json",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "properties": {
    "$schema": {
      "description": "このファイルのスキーマ（エディタの補完・検査用。読むときは無視する）",
      "type": "string"
    },
    "afocal": {
      "description": "像空間をアフォーカルにする。値は角度の単位（`ur`・`mr`・`rr`・`as`・`am`・`dg`）",
      "type": [
        "string",
        "null"
      ]
    },
    "aim_pupil": {
      "$ref": "#/$defs/AimPupil",
      "description": "光線エイミングの瞳のずれ・圧縮（.zmx の PUSH と RAIM の 10 番目。追跡には効かない）。省略は全部 0"
    },
    "aiming": {
      "$ref": "#/$defs/Aiming",
      "default": "off"
    },
    "aperture": {
      "$ref": "#/$defs/ApertureSpec"
    },
    "apodization": {
      "$ref": "#/$defs/Apodization",
      "description": "瞳の振幅の分布（`\"uniform\"`・`{\"gaussian\": G}`・`\"cosine_cubed\"`。省略は一様）"
    },
    "beams": {
      "description": "光束の組（名前つきの経路）。光束の名前は状態の名前の代わりに使え、光束の状態を当てて経路を選んだ系になる",
      "items": {
        "$ref": "#/$defs/Beam"
      },
      "type": "array"
    },
    "blocks": {
      "items": {
        "$ref": "#/$defs/Block"
      },
      "type": "array"
    },
    "coating_file": {
      "description": "膜ファイル（OpticStudio の COATING.DAT の形）。面の `coat` の名前を、`coatings` に無ければこのファイルで引く。\n相対パスはプロジェクトのフォルダから、そこに無ければ材料の検索フォルダから。取り込んだ .zmx の膜ファイルより優先",
      "type": [
        "string",
        "null"
      ]
    },
    "coatings": {
      "additionalProperties": {
        "$ref": "#/$defs/CoatSpec"
      },
      "description": "膜（名前 → フィルタの透過特性・表）。面の `coat` に名前を書いて使う。ユーザーカタログの同じ名前より優先",
      "type": "object"
    },
    "environment": {
      "$ref": "#/$defs/Environment",
      "description": "温度・気圧（ガラスの屈折率の計算）。省略で 20 °C・1 atm・補正なし"
    },
    "fields": {
      "$ref": "#/$defs/FieldsSpec",
      "default": {
        "points": [
          [
            0.0,
            0.0
          ]
        ],
        "type": "angle",
        "weights": []
      }
    },
    "floating_clip": {
      "description": "浮動開口（半直径を固定した面）の外の光線をけるか（既定はける。OpticStudio と同じ）",
      "type": "boolean"
    },
    "format": {
      "description": "形式の印 \"lensbench-project\"。書くときはいつも付ける（省略したファイルは今の版として読む）",
      "type": [
        "string",
        "null"
      ]
    },
    "format_version": {
      "description": "形式の版（今は 1）。読める版より新しければ誤り",
      "format": "uint32",
      "minimum": 0,
      "type": [
        "integer",
        "null"
      ]
    },
    "glass_catalogs": {
      "default": [
        "SCHOTT"
      ],
      "items": {
        "type": "string"
      },
      "type": "array"
    },
    "glass_template": {
      "$ref": "#/$defs/GlassTemplate",
      "description": "ガラス置換のテンプレート（OpticStudio の Glass Substitution Template、.zmx の GSTD）。最適化のガラスの置き換えの候補を絞る"
    },
    "glrs": {
      "anyOf": [
        {
          "$ref": "#/$defs/BlockRef"
        },
        {
          "type": "null"
        }
      ],
      "description": "大域座標の基準の面（.zmx の GLRS。書き出し・3D の座標の原点）。ブロックの面 `{\"block\": id, \"surface\": i}` か、\n展開した系の面の番号か名前。省略で面 1"
    },
    "gui": {
      "description": "GUI が自分の編集の状態（組合せの表など）を残す欄。展開には使わない"
    },
    "image": {
      "anyOf": [
        {
          "$ref": "#/$defs/Row"
        },
        {
          "type": "null"
        }
      ],
      "description": "像面（省略は平面で傾きなし）。システムファイル（版 2）の面の行で、形・面の前の傾き偏心・開口などを書く。\n厚さ・媒質・絞りの印は書けない"
    },
    "input_pol": {
      "$ref": "#/$defs/InputPolarization",
      "description": "系の入射偏光（.zmx の POLS。膜・偏光を入れる解析の入射の偏光）。省略は偏光なし"
    },
    "macros": {
      "description": "ZPL のマクロ（名前 `name` と文 `source`、.ZPL の中身）。ブロックの `surface_ops` の `add_solve` で種類\n`macro_curv`・`macro_thick` の `param` にこの並びの番号（0 始まり）を書いて使う。マクロのファイルは読まない",
      "items": {
        "$ref": "#/$defs/Macro"
      },
      "type": "array"
    },
    "mech_clip": {
      "description": "機構部品（`mechanics`）の穴の外に出た光線を、解析の光線追跡でもけるか（既定はける。false ならけられは\n機構のケラレの解析だけで見て、レイアウト図では切られる点から後ろを薄く描く）",
      "type": "boolean"
    },
    "mechanics": {
      "description": "機構部品（チューブ・ケージ板・マウント）。光線の追跡は変えず、ケラレの確認（`mech-check`）と描画に使う",
      "items": {
        "$ref": "#/$defs/MechPlacement"
      },
      "type": "array"
    },
    "name": {
      "default": "",
      "type": "string"
    },
    "object": {
      "anyOf": [
        {
          "$ref": "#/$defs/Row"
        },
        {
          "type": "null"
        }
      ],
      "description": "物体面の形・開口・物体空間の媒質（省略は平面で開口なし・空気）。`image` と同じ面の行で、厚さは\n`object_distance`。`medium` は物体空間の媒質（液浸など）。厚さ・絞りの印・傾き偏心は書けない"
    },
    "object_distance": {
      "default": null,
      "description": "物体面から最初のブロックまで [mm]（省略で無限遠）",
      "format": "double",
      "type": [
        "number",
        "null"
      ]
    },
    "path": {
      "description": "ビームスプリッターの経路（BS を通る順の T・R）。省略で各 BS の arm。状態の project でも変えられる",
      "type": [
        "string",
        "null"
      ]
    },
    "primary": {
      "default": 1,
      "description": "主波長の番号（1 始まり）",
      "format": "uint",
      "minimum": 0,
      "type": "integer"
    },
    "ropd": {
      "description": "OPD の基準（.zmx の ROPD。省略は 2: 出射瞳の参照球）",
      "format": "int64",
      "type": "integer"
    },
    "states": {
      "default": [],
      "items": {
        "$ref": "#/$defs/State"
      },
      "type": "array"
    },
    "telecentric": {
      "description": "物体側テレセントリック（物体距離が有限のときだけ）",
      "type": "boolean"
    },
    "vig_interp": {
      "anyOf": [
        {
          "$ref": "#/$defs/VigInterp"
        },
        {
          "type": "null"
        }
      ],
      "description": "定義した視野以外の点のケラレ係数の求め方（`\"continuous\"`・`\"opticstudio\"`。省略は連続）"
    },
    "wavelengths": {
      "items": {
        "$ref": "#/$defs/Wave"
      },
      "type": "array"
    }
  },
  "required": [
    "wavelengths",
    "aperture",
    "blocks"
  ],
  "title": "lensbench プロジェクトファイル",
  "type": "object"
}
