{
  "version": "0.1.0",
  "slice": "fixture.clamp_unit",
  "unit_system": "mm | N | MPa | deg",
  "frame_note": "每个模块局部原点在其主安装面中心；Z 为功能方向（气缸=行程伸出，型材=长度，板=法向）。接口只引用命名 port，禁止引用第 N 个面。",
  "ontology": {
    "class_map": {
      "actuator.cylinder": "eq",
      "structure.profile": "eq",
      "plate.generated": "cad",
      "sensor.reed": "eq",
      "fastener.tnut": "mat",
      "joint.floating": "eq",
      "fixture.clamp_unit": "cad"
    },
    "station": "S2",
    "station_note": "18V 线 S2 定子入壳：压装时夹持壳体。对象 ID 与 org-capability 本体 L1 类对齐。"
  },
  "mate_types": [
    {
      "id": "thread_coaxial",
      "label": "螺纹同轴",
      "must_match": ["thread", "gender"]
    },
    {
      "id": "hole_pattern",
      "label": "孔系",
      "must_match": ["count", "pcd_mm", "thread"]
    },
    {
      "id": "t_slot",
      "label": "型材槽",
      "must_match": ["slot_mm"]
    },
    {
      "id": "face_flush",
      "label": "贴合面",
      "must_match": ["normal"]
    },
    {
      "id": "sensor_groove",
      "label": "磁开槽",
      "must_match": ["groove"]
    }
  ],
  "modules": [
    {
      "id": "MOD-CYL-ISO-C32-50",
      "kind": "actuator.cylinder",
      "role": "clamp_drive",
      "name": "ISO 紧凑气缸 Ø32×50",
      "standard": "ISO 21287 / 近似 ISO 15552 接口",
      "vendor": "SMC",
      "series": "CQ2B",
      "order_code": "CQ2B32-50DZ",
      "ontology": { "class_id": "eq", "layer": "L3" },
      "params": {
        "bore_mm": { "value": 32, "min": 32, "max": 32 },
        "stroke_mm": { "value": 50, "min": 50, "max": 50 },
        "pressure_mpa": { "value": 0.5, "min": 0.15, "max": 1.0 },
        "force_extend_n": { "value": 402, "min": 120, "max": 804, "note": "理论推力 @ 当前气压；0.5 MPa 时 402 N" },
        "body_wxh_mm": { "value": [45, 45] }
      },
      "ports": [
        {
          "id": "cap_flange",
          "label": "尾盖安装孔系",
          "mate": "hole_pattern",
          "spec": { "count": 4, "pcd_mm": 45.3, "spacing_mm": [32, 32], "thread": "M6", "gender": "female" },
          "frame": { "xyz_mm": [0, 0, 0], "rpy_deg": [0, 180, 0] },
          "axis": "Z-"
        },
        {
          "id": "rod_end",
          "label": "活塞杆外螺纹",
          "mate": "thread_coaxial",
          "spec": { "thread": "M10x1.25", "gender": "male", "length_mm": 12 },
          "frame": { "xyz_mm": [0, 0, 50], "rpy_deg": [0, 0, 0] },
          "axis": "Z+"
        },
        {
          "id": "switch_rail",
          "label": "缸筒磁开槽",
          "mate": "sensor_groove",
          "spec": { "groove": "C-slot", "count": 2 },
          "frame": { "xyz_mm": [22.5, 0, 25], "rpy_deg": [0, 0, 0] },
          "axis": "Z+"
        }
      ],
      "io": [
        { "id": "solenoid", "dir": "DO", "signal": "Y_CLAMP", "voltage": "24V", "note": "5/2 电磁阀伸出=夹紧" },
        { "id": "reed_extend", "dir": "DI", "signal": "X_CLAMPED", "via_port": "switch_rail" }
      ],
      "substitutes": [
        { "id": "MOD-CYL-ISO-C32-50-AT", "reason": "同孔系同杆螺纹，国产替换" },
        { "id": "MOD-CYL-ISO-C40-80", "reason": "推力/行程不够时升档" }
      ],
      "cad": {
        "backend": "cadquery",
        "generator": "cylinder_compact",
        "sw_config": "CQ2B32-50DZ",
        "library_step": null
      }
    },
    {
      "id": "MOD-CYL-ISO-C32-50-AT",
      "kind": "actuator.cylinder",
      "role": "clamp_drive",
      "name": "紧凑气缸 Ø32×50（亚德客）",
      "standard": "与 SMC CQ2 孔系互换",
      "vendor": "Airtac",
      "series": "SDA",
      "order_code": "SDA32x50",
      "ontology": { "class_id": "eq", "layer": "L3" },
      "params": {
        "bore_mm": { "value": 32, "min": 32, "max": 32 },
        "stroke_mm": { "value": 50, "min": 50, "max": 50 },
        "pressure_mpa": { "value": 0.5, "min": 0.15, "max": 1.0 },
        "force_extend_n": { "value": 402, "min": 120, "max": 804 },
        "body_wxh_mm": { "value": [45, 45] }
      },
      "ports": [
        {
          "id": "cap_flange",
          "label": "尾盖安装孔系",
          "mate": "hole_pattern",
          "spec": { "count": 4, "pcd_mm": 45.3, "spacing_mm": [32, 32], "thread": "M6", "gender": "female" },
          "frame": { "xyz_mm": [0, 0, 0], "rpy_deg": [0, 180, 0] },
          "axis": "Z-"
        },
        {
          "id": "rod_end",
          "label": "活塞杆外螺纹",
          "mate": "thread_coaxial",
          "spec": { "thread": "M10x1.25", "gender": "male", "length_mm": 12 },
          "frame": { "xyz_mm": [0, 0, 50], "rpy_deg": [0, 0, 0] },
          "axis": "Z+"
        },
        {
          "id": "switch_rail",
          "label": "缸筒磁开槽",
          "mate": "sensor_groove",
          "spec": { "groove": "C-slot", "count": 2 },
          "frame": { "xyz_mm": [22.5, 0, 25], "rpy_deg": [0, 0, 0] },
          "axis": "Z+"
        }
      ],
      "io": [
        { "id": "solenoid", "dir": "DO", "signal": "Y_CLAMP", "voltage": "24V" },
        { "id": "reed_extend", "dir": "DI", "signal": "X_CLAMPED", "via_port": "switch_rail" }
      ],
      "substitutes": [
        { "id": "MOD-CYL-ISO-C32-50", "reason": "原厂互换" }
      ],
      "cad": {
        "backend": "cadquery",
        "generator": "cylinder_compact",
        "sw_config": "SDA32x50",
        "library_step": null
      }
    },
    {
      "id": "MOD-CYL-ISO-C40-80",
      "kind": "actuator.cylinder",
      "role": "clamp_drive",
      "name": "ISO 紧凑气缸 Ø40×80",
      "standard": "ISO 21287",
      "vendor": "SMC",
      "series": "CQ2B",
      "order_code": "CQ2B40-80DZ",
      "ontology": { "class_id": "eq", "layer": "L3" },
      "params": {
        "bore_mm": { "value": 40, "min": 40, "max": 40 },
        "stroke_mm": { "value": 80, "min": 80, "max": 80 },
        "pressure_mpa": { "value": 0.5, "min": 0.15, "max": 1.0 },
        "force_extend_n": { "value": 628, "min": 188, "max": 1256 },
        "body_wxh_mm": { "value": [54, 54] }
      },
      "ports": [
        {
          "id": "cap_flange",
          "label": "尾盖安装孔系",
          "mate": "hole_pattern",
          "spec": { "count": 4, "pcd_mm": 56.6, "spacing_mm": [40, 40], "thread": "M6", "gender": "female" },
          "frame": { "xyz_mm": [0, 0, 0], "rpy_deg": [0, 180, 0] },
          "axis": "Z-"
        },
        {
          "id": "rod_end",
          "label": "活塞杆外螺纹",
          "mate": "thread_coaxial",
          "spec": { "thread": "M12x1.25", "gender": "male", "length_mm": 16 },
          "frame": { "xyz_mm": [0, 0, 80], "rpy_deg": [0, 0, 0] },
          "axis": "Z+"
        },
        {
          "id": "switch_rail",
          "label": "缸筒磁开槽",
          "mate": "sensor_groove",
          "spec": { "groove": "C-slot", "count": 2 },
          "frame": { "xyz_mm": [27, 0, 40], "rpy_deg": [0, 0, 0] },
          "axis": "Z+"
        }
      ],
      "io": [
        { "id": "solenoid", "dir": "DO", "signal": "Y_CLAMP", "voltage": "24V" },
        { "id": "reed_extend", "dir": "DI", "signal": "X_CLAMPED", "via_port": "switch_rail" }
      ],
      "substitutes": [],
      "cad": {
        "backend": "cadquery",
        "generator": "cylinder_compact",
        "sw_config": "CQ2B40-80DZ",
        "library_step": null
      }
    },
    {
      "id": "MOD-PRF-4040",
      "kind": "structure.profile",
      "role": "frame",
      "name": "欧标 4040 铝型材",
      "standard": "槽宽 8 mm",
      "vendor": "国产",
      "series": "4040",
      "order_code": "PRF-4040-L{length_mm}",
      "ontology": { "class_id": "eq", "layer": "L3" },
      "params": {
        "section_mm": { "value": [40, 40], "min": [40, 40], "max": [40, 40] },
        "slot_mm": { "value": 8, "min": 8, "max": 8 },
        "length_mm": { "value": 800, "min": 200, "max": 2000, "step": 10 }
      },
      "ports": [
        {
          "id": "slot_front",
          "label": "前槽（气缸侧）",
          "mate": "t_slot",
          "spec": { "slot_mm": 8, "tnut": "M8" },
          "frame": { "xyz_mm": [20, 0, 0], "rpy_deg": [0, 90, 0] },
          "axis": "X+"
        },
        {
          "id": "slot_back",
          "label": "后槽（线体侧）",
          "mate": "t_slot",
          "spec": { "slot_mm": 8, "tnut": "M8" },
          "frame": { "xyz_mm": [-20, 0, 0], "rpy_deg": [0, -90, 0] },
          "axis": "X-"
        }
      ],
      "io": [],
      "substitutes": [],
      "cad": {
        "backend": "cadquery",
        "generator": "profile_4040",
        "sw_config": "4040-L",
        "library_step": null
      }
    },
    {
      "id": "MOD-PLATE-CLAMP",
      "kind": "plate.generated",
      "role": "jaw_plate",
      "name": "夹紧安装板（非标件）",
      "standard": null,
      "vendor": "自绘",
      "series": "GEN",
      "order_code": "PLATE-CLAMP-{L}x{W}x{T}",
      "ontology": { "class_id": "cad", "layer": "L3" },
      "params": {
        "length_mm": { "value": 120, "min": 60, "max": 400, "step": 1 },
        "width_mm": { "value": 80, "min": 40, "max": 200, "step": 1 },
        "thickness_mm": { "value": 8, "min": 6, "max": 16, "step": 2 },
        "material": { "value": "Q235", "enum": ["Q235", "AL6061"] }
      },
      "ports": [
        {
          "id": "cyl_face",
          "label": "气缸安装面",
          "mate": "hole_pattern",
          "spec": { "count": 4, "pcd_mm": "from_bound_cylinder", "spacing_mm": "from_bound_cylinder", "thread": "M6", "gender": "through" },
          "frame": { "xyz_mm": [0, 0, 0], "rpy_deg": [0, 0, 0] },
          "axis": "Z+"
        },
        {
          "id": "drive_face",
          "label": "杆端连接面",
          "mate": "thread_coaxial",
          "spec": { "thread": "from_bound_cylinder", "gender": "female" },
          "frame": { "xyz_mm": [0, 0, 8], "rpy_deg": [0, 0, 0] },
          "axis": "Z+"
        },
        {
          "id": "jaw_face",
          "label": "夹持工件面",
          "mate": "face_flush",
          "spec": { "normal": "Z+" },
          "frame": { "xyz_mm": [0, 0, 8], "rpy_deg": [0, 0, 0] },
          "axis": "Z+"
        }
      ],
      "io": [],
      "substitutes": [],
      "cad": {
        "backend": "cadquery",
        "generator": "plate_rect_holes",
        "sw_config": null,
        "library_step": null,
        "drawn": true
      }
    },
    {
      "id": "MOD-SNS-REED-D-M9N",
      "kind": "sensor.reed",
      "role": "clamp_feedback",
      "name": "气缸磁性开关",
      "standard": "C 槽",
      "vendor": "SMC",
      "series": "D-M9N",
      "order_code": "D-M9N",
      "ontology": { "class_id": "eq", "layer": "L3" },
      "params": {
        "voltage": { "value": "24V", "enum": ["24V"] },
        "output": { "value": "NPN", "enum": ["NPN", "PNP"] },
        "wire": { "value": 3, "min": 2, "max": 3 }
      },
      "ports": [
        {
          "id": "groove",
          "label": "卡入磁开槽",
          "mate": "sensor_groove",
          "spec": { "groove": "C-slot" },
          "frame": { "xyz_mm": [0, 0, 0], "rpy_deg": [0, 0, 0] },
          "axis": "Z+"
        }
      ],
      "io": [
        { "id": "contact", "dir": "DI", "signal": "X_CLAMPED", "voltage": "24V" }
      ],
      "substitutes": [
        { "id": "MOD-SNS-REED-CS1", "reason": "亚德客配套" }
      ],
      "cad": {
        "backend": "cadquery",
        "generator": "reed_switch",
        "sw_config": "D-M9N",
        "library_step": null
      }
    },
    {
      "id": "MOD-SNS-REED-CS1",
      "kind": "sensor.reed",
      "role": "clamp_feedback",
      "name": "气缸磁性开关（亚德客）",
      "standard": "C 槽",
      "vendor": "Airtac",
      "series": "CS1-J",
      "order_code": "CS1-J",
      "ontology": { "class_id": "eq", "layer": "L3" },
      "params": {
        "voltage": { "value": "24V", "enum": ["24V"] },
        "output": { "value": "NPN", "enum": ["NPN", "PNP"] },
        "wire": { "value": 2, "min": 2, "max": 3 }
      },
      "ports": [
        {
          "id": "groove",
          "label": "卡入磁开槽",
          "mate": "sensor_groove",
          "spec": { "groove": "C-slot" },
          "frame": { "xyz_mm": [0, 0, 0], "rpy_deg": [0, 0, 0] },
          "axis": "Z+"
        }
      ],
      "io": [
        { "id": "contact", "dir": "DI", "signal": "X_CLAMPED", "voltage": "24V" }
      ],
      "substitutes": [
        { "id": "MOD-SNS-REED-D-M9N", "reason": "SMC 配套" }
      ],
      "cad": {
        "backend": "cadquery",
        "generator": "reed_switch",
        "sw_config": "CS1-J",
        "library_step": null
      }
    },
    {
      "id": "MOD-TNU-M8-40",
      "kind": "fastener.tnut",
      "role": "frame_fastener",
      "name": "4040 锤头螺母 M8",
      "standard": "槽 8",
      "vendor": "国产",
      "series": "T-NUT",
      "order_code": "TNU-M8-40",
      "ontology": { "class_id": "mat", "layer": "L3" },
      "params": {
        "thread": { "value": "M8" },
        "qty_default": { "value": 4, "min": 2, "max": 8 }
      },
      "ports": [
        {
          "id": "slot",
          "label": "嵌入型材槽",
          "mate": "t_slot",
          "spec": { "slot_mm": 8, "tnut": "M8" },
          "frame": { "xyz_mm": [0, 0, 0], "rpy_deg": [0, 0, 0] },
          "axis": "Z+"
        }
      ],
      "io": [],
      "substitutes": [],
      "cad": {
        "backend": "cadquery",
        "generator": "tnut_m8",
        "sw_config": null,
        "library_step": null
      }
    },
    {
      "id": "MOD-FLT-M10",
      "kind": "joint.floating",
      "role": "rod_joint",
      "name": "浮动接头 M10",
      "standard": null,
      "vendor": "SMC",
      "series": "JA",
      "order_code": "JA10-8-125",
      "ontology": { "class_id": "eq", "layer": "L3" },
      "params": {
        "thread_rod": { "value": "M10x1.25", "enum": ["M10x1.25", "M12x1.25"] },
        "thread_plate": { "value": "M8", "enum": ["M8", "M10"] }
      },
      "ports": [
        {
          "id": "to_rod",
          "label": "接活塞杆",
          "mate": "thread_coaxial",
          "spec": { "thread": "M10x1.25", "gender": "female" },
          "frame": { "xyz_mm": [0, 0, 0], "rpy_deg": [0, 180, 0] },
          "axis": "Z-"
        },
        {
          "id": "to_plate",
          "label": "接夹紧板",
          "mate": "thread_coaxial",
          "spec": { "thread": "M8", "gender": "male" },
          "frame": { "xyz_mm": [0, 0, 28], "rpy_deg": [0, 0, 0] },
          "axis": "Z+"
        }
      ],
      "io": [],
      "substitutes": [],
      "cad": {
        "backend": "cadquery",
        "generator": "floating_joint",
        "sw_config": "JA10-8-125",
        "library_step": null
      }
    },
    {
      "id": "MOD-FLT-M12",
      "kind": "joint.floating",
      "role": "rod_joint",
      "name": "浮动接头 M12",
      "standard": null,
      "vendor": "SMC",
      "series": "JA",
      "order_code": "JA12-10-125",
      "ontology": { "class_id": "eq", "layer": "L3" },
      "params": {
        "thread_rod": { "value": "M12x1.25", "enum": ["M12x1.25"] },
        "thread_plate": { "value": "M10", "enum": ["M8", "M10"] }
      },
      "ports": [
        {
          "id": "to_rod",
          "label": "接活塞杆",
          "mate": "thread_coaxial",
          "spec": { "thread": "M12x1.25", "gender": "female" },
          "frame": { "xyz_mm": [0, 0, 0], "rpy_deg": [0, 180, 0] },
          "axis": "Z-"
        },
        {
          "id": "to_plate",
          "label": "接夹紧板",
          "mate": "thread_coaxial",
          "spec": { "thread": "M10", "gender": "male" },
          "frame": { "xyz_mm": [0, 0, 32], "rpy_deg": [0, 0, 0] },
          "axis": "Z+"
        }
      ],
      "io": [],
      "substitutes": [],
      "cad": {
        "backend": "cadquery",
        "generator": "floating_joint",
        "sw_config": "JA12-10-125",
        "library_step": null
      }
    }
  ],
  "units": [
    {
      "id": "UNIT-CLAMP-PNEU-V1",
      "kind": "fixture.clamp_unit",
      "name": "气动夹紧单元 V1",
      "ontology": { "class_id": "cad", "layer": "L3", "station": "S2" },
      "roles": {
        "drive": { "kind": "actuator.cylinder", "required": true },
        "frame": { "kind": "structure.profile", "required": true },
        "plate": { "kind": "plate.generated", "required": true, "drawn": true },
        "sensor": { "kind": "sensor.reed", "required": true },
        "fastener": { "kind": "fastener.tnut", "required": true },
        "joint": { "kind": "joint.floating", "required": false }
      },
      "binds": [
        { "from": "drive.cap_flange", "to": "frame.slot_front", "via": "fastener.slot", "mate": "t_slot", "note": "气缸尾盖经锤头螺母上到型材前槽" },
        { "from": "drive.rod_end", "to": "joint.to_rod", "mate": "thread_coaxial", "optional_if_no": "joint" },
        { "from": "joint.to_plate", "to": "plate.drive_face", "mate": "thread_coaxial", "optional_if_no": "joint" },
        { "from": "drive.rod_end", "to": "plate.drive_face", "mate": "thread_coaxial", "skip_if": "joint" },
        { "from": "sensor.groove", "to": "drive.switch_rail", "mate": "sensor_groove" },
        { "from": "plate.jaw_face", "to": "WORKPIECE.clamp_face", "mate": "face_flush", "external": true }
      ],
      "select": {
        "safety": 1.25,
        "efficiency": 0.85,
        "approach_mm": 10,
        "plate_margin_mm": 20,
        "profile_extra_mm": 120
      }
    }
  ]
}
