AI CAD 原生工具契约 (AI SDK Tools)
AI CAD 原生工具契约 (AI SDK Tools)
Section titled “AI CAD 原生工具契约 (AI SDK Tools)”@aira/cad-tools 导出了供 AI Agent 交互调用的原生工具集。所有工具均基于 Vercel AI SDK 严格定义,具有机器强可读的 JSON Schema 校验与精确的执行语义。
核心工具一览
Section titled “核心工具一览”1. aira_model_read (模型只读查询)
Section titled “1. aira_model_read (模型只读查询)”在执行任何修改前,Agent 可通过该工具获取当前模型的空间结构、Body 实体树、草图特征和已有标注信息。
- 调用时机:任务开始时、规划前、或修改后的结果核查。
- 参数:
{"scope": "full" | "summary" | "bodies" | "parameters","bodyIds": ["body-1", "body-2"]}
- 返回:当前 Revision 的树形结构与几何摘要。
2. aira_compile_exact_plan (精确建模方案编译)
Section titled “2. aira_compile_exact_plan (精确建模方案编译)”将意图转化为参数化特征增量。Agent 输出一组 AMIR 特征算子(如拉伸、旋转、打孔、特征关联),系统在沙箱中进行拓扑合法性检验。
- 调用时机:构造新实体、增加草图特征、修改历史参数。
- 核心参数:
{"planId": "plan-uuid","operations": [{"type": "extrude","sketchId": "sketch-base","distance": 25.0,"symmetric": false}]}
3. aira_inspect_brep (拓扑与几何检验)
Section titled “3. aira_inspect_brep (拓扑与几何检验)”对生成的实体进行边界几何(B-Rep)与工程准入审计。
- 检验维度:
- 流形完整性(Manifold check)
- 自相交与退化边(Self-intersections & Degenerate Edges)
- 最小壁厚(Wall thickness verification)
- 几何体积与质心(Volume & Center of Mass)
4. aira_stage_brep (暂存与事务提议)
Section titled “4. aira_stage_brep (暂存与事务提议)”在模型正式提交(Commit)到主历史链之前,将生成的候选几何暂存到沙箱暂存区。允许 Agent 在正式定稿前进行并行的设计对比与微调。
5. standard_parts_tool 与 auto_match_holes (标准件与装配)
Section titled “5. standard_parts_tool 与 auto_match_holes (标准件与装配)”standard_parts_tool:检索符合 ISO/DIN/GB 规范的标准件(如螺栓、螺母、轴承)几何与材质参数。auto_match_holes:自动识别装配面上的螺孔阵列并生成精确同心、同轴的紧固件配合。
6. calculate_gear_pair_tool & fea_tool (工程计算与分析)
Section titled “6. calculate_gear_pair_tool & fea_tool (工程计算与分析)”calculate_gear_pair_tool:精确齿轮啮合参数设计(模数、齿数、压力角、中心距)。fea_tool:基于@aira/geometry-kernel的轻量有限元静力学与热力学应力分析。